#from brian.library.ionic_currents import *
## Constants
C = 1*mfarad; I = 40*mA
E_L = -80*mvolt; E_Na = 60*mvolt; E_K = -90*mvolt
g_L = 8*siemens; g_Na = 20*siemens; g_K = 10*siemens
g_syn = 10*siemens; maxConn = 50*mA
V_half_m = -20*mvolt; V_half_n = -25*mvolt
Theta_syn = -30*mvolt; V_syn = 30*mvolt
k_m = 15*mvolt; k_n = 5*mvolt
tau = 1*second; time = 10*second
V_01 = -10*mvolt; n_01 = 0.4
V_02 = -40*mvolt; n_02 = 0.3
equs = Equations('''
n_inf_V = 1/(1 + exp((V_half_n - V)/k_n)) : 1
m_inf_V = 1/(1 + exp((V_half_m - V)/k_m)) : 1
dV/dt = (I - g_L*(V - E_L) - g_Na*m_inf_V*(V - E_Na) -\
g_K*n*(V - E_K) + I_gap)/C : volt #was mvolt
dn/dt = (n_inf_V - n)/tau : 1
I_gap : amp''') #was mamp
G = NeuronGroup(N=2, model=equs, method='exponential_Euler')
G1 = G[0:1]
G2 = G[1:2]
G1.V = V_01; G1.n = n_01
G2.V = V_02; G2.n = n_02
synEqus = ('''w : siemens #conductivity
I_syn = w*(V_syn - V_pre)/(1 + exp(-100*(V_post - Theta_syn)/volt)) :\
amp ''')
S = Synapses(G1, G2, model=synEqus)
S.connect(True)
G.I_gap=S.I_syn
S.w = g_syn
M1 = MultiStateMonitor(G1, ['V', 'n'], record=0)
M2 = MultiStateMonitor(G2, ['V', 'n'], record=0)
#M3 = StateMonitor(S, 'I_gap', record=True)
defaultclock.t = 0*second
run(time)
plt.figure(1)
xlabel('Voltage (V)')
ylabel('Response')
title('V vs. n')
plot(M1['V'][0], M1['n'][0], 'k', c='b')
plot(M2['V'][0], M2['n'][0], 'k', c='g')
plt.figure(2)
xlabel('Time (s)')
ylabel('Voltage (mV)')
plot(M1['V'].times/second, M1['V'][0]/mV, 'k', c='b')
plot(M2['V'].times/second, M2['V'][0]/mV, 'k', c='g')
#plt.figure(3)
#plot(M1['V'].times/second, M3[0]/mA, c = 'r')
show()
--
You received this message because you are subscribed to the Google Groups "Brian" group.
To unsubscribe from this group and stop receiving emails from it, send an email to briansupport...@googlegroups.com.
To post to this group, send email to brians...@googlegroups.com.
Visit this group at http://groups.google.com/group/briansupport.
For more options, visit https://groups.google.com/d/optout.