Chapter 12 - Eigenvalues and Eigenvectors

Section 12.4 - Solving a Square First-Order Linear System of Differential Equations

Example 12.4.1

A={{5.,-9.,1.},{-9.,2.,π},{1.,π,-4.}};

(Q=Transpose[N[Eigenvectors[A]]])//MatrixForm

EigVals=N[Eigenvalues[A]]

(Diag=DiagonalMatrix[EigVals])//MatrixForm

Q.Diag.Inverse[Q]//MatrixForm

N[A]//MatrixForm

(eDiag=DiagonalMatrix[(E^(EigVals t))])//MatrixForm

(eAt=Chop[Simplify[Q.eDiag.Inverse[Q]]])//MatrixForm

X0={{7},{15},{21}};

(X=Chop[Simplify[eAt.X0]])//MatrixForm

X/.t->0

(DX=D[X,t])//MatrixForm

Simplify[A.X]//MatrixForm

X1=Q[[All,1]]

X2=Q[[All,2]]

X3=Q[[All,3]]

LeftSideSystem=a X1+b X2+c X3

CoeffsA=Solve[{LeftSideSystem==Flatten[X0]},{a,b,c}]

Flatten[Inverse[Q].X0]

(a Exp[EigVals[[1]] t] X1+b Exp[EigVals[[2]] t] X2+c Exp[EigVals[[3]] t] X3)/.Flatten[CoeffsA]

X//MatrixForm

RHS=Flatten[A.{{x[t]},{y[t]},{z[t]}}];

