Problem #8 in 7.6.
I am going to need several packages. (Ignore warning statements.)
> with(DEtools):with(linalg):with(plots):with(LinearAlgebra):
Warning, the name adjoint has been redefined
Warning, the name adjoint has been redefined
Warning, the name changecoords has been redefined
Warning, the assigned name GramSchmidt now has a global binding
First, I will just plot a few solution curves:
>
DEplot3d(
[D(x)(t)=-3*x(t)+2*z(t),D(y)(t)=x(t)-y(t),D(z)(t)=-2*x(t)-y(t)],
[x(t),y(t),z(t)],t=0..5,
[[x(0)=1,y(0)=1,z(0)=1],[x(0)=-1,y(0)=-1,z(0)=-1],
[x(0)=1,y(0)=-1,z(0)=-1],[x(0)=-1,y(0)=1,z(0)=1],
[x(0)=1,y(0)=-1,z(0)=1/2],[x(0)=-1,y(0)=1,z(0)=-1/2],
[x(0)=1,y(0)=1,z(0)=0]],
x=-1.5..1.5,y=-1.5..1.5,view=-1.5..1.5,
linecolor=[red,black,black,green,blue,yellow,pink],
thickness=3,stepsize=0.1);
> solplots:=%: We save the plots for latter use.
Next we find the eigenvectors.
> A:=matrix([[-3,0,2],[1,-1,0],[-2,-1,0]]);
> eigenvectors(A);
We can see that the eigenvector [2,-2,1]^T cooresponds to the eigenspace given by the black line in the plot above.
But the two complex eigenvalues give an inward spiral in some 2-dimensional subspace. How can we find the equation for this plane? This is not done in your textbook.
I can get the coordinate transformation matrix used in diagonalizing A as follows.
> B:=jordan(A,`P`);
> evalm(P);
Thus we B=P^(-1)AP. However B is complex. I can create a new similar matrix that is almost diagonial.
> Q:=matrix([[1,0,0],[0,1/2,I/2],[0,1/2,-I/2]]);
> C:=simplify(evalm(inverse(Q)&*B&*Q));
It follows that C = Q^(-1)P^(-1)APQ. Let R=PQ.
> R:=simplify(evalm(P&*Q));
The second two column vectors of R give a basis for the subspace we want. I'll compute their cross product to get a normal vector and hance deduce an equation for the plane.
> CrossProduct(<2,4,-2>,<4*sqrt(2),-sqrt(2),5*sqrt(2)>);
So x-y-z=0, or z=x-y. We will plot the plane and overlay it with the solution curves graph.
> plane:=plot3d(x-y,x=-1.5..1.5,y=-1.5..1.5,view=-1.5..1.5,color=gray):
> display(solplots,plane);
The red curve should lie completely in the plane.
Next we find explicitly the general solution.
>
sys1 := diff(x(t),t) = -3*x(t)+2*z(t),
diff(y(t),t) = x(t)-y(t),
diff(z(t),t) = -2*x(t)-y(t) ;
> dsolve({sys1});
You can specify initial conditions as foloows.
> intcond:=x(0)=2,y(0)=3,z(0)=1;
> dsolve({sys1,intcond},{x(t),y(t),z(t)});
>
spacecurve([
-4/3*exp(-2*t)-5/3*sqrt(2)*exp(-t)*sin(sqrt(2)*t)+10/3*exp(-t)*cos(sqrt(2)*t), 4/3*exp(-2*t)+5/3*exp(-t)*cos(sqrt(2)*t)+5/3*sqrt(2)*exp(-t)*sin(sqrt(2)*t),
-2/3*exp(-2*t)-10/3*sqrt(2)*exp(-t)*sin(sqrt(2)*t)+5/3*exp(-t)*cos(sqrt(2)*t),
t=0..9],x=0..3,y=0..3,color=red,thickness=3);
>