Beispiel #1
0
def two_coupled_li_neurons(y_0, t_max, dt, params, figure="Phase"):
    """ Two mutually coupled leaky-integrator neurons with self connections """
    res = integrate_multiple(two_li_ode,
                             y_0,
                             np.arange(0, t_max, dt),
                             args=(params, ))
    labels = ["Neuron 1", "Neuron 2"]
    res.plot_state(figure + "_state", label=False, subs_labels=labels)
    res.plot_phase(figure + "_phase", scale=0.05, label=labels)
    return res
Beispiel #2
0
def hopf_ocillator():
    """ 4a - Hopf oscillator simulation """
    params = HopfParameters(mu=1., omega=1.0)
    time = np.arange(0, 30, 0.01)
    title = "Hopf oscillator {} (x0={})"
    label = ["x0", "x1"]
    x0_list = [[1e-3, 1e-3], [1.0, 1.0]]
    for x0 in x0_list:
        hopf = integrate(hopf_equation, x0, time, args=(params,))
        hopf.plot_state(title.format("state", x0), label)
    hopf_multiple = integrate_multiple(
        hopf_equation,
        x0_list,
        time,
        args=(params,)
    )
    hopf_multiple.plot_phase(title.format("phase", x0_list), label=label)