MatLab-Homework3

# MatLab-Homework3 - Homework 7: Diﬀerential Equations This...

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

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

Unformatted text preview: Homework 7: Diﬀerential Equations This week, you will submit 2 jpgs and 2 diary ﬁles, one for each problem. Be sure to clean up your diary ﬁle before submitting it. 1. Consider the initial value problem dy dt = t2 et − 3y with y (0) = 1. • Using dsolve ﬁnd the exact solution to this. • Use myeuler with n = 10 to approximate the solution to approximate the value of y (5) (use the interval [0, 5]). • On the same set of axes, plot the exact solution along with the approximation you found using myeuler. Be sure to use diﬀerent colors and linestyles for each graph. • Determine the error in estimating y (5) using myeuler and put this information on your graph, as was done in the lecture. • Title the graph with your name and “Problem 1” 2. Consider the initial value problem dy dt = 2t y + et with y (0) = 1. • Attempt to solve this with dsolve. What happens? • Use myeuler with n = 10, n = 20 and n = 50 to approximate the solution on the interval [0, 2]. • Use ode45 to approximate the solution on the interval [0, 2]. • Plot your solution using ode45 along with your 3 solutions using myeuler on the same set of axes. Be sure to use diﬀerent colors and linestyles for each graph. • Title the graph with your name and “Problem 2” ...
View Full Document

## This note was uploaded on 04/19/2011 for the course MATH 21126 taught by Professor Johnson during the Spring '11 term at Carnegie Mellon.

Ask a homework question - tutors are online