CoCalc Public FilesTwo Equations of Lagrange.sagewsOpen with one click!
Author: Bill Page
Views : 61
Description: The two equations are not independent.
Compute Environment: Ubuntu 18.04 (Deprecated)

Two Equations of Lagrange in Terms of Differential Forms

We show that the "two equations of Lagrange" given by Oziewicz and Ramirez are not independent. The second equation is exactly vv times the first equation.

This worksheet: https://cloud.sagemath.com/projects/b04b5777-e269-4c8f-a4b8-b21dbe1c93c6/files/Two%20Equations%20of%20Lagrange.sagews

%typeset_mode True

Consider vectors and forms on a 6-dimensional manifold

M = Manifold(5,'M') coord.<t, x, v, a, s> = M.chart() f = M.scalar_field(function('f')(*list(coord))) basis = coord.frame() [Dt,Dx,Dv,Da,Ds] = [basis[i] for i in range(M.dim())] cobasis=coord.coframe() [dt,dx,dv,da,ds] = [cobasis[i] for i in range(M.dim())] #d=xder from sage.manifolds.utilities import exterior_derivative as d def ev(N): return (lambda x: N.contract(x))

For the most general Lagrangian

L = M.scalar_field(function('L')(*list(coord))); L.display()
MR(t,x,v,a,s)L(t,x,v,a,s)\displaystyle \begin{array}{llcl} & M & \longrightarrow & \mathbb{R} \\ & \left(t, x, v, a, s\right) & \longmapsto & L\left(t, x, v, a, s\right) \end{array}
%md f is a dependent variable

f is a dependent variable

f = M.scalar_field(var('f'))
%md Kinematics

Kinematics

N = Dt + v*Dx + a*Dv + s*Da + f*Ds; N.display()
t+vx+av+sa+fs\displaystyle \frac{\partial}{\partial t } + v \frac{\partial}{\partial x } + a \frac{\partial}{\partial v } + s \frac{\partial}{\partial a } + f \frac{\partial}{\partial s }
N(M.scalar_field(t))==1 N(M.scalar_field(x))==v N(M.scalar_field(v))==a N(M.scalar_field(a))==s N(M.scalar_field(s))==f
True\displaystyle \mathrm{True}
True\displaystyle \mathrm{True}
True\displaystyle \mathrm{True}
True\displaystyle \mathrm{True}
True\displaystyle \mathrm{True}

Define auxillary fields

r=Ds(L); r.display()
MR(t,x,v,a,s)Ls\displaystyle \begin{array}{llcl} & M & \longrightarrow & \mathbb{R} \\ & \left(t, x, v, a, s\right) & \longmapsto & \frac{\partial\,L}{\partial s} \end{array}
q=Da(L)-N(r); q.display()
MR(t,x,v,a,s)v2Lxsa2Lvss2Lasf2Ls22Lts+La\displaystyle \begin{array}{llcl} & M & \longrightarrow & \mathbb{R} \\ & \left(t, x, v, a, s\right) & \longmapsto & -v \frac{\partial^2\,L}{\partial x\partial s} - a \frac{\partial^2\,L}{\partial v\partial s} - s \frac{\partial^2\,L}{\partial a\partial s} - f \frac{\partial^2\,L}{\partial s ^ 2} - \frac{\partial^2\,L}{\partial t\partial s} + \frac{\partial\,L}{\partial a} \end{array}
p=Dv(L)-N(q); p.display()
MR(t,x,v,a,s)v23Lx2s+a23Lv2s+2as3Lvas+2af3Lvs2+s23La2s+2fs3Las2+f23Ls3+(2a3Lxvs+2s3Lxas+2f3Lxs2+23Ltxs2Lxa)v+2a3Ltvs+2s3Ltas+2f3Lts2+a2Lxsa2Lva+s2Lvss2La2+3Lt2s2Lta+Lv\displaystyle \begin{array}{llcl} & M & \longrightarrow & \mathbb{R} \\ & \left(t, x, v, a, s\right) & \longmapsto & v^{2} \frac{\partial^3\,L}{\partial x ^ 2\partial s} + a^{2} \frac{\partial^3\,L}{\partial v ^ 2\partial s} + 2 \, a s \frac{\partial^3\,L}{\partial v\partial a\partial s} + 2 \, a f \frac{\partial^3\,L}{\partial v\partial s ^ 2} + s^{2} \frac{\partial^3\,L}{\partial a ^ 2\partial s} + 2 \, f s \frac{\partial^3\,L}{\partial a\partial s ^ 2} + f^{2} \frac{\partial^3\,L}{\partial s ^ 3} + {\left(2 \, a \frac{\partial^3\,L}{\partial x\partial v\partial s} + 2 \, s \frac{\partial^3\,L}{\partial x\partial a\partial s} + 2 \, f \frac{\partial^3\,L}{\partial x\partial s ^ 2} + 2 \, \frac{\partial^3\,L}{\partial t\partial x\partial s} - \frac{\partial^2\,L}{\partial x\partial a}\right)} v + 2 \, a \frac{\partial^3\,L}{\partial t\partial v\partial s} + 2 \, s \frac{\partial^3\,L}{\partial t\partial a\partial s} + 2 \, f \frac{\partial^3\,L}{\partial t\partial s ^ 2} + a \frac{\partial^2\,L}{\partial x\partial s} - a \frac{\partial^2\,L}{\partial v\partial a} + s \frac{\partial^2\,L}{\partial v\partial s} - s \frac{\partial^2\,L}{\partial a ^ 2} + \frac{\partial^3\,L}{\partial t ^ 2\partial s} - \frac{\partial^2\,L}{\partial t\partial a} + \frac{\partial\,L}{\partial v} \end{array}

