def simulate_baseline(time=10 * second):
    prc = PinskyRinzelCell()
    prc_group = prc.generate_neuron_group(n_cells=1)
    net = br2.Network(prc_group)
    mon = br2.StateMonitor(prc_group, True, record=True)
    net.add(mon)
    net.run(time, report='text')

    return prc, prc_group, net, mon
Exemplo n.º 2
0
def simulate_baseline(time=10 * second):
    # We simulate the CA1 cells, which have a modified maximum Ca-conductance
    tpr_cell_group = generate_ca1_pyramidal_group(n_cells=1)

    net = br2.Network(tpr_cell_group)
    mon = br2.StateMonitor(tpr_cell_group, True, record=True)
    net.add(mon)
    net.run(time, report='text')

    return tpr_cell_group, net, mon
def simulate_fig2a(time=2 * second, dt=None):
    prc = PinskyRinzelCell()
    prc_group = prc.generate_neuron_group(n_cells=1, dt=None)
    prc_group.Is_inj = 0.75 * (uA /
                               cm2) * prc.general_parameters['membrane_area']
    net = br2.Network(prc_group)
    mon = br2.StateMonitor(prc_group, True, record=True)
    net.add(mon)
    net.run(time, report='text')

    return prc, prc_group, net, mon
Exemplo n.º 4
0
def simulate_prfig2a(time=2 * second, dt=None):
    # We simulate the CA1 cells, which have a modified maximum Ca-conductance
    # These cells should show tonic firing instead of bursting
    tpr_cell = TaxidisPinskyRinzelCell()

    tpr_cell.somatic_parameters['Is_soma'] = 0.75 * uA / cm2
    tpr_cell.dendritic_parameters['gd_Ca'] = 7 * msiemens / cm2

    tpr_cell_group = tpr_cell.generate_neuron_group(n_cells=1, dt=None)

    net = br2.Network(tpr_cell_group)
    mon = br2.StateMonitor(tpr_cell_group, True, record=True)
    net.add(mon)
    net.run(time, report='text')

    return tpr_cell_group, net, mon
def get_tuning_curves(n, nb_bins):
    x = np.linspace(0, 2 * np.pi, nb_bins + 1)
    phi = np.linspace(0, 2 * np.pi, n + 1)[0:-1]
    A = np.random.uniform(10, 50, n)
    B = np.random.uniform(5, 10, n)
    C = np.random.uniform(0, 2, n)
    return pd.DataFrame(index=x,
                        columns=np.arange(n),
                        data=C +
                        A * np.exp(B * np.cos(np.vstack(x) - phi)) / np.exp(B))


N = 20  # number of neurons
tcurves = get_tuning_curves(N, nb_bins=60)
freq_steps = tcurves.reindex(hd_signal, method='nearest').values
network = br2.Network()
stim_hd = br2.TimedArray(freq_steps * br2.Hz, dt=float(bin_size) * br2.ms)
network.add(br2.PoissonGroup(N, rates='stim_hd(t, i)'))
network.add(br2.SpikeMonitor(network.objects[0]))
network.run(duration * br2.ms, report='text')
spikes = network.objects[2].spike_trains()
del network

# the firing rate
frate = pd.DataFrame(index=hd_signal.index)
for k in spikes.keys():
    frate[k], bins_edge = np.histogram(spikes[k] / br2.ms,
                                       int(duration / bin_size),
                                       range=(0, duration))

########################################################################################################