I want to plot current through different types of voltage gated calcium channels. This is the code that I have:
Code: Select all
#Formulas for Non-modulated Ca currents
threshold = 1.10e-4
m = 10000 # steepness of switch
temp1 = 0.0853*T/2
temp2 = v/temp1
# switch goes to 0 for abs(temp2) < threshold and 1 for abs(temp2) > threshold
switch = (1 + tanh(((fabs(temp2) - threshold)*100)))/2
temp3 = (1-switch)*(1-temp2/2) + switch*(temp2/exp(temp2)-1)
gca_N = gcabar_N * mgate_N**2 * hgate_N
gca_L = gcabar_L * mgate_L**2
dvf = 0.001/(0.001+cai)*temp1*temp3*(1-cai/cao*exp(temp2))
I_non_mod_L = -gca_L*dvf
I_non_mod_N = -gca_N*dvf
mgate_N = rxd.State([cyt, mem], name = 'mgate_N', initial = 0.001581552)
hgate_N = rxd.State([cyt, mem], name = 'hgate_N', initial = 0.973556944)
mgate_L = rxd.State([cyt, mem], name = 'mgate_L', initial = 3.42574e-6)
m_gate_N = rxd.Rate(mgate_N, (minf_N-mgate_N)/tau_Nm)
h_gate_N = rxd.Rate(hgate_N, (hinf_N-hgate_N)/tau_Nh)
m_gate_L = rxd.Rate(mgate_L, (minf_L-mgate_L)/tau_Lm)
ca_N_current = rxd.MultiCompartmentReaction(cai, cao, I_non_mod_N, mass_action = False,
membrane = mem, membrane_flux = True)
ca_L_current = rxd.MultiCompartmentReaction(cai, cao, I_non_mod_L, mass_action = False,
membrane = mem, membrane_flux = True)
leak_current = rxd.MultiCompartmentReaction(xi, xo, gl*(v - el), mass_action = False,
membrane = mem, membrane_flux = True)