Under the terms of the GNU General Public License

Euler Methods

RR converts to a floating-point number to avoid Sage taking too much time with exact values. Here is a plot of our approximation (blue) along with the actual solution (red).

Interactive Euler Method Code

The exact solution is y= e^(1/2*x^2)
eulers_method implements Euler’s method for finding a numerical solution of the first-order ODE y′=f(x,y). The x column of the table increments from x0 to x1 by h (so (x1−x0)/h must be an integer). In the y column, the new y-value equals the old y-value plus the corresponding entry in the last column. Euler's method is used primarily for pedagogical purposes. The following Sage commands use Euler's method to generate a solution for y' = 5xy -5, y(0) =1

Numerical methods, see
http://doc.sagemath.org/html/en/reference/calculus/sage/calculus/desolvers.html
https://www.youtube.com/watch?v=1tzQzFVNMOs
https://share.cocalc.com/share/a170dcd310ae7ea835c8e377659376f4b3621b01/Euler%27s%20Method.sagews?viewer=share

 

  1. Joyner, D. and Hampton, M., Introductory Differential Equations using Sage, 2011.