Docsity

Solving ODEs with Complex Eigenvalues using MATLAB, Study notes of Differential Equations

Partial preview of the text

Download Solving ODEs with Complex Eigenvalues using MATLAB and more Study notes Differential Equations in PDF only on Docsity!

ODE Solution via Complex Eigenvalues

» A = [-1 2;-1 -3]

A =

» [u d] = eig(A)

u =

0.5774 - 0.5774i 0.5774 + 0.5774i 0 + 0.5774i 0 - 0.5774i

d =

-2.0000 + 1.0000i 0 0 -2.0000 - 1.0000i

» A*u

ans =

-0.5774 + 1.7321i -0.5774 - 1.7321i -0.5774 - 1.1547i -0.5774 + 1.1547i

» u*d

ans =

-0.5774 + 1.7321i -0.5774 - 1.7321i -0.5774 - 1.1547i -0.5774 + 1.1547i

» c = [real(u(:,1)) imag(u(:,1))]\x

c =

» sol = c(1)(exp(-2t)cos(t)real(u(:,1)) – exp(-2t)sin(t)imag(u(:,1)))+ c(2)(exp(-2t)sin(t)real(u(:,1)) + exp(-2t)cos(t)imag(u(:,1)))

A =

» [u d] = eig(A)

u =

-0.1954 -0.1954 0.5117 0. 0 - 0.4881i 0 + 0.4881i 0 + 0.6796i 0 - 0.6796i 0.3162 0.3162 0.3162 0. 0 + 0.7897i 0 - 0.7897i 0 + 0.4200i 0 - 0.4200i

d =

0 + 2.4972i 0 0 0 0 0 - 2.4972i 0 0 0 0 0 + 1.3281i 0 0 0 0 0 - 1.3281i

» x0 = [1 2 3 4]'

x0 =

» c = [real(u(:,1)) imag(u(:,1)) real(u(:,3)) imag(u(:,3))]\x

c =