All published worksheets from http://sagenb.org
# # Euler's method # from pylab import * # time step h = 0.05 # initial condition x0 = 2.0 y0 = 4.0 # final point xn = 2.5 # function (DE) def fn(x, y): return 0.1 * sqrt(y) + 0.4 * x * x; # algorithm y = y0 print "xn yn" for x in arange(x0,xn+(h/2),h): print "%.2lf" % x, "%.4lf" % y y = y + h * fn(x, y)