1 /* Copyright (C) 2003 Valerij Pipin <pip@iszf.irk.ru>
3 * This program is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU General Public License as
5 * published by the Free Software Foundation; either version 2 of
6 * the License, or (at your option) any later version.
8 * This program is distributed in the hope that it will be
9 * useful, but WITHOUT ANY WARRANTY; without even the implied
10 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 * PURPOSE. See the GNU General Public License for more details.
13 * Proving the conservation of helicity in hydrodynamics
16 (if get('itensor,'version)=false then load(itensor),
17 icounter:5,idummyx:j,derivabbrev:false)$
19 ("the conservation of helicity in hydrodynamics")$
20 ("the covariant formulation of the Euler equation is")$
21 euler:d_t*v([i1])+'liediff(v,v([i0]))=
22 -extdiff(p([]),i1)/rho([])+extdiff((v([i0])|v/2-phi([])),i1)$
25 ("take the exterior derivative of both sides")$
26 euler:d_t*omega([i1,i2])+'liediff(v,omega([i0,i1]))=
27 extdiff(-extdiff(p([]),i1)/rho([])+extdiff(v([i0])|v/2-phi([]),i1),i2)$
29 ishow(omega([i1,i2])=extdiff(v([i1]),i2))$
30 ("declare the function's dependencies")$
32 ("define the chain rule for the derivatives' replacement")$
33 matchdeclare(i,symbolp);
34 defrule(p_r, p([],[],i),'diff(p,rho)*rho([],[],i));
35 defrule(p_sr, p([],[],i),'diff(p,s)*s([],[],i)+'diff(p,rho)*rho([],[],i));
37 ishow(ratsimp(apply1(euler,p_r)))$
38 ("this law was originally discovered by Lord Kelvin")$
39 ("for the more general case there is Ertel's theorem")$
41 ("apply another rule where pressure depends on both rho and the entropy")$
42 euler:factor(expand(apply1(euler,p_sr)))$
44 ("The RHS vanishes after forming the exterior product with the
45 differential of the entropy")$
46 rhs(euler)~extdiff(s([]),i3)$
47 ishow(lhs(euler)=factor(expand(apply1(%,p_sr))))$
49 /* End of demo -- comment line needed by MAXIMA to resume demo menu */