solegs.mw
Solving Two Dimensional Systems of Linear Differential Equations.
| > |
restart; with(LinearAlgebra): |
A utiity procedure.
| > |
buildsys := proc(mat)
{diff(x(t),t)=mat[1,1]*x(t)+mat[1,2]*y(t), diff(y(t),t)=mat[2,1]*x(t)+mat[2,2]*y(t)};
end; |
Diagonializable, real eigenvalues.
| > |
A := Matrix([[-4, 6], [-3, 5]]); |
Initial Condition
Maple's Solution
| > |
sol := dsolve(sys union {x(0)=a, y(0)=b}, [x(t),y(t)]); |
Now, we'll solve it.
| > |
evv := Eigenvectors(A); |
| > |
zmat := DiagonalMatrix([exp(2*t), exp(-t)]); |
| > |
xsol := P.zmat.P^(-1).xno; |
Rearrange to compare with Maple.
| > |
map(collect, %, [exp(2*t), exp(-t)]); |
Diagonalizable, nonreal eigenvalues.
| > |
A := Matrix([[11, -6], [15, -7]]); |
| > |
dsol:=dsolve(sys union {x(0)=a, y(0)=b}, [x(t), y(t)]); |
| > |
evv := Eigenvectors(A); |
| > |
zmat := << exp(2*t)*cos(3*t)|-exp(2*t)*sin(3*t)>,
<exp(2*t)*sin(3*t)| exp(2*t)*cos(3*t)>>; |
| > |
xsol := Q.zmat.Q^(-1).xno; |
To check that this is the same as Maple's solution, create differences
| > |
{x(t)-xsol[1], y(t)-xsol[2]}; |
Now substitute Maple's solutions for
and
Nondiagonalizable.
| > |
A := Matrix([[-8/3, 4/3], [-1/3, -4/3]]); |
| > |
dsol := dsolve(sys union {y(0)=b, x(0)=a}, [x(t), y(t)]); |
| > |
evv := Eigenvectors(A); |
Pick some vector independent of
This is
Adjust
This is
Tis normalization gives us the 1 in the matrix B below.
| > |
zmat := << exp(-2*t) | t*exp(-2*t)>, <0| exp(-2*t)>>; |
| > |
xsol := P.zmat.P^(-1).xno; |
| > |
{x(t)-xsol[1], y(t)-xsol[2]}; |