Regenerated PDF

This commit is contained in:
Roger Labbe
2015-05-01 07:05:53 -07:00
parent 4fef1138f7
commit 08123b0d15
4 changed files with 80 additions and 2 deletions

26
experiments/euler.py Normal file
View File

@@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 21 18:40:47 2015
@author: Roger
"""
def dx(t, y):
return y
def euler(t0, tmax, y0, dx, step=1.):
t = t0
y = y0
while t < tmax:
f = dx(t,y)
y = y + step*dx(t, y)
t +=step
return y
print(euler(0, 4, 1, dx, step=0.25))