Ordinary Differential Equations: V M C G DT DV
Ordinary Differential Equations: V M C G DT DV
Ordinary Differential Equations: V M C G DT DV
f ( xi , yi )
where f(xi,yi) is the differential equation evaluated at xi
and yi. This estimate can be substituted into the
equation:
yi 1 yi f ( xi , yi )h
• A new value of y is predicted using the slope to
extrapolate linearly over the step size h.
by Lale Yurttas, Texas A Chapter 25 7
&M University
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
dy
f ( x, y ) 2 x 3 12 x 2 20 x 8.5
dx
Starting point x0 0, y0 1
Not good
f ( xi , yi ) 2
Ea h
2!
Ea O ( h 2 )
• Propagated truncation error
– The sum of the two is the total or global truncation error
– Round-off errors
by Lale Yurttas, Texas A Chapter 25 9
&M University
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
• The Taylor series provides a means of quantifying the
error in Euler’s method. However;
– The Taylor series provides only an estimate of the local
truncation error-that is, the error created during a single
step of the method.
– In actual problems, the functions are more complicated
than simple polynomials. Consequently, the derivatives
needed to evaluate the Taylor series expansion would not
always be easy to obtain.
• In conclusion,
– the error can be reduced by reducing the step size
– If the solution to the differential equation is linear, the
method will provide error free predictions as for a straight
line the 2nd derivative would be zero.
by Lale Yurttas, Texas A Chapter 25 10
&M University
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Figure 25.4
yi 1 yi (a1k1 a2 k 2 )h
or
Compare with
f ( xi , yi ) f ( xi , yi )
yi 1 yi a1 f ( xi , yi ) a2 f ( xi , yi ) p1h q11 k1h h
x y
f ( xi , yi )
yi 1 yi a1h f ( xi , yi ) a2 h f ( xi , yi ) a2 p1h 2
x
2 f ( xi , yi )
a2 q11 f ( xi , yi )h
y
f ( xi , yi ) f ( xi , yi ) h2
yi 1 yi f ( xi , yi )h f ( xi , yi )
x y 2!
a1 a2 1
1
a 2 p1
2
1
a2 q11
2
by Lale Yurttas, Texas A Chapter 25 20
&M University
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
• Because we can choose an infinite number of values for
a2, there are an infinite number of second-order RK
methods.
• Every version would yield exactly the same results if
the solution to ODE were quadratic, linear, or a
constant.
• However, they yield different results if the solution is
more complicated (typically the case).
• Three of the most commonly used methods are: