# hw3 - diagram will suﬃce For θ = 0 5 1 use your code for...

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

MEE 210B Homework # 3 Due February 9, 2009, 9am in class Note: Please turn in the programming problem separately from the theory problems. Reading: (1) A User’s View of Solving Stiff Ordinary Differential Equations (on the class website), (2) Wikipedia article on automatic differentiation 1. (1 point each part) Are the following equations stiff? Explain why or why not. Assume an error tolerance of 10 - 2 . (a) y 0 = y , t [0 , 1], y 0 = 1 (b) y 0 = - 1000( y - t 3 ) + 3 t 2 , t [0 , 1], y 0 = 1 (c) y 0 = - 1000( y - sin(1000 t )) + 1000 cos(1000 t ), t [0 , 1], y 0 = 0 2. Consider the θ -method: y n +1 = y n + θhf n + (1 - θ ) hf n +1 where 0 θ 1 and f n = f ( t n , y n ). (a) (1 point) What is the local truncation error? (b) (1 point) What is the local error? (c) (1 point) What is the order of this method? (d) (2 points) A method is called A-stable if its region of absolute stability contains the left half of the complex plane. For which values of θ is the θ -method A-stable? Justify your answer. 3. (10 points) Write a MATLAB code to implement the theta method for systems of ODEs. Explain the structure of your code (a flowchart or

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.

Unformatted text preview: diagram will suﬃce). For θ = 0 , . 5 , 1, use your code for solving: • The ODE system of Homework 2, Problem 3, with the stepsizes as indicated 1 • The predator-prey problem y 1 = . 25 y 1-. 01 y 1 y 2 y 2 =-y 2 + . 01 y 1 y 2 for 0 ≤ t ≤ 10 with stepsizes h = 0 . 1 and h = 0 . 001, and initial values y 1 = y 2 = 10. Plot y 1 vs. t and y 2 vs. t , and y 1 vs. y 2 . Note: You should write your own Newton iteration, but there is no need to write your own linear system solver. Use the func-tion provided in Matlab for that. Provide a subroutine for each problem that computes the Jacobian matrix. Do not use ﬁnite diﬀerence approximation or automatic diﬀerentiation to compute the Jacobian. DO NOT USE THE MATRIX INVERSE. IF YOU USE THE MATRIX INVERSE, YOU WILL NOT GET CREDIT FOR THIS PROBLEM! 2...
View Full Document

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern