I couldn’t understand what is my exact problem but I already tried different types of input so I believe the problem is not there. And when I look at my plot I couldn’t understand either. I guess I need a synapse equation but could anyone please help me about what is the problem here Thanks!

# Minimal code to reproduce problem

I convert my “stim” array to TimedArray:

``````
from brian2 import *

my_stim = TimedArray(stim * Hz, dt=1*ms)
tau=10*ms

P = PoissonGroup(1, rates='I_stim(t)')
A = NeuronGroup(100, 'dv/dt = -v/tau : volt', threshold='v > -50*mV', reset='v = -70*mV', refractory=5*ms)

P_A = Synapses(P,A, model='w : volt', on_pre='v += w', delay = 2*ms)
P_A.connect(condition='i != j')

A_M = StateMonitor(A, variables=True, record=True)
A_SM = SpikeMonitor(A)

run(1*second)

plot(A_M.t / ms, A_M[0].v / mV)
ylabel('v (mV)')
xlabel('t (ms)')
show()

plot(A_SM.t/ms, A_SM.i, '.')
xlim(0, 1*second/ms)
show()

``````

# Actual output

Hi @SirK ,
It’s hard to tell from your code what exactly is happening here. This code should return an error unless you posted a code snippet.

Below are a few problems:

• there is no variable `stim``TimedArray` should return an error
• there is no variable `I_stim``PoissonGroup` should return an error
• in the equation for voltage, there is no resting potential – voltage is trying to return back to zero after it is reset to -70mV each time it crosses -50mV. These neurons must oscillate at a pretty high frequency.
• finally, you defined variable `w` for synapses `P_A` `"w : volt"` but you don’t set this variable to a specific value (like `P_A.w=5*mV`), but the value by default is zero – spikes from `P` never effect `A`.

Hope it helps,
rth

I believe I cannot express myself clearly sorry for that. I dropped the timed array method and wrote some equations for my first neuron group to generate stimulation and solved my problem.
Thank you so much for your effort have a nice day

1 Like