kill(all)$

load: packages : to use ' lratsubst([,,],eq) '

load(lrats)$

eccentric anomaly (=E), relation of time of flight , 'version 1.0'
peter.vlasschaert@gmail.com,25/06/2018

fig 1 : with use ' GeoGebra ,paint ,maxima '

point : F     'peri - point '
point : Q    ' apo - point '
point : B,A 'two focuses'
distance : |QD| = aa , |DK| = a ,a=aa ,a ='radius of the circle ',semi-major axis
distance : |DL|=|DM| = b                                                          ,semi-minor axis
distance : |DB| =|AD|= a*e = c
triangle 'A'  : (D,K,Z),angle(K,D,Z) = E
triangle 'B'  : (B,Z,H),angle(H,B,Z) = θ
rem : e 'eccentricity'

def : 'eccentricity',ellipse = e = c/a
===========================

find : distance = | DB | = c

p1: e = c/a;
p1a: solve(p1,c)[1];

find : distance = |DZ| = DZ from triangle 'A' ,right triangle 'DZ'

p2:cos(E) =DZ/a;
p2a:solve(p2,DZ)[1];

find : distance = |DZ| = DZ from triangle 'B' ,right triangle 'BZ'

rem : DZ = |DZ| =|DB|+|BZ|

find ; BZ ?

p3:cos(θ) = BZ/r;
p3a:solve(p3,BZ)[1];

find: DB ?

p3b: DB =rhs(p1a);

find : DZ  ?

p3c:DZ = DB +BZ;

p3d: lhs(p3c) =rhs(p3b)+rhs(p3a);

relation between( triangle(A),triangle(B))

p4:rhs(p2a)=rhs(p3d);

see : ' time of flight' , polar equation,red = θ in the fig1

p5: r =p/(1+e*cos(θ));

rem : find 'p' for ellipse
show before : 'see website'
1e)  θ = 0   , r=r_p ( p = peri-point )
2e)  θ = π  , r=r_a ( a =  apo-point)
3e) def : r_a+r_p = 2*a => solve 'p'

p5a:p=a*(1-e^2);

p5b:subst([p5a],p5);

combination : r=polar equation and  'p4'
================================

p6:subst([p5b],p4);

p6a:ratsimp(p6);

assume(a>0);

find : cos(E) ?

p6b:factor(p6a)/a;

find : cos(θ) ?

p6c:solve(p6b,cos(θ))[1];

find : r=r(E) ? combine('p5b','p6b')

p7:subst([p6c],p5b);

p7a:ratsimp(p7);

p7b:factor(p7a);

?  find : E =E(e,θ)

we find : sin(E)  ?

rem : (sin(E))^2+ (cos(E))^2 = 1,basic goniometric .

p8:(sin(E))^2+ (cos(E))^2 = 1;

p8a:p6b^2;

p8b:lratsubst([p8a],p8);

p8c:solve(p8b,sin(E));

p8d:p8c[2];

p8d1:lratsubst([sqrt(1-cos(θ)^2)=sin(θ)],p8d);

p8e:trigsimp(p8d1);

ℏ;

find : tan(E) ?
==========

p9:tan(E) = rhs(p8e)/rhs(p6b);

rem : find ?  (tan(E/2))^2
===================

p10:cos(2*E);
p10a:trigexpand(p10);

rule: trignometric identity ?
------------------------------------------

p10b:(sin(E))^2=(1-(cos(E))^2);
p10c:(cos(E))^2=(1-(sin(E))^2);

p10d:p10=lratsubst([p10b],p10a);
p10e:p10=lratsubst([p10c],p10a);

p10f:solve(p10e,lhs(p10b))[1];
p10g:solve(p10d,lhs(p10c))[1];

? find : (tan(E))^2

p10h:(tan(E))^2 = rhs(p10f)/rhs(p10g);

? find : (tan(E/2))^2

p10i:lratsubst([E=E/2],p10h);

rem : cos(E) => 'p6b'

p11:lratsubst([p6b],p10i);

rem :construct : 'lhs' => (tan(θ/2))^2,E => θ ,into 'p10i'

p11a:subst([E=θ],p10i);

p11b: part(p11,2,1);
p11c: part(p11,2,2);

p11b1:factor(p11b);
p11c1:factor(p11c);

combination ( 'p11','p11b1,p11c1)

p12:lhs(p11) = p11b1/p11c1;

? find u  =  p11a ,'rhs'

p13: (1-e)/(1+e) *u =rhs(p12);

remove : minus sign , 'expand and combine'

p14:solve(p13,u);
p14a :expand(p14);
p14b:combine(p14a);

p15:lhs(p12) = lhs(p13);

p16:subst([u=lhs(p11a)],p15);

assume(θ>0,E>0);

p17:map(sqrt,p16);

p18:sqrt(lhs(p16)=rhs(p16));

p19:part(p18,1,1);

p19a:part(p18,2,1);
p19b:part(p18,2,2,1);

p20:p19=p19a*p19b;

p21:map(atan,p20);

rem : atan(tan(θ)) = θ
================

rule : see 'rem' , above

p22:atan(tan(ψ)) = ψ;

p23:subst([ψ=E/2],p22);

p24:rhs(p23)=rhs(p21);

p25:p24*2;

given : kepler equation ,time flight elliptical orbit

given : mean anomaly for the ellipse.

def : Kepler's equation .
===================
M_e = E-e*sin(E)

p26:M_e = rhs(p25)-e*rhs(p8e);

time flight (t= t_f),trough elliptical orbit.

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

p28:solve(p27,t)[1];

p29:subst([t=t_f,p26],p28);

t_f :Kepler's Equation 
=================

p30:t_f=(E-e*sin(E))*T/(2*%pi);

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