{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Problems for Obligatory 2 - Spring 2010 MAT260 2 Obligatory...

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

View Full Document Right Arrow Icon
Spring 2010 MAT260 – BEREGNINGSALGORITMER 2 Obligatory Exercise 2 Deadline: 29. April 15.00 Print your name and Candidate number on the front page, and deliver your solutions to the problems below in a box marked MAT260 in the ’Ekspedisjon’ office in the 5th floor Problem 1 Use the Leap-frog method a) x n = x n 2 + 2 hf n 1 , n = 2 , 3 , . . . , to integrate the differential equation x ( t ) = x (1 - x ) f ( t, x ) , four steps from t = 0 to t = 2 with initial value x (0) = 0 . 5. Use Euler’s method in the first step. Write down the formulas you use to compute each of the four x -values. The global error in the computed approximation of x (2) is of order two. Using b) eight steps from t = 0 to t = 2 gives x (2) 0 . 88110. Use your own result in combination with this result to estimate the error in the approximation 0 . 88110. Explain the assumptions that your error estimate is based on. Write a Matlab function [t,x] = Leap frog(f,ts,te,xs,N) which takes c) a total of N equidistant steps from time t = ts , with initial value xs , to time t = te
Image of page 1

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

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}