12.07.2015 Views

This exam is due by 5pm on Tuesday, March 2. You may use any ...

This exam is due by 5pm on Tuesday, March 2. You may use any ...

This exam is due by 5pm on Tuesday, March 2. You may use any ...

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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Jim LambersMAT 461/561Spring Semester 2013-14Exam 1<str<strong>on</strong>g>Th<str<strong>on</strong>g>is</str<strong>on</strong>g></str<strong>on</strong>g> <str<strong>on</strong>g>exam</str<strong>on</strong>g> <str<strong>on</strong>g>is</str<strong>on</strong>g> <str<strong>on</strong>g>due</str<strong>on</strong>g> <str<strong>on</strong>g>by</str<strong>on</strong>g> <str<strong>on</strong>g>5pm</str<strong>on</strong>g> <strong>on</strong> Thursday, February 27. <strong>You</strong> <strong>may</strong> <strong>use</strong> <strong>any</strong> resource, including thetextbook, course notes, or other publ<str<strong>on</strong>g>is</str<strong>on</strong>g>hed informati<strong>on</strong>, but all sources outside of course materialmust be cited. <strong>You</strong> <strong>may</strong> not collaborate with <strong>any</strong><strong>on</strong>e.1. Using the definiti<strong>on</strong> of local truncati<strong>on</strong> error,(a) Show that the modified Euler method <str<strong>on</strong>g>is</str<strong>on</strong>g> 2nd-order accurate.(b) Show that the implicit 2-step Adams-Moult<strong>on</strong> method <str<strong>on</strong>g>is</str<strong>on</strong>g> 3rd-order accurate.<strong>2.</strong> The ODE system given <str<strong>on</strong>g>by</str<strong>on</strong>g>y ′ 1 = α − y 1 − 4y 1y 21 + y 2 1y ′ 2 = βy 1(1 − y 21 + y 2 1where α and β are parameters, represents a simplified approximati<strong>on</strong> to a chemical reacti<strong>on</strong>.There <str<strong>on</strong>g>is</str<strong>on</strong>g> a parameter value β c = 3α 5 − 25 α such that for β > β c, soluti<strong>on</strong> trajectories decay inamplitude and spiral in (y 1 , y 2 )-space into a stable fixed point, whereas for β < β c , trajectoriesoscillate without damping and are attracted to a stable limit cycle. [<str<strong>on</strong>g>Th<str<strong>on</strong>g>is</str<strong>on</strong>g></str<strong>on</strong>g> <str<strong>on</strong>g>is</str<strong>on</strong>g> called a Hopfbifurcati<strong>on</strong>.](a) Set α = 10 and <strong>use</strong> <strong>any</strong> of the d<str<strong>on</strong>g>is</str<strong>on</strong>g>cretizati<strong>on</strong> methods introduced in Chapter 6 with afixed step size h = 0.01 to approximate the soluti<strong>on</strong> starting at y 1 (0) = 0, y 2 (0) = 2, for0 ≤ t ≤ 20. Do th<str<strong>on</strong>g>is</str<strong>on</strong>g> for the parameter values β = 2 and β = 4. For each case plot y 1 vs.t and y 2 vs. y 1 . Describe your observati<strong>on</strong>s.(b) Investigate the situati<strong>on</strong> closer to the critical value β c = 3.5. [<strong>You</strong> <strong>may</strong> have to increasethe length of the integrati<strong>on</strong> interval bey<strong>on</strong>d t = 20 to get a better look.]3. (a) Use the Taylor expansi<strong>on</strong>,),y(t i+1 ) = y(t i ) + hy ′ (t i ) + h22 y′′ (t i ) + h36 y′′′ (t i )+ h424 y(iv) (t i ) + h5120 y(v) (t i ) + O(h 6 ),to derive a corresp<strong>on</strong>ding series expansi<strong>on</strong> for the local truncati<strong>on</strong> error of the forwardEuler method.(b) Manipulating the forward Euler method written for the step sizes h and h/2, applyRichards<strong>on</strong> extrapolati<strong>on</strong> to obtain a 2nd-order <strong>on</strong>e-step method.(c) Manipulating the forward Euler method written for the step sizes h, h/2 and h/3, applyRichards<strong>on</strong> extrapolati<strong>on</strong> to obtain a 3rd-order <strong>on</strong>e-step method.1


