Exemple #1
0
 def step(x0, t, dt):
     if kind == "EM":
         # Euler-Maruyama (order 1.0 Weak / Strong) integration
         return rk4(lambda x, t: dxdt(x),
                    x0,
                    np.nan,
                    dt,
                    s=diffusion,
                    stages=1)
     elif kind == "RK4":
         # 4-stage Runge-Kutta (order 1.0 Weak / Strong) integration
         return rk4(lambda x, t: dxdt(x),
                    x0,
                    np.nan,
                    dt,
                    s=diffusion,
                    stages=4)
     elif kind == "Tay2":
         # Taylor-Stratonovich (order 2.0 Weak / Strong) integration.
         return l96s_tay2_step(x0, np.nan, dt, diffusion)
     else:
         raise ValueError
Exemple #2
0
def step(x0, t, dt):
    return rk4(lambda x, t: dxdt(x), x0, np.nan, dt)
Exemple #3
0
 def step(self, x0, t, dt):
     return rk4(lambda t, x: self.dxdt(x), x0, np.nan, dt)
Exemple #4
0
 def step1(self, x0, t, dt):
     return rk4(lambda x, t: self.dxdt(x), x0, np.nan, dt)