kill(all)$

rocket  science (cannon ball ,rotating earth:ω) ,version 2.0correct
peter.vlasschaert@gmail.com,03/06/2018

rem : Max height (include ,t= tmax);

depends([x,y,z],t);

diff .eq for rotating earth ,components

p1:'diff(x,t,2)-2*ω*'diff(y,t,1)*sin(λ) = Fx/m;
p2:'diff(y,t,2)+2*ω*('diff(x,t)*sin(λ)+'diff(z,t)*cos(λ))=Fy/m;
p3:'diff(z,t,2)-2*ω*'diff(y,t,1)*sin(λ) = -g+Fz/m;

rem :λ = lattitude, north pole : λ=π/2,south pole : λ=-π/2

intial condition= ic : x(0=y(0)=z(0) =0,   x'(0) = u0,y'(0) = v0,z'(0) = w0 for above  'diff eq'.
free particle  :  z=h, F[x] = F[y]=F[z] =0,ω = constant .

1e)  integrate 'p1' and  y = v0*t , find  %c1 'from  ic,t=0

p1a:integrate(ev(p1,y=v0*t),t);

p2a:ev(p1a,y=0,diff(x,t)=u0,Fx=0);

p3a:ev(p1a,rhs(p2a)=lhs(p2a),Fx=0);

p4a:solve(p3a,'diff(x,t))[1];

2e)  integrate 'p3' and y=v0*t,find  %c2 'from ic ,t=0

p1c:integrate(ev(p3,y=v0*t),t);

p2c:ev(p1c,y=0,diff(z,t)=w0,Fz=0,t=0);

p3c:solve(p2c,%c2)[1];

p4c:ev(p1c,p3c,Fz=0,%);

p5c:solve(p4c,'diff(z,t))[1];

3e)  subst  p4a,p5c into 'p2'

p1b:ev(p2,p4a,Fy=0,p5c);

p2b:solve(p1b,'diff(y,t,2))[1];

p3b:ratsimp(p2b);

coeff ' rhs' from 'p3b' ,ω,ω^2, want to remove 'ω^2' 

p4b1:coeff(rhs(p3b)=0,ω);
p4b2:coeff(rhs(p3b)=0,ω^2);

p5b:ev(p3b,p4b2);

3e)  integrate 'p1' find  %c3 'from ic,t=0

p6b:integrate(p5b,t);

p7b:ev(p6b, diff(y,t)=v0,t=0);

p8b:solve(p7b,%c3)[1];

p9b:ev(p6b,p8b);

three diff.eq (velocity components): dx/dt=diff(x,t),dy/dt=diff(y,t),dz/dt=diff(z,t).

p10a:p4a;
p10b:p9b;
p10c:p5c;

when : earth not rotating : ω = 0

p10a1:ev(p10a,ω=0);
p10b1:ev(p10b,ω=0);
p10c1:ev(p10c,ω=0);

find r(x(t),y(t),z(t)) : x=x(t),y=y(t),z=z(t).

p11a :ev(integrate(p10a,t),x=x(t));
p11b :ev(integrate(p10b,t),y=y(t));
p11c :ev(integrate(p10c,t),z=z(t));

p12a:solve(ev(p11a,t=0),%c4)[1];
p12b:solve(ev(p11b,t=0),%c5)[1];
p12c:solve(ev(p11c,t=0),%c6)[1];

p13a:ev(p11a,p12a);
p13b:ev(p11b,p12b);
p13c:ev(p11c,p12c);

when : earth not rotating  :  ω = 0

p14a: ev(p13a,ω=0);
p14b: ev(p13b,ω=0);
p14c: ev(p13c,ω=0);

fire : cannon x(0) =y(0)=z(0) =0 , ω ≠ 0

p15a:ev(p13a,x(0)=0,y(0)=0,z(0)=0);
p15b:ev(p13b,x(0)=0,y(0)=0,z(0)=0);
p15c:ev(p13c,x(0)=0,y(0)=0,z(0)=0);

time for cannon ball , plane with  z=z(t)=0 ( hit ground , xy plane)   , t=tz

a)  z(t) = 0  then   t=tz

p16a:ev(p15c,z(t)=0,t=tz);

p16b:solve(p16a,tz);

time to travel from x(0)=y(0)=z(0)=0 (source,z=0)  to  hit xy plane again (target,z=0) ,t=tz

p16b1:p16b[1];

where : we hit  xy plane. (z=0)
hit target : position (x_hitω,y_hitω,0), 'p15a,p15b'

p17a:ev(p15a,t=tz);
p17b:ev(p15b,t=tz);

p18a: x_hitω = ratsimp(ev(rhs(p17a),p16b1));
p18b: y_hitω = ratsimp(ev(rhs(p17b),p16b1));

p19a:ev(p18a,y=y_hitω);
p19b:ev(p18b,y=y_hitω);

when : earth not rotating ,ω = 0 , hit 'xyplane'  
hit target : position(x_hitωc,y_hitωc,z=0),'p21a,p21b'

p22a:ev(p19a,ω=0);
p22b:ev(p19b,ω=0);

angle cannon (α,β,γ) , initial speed of the cannon = vv0

What  u0 = vv0*cos(α)
            v0 = vv0*cos(β)
            w0 = vv0*cos(γ)
rem : (vv0)^2  = u0^2+v0^2+w0^2
rem : (cos(α))^2+(cos(β))^2+(cos(γ))^2 = 1

p23a:u0=vv0*cos(α);
p23b:v0= vv0*cos(β);
p23c:w0=vv0*cos(γ);

1e)  ω ≠ 0

p24a:ratsimp(ev(p19a,p23a,p23b,p23c));
p24b:ratsimp(ev(p19b,p23a,p23b,p23c));
p24c:ev(p16b,p23a,p23b,p23c)[1];

2e)  ω = 0

p25a:ratsimp(ev(p22a,p23a,p23b,p23c));
p25b:ratsimp(ev(p22b,p23a,p23b,p23c));

How to find Max height : cannon ball, dz/dt = 0 , time get their : t=tmax

p26a:p10a;
p26b:p10b;
p26c:p10c;

1e)  dz/dt = 0 ,t= tmax

p27a:ev(p26c,'diff(z,t)=0,t=tmax);

2e) find :'tmax', first we need y 'p15b'

p27b:solve(p27a,tmax)[1];

p27d:ratsimp(ev(p27b,y=rhs(p27c)));
p27e:ev(p27d,p23a,p23b,p23c);

position Max height (x_max,y_max,z_max)  ? t=tmax into 'p15a,p15b,p15c'

p28a:ev(p15a,t=tmax)$
p28a1:x_max=ev(rhs(p28a),p27g1);
p28b:ev(p15b,t=tmax)$
p28b1:y_max=ev(rhs(p28b),p27g1);
p28c:ev(p15c,t=tmax)$
p28c1:z_max=ev(rhs(p28c),p27g1);

Max height : position(x_max,y_max,z_max)

p29a:ratsimp(ev(p28a1,p23a,p23b,p23c));
p29b:ratsimp(ev(p28b1,p23a,p23b,p23c));
p29c:ratsimp(ev(p28c1,p23a,p23b,p23c));

whem :ω =0

p30a:ratsimp(ev(p29a,ω=0));
p30b:ratsimp(ev(p29b,ω=0));
p30c:ratsimp(ev(p29c,ω=0));

What : velocity Max height , dz/dt =0=vz_max = 0
tmax  'p27g1';xmax,ymax  'p29a,p29b' ? vx_max,vy_max

p31a:p10a;
p31b:p10b;
p31c:p10c;

p32a:vx_max = ev(rhs(p31a),y=y_max,t=tmax,p23a,p23b,p23c)$
p32a1:lhs(p32a)=ratsimp(ev(rhs(p32a),p30b,p27g1));
p32b:vy_max = ev(rhs(p31b),y=y_max,t=tmax,p23a,p23b,p23c)$
p32b1:lhs(p32b)=ratsimp(ev(rhs(p32b),p30b,p27g1));
p32c:vz_max = 0;

ω = 0

p33a:ev(p32a1,ω=0);
p33b:ev(p32b1,ω=0);
p33c:p32c;

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