Docsity

Homework 5: Solving Linear Systems and ODEs using MATLAB - Prof. Dianne P. O'Leary, Assignments of Mathematics

Toggle sidebar
bg1
CMSC/AMSC 460 Fall 2007
Homework 5
Due Tuesday, November 13, before class begins
10 points
The assignment provides a little practice in solving linear systems of equa-
tions and systems of ODEs. We’ll use these techniques again in Hmwk. 7.
Use ode45 to solve the differential equation
y0=J−1y−y,
over the interval t= 0 to t= 10 with
y(0) =
1
3
4
,
J(t) =
1 + t t2y2(t)ty3(t)
ty1(t) 1 + t t2y3(t)
t2y1(t)ty2(t) 1 + t
.
Plot the three components of yon a single graph, with labeled axes and a
legend to distinguish the three components.
Use Events to find the time twhen y3(t) = 1.
Your programs should be well documented.
Hints: Helpful Matlab commands include ode45,plot,legend,xlabel,
ylabel,title,odeset.
Examples of using ode45 and events:http://www.mathworks.com/access/
helpdesk/help/techdoc/index.html?/access/helpdesk/help/techdoc/math/
f1-662913.html
http://www.mathworks.com/access/helpdesk/help/techdoc/math/f1-662913.
html#f1-669698
1

Partial preview of the text

Download Homework 5: Solving Linear Systems and ODEs using MATLAB - Prof. Dianne P. O'Leary and more Assignments Mathematics in PDF only on Docsity!

CMSC/AMSC 460 Fall 2007 Homework 5 Due Tuesday, November 13, before class begins 10 points

The assignment provides a little practice in solving linear systems of equa- tions and systems of ODEs. We’ll use these techniques again in Hmwk. 7.

Use ode45 to solve the differential equation

y′^ = J−^1 y − y,

over the interval t = 0 to t = 10 with

y(0) =

J(t) =

1 + t t^2 y 2 (t) ty 3 (t) ty 1 (t) 1 + t t^2 y 3 (t) t^2 y 1 (t) ty 2 (t) 1 + t

Plot the three components of y on a single graph, with labeled axes and a legend to distinguish the three components.

Use Events to find the time t when y 3 (t) = 1.

Your programs should be well documented.

Hints: Helpful Matlab commands include ode45, plot, legend, xlabel, ylabel, title, odeset.

Examples of using ode45 and events: http://www.mathworks.com/access/ helpdesk/help/techdoc/index.html?/access/helpdesk/help/techdoc/math/ f1-662913.html http://www.mathworks.com/access/helpdesk/help/techdoc/math/f1-662913. html#f1-