# Section 9.6# Example 1 interface(imaginaryunit=i);with(linalg):with(Student[LinearAlgebra]):I := Id(2);A := matrix([[-1,2],[-1,-3]]);evalm(A-r*I);det(%);solve(%=0,r);r1 := %[1];z := vector(2);eq := evalm((A-r1*I)&*z);eq1 := eq[1]=0; eq2 := eq[2]=0;# Although they don't look like it, these equations are actually multiples of each other.#If we apply Gaussian elmination, we geteq2 := eq2 + eq1/(1-i);eq2 := simplify(%);eq1;eq2;# This is easily solved by letting z[1] = 2s and solving for z[2]:z[1] := 2*s;z[2] := solve(eq1,z[2]);evalm(z);subs(s=1,%);z1 := evalm(%); #Eigenvector corresponding to r1alpha := Re(r1); beta := Im(r1); a := evalm(Re(z1)); b := evalm(Im(z1));x := exp(alpha*t)(c1*(cos(beta*t)*a-sin(beta*t)*b) + c2*(sin(beta*t)*a+cos(beta*t)*b));evalm(%);# Finding the eigen-pairs another way:eigenvects(A);#Using dsolve to find the general solution:de1 := diff(x1(t),t) = -x1(t)+2*x2(t);de2 := diff(x2(t),t) = -x1(t)-3*x2(t);dsolve({de1,de2});# Notice that if _C1 is changed to 2*c2 and _C2 is changed to 2*c1, dsolve's answer is# the same as the first answer above.# Example 2 A := matrix([[0,1,0,0],[-(k1+k2)/m1,0,k2/m1,0],[0,0,0,1],[k2/m2,0,-(k2+k3)/m2,0]]);evalm(subs({m1=1,m2=1,k1=1,k2=2,k3=3},evalm(A)));A_Ex2 := (%);I := Id(4);evalm(A_Ex2 - r*I);det(%);subs(r=sqrt(z),%);rsquared := solve(%,z);beta1 := sqrt(-rsquared[1]);beta2 := sqrt(-rsquared[2]);f1 := evalf(beta1/(2*Pi));f2 := evalf(beta2/(2*Pi));TTdSMApJNlJUQUJMRV9TQVZFLzEzNjU5NjU0NFgsJSlhbnl0aGluZ0c2IjYiW2dsISIlISEhIyUiIyIjIiIiIiIhRihGJzYiTTdSMApJN1JUQUJMRV9TQVZFLzEwODA3ODA2NDhYLCUpYW55dGhpbmdHNiI2IltnbCEiJSEhISMxIiUiJSIiIiIiIUYoRihGKEYnRihGKEYoRihGCidGKEYoRihGKEYnNiI=