hw3 - diagram will suce). For = 0 , . 5 , 1, use your code...

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

View Full Document Right Arrow Icon
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
Background image of page 1

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

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: diagram will suce). 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 dierence approximation or automatic dierentiation 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

This note was uploaded on 07/08/2009 for the course ME 210B taught by Professor Linda during the Spring '09 term at UCSB.

Page1 / 2

hw3 - diagram will suce). For = 0 , . 5 , 1, use your code...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online