kill(all)$

load(lrats)$

rem : syntax : lratsubst([,,],equation), from packages ,load(lrats).

appendix :Max ranges trajectory  'version 1.0'
peter.vlasschaert@gmail.com,22/06/2018

p1:(2*sin(ψ/2))/Δbo-sin(ψ/2)=sin(ψ/2+2*η_bo);

rem : from 'geometry : trajectory of ballastic missile,part 2'

find : ψ ? from 'p1' ?   max range :∂ψ/∂η_bo =  0

How to find the max range : from 'p1'
rem : definition : sine function :  -1 ≤ sin(angle) ≤ 1
=> max value = 1 

1e)   lhs(p1) =1

p2:lhs(p1)  =1.0;

2e) rhs(p1) =1

p3:rhs(p1) = 1.0;

given : Δbo,ψ
============
find : η_bo ? single answer for this value ?
-------------------------------------------------------------------

p4:solve(p3,η_bo)$
p5:expand(p4);
p6:p5[1];

yes : we get single answer.
explain : only one value to get maximum range.

find Max range. with given Δbo.

p7:factor(p2);

p8:solve(p7,sin(ψ/2))$
p9:fullratsimp(p8);
p10:p9[1];

for : Max range condition.

determing lowest value :Δbo,given range ngle

p11:solve(p10,Δbo);

To make graph : ψ = ψ(η_bo), given :Δbo
================================

p12:solve(p10,ψ);
p13:p12[1];

p14:lratsubst([Δbo =.6] ,p13);
p15:float(p14);

angle : rad

p15a:lratsubst([ψ=ψ_max],p15);

degree :  conversion = 180°/π
max (ψ).

p16:conversion= 180/%pi;

 angle : deg  ,use conversion.

p17:lhs(p15a)= float(rhs(p16)*rhs(p15a));

corresponding ,η_bo  = max_ηbo,from 'p6'

p18:max_ηbo = lratsubst([ψ =ψ_max],rhs(p6));

angle : rad

p19:lratsubst([p15a],p18)$
p19a:float(p19);

angle :deg ,use conversion

p20:lhs(p18)=float(rhs(p19a)*rhs(p16));

result :Δbo =0.8 =>ψ_max = 83°,max_ηbo = 24°
rem : only one value for max_range.

to make :graph ψ = ψ(η_bo), given :Δbo =0.8
===================================

p21:lratsubst([Δbo =0.8],p1);

p22:solve(p21,η_bo);
p22a :p22[1];

p23:makelist(ψ =i/10*(π/2),i,0,10);

p24:lratsubst(p23[2],p22a);

p25:makelist(lratsubst(p23[i],p22a),i,1,length(p23));

p26:float(p25);

make function M : from 'p24' ,calculation  M(ψ) = number values for ,η_bo

p27:M(ψ) :=''p22a;

p28:float(M(1.459455312453933));

check : Max result : 'same p19a' = 0.4205343...., from 'ψ =' = 'p15'
==================================================

graph =>  η_bo = η_bo (ψ).
=====================

p29:lratsubst([ψ=ψ*rhs(p16)],rhs(p22a));

p30:y=float(rhs(p22a));

plot :  y = η_bo = rad, ψ = rad.
========================

wxplot2d([rhs(p22a)], [ψ,0,1.6], [y,0,0.43],
 [plot_format,xmaxima ])$

highst  values  on the graph :  last value = (ψ_max,max_ηbo).

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