Skip to content

Commit

Permalink
Merge pull request #674 from suny-downstate-medical-center/netpyne_joao
Browse files Browse the repository at this point in the history
added a missing ghk.inc mod file in the batchCell example
  • Loading branch information
vvbragin authored Apr 15, 2022
2 parents 522f377 + 7744d48 commit 7974cad
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions examples/batchCell/mod/ghk.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
COMMENT
GHK function that returns effective driving force
Slope at low voltages is 1
z needs to be set as a PARAMETER
ENDCOMMENT

FUNCTION ghkg(v(mV), ci(mM), co(mM), z) (mV) {
LOCAL xi, f, exi, fxi
f = R*(celsius+273.15)/(z*(1e-3)*FARADAY)
xi = v/f
exi = exp(xi)
if (fabs(xi) < 1e-4) {
fxi = 1 - xi/2
}else{
fxi = xi/(exi - 1)
}
ghkg = f*((ci/co)*exi - 1)*fxi
}

FUNCTION ghk(v(mV), ci(mM), co(mM), z) (.001 coul/cm3) {
LOCAL xi, f, exi, fxi
f = R*(celsius+273.15)/(z*(1e-3)*FARADAY)
xi = v/f
exi = exp(xi)
if (fabs(xi) < 1e-4) {
fxi = 1 - xi/2
}else{
fxi = xi/(exi - 1)
}
ghk = (.001)*z*FARADAY*(ci*exi - co)*fxi
}









0 comments on commit 7974cad

Please sign in to comment.