{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Matlab 5

Matlab 5 - MATLAB Assignment 5 Second Order ODEs Exercise...

This preview shows pages 1–4. Sign up to view the full content.

20 25 30 35 40 45 50 -6 -4 -2 0 2 4 6 x 10 10 MATLAB Assignment 5 Second Order ODEs Exercise 5.1 (a) >> solve('r^2-r+(5/4)=0') ans = 1/2+i 1/2-i >> f=inline('exp(1/2*t)*(cos(t)+sin(t))') f = Inline function: f(t) = exp(1/2*t)*(cos(t)+sin(t)) >> fplot(f,[20,50]) (b)

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This graph has the solution oscillating with increased amplitude as t increases. This is because the a in r 1 =a+bi and r 2 =a-bi is positive unlike the example. Exercise 5.2 (a) >> dsolve('D2y-2*Dy-y=3*cos(t)') ans = exp(t+t*2^(1/2))*C2+exp(t-t*2^(1/2))*C1-3/4*cos(t)-3/4*sin(t) (b) >> dsolve('D2y+7*y*Dy+y=3*sin(t)') ??? Error using ==> maple at 129 Error, invalid input: rhs received [diff(diff(y(t),t),t) = -7*y(t)*diff(y(t),t)-y(t)+3*sin(t)], which is not valid for its 1st argument, expr Error in ==> dsolve at 365 RHS{j} = ... Exercise 5.3 (a) y =x 1 y' =x 1 ' =x 2 y'' =(y') ' =x 2 ' y'' – 5y' – 10y=8 cos(t) x 2 ' – 5x 2 – 10x 1 = 8 cos(t) x 2 ' = 8 cos(t) + 5x 2 +10x 1 x 1 ' =x 2 (b) 3y'' + (1/t 2 ) y' + (1/t) y 2 = 20 3x 2 ' + (1/t 2 )x 2 + (1/t)x 1 2 = 20 x 1 ' =x 2 3x 2 ' = -(1/t 2 )x 2 - (1/t)x 1 2 + 20 Exercise 5.4 (a) >> [t,x]=ode45('secondode',[0,5],[2,4]); >> plot(t,x)
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 0 10 20 30 40 50 60 70 (b) Two curves were graphed because we entered two initial values into ode45. The table of values calculated y(0) = 2 and y(0) = 4.

This preview has intentionally blurred sections. Sign up to view the full version.

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

{[ snackBarMessage ]}

Page1 / 6

Matlab 5 - MATLAB Assignment 5 Second Order ODEs Exercise...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online