hw7solution (1)

Hw7solution(1) - Chapter.7.6#5 1 5 a Let e Then r 1 5 To have non-trivial solution 1 5 and r for r 1 2 5 2 1 0 0 1 r 3 1 r r 2r 2 0 r 3 e 1 r 1 5 1

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Chapter .7.6 #5. 1 5 a) Let e . Then r 1 5 To have non-trivial solution 1 5 and r for r 1 , 2 5 2 1 0 0 1 r 3 1 r r 2r 2 0 r 3 e 1 r 1 5 1 3 e e 0 0 1 3 which gives 2 Hence, 2 for r 1 , 2 which gives 1 2 Hence, 1 2 e e cos t sin t 2 cos t sin t 5 2 1 0 0 1 e e 2 cos t sin t cos t sin t 1 Therefore, the general solution is c e b) cos t 2cos t sin t c e sin t cos t 2sin t #7. 1 0 2 1 3 2 Let e . Then r 1 2 3 r e 0 2 1 0 2 1 3 2 r 0 2 0 2 1 e e 0 0 0 0 2 1 1 1 r To have non-trivial solution, 1 2 3 r 1 0 2 r 0 2 0 r 7r 5 r 1 r 2r 5 0 1 r 0 0 2 1 r 2 3 2 1 r For r 1, r 1 r 1 4 r r 1, 1 3r 2 0 0 2 0 3 2 Set 2. Then 0 2 0 e 0 0 0 and 2 3 2 2 3 e 2 For r 1 2 , 2 2 3 The augmented matrix is 2 2 3 2 2 3 2 0 0 Set 1. Then and 0 1 0 e cos 2t cos 2t sin 2t sin 2t e 0 1 0 2 2 0 2 2 0 0 row2 2 0 2 0 row3 3 0 0 2 0 2 0 row3 0 2 2 0 0 2 0 2 0 2 0 0 2 0 0 0 2 0 0 2 2 0 0 2 0 2 0 0 0 2 0 0 0 0 2 2 0 2 2 e 0 0 0 row1 row1/2 row2 For r 1 2 , 2 2 3 0 2 2 0 2 2 e 0 0 0 The augmented matrix is 2 2 3 2 2 3 0 2 2 2 0 0 Set 1. Then and 0 1 0 0 row2 2 0 2 0 row3 3 0 2 2 0 0 2 0 2 0 row3 0 2 2 0 0 2 0 2 0 row1 row1/2 2 0 0 2 0 0 0 2 0 0 2 2 0 0 2 0 2 0 0 0 2 0 0 0 row2 0 1 By linear combination of and e 0 cos 2t sin 2t cos 2t sin 2t e 1 2 1 2 1 2 1 2 0 cos 2t sin 2t 0 sin 2t cos 2t e Therefore, the general solution is c or c 2 3 e 2 2 3 e 2 e c 0 cos 2t sin 2t e c 0 sin 2t cos 2t e c 0 cos 2t sin 2t e c 0 sin 2t cos 2t e #9. 1 1 Let e . Then r 1 1 To have non-trivial solution 1 1 and r for r 1 , 2 1 2 5 0 0 1 r 3 5 r r 2r 2 0 r 3 e 5 r 1 1 5 3 e e 0 0 5 3 , 0 1 1 which gives 5 2 Hence, 5 2 for r 1 , e e 5 cos t 5sin t 2 cos t sin t 2 which gives 1 2 5 0 0 2 Hence, 2 5 e e 5 2 5cos t 5sin t cos t sin t Therefore, the general solution is c e Apply the initial condition c c Therefore, e cos t cos t 3sin t sin t 5 2 c 1 ,c 5 0 1 3 5 1 1 5cos t 2cos t sin t c e 5sin t cos t 2sin t 5/10/09 4:57 PM C:\Documents and Settings\Administrator\Desktop\Spring 0...\hw7.m 1 of 3 %% HW#7 %%7.6 %%%prob. 5 clear all A5 = [1 -3] [x1,x2] = meshgrid([-2:0.2:2],[-2:0.2:2]) N = length(x1) X1 = zeros(N,N) X2 = X1 for k = 1:N for p = 1:N x = [x1(k,p) x2(k,p)] tmp = A5*x X1(k,p) = tmp(1) X2(k,p) = tmp(2) end end figure(1) quiver(x1,x2,X1,X2,'r') t= [0:0.01:10] Nt = length(t) traj = zeros(2,Nt) ICs = [-1.5 -1 -0.5 0 0 0.5 1 -2] for p = 1:8 for k = 1:Nt tk = t(k) c1 = exp(-tk)*cos(tk) c2 = exp(-tk)*sin(tk) traj(:,k) = [-c1-2*c2, c2 c2, -c1+2*c2]*ICs(:,p) end figure(1) hold on plot(traj(1,:),traj(2,:),'b') end xlabel('x1') ylabel('x2') title('vector field and several trajectories for Prob.#5, Section 7.6') axis([-2 2 -2 2]) axis square grid on hold off %%7.8 %%%prob. 2 A2 = [4 8 -4] % Define A matrix % Grid over which we can evaluate x [x1 x2] = meshgrid([-2:0.2:2] , [-2:0.2:2]) % Vector Field [N,junk] = size(x1) X1 = zeros(N,N) 5/10/09 4:57 PM C:\Documents and Settings\Administrator\Desktop\Spring 0...\hw7.m 2 of 3 X2 = X1 for k = 1 : N for p = 1 : N x = [x1(k,p) x2(k,p) ] tmp = A2*x X1(k,p) = tmp(1) X2(k,p) = tmp(2) end end figure(2) quiver(x1,x2,X1,X2,'r') t = [0:0.01:10] %Plot the exact solution Nt = length(t) traj = zeros(2,Nt) ICs = [-2 -1 0 1 2 2 2 2 -2 1]' for p = 1 : 16 for k = 1 : Nt tk = t(k) c1 = 1 c2 = tk traj(:,k) = [(1*c1+4*c2) (-2*c2) end figure(2) hold on plot(traj(1,:), traj(2,:),'b') end 2 1 0 -1 -2 -2 -2 (8*c2) (1*c1-4*c2)]*ICs(:,p) xlabel('x1') ylabel('x2') title('Vector Field and several trajectories for Prob.#2, Section 7.8') axis([-2 2 -2 2 ]) axis square grid on hold off %%7.8 %%%prob. 10 A3 = [3 -1 -3] % Define A matrix % Grid over which we can evaluate x [x1 x2] = meshgrid([-4:0.2:4] , [-4:0.2:4]) % Vector Field [N,junk] = size(x1) X1 = zeros(N,N) X2 = X1 for k = 1 : N for p = 1 : N x = [x1(k,p) x2(k,p) ] 5/10/09 4:57 PM C:\Documents and Settings\Administrator\Desktop\Spring 0...\hw7.m 3 of 3 tmp = A3*x X1(k,p) = tmp(1) X2(k,p) = tmp(2) end end figure(3) quiver(x1,x2,X1,X2,'r') t = [0:0.01:10] %Plot the exact solution Nt = length(t) traj = zeros(2,Nt) ICs = [-2 -1 0 1 2 2 2 2 2 1 0 -2 2 4]' % Last entry being specific IC IC = [2 4]' for p = 1 : 17 for k = 1 : Nt tk = t(k) c1 = 1 c2 = tk traj(:,k) = [(c1+3*c2) (9*c2) (-c2) (c1-3*c2)]*ICs(:,p) end figure(3) hold on plot(traj(1,:), traj(2,:),'b') end -1 -2 -2 -2 xlabel('x1') ylabel('x2') title('Vector Field and several trajectories for Prob.#10, Section 7.8') axis([-4 4 -4 4 ]) axis square grid on hold off ...
View Full Document

This note was uploaded on 10/12/2009 for the course MAE 210792200 taught by Professor Youssef during the Spring '09 term at UCLA.

Ask a homework question - tutors are online