Problem Constructing Short-Term Potentiation

I am working with a network of PYR and PVN neurons. For the PYR neurons, I have created two spike event-dependent variables: PYR.u is a unitless spike frequency adaptation variable, while PYR.f is a unitless spike-induced synaptic strength variable. When I run simulations over 4 sec with increasing applied current, I see the expected spike-induced increases in PYR.u, but not in PYR.f (image attached). There are no error messages. I must have a logic error in my code. Suggestions? I apologize for amount of code included. Thx

#Some PYR eqs
eqs_pyr = “”"
Iext : amp
Isyn_e_pyr = g_e*(v-Ee)s_sum_e_pyr : amp
s_sum_e_pyr : 1
d_pyr : siemens
k = (int(v<vt) * klow) + (int(v>=vt) * khigh) : siemens/volt
du/dt = a
(-u) : 1
df/dt = b*(-f) : 1
dv/dt = (k*(v-vr)(v-vt)+Iext-Isyn_e_pyr-ud_pyr*(v-va))/C_pyr : volt
“”"
reset = ‘’’
u += 1
f += 0.5
v = vc
‘’’

#PYR neuron group
PYR = NeuronGroup(N1, model=eqs_pyr, reset=reset, threshold=‘v >= vpeak’, method = ‘euler’)
PYR.d_pyr = 0.000000001 * siemens
print(PYR)

#Excitatory synapse model
S_pyr_pyr=Synapses(PYR,PYR,
model=“”"
f_syn=f : 1
ds0/dt=-(s0-s_inf)/(tau_s) :1 (clock-driven)
ds1/dt=-s1Beta :1 (clock-driven)
s_tot=clip(s0,0,s1)
(1 + f_syn) :1
s_sum_e_pyr_post = s_tot : 1 (summed)
“”“,
on_pre=”“”
s0=s1
s1=(s_inf*(1-exp(-0.001second/tau_s))+s1exp(-0.001second/tau_s))exp(0.001Betasecond)
delay=0.001*second
“”",
method = ‘exact’)

#Connectivity
S_pyr_pyr.connect(condition=‘rand() < 0.02’)
print(“Source neuron indices (i):”, S_pyr_pyr.i[:])
print(“Target neuron indices (j):”, S_pyr_pyr.j[:])
print(“Connections (i, j):”)

set initial conditions

PYR.u=0
PYR.f=0

What you have aready tried

Correction: there was a typographical error in the eq. for dv/dt
Should be:

dv/dt = (k*(v-vr)(v-vt)+Iext-Isyn_e_pyr-u d_pyr*(v-va))/C_pyr : volt

My apologies again. When copy/pasting code into this window, some bold-faced text was corrupted. Here is the code again without typographical error:

#Some cell and synaptic parameters
C_pyr = 115 * pF
vr = -52.0 * mV # resting potential
vpeak = 30.0 * mV # spike peak
va = -65 * mV # adaptive current reversal potential
vt = -49.0 * mV # spike threshold
va = -65 * mV # adaptive current reversal potential
vt = -49.0 * mV # spike threshold
vc = -53.0 * mV # postspike reset potential
N1 = 2000 # number of PYR neurons in network
klow = 0.1 * nS/mV
khigh = 3.3 * nS/mV
a = 0.008 /ms # decay rate of adaptive conductance
b = 0.002 /ms # decay rate of STP
g_e = 0.7 * nS # EPSC conductance
Ee=-15 *mV # EPSC reversal potential
alpha = 2000 /second
Beta = 333.33 /second
s_inf =alpha/(alpha+Beta)
tau_s =1/(alpha+Beta)

#Some PYR eqs
eqs_pyr = “”"
Iext : amp
Isyn_e_pyr = g_e*(v-Ee)s_sum_e_pyr : amp
s_sum_e_pyr : 1
d_pyr : siemens
k = (int(v<vt) * klow) + (int(v>=vt) * khigh) : siemens/volt
du/dt = a
(-u) : 1
df/dt = b*(-f) : 1
dv/dt = (k*(v-vr)(v-vt)+Iext-Isyn_e_pyr-ud_pyr*(v-va))/C_pyr : volt
“”"
reset = ‘’’
u += 1
f += 0.5
v = vc
‘’’
#PYR neuron group
PYR = NeuronGroup(N1, model=eqs_pyr, reset=reset, threshold=‘v >= vpeak’, method = ‘euler’)
PYR.d_pyr = 0.000000001 * siemens
print(PYR)

#Excitatory synapse model
S_pyr_pyr=Synapses(PYR,PYR,
model=“”"
f_syn=f : 1
ds0/dt=-(s0-s_inf)/(tau_s) :1 (clock-driven)
ds1/dt=-s1Beta :1 (clock-driven)
s_tot=clip(s0,0,s1)
(1 + f_syn) :1
s_sum_e_pyr_post = s_tot : 1 (summed)
“”“,
on_pre=”“”
s0=s1
s1=(s_inf*(1-exp(-0.001second/tau_s))+s1exp(-0.001second/tau_s))exp(0.001Betasecond)
delay=0.001*second
“”",
method = ‘exact’)

#Connectivity
S_pyr_pyr.connect(condition=‘rand() < 0.02’)
print(“Source neuron indices (i):”, S_pyr_pyr.i[:])
print(“Target neuron indices (j):”, S_pyr_pyr.j[:])
print(“Connections (i, j):”)

set initial conditions

PYR.u=0
PYR.f=0

Following up on my earlier query, my code is errant in two ways. First, as stated before, a spike is inducing a step increase in adaptation factor u, but is failing to induce a step in the STP factor f. Secondly, my synapse code is flawed because, as written, the synaptic factor f would correspond to prior spiking of the postsynaptic target neuron, not the source neuron.