|
@@ -25,9 +25,9 @@ class model:
|
|
|
vSPar=self.getVolumePar(sourceCompartment,scaleToVolume)
|
|
|
vTPar=self.getVolumePar(targetCompartment,scaleToVolume)
|
|
|
|
|
|
-#the source equation (where we subtract the current)
|
|
|
+ #the source equation (where we subtract the current)
|
|
|
addValue(cSrc['targets'],sourceCompartment,-get(k)/get(pc)/get(vSPar))
|
|
|
-#the target equation (where we add the current)
|
|
|
+ #the target equation (where we add the current)
|
|
|
addValue(cTarg['targets'],sourceCompartment,get(k)/get(pc)/get(vTPar))
|
|
|
|
|
|
|
|
@@ -76,7 +76,7 @@ class model:
|
|
|
targetV=self.getVolumePar(target,useVolume)
|
|
|
doAdd=(variable!="volume" or calculateDerivative(targetV))
|
|
|
|
|
|
-#the target equation (where we add the current)
|
|
|
+ #the target equation (where we add the current)
|
|
|
if doAdd:
|
|
|
if variable=="volume":
|
|
|
parName=targetV["name"]
|
|
@@ -184,6 +184,9 @@ class model:
|
|
|
self.flows[pairName]=f
|
|
|
|
|
|
for b in self.mod['bindings']['diffusion']:
|
|
|
+ #whether to scale transfer constants to organ volume
|
|
|
+ #default is true, but changing here will assume no scaling
|
|
|
+ useVolume=1
|
|
|
comps=b.split('->')
|
|
|
try:
|
|
|
pcParName=self.mod['partitionCoefficients'][b]
|
|
@@ -193,15 +196,15 @@ class model:
|
|
|
|
|
|
kParName=self.mod['bindings']['diffusion'][b]
|
|
|
kPar=pars[kParName]
|
|
|
- self.bind(comps[0],comps[1],kPar,pcPar)
|
|
|
+ self.bind(comps[0],comps[1],kPar,pcPar,useVolume)
|
|
|
|
|
|
#add derivatives calculateDerivative returns true
|
|
|
if calculateDerivative(kPar):
|
|
|
self.bindDerivative(kParName,"diffusionParameter",\
|
|
|
- comps[0],comps[1],kPar,pcPar,0)
|
|
|
+ comps[0],comps[1],kPar,pcPar,useVolume)
|
|
|
if calculateDerivative(pcPar):
|
|
|
self.bindDerivative(pcParName,"partitionCoefficient",\
|
|
|
- comps[0],comps[1],kPar,pcPar,0)
|
|
|
+ comps[0],comps[1],kPar,pcPar,useVolume)
|
|
|
|
|
|
for q in self.mod['bindings']['flow']:
|
|
|
comps=q.split('->')
|