kill(all)$

load("lrats")$

Orbital position as a function of 'time',(circle).  'version 1.0'
peter.vlasschaert@gmail.com,25/06/2018.

e< 1 : ellipse (= elliptical orbit)
e= 0 : circle   (= circular   orbit)

1e) relation between 'time' and 'θ' from polar equation.
h = r*(r*d0/dt) =r*v=r^2*dθ/dt 
===========================================

p1:dθ/dt = h/r^2;

2e) polar equation ( circle :  e= 0)
==========================

p2:r=p/(1+e*cos(θ));
p2a:ev( p2,e=0);;

 ? where peri-point 'polar equation 'p2'  ',lowest point

Answer :  e =0 ,r=r_p ,p = peri-point.
--------------------------------------------------------

p2a:lratsubst([r=r_p,e=0],p2);

? where apo-point 'polar equation 'p2'',highest point

Answer : θ = π,r=r_a , a = apo-point.
--------------------------------------------------------

p2b:lratsubst([r=r_a,e=0],p2);
p2c:expand(p2b);

 ? definition : ellips : 'r_a+r_p = 2*a '

p3:p2a+p2c;

p3a: rhs(p3) = 2*a;

find :  p ?, polar equation to draw , e ,a : given
=====================================

1e) p  ?
-----------

p3b:solve(p3a,p)[1];

find : factorout 'a' , 'p3c'

p3c:lhs(p)=coeff(rhs(p3b),a)*a;

2e)    given a,e  : draw 'r'
---------------------------------------

p3d:subst([p3c,e=0],p2);

rem :   p= h^2/μ = a*(1-e^2) ,other def's

Find : flight time in the orbit from the 'peri-point' as references.
================================================= =

1e) def ,from above
-------------------------------

p4:p=h^2/μ;

2e)  put 'p' into 'p2'
-----------------------------

p4a:subst([p4,e=0],p2);

3e) put  'r '  into 'p1'
-------------------------------

p4b:subst([p4a,e=0],p1);

p4c:p4b*dt;

rem : separation of variables =  'θ,t'
--------------------------------------------------------

coef:dθ
======

p5a:coeff(lhs(p4c),dθ);

coef:dt
=====

p5b:coeff(rhs(p4c),dt);

rem : integration t : t_p  to  t
         ==================
         integration θ : 0    to  θ
         ==================

symbolic : representation : flight time.
==============================
==============================

p6:'integrate(p5a,θ,0,θ) = 'integrate(p5b,t,t_p,t);

reference : t_p = 0; p  = peri-point .

p6a:subst([t_p=0],p6);

p6b:solve(p6a,t);

p6c:p6b[1];

from : integral ellipse 'website: part : rocket science'
 e < 1,q=tan(x/2)

time of flight ( = t_f): when the orbit circle
==================================
==================================

ref : like orientation geometric circle : pos-x-axis

given : website 'integral circle'

p7:'integrate(1/(a1*cos(x)+a2)^2,x,0,x)=(2*a2*atan((sqrt(a2-a1)*q)/sqrt(a2+a1))-(a1*sqrt(a2^2-a1^2)*sin(x))/(a1*cos(x)+a2))/(a2^2-a1^2)^(3/2);

solve 'p6c' elliptical orbit. 
====================
a1 = e
a2 = 1
x   = θ
q = tan(θ/2)
====================
e =eccentricity = 0  :cirrcle
θ = true anomaly. ( = polar equation)
=============================

p7a:[a1=e,a2=1,x=θ,q=tan(θ/2),e=0];

p7b:subst(p7a,p7);

p7c: [t=t_f];

p7d:subst(p7c,p6c);

relation : between flight time (circle orbit) and radius ( = r)
==============================================
==============================================

p7e:lratsubst([rhs(p4a)=lhs(p4a)],p7d);

from 'p4a'

p7f:p4a;

p7g:solve(p7f,h);
p7h:[p7g[2]];

p7i:lratsubst(p7h,p7d);

assume(μ>0,r>0);

p7j:lhs(p7i)=ratsimp(rhs(p7i));

because : circle ( special case ellipse where two focuses fall together) =
 radius ( = circle) of polar equation.
=========================================================

ellipse :  M_e/(2*π) = t/T, before 'see website'
===================================

p8:M_e/(2*%pi) = t/T;

circle : θ/(2*π) = t/T

p8a:θ/(2*π) = t/T;

find : relation between('p8','p8a')
==========================

p9:solve(p8,M_e)[1];

p9a:solve(p8a,θ)[1];

result : mean anomaly
==================

p9b:lhs(p9)=lhs(p9a);

M_e =  mean anomaly for the ellipse
θ      =  mean anomaly for the circle
=============================

------------------------------------------------------------------------------------------------------------------------------------------------------------------