Example 2.  Use Mathematica to find the analytic solution and graph for the I.V.P.  [Graphics:Images/RungeKuttaMod_gr_40.gif].  

Solution 2.

[Graphics:../Images/RungeKuttaMod_gr_41.gif]


[Graphics:../Images/RungeKuttaMod_gr_42.gif]
[Graphics:../Images/RungeKuttaMod_gr_43.gif]
[Graphics:../Images/RungeKuttaMod_gr_44.gif]
[Graphics:../Images/RungeKuttaMod_gr_45.gif]
[Graphics:../Images/RungeKuttaMod_gr_46.gif]

Dig out the formula for the solution out of the data structure of  solset and put it in  f[t].
Plot the analytic solution at the same sample points that were used for the numerical approximations.

[Graphics:../Images/RungeKuttaMod_gr_47.gif]

[Graphics:../Images/RungeKuttaMod_gr_48.gif]

[Graphics:../Images/RungeKuttaMod_gr_49.gif]
[Graphics:../Images/RungeKuttaMod_gr_50.gif]

Just for fun, plot the Runge-Kutta solution and the analytic solution. Notice that there is a difference.

[Graphics:../Images/RungeKuttaMod_gr_51.gif]

[Graphics:../Images/RungeKuttaMod_gr_52.gif]

[Graphics:../Images/RungeKuttaMod_gr_53.gif]

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(c) John H. Mathews 2004