Examples using the DifferentialThomas Package
Consistency check
restart;
with⁡DifferentialThomas
ComplementOfDecomposition,Display,Equations,Inequations,IntersectDecompositions,LinearCombination,NormalForm,PowerSeriesSolution,Ranking,ReducedForm,ThomasDecomposition,Tools
withTools:
Ranking⁡x,y,u:
Eq1 ≔ diffux, y, y diffux, y, x+diffux, y, x+1=0, diffux, y, x, x ux, y−diffux, y, y2+ux, y=0
Eq1≔∂∂yu⁡x,y⁢∂∂xu⁡x,y+∂∂xu⁡x,y+1=0,∂2∂x2u⁡x,y⁢u⁡x,y−∂∂yu⁡x,y2+u⁡x,y=0
TD≔ThomasDecomposition⁡Eq1
TD≔
This shows that system Eq1 is inconsistent.
Eq2 ≔ diffux, y, y diffux, y, x+diffux, y, x+1, diffux, y, x, x ux, y−diffux, y, y2−diffux, y, x
Eq2≔∂∂yu⁡x,y⁢∂∂xu⁡x,y+∂∂xu⁡x,y+1,∂2∂x2u⁡x,y⁢u⁡x,y−∂∂yu⁡x,y2−∂∂xu⁡x,y
TD≔ThomasDecomposition⁡Eq2
TD≔DifferentialSystem
This shows that system Eq2 is consistent.
EquationsTD
∂∂xu⁡x,y=−1∂∂yu⁡x,y+1,∂∂yu⁡x,y3=−∂∂yu⁡x,y2+1
Namely, there is a non-empty set of equations in the output simple system.
Eq3 ≔ diffux, y, y diffux, y, x+diffux, y, x+1=0, ax, y ux, y+diffux, y, x, x ux, y−diffux, y, y2−diffux, y, x=0, diffax, y, x=0, diffax, y, y=0
Eq3≔∂∂yu⁡x,y⁢∂∂xu⁡x,y+∂∂xu⁡x,y+1=0,a⁡x,y⁢u⁡x,y+∂2∂x2u⁡x,y⁢u⁡x,y−∂∂yu⁡x,y2−∂∂xu⁡x,y=0,∂∂xa⁡x,y=0,∂∂ya⁡x,y=0
Eq3 is the extension of Eq2 with the constant (parameter) 'a', here represented by a function of x,y with null partial derivatives
Rankingx,y,u,a
ranking
TD≔ThomasDecomposition⁡Eq3
EquationsTD1
∂∂xu⁡x,y3=−∂∂xu⁡x,y2−2⁢∂∂xu⁡x,y−1,∂∂xu⁡x,y=−1∂∂yu⁡x,y+1,a⁡x,y=0
The last equation in the output system above shows that consistency holds if and only if a=0.
InequationsTD1
u⁡x,y≠0
To display the equations and inequations of the returned decomposition, as differential polynomials equal to or different than 0, use Display
DisplayTD1
−∂∂xu⁡x,y3−∂∂xu⁡x,y2−2⁢∂∂xu⁡x,y−1=0,∂∂yu⁡x,y⁢∂∂xu⁡x,y+∂∂xu⁡x,y+1=0,a⁡x,y=0,u⁡x,y≠0
Computation of Lagrangian constraints (Eq.13, V.P.Gerdt, D.Robertz. Lagrangian constraints and differential Thomas decomposition. Advances in Applied Mathematics 72, 113-138, 2016)
Use a ranking for the independent variables that will produce ODEs when possible
ivar≔t,x
Rank the dependent variables in equation footing and use a non-elimination ranking
dvar≔u,v,w
Ranking⁡ivar,dvar
To check the last ranking set, you can call Ranking with no arguments
Ranking
The current Ranking for the independent variables [t, x] and the dependent variables [u, v, w] is: Matrixordering with Matrix(5, 5, [[1,0,0,0,0],[0,1,0,0,0],[0,0,1,1,1],[0,0,0,0,-1],[0,0,0,-1,0]])
The Lagrangian is given by
L ≔ 12 diffut, x, t2+diffvt, x, t2 ut, x diffwt, x, x+diffwt, x, t diffut, x, t+diffvt, x, x
L≔∂∂tu⁡t,x22+∂∂tv⁡t,x2⁢u⁡t,x⁢∂∂xw⁡t,x+∂∂tw⁡t,x⁢∂∂tu⁡t,x+∂∂xv⁡t,x
The corresponding Euler-Lagrange equations are
EL ≔ −diffvt, x, t2 diffwt, x, x+diffut, x, t, t+diffwt, x, t, t = 0, 2 diffvt, x, t ut, x diffwt, x, t, x+2 diffvt, x, t, t ut, x diffwt, x, x+2 diffvt, x, t diffut, x, t diffwt, x, x+diffwt, x, t, x=0, 2 diffvt, x, t, x diffvt, x, t ut, x+diffvt, x, t2 diffut, x, x+diffut, x, t, t+diffvt, x, t, x=0
EL≔−∂∂tv⁡t,x2⁢∂∂xw⁡t,x+∂2∂t2u⁡t,x+∂2∂t2w⁡t,x=0,2⁢∂∂tv⁡t,x⁢u⁡t,x⁢∂2∂t∂xw⁡t,x+2⁢∂2∂t2v⁡t,x⁢u⁡t,x⁢∂∂xw⁡t,x+2⁢∂∂tv⁡t,x⁢∂∂tu⁡t,x⁢∂∂xw⁡t,x+∂2∂t∂xw⁡t,x=0,2⁢∂2∂t∂xv⁡t,x⁢∂∂tv⁡t,x⁢u⁡t,x+∂∂tv⁡t,x2⁢∂∂xu⁡t,x+∂2∂t2u⁡t,x+∂2∂t∂xv⁡t,x=0
TD≔ThomasDecomposition⁡EL
TD≔DifferentialSystem,DifferentialSystem,DifferentialSystem,DifferentialSystem,DifferentialSystem,DifferentialSystem
−2⁢∂2∂t∂xv⁡t,x⁢∂∂tv⁡t,x⁢u⁡t,x−∂∂tv⁡t,x2⁢∂∂xu⁡t,x−∂2∂t2u⁡t,x−∂2∂t∂xv⁡t,x=0,2⁢∂∂tv⁡t,x⁢u⁡t,x⁢∂2∂t∂xw⁡t,x+2⁢∂2∂t2v⁡t,x⁢u⁡t,x⁢∂∂xw⁡t,x+2⁢∂∂tv⁡t,x⁢∂∂tu⁡t,x⁢∂∂xw⁡t,x+∂2∂t∂xw⁡t,x=0,2⁢∂2∂t∂xv⁡t,x⁢∂∂tv⁡t,x⁢u⁡t,x+∂∂tv⁡t,x2⁢∂∂xu⁡t,x+∂∂tv⁡t,x2⁢∂∂xw⁡t,x+∂2∂t∂xv⁡t,x−∂2∂t2w⁡t,x=0,∂∂xw⁡t,x≠0,u⁡t,x≠0
In (20), the second equation is a (generalized) Lagrangian constraint.
DisplayTD3
u⁡t,x=0,∂2∂t∂xv⁡t,x=0,−∂2∂t2w⁡t,x=0,∂2∂t∂xw⁡t,x=0,∂∂xw⁡t,x=0
Here the first, second and fourth equations are Lagrangian constraints.
DisplayTD4
−∂2∂t2u⁡t,x=0,∂2∂t∂xu⁡t,x=0,∂∂xu⁡t,x=0,2⁢∂∂tv⁡t,x⁢u⁡t,x+1=0,−∂2∂t2w⁡t,x=0,∂2∂t∂xw⁡t,x=0,∂∂xw⁡t,x=0,u⁡t,x≠0
The second, third and fifth equations are Lagrangian constraints.
DisplayTD5
u⁡t,x=0,∂∂tv⁡t,x=0,−∂2∂t2w⁡t,x=0,∂2∂t∂xw⁡t,x=0,∂∂xw⁡t,x≠0
The first, second and fourth equations are Lagrangian constraints.
DisplayTD6
u⁡t,x=0,∂2∂t∂xv⁡t,x=0,∂∂tv⁡t,x2⁢∂∂xw⁡t,x−∂2∂t2w⁡t,x=0,∂2∂t∂xw⁡t,x=0,∂2∂x2w⁡t,x=0,∂∂xw⁡t,x≠0,∂∂tv⁡t,x≠0
The following picture illustrates the tree of case distinctions constructed by the Thomas algorithm:
Computation of Lagrangian constraints (Eq.8.1, A. Deriglazov. Classical mechanics, Hamiltonian and Lagrangian formalism. Springer, Heidelberg, 2010)
This application of the differential Thomas decomposition is taken from V.P.Gerdt, D.Robertz, "Lagrangian constraints and differential Thomas decomposition", Advances in Applied Mathematics, 72, 113-138, 2016
Ranking⁡t,q1,q2
The Lagrangian and corresponding Euler-Lagrange equations
L ≔ q1t2 diffq2t, t2+2 q1t q2t diffq1t, t diffq2t, t+q2t2 diffq1t, t2+q1t2+q2t2
L≔q1⁡t2⁢ⅆⅆtq2⁡t2+2⁢q1⁡t⁢q2⁡t⁢ⅆⅆtq1⁡t⁢ⅆⅆtq2⁡t+q2⁡t2⁢ⅆⅆtq1⁡t2+q1⁡t2+q2⁡t2
EL ≔ 2 q1t q2t diffq2t, t, t+4 diffq1t, t q2t diffq2t, t+2 diffq1t, t, t q2t2−2 q1t=0, 2 q1t2 diffq2t, t, t+4 diffq1t, t q1t diffq2t, t+2 q1t q2t diffq1t, t, t−2 q2t=0
EL≔2⁢q1⁡t⁢q2⁡t⁢ⅆ2ⅆt2q2⁡t+4⁢ⅆⅆtq1⁡t⁢q2⁡t⁢ⅆⅆtq2⁡t+2⁢ⅆ2ⅆt2q1⁡t⁢q2⁡t2−2⁢q1⁡t=0,2⁢q1⁡t2⁢ⅆ2ⅆt2q2⁡t+4⁢ⅆⅆtq1⁡t⁢q1⁡t⁢ⅆⅆtq2⁡t+2⁢q1⁡t⁢q2⁡t⁢ⅆ2ⅆt2q1⁡t−2⁢q2⁡t=0
TD≔DifferentialSystem,DifferentialSystem,DifferentialSystem
The equations and inequations of the three simple systems returned by ThomasDecomposition
DisplayTD
q1⁡t+q2⁡t=0,2⁢q2⁡t⁢ⅆ2ⅆt2q2⁡t+2⁢ⅆⅆtq2⁡t2−1=0,q2⁡t≠0,q1⁡t−q2⁡t=0,2⁢q2⁡t⁢ⅆ2ⅆt2q2⁡t+2⁢ⅆⅆtq2⁡t2−1=0,q2⁡t≠0,q1⁡t=0,q2⁡t=0
The first expression q1⁡t+q2⁡t=0, and in the second system q1⁡t−q2⁡t=0,are local constraints. The complementary constrains in the third system are q1⁡t=0,q2⁡t=0.
Painlevé test for Burgers' equations (Ex.1, Fuding Xie, Yong Chen. An algorithmic method in Painleve analysis of PDE. Computer Physics Communications 154, 197-204, 2004)
Burgers≔diffux,t,t+ux,t diffux,t,x−diffux,t,x,x;
Burgers≔∂∂tu⁡x,t+u⁡x,t⁢∂∂xu⁡x,t−∂2∂x2u⁡x,t
Application of WTC method
WTC_Bur≔subs⁡u⁡x,t=add⁡v‖j⁡x,t⁢f⁡x,tj,j=0..3f⁡x,t,Burgers
WTC_Bur≔∂∂tv0⁡x,t+v1⁡x,t⁢f⁡x,t+v2⁡x,t⁢f⁡x,t2+v3⁡x,t⁢f⁡x,t3f⁡x,t+v0⁡x,t+v1⁡x,t⁢f⁡x,t+v2⁡x,t⁢f⁡x,t2+v3⁡x,t⁢f⁡x,t3⁢∂∂xv0⁡x,t+v1⁡x,t⁢f⁡x,t+v2⁡x,t⁢f⁡x,t2+v3⁡x,t⁢f⁡x,t3f⁡x,tf⁡x,t−∂2∂x2v0⁡x,t+v1⁡x,t⁢f⁡x,t+v2⁡x,t⁢f⁡x,t2+v3⁡x,t⁢f⁡x,t3f⁡x,t
Num≔numerWTC_Bur
Num≔f⁡x,t2⁢v1⁡x,t⁢∂∂xv0⁡x,t+f⁡x,t2⁢v0⁡x,t⁢∂∂xv1⁡x,t−f⁡x,t⁢∂∂tf⁡x,t⁢v0⁡x,t+f⁡x,t⁢v0⁡x,t⁢∂∂xv0⁡x,t+2⁢f⁡x,t⁢∂∂xv0⁡x,t⁢∂∂xf⁡x,t+f⁡x,t⁢v0⁡x,t⁢∂2∂x2f⁡x,t−2⁢f⁡x,t4⁢v3⁡x,t⁢∂2∂x2f⁡x,t+f⁡x,t7⁢v3⁡x,t⁢∂∂xv3⁡x,t+2⁢f⁡x,t6⁢v3⁡x,t2⁢∂∂xf⁡x,t+f⁡x,t6⁢v2⁡x,t⁢∂∂xv3⁡x,t+f⁡x,t6⁢v3⁡x,t⁢∂∂xv2⁡x,t+f⁡x,t5⁢v1⁡x,t⁢∂∂xv3⁡x,t+f⁡x,t5⁢v2⁡x,t⁢∂∂xv2⁡x,t+f⁡x,t5⁢v3⁡x,t⁢∂∂xv1⁡x,t+f⁡x,t4⁢v2⁡x,t2⁢∂∂xf⁡x,t+f⁡x,t4⁢v1⁡x,t⁢∂∂xv2⁡x,t+2⁢f⁡x,t4⁢∂∂tf⁡x,t⁢v3⁡x,t+f⁡x,t4⁢v2⁡x,t⁢∂∂xv1⁡x,t+f⁡x,t4⁢v3⁡x,t⁢∂∂xv0⁡x,t+f⁡x,t4⁢v0⁡x,t⁢∂∂xv3⁡x,t−4⁢f⁡x,t4⁢∂∂xf⁡x,t⁢∂∂xv3⁡x,t−2⁢f⁡x,t3⁢v3⁡x,t⁢∂∂xf⁡x,t2+f⁡x,t3⁢v1⁡x,t⁢∂∂xv1⁡x,t+f⁡x,t3⁢∂∂tf⁡x,t⁢v2⁡x,t+f⁡x,t3⁢v2⁡x,t⁢∂∂xv0⁡x,t+f⁡x,t3⁢v0⁡x,t⁢∂∂xv2⁡x,t−2⁢f⁡x,t3⁢∂∂xf⁡x,t⁢∂∂xv2⁡x,t−f⁡x,t3⁢v2⁡x,t⁢∂2∂x2f⁡x,t+3⁢f⁡x,t5⁢v2⁡x,t⁢v3⁡x,t⁢∂∂xf⁡x,t+2⁢f⁡x,t4⁢v1⁡x,t⁢v3⁡x,t⁢∂∂xf⁡x,t+f⁡x,t3⁢v1⁡x,t⁢v2⁡x,t⁢∂∂xf⁡x,t+f⁡x,t3⁢v3⁡x,t⁢v0⁡x,t⁢∂∂xf⁡x,t−f⁡x,t⁢v1⁡x,t⁢v0⁡x,t⁢∂∂xf⁡x,t+f⁡x,t5⁢∂∂tv3⁡x,t+f⁡x,t4⁢∂∂tv2⁡x,t+∂∂tv1⁡x,t⁢f⁡x,t3+f⁡x,t2⁢∂∂tv0⁡x,t−v0⁡x,t2⁢∂∂xf⁡x,t−2⁢v0⁡x,t⁢∂∂xf⁡x,t2−f⁡x,t5⁢∂2∂x2v3⁡x,t−f⁡x,t4⁢∂2∂x2v2⁡x,t−f⁡x,t3⁢∂2∂x2v1⁡x,t−f⁡x,t2⁢∂2∂x2v0⁡x,t
P≔convertNum,D:
subs⁡f⁡x,t=0,P
−v0⁡x,t2⁢D1⁡f⁡x,t−2⁢v0⁡x,t⁢D1⁡f⁡x,t2
sol_v0≔solvev0⁡x,t≠0,=0,v0⁡x,t
sol_v0≔v0⁡x,t=−2⁢D1⁡f⁡x,t
convert⁡op⁡sol_v0,diff
v0⁡x,t=−2⁢∂∂xf⁡x,t
P≔expand⁡subs⁡convert⁡op⁡sol_v0,diff,Num
P≔2⁢f⁡x,t2⁢∂3∂x3f⁡x,t−2⁢f⁡x,t2⁢∂2∂t∂xf⁡x,t−4⁢f⁡x,t4⁢v3⁡x,t⁢∂2∂x2f⁡x,t+f⁡x,t7⁢v3⁡x,t⁢∂∂xv3⁡x,t+2⁢f⁡x,t6⁢v3⁡x,t2⁢∂∂xf⁡x,t+f⁡x,t6⁢v2⁡x,t⁢∂∂xv3⁡x,t+f⁡x,t6⁢v3⁡x,t⁢∂∂xv2⁡x,t+f⁡x,t5⁢v1⁡x,t⁢∂∂xv3⁡x,t+f⁡x,t5⁢v2⁡x,t⁢∂∂xv2⁡x,t+f⁡x,t5⁢v3⁡x,t⁢∂∂xv1⁡x,t+f⁡x,t4⁢v2⁡x,t2⁢∂∂xf⁡x,t+f⁡x,t4⁢v1⁡x,t⁢∂∂xv2⁡x,t+2⁢f⁡x,t4⁢∂∂tf⁡x,t⁢v3⁡x,t+f⁡x,t4⁢v2⁡x,t⁢∂∂xv1⁡x,t−6⁢f⁡x,t4⁢∂∂xf⁡x,t⁢∂∂xv3⁡x,t−4⁢f⁡x,t3⁢v3⁡x,t⁢∂∂xf⁡x,t2+f⁡x,t3⁢v1⁡x,t⁢∂∂xv1⁡x,t+f⁡x,t3⁢∂∂tf⁡x,t⁢v2⁡x,t−4⁢f⁡x,t3⁢∂∂xf⁡x,t⁢∂∂xv2⁡x,t−3⁢f⁡x,t3⁢v2⁡x,t⁢∂2∂x2f⁡x,t−2⁢f⁡x,t2⁢∂∂xf⁡x,t⁢∂∂xv1⁡x,t+2⁢f⁡x,t⁢∂∂tf⁡x,t⁢∂∂xf⁡x,t+2⁢f⁡x,t⁢v1⁡x,t⁢∂∂xf⁡x,t2−2⁢f⁡x,t⁢∂∂xf⁡x,t⁢∂2∂x2f⁡x,t−2⁢f⁡x,t2⁢v1⁡x,t⁢∂2∂x2f⁡x,t+3⁢f⁡x,t5⁢v2⁡x,t⁢v3⁡x,t⁢∂∂xf⁡x,t+2⁢f⁡x,t4⁢v1⁡x,t⁢v3⁡x,t⁢∂∂xf⁡x,t+f⁡x,t3⁢v1⁡x,t⁢v2⁡x,t⁢∂∂xf⁡x,t+f⁡x,t5⁢∂∂tv3⁡x,t+f⁡x,t4⁢∂∂tv2⁡x,t+∂∂tv1⁡x,t⁢f⁡x,t3−f⁡x,t5⁢∂2∂x2v3⁡x,t−f⁡x,t4⁢∂2∂x2v2⁡x,t−f⁡x,t3⁢∂2∂x2v1⁡x,t
P≔convertP,D:
P≔collectP,f⁡t,x:
Extraction of the coefficients at f⁡t,xj for j=1..3
forjto3dopj≔convert⁡coeff⁡P,f⁡x,t,j,diffenddo
p1≔−2⁢∂∂xf⁡x,t⁢∂2∂x2f⁡x,t+2⁢∂∂tf⁡x,t⁢∂∂xf⁡x,t+2⁢v1⁡x,t⁢∂∂xf⁡x,t2
p2≔−2⁢∂∂xv1⁡x,t⁢∂∂xf⁡x,t−2⁢v1⁡x,t⁢∂2∂x2f⁡x,t−2⁢∂2∂t∂xf⁡x,t+2⁢∂3∂x3f⁡x,t
p3≔−∂2∂x2v1⁡x,t+∂∂tv1⁡x,t−3⁢v2⁡x,t⁢∂2∂x2f⁡x,t−4⁢∂∂xf⁡x,t⁢∂∂xv2⁡x,t+∂∂tf⁡x,t⁢v2⁡x,t−4⁢v3⁡x,t⁢∂∂xf⁡x,t2+v1⁡x,t⁢∂∂xv1⁡x,t+v1⁡x,t⁢v2⁡x,t⁢∂∂xf⁡x,t
Ranking⁡x,t,v3,v2,v1,f
TD≔ThomasDecomposition⁡p1,p3
TD≔DifferentialSystem,DifferentialSystem
∂2∂x2v1⁡x,t=−4⁢v3⁡x,t⁢∂∂xf⁡x,t2−2⁢v1⁡x,t⁢v2⁡x,t⁢∂∂xf⁡x,t−2⁢∂∂tf⁡x,t⁢v2⁡x,t−4⁢∂∂xf⁡x,t⁢∂∂xv2⁡x,t+v1⁡x,t⁢∂∂xv1⁡x,t+∂∂tv1⁡x,t,∂2∂x2f⁡x,t=v1⁡x,t⁢∂∂xf⁡x,t+∂∂tf⁡x,t
EquationsTD2
∂2∂x2v1⁡x,t=∂∂tf⁡x,t⁢v2⁡x,t+v1⁡x,t⁢∂∂xv1⁡x,t+∂∂tv1⁡x,t,∂∂xf⁡x,t=0
Reduction of p2 modulo radical differential ideal generated by p1
NormalFormp2,TD1;
0
NormalFormp2,TD2;
In this context, zero in (42) and (43) means that (30) possesses the Painleve property.
Cole-Hopf transformation (Ex.3.8, T. Baechler, V. Gerdt, M. Lange-Hegermann, D. Robertz. Algebraic Thomas decomposition of algebraic and differential systems. Journal of Symbolic Computation, 47, 1233-1266, 2012)
We demonstrate how to study the Cole-Hopf transformation by using the differential Thomas decomposition.
The claim is that for every non-zero analytic solution of the heat equation
∂∂tη⁡t,x+∂2∂x2η⁡t,x=0
the function defined by
zeta⁡t,x=∂∂xη⁡t,xη⁡t,x
is a solution to Burgers' equation
2⁢∂∂xzeta⁡t,x⁢zeta⁡t,x+∂2∂x2zeta⁡t,x+∂∂tzeta⁡t,x=0
We define a ranking on the ring of differential polynomials in eta and zeta such that any partial derivative of eta is ranked higher than any partial derivative of zeta.
Rankingt,x, eta,zeta
We define the differential system which combines the heat equation in eta and Burgers' equation in zeta:
CH ≔ diffetat, x, t+diffetat, x, x, x=0, etat, x zetat, x−diffetat, x, x = 0
CH≔∂∂tη⁡t,x+∂2∂x2η⁡t,x=0,η⁡t,x⁢ζ⁡t,x−∂∂xη⁡t,x=0
We also include the assumption η≠0.
TD ≔ ThomasDecompositionCH, etat,x ≠ 0
η⁡t,x⁢ζ⁡t,x2+η⁡t,x⁢∂∂xζ⁡t,x+∂∂tη⁡t,x=0,η⁡t,x⁢ζ⁡t,x−∂∂xη⁡t,x=0,2⁢∂∂xζ⁡t,x⁢ζ⁡t,x+∂2∂x2ζ⁡t,x+∂∂tζ⁡t,x=0,η⁡t,x≠0
The simple system of the resulting Thomas decomposition allows to read off that zeta as defined above is a solution of Burgers' equation if eta is a solution of the heat equation, which proves the original claim. Conversely, since the above simple differential system is consistent with the heat equation for eta by construction, we conclude that for any solution zeta of Burgers' equation there exists a solution eta of the heat equation such that the Cole-Hopf transformation of eta is zeta.
Continuous stirred-tank reactor as nonlinear control system (Ex.1.2, H. Kwakernaak, R. Sivan. Linear Optimal Control Systems. Wiley-Interscience, New York, 1972)
The following system of nonlinear ordinary differential equations is a model of a continuous stirred-tank reactor containing dissolved material of concentration c(t) with two inputs with constant concentrations c1 and c2 and flow rates F1(t) and F2(t), respectively.
The outward flow has a flow rate proportional to the square root of the volume V(t) of liquid in the tank. We denote that square root by sV(t) and replace V(t) by sV(t)^2. The model also depends on an experimental constant k.
This model is described in Example 1.2 in H. Kwakernaak, R. Sivan, Linear Optimal Control Systems. Wiley-Interscience, New York, 1972.
A study of this model by means of the differential Thomas decomposition was first demonstrated in M. Lange-Hegermann, D. Robertz, Thomas decompositions of parametric nonlinear control systems, in: Proceedings of the 5th Symposium on System Structure and Control, Grenoble (France), pp. 291-296, 2013.
The system of equations is
2⁢sV⁡t⁢ⅆⅆtsV⁡t−F1⁡t−F2⁡t+k⁢sV⁡t=0
sV⁡t2⁢ⅆⅆtc⁡t+2⁢c⁡t⁢ⅆⅆtsV⁡t⁢sV⁡t−c2⁡t⁢F2⁡t+c⁡t⁢k⁢sV⁡t−c1⁡t⁢F1⁡t=0
Using the package DifferentialThomas we investigate the dependence of the control-theoretic behavior on configurations of the parameters c1 and c2.
The ranking is chosen so that F1 and F2 are eliminated, and if this succeeds, sV and c are also eliminated.
Ranking⁡t,F1,F2,sV,c,c1,c2
We include the equations which express that c1 and c2 do not depend on time into the system.
L ≔ 2 diffsVt, tsVt−F1t−F2t+ksVt = 0, diffct, t sVt2−c2tF2t+ctksVt−c1tF1t+2 ctdiffsVt, tsVt = 0, diffc1t, t = 0, diffc2t, t = 0
L≔2⁢sV⁡t⁢ⅆⅆtsV⁡t−F1⁡t−F2⁡t+ksV⁡t=0,sV⁡t2⁢ⅆⅆtc⁡t−c2⁡t⁢F2⁡t+c⁡t⁢ksV⁡t−c1⁡t⁢F1⁡t+2⁢c⁡t⁢ⅆⅆtsV⁡t⁢sV⁡t=0,ⅆⅆtc1⁡t=0,ⅆⅆtc2⁡t=0
TD≔ThomasDecomposition⁡L,sVt≠0,c1t≠0,c2t≠0
The three resulting simple differential systems describe different structural behavior of the control system, corresponding to different configurations of the parameters c1 and c2.
S1≔Display⁡TD1
S1≔2⁢c2⁡t⁢sV⁡t⁢ⅆⅆtsV⁡t−c2⁡t⁢F1⁡t+c2⁡t⁢ksV⁡t+c1⁡t⁢F1⁡t−sV⁡t2⁢ⅆⅆtc⁡t−c⁡t⁢ksV⁡t−2⁢c⁡t⁢ⅆⅆtsV⁡t⁢sV⁡t=0,−sV⁡t2⁢ⅆⅆtc⁡t+c2⁡t⁢F2⁡t−c⁡t⁢ksV⁡t−2⁢c⁡t⁢ⅆⅆtsV⁡t⁢sV⁡t+2⁢c1⁡t⁢sV⁡t⁢ⅆⅆtsV⁡t−c1⁡t⁢F2⁡t+c1⁡t⁢ksV⁡t=0,ⅆⅆtc1⁡t=0,ⅆⅆtc2⁡t=0,c2⁡t≠0,c1⁡t≠0,−c2⁡t+c1⁡t≠0,sV⁡t≠0
collect⁡S11,F1⁡t
−c2⁡t+c1⁡t⁢F1⁡t+2⁢c2⁡t⁢sV⁡t⁢ⅆⅆtsV⁡t−sV⁡t2⁢ⅆⅆtc⁡t−2⁢c⁡t⁢ⅆⅆtsV⁡t⁢sV⁡t+c2⁡t⁢ksV⁡t−c⁡t⁢ksV⁡t=0
collect⁡S12,F2⁡t
c2⁡t−c1⁡t⁢F2⁡t−sV⁡t2⁢ⅆⅆtc⁡t+2⁢c1⁡t⁢sV⁡t⁢ⅆⅆtsV⁡t−2⁢c⁡t⁢ⅆⅆtsV⁡t⁢sV⁡t+c1⁡t⁢ksV⁡t−c⁡t⁢ksV⁡t=0
The previous two equations show that F1(t) and F2(t) are observable with respect to c(t) and sV(t). This is true for the configuration of parameters c1 and c2 described by the first simple system S1. Besides the third and fourth equations for c1 and c2, which were part of the input, the first simple system does not contain any equation not involving F1(t) and F2(t). Due to the choice of ranking we conclude that there exist no consequences of the system which only involve c(t) and sV(t) (and possibly c1 and c2). Since F1(t) and F2(t) are observable with respect to c and sV, we conclude that (c(t), sV(t)) is a flat output of the system.
S2≔Display⁡TD2
S2≔sV⁡t2⁢ⅆⅆtc⁡t+c⁡t⁢F1⁡t−c2⁡t⁢F1⁡t+c⁡t⁢F2⁡t−c2⁡t⁢F2⁡t=0,2⁢c2⁡t⁢sV⁡t⁢ⅆⅆtsV⁡t−sV⁡t2⁢ⅆⅆtc⁡t−2⁢c⁡t⁢ⅆⅆtsV⁡t⁢sV⁡t+c2⁡t⁢ksV⁡t−c⁡t⁢ksV⁡t=0,−c2⁡t+c1⁡t=0,ⅆⅆtc2⁡t=0,c2⁡t≠0,sV⁡t≠0,c⁡t−c2⁡t≠0
S3≔Display⁡TD3
S3≔2⁢sV⁡t⁢ⅆⅆtsV⁡t−F1⁡t−F2⁡t+ksV⁡t=0,c⁡t−c2⁡t=0,−c2⁡t+c1⁡t=0,ⅆⅆtc2⁡t=0,c2⁡t≠0,sV⁡t≠0
We note that the second and third simple systems S2 and S3 describe behaviors of the system for which the parameters c1 and c2 are equal. In this configuration we find consequences which involve c(t) and/or sV(t) only (together with the parameters c1 and c2), which shows that (c(t), sV(t)) is not a flat output of the system in this case.
Singular solutions of ODEs
J. F. Ritt. Differential Algebra, American Mathematical Society, New York, N. Y., 1950. II.§4, II.§19
Ranking⁡t,u
We show two types of singular solutions, which are found by the differential Thomas decomposition. The first system contains envelopes.
res ≔ ThomasDecompositiondiffut, t2−ut
res≔DifferentialSystem,DifferentialSystem
Display⁡res
−ⅆⅆtu⁡t2+u⁡t=0,u⁡t≠0,u⁡t=0
pdsolve1
u⁡t=14⁢t2−12⁢t⁢_C1+14⁢_C12
plots:-displayplotmapa→subs_C1=a,rhs1,$−5..5,t=−3..3,0..10,color=black$11,plot0,−3..3,thickness=3,color=red;
The second kind of singular solutions are limits, i.e. the power series expansions of a general solution can come arbitrarily close to the singular solution.
res ≔ ThomasDecomposition−ut3+diffut, t2
Displayres;
u⁡t3−ⅆⅆtu⁡t2=0,u⁡t≠0,u⁡t=0
u⁡t=𝒫⁡213⁢t2+_C1;0,0⁢223
Ex.2.2.60, D. Robertz. Formal Algorithmic Elimination for PDEs. Lecture Notes in Mathematics, Vol. 2121. Springer, Cham, 2014
This example demonstrate that the differential Thomas decomposition naturally distinguishes cases so that singular solutions are separated from the general solution.
We consider the following nonlinear ODE:
L ≔ diffut,t2−4 t diffut,t−4 ut+8 t2=0
L≔ⅆⅆtu⁡t2−4⁢t⁢ⅆⅆtu⁡t−4⁢u⁡t+8⁢t2=0
TD≔ThomasDecomposition⁡L
The first simple system of the Thomas decomposition yields the general solution of the given ODE:
S1≔ⅆⅆtu⁡t2−4⁢t⁢ⅆⅆtu⁡t−4⁢u⁡t+8⁢t2=0,t2−u⁡t≠0
The inequation contained in the first simple system is a consequence of the assumption that the separant of the given ODE does not vanish.
The second simple system defines a singular solution, which is a solution of the given ODE for which the separant vanishes.
S2≔t2−u⁡t=0
As illustration we plot a few trajectories belonging to the general solution given by S1 as well as the singular solution given by S2 in the same diagram.
P ≔ map⁡c→2⁢t+c2+c2,$−5..10
P≔2⁢t−52+50,2⁢t−42+32,2⁢t−32+18,2⁢t−22+8,2⁢t−12+2,2⁢t2,2⁢t+12+2,2⁢t+22+8,2⁢t+32+18,2⁢t+42+32,2⁢t+52+50,2⁢t+62+72,2⁢t+72+98,2⁢t+82+128,2⁢t+92+162,2⁢t+102+200
plott2,op⁡P,t=−30..20
Note that the singular solution is an envelope of the general solution.
An example of an ODE not solved using DifferentialAlgebra or DEtools:-rifsimp
This example, from Kamke's book on ODEs, demonstrates different behavior of the packages DifferentialThomas, DifferentialAlgebra and DEtools.
Ranking⁡x,y
L ≔ 2 yx diffyx,x,x−diffyx,x23 + 32 diffyx,x,x x diffyx,x,x − diffyx,x3=0
L≔2⁢y⁡x⁢ⅆ2ⅆx2y⁡x−ⅆⅆxy⁡x23+32⁢ⅆ2ⅆx2y⁡x⁢x⁢ⅆ2ⅆx2y⁡x−ⅆⅆxy⁡x3=0
T≔ThomasDecomposition⁡L
T≔DifferentialSystem,DifferentialSystem,DifferentialSystem,DifferentialSystem,DifferentialSystem
We obtain a Thomas decomposition for the given ODE with five simple differential systems.
Display⁡T1
32⁢x3⁢ⅆ2ⅆx2y⁡x4−96⁢x2⁢ⅆⅆxy⁡x⁢ⅆ2ⅆx2y⁡x3+8⁢y⁡x3⁢ⅆ2ⅆx2y⁡x3−12⁢y⁡x2⁢ⅆⅆxy⁡x2⁢ⅆ2ⅆx2y⁡x2+6⁢y⁡x⁢ⅆⅆxy⁡x4⁢ⅆ2ⅆx2y⁡x−ⅆⅆxy⁡x6+96⁢x⁢ⅆⅆxy⁡x2⁢ⅆ2ⅆx2y⁡x2−32⁢ⅆⅆxy⁡x3⁢ⅆ2ⅆx2y⁡x=0,y⁡x2+8⁢x≠0,−y⁡x2+8⁢x≠0,x⁢ⅆⅆxy⁡x−2⁢y⁡x≠0,ⅆⅆxy⁡x≠0,y⁡x≠0,512⁢x3⁢ⅆⅆxy⁡x3−768⁢x2⁢y⁡x⁢ⅆⅆxy⁡x2+27⁢y⁡x4⁢ⅆⅆxy⁡x−48⁢x⁢y⁡x2⁢ⅆⅆxy⁡x+1728⁢x2⁢ⅆⅆxy⁡x−64⁢y⁡x3≠0
Display⁡T2
512⁢x3⁢ⅆⅆxy⁡x3−768⁢x2⁢y⁡x⁢ⅆⅆxy⁡x2+27⁢y⁡x4⁢ⅆⅆxy⁡x−48⁢x⁢y⁡x2⁢ⅆⅆxy⁡x+1728⁢x2⁢ⅆⅆxy⁡x−64⁢y⁡x3=0,y⁡x2+8⁢x≠0,−y⁡x2+8⁢x≠0
Display⁡T3
x⁢ⅆⅆxy⁡x−2⁢y⁡x=0,y⁡x≠0,y⁡x2+8⁢x≠0
Display⁡T4
ⅆⅆxy⁡x=0,y⁡x≠0
Display⁡T5
−y⁡x2+8⁢x=0
The DifferentialAlgebra package and the command rifsimp (in Maple 2017) do not terminate on the same input in reasonable time.
Automatic theorem proving: evolute of a tractrix (M. Lange-Hegermann, Counting Solutions of Differential Equations, PhD thesis, RWTH Aachen University, 2014)
Reduction differential equations w.r.t. simple differential system us allows to prove theorems automatically by deciding whether certain equations are consequences of a differential system.
As an example, we look at the relation of two curves, the template xt,Yt and the tractrix xt,yt. The template curve pulls the tractrix curve as if these two curves were connected by a fixed rod. The tractrix moves in the direction of the template but keeps a constant distance d; thus, it is also called curve of pursuit. The template pushes the tractrix away when it moves in the direction of the tractrix. Thereby, one can model the parking process of a truck.
We prove that the evolute of the tractrix is given by the intersection points of the normals of template and tractrix.
Set the ranking.
In the following, the (algebraic) parameter d stands for the distance. As it is a constant, we have ⅆⅆ tdt.
Ranking⁡t,x,y,X,Y,d
The next simple procedure symbolically computes the normal ξ,η of a curve X,Y.
NormalDirection ≔ procX,YdiffX,t X − xi+diffY,t Y − etaend
NormalDirection≔procX,Ydiff⁡X,t*X − ξ+diff⁡Y,t*Y − ηend
The following differential equations describe the interrelation of template and tractrix curve.
L≔X⁡t−x⁡t2+Y⁡t−y⁡t2−d⁡t2=0, # distance d−ⅆⅆty⁡t⁢X⁡t−x⁡t+ⅆⅆtx⁡t⁢Y⁡t−y⁡t=0, # the tractrix moves in the direction of the template.ⅆⅆtdt=0 # distance is constant
L≔X⁡t−x⁡t2+Y⁡t−y⁡t2−d⁡t2=0,−ⅆⅆty⁡t⁢X⁡t−x⁡t+ⅆⅆtx⁡t⁢Y⁡t−y⁡t=0,ⅆⅆtd⁡t=0
Symbolically compute the intersection of the normals of template and tractrix:
Ntrac≔NormalDirection⁡x⁡t,y⁡t
Ntrac≔ⅆⅆtx⁡t⁢x⁡t−ξ+ⅆⅆty⁡t⁢y⁡t−η
Ntemp≔NormalDirection⁡X⁡t,Y⁡t
Ntemp≔ⅆⅆtX⁡t⁢X⁡t−ξ+ⅆⅆtY⁡t⁢Y⁡t−η
s≔solveNtrac,Ntemp,xi,eta
s≔η=−X⁡t⁢ⅆⅆtX⁡t⁢ⅆⅆtx⁡t−ⅆⅆtX⁡t⁢ⅆⅆtx⁡t⁢x⁡t−ⅆⅆtX⁡t⁢ⅆⅆty⁡t⁢y⁡t+ⅆⅆtY⁡t⁢Y⁡t⁢ⅆⅆtx⁡tⅆⅆty⁡t⁢ⅆⅆtX⁡t−ⅆⅆtx⁡t⁢ⅆⅆtY⁡t,ξ=X⁡t⁢ⅆⅆtX⁡t⁢ⅆⅆty⁡t+ⅆⅆtY⁡t⁢Y⁡t⁢ⅆⅆty⁡t−ⅆⅆtx⁡t⁢x⁡t⁢ⅆⅆtY⁡t−ⅆⅆty⁡t⁢y⁡t⁢ⅆⅆtY⁡tⅆⅆty⁡t⁢ⅆⅆtX⁡t−ⅆⅆtx⁡t⁢ⅆⅆtY⁡t
Compute the evolute:
evo≔solveNtrac, DifferentiateNtrac,t,xi,eta
evo≔η=−ⅆⅆtx⁡t⁢x⁡t⁢x2−ⅆⅆtx⁡t⁢x0⁢x2−ⅆⅆtx⁡t⁢x12−ⅆⅆtx⁡t⁢y0⁢y2−ⅆⅆtx⁡t⁢y12+ⅆⅆty⁡t⁢y⁡t⁢x2ⅆⅆtx⁡t⁢y2−ⅆⅆty⁡t⁢x2,ξ=ⅆⅆtx⁡t⁢x⁡t⁢y2+ⅆⅆty⁡t⁢y⁡t⁢y2−ⅆⅆty⁡t⁢x0⁢x2−ⅆⅆty⁡t⁢x12−ⅆⅆty⁡t⁢y0⁢y2−ⅆⅆty⁡t⁢y12ⅆⅆtx⁡t⁢y2−ⅆⅆty⁡t⁢x2
Check whether these two solutions are equivalent modulo our equations, i.e., whether their difference is zero modulo our equations.
Compute simple differential systems from the equations
res ≔ ThomasDecompositionL, −diffyt, t diffXt, t+diffxt, t diffYt, t≠0
and reduce the difference with respect to both systems to zero
differences≔ numersubsevo,eta−subss,eta, numersubsevo,zeta−subss,zeta
differences≔ⅆⅆtx⁡t⁢X⁡t⁢ⅆⅆtX⁡t⁢ⅆⅆtx⁡t⁢y2−X⁡t⁢ⅆⅆtX⁡t⁢ⅆⅆty⁡t⁢x2−ⅆⅆtX⁡t⁢ⅆⅆtx⁡t⁢x⁡t⁢y2−ⅆⅆtX⁡t⁢ⅆⅆty⁡t⁢y⁡t⁢y2+ⅆⅆtX⁡t⁢ⅆⅆty⁡t⁢x0⁢x2+ⅆⅆtX⁡t⁢ⅆⅆty⁡t⁢x12+ⅆⅆtX⁡t⁢ⅆⅆty⁡t⁢y0⁢y2+ⅆⅆtX⁡t⁢ⅆⅆty⁡t⁢y12+ⅆⅆtY⁡t⁢Y⁡t⁢ⅆⅆtx⁡t⁢y2−ⅆⅆtY⁡t⁢Y⁡t⁢ⅆⅆty⁡t⁢x2+ⅆⅆtY⁡t⁢ⅆⅆtx⁡t⁢x⁡t⁢x2−ⅆⅆtY⁡t⁢ⅆⅆtx⁡t⁢x0⁢x2−ⅆⅆtY⁡t⁢ⅆⅆtx⁡t⁢x12−ⅆⅆtY⁡t⁢ⅆⅆtx⁡t⁢y0⁢y2−ⅆⅆtY⁡t⁢ⅆⅆtx⁡t⁢y12+ⅆⅆtY⁡t⁢ⅆⅆty⁡t⁢y⁡t⁢x2,0
ReducedFormres1,differences
0,0
ReducedFormres2,differences
which implies the claim.
Parameter identification in predator-prey equations (M. Lange-Hegermann. Counting Solutions of Differential Equations. PhD thesis, RWTH Aachen University, 2014)
Consider the Lotka-Volterra (predator-prey) equations.
ⅆⅆ t xt=xt α−βyt
ⅆⅆ t yt=yt −γ+δat
In them xt models the number of prey and yt number of predators. Furthermore, α, β, γ,and δ are constants. The goal of this example is to demonstrate elimination for parameter identification, i.e., to express the parameters α, β, γ,and δ in terms of the functions xt and yt. The parameters cannot directly be measured in nature, but the amount of predator and prey can (to a certain extend). Therefore, using a block ranking with α, β, γ, δ≪x,y, we model the parameters as functions with derivative zero.
For a better presentation, exclude the trivial cases where ⅆⅆ t xt≠0 or ⅆⅆ t yt≠0.
ivar≔t:dvar≔alpha,beta,gamma,delta,x,y: ivar,dvar1..4,dvar5..6;
t,α,β,γ,δ,x,y
Rankingt,α,β,γ,δ,x,y
sys ≔ diffxt, t−xt −betat yt+alphat = 0, diffyt, t−yt deltat xt−gammat = 0, diffalphat, t = 0, diffbetat, t = 0, diffgammat, t = 0, diffdeltat, t = 0,diffxt, t ≠ 0, diffyt, t ≠ 0
sys≔ⅆⅆtx⁡t−x⁡t⁢−β⁡t⁢y⁡t+α⁡t=0,ⅆⅆty⁡t−y⁡t⁢δ⁡t⁢x⁡t−γ⁡t=0,ⅆⅆtα⁡t=0,ⅆⅆtβ⁡t=0,ⅆⅆtγ⁡t=0,ⅆⅆtδ⁡t=0,ⅆⅆtx⁡t≠0,ⅆⅆty⁡t≠0
res≔ThomasDecompositionsys;
res≔DifferentialSystem
The differential Thomas decomposition results in a single simple differential system. In this system, one can solve for the constants α,β,γ,δ and see that there exist two equations in xt and yt only, characterizing all possible solutions of the Lotka-Volterra equations:
A, XY ≔ selectremovehas,Equationsres1, alpha,beta,gamma,delta:
The solutions
A
α⁡t=x⁡t⁢ⅆⅆtx⁡t⁢ⅆⅆty⁡t−x⁡t⁢ⅆ2ⅆt2x⁡t⁢y⁡t+ⅆⅆtx⁡t2⁢y⁡tx⁡t2⁢ⅆⅆty⁡t,β⁡t=−ⅆ2ⅆt2x⁡t⁢x⁡t+ⅆⅆtx⁡t2x⁡t2⁢ⅆⅆty⁡t,γ⁡t=−−x⁡t⁢y⁡t⁢ⅆ2ⅆt2y⁡t+x⁡t⁢ⅆⅆty⁡t2+ⅆⅆtx⁡t⁢y⁡t⁢ⅆⅆty⁡tⅆⅆtx⁡t⁢y⁡t2,δ⁡t=ⅆ2ⅆt2y⁡t⁢y⁡t−ⅆⅆty⁡t2ⅆⅆtx⁡t⁢y⁡t2
The equations on xt and yt
XY
ⅆ3ⅆt3x⁡t=−−x⁡t2⁢ⅆ2ⅆt2x⁡t⁢ⅆ2ⅆt2y⁡t+x⁡t⁢ⅆⅆtx⁡t2⁢ⅆ2ⅆt2y⁡t−3⁢x⁡t⁢ⅆⅆtx⁡t⁢ⅆ2ⅆt2x⁡t⁢ⅆⅆty⁡t+2⁢ⅆⅆtx⁡t3⁢ⅆⅆty⁡tx⁡t2⁢ⅆⅆty⁡t,ⅆ3ⅆt3y⁡t=3⁢ⅆⅆtx⁡t⁢y⁡t⁢ⅆⅆty⁡t⁢ⅆ2ⅆt2y⁡t−2⁢ⅆⅆtx⁡t⁢ⅆⅆty⁡t3+ⅆ2ⅆt2x⁡t⁢y⁡t2⁢ⅆ2ⅆt2y⁡t−ⅆ2ⅆt2x⁡t⁢y⁡t⁢ⅆⅆty⁡t2ⅆⅆtx⁡t⁢y⁡t2
Return to Index of Example Worksheets
Download Help Document