(d) Explain why your obtained methods are special cases of Runge-Kutta methods.4. To draw a circle of radius r <strong>on</strong> a screen, <strong>on</strong>e <strong>may</strong> proceed to evaluate pairs of values x = r cos θ,y = r sin θ for a successi<strong>on</strong> of values of θ, but th<str<strong>on</strong>g>is</str<strong>on</strong>g> <str<strong>on</strong>g>is</str<strong>on</strong>g> computati<strong>on</strong>ally expensive. A cheapermethod <strong>may</strong> be obtained <str<strong>on</strong>g>by</str<strong>on</strong>g> c<strong>on</strong>sidering the system of ODEsx ′ = −y, x(0) = r,y ′ = x, y(0) = 0,where x ′ = dxdθ, and approximating th<str<strong>on</strong>g>is</str<strong>on</strong>g> using a simple d<str<strong>on</strong>g>is</str<strong>on</strong>g>cretizati<strong>on</strong> method. However, caremust be taken so as to ensure that the obtained approximate soluti<strong>on</strong> looks right, i.e., thatthe approximate curve closes rather than spirals.Carry out th<str<strong>on</strong>g>is</str<strong>on</strong>g> integrati<strong>on</strong> using a uniform step size h = .02 for 0 ≤ θ ≤ 120, applying Euler’smethod, the modified Euler method, and the fourth-order Runge-Kutta method. Determineif the soluti<strong>on</strong> spirals in, spirals out, or forms an approximate circle as desired.(a) Set the value of r in the problem statement to 1.(b) For all three methods, <strong>use</strong> the same time-stepping as in eulerforward.m from the courseweb site, in which h <str<strong>on</strong>g>is</str<strong>on</strong>g> set to the minimum of the prescribed value of h, and T − t n ,where T <str<strong>on</strong>g>is</str<strong>on</strong>g> the final time and t n <str<strong>on</strong>g>is</str<strong>on</strong>g> the current time after n steps have been taken. ForT = 120 and h = 0.02, th<str<strong>on</strong>g>is</str<strong>on</strong>g> will actually result in 6001 time steps, rather than the 6000that <str<strong>on</strong>g>is</str<strong>on</strong>g> expected, beca<strong>use</strong> of roundoff error in updating the value of t n .(c) Make all three methods compute a 2×6002 matrix, in which each column c<strong>on</strong>s<str<strong>on</strong>g>is</str<strong>on</strong>g>ts of thex- and y-coordinates of a point of the computed soluti<strong>on</strong>. The first column representsthe initial point (1, 0), and the remaining columns represent the points computed <str<strong>on</strong>g>by</str<strong>on</strong>g> the6001 time steps described above.(d) <strong>You</strong>r code must save your soluti<strong>on</strong> matrices in three separate ASCII files: U1.dat forEuler’s method, U<strong>2.</strong>dat for modified Euler, and U3.dat for the fourth-order Runge-Kutta method. For <str<strong>on</strong>g>exam</str<strong>on</strong>g>ple, if U1 <str<strong>on</strong>g>is</str<strong>on</strong>g> the name of the matrix computed <str<strong>on</strong>g>by</str<strong>on</strong>g> forwardEuler, then it can be saved as follows:save -ascii U1.dat U1These files must then be emailed to me at James.Lambers@usm.edu.5. Suppose that we apply a numerical method to an initial value problem, with two differentstep sizes h 1 and h 2 , and obtain error estimates e(h 1 ) and e(h 2 ). Furthermore, suppose thatthe error <str<strong>on</strong>g>is</str<strong>on</strong>g> of the form Ch p , where the c<strong>on</strong>stants C and p are unknown. Show thatp = ln( e(h2 )e(h 1 )6. Derive the 2-step Adams-Moult<strong>on</strong> formula) /ln(h2h 1).y i+1 = y i + h 12 (5f i+1 + 8f i − f i−1 ).2


7. The following classical <str<strong>on</strong>g>exam</str<strong>on</strong>g>ple from astr<strong>on</strong>omy gives a str<strong>on</strong>g motivati<strong>on</strong> to solve initial valueproblems with adaptive step size c<strong>on</strong>trol.C<strong>on</strong>sider two bodies of masses µ = 0.012277471 and ˆµ = 1 − µ (earth and sun) in a planarmoti<strong>on</strong>, and a third body of negligible mass (mo<strong>on</strong>) moving in the same plane. The moti<strong>on</strong><str<strong>on</strong>g>is</str<strong>on</strong>g> governed <str<strong>on</strong>g>by</str<strong>on</strong>g> the equati<strong>on</strong>sStarting with the initial c<strong>on</strong>diti<strong>on</strong>su ′′1 = u 1 + 2u ′ 2 − ˆµ u 1 + µD 1− µ u 1 − ˆµD 2,u ′′2 = u 2 − 2u ′ 1 − ˆµ u 2D 1− µ u 2D 2,D 1 = ((u 1 + µ) 2 + u 2 2) 3/2 ,D 2 = ((u 1 − ˆµ) 2 + u 2 2) 3/2 .u 1 (0) = 0.994, u 2 (0) = 0, u ′ 1(0) = 0,u ′ 2(0) = −<strong>2.</strong>00158510637908252240537862224,the soluti<strong>on</strong> <str<strong>on</strong>g>is</str<strong>on</strong>g> periodic with period < 17.1. Note that D 1 = 0 at (−µ, 0) and D 2 = 0 at (ˆµ, 0),so we need to be careful when the orbit passes near these singularity points.The orbit <str<strong>on</strong>g>is</str<strong>on</strong>g> depicted in Figure 1. Using the fourth-order Runge-Kutta method, integrate th<str<strong>on</strong>g>is</str<strong>on</strong>g>Figure 1: Soluti<strong>on</strong> to the system of ODEs in Problem 73


problem <strong>on</strong> [0, 17.1] with a uniform step size, using 100, 1000, 10,000, and 20,000 steps. Plotthe orbit for each case. How m<strong>any</strong> uniform steps are needed before the orbit appears to bequalitatively correct?8. (B<strong>on</strong>us) Repeat problem 4 with the backward Euler methodand the implicit trapezoidal methody n+1 = y n + hf(t n+1 , y n+1 )y n+1 = y n + h 2 [f(t n, y n ) + f(t n+1 , y n+1 )].Note that beca<strong>use</strong> the system of ODEs <str<strong>on</strong>g>is</str<strong>on</strong>g> linear, you do not need to <strong>use</strong> a method such asNewt<strong>on</strong>’s method to compute x n+1 and y n+1 from x n and y n .Explain the observed results. Hints: <str<strong>on</strong>g>Th<str<strong>on</strong>g>is</str<strong>on</strong>g></str<strong>on</strong>g> has to do with a certain invariant functi<strong>on</strong> of xand y, rather than with the order of the methods. Also, you can <strong>use</strong> the fact that the inverseof a 2 × 2 matrix <str<strong>on</strong>g>is</str<strong>on</strong>g> given <str<strong>on</strong>g>by</str<strong>on</strong>g> the formula[ ] −1 a b=c d1ad − bc[ d −b−c a].4

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

Saved successfully!

Ooh no, something went wrong!