12.07.2015 Views

COPYRIGHT 2008, PRINCETON UNIVERSITY PRESS

COPYRIGHT 2008, PRINCETON UNIVERSITY PRESS

COPYRIGHT 2008, PRINCETON UNIVERSITY PRESS

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

log |Rel Error|differential equation applications 207–7Error in rk4–9N = 500N = 1000–13N = 5000Figure 9.5 The log of the relative error (number of places of precision) obtained with rk4timeusing a differing number N of steps over the same time interval.5. Make a table of comparisons similar to Table 9.1. There we compare rk4 andrk45 for the two equations2yy ′′ + y 2 − y ′2 =0, (9.40)y ′′ +6y 5 =0, (9.41)with initial conditions ([y(0),y ′ (0)] = (1, 1). Equation (9.40) yields oscillationswith variable frequency and has an analytic solution with which to compare.Equation (9.41) corresponds to our standard potential (9.4), with p =6.Although we have not tuned rk45, the table shows that by setting its toleranceparameter to a small enough number, rk45 will obtain better precision thanrk4 (Figure 9.5) but that it requires ∼10 times more floating-point operationsand takes ∼5 times longer.9.6 Solution for Nonlinear Oscillations (Assessment)Use your rk4 program to study anharmonic oscillations by trying powers in therange p =2–12 or anharmonic strengths in the range 0 ≤ αx ≤ 2.Donot include anyexplicit time-dependent forces yet. Note that for large values of p you may needto decrease the step size h from the value used for the harmonic oscillator becausethe forces and accelerations get large near the turning points.1. Check that the solution remains periodic with constant amplitude and periodfor a given initial condition and value of p or α regardless of how nonlinear−101<strong>COPYRIGHT</strong> <strong>2008</strong>, PRINCET O N UNIVE R S I T Y P R E S SEVALUATION COPY ONLY. NOT FOR USE IN COURSES.ALLpup_06.04 — <strong>2008</strong>/2/15 — Page 207

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!