First Equation

(N(p)-Dx(L)).display()
MR(t,x,v,a,s)v34Lx3s+a34Lv3s+3a2s4Lv2as+3a2f4Lv2s2+3as24Lva2s+6afs4Lvas2+3af24Lvs3+s34La3s+3fs24La2s2+3f2s4Las3+f34Ls4+(3a4Lx2vs+3s4Lx2as+3f4Lx2s2+34Ltx2s3Lx2a)v2+3a24Ltv2s+6as4Ltvas+6af4Ltvs2+3s24Lta2s+6fs4Ltas2+3f24Lts3+3a23Lxvs+3as3Lxas+3af3Lxs2a23Lv2a+3as3Lv2s2as3Lva2+3fs3Lvs2s23La3+fs3La2s+2f23Las2+(3a24Lxv2s+6as4Lxvas+6af4Lxvs2+3s24Lxa2s+6fs4Lxas2+3f24Lxs3+6a4Ltxvs+6s4Ltxas+6f4Ltxs2+3a3Lx2s2a3Lxva+3s3Lxvs2s3Lxa2+f3Lxas+34Lt2xs23Ltxa+2Lxv)v+3a4Lt2vs+3s4Lt2as+3f4Lt2s2+3a3Ltxs2a3Ltva+3s3Ltvs2s3Lta2+f3Ltasa2Lxa+s2Lxs+a2Lv2+(af+3s2)3Lvas+2f2Lvsf2La2+4Lt3s3Lt2a+2LtvLx\displaystyle \begin{array}{llcl} & M & \longrightarrow & \mathbb{R} \\ & \left(t, x, v, a, s\right) & \longmapsto & v^{3} \frac{\partial^4\,L}{\partial x ^ 3\partial s} + a^{3} \frac{\partial^4\,L}{\partial v ^ 3\partial s} + 3 \, a^{2} s \frac{\partial^4\,L}{\partial v ^ 2\partial a\partial s} + 3 \, a^{2} f \frac{\partial^4\,L}{\partial v ^ 2\partial s ^ 2} + 3 \, a s^{2} \frac{\partial^4\,L}{\partial v\partial a ^ 2\partial s} + 6 \, a f s \frac{\partial^4\,L}{\partial v\partial a\partial s ^ 2} + 3 \, a f^{2} \frac{\partial^4\,L}{\partial v\partial s ^ 3} + s^{3} \frac{\partial^4\,L}{\partial a ^ 3\partial s} + 3 \, f s^{2} \frac{\partial^4\,L}{\partial a ^ 2\partial s ^ 2} + 3 \, f^{2} s \frac{\partial^4\,L}{\partial a\partial s ^ 3} + f^{3} \frac{\partial^4\,L}{\partial s ^ 4} + {\left(3 \, a \frac{\partial^4\,L}{\partial x ^ 2\partial v\partial s} + 3 \, s \frac{\partial^4\,L}{\partial x ^ 2\partial a\partial s} + 3 \, f \frac{\partial^4\,L}{\partial x ^ 2\partial s ^ 2} + 3 \, \frac{\partial^4\,L}{\partial t\partial x ^ 2\partial s} - \frac{\partial^3\,L}{\partial x ^ 2\partial a}\right)} v^{2} + 3 \, a^{2} \frac{\partial^4\,L}{\partial t\partial v ^ 2\partial s} + 6 \, a s \frac{\partial^4\,L}{\partial t\partial v\partial a\partial s} + 6 \, a f \frac{\partial^4\,L}{\partial t\partial v\partial s ^ 2} + 3 \, s^{2} \frac{\partial^4\,L}{\partial t\partial a ^ 2\partial s} + 6 \, f s \frac{\partial^4\,L}{\partial t\partial a\partial s ^ 2} + 3 \, f^{2} \frac{\partial^4\,L}{\partial t\partial s ^ 3} + 3 \, a^{2} \frac{\partial^3\,L}{\partial x\partial v\partial s} + 3 \, a s \frac{\partial^3\,L}{\partial x\partial a\partial s} + 3 \, a f \frac{\partial^3\,L}{\partial x\partial s ^ 2} - a^{2} \frac{\partial^3\,L}{\partial v ^ 2\partial a} + 3 \, a s \frac{\partial^3\,L}{\partial v ^ 2\partial s} - 2 \, a s \frac{\partial^3\,L}{\partial v\partial a ^ 2} + 3 \, f s \frac{\partial^3\,L}{\partial v\partial s ^ 2} - s^{2} \frac{\partial^3\,L}{\partial a ^ 3} + f s \frac{\partial^3\,L}{\partial a ^ 2\partial s} + 2 \, f^{2} \frac{\partial^3\,L}{\partial a\partial s ^ 2} + {\left(3 \, a^{2} \frac{\partial^4\,L}{\partial x\partial v ^ 2\partial s} + 6 \, a s \frac{\partial^4\,L}{\partial x\partial v\partial a\partial s} + 6 \, a f \frac{\partial^4\,L}{\partial x\partial v\partial s ^ 2} + 3 \, s^{2} \frac{\partial^4\,L}{\partial x\partial a ^ 2\partial s} + 6 \, f s \frac{\partial^4\,L}{\partial x\partial a\partial s ^ 2} + 3 \, f^{2} \frac{\partial^4\,L}{\partial x\partial s ^ 3} + 6 \, a \frac{\partial^4\,L}{\partial t\partial x\partial v\partial s} + 6 \, s \frac{\partial^4\,L}{\partial t\partial x\partial a\partial s} + 6 \, f \frac{\partial^4\,L}{\partial t\partial x\partial s ^ 2} + 3 \, a \frac{\partial^3\,L}{\partial x ^ 2\partial s} - 2 \, a \frac{\partial^3\,L}{\partial x\partial v\partial a} + 3 \, s \frac{\partial^3\,L}{\partial x\partial v\partial s} - 2 \, s \frac{\partial^3\,L}{\partial x\partial a ^ 2} + f \frac{\partial^3\,L}{\partial x\partial a\partial s} + 3 \, \frac{\partial^4\,L}{\partial t ^ 2\partial x\partial s} - 2 \, \frac{\partial^3\,L}{\partial t\partial x\partial a} + \frac{\partial^2\,L}{\partial x\partial v}\right)} v + 3 \, a \frac{\partial^4\,L}{\partial t ^ 2\partial v\partial s} + 3 \, s \frac{\partial^4\,L}{\partial t ^ 2\partial a\partial s} + 3 \, f \frac{\partial^4\,L}{\partial t ^ 2\partial s ^ 2} + 3 \, a \frac{\partial^3\,L}{\partial t\partial x\partial s} - 2 \, a \frac{\partial^3\,L}{\partial t\partial v\partial a} + 3 \, s \frac{\partial^3\,L}{\partial t\partial v\partial s} - 2 \, s \frac{\partial^3\,L}{\partial t\partial a ^ 2} + f \frac{\partial^3\,L}{\partial t\partial a\partial s} - a \frac{\partial^2\,L}{\partial x\partial a} + s \frac{\partial^2\,L}{\partial x\partial s} + a \frac{\partial^2\,L}{\partial v ^ 2} + {\left(a f + 3 \, s^{2}\right)} \frac{\partial^3\,L}{\partial v\partial a\partial s} + 2 \, f \frac{\partial^2\,L}{\partial v\partial s} - f \frac{\partial^2\,L}{\partial a ^ 2} + \frac{\partial^4\,L}{\partial t ^ 3\partial s} - \frac{\partial^3\,L}{\partial t ^ 2\partial a} + \frac{\partial^2\,L}{\partial t\partial v} - \frac{\partial\,L}{\partial x} \end{array}

