def test_euler(self):
     euler_det = integrators.EulerDeterministic()
     euler_sto = integrators.EulerStochastic()
     self.assertEqual(euler_det.dt, dt)
     self.assertEqual(euler_sto.dt, dt)
     self.assertTrue(isinstance(euler_sto.noise, noise.Additive))
     self.assertEqual(euler_sto.noise.nsig, 1.0)
     self.assertEqual(euler_sto.noise.ntau, 0.0)
Beispiel #2
0
 def test_euler(self):
     euler_det = integrators.EulerDeterministic()
     euler_sto = integrators.EulerStochastic()
     euler_sto.noise.dt = euler_sto.dt
     assert euler_det.dt == dt
     assert euler_sto.dt == dt
     assert isinstance(euler_sto.noise, noise.Additive)
     assert euler_sto.noise.nsig == 1.0
     assert euler_sto.noise.ntau == 0.0
     self._test_scheme(euler_det)
     self._test_scheme(euler_sto)
Beispiel #3
0
 def _run_sim(self, length, model, *mons):
     sim = simulator.Simulator(
         model=model,
         connectivity=connectivity.Connectivity(load_default=True),
         coupling=coupling.Linear(),
         integrator=integrators.EulerDeterministic(),
         monitors=mons)
     sim.configure()
     ys = []
     for (t, y), in sim(simulation_length=length):
         ys.append(y)
     return sim, numpy.array(ys)
Beispiel #4
0
 def gen_sim(a):
     dt = 0.1
     conn = connectivity.Connectivity()
     conn.weights = weights
     conn.tract_lengths = idelays * dt
     conn.speed = 1.0
     sim = simulator.Simulator(
         coupling=py_coupling.Kuramoto(a=a),
         connectivity=conn,
         model=models.Kuramoto(omega=100 * 2 * numpy.pi / 1e3),
         monitors=monitors.Raw(),
         integrator=integrators.EulerDeterministic(dt=dt))
     sim.configure()
     sim.history[:] = 0.1
     return sim