Solns=DSolve[{x'[t]==RHS[[1]],y'[t]==RHS[[2]],z'[t]==RHS[[3]],x[0]==7,y[0]==15,z[0]==21},{x[t],y[t],z[t]},t][[1]];

Expand[{x[t],y[t],z[t]}/.Solns]

PlotX0=Graphics3D[{Red,PointSize[0.03],Point[Flatten[X0]]}];

PlotSoln=ParametricPlot3D[{x[t],y[t],z[t]}/.Solns,{t,-0.25,0.25},PlotRange->All,PlotStyle->{Blue,Thickness[0.007]}];

Show[PlotSoln,PlotX0]

Example 12.4.2

A={{-2.,9.,-1.},{-4.,1.,-π},{5.,-3.,4.}};

(Q=Chop[Transpose[N[Eigenvectors[A]]]])//MatrixForm

EigVals=N[Eigenvalues[A]]

(Diag=Chop[DiagonalMatrix[EigVals]])//MatrixForm

Chop[Q.Diag.Inverse[Q]]//MatrixForm

A//MatrixForm

(eDiag=DiagonalMatrix[(E^(EigVals t))])//MatrixForm

eAt=Chop[Simplify[Q.eDiag.Inverse[Q]]]

X0={{-6},{10},{7}};

X=Simplify[eAt.X0]

Chop[X/.t->0]

(XNew=ComplexExpand[Re[Simplify[X]]])//MatrixForm

XNew/.t->0

(DXNew=Simplify[D[XNew,t]])//MatrixForm

Simplify[A.XNew]//MatrixForm

PlotX0=Graphics3D[{Red,PointSize[0.03],Point[Flatten[X0]]}];

PlotSoln=ParametricPlot3D[Flatten[XNew],{t,-1,1},PlotRange->All,PlotStyle->{Blue,Thickness[0.007]}];

Show[PlotSoln,PlotX0]

RHS=Flatten[A.{{x[t]},{y[t]},{z[t]}}];

Solns=DSolve[{x'[t]==RHS[[1]],y'[t]==RHS[[2]],z'[t]==RHS[[3]],x[0]==-6,y[0]==10,z[0]==7},{x[t],y[t],z[t]},t][[1]];

Chop[{x[t],y[t],z[t]}/.Solns]

Flatten[XNew]

X1=Q[[All,1]]

X2=Q[[All,2]]

X3=Q[[All,3]]

LeftSideSystem=a X1+b X2+c X3

CoeffsA=Chop[Solve[{LeftSideSystem==Flatten[X0]},{a,b,c}][[1]]]

Flatten[Chop[Inverse[Q].X0]]

ComplexExpand[Re[(a Exp[EigVals[[1]] t] X1+b Exp[EigVals[[2]] t] X2+c Exp[EigVals[[3]] t] X3)/.Flatten[CoeffsA]]]

Flatten[XNew]

Example 12.4.3

(F={{Sin[t]},{−(E^t)},{Cos[3 t]}})//MatrixForm

A={{5.,-9,1},{-9,2,π},{1,π,-4}};

(Q=Transpose[N[Eigenvectors[A]]])//MatrixForm

EigVals=N[Eigenvalues[A]]

(Diag=DiagonalMatrix[EigVals])//MatrixForm

Q.Diag.Inverse[Q]//MatrixForm

A//MatrixForm

(eDiag=DiagonalMatrix[(E^(EigVals t))])//MatrixForm

eAt=Chop[Simplify[Q.eDiag.Inverse[Q]]]

(eNegDiag=DiagonalMatrix[(E^(−EigVals t))])//MatrixForm

eNegAt=Chop[Simplify[Q.eNegDiag.Inverse[Q]]]

X0={{-2},{4},{10}}

Z=Chop[Expand[Integrate[eNegAt.F,t]]]

P0=Re[X0-Z/.t->0]

X=Chop[ComplexExpand[Re[Simplify[eAt.(Z+P0)]]]]

X/.t->0

DX=Simplify[D[X,t]]

Simplify[A.X+F]

PlotX0=Graphics3D[{Red,PointSize[0.03],Point[Flatten[X0]]}];

PlotSoln=ParametricPlot3D[Flatten[X],{t,-0.25,0.25},PlotRange->All,PlotStyle->{Blue,Thickness[0.007]}];

Show[PlotSoln,PlotX0]

RHS=Flatten[A.{{x[t]},{y[t]},{z[t]}}+F];

Solns=DSolve[{x'[t]==RHS[[1]],y'[t]==RHS[[2]],z'[t]==RHS[[3]],x[0]==-2,y[0]==4.,z[0]==10.},{x[t],y[t],z[t]},t][[1]];

Chop[TrigReduce[ComplexExpand[Re[{x[t],y[t],z[t]}/.Solns]]],(10^(-3))]

X

Example 12.4.4

(F={{0},{0},{Sin[t]}})//MatrixForm

A={{0,1,0},{0,0,1},{-3,2,-5}};

(Q=Transpose[N[Eigenvectors[A]]])//MatrixForm

EigVals=N[Eigenvalues[A]]

(Diag=Chop[DiagonalMatrix[EigVals]])//MatrixForm

Chop[Q.Diag.Inverse[Q]]//MatrixForm

A//MatrixForm

(eDiag=DiagonalMatrix[(E^(EigVals t))])//MatrixForm

QeDiag=Chop[Q.eDiag]

(eNegDiag=DiagonalMatrix[(E^(−EigVals t))])//MatrixForm

eNegDiagQInv=Chop[eNegDiag.Inverse[Q]]

Y0={{4},{-9},{7}};

W=Expand[Chop[Integrate[eNegDiagQInv.F,t]]]

R0=Chop[Inverse[Q].Y0-W/.t->0]

Y=Simplify[QeDiag.(W+R0)]

Chop[Y/.t->0]//MatrixForm

Y1=ComplexExpand[Re[Y[[1]]]]

{Y1,D[Y1,t],D[Y1,{t,2}]}/.t->0

Chop[Simplify[D[Y1,{t,3}]+5 D[Y1,{t,2}]-2 D[Y1,t]+3 Y1]]

Soln=DSolve[{y'''[t]+5. y''[t]-2 y'[t]+3 y[t]==Sin[t],y[0]==4,y'[0]==-9,y''[0]==7},y[t],t];

Chop[Expand[TrigReduce[ComplexExpand[Re[y[t]/.Soln]]]]]

Plot[Y1,{t,-0.5,5},PlotStyle->{Blue,Thickness[0.007]}]