4.1 Performance Trade Study Selected Results
4.1.8 Monte Carlo Studies for Mapping the Effect of Mirror and Jitter Error
The starting values are x00,y00.25. Because we are computing the approximations for c2, the initial value for his
For equation (12), we have so the numbers Fand Gin the subroutine are ,
and we find
,
Thus, with we get for the first approximation
To describe the further outputs of the algorithm, we use the notation y(2; h) for the approx-imation obtained with step size h. Thus,y(2; 2) 5.25, and we find from the algorithm
Since which is less than we stop.
The exact solution of (12) is so we have determined that
◆
In the next section, we discuss methods with higher rates of convergence than either Euler’s or the improved Euler’s methods.
fA2B 1
2ae4 5
2b 26.04880 .
fAxB12
A
e2xx12B
,e0.001, 0yA2; 29ByA2; 28B0 0.00083,
yA2; 24B25.79127 yA2; 29B26.04880 . yA2; 23B25.12012 yA2; 28B26.04797 yA2; 22B23.06067 yA2; 27B26.04468 yA2; 21B18.28125 yA2; 26B26.03172 yA2; 1B11.25000 yA2; 25B25.98132 y0.25 A01B2A11B5.25 .
x00, y00.25, and h2, yy h
2AFGBy h
2A2x4yB h2
2 A12x4yB . xxh
G AxhB2AyhFBx2yhA12x4yB , Fx2y
fAx, yBx2y, h A20B202 .
Section 3.6 Improved Euler’s Method 129
†An applet, maintained on the web at http://alamos.math.arizona.edu/~rychlik/JOde/index.html automates most of the differential equation algo-rithms discussed in this book.
Solution
In many of the following problems, it will be essential to have a calculator or computer available. You may use a software package†or write a program for solving initial value problems using the improved Euler’s method algo-rithms on pages 127 and 128. (Remember, all trigono-metric calculations are done in radians.)
1. Show that when Euler’s method is used to approxi-mate the solution of the initial value problem
y¿ 5y , yA0B 1 ,
at x1, then the approximation with step size his .
2. Show that when Euler’s method is used to approxi-mate the solution of the initial value problem
at x2, then the approximation with step size his 3a1 h
2b2
/
h.
y¿ 1
2y , yA0B3 , A15hB1
/
h3. Show that when the trapezoid scheme given in for-mula (8) is used to approximate the solution
of at x1, then we get
which leads to the approximation
for the constant e. Compute this approximation for h1, 101, 102, 103, and 104and compare your results with those in Tables 3.4 and 3.5.
4. In Example 1 the improved Euler’s method approxi-mation to ewith step size hwas shown to be
First prove that the error
approaches zero as Then use L’Hôpital’s rule to show that
Compare this constant with the entries in the last column of Table 3.5.
5. Show that when the improved Euler’s method is used to approximate the solution of the initial value problem
at , then the approximation with step size his
6. Since the integral with variable upper limit satisfies (for continuous f) the initial value problem
any numerical scheme that is used to approximate the solution at x1 will give an approximation to the definite integral
Derive a formula for this approximation of the inte-gral using
01fAtBdt .
y¿ fAxB , yA0B 0 , yAxB J x0 fAtBdt 1
3A14h8h2B1
/
A2hB . x1/
2y¿ 4y , yA0B 1 3 , limhS0
error h2 e
60.45305 . hS0.
Je A1hh2
/
2B1/
ha1h h2 2b1
/
h. a1h
/
21h
/
2b1
/
hyn1 a1h
/
21h
/
2byn , n0, 1, 2, . . . , y¿ y , yA0B1 ,fAxBex
130 Chapter 3 Mathematical Models and Numerical Methods Involving First-Order Equations
(a) Euler’s method.
(b) the trapezoid scheme.
(c) the improved Euler’s method.
7. Use the improved Euler’s method subroutine with step size h0.1 to approximate the solution to the initial value problem
at the points x 1.1, 1.2, 1.3, 1.4, and 1.5. (Thus, input N 5.) Compare these approximations with those obtained using Euler’s method (see Exercises 1.4, Problem 5).
8. Use the improved Euler’s method subroutine with step size h0.2 to approximate the solution to the initial value problem
at the points x1.2, 1.4, 1.6, and 1.8. (Thus, input N 4.) Compare these approximations with those obtained using Euler’s method (see Exercises 1.4, Problem 6).
9. Use the improved Euler’s method subroutine with step size h0.2 to approximate the solution to at the points x0, 0.2, 0.4, . . . , 2.0. Use your an-swers to make a rough sketch of the solution on [0, 2].
10. Use the improved Euler’s method subroutine with step size h0.1 to approximate the solution to at the points x0, 0.1, 0.2, . . . , 1.0. Use your an-swers to make a rough sketch of the solution on [0, 1].
11. Use the improved Euler’s method with tolerance to approximate the solution to
at t1. For a tolerance of use a stopping procedure based on the absolute error.
12. Use the improved Euler’s method with tolerance to approximate the solution to
at . For a tolerance of , use a stop-ping procedure based on the absolute error.
13. Use the improved Euler’s method with tolerance to approximate the solution to
at x1. For a tolerance of use a stop-ping procedure based on the absolute error.
e0.003, y¿ 1yy3 , yA0B 0 , e0.01 x p
y¿ 1sin y , yA0B0 , e0.01, dx
dt 1t sinAtxB , xA0B 0 , y¿ 4 cosAxyB , yA0B 1 , y¿ x3 cosAxyB , yA0B 0 , y¿ 1
xAy2yB , yA1B 1 , y¿ xy2 , yA1B 0 ,
14. By experimenting with the improved Euler’s method subroutine, find the maximum value over the interval
of the solution to the initial value problem Where does this maximum value occur? Give answers to two decimal places.
15. The solution to the initial value problem
crosses the x-axis at a point in the interval . By experimenting with the improved Euler’s method subroutine, determine this point to two decimal places.
16. The solution to the initial value problem
has a vertical asymptote (“blows up”) at some point in the interval . By experimenting with the improved Euler’s method subroutine, determine this point to two decimal places.
17. Use Euler’s method (4) with h0.1 to approximate the solution to the initial value problem
on the interval (that is, at x0, 0.1, . . . , 1.0). Compare your answers with the actual solution What went wrong? Next, try the step size h0.025 and also h 0.2. What conclusions can you draw concerning the choice of step size?
18. Local versus Global Error. In deriving formula (4) for Euler’s method, a rectangle was used to approximate the area under a curve (see Figure 3.14). With this approximation can be written as
(a) Show that if ghas a continuous derivative that is bounded in absolute value by B, then the rectan-gle approximation has error ; that is, for some constant M,
This is called the local truncation error of the scheme. [Hint:Write
xxnn1gAtBdthgAxnB
xxnn13gAtBgAxnB4dt .
`
xxnn1gAtBdthgAxnB` Mh2 . OAh2B
xxnn1gAtBdthgAxnB , where hxn1xn . gAtBJf
A
t, fAtBB
,y e20x.
0x1 y¿ 20y , yA0B 1 ,
31, 24 dy
dx y
x x3y2 , yA1B3
30, 1.44 dy
dx Axy2B2 , yA0B 2 y¿ sinAxyB , yA0B2 . 30, 24
Section 3.6 Improved Euler’s Method 131
Next, using the mean value theorem, show that Then integrate to obtain the error bound .]
(b) In applying Euler’s method, local truncation errors occur in each step of the process and are propagated throughout the further computations.
Show that the sumof the local truncation errors in part (a) that arise after nsteps is . This is the global error, which is the same as the convergence rate of Euler’s method.
19. Building Temperature. In Section 3.3 we mod-eled the temperature inside a building by the initial value problem
(13)
where Mis the temperature outside the building,Tis the temperature inside the building, His the addi-tional heating rate, Uis the furnace heating or air conditioner cooling rate, K is a positive constant, and T0 is the initial temperature at time t0. In a typical model,t00 (midnight),T065ºF,
0.1, , and
75 20 cos
The constant K is usually between and , depending on such things as insulation. To study the effect of insulating this building, consider the typical building described above and use the improved Euler’s method subroutine with h to approxi-mate the solution to (13) on the interval
(1 day) for K0.2, 0.4, and 0.6.
20. Falling Body. In Example 1 of Section 3.4, we modeled the velocity of a falling body by the initial value problem
under the assumption that the force due to air resistance is by. However, in certain cases the force due to air resistance behaves more like where r is some constant. This leads to the model (14)
To study the effect of changing the parameter rin (14), take m1,g9.81,b2, and y00. Then use the improved Euler’s method subroutine with h 0.2 to approximate the solution to (14) on the interval for r1.0, 1.5, and 2.0. What is the relationship between these solutions and the constant solution yAtB A9.81
/
2B1/
r?0t5 mdy
dt mgbyr , yA0By0 .
A1B byr,
mdy
dt mgby , yA0By0 ,
0t24 2
/
31
/
21
/
4Apt
/
12B .MAtB
UAtB 1.5370TAtB4 HAtB TAt0BT0 ,
dT
dt K3MAtBTAtB4 HAtBUAtB OAhB AB
/
2Bh20gAtB gAxnB0 B0txn0.
In Sections 1.4 and 3.6, we discussed a simple numerical procedure, Euler’s method, for obtaining a numerical approximation of the solution to the initial value problem
(1)
Euler’s method is easy to implement because it involves only linear approximations to the solution But it suffers from slow convergence, being a method of order 1; that is, the error is . Even the improved Euler’s method discussed in Section 3.6 has order of only 2. In this section we present numerical methods that have faster rates of convergence. These include Taylor methods, which are natural extensions of the Euler procedure, and Runge–Kutta methods,which are the more popular schemes for solving initial value problems because they have fast rates of convergence and are easy to program.
As in the previous section, we assume that fand are continuous and bounded on the
vertical strip and that f possesses as many continuous
partial derivatives as needed.
To derive the Taylor methods, let be the exactsolution of the related initial value problem
(2)
The Taylor series for about the point xnis
where h x xn. Since satisfies (2), we can write this series in the form (3)
Observe that the recursive formula for in Euler’s method is obtained by truncating the Taylor series after the linear term. For a better approximation, we will use more terms in the Taylor series. This requires that we express the higher-order derivatives of the solution in terms of the function .
If ysatisfies we can compute by using the chain rule:
(4)
In a similar fashion, define f3,f4, . . . , that correspond to the expressions , etc. If we truncate the expansion in (3) after the term, then, with the above notation, the recursive formulas for the Taylor method of order pare
(5)
(6) yn1ynhfAxn, ynB h2
2! f2Axn, ynB
p
hpp! fpAxn, ynB . xn1xnh ,
hp
y‡AxB, yA4BAxB : f2Ax, yB .
0f
0xAx, yB 0f
0yAx, yBfAx, yB y– 0f
0xAx, yB 0f
0yAx, yB y¿
y–
y¿fAx, yB, fAx, yB
yn1
fnAxBynh fAxn, ynBh2
2!f–nAxnB p . fn
fnAxBfnAxnBhf¿nAxnB h2
2!f–nAxnB p , fnAxB
f¿nfAx, fnB , fnAxnByn . fnAxB
EAx, yB: a 6 x 6 b, q 6 y 6 qF 0f
/
0yOAhB fAxB.
y¿fAx, yB , yAx0By0 .
f(x)
132 Chapter 3 Mathematical Models and Numerical Methods Involving First-Order Equations