Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add new synaptic current to aeif neuron #927

Closed
atiye-nejad opened this issue Jul 4, 2023 · 4 comments
Closed

add new synaptic current to aeif neuron #927

atiye-nejad opened this issue Jul 4, 2023 · 4 comments

Comments

@atiye-nejad
Copy link

I am going to add these synaptic current to aeif neuron.:
` equations:

    inline I_syn_exc pA = (2 - s1) * g_EIn * s * (V_bounded-E_EIn)
    inline I_syn_inh pA = (2 - s2) * g_IIn * s * (V_bounded-E_IIn)
    inline Hing = 1. / (1. + exp((-48. - V_bounded)/ 5.)
    s' = (alpha * Hing * (V_bounded - 25) * (1 - s)) - beta * s 
    
parameters:
    alpha = 3.5 1/ms
    beta = 1. 1/ms
    g_EIn = 1. nS
    g_IIn = 1.3 nS`

s1 and s2 are some parameters that I would like to determine at the beginning of stimulation and change their values to see the results? when I add these equations to aeif_cond_alpha neuron to make a new neuron module I received these errors? can You help me where I am wrong to correct it?
the final neuron:
`neuron aeif_cond_alpha:

state:
    V_m mV = E_L       # Membrane potential
    w pA = 0 pA        # Spike-adaptation current

equations:
    inline V_bounded mV = min(V_m, V_peak) # prevent exponential divergence
    kernel g_inh = (e / tau_syn_inh) * t * exp(-t / tau_syn_inh)
    kernel g_exc = (e / tau_syn_exc) * t * exp(-t / tau_syn_exc)

    # Add inlines to simplify the equation definition of V_m
    inline exp_arg real = (V_bounded - V_th) / Delta_T
    inline I_spike pA = g_L * Delta_T * exp(exp_arg)
    inline I_syn_exc pA = convolve(g_exc, exc_spikes) * (V_bounded - E_exc)
    inline I_syn_inh pA = convolve(g_inh, inh_spikes) * (V_bounded - E_inh)
    inline Hing real = 1. / (1. + exp((-48. - V_bounded)/ 5.)
    inline I_syn_exc pA = (2 - s1) * g_EIn * s * (V_bounded-E_EIn)
    inline I_syn_inh pA = (2 - s2) * g_IIn * s * (V_bounded-E_IIn)


    V_m' = (-g_L * (V_bounded - E_L) + I_spike - w + I_e + I_stim + I_syn_exc + I_syn_inh) / C_m
    w' = (a * (V_bounded - E_L) - w) / tau_w
    s' = (alpha * Hing * (V_bounded - 25) * (1 - s)) - beta * s 

parameters:
    # membrane parameters
    C_m pF = 281.0 pF         # Membrane Capacitance
    t_ref ms = 0.0 ms         # Refractory period
    V_reset mV = -60.0 mV     # Reset Potential
    g_L nS = 30.0 nS          # Leak Conductance
    E_L mV = -70.6 mV         # Leak reversal Potential (aka resting potential)

    # spike adaptation parameters
    a nS = 4 nS               # Subthreshold adaptation
    b pA = 80.5 pA            # Spike-triggered adaptation
    Delta_T mV = 2.0 mV       # Slope factor
    tau_w ms = 144.0 ms       # Adaptation time constant
    V_th mV = -50.4 mV        # Threshold Potential
    V_peak mV = 0 mV          # Spike detection threshold

    
    # constant external input current
    I_e pA = 0 pA
    
    # added synaptic parameters
    alpha = 3.5 1/ms
    beta = 1. 1/ms
    g_EIn = 1. nS
    g_IIn = 1.3 nS



    # refractory time in steps
    RefractoryCounts integer = steps(t_ref)
    # counts number of tick during the refractory period
    r integer

input:
    inh_spikes nS <- inhibitory spike
    exc_spikes nS <- excitatory spike
    I_stim pA <- continuous

output:
    spike

update:
    integrate_odes()

    if r > 0: # refractory
        r -= 1 # decrement refractory ticks count
        V_m = V_reset # clamp potential
    elif V_m >= V_peak: # threshold crossing detection
        r = RefractoryCounts
        V_m = V_reset # clamp potential
        w += b
        emit_spike()`
@pnbabu
Copy link
Contributor

pnbabu commented Jul 4, 2023

@atiye-nejad s1 and s2 are not defined anywhere in the model but are defined in the equations. That is why the error. You can define them in the parameters block and change them using the nest.set() function in your simulation script.

@atiye-nejad
Copy link
Author

thanks. I defined an initial values in parameters block for s1 and s2 but I received this error:
File "/home/atine/Updated_neuron/updated_neuron.py", line 3, in <module> import matplotlib.pyplot as plt File "/home/atine/miniconda3/lib/python3.10/site-packages/matplotlib/pyplot.py", line 44, in <module> from matplotlib.figure import Figure, figaspect File "/home/atine/miniconda3/lib/python3.10/site-packages/matplotlib/figure.py", line 24, in <module> from matplotlib import docstring, projections File "/home/atine/miniconda3/lib/python3.10/site-packages/matplotlib/projections/__init__.py", line 4, in <module> from mpl_toolkits.mplot3d import Axes3D File "/usr/lib/python3/dist-packages/mpl_toolkits/mplot3d/__init__.py", line 1, in <module> from .axes3d import Axes3D File "/usr/lib/python3/dist-packages/mpl_toolkits/mplot3d/axes3d.py", line 47, in <module> class Axes3D(Axes): File "/usr/lib/python3/dist-packages/mpl_toolkits/mplot3d/axes3d.py", line 54, in Axes3D Axes._shared_axes["z"] = cbook.Grouper() AttributeError: type object 'Axes' has no attribute '_shared_axes'. Did you mean: '_shared_x_axes'?

@pnbabu
Copy link
Contributor

pnbabu commented Jul 4, 2023

@atiye-nejad The error seems to be coming from matplotlib and not from NESTML.

@clinssen
Copy link
Contributor

Closing due to inactivity; please feel free to re-open if there is still an issue. Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants