> | with(DEtools):with(plots):with(LinearAlgebra): |
Warning, the name changecoords has been redefined
Linear1
> | de1:=diff(x1(t),t)=x1(t)+x2(t); |
> | de2:=diff(x2(t),t)=4*x1(t)+x2(t); |
> | dfieldplot([de1,de2],[x1(t),x2(t)],t=0..1,x1=-3..3,x2=-3..3,arrows=MEDIUM); |
> | DEplot([de1,de2],[x1(t),x2(t)],t=0..3,[[x1(0)=0.1,x2(0)=0.1],[x1(0)=-2,x2(0)=3],[x1(0)=-1.5,x2(0)=3],[x1(0)=1.3,x2(0)=-2.8]],x1=-3..3,x2=-3..3,arrows=MEDIUM,linecolor=blue);
|
> | A:=Matrix([[1,1],[4,1]]); |
> | Eigenvectors(A); |
Linear2
> | de1:=diff(x1(t),t)=3*x1(t)-1*x2(t); |
> | de2:=diff(x2(t),t)=-2*x1(t)+4*x2(t); |
> | dfieldplot([de1,de2],[x1(t),x2(t)],t=0..1,x1=-5..5,x2=-5..5,arrows=MEDIUM); |
> | A:=Matrix([[3,-1],[-2,4]]); |
> | Eigenvectors(A); |
> | MatrixExponential(A); |
Linear3
> | de1:=diff(x1(t),t)=-2*x1(t)+0*x2(t); |
> | de2:=diff(x2(t),t)=1*x1(t)-3*x2(t); |
> | dfieldplot([de1,de2],[x1(t),x2(t)],t=0..1,x1=-3..3,x2=-3..3,arrows=MEDIUM); |
> | A:=Matrix([[-2,0],[1,-3]]); |
> | Eigenvectors(A); |
Linear4
> | de1:=diff(x1(t),t)=1*x1(t)+5*x2(t); |
> | de2:=diff(x2(t),t)=-1*x1(t)-1*x2(t); |
> | dfieldplot([de1,de2],[x1(t),x2(t)],t=0..1,x1=-3..3,x2=-3..3,arrows=MEDIUM); |
> | A:=Matrix([[1,5],[-1,-1]]); |
> | Eigenvectors(A); |
> | MatrixExponential(A*t); |
> |
Volterra-Lotka
> | de1:=diff(F(t),t)=F(t)-1/2*F(t)*R(t); |
> | de2:=diff(R(t),t)=-3/4*R(t)+1/4*F(t)*R(t); |
> | dfieldplot([de1,de2],[F(t),R(t)],t=0..1,F=0..7,R=0..5,arrows=MEDIUM); |
Eigenvectors and Diagonalization
> | A:=Matrix([ [ 21, 0, -80 ], [ -8, 1, 32 ], [ 4, 0, -15 ] ]); |
> | E:=Eigenvectors(A); |
> | B:=Matrix([[5],[-2],[1]]); |
> | A.B; |
> | M:=E[2]; |
> | E[1]; |
> | MatrixInverse(M).A.M; |
> | Di:=Matrix([[1,0,0],[0,1,0],[0,0,5]]); |
> | M.Di.MatrixInverse(M); |
> | C:=Matrix([[exp(t),0,0],[0,exp(t),0],[0,0,exp(5*t)]]); |
> | M.C.MatrixInverse(M); |
> | MatrixExponential(A*t); |
JordanForm
> | A:=Matrix([ [ 3, -2, -1 ], [ 0, 5, 1 ], [ 3, -6, -1 ] ]); |
> | Eigenvectors(A); |
> | JordanForm(A); |
> | B:=JordanForm(A,output='Q'); |
> | J:=MatrixInverse(B).A.B; |
> | Je:=MatrixExponential(J*t); |
> | B.Je.MatrixInverse(B); |
> | MatrixExponential(A*t); |
> |