{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

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

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

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 diﬀerence between the computed and the exact solution, as well as h as a function of x . (reminder: the trunction error
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 diﬀerence 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 ﬁfth-order part as control. 1...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online