Hi,

No problem. The step current generator isn't showing any effect, because the first timepoint of the current generator (in ``amplitude_times``) is set to 1000, and you're also simulating for 1000 ms, so the simulation ends too soon (or the amplitude timepoint should be set earlier).

As for the spiking behaviour, this is because of the way the NESTML model is formulated. When the neuron reaches threshold, a spike is emitted, but the membrane potential is not reset to a large negative value (like E_L), so it stays above threshold and the condition remains active, triggering more spikes to be emitted. You can add the reset to make this issue go away. If this reset is undesirable (because it does not match the way your model should behave), the test that finds the peak in V_m should be improved, for instance by storing one more "old" version of V_m as the model currently does on line 197.

Hope this helps!

Yours,
Charl


On Tue, Aug 22, 2023, at 15:47, atiye nejadebrahim wrote:

Hello Hans, 
This is the scripts with step_current_generator that can't generate spikes:

import numpy as np
import nest
import shelve
import matplotlib.pyplot as plt
nest.Install('hh_motor_neuron_module')
neuron=nest.Create('hh_motor_neuron_nestml',1) #{'I_e':1000})

scg1 = nest.Create("step_current_generator", 1, params={
  "amplitude_times": [1000],
  "amplitude_values": [2000],
})

mm1 = nest.Create("multimeter", 1, params={
  "interval": .1,
  "start": 0,
  "stop": 1000,
  "record_from": ["I"],
})

multimeter = nest.Create("multimeter", params={'record_from':['V_m'],'interval': .1})
spikerecorder = nest.Create("spike_recorder")
spike_times = nest.GetStatus(spikerecorder, keys='events')[0]['times']

nest.Connect(multimeter, neuron)
nest.Connect(neuron, spikerecorder)
nest.Connect(scg1, neuron)
nest.Connect(mm1, scg1)

sim_time = 1000.0  # Simulation time in milliseconds
dt = 0.1          # Simulation time step in milliseconds
nest.Simulate(sim_time)

fig, ax = plt.subplots(nrows=2)
ax[0].plot(multimeter.get("events")["times"], multimeter.get("events")["V_m"])
ax[1].plot(mm1.get("events")["times"], mm1.get("events")["I"])
ax[0].scatter(spike_times, np.zeros_like(spike_times), marker="d", c="orange", alpha=.8, zorder=99)
ax[0].set_ylabel("v [mV]")
ax[1].set_ylabel("I")
ax[-1].set_xlabel("Time [ms]")
fig.show()
plt.show(block=True)

this is the code with injecting I_e that generates asysnchronous outputs between spikes and AP:

import numpy as np
import nest
import shelve
import matplotlib.pyplot as plt

nest.Install('hh_motor_neuron_module')

neuron=nest.Create('hh_motor_neuron_nestml',1, {'I_e':2000})

multimeter = nest.Create("multimeter", params={'record_from':['V_m'],'interval': .1})

spikerecorder = nest.Create("spike_recorder")

spike_times = nest.GetStatus(spikerecorder, keys='events')[0]['times']

nest.Connect(multimeter, neuron)
nest.Connect(neuron, spikerecorder)

sim_time = 1000.0  # Simulation time in milliseconds
dt = 0.1          # Simulation time step in milliseconds
nest.Simulate(sim_time)

dmm = multimeter.get()
Vms = dmm["events"]["V_m"]
ts = dmm["events"]["times"]
plt.figure(1)
plt.plot(ts, Vms)
events = spikerecorder.get("events")
the .nestml neuron model is attached. however it is clear in 'hh_psc_alpha' model, too. 

On Tuesday, August 22, 2023 at 03:33:35 PM GMT+2, Hans Ekkehard Plesser <hans.ekkehard.plesser@nmbu.no> wrote:


 

Hello Atiye,

 

Please post a script that reproduces the behavior you describe. Without it, it is impossible to provide good advice.

 

Best,

Hans Ekkehard

 

-- 

 

Prof. Dr. Hans Ekkehard Plesser

 

Department of Data Science

Faculty of Science and Technology

Norwegian University of Life Sciences

PO Box 5003, 1432 Aas, Norway

 

Phone +47 6723 1560

Email hans.ekkehard.plesser@nmbu.no

Home http://arken.nmbu.no/~plesser

 

 

 

From: atiye nejadebrahim <atiye.nejadebrahim@yahoo.com>
Date: Tuesday, 22 August 2023 at 14:12
To: NEST User Mailing List <users@nest-simulator.org>
Subject: [NEST Users] asynchronicity between spikes and firing pattern


Some people who received this message don't often get email from atiye.nejadebrahim@yahoo.com. Learn why this is important


Dear All,  

I made a HH neuron model and I can get an action potential from it. but it seems there is a problem in spikes. Action potential shape show one spike, but spike recorder shows several spikes and there is not any synchronicity between them. can you help me why? 

my second question is about spike generation, when I use I_e current for injecting current to the neuron, I can record spikes, but when I use step current generators, no spike shows. can you help me why?

Thank you for your consideration. 

Best, 

Atiyeh 

Inline image

 

 

Dear All,  

I made a HH neuron model and I can get an action potential from it. but it seems there is a problem in spikes. Action potential shape show one spike, but spike recorder shows several spikes and there is not any synchronicity between them. can you help me why? 

my second question is about spike generation, when I use I_e current for injecting current to the neuron, I can record spikes, but when I use step current generators, no spike shows. can you help me why?

Thank you for your consideration. 

Best, 

Atiyeh 

 

 

_______________________________________________
NEST Users mailing list -- users@nest-simulator.org
To unsubscribe send an email to users-leave@nest-simulator.org

_______________________________________________
NEST Users mailing list -- users@nest-simulator.org
To unsubscribe send an email to users-leave@nest-simulator.org


Attachments: