# This is the reduced model for the ion concentrations
# published in Cressman et al., JCNS 26, 159-170 (2009).
#
# The variables are:
# 	ki = intracellular potassium concentration
# 	ko = extracellular potassium concentration
# 	nai = intracellular sodium concentration
#	nao = extracellular sodium concentration
#
# The parameters of interest are
#	rho = strength of pumps
#	epsilon = diffusion constant for potassium diffusion from the extracellular space to the bath
# 	kbath = bath potassium concentration
#	glia = strength of glia

par rho=01.25, epsilon=1.2, kbath=4.0, glia=66

# Below are the fits to the average potassium and sodium membrane currents.
# The published paper has a few typographical errors. Most importantly, note
# the factors in the expression for g2, and the expression for g3 should read
# g3=(expression)*(the expresion below it, which is mislabeled as g4). One
# should cross out the "g4=".
#
# na_ratio represents the ratio nai/naout; k_ratio represents the ratio ko/ki.
#
# The following are the equations for the fits appear in the paper
# taking the typo described above into account.
#
# g1(na_ratio)=420.0*(1.0-0.75*(1.0-0.93*exp(-2.6*na_ratio))^(1/3))
# g2(k_ratio,na_ratio)=exp(2.0*(1.0-7.41*k_ratio)/(1.0+exp(-2.6*na_ratio)))
# See typo note above about g3
# g3(k_ratio,na_ratio)=((1.0/(1+exp(35.7*(1.0+1.94*na_ratio-24.3*k_ratio))))^5)*((1.0/(1+exp(0.88*(1.0+1.48*na_ratio-24.6*k_ratio))))^5)
# glk(k_ratio)=2.6*exp(-32.5*k_ratio)
# Ik(k_ratio,na_ratio)=g1(na_ratio)*g2(k_ratio,na_ratio)*g3(k_ratio,na_ratio)+glk(k_ratio) 
# Ina(k_ratio,na_ratio)=g1(na_ratio)*g2(k_ratio,na_ratio)*g3(k_ratio,na_ratio)+1.5
#
# However, the following very slightly different equations are what were actually used
# to generate the figures in the paper
#
g1(na_ratio)=420.0*(1.0-0.75*(1.0-0.93*exp(-2.6*na_ratio))^(0.3))
g2(k_ratio,na_ratio)=exp((1.0-7.41*k_ratio)/(1.94+1.98*exp(-2.6*na_ratio)))
g3(k_ratio,na_ratio)=((1.0/(1+exp(35.7*(1.0+1.94*na_ratio-24.3*k_ratio))))^5)*((1.0/(1+exp(0.88*(1.0+1.48*na_ratio-24.6*k_ratio))))^5)
glk(k_ratio)=2.6*exp(-32.5*k_ratio)
Ik(k_ratio,na_ratio)=0.94*(g1(na_ratio)*g2(k_ratio,na_ratio)*g3(k_ratio,na_ratio)+glk(k_ratio))
Ina(k_ratio,na_ratio)=g1(na_ratio)*g2(k_ratio,na_ratio)*g3(k_ratio,na_ratio)+1.5

########

ipumps=(rho/(1.0+exp((25-nai)/3)))*(1.0/(1.0+exp(5.5-ko)))
iglia=glia/(1.0+exp((18.0-ko)/2.5))
idiff=epsilon*(ko-kbath)

ki=140.0+(18.0-nai)
nao=144.0-7.0*(nai-18.0)
# In the following equation, the published paper has a minus sign that should be ignored.
ko'=0.33*Ik((ko/ki),(nai/nao))-14.0*ipumps-iglia-idiff
nai'=0.04714*Ina((ko/ki),(nai/nao))-3.0*ipumps

####

@ TOTAL=1000,BOUND=10000
done