Page 125 -
P. 125

Solve, over the interval 0 ≤ t ≤ 20, the following first-order differential equa-
                             tion for a = 2 and a = 0.5:


                                                           dy
                                                         a    +  y = 1
                                                           dt
                             where y(0) = 0. (Physically, this would correspond to the charging of a capac-
                             itor from a dc source connected suddenly to the battery at time zero. Here, y
                             is the voltage across the capacitor, and a = RC.)
                             NOTE The analytic solution to this problem is y = 1 – exp(–t/a).





                             4.7.2  Higher-Order Iterators: The Runge-Kutta Method*
                             In this subsection, we want to explore the possibility that if we sampled the
                             function n-times per step, we will obtain a more accurate solution to the ODE
                             than that obtained from the first-order iterator for the same value of ∆t.
                              To focus the discussion, consider the ODE:

                                                        y′(t) = f(t, y(t))                 (4.41)

                             Higher-order ODEs can be reduced, as will be shown at the end of the sub-
                             section, to a system of equations having the same functional form as Eq.
                             (4.41). The derivation of a technique using higher-order iterators will be
                             shown below in detail for two evaluations per step. Higher-order recipes can
                             be found in most books on numerical methods for ODE.
                              The key to the Runge-Kutta method is to properly arrange each of the eval-
                             uations in a particular step to depend on the previous evaluations in the
                             same step.
                              In the second-order model:

                             if:                     k =  f t n y t n( ( ), ( ( )))(∆ t)   (4.42)
                                                      1

                             then:              k =  f tn +( ( ) α∆ t y tn +, ( ( )) β k )(∆ t)  (4.43)
                                                 2                      1
                             and                  y t n(( + 1 )) =  y t n(( )) + ak +  bk  (4.44)
                                                                     1    2
                             where a, b, α, and β are unknown parameters to be determined. They should
                                                                          3
                             be chosen such that Eq. (4.44) is correct to order (∆t) .
                              To find a, b, α, and β, let us compute y(t(n + 1)) in two different ways. First,
                             Taylor expanding the function y(t(n + 1)) to order (∆t) , we obtain:
                                                                            2




                             © 2001 by CRC Press LLC
   120   121   122   123   124   125   126   127   128   129   130