Download presentation
Presentation is loading. Please wait.
Published byRolf Beasley Modified over 8 years ago
1
Euler’s method and so on… Euler’s method of approximation of a function y = f(x) is approximations. constructed from repeated applications of linear It consists of generating a sequence of ordered pairs (x i, y i ). The sequence is generated in the following way. (a, b) are the coordinates of the starting point x 1 = ay 1 = b x 2 = x 1 + hy 2 y 1 + f (x 1 ) × h where h is the step size x 3 = x 2 + hy 3 y 2 + f (x 2 ) × h
2
Euler’s method Consider approximating the function f(x) = e x over the interval [2, 2.2]. Choose (2, e 2 ) as the coordinates of the starting point, i.e., (x 1, y 1 ) = (2, e 2 ). x y 7.389 7.639 7.889 8.139 8.389 8.639 8.889 22.0252.052.0752.12.1252.152.1752.2 y = e x (2, e 2 )
3
Euler’s method Choose a step size of 0.1, therefore h = 0.1 y x 7.389 7.639 7.889 8.139 8.389 8.639 8.889 22.0252.052.0752.12.1252.152.1752.2 ( 2, e 2 ) ( 2.1, e 2.1 ) 0.1 f (x 1 ) × h = e 2 × 0.1 ( 0.739) Gradient = e 2 The approximated value of the function when x = 2.1 is e 2 + 0.1e 2 = 1.1e 2 = e 2 + 0.739 8.128 x 2 = x 1 + h = 2 + 0.1 = 2.1 f (x) = e x, f (x 1 ) = e 2.The straight line with gradient e 2 is drawn from the start point. (2.1, 8.128) The actual value of the function when x = 2.1 is e 2.1 (8.166…) y = e x
4
Euler’s method Gradient = e 2.1 The process can be repeated with a new start point at (2.1, 1.1e 2 ) y x 7.389 7.639 7.889 8.139 8.389 8.639 8.889 22.0252.052.0752.12.1252.152.1752.2 0.1 f (x 2 ) × h = e 2.1 × 0.1 ( 0.817) The approximated value of the function when x = 2.2 is 1.1e 2 + 0.817 8.945 x 3 = x 2 + h = 2.1 + 0.1 = 2.2 f (x 2 ) = e 2.1.The straight line with gradient e 2.1 is drawn from the new start point. (2.1, 1.1e 2 ) The actual value of the function when x = 2.2 is e 2.2 (9.025…) y = e x ( 2.2, e 2.2 ) (2.2, 8.945)
5
Euler’s method In summary: (x 1, y 1 ) = (2, e 2 ) Gradient = e 2 f (x 1 ) = e 2 (x 2, y 2 ) = (2.1, 8.128) y x y = e x 7.389 7.639 7.889 8.139 8.389 8.639 8.889 22.0252.052.0752.12.1252.152.1752.2 ( 2.1, e 2.1 ) ( 2.2, e 2.2 ) f (x 2 ) = e 2.1 Gradient = e 2.1 (x 2, y 2 ) = (2.1, 8.128) (x 3, y 3 ) = (2.2, 8.945) (x 1, y 1 ) = ( 2, e 2 )
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.