update on machine learning
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import numpy as np
|
||||
|
||||
t = np.linspace(0, 10, 21) # 20 intervals in [0, 10]
|
||||
dt = t[1] - t[0]
|
||||
N = np.zeros(t.size)
|
||||
|
||||
N[0] = 1
|
||||
r = 0.5
|
||||
|
||||
for n in range(0, N.size-1, 1):
|
||||
N[n+1] = N[n] + r*dt*N[n]
|
||||
print 'N[%d]=%.1f' % (n+1, N[n+1])
|
||||
Reference in New Issue
Block a user