update on machine learning

This commit is contained in:
mhjensen
2017-12-06 14:13:28 +01:00
parent 2111fd0fbc
commit 3eaf9e4578
70 changed files with 7950 additions and 551 deletions
+12
View File
@@ -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])