Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- od0o = np.zeros((N,))
- od0o[0]=0.7
- od0n = np.zeros((N,))
- def TOTAL(a):
- ...
- return...
- for i in range (1,N):
- R = np.random.uniform(0,1)
- od0n[i] = od0o[i-1] + 0.001 * np.random.normal()
- L = np.exp(-0.5 * (TOTAL(od0n[i]) - TOTAL(od0o[i-1]))
- LL=min(1,max(L,0))
- if LL>R:
- od0o[i]= od0n[i]
- chi = TOTAL(od0o[i])
- else:
- od0o[i]= od0o[i-1]
- chi = TOTAL(od0o[i])
Add Comment
Please, Sign In to add comment