kill(all)$

load("lrats")$

number of stages of 'rocket',parameters,version 1.0
peter.vlasschaert@gmail.com,28/07/2018.

example :  n=3, M1=0 : detached from the rocket (after burn-out and removed ).
==================================================================

p1:A=(M[1]+M[2]+M[3]+P)/(M[2]+M[3]+P);
p2:A=y/x;
p2a:x=part(p1,2,2);
p2b:y=part(p1,2,1);

definition : μ  'example'

p3:μ =rhs(p2b)/((1-ε)*M[1]+M[2]+M[3]+P);

p4: part(p3,2,1);
p4a:part(p3,2,2);

p5:lhs(p3)*p4a= part(p1,2,1) ;

p6:lhs(p5)-rhs(p5)=0;

p7:expand(p6);

coef : M[i],i=1,2,3  ; P

p8a:ratcoeff(lhs(p7),M[1]);
p8b:ratcoeff(lhs(p7),M[2]);
p8c:ratcoeff(lhs(p7),M[3]);
p8d:ratcoeff(lhs(p7),P);

p9a:(-1)*p8a;
p9b:p8b;
p9c:p8c;
p9d:p8d;

p10:M[1]*p9a =p8b*part(p2,2,2);

p11:1/p10*M[1];

 calculation :  (μ-1) : function(M[1,M[2],M[3],P)
======================================

p12: p8b=ratsimp(rhs(p3)-1);

p13:lhs(p11)=subst([p12],rhs(p11));

p14:p13*ε;

p15:p5/μ;

p16:lhs(p14)=lratsubst([p15],rhs(p14));
p16a:p2b;

p17:lhs(p14)=subst([rhs(p16a)=lhs(p16a)],rhs(p16));

p18:p17*μ;

p19:lhs(p18)=lratsubst([rhs(p2)=lhs(p2)],rhs(p18));

general equation : when first stage burn-out
=====================================

p20:subst([p1],p19);

example :  n=3
==============
=>   M[k],k=1,2,3
=>   P
==============
parameters :μ,ε

p21:rhs(p20)=lhs(p20);

definition : μ when n=3

p22:p3;

M0=M[1]+M[2]+M[3]
M0: initial mass of rocket with three stages and payload = P
==================================================
get : l1,l2,l3

p23:M[1]+M[2]+M[3]=M0;

p23a:l1=(M[1]+M[2]+M[3]+P)/(M[2]+M[3]+P);
p23b:l2=(M[2]+M[3]+P)/(M[3]+P);
p23c:l3=(M[3]+P)/(P);

l=l1*l2*l3,product

p24:l=rhs(p23a)*rhs(p23b)*rhs(p23c);

p25:lratsubst([p23],p24);

rem : 'p21' and 'p23a'

p26:p21;
p26a:p23a;

p26b:subst([rhs(p26a)=lhs(p26a)],p26);

l1 => ε1,μ1 by definition.

p27:subst([ε=ε1,μ=μ1],p26b);

 n 'stages' rocket  ?    ( 'general equations ' )
=====================================

Before  l[i]  => ε[i],μ[i]   ;  i=1,2,....,n

p28:l[i] :=(ε[i]*μ[i])/(1-(1-ε[i])*μ[i]);

p28a:ll(i,n) :=(sum(M[j],j,i,n)+P)/(sum(M[j],j,i+1,n)+P);

take n:3 into ll(i,n) 
===============
i=1 : first        stage
i=2: second  stage
i=3 : third      stage
===============

p28a1:ll(1,3);
p28a2:ll(2,3);
p28a3:ll(3,3);

How to get :  ratio = (initial mass of the rocket + P)/P;
rem : initial mass of the rocket without the payload = P

same : 'p24' and 'p25'

p29:ratio(n):=product(ll(k,n), k, 1, n);

for n=3, three stages rocket

p29a:ratio(3);

M0 : initial mass of rocket at  time ( t=0)
================================

p30: subst([n=m],sum(M[k],k,1,n))=M0;

example  m = 3, for three stages

p30a:subst([m=3],p30);

p30b:ev(p30a,sum);

general m= n ,for  n stages rocket

p31:Ratio = lratsubst([p30b],p29a);

we want combine : 'p31' and sum('p28',i,1,n)
=====================================

p32: rhs(p31) =product(l[k],k,1,n);

rem : used to find optimal stages of 'rocket '.(optimization)
           ============================================

definition :ε[k]
============
  ε :  0 < ε[k] < 1
rem : typical value : ε[k] =0.8, for rocket

rem : ε[1] *M[1] = fuel inside M[1] ,' first        stage'
           ε[2] *M[2] = fuel inside M[2] ,' second stage'
          ----------------------------------------------------------------
           ε[k] *M[k] = fuel inside M[k] ,' k             stage'

definition : μ[k]
=============

p32a:μ[k] = (sum(M[i],i,k,n)+P)/((1-ε[k])*M[k]+sum(M[j],j,k+1,n)+P);

result : 'p32' and 'p32a'
===================

p33:subst([p32a],p32);

p33a:ratsimp(p33);

general equations for v[k],see : one stage ,double stage rocket : website.

p34:v[k] = c[k]*log(μ[k]);

with use definition 'above',μ[k]

velocity increase : k stage burn
==========================

p34a:subst([p32a],p34);

increase of velocity : all n stages are burnt one after another = v[toti]
i=1,2

first definition :
============

p34b:v[tot1]=sum(rhs(p34a),k,1,n);

second definition :
=============== 

p34c:v[tot2]=sum(rhs(p34),k,1,n);

p34d:lhs(p34c)-rhs(p34c) = 0;

rem : used to find optimal stages of 'rocket'. (optimization)
          ============================================
use :  'p34d'

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