Second Equation

(Dt(L)-(N(L)-(p*a+q*s+r*f)-(v*N(p)+a*N(q)+s*N(r)))).display()
MR(t,x,v,a,s)v44Lx3s+(3a4Lx2vs+3s4Lx2as+3f4Lx2s2+34Ltx2s3Lx2a)v3+(3a24Lxv2s+6as4Lxvas+6af4Lxvs2+3s24Lxa2s+6fs4Lxas2+3f24Lxs3+6a4Ltxvs+6s4Ltxas+6f4Ltxs2+3a3Lx2s2a3Lxva+3s3Lxvs2s3Lxa2+f3Lxas+34Lt2xs23Ltxa+2Lxv)v2+(a34Lv3s+3a2s4Lv2as+3a2f4Lv2s2+3as24Lva2s+6afs4Lvas2+3af24Lvs3+s34La3s+3fs24La2s2+3f2s4Las3+f34Ls4+3a24Ltv2s+6as4Ltvas+6af4Ltvs2+3s24Lta2s+6fs4Ltas2+3f24Lts3+3a23Lxvs+3as3Lxas+3af3Lxs2a23Lv2a+3as3Lv2s2as3Lva2+3fs3Lvs2s23La3+fs3La2s+2f23Las2+3a4Lt2vs+3s4Lt2as+3f4Lt2s2+3a3Ltxs2a3Ltva+3s3Ltvs2s3Lta2+f3Ltasa2Lxa+s2Lxs+a2Lv2+(af+3s2)3Lvas+2f2Lvsf2La2+4Lt3s3Lt2a+2LtvLx)v\displaystyle \begin{array}{llcl} & M & \longrightarrow & \mathbb{R} \\ & \left(t, x, v, a, s\right) & \longmapsto & v^{4} \frac{\partial^4\,L}{\partial x ^ 3\partial s} + {\left(3 \, a \frac{\partial^4\,L}{\partial x ^ 2\partial v\partial s} + 3 \, s \frac{\partial^4\,L}{\partial x ^ 2\partial a\partial s} + 3 \, f \frac{\partial^4\,L}{\partial x ^ 2\partial s ^ 2} + 3 \, \frac{\partial^4\,L}{\partial t\partial x ^ 2\partial s} - \frac{\partial^3\,L}{\partial x ^ 2\partial a}\right)} v^{3} + {\left(3 \, a^{2} \frac{\partial^4\,L}{\partial x\partial v ^ 2\partial s} + 6 \, a s \frac{\partial^4\,L}{\partial x\partial v\partial a\partial s} + 6 \, a f \frac{\partial^4\,L}{\partial x\partial v\partial s ^ 2} + 3 \, s^{2} \frac{\partial^4\,L}{\partial x\partial a ^ 2\partial s} + 6 \, f s \frac{\partial^4\,L}{\partial x\partial a\partial s ^ 2} + 3 \, f^{2} \frac{\partial^4\,L}{\partial x\partial s ^ 3} + 6 \, a \frac{\partial^4\,L}{\partial t\partial x\partial v\partial s} + 6 \, s \frac{\partial^4\,L}{\partial t\partial x\partial a\partial s} + 6 \, f \frac{\partial^4\,L}{\partial t\partial x\partial s ^ 2} + 3 \, a \frac{\partial^3\,L}{\partial x ^ 2\partial s} - 2 \, a \frac{\partial^3\,L}{\partial x\partial v\partial a} + 3 \, s \frac{\partial^3\,L}{\partial x\partial v\partial s} - 2 \, s \frac{\partial^3\,L}{\partial x\partial a ^ 2} + f \frac{\partial^3\,L}{\partial x\partial a\partial s} + 3 \, \frac{\partial^4\,L}{\partial t ^ 2\partial x\partial s} - 2 \, \frac{\partial^3\,L}{\partial t\partial x\partial a} + \frac{\partial^2\,L}{\partial x\partial v}\right)} v^{2} + {\left(a^{3} \frac{\partial^4\,L}{\partial v ^ 3\partial s} + 3 \, a^{2} s \frac{\partial^4\,L}{\partial v ^ 2\partial a\partial s} + 3 \, a^{2} f \frac{\partial^4\,L}{\partial v ^ 2\partial s ^ 2} + 3 \, a s^{2} \frac{\partial^4\,L}{\partial v\partial a ^ 2\partial s} + 6 \, a f s \frac{\partial^4\,L}{\partial v\partial a\partial s ^ 2} + 3 \, a f^{2} \frac{\partial^4\,L}{\partial v\partial s ^ 3} + s^{3} \frac{\partial^4\,L}{\partial a ^ 3\partial s} + 3 \, f s^{2} \frac{\partial^4\,L}{\partial a ^ 2\partial s ^ 2} + 3 \, f^{2} s \frac{\partial^4\,L}{\partial a\partial s ^ 3} + f^{3} \frac{\partial^4\,L}{\partial s ^ 4} + 3 \, a^{2} \frac{\partial^4\,L}{\partial t\partial v ^ 2\partial s} + 6 \, a s \frac{\partial^4\,L}{\partial t\partial v\partial a\partial s} + 6 \, a f \frac{\partial^4\,L}{\partial t\partial v\partial s ^ 2} + 3 \, s^{2} \frac{\partial^4\,L}{\partial t\partial a ^ 2\partial s} + 6 \, f s \frac{\partial^4\,L}{\partial t\partial a\partial s ^ 2} + 3 \, f^{2} \frac{\partial^4\,L}{\partial t\partial s ^ 3} + 3 \, a^{2} \frac{\partial^3\,L}{\partial x\partial v\partial s} + 3 \, a s \frac{\partial^3\,L}{\partial x\partial a\partial s} + 3 \, a f \frac{\partial^3\,L}{\partial x\partial s ^ 2} - a^{2} \frac{\partial^3\,L}{\partial v ^ 2\partial a} + 3 \, a s \frac{\partial^3\,L}{\partial v ^ 2\partial s} - 2 \, a s \frac{\partial^3\,L}{\partial v\partial a ^ 2} + 3 \, f s \frac{\partial^3\,L}{\partial v\partial s ^ 2} - s^{2} \frac{\partial^3\,L}{\partial a ^ 3} + f s \frac{\partial^3\,L}{\partial a ^ 2\partial s} + 2 \, f^{2} \frac{\partial^3\,L}{\partial a\partial s ^ 2} + 3 \, a \frac{\partial^4\,L}{\partial t ^ 2\partial v\partial s} + 3 \, s \frac{\partial^4\,L}{\partial t ^ 2\partial a\partial s} + 3 \, f \frac{\partial^4\,L}{\partial t ^ 2\partial s ^ 2} + 3 \, a \frac{\partial^3\,L}{\partial t\partial x\partial s} - 2 \, a \frac{\partial^3\,L}{\partial t\partial v\partial a} + 3 \, s \frac{\partial^3\,L}{\partial t\partial v\partial s} - 2 \, s \frac{\partial^3\,L}{\partial t\partial a ^ 2} + f \frac{\partial^3\,L}{\partial t\partial a\partial s} - a \frac{\partial^2\,L}{\partial x\partial a} + s \frac{\partial^2\,L}{\partial x\partial s} + a \frac{\partial^2\,L}{\partial v ^ 2} + {\left(a f + 3 \, s^{2}\right)} \frac{\partial^3\,L}{\partial v\partial a\partial s} + 2 \, f \frac{\partial^2\,L}{\partial v\partial s} - f \frac{\partial^2\,L}{\partial a ^ 2} + \frac{\partial^4\,L}{\partial t ^ 3\partial s} - \frac{\partial^3\,L}{\partial t ^ 2\partial a} + \frac{\partial^2\,L}{\partial t\partial v} - \frac{\partial\,L}{\partial x}\right)} v \end{array}

