DEtools
matrixDE
find solutions of a linear system of ODEs in matrix form
Calling Sequence
Parameters
Description
Examples
matrixDE(A, B, t, method=matrixexp)
matrixDE(A, B, t, solution=solntype)
A, B
-
coefficients of a system X⁢' ⁢t=A⁡t⁢X⁡t+B⁡t ; if B not specified, then assumed to be a zero vector
t
independent variable of the system
method=matrixexp
(optional) matrix exponentials
solution=solntype
(optional) where solution=polynomial or solution=rational
The matrixDE command solves a system of linear ODEs of the form X'⁡t=A⁡t⁢X⁡t+B⁡t. If B is not specified then it is assumed to be the zero vector.
An option of the form method = matrixexp can be specified to use matrix exponentials (in the case of constant coefficients).
An option of the form solution = polynomial or solution = rational can be specified to search for polynomial or rational solution. In this case, the function invokes LinearFunctionalSystems[PolynomialSolution] or LinearFunctionalSystems[RationalSolution].
The command returns a pair S⁡t,P⁡t with S⁡t, which is an n by n matrix, and P⁡t, which is an n by 1 vector. If you want the result expressed using Matrix instead, then use convert/Matrix on S(t).
A particular solution of the system can be then written in the form F⁡t=S⁡t⁢C0+P⁡t where C0 is n by 1 and F⁡0=C0+P⁡0. If B is zero then P will also be zero.
If a system is expressed in terms of equations, dsolve can be used instead.
with⁡DEtools:
Nonconstant homogeneous system
A≔Matrix⁡2,2,1,t2,t,1
A≔1t2t1
sol≔matrixDE⁡A,t
sol≔ⅇt⁢t32⁢BesselI⁡35,2⁢t525ⅇt⁢t32⁢BesselK⁡35,2⁢t525ⅇt⁢BesselI⁡−25,2⁢t525⁢t−ⅇt⁢BesselK⁡25,2⁢t525⁢t,00
Matrix of arbitrary coefficients
C≔Matrix⁡2,1:
Verification of solution
F≔evalm⁡sol1&*C+sol2:rh≔evalm⁡A&*F:
simplify⁡normal⁡diff⁡F1,1,t−rh1,1,symbolic
0
simplify⁡normal⁡diff⁡F2,1,t−rh2,1,symbolic
Nonhomogeneous system of two variables with constant coefficients
A≔Matrix⁡2,2,1,1,0,1;B≔Matrix⁡2,1,tk,tl
A≔1101
B≔tktl
sol≔matrixDE⁡A,B,t
sol≔ⅇtⅇt⁢t0ⅇt,−ⅇt2⁢tl2⁢WhittakerM⁡l2,l2+12,t⁢k⁢l+k⁢tl2+1⁢WhittakerM⁡l2,l2+12,t⁢ⅇt2+ⅇt2⁢tk2⁢WhittakerM⁡k2,k2+12,t⁢l−ⅇt2⁢tl2⁢WhittakerM⁡l2,l2+12,t⁢k−ⅇt2⁢tl2⁢WhittakerM⁡l2,l2+12,t⁢l+tl+1⁢k⁢l+tl2+1⁢WhittakerM⁡l2,l2+12,t⁢ⅇt2+ⅇt2⁢tk2⁢WhittakerM⁡k2,k2+12,t−ⅇt2⁢tl2⁢WhittakerM⁡l2,l2+12,t+tl+1⁢k+tl+1⁢l+tl+1k+1⁢l+1−ⅇt2⁢tl2⁢WhittakerM⁡l2+1,l2+12,t⁢l2+tl2+1⁢ⅇt2⁢WhittakerM⁡l2+1,l2+12,t⁢l+ⅇt2⁢tk2⁢WhittakerM⁡k2+1,k2+12,t⁢l−2⁢ⅇt2⁢tl2⁢WhittakerM⁡l2+1,l2+12,t⁢l+tl+1⁢l2−tl+1⁢l⁢t+tl2+1⁢WhittakerM⁡l2,l2+12,t⁢ⅇt2+tl2+1⁢ⅇt2⁢WhittakerM⁡l2+1,l2+12,t+ⅇt2⁢tk2⁢WhittakerM⁡k2+1,k2+12,t−ⅇt2⁢tl2⁢WhittakerM⁡l2+1,l2+12,t−tk⁢l⁢t+2⁢tl+1⁢l−tl+1⁢t−tk⁢t+tl+1l+1⁢t
F≔evalm⁡sol1&*C+sol2:rh≔evalm⁡A&*F+B:
Nonconstant homogeneous system with unknown coefficients
A≔Matrix⁡2,2,1,0,1,f⁡t
A≔101f⁡t
sol≔−f⁡t⁢DESol⁡ⅆ2ⅆt2_Y⁡t−ⅆⅆt_Y⁡t⁢f⁡t−ⅆⅆt_Y⁡t−_Y⁡t⁢ⅆⅆtf⁡t+f⁡t⁢_Y⁡t,_Y⁡t+ⅆⅆtDESol⁡ⅆ2ⅆt2_Y⁡t−ⅆⅆt_Y⁡t⁢f⁡t−ⅆⅆt_Y⁡t−_Y⁡t⁢ⅆⅆtf⁡t+f⁡t⁢_Y⁡t,_Y⁡tDESol⁡ⅆ2ⅆt2_Y⁡t−ⅆⅆt_Y⁡t⁢f⁡t−ⅆⅆt_Y⁡t−_Y⁡t⁢ⅆⅆtf⁡t+f⁡t⁢_Y⁡t,_Y⁡t,00
General nonhomogeneous system of two variables with constant coefficients
A≔Matrix⁡2,2,a,b,c,d
A≔abcd
B≔Matrix⁡2,1,f⁡t,g⁡t
B≔f⁡tg⁡t
sol≔ⅇ−−a−d+a2−2⁢a⁢d+4⁢b⁢c+d2⁢t2ⅇa+d+a2−2⁢a⁢d+4⁢b⁢c+d2⁢t2−ⅇ−−a−d+a2−2⁢a⁢d+4⁢b⁢c+d2⁢t2⁢−d+a+a2−2⁢a⁢d+4⁢b⁢c+d22⁢bⅇa+d+a2−2⁢a⁢d+4⁢b⁢c+d2⁢t2⁢d−a+a2−2⁢a⁢d+4⁢b⁢c+d22⁢b,∫−f⁡t⁢d+ⅆⅆtf⁡t+b⁢g⁡t⁢ⅇ−a+d+a2−2⁢a⁢d+4⁢b⁢c+d2⁢t2ⅆt⁢ⅇa+d+a2−2⁢a⁢d+4⁢b⁢c+d2⁢t2−∫−f⁡t⁢d+ⅆⅆtf⁡t+b⁢g⁡t⁢ⅇ−a−d+a2−2⁢a⁢d+4⁢b⁢c+d2⁢t2ⅆt⁢ⅇ−−a−d+a2−2⁢a⁢d+4⁢b⁢c+d2⁢t2a2−2⁢a⁢d+4⁢b⁢c+d2−2⁢ⅇ−a−d+a2−2⁢a⁢d+4⁢b⁢c+d2⁢t2⁢ⅇ−−a−d+a2−2⁢a⁢d+4⁢b⁢c+d2⁢t2⁢g⁡t⁢b−2⁢ⅇ−a−d+a2−2⁢a⁢d+4⁢b⁢c+d2⁢t2⁢ⅇ−−a−d+a2−2⁢a⁢d+4⁢b⁢c+d2⁢t2⁢f⁡t⁢d−2⁢ⅇ−a+d+a2−2⁢a⁢d+4⁢b⁢c+d2⁢t2⁢ⅇa+d+a2−2⁢a⁢d+4⁢b⁢c+d2⁢t2⁢g⁡t⁢b+2⁢ⅇ−a+d+a2−2⁢a⁢d+4⁢b⁢c+d2⁢t2⁢ⅇa+d+a2−2⁢a⁢d+4⁢b⁢c+d2⁢t2⁢f⁡t⁢d+2⁢ⅇ−a−d+a2−2⁢a⁢d+4⁢b⁢c+d2⁢t2⁢ⅇ−−a−d+a2−2⁢a⁢d+4⁢b⁢c+d2⁢t2⁢ⅆⅆtf⁡t−2⁢ⅇ−a+d+a2−2⁢a⁢d+4⁢b⁢c+d2⁢t2⁢ⅇa+d+a2−2⁢a⁢d+4⁢b⁢c+d2⁢t2⁢ⅆⅆtf⁡t−∫−f⁡t⁢d+ⅆⅆtf⁡t+b⁢g⁡t⁢ⅇ−a+d+a2−2⁢a⁢d+4⁢b⁢c+d2⁢t2ⅆt⁢ⅇa+d+a2−2⁢a⁢d+4⁢b⁢c+d2⁢t2⁢a2−2⁢a⁢d+4⁢b⁢c+d2+∫−f⁡t⁢d+ⅆⅆtf⁡t+b⁢g⁡t⁢ⅇ−a+d+a2−2⁢a⁢d+4⁢b⁢c+d2⁢t2ⅆt⁢ⅇa+d+a2−2⁢a⁢d+4⁢b⁢c+d2⁢t2⁢a−∫−f⁡t⁢d+ⅆⅆtf⁡t+b⁢g⁡t⁢ⅇ−a+d+a2−2⁢a⁢d+4⁢b⁢c+d2⁢t2ⅆt⁢ⅇa+d+a2−2⁢a⁢d+4⁢b⁢c+d2⁢t2⁢d−∫−f⁡t⁢d+ⅆⅆtf⁡t+b⁢g⁡t⁢ⅇ−a−d+a2−2⁢a⁢d+4⁢b⁢c+d2⁢t2ⅆt⁢ⅇ−−a−d+a2−2⁢a⁢d+4⁢b⁢c+d2⁢t2⁢a2−2⁢a⁢d+4⁢b⁢c+d2−∫−f⁡t⁢d+ⅆⅆtf⁡t+b⁢g⁡t⁢ⅇ−a−d+a2−2⁢a⁢d+4⁢b⁢c+d2⁢t2ⅆt⁢ⅇ−−a−d+a2−2⁢a⁢d+4⁢b⁢c+d2⁢t2⁢a+∫−f⁡t⁢d+ⅆⅆtf⁡t+b⁢g⁡t⁢ⅇ−a−d+a2−2⁢a⁢d+4⁢b⁢c+d2⁢t2ⅆt⁢ⅇ−−a−d+a2−2⁢a⁢d+4⁢b⁢c+d2⁢t2⁢d+2⁢f⁡t⁢a2−2⁢a⁢d+4⁢b⁢c+d22⁢b⁢a2−2⁢a⁢d+4⁢b⁢c+d2
sol≔matrixDE⁡A,t,method=matrixexp
sol≔a2−2⁢a⁢d+4⁢b⁢c+d2⁢ⅇa+d+a2−2⁢a⁢d+4⁢b⁢c+d2⁢t2+a⁢ⅇa+d+a2−2⁢a⁢d+4⁢b⁢c+d2⁢t2−d⁢ⅇa+d+a2−2⁢a⁢d+4⁢b⁢c+d2⁢t2+a2−2⁢a⁢d+4⁢b⁢c+d2⁢ⅇ−−a−d+a2−2⁢a⁢d+4⁢b⁢c+d2⁢t2−a⁢ⅇ−−a−d+a2−2⁢a⁢d+4⁢b⁢c+d2⁢t2+d⁢ⅇ−−a−d+a2−2⁢a⁢d+4⁢b⁢c+d2⁢t22⁢a2−2⁢a⁢d+4⁢b⁢c+d2b⁢ⅇa+d+a2−2⁢a⁢d+4⁢b⁢c+d2⁢t2−ⅇ−−a−d+a2−2⁢a⁢d+4⁢b⁢c+d2⁢t2a2−2⁢a⁢d+4⁢b⁢c+d2c⁢ⅇa+d+a2−2⁢a⁢d+4⁢b⁢c+d2⁢t2−ⅇ−−a−d+a2−2⁢a⁢d+4⁢b⁢c+d2⁢t2a2−2⁢a⁢d+4⁢b⁢c+d2a2−2⁢a⁢d+4⁢b⁢c+d2⁢ⅇa+d+a2−2⁢a⁢d+4⁢b⁢c+d2⁢t2−a⁢ⅇa+d+a2−2⁢a⁢d+4⁢b⁢c+d2⁢t2+d⁢ⅇa+d+a2−2⁢a⁢d+4⁢b⁢c+d2⁢t2+a2−2⁢a⁢d+4⁢b⁢c+d2⁢ⅇ−−a−d+a2−2⁢a⁢d+4⁢b⁢c+d2⁢t2+a⁢ⅇ−−a−d+a2−2⁢a⁢d+4⁢b⁢c+d2⁢t2−d⁢ⅇ−−a−d+a2−2⁢a⁢d+4⁢b⁢c+d2⁢t22⁢a2−2⁢a⁢d+4⁢b⁢c+d2,00
Finding a polynomial solution
M≔Matrix⁡6,6,0,1,0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,0,2,2⁢x,0,0,1,0,x2,0,2⁢x,0,0,1,0,x2,−2,0,0,0
M≔01000000110000001022⁢x0010x202⁢x0010x2−2000
sol≔matrixDE⁡M,x,solution=polynomial
sol≔01x0000010001−x−x2000−1xx20000−1−2⁢x000−2⁢xx2x3−2000,000000
See Also
dsolve
LinearFunctionalSystems[PolynomialSolution]
LinearFunctionalSystems[RationalSolution]
Download Help Document