kill(all)$
load(lrats)$
load(vect)$

launch dynamics to re-entery dynamics (no earth of rotation), 'version 1.0a',corrected
peter.vlasschaert@gmail.com,12/09/2018

see also website:
launch trajectories (no rotation of rotation),'version 1.0'

forces acting on the rocket. (L,G,D)

Why  γ negativ : see Figure γ below the local horizon  
s: along the earth 

see also : website 
----------------------------
Polar coordinates and Normal-Tangential coordinates ( = velocity),version 1.0

polar coordinates: (r,θ)
===================
θ      unit vectors       : e[θ]
 r     unit vectors       : e[r]
R : vector , r = radius

p1: 'diff(R,t) = 'diff(r,t)*e[r] + r*'diff(θ,t)*e[θ];

rem :  ref  x -axis : rotation trough angle of R : θ  , 'velocity'

p2: V = v*cos(γ)*e[θ] + v*sin(γ)*e[r];
p2a:rhs(p1) = rhs(p2);

coef : from  e[θ]
=============

p2b:coeff(p2a,e[θ]);

coef : from  e[r]
=============

p2c:coeff(p2a,e[r]);

see also : website 
----------------------------
rotating coordinates system,version 1.0

Why rotation of the system because : unit vectors (e[V],e[L]), change in position in space
--------------------------------------------------------------------------------------------------------------------------------------
(dV/dt)'fixed' = inertial part + noninertial part = (dV/dt)'moving'+ωxV
--------------------------------------------------------------------------------------------------------------------------------------
rem : x = 'cross product' between (ω,V)

1e) inertial part : acceleration
=========================

p3:[R = V,r=v,θ = γ, e[θ] =e[V],e[r] = e[L]];
p3a:subst(p3,p1)$
p3b:subst([e[γ]=e[L]],p3a);

2e) non inertial part : acceleration      cross( ω *V) =vec[ω] x V
===================================================

p4:V*vec[ω]=-e[L]*v*('diff(θ,t,1));

p4a:solve(p2b,('diff(θ,t,1)))[1];
p4b:subst([p4a],p4);

result :acceleration => Newton Law
-----------------------------------------------------
F = m*a = m*dV/dt

p5:a =(rhs(p3b)+rhs(p4b));

equation : Launch dynamics :  first order ODE's
=========================

===============================================
 r =r[e]+h , h = height above the earth
 γ, angle between(local horizon,vector: V)
 α,angle between(vector          V,vector: T)
 r[e],earth radius
 ρ = density medium ( density of air)
 C[L]  ,C[D] = constant 
 v    = velocity
 Afr = frontal area
 m  = mass rocket +propellant (change during the flight)
 g0 : 9.81 m/s^2 down acceleration under gravitation
 s : along the earth surface
T :thrust
===============================================

p6:'diff(v,t,1)=-(Afr*C[D]*v^2*ρ)/(2*m)-(r[e]^2*g0*sin(γ))/r^2+(T*cos(α))/m;
p6a:'diff(γ,t,1)=(Afr*C[L]*v*ρ)/(2*m)+(v*cos(γ))/r-(r[e]^2*g0*cos(γ))/(r^2*v)+(T*sin(α))/(m*v);
p6b:p2c;
p6c:'diff(s,t,1)=(r[e]*v*cos(γ))/r;
p6d:'diff(m,t,1)=-T/(g0*I[spc]);

use : p6c  not  => use : 'p4a'

p6e : p4a;

equation : re-entery dynamics :  first order ODE's
==========================================
γ ( = gamma ) = -γ
T (= thrust    ) = 0
m = constant =mr

p7:[γ =-γ,T=0,m=mr];
p7a:subst(p7,p6);
p7b:lhs(p6a) =subst(p7,rhs(p6a));
p7c:lhs(p6b) =subst(p7,rhs(p6b));
p7d:subst(p7,p6c);
p7e:subst(p7,p6d);

use : p6c  not  => use : 'p4a'

p7f:subst(p7,p6e);

rem :  we use general , launch dynamics equations with 
T = 0, m = mr,γ < 0.
math :      =>  If  γ < 0 then ( T = 0 , m=mr )

corrected : 'version 1.0a', v was lost ,'p6c', from : version 1.0 : 06/09/2018

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