Multiplying by vv

v*(N(p)-Dx(L)) == (Dt(L)-(N(L)-(p*a+q*s+r*f)-(v*N(p)+a*N(q)+s*N(r))))
True\displaystyle \mathrm{True}
True\displaystyle \mathrm{True}
%md ## Checking the calculations from the paper ##

Checking the calculations from the paper

L = M.scalar_field(function('L')(*list(coord))) p = M.scalar_field(function('p')(*list(coord))) q = M.scalar_field(function('q')(*list(coord))) r = M.scalar_field(function('r')(*list(coord))) t=M.scalar_field(t) x=M.scalar_field(x) v=M.scalar_field(v) a=M.scalar_field(a) s=M.scalar_field(s)

Action differential Form

alpha = L*dt + p*(dx-v*dt) + q*(dv-a*dt) + r*(da-s*dt) alpha.display()
(vp(t,x,v,a,s)aq(t,x,v,a,s)sr(t,x,v,a,s)+L(t,x,v,a,s))dt+p(t,x,v,a,s)dx+q(t,x,v,a,s)dv+r(t,x,v,a,s)da\displaystyle \left( -v p\left(t, x, v, a, s\right) - a q\left(t, x, v, a, s\right) - s r\left(t, x, v, a, s\right) + L\left(t, x, v, a, s\right) \right) \mathrm{d} t + p\left(t, x, v, a, s\right) \mathrm{d} x + q\left(t, x, v, a, s\right) \mathrm{d} v + r\left(t, x, v, a, s\right) \mathrm{d} a
alpha == L*dt+p*dx+q*dv+r*da-(p*v+q*a+r*s)*dt
True\displaystyle \mathrm{True}
d(alpha).display()
(vpx+aqx+srxLx+pt)dtdx+(vpv+aqv+srv+p(t,x,v,a,s)Lv+qt)dtdv+(vpa+aqa+sra+q(t,x,v,a,s)La+rt)dtda+(vps+aqs+srs+r(t,x,v,a,s)Ls)dtds+(pv+qx)dxdv+(pa+rx)dxdapsdxds+(qa+rv)dvdaqsdvdsrsdads\displaystyle \left( v \frac{\partial\,p}{\partial x} + a \frac{\partial\,q}{\partial x} + s \frac{\partial\,r}{\partial x} - \frac{\partial\,L}{\partial x} + \frac{\partial\,p}{\partial t} \right) \mathrm{d} t\wedge \mathrm{d} x + \left( v \frac{\partial\,p}{\partial v} + a \frac{\partial\,q}{\partial v} + s \frac{\partial\,r}{\partial v} + p\left(t, x, v, a, s\right) - \frac{\partial\,L}{\partial v} + \frac{\partial\,q}{\partial t} \right) \mathrm{d} t\wedge \mathrm{d} v + \left( v \frac{\partial\,p}{\partial a} + a \frac{\partial\,q}{\partial a} + s \frac{\partial\,r}{\partial a} + q\left(t, x, v, a, s\right) - \frac{\partial\,L}{\partial a} + \frac{\partial\,r}{\partial t} \right) \mathrm{d} t\wedge \mathrm{d} a + \left( v \frac{\partial\,p}{\partial s} + a \frac{\partial\,q}{\partial s} + s \frac{\partial\,r}{\partial s} + r\left(t, x, v, a, s\right) - \frac{\partial\,L}{\partial s} \right) \mathrm{d} t\wedge \mathrm{d} s + \left( -\frac{\partial\,p}{\partial v} + \frac{\partial\,q}{\partial x} \right) \mathrm{d} x\wedge \mathrm{d} v + \left( -\frac{\partial\,p}{\partial a} + \frac{\partial\,r}{\partial x} \right) \mathrm{d} x\wedge \mathrm{d} a -\frac{\partial\,p}{\partial s} \mathrm{d} x\wedge \mathrm{d} s + \left( -\frac{\partial\,q}{\partial a} + \frac{\partial\,r}{\partial v} \right) \mathrm{d} v\wedge \mathrm{d} a -\frac{\partial\,q}{\partial s} \mathrm{d} v\wedge \mathrm{d} s -\frac{\partial\,r}{\partial s} \mathrm{d} a\wedge \mathrm{d} s
d(alpha) == d(L).wedge(dt) + d(p).wedge(dx) + d(q).wedge(dv) + d(r).wedge(da) - d(p*v + q*a + r*s).wedge(dt)
True\displaystyle \mathrm{True}
ev(alpha)(N)==L
True\displaystyle \mathrm{True}
Omega = -(p*dx+q*dv+r*da).wedge(d(t)); Omega.display()
p(t,x,v,a,s)dtdx+q(t,x,v,a,s)dtdv+r(t,x,v,a,s)dtda\displaystyle p\left(t, x, v, a, s\right) \mathrm{d} t\wedge \mathrm{d} x + q\left(t, x, v, a, s\right) \mathrm{d} t\wedge \mathrm{d} v + r\left(t, x, v, a, s\right) \mathrm{d} t\wedge \mathrm{d} a
alpha == L*dt + ev(N)(Omega)
True\displaystyle \mathrm{True}
%md Equation of Motion ($E=0$)

Equation of Motion (E=0E=0)

E = ev(N)(d(alpha)) E.display()
(v2pxa2qvasqaafqsasrvs2rafsrs(apv+spa+fps+aqx+srxLx+pt)vap(t,x,v,a,s)sq(t,x,v,a,s)fr(t,x,v,a,s)+aLv+sLa+fLsaqtsrt)dt+(vpx+apv+spa+fpsLx+pt)dx+(vqx+aqv+sqa+fqs+p(t,x,v,a,s)Lv+qt)dv+(vrx+arv+sra+frs+q(t,x,v,a,s)La+rt)da+(r(t,x,v,a,s)Ls)ds\displaystyle \left( -v^{2} \frac{\partial\,p}{\partial x} - a^{2} \frac{\partial\,q}{\partial v} - a s \frac{\partial\,q}{\partial a} - a f \frac{\partial\,q}{\partial s} - a s \frac{\partial\,r}{\partial v} - s^{2} \frac{\partial\,r}{\partial a} - f s \frac{\partial\,r}{\partial s} - {\left(a \frac{\partial\,p}{\partial v} + s \frac{\partial\,p}{\partial a} + f \frac{\partial\,p}{\partial s} + a \frac{\partial\,q}{\partial x} + s \frac{\partial\,r}{\partial x} - \frac{\partial\,L}{\partial x} + \frac{\partial\,p}{\partial t}\right)} v - a p\left(t, x, v, a, s\right) - s q\left(t, x, v, a, s\right) - f r\left(t, x, v, a, s\right) + a \frac{\partial\,L}{\partial v} + s \frac{\partial\,L}{\partial a} + f \frac{\partial\,L}{\partial s} - a \frac{\partial\,q}{\partial t} - s \frac{\partial\,r}{\partial t} \right) \mathrm{d} t + \left( v \frac{\partial\,p}{\partial x} + a \frac{\partial\,p}{\partial v} + s \frac{\partial\,p}{\partial a} + f \frac{\partial\,p}{\partial s} - \frac{\partial\,L}{\partial x} + \frac{\partial\,p}{\partial t} \right) \mathrm{d} x + \left( v \frac{\partial\,q}{\partial x} + a \frac{\partial\,q}{\partial v} + s \frac{\partial\,q}{\partial a} + f \frac{\partial\,q}{\partial s} + p\left(t, x, v, a, s\right) - \frac{\partial\,L}{\partial v} + \frac{\partial\,q}{\partial t} \right) \mathrm{d} v + \left( v \frac{\partial\,r}{\partial x} + a \frac{\partial\,r}{\partial v} + s \frac{\partial\,r}{\partial a} + f \frac{\partial\,r}{\partial s} + q\left(t, x, v, a, s\right) - \frac{\partial\,L}{\partial a} + \frac{\partial\,r}{\partial t} \right) \mathrm{d} a + \left( r\left(t, x, v, a, s\right) - \frac{\partial\,L}{\partial s} \right) \mathrm{d} s

Rewriting it in various ways.

E == N(L)*dt - N(t) * d(L) + N(p)*dx - N(x)*d(p) + N(q)*dv - N(v)*d(q) + N(r)*da - N(a)*d(r) - N(p*v+q*a+r*s)*dt + N(t)*d(p*v+q*a+r*s)
True\displaystyle \mathrm{True}
E == N(L)*dt - d(L) + N(p)*dx - v*d(p) + N(q)*dv - a*d(q) + N(r)*da - s*d(r) - N(p*v+q*a+r*s)*dt + d(p*v+q*a+r*s)
True\displaystyle \mathrm{True}
E == N(L-p*v-q*a-r*s)*dt - d(L - p*v - q*a- r*s) - v*d(p) - a*d(q) - s*d(r) + N(p)*dx + N(q)*dv + N(r)*da
True\displaystyle \mathrm{True}
d(p*v) == v*d(p) + p*d(v)
True\displaystyle \mathrm{True}
d(q*a) == a*d(q) + q*d(a)
True\displaystyle \mathrm{True}
d(r*s) == s*d(r) + r*d(s)
True\displaystyle \mathrm{True}
E == N(L - p*v - q*a - r*s)*dt - d(L) + p*dv + q*da + r*ds + N(p)*dx + N(q)*dv + N(r)*da
True\displaystyle \mathrm{True}
True\displaystyle \mathrm{True}
N(p*v) == p*N(v) + v*N(p)
True\displaystyle \mathrm{True}
E == N(L)*dt - (p*a+q*s+r*f)*dt -(v*N(p) + a*N(q) + s*N(r) )*dt - d(L) + p*dv + q*da + r*ds + N(p)*dx + N(q)*dv + N(r)*da
True\displaystyle \mathrm{True}
E == ( N(L) - (p*a + q*s + r*f) - (v*N(p) + a*N(q) + s*N(r)))*dt + N(p)*dx + (N(q)+p)*dv + (N(r)+q)*da + r*ds - d(L)
True\displaystyle \mathrm{True}
d(L) == Dt(L)*dt + Dx(L)*dx + Dv(L)*dv + Da(L)*da + Ds(L)*ds
True\displaystyle \mathrm{True}
r=Ds(L); r.display()
MR(t,x,v,a,s)Ls\displaystyle \begin{array}{llcl} & M & \longrightarrow & \mathbb{R} \\ & \left(t, x, v, a, s\right) & \longmapsto & \frac{\partial\,L}{\partial s} \end{array}
q=Da(L)-N(r); q.display()
MR(t,x,v,a,s)v2Lxsa2Lvss2Lasf2Ls22Lts+La\displaystyle \begin{array}{llcl} & M & \longrightarrow & \mathbb{R} \\ & \left(t, x, v, a, s\right) & \longmapsto & -v \frac{\partial^2\,L}{\partial x\partial s} - a \frac{\partial^2\,L}{\partial v\partial s} - s \frac{\partial^2\,L}{\partial a\partial s} - f \frac{\partial^2\,L}{\partial s ^ 2} - \frac{\partial^2\,L}{\partial t\partial s} + \frac{\partial\,L}{\partial a} \end{array}
p=Dv(L)-N(q); p.display()
MR(t,x,v,a,s)v23Lx2s+a23Lv2s+2as3Lvas+2af3Lvs2+s23La2s+2fs3Las2+f23Ls3+(2a3Lxvs+2s3Lxas+2f3Lxs2+23Ltxs2Lxa)v+2a3Ltvs+2s3Ltas+2f3Lts2+a2Lxsa2Lva+s2Lvss2La2+3Lt2s2Lta+Lv\displaystyle \begin{array}{llcl} & M & \longrightarrow & \mathbb{R} \\ & \left(t, x, v, a, s\right) & \longmapsto & v^{2} \frac{\partial^3\,L}{\partial x ^ 2\partial s} + a^{2} \frac{\partial^3\,L}{\partial v ^ 2\partial s} + 2 \, a s \frac{\partial^3\,L}{\partial v\partial a\partial s} + 2 \, a f \frac{\partial^3\,L}{\partial v\partial s ^ 2} + s^{2} \frac{\partial^3\,L}{\partial a ^ 2\partial s} + 2 \, f s \frac{\partial^3\,L}{\partial a\partial s ^ 2} + f^{2} \frac{\partial^3\,L}{\partial s ^ 3} + {\left(2 \, a \frac{\partial^3\,L}{\partial x\partial v\partial s} + 2 \, s \frac{\partial^3\,L}{\partial x\partial a\partial s} + 2 \, f \frac{\partial^3\,L}{\partial x\partial s ^ 2} + 2 \, \frac{\partial^3\,L}{\partial t\partial x\partial s} - \frac{\partial^2\,L}{\partial x\partial a}\right)} v + 2 \, a \frac{\partial^3\,L}{\partial t\partial v\partial s} + 2 \, s \frac{\partial^3\,L}{\partial t\partial a\partial s} + 2 \, f \frac{\partial^3\,L}{\partial t\partial s ^ 2} + a \frac{\partial^2\,L}{\partial x\partial s} - a \frac{\partial^2\,L}{\partial v\partial a} + s \frac{\partial^2\,L}{\partial v\partial s} - s \frac{\partial^2\,L}{\partial a ^ 2} + \frac{\partial^3\,L}{\partial t ^ 2\partial s} - \frac{\partial^2\,L}{\partial t\partial a} + \frac{\partial\,L}{\partial v} \end{array}
%md ## For example: the Schiff and Poirier Lagrangian ##

For example: the Schiff and Poirier Lagrangian

hbar = var('hbar',latex_name='\hbar') m = var('m') V = M.scalar_field(function('V')(var('x'))) L = 1/2*m*v^2 - V - hbar^2/4/m*(s/v^3-5/2*a^2/v^4); L.display()
MR(t,x,v,a,s)4m2v68mv4V(x)+5a2222sv8mv4\displaystyle \begin{array}{llcl} & M & \longrightarrow & \mathbb{R} \\ & \left(t, x, v, a, s\right) & \longmapsto & \frac{4 \, m^{2} v^{6} - 8 \, m v^{4} V\left(x\right) + 5 \, a^{2} {{\hbar}}^{2} - 2 \, {{\hbar}}^{2} s v}{8 \, m v^{4}} \end{array}
r=Ds(L); r.display()
MR(t,x,v,a,s)24mv3\displaystyle \begin{array}{llcl} & M & \longrightarrow & \mathbb{R} \\ & \left(t, x, v, a, s\right) & \longmapsto & -\frac{{{\hbar}}^{2}}{4 \, m v^{3}} \end{array}
q=Da(L)-N(r); q.display()
MR(t,x,v,a,s)a22mv4\displaystyle \begin{array}{llcl} & M & \longrightarrow & \mathbb{R} \\ & \left(t, x, v, a, s\right) & \longmapsto & \frac{a {{\hbar}}^{2}}{2 \, m v^{4}} \end{array}
p=Dv(L)-N(q); p.display()
MR(t,x,v,a,s)4m2v62a22+2sv4mv5\displaystyle \begin{array}{llcl} & M & \longrightarrow & \mathbb{R} \\ & \left(t, x, v, a, s\right) & \longmapsto & \frac{4 \, m^{2} v^{6} - 2 \, a^{2} {{\hbar}}^{2} + {{\hbar}}^{2} s v}{4 \, m v^{5}} \end{array}

First Equation

(N(p)-Dx(L)).expr().expand()
am+5a322mv62a2smv5+f24mv4+xV(x)\displaystyle a m + \frac{5 \, a^{3} {{\hbar}}^{2}}{2 \, m v^{6}} - \frac{2 \, a {{\hbar}}^{2} s}{m v^{5}} + \frac{f {{\hbar}}^{2}}{4 \, m v^{4}} + \frac{\partial}{\partial x}V\left(x\right)

Second Equation

(Dt(L)-(N(L)-(p*a+q*s+r*f)-(v*N(p)+a*N(q)+s*N(r)))).expr().expand()
amv+vxV(x)+5a322mv52a2smv4+f24mv3\displaystyle a m v + v \frac{\partial}{\partial x}V\left(x\right) + \frac{5 \, a^{3} {{\hbar}}^{2}}{2 \, m v^{5}} - \frac{2 \, a {{\hbar}}^{2} s}{m v^{4}} + \frac{f {{\hbar}}^{2}}{4 \, m v^{3}}