# matlab-20d-4 - Aston Khor A12038759 Deotte Matlab Homework...

• 7
• 93% (14) 13 out of 14 people found this document helpful

This preview shows page 1 - 4 out of 7 pages.

Aston Khor A12038759 Deotte Matlab Homework 4 Exercise 4.1) a) >> B=[1.2 2.5;4 0.7] B = 1.2000 2.5000 4.0000 0.7000 b) >> [eigvec,eigval]= eig(B) eigvec = 0.6501 -0.5899 0.7599 0.8075 eigval = 4.1221 0 0 -2.2221 Exercise 4.2) a) b) >> A = [1 3; -1 -8] A = 1 3 -1 -8 >> [eigvec, eigval] = eig(A) eigvec = 0.9934 -0.3276 -0.1148 0.9448 eigval = 0.6533 0 0 -7.6533 c)
As t gets larger, v(t) will move in the direction of vector [ 0.9934 0.1148 ] when C is positive and the opposite direction when C is negative. d) >> g = @(t,Y) [1*Y(1) + 3*Y(2); -1*Y(1) - 8*Y(2)]; P = [-3,3; -3,0; -3,2; -2,-3; -1,3; 0,-3; 1,4; 2,-3; 4,-2; 4,0; 4,2]; phaseplane(g, [-4.5,4.5], [-4.5,4.5], 16) hold on for i=1:size(P,1) drawphase(g, 50, P(i,1), P(i,2)) end hold off The phase diagram matches the points in part C. V(t) tends towards [ 0.9934 0.1148 ¿ in positive C 1 direction and tends towards [ 0.9934 0.1148 ] in the negative C 2 Exercise 4.3) a) >> A=[2.7 -1;4.1 3.7] A = 2.7000 -1.0000 4.1000 3.7000
>> [eigvec, eigval]=eig(A) eigvec = -0.1093 + 0.4291i -0.1093 - 0.4291i 0.8966 + 0.0000i 0.8966 + 0.0000i eigval = 3.2000 + 1.9621i 0.0000 + 0.0000i 0.0000 + 0.0000i 3.2000 - 1.9621i b) c) >> g = @(t,Y) [2.7*Y(1) - 1.4*Y(2); 4.1*Y(1) + 3.7*Y(2)]; P = [-3,3; -3,0; -3,2; -2,-3; -1,3; 0,-3; 1,4; 2,-3; 4,-2; 4,0; 4,2]; phaseplane(g, [-4.5,4.5], [-4.5,4.5], 16) hold on for i=1:size(P,1) drawphase(g, 50, P(i,1), P(i,2)) end hold off Exercise 4.4) a) >> A = [1.25, -0.97, 4.6; -2.6, -5.2, -0.31; 1.18, -10.3, 1.12] Eigenvalue determines whether the solution will approach infinity or not. If eigenvalue is positive, it approaches infinity, and if it is negative, it approaches zero.