In [65]:
import numpy as np
%matplotlib inline
import matplotlib
import matplotlib.pyplot as plt
In [66]:
dt = 0.02
N = 2000
X = np.zeros(N)
Y = np.zeros(N)
Y[:] = -2
R = np.random.lognormal(mean = 1, sigma = 1, size = N)
In [67]:
def vx(y):
    return np.exp(y)

def vy(r):
    return np.sqrt(r)
In [79]:
for i in range(5):
    X = X + vx(Y)*dt + np.random.normal(loc = 0.0, scale = 0.01, size = N)
    Y = Y + vy(R)*dt + np.random.normal(loc = 0.0, scale = 0.01, size = N)
    Y[Y > 0] = 0

plt.clf()
plt.figure(figsize = (10,6))
plt.xlim((-0.1, 2.1))
plt.ylim((-2.1, 0.1))
plt.scatter(X, Y, s = 20*R, marker = '.', c = 'k', lw = 0, alpha = 0.6)
Out[79]:
<matplotlib.collections.PathCollection at 0x11b0810d0>
<matplotlib.figure.Figure at 0x11acfae10>
In [69]:
 
In [ ]: