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

Introduction Mach number (= M),'version 1.0'
peter.vlasschaert@gmail.com,28/08/2018.

coninuity equation :
=================

m[i] = mass     'i' ,  i=1,2,3,...     , [kg]
ρ [i] = density 'i' ,  i = 1,2,3,.....  ,[kg/m^3]
v [i]  = velocity 'i' , i=1,2,3,....     ,[m/s]
A [i] = surface 'i'  , i=1,2,3,....     ,[m^2]
V [i] = Volume 'i'  , i=1,2,3,...      ,[m^3]

p1: 'diff(m[i],t) = ρ[i]*A[i]*v[i];

inflow     : i=1  tube   , units  [kg/s]
outflow   : i=2  tube  , units   [kg/s]
---------------------------------------------------
[kg/s] =[m^2]*[m/s]*[kg/m^3]
---------------------------------------------------

p2: subst([i=1],p1);
p2a:subst([i=2],p1);

p3:lhs(p2)=lhs(p2a);
p3a:rhs(p2) = rhs(p2a);

momentum equation :  
==================
math : F = m*a = m*dv/dt =mass*acceleration,[N]
-------------------------------------------------------------------------
P[i] = pressure 'i', i =1,2,3,....,[N/m^2]
-------------------------------------------------------------------------
F= P*A = pressure*surface
-------------------------------------------------------------------------

force :  x-direction  (pressure surface : dy*dz)
======================================
F = P*dy*dz-(P+dP/dx*dx)*dy*dz    ,P=PP, F=FF
----------------------------------------------------------------------

p4:FF = PP*dy*dz-(PP+'diff(PP,x)*dx)*dy*dz;

rem : taylor expansion .

p4a:ratsimp(p4);

math      :mass :  M=ρ*(dx*dy*dz)         
maxima :mass :  MM = ρρ*(dx*dy*dz)

p5:MM = ρρ*(dx*dy*dz);

x - direction :
==========

math       :  acceleration :  a = dv/dt   = dv/dx*dx/dt,           [m^2/s]
maxima  :  acceleration :  a = dvv/dt = dvv/dxx*dxx/dt,    [m^2/s]
------------------------------------------------------------------------------------------------
v=dx/dt      = velocity x-direction.
vv=dxx/dt  = velocity x-direction.

p6:   a='diff(vv,t);
p6a: a='diff(vv,x)*'diff(xx,t);

p7: FF = rhs(p5)*vv*'diff(vv,x);

combination : 'p7' and 'p4a' , FF
=======================

p8:rhs(p7) = rhs(p4a);

p8a:(p8/(dx*dy*dz))*(-1);

integration : ?
============  
=>  x-direction

p8b:integrate(-vv*ρρ,vv,vv1,vv2) - integrate(1,PP,PP1,PP2)=0;

p8c:expand(p8b);

rem : (vv^2*ρρ)/2+PP = constant along streamline
see : books of fluid dynamics.

Def :  M ('Mach Number')
=====================
M < 1 : subsonic
M = 1 : sonic
M > 1 : supersonic

1e)  from continuity equation , 'see above'.
===================================

p9:rhs(p1) = const;

p9a:log(lhs(p9)) = 'log(const);

p9b:p9a, logexpand=super;

math : ln , maxima : log
====================

differentiating :

p9c1:diff(p9b, ρ[i] ) ;
p9c2:diff(p9b, v[i] ) ;
p9c3:diff(p9b, A[i] ) ;

rem : 

p10:dρ[i]*lhs(p9c1)+dv[i]*lhs(p9c2)+dA[i]*lhs(p9c3)=0;

2e) from momentum equation.
=========================
see : 'p8a' ,above.

p10a:dp/dv[i] = -v[i]*ρ[i];

p10b:solve(p10a,ρ[i]);

dp : pressure difference.

combination : 1e) ,2e)
==================
( =>  flow isentropic)

p11:subst(p10b,p10);

p11a:dρ[i]/dp = 1/q^2;

rem : dp/dρ = q^2

p11b:lratsubst([p11a],p11);

p11c:expand(p11b);

p11d:args(p11c);

p11d1:part(p11d,1,1);
p11d2:part(p11d,1,2);
p11d3:part(p11d,1,3);
p11d4:part(p11d,2);

p12:p11d3=-p11d1-p11d2;

p12a:lhs(p12)=(M^2-1)*dv[i]/v[i];

rem : find M ? v[i],q
================

p13:rhs(p12) = rhs(p12a);

p13a:solve(p13,M);

p13b:p13a[1]*p13a[2]$
p13b1:lhs(p13b) =(-1)*rhs(p13b);

p13b2:p13b1-1;

use : p12a
==========

p14:subst([p13b1],p12a);

p14a:p12a/lhs(p13b2);

p14b: rhs(p14a) = lhs(p14a);

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

rem, flow : isentropic, see 'introduction to flight ' , John D Anderson Jr
rem , Mach Number no dimension. ( Basic Aerodynamics)

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