80 likes | 337 Views
Euler’s Method. Recall: If we have a differential equation and an initial value, Euler’s method lets us build an approximation to graph of the function f . New t = Old t + D t New y = Old y + y ’(Old t , Old y ) D t. D t. How accurate is the approximation?
E N D
Euler’s Method Recall: If we have a differential equation and an initial value, Euler’s method lets us build an approximation to graph of the function f. New t = Old t + Dt New y = Old y + y’(Old t, Old y) Dt Dt How accurate is the approximation? Answer: Sometimes it is more accurate than others.
Turning Corners (or Not!!!) Euler’s method is very bad at turning corners. When it nears a maximum, it “overshoots.” Likewise, when it nears a minimum, it drops too far.
Point of View Dt Dt Dy = f’(point)*Dt Area = f’(point)*Dt Euler’s method is a generalization of the left end-point Riemann sum!
Dt Dt Dt 2 Midpoint Approximations We use this insight to improve on Euler’s method. The midpoint Riemann sum is much more accurate.
Dt Dt 2 Improved Euler’s Method We don’t know the value of the function at the midpoint. We only know the value of the function at the left endpoint. The idea obviously has merit. There’s only one problem . . . But we can approximate the value of the function at the midpoint using the ordinary Euler approximation!
Here it is! Old t andOld y temp t = Old t + 0.5(Dt) Temp y = Old y + 0.5(Dt) y’(Old t, Old y) New t = Old t + Dt New y = Old y + y’(Temp t, Temp y) Dt