{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

chw5 - τ in fourth-order RK is approx Ch 4 If you change h...

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

View Full Document Right Arrow Icon
Math 128a, fall 2011, Chorin, computer homework 5 Write an adaptive fourth-order RK program for solving y 0 = y 2 ,y (0) = 1, in the interval 0 x 0 . 85, to achieve an error ± 10 - 4 , controlling the mesh size h by extrapolation from a calculation with h/ 2, assuming (correctly) that the error in your RK method can be written as Ch 4 + O ( h 5 ), where C = C ( x ) is independent of h . Plot the solution, the difference between the computed and the exact solution, as well as h as a function of x . (reminder: the trunction error
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: τ in fourth-order RK is approx. Ch 4 . If you change h to qh , the error becomes q 4 τ . You can estimate τ by comparing your result to the control result, the difference of the two is approximately τ/h . Then solve | q 4 τ | ≤ ± ). (more ambitious) If you have the stamina, you can instead use the fourth-order part of Runge-Kutte-Fehlberg, using the fifth-order part as control. 1...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online