error

Anything that doesn't fit elsewhere.
Post Reply
liqiang
Posts: 4
Joined: Wed Sep 11, 2024 11:04 pm

error

Post by liqiang »

Hello, when I tried to apply some synapses to a neuron and activate them, an error occurred:
net_send td-t = -4.2861 SelfEvent target=VecStim[1699] 31.1650471072498 flag=1

Here is my code:

Code: Select all

for i, (ampa_vecstim, nmda_vecstim) in enumerate(zip(ampa_vecstim_list, nmda_vecstim_list)):
    t_ampa_vec = h.Vector(ampa_activation[i])
    ampa_vecstim.play(t_ampa_vec)
    t_nmda_vec = h.Vector(nmda_activation[i])
    nmda_vecstim.play(t_nmda_vec)
soma_v = h.Vector()
soma_v.record(complex_cell.soma[0](0.5)._ref_v)

time_v = h.Vector()
time_v.record(h._ref_t)
h.tstop = 8000
st = time.time()
h.run()
I want to ask what's wrong with it.
ted
Site Admin
Posts: 6381
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: error

Post by ted »

About this Forum: If you need to paste code, be sure to surround it with the proper markup (that's what the < / > formatting button is for). Otherwise things like leftsquarebracket i rightsquarebracket will be treated as formatting instructions (interpreted as "italic").

Here's how to fix your own code:
1. When you're developing code and something doesn't work, try again with the simplest model possible: a single compartment model cell, a single synaptic mechanism attached to it, and one vector of synaptic activation times. When you get that working, add a second synaptic mechanism with a different vector of synaptic activation times. Then try a larger number of synaptic mechanisms and activation time vectors.
2. Development and debugging will be easiest if you begin with short run times. 5 or 10 ms is long enough to reveal the most common problems. Code that dies immediately isn't going to work better with a long run time. Code that produces incorrect results from the start doesn't have to run for 8000 ms to reveal what's wrong.

Here are three questions about this loop:

Code: Select all

for i, (ampa_vecstim, nmda_vecstim) in enumerate(zip(ampa_vecstim_list, nmda_vecstim_list)):
    t_ampa_vec = h.Vector(ampa_activation[i])
    ampa_vecstim.play(t_ampa_vec)
    t_nmda_vec = h.Vector(nmda_activation[i])
    nmda_vecstim.play(t_nmda_vec)
Why are the iterated variables never used in the loop?
What are

Code: Select all

ampa_activation[i]
and

Code: Select all

nmda_activation[i]
?
Let's pretend that the loop actually works. After the first pass through the loop, what do you think will happen to the t_ampa_vec and t_nmda_vec that were created in the previous pass?
Post Reply