kill(all)$

simple Bernoulli's Equation In Irrotational Flow , version 1.0
peter.vlasschaert@gmail.com,25/04/2019

load packages ?
==============

load(lrats)$
load(vect)$

declare : vector field
------------------------------

declare(G,nonscalar);

rem : load(vect) , used for vector analysis.

two words : a) Bernoulli's Equation   ( = Energy of the fluid   )
                        b) Irrotational Flow           ( = no Rotation of the fluid)
                         

a) Bernoulli's Equation
===================

1e) Mechanics : conservation  of Energy = E[m]
-----------------------------------------------------------------------
index :  m = mechanical  
index :  k = kinetic
index :  p = potential
E : energy
no index : m : mass > 0
no index : p  : pressure > 0
 v : velocity
 g : 9,81 m/s^2  > 0
 z  : height 
V  : volume ( 'Big v')

p1: E[m] = E[k] + E[p];

kinetic energy.
============

p1a:E[k] = 1/2*m*v^2;

potential energy
==============

p1b:E[p] = m*g*z;

result : mechanical energy
======================

p1c:subst([p1a,p1b],p1);

result : mechanical energy /mass = Em
================================

p2:[E[m]/m =Em];

p2a:p1c/m;

p2b:subst(p2,p2a);

p2c:expand(p2b);

when no friction  Em = C1
=====================
independent of path followed.(= one state 'begin' to other state 'end')
rem : C1 = constant

p2d: rhs(p2c) = C1;

How to get Bernoulli's Equation  Eb
==============================
other work : ideal gas ( p*V=R*n*T)
Eb = mechanical energy + p*V/m

p3: Eb = Em + p*V/m;

p3a:subst([p2c],p3);

Em => C1  => Eb => C2
===================

p3b:rhs(p3a)  = C2;

result  :Bernoulli's Equation
========================
C = constant

p4:lhs(p3b) = C;

definition density: 
ρ = mass/volume

p4a: [m/V = ρ];

p4b:lratsubst(p4a,p4),expand;

b) Irrotational Flow 
================
=>  see vector product  , website , fluid dynamics.
vector product :vec(CC)  = vec(A) ~ vec(B) , ~  operator  'Maxima'
-----------------------------------------------------------------------------------------------
vec : vector.

suppose G : vector field , see calculus, wikipedia
=>     curl(G) = 0  , 'definition : Irrotational Flow '

1e)  components G
-----------------------------

p5:express(G);

2e) curl  of G
------------------

p5a:curl(G) =0;

p5b:express(p5a);

result : 3  equations. from 'p5b'
==========================

p5b1:part(p5b,1,1)=rhs(p5b);
p5b2:part(p5b,1,2)=rhs(p5b);
p5b3:part(p5b,1,3)=rhs(p5b);

final : result
==========

first equation 'p5b1'
-----------------------------

p6a:part(p5b1,1,2);

p6b:-p6a;

p6c:p5b1-p6a;

final :three equations
--------------------------------

p7a:p5b1-part(p5b1,1,2);
p7b:p5b2-part(p5b2,1,2);
p7c:p5b3-part(p5b3,1,2);

rem : 'p7a,p7b,p7c' are conditions for  Irrotational Field