Description of problem
I am new to Brian 2 and python in general so this may be very basic. I obtained a list of synaptic weights based on the time gaps between pre and post-synaptic firings from the STDP tutorial in the documentation. I am trying to apply each synaptic weight value obtained from that list to a separate synapse and output the post synaptic membrane potentials after some duration. After every firing, the post synaptic membrane potential should increase by the weight provided in the list at the iteration the loop is currently on. Then I want to add the final membrane potential to a list, and then iterate through the synaptic weights list until all values have been simulated through a separate neuron.
Minimal code to reproduce problem
Here’s what I have tried so far, there is probably a better way to go about it but I don’t really know what I’m doing yet.
``` delta_w_values=[0.00082085, 0.00086726, 0.00091173, 0.00095847, 0.00100761, #Obtained from a STDP simulation Final_Membrane_Potentials = [] for del_w in delta_w_values: P = NeuronGroup(1, 'dv/dt=(1-v)/(tau) : 1', method='exact', threshold='v > -55', reset='v = -70', refractory=2 * ms) Q = NeuronGroup(1, 'dv/dt=(1-v)/(tau) : 1', method='exact', refractory=2 * ms) P.v = -70 # Initializing neuron P voltage Q.v = -70 # Initializing neuron Q voltage S = Synapses(P, Q, on_pre='v += del_w', delay=2 * ms) S.connect(j='i') M = StateMonitor(Q, 'v', record=True) run(1000 * ms) Final_Membrane_Potentials.append(M.v[-1]) print(Final_Membrane_Potentials)```
This is the result:
[array([-70. , -69.2935382 , -68.5941058 , …, 1.00324561,
1.00321331, 1.00318134]), array([-70. , -69.2935382 , -68.5941058 , …, 1.00342911,
1.00339499, 1.00336121]), array([-70. , -69.2935382 , -68.5941058 , …, 1.00360494,
1.00356907, 1.00353356]), array([-70. , -69.2935382 , -68.5941058 , …, 1.00378975,
1.00375204, 1.00371471]), array([-70. , -69.2935382 , -68.5941058 , …, 1.00398405,
1.00394441, 1.00390516])]
Why do I get this instead of just one final membrane potential for each delta w value, so five values?
Thanks in advance for the help!