how is the tension in the string calculated?

My understanding:

T = m*v*v/r; // added lookang for tension only work for circular motion

my hypothesis:

T1 = m*v*v/r + m*dvr/dt ? // radial acceleration due to tangential change in velocity and radial acceleration due to radial change in velocity ?

where dvr/dt = (cst*cst/(m*r*r*r)-M*g)/m

My equation:

T1 = m*v*v/r +(cst*cst/(m*r*r*r)-M*g) ;

can help take a look if my equation of Tension is correct ?

did i get the generalized equation for tension in any elliptical motion?

the logic seems correct and i implement the equation looks correct. is it correct conceptually in the absence of frictional forces :)