Andrej пре 2 година
родитељ
комит
cf428f7988

+ 2 - 2
models/humanHG.json

@@ -49,8 +49,8 @@
          "redBloodCells->plasma":"kRBC",
          "kidney->urine":"kU",
          "slowlyPerfused->hair":"kH",
-         "hair->venous":"kH",
          "brainBlood->brain":"kBR",
+         "brain->venous":"kBR",
          "liver->intestine":"kB",
          "liver->inorganicMercury":"kI",
          "intestine->gut":"kR",
@@ -66,7 +66,7 @@
        "brainBlood":"brainBloodPC",
        "liver":"liverPC",
        "gut":"gutPC",
-       "brainBlood->brain":"brainPC",
+       "brain->venous":"brainPC",
        "hair->venous":"hairPC",
        "redBloodCells->plasma":"rbcPC"}
 }

+ 2 - 33
models/humanHG_parameters1.json

@@ -43,9 +43,7 @@
         "kidneyVolume":{"derived":"kidneyVolume"},
         "richlyPerfusedVolume":{"derived":"richlyPerfusedVolume"},
         "fatVolume":{"derived":"fatVolume"},
-        "hairVolume":{"function":"hairGrowth"},
-        "hairGrowthDuration":{"derived":"hairGrowthDuration"},
-        "hairVolumeMax":{"derived":"hairVolumeMax"},
+        "hairVolume":{"value":1},
         "slowlyPerfusedVolume":{"derived":"slowlyPerfusedVolume"},
         "brainBloodVolume":{"derived":"brainBloodVolume"},
         "brainVolume":{"derived":"brainVolume"},
@@ -88,20 +86,7 @@
         "kRScaled":{"value":8.33e-5,"unit":"l/min","dist":"lognormal","cv":0.3},
         "kUScaled":{"value":0,"unit":"l/min"},
         "zero":{"value":0},
-        "threeQuarters":{"value":0.75},
-        "heavisideTransition":{"value":100},
-        "hairGrowthStart":{"value":0e6,"unit":"min"},
-        "hairGrowthStop":{"derived":"hairGrowthStop"},
-        "hairGrowth":{"derived":"hairGrowth"}},
-    "functions":{
-       "commentHairGrowth":"2yr hair growth to a total mass of 140g",
-       "hairGrowth":{
-           "type":"linearGrowth",
-           "t1":"hairGrowthStart",
-           "W1":"heavisideTransition",
-           "t2":"hairGrowthStop",
-           "W2":"heavisideTransition",
-           "C":"hairVolumeMax"}},
+        "threeQuarters":{"value":0.75}},
     "derivedParameters":{
        "bwPower0p75":{
           "type":"power",
@@ -191,22 +176,6 @@
            "type":"product",
            "a":"intestineVolumeFraction",
            "b":"bodyWeight"},
-       "hairVolumeMax":{
-           "type":"product",
-           "a":"hairVolumeFraction",
-           "b":"bodyWeight"},
-       "hairGrowthStop":{
-           "type":"sum",
-           "a":"hairGrowthStart",
-           "b":"hairGrowthDuration"},
-       "hairGrowthDuration":{
-            "type":"ratio",
-            "a":"hairVolumeMax",
-            "b":"hairGrowth"},
-       "hairGrowth":{
-            "type":"ratio",
-            "a":"kH",
-            "b":"hairPC"},
        "hairPC":{
           "type":"ratio",
           "a":"hairPCBlood",

+ 234 - 60
models/humanHG_parameters2.json

@@ -1,80 +1,254 @@
 {"parameters":{
-        "bodyWeight":{"value":70,"units":"kg"},
-        "bodyWeight0p75":{"derived":"bwPower0p75"},
-        "kidneyPC":{"value":4.0},
-        "richlyPerfusedPC":{"value":1},
-        "fatPC":{"value":0.15},
-        "slowlyPerfusedPC":{"value":2},
-        "brainBloodPC":{"value":1},
-        "brainPC":{"value":3},
-        "hairPC":{"value":248.7},
-        "placentaPC":{"value":2},
-	     "liverPC":{"value":5},
-        "gutPC":{"value":1},
-        "rbcPC":{"value":12},
-        "flowNotes":"assuming 70kg individual, fetus at 0.1kg",
-        "plasmaFlow":{"value":8.067,"unit":"l/min"},
-        "plasmaFlowScaled":{"value":0.333,"unit":"l/min"},
-        "kidneyFlow":{"value":1.412,"unit":"l/min"},
-        "richlyPerfusedFlow":{"value":1.484,"unit":"l/min"},
-        "fatFlow":{"value":0.419,"unit":"l/min"},
-        "slowlyPerfusedFlow":{"value":2.01,"unit":"l/min"},
-        "brainBloodFlow":{"value":0.920,"unit":"l/min"},
-        "placentaFlow":{"value":0.173,"unit":"l/min"},
-        "liverInFlow":{"value":0.391,"unit":"l/min"},
-        "liverOutFlow":{"value":1.928,"unit":"l/min"},
-        "gutFlow":{"value":1.538,"unit":"l/min"},
-        "plasmaVolume":{"value":1.64,"unit":"kg"},
-        "redBloodCellsVolume":{"value":1.64,"unit":"kg"},
-        "kidneyVolume":{"value":0.28,"unit":"kg"},
-        "richlyPerfusedVolume":{"value":7,"unit":"kg"},
-        "fatVolume":{"value":19.11,"unit":"kg"},
+        "bodyWeight":{"value":67.77,"units":"kg","dist":"lognormal","cv":0.26},
+        "bwPower0p75":{"derived":"bwPower0p75"},
+        "commentPC":"X",
+        "brainBloodPC":{"value":1,"dist":"lognormal","cv":0.3},
+        "brainPC":{"value":3,"dist":"lognormal","cv":0.3},
+        "fatPC":{"value":0.15,"dist":"lognormal","cv":0.3},
+        "gutPC":{"value":1,"dist":"lognormal","cv":0.7},
+        "hairPC":{"derived":"hairPC"},
+        "hairPCBlood":{"value":248.7,"dist":"lognormal","cv":0.7},
+        "kidneyPC":{"value":4.0,"dist":"lognormal","cv":0.3},
+        "liverPC":{"value":5.0,"dist":"lognormal","cv":0.3},
+        "rbcPC":{"value":12.0,"dist":"lognormal","cv":0.3},
+        "richlyPerfusedPC":{"value":1.0,"dist":"lognormal","cv":0.3},
+        "slowlyPerfusedPC":{"value":2.0,"dist":"lognormal","cv":0.3},
+        "commentCardiacOutput":"X",
+        "cardiacOutput":{"derived":"cardiacOutput"},
+        "cardiacOutputScaled":{"value":0.333,"unit":"l/min","dist":"normal","cv":0.22},
+        "commentFlows":"X",
+        "plasmaFlow":{"derived":"plasmaFlow"},
+        "kidneyFlow":{"derived":"kidneyFlow"},
+        "richlyPerfusedFlow":{"derived":"richlyPerfusedFlow"},
+        "fatFlow":{"derived":"fatFlow"},
+        "slowlyPerfusedFlow":{"derived":"slowlyPerfusedFlow"},
+        "brainBloodFlow":{"derived":"brainBloodFlow"},
+        "liverInFlow":{"derived":"liverInFlow"},
+        "liverOutFlow":{"derived":"liverOutFlow"},
+        "gutFlow":{"derived":"gutFlow"},
+        "commentFlowFraction":"X",
+        "plasmaFlowFraction":{"value":1},
+        "kidneyFlowFraction":{"value":0.175,"dist":"normal","cv":0.3},
+        "richlyPerfusedFlowFraction":{"value":0.183,"dist":"normal","cv":0.3},
+        "fatFlowFraction":{"value":0.052,"dist":"normal","cv":0.3},
+        "slowlyPerfusedFlowFraction":{"value":0.249,"dist":"normal","cv":0.3},
+        "brainBloodFlowFraction":{"value":0.114,"dist":"normal","cv":0.3},
+        "liverInFlowFraction":{"value":0.046,"dist":"normal","cv":0.32},
+        "commentLiverOutFlow":"sum of liver in and gut",
+        "liverOutFlowFraction":{"value":0.227,"dist":"normal","cv":0.3},
+        "gutFlowFraction":{"value":0.181,"dist":"normal","cv":0.33},
+        "commentVolumes":"X",
+        "plasmaVolume":{"derived":"plasmaVolume"},
+        "redBloodCellsVolume":{"derived":"redBloodCellsVolume"},
+        "kidneyVolume":{"derived":"kidneyVolume"},
+        "richlyPerfusedVolume":{"derived":"richlyPerfusedVolume"},
+        "fatVolume":{"derived":"fatVolume"},
         "hairVolume":{"function":"hairGrowth"},
-        "hairGrowth":{"value":5e-8,"unit":"kg/min"},
-        "hairGrowthDuration":{"value":3e6,"dist":"lognormal","cv":0.5},
-        "slowlyPerfusedVolume":{"value":24.5,"unit":"kg"},
-        "brainBloodVolume":{"value":0.49,"unit":"kg"},
-        "brainVolume":{"value":1.4,"unit":"kg"},
-        "placentaVolume":{"value":0.0431,"unit":"kg"},
-        "liverVolume":{"value":1.82,"unit":"kg"},
-        "gutVolume":{"value":1.19,"unit":"kg"},
-        "intestineVolume":{"value":0.98,"unit":"kg"},
-        "kRBC":{"value":0.60,"unit":"l/min"},
-        "kU":{"value":0,"unit":"l/min"},
-        "commentkH":"assume pc-times larger input flow, 2.823e-6*248.7",
-        "kH":{"value":2.823e-6,"unit":"l/min"},
-        "kBR":{"value":4.033e-3,"unit":"l/min"},
-        "kI":{"value":4.033e-6,"unit":"l/min"},
-        "kB":{"value":4.033e-5,"unit":"l/min"},
-        "kD":{"value":4.033e-5,"unit":"l/min"},
-        "kF":{"value":8.066e-5,"unit":"l/min"},
-        "kF1":{"value":0,"unit":"l/min"},
-        "kR":{"value":2.016e-3,"unit":"l/min"},
+        "hairGrowthDuration":{"derived":"hairGrowthDuration"},
+        "hairVolumeMax":{"derived":"hairVolumeMax"},
+        "slowlyPerfusedVolume":{"derived":"slowlyPerfusedVolume"},
+        "brainBloodVolume":{"derived":"brainBloodVolume"},
+        "brainVolume":{"derived":"brainVolume"},
+        "liverVolume":{"derived":"liverVolume"},
+        "gutVolume":{"derived":"gutVolume"},
+        "intestineVolume":{"derived":"intestineVolume"},
+        "commentFractions":"X",
+        "plasmaVolumeFraction":{"value":0.024,"dist":"normal","cv":0.14},
+        "redBloodCellsVolumeFraction":{"value":0.024,"dist":"normal","cv":0.25},
+        "kidneyVolumeFraction":{"value":0.004,"dist":"normal","cv":0.3},
+        "richlyPerfusedVolumeFraction":{"value":0.1,"dist":"normal","cv":0.3},
+        "fatVolumeFraction":{"value":0.273,"dist":"normal","cv":0.24},
+        "hairVolumeFraction":{"value":0.002,"dist":"normal","cv":0.5},
+        "slowlyPerfusedVolumeFraction":{"value":0.35,"dist":"normal","cv":0.16},
+        "brainBloodVolumeFraction":{"value":0.007,"dist":"normal","cv":0.3},
+        "brainVolumeFraction":{"value":0.02,"dist":"normal","cv":0.3},
+        "liverVolumeFraction":{"value":0.026,"dist":"normal","cv":0.25},
+        "gutVolumeFraction":{"value":0.017,"dist":"normal","cv":0.15},
+        "intestineVolumeFraction":{"value":0.14,"dist":"normal","cv":0.3},
+        "commentDiff":"X",
+        "kB":{"derived":"kB"},
+        "kBR":{"derived":"kBR"},
+        "kD":{"derived":"kD"},
+        "kF":{"derived":"kF"},
+        "kH":{"derived":"kH"},
+        "kI":{"derived":"kI"},
+        "kIF":{"derived":"kIF"},
+        "kRBC":{"derived":"kRBC"},
+        "kR":{"derived":"kR"},
+        "kU":{"derived":"kU"},
+        "commentDiffScaled":"X",
+        "kBScaled":{"value":1.67e-6,"unit":"l/min","dist":"lognormal","cv":0.3},
+        "kBRScaled":{"value":1.67e-4,"unit":"l/min","dist":"lognormal","cv":0.3},
+        "kDScaled":{"value":1.67e-6,"unit":"l/min","dist":"lognormal","cv":0.3},
+        "kFScaled":{"value":3.33e-6,"unit":"l/min","dist":"lognormal","cv":0.36},
+        "kHScaled":{"value":1.17e-7,"unit":"l/min","dist":"lognormal","cv":0.25},
+        "kIScaled":{"value":1.67e-5,"unit":"l/min","dist":"lognormal","cv":0.3},
+        "kIFScaled":{"value":0,"unit":"l/min","noDist":"lognormal","cv":0.3},
+        "kRBCScaled":{"value":2.5e-2,"unit":"l/min","dist":"lognormal","cv":0.3},
+        "kRScaled":{"value":8.33e-5,"unit":"l/min","dist":"lognormal","cv":0.3},
+        "kUScaled":{"value":0,"unit":"l/min"},
         "zero":{"value":0},
         "threeQuarters":{"value":0.75},
         "heavisideTransition":{"value":100},
         "hairGrowthStart":{"value":0e6,"unit":"min"},
-        "hairGrowthStop":{"derived":"hairGrowthStop"}},
+        "hairGrowthStop":{"derived":"hairGrowthStop"},
+        "hairGrowth":{"derived":"hairGrowth"}},
     "functions":{
        "commentHairGrowth":"2yr hair growth to a total mass of 140g",
        "hairGrowth":{
-           "type":"linearGrowthFixedSlope",
+           "type":"linearGrowth",
            "t1":"hairGrowthStart",
            "W1":"heavisideTransition",
            "t2":"hairGrowthStop",
            "W2":"heavisideTransition",
-           "alpha":"hairGrowth"}},
+           "C":"hairVolumeMax"}},
     "derivedParameters":{
-        "hairGrowthStop":{
-           "type":"sum",
-           "a":"hairGrowthStart",
-           "b":"hairGrowthDuration"},
        "bwPower0p75":{
           "type":"power",
           "a":"bodyWeight",
           "n":"threeQuarters"},
-       "plasmaFlow":{
+       "cardiacOutput":{
+          "type":"product",
+          "a":"cardiacOutputScaled",
+          "b":"bwPower0p75"},
+        "plasmaFlow":{
+           "type":"product",
+           "a":"cardiacOutput",
+           "b":"plasmaFlowFraction"},
+        "kidneyFlow":{
+           "type":"product",
+           "a":"cardiacOutput",
+           "b":"kidneyFlowFraction"},
+        "richlyPerfusedFlow":{
+           "type":"product",
+           "a":"cardiacOutput",
+           "b":"richlyPerfusedFlowFraction"},
+        "fatFlow":{
+           "type":"product",
+           "a":"cardiacOutput",
+           "b":"fatFlowFraction"},
+        "slowlyPerfusedFlow":{
+           "type":"product",
+           "a":"cardiacOutput",
+           "b":"slowlyPerfusedFlowFraction"},
+        "brainBloodFlow":{
+           "type":"product",
+           "a":"cardiacOutput",
+           "b":"brainBloodFlowFraction"},
+        "liverInFlow":{
+           "type":"product",
+           "a":"cardiacOutput",
+           "b":"liverInFlowFraction"},
+        "liverOutFlow":{
+           "type":"product",
+           "a":"cardiacOutput",
+           "b":"liverOutFlowFraction"},
+        "gutFlow":{
+           "type":"product",
+           "a":"cardiacOutput",
+           "b":"gutFlowFraction"},
+        "plasmaVolume":{
+           "type":"product",
+           "a":"plasmaVolumeFraction",
+           "b":"bodyWeight"},
+        "redBloodCellsVolume":{
+           "type":"product",
+           "a":"redBloodCellsVolumeFraction",
+           "b":"bodyWeight"},
+        "kidneyVolume":{
+           "type":"product",
+           "a":"kidneyVolumeFraction",
+           "b":"bodyWeight"},
+        "richlyPerfusedVolume":{
+           "type":"product",
+           "a":"richlyPerfusedVolumeFraction",
+           "b":"bodyWeight"},
+        "fatVolume":{
+           "type":"product",
+           "a":"fatVolumeFraction",
+           "b":"bodyWeight"},
+        "slowlyPerfusedVolume":{
+           "type":"product",
+           "a":"slowlyPerfusedVolumeFraction",
+           "b":"bodyWeight"},
+        "brainBloodVolume":{
+           "type":"product",
+           "a":"brainBloodVolumeFraction",
+           "b":"bodyWeight"},
+        "brainVolume":{
+           "type":"product",
+           "a":"brainVolumeFraction",
+           "b":"bodyWeight"},
+        "liverVolume":{
+           "type":"product",
+           "a":"liverVolumeFraction",
+           "b":"bodyWeight"},
+        "gutVolume":{
+           "type":"product",
+           "a":"gutVolumeFraction",
+           "b":"bodyWeight"},
+        "intestineVolume":{
+           "type":"product",
+           "a":"intestineVolumeFraction",
+           "b":"bodyWeight"},
+       "hairVolumeMax":{
+           "type":"product",
+           "a":"hairVolumeFraction",
+           "b":"bodyWeight"},
+       "hairGrowthStop":{
+           "type":"sum",
+           "a":"hairGrowthStart",
+           "b":"hairGrowthDuration"},
+       "hairGrowthDuration":{
+            "type":"ratio",
+            "a":"hairVolumeMax",
+            "b":"hairGrowth"},
+       "hairGrowth":{
+            "type":"ratio",
+            "a":"kH",
+            "b":"hairPC"},
+       "hairPC":{
+          "type":"ratio",
+          "a":"hairPCBlood",
+          "b":"slowlyPerfusedPC"},
+       "kB":{
+          "type":"product",
+          "a":"kBScaled",
+          "b":"bwPower0p75"},
+       "kBR":{
+          "type":"product",
+          "a":"kBRScaled",
+          "b":"bwPower0p75"},
+       "kD":{
+          "type":"product",
+          "a":"kDScaled",
+          "b":"bwPower0p75"},
+       "kF":{
+          "type":"product",
+          "a":"kFScaled",
+          "b":"bwPower0p75"},
+       "kH":{
+          "type":"product",
+          "a":"kHScaled",
+          "b":"bwPower0p75"},
+       "kI":{
+          "type":"product",
+          "a":"kIScaled",
+          "b":"bwPower0p75"},
+       "kIF":{
+          "type":"product",
+          "a":"kIFScaled",
+          "b":"bwPower0p75"},
+       "kRBC":{
+          "type":"product",
+          "a":"kRBCScaled",
+          "b":"bwPower0p75"},
+       "kR":{
+          "type":"product",
+          "a":"kRScaled",
+          "b":"bwPower0p75"},
+       "kU":{
           "type":"product",
-          "a":"plasmaFlowScaled",
-          "b":"bodyWeight0p75"}}
+          "a":"kUScaled",
+          "b":"bwPower0p75"}}
 }

+ 0 - 179
models/humanHG_parameters3.json

@@ -1,179 +0,0 @@
-{"parameters":{
-        "bodyWeight":{"value":70,"units":"kg"},
-        "bodyWeight0p75":{"derived":"bwPower0p75"},
-        "kidneyPC":{"value":4.0},
-        "richlyPerfusedPC":{"value":1},
-        "fatPC":{"value":0.15},
-        "slowlyPerfusedPC":{"value":2},
-        "brainBloodPC":{"value":1},
-        "brainPC":{"value":3},
-        "hairPCBlood":{"value":248.7,"dist":"lognormal","cv":0.7},
-        "hairPC":{"derived":"hairPC"},
-        "placentaPC":{"value":2},
-	     "liverPC":{"value":5},
-        "gutPC":{"value":1},
-        "rbcPC":{"value":12},
-        "flowNotes":"assuming 70kg individual, fetus at 0.1kg",
-        "plasmaFlow":{"value":8.067,"unit":"l/min"},
-        "plasmaFlowScaled":{"value":0.333,"unit":"l/min"},
-        "kidneyFlow":{"value":1.412,"unit":"l/min"},
-        "richlyPerfusedFlow":{"value":1.484,"unit":"l/min"},
-        "fatFlow":{"value":0.419,"unit":"l/min"},
-        "slowlyPerfusedFlow":{"value":2.01,"unit":"l/min"},
-        "brainBloodFlow":{"value":0.920,"unit":"l/min"},
-        "placentaFlow":{"value":0.173,"unit":"l/min"},
-        "liverInFlow":{"value":0.391,"unit":"l/min"},
-        "liverOutFlow":{"value":1.928,"unit":"l/min"},
-        "gutFlow":{"value":1.538,"unit":"l/min"},
-        "commentVolumes":"X",
-        "plasmaVolume":{"derived":"plasmaVolume"},
-        "redBloodCellsVolume":{"derived":"redBloodCellsVolume"},
-        "kidneyVolume":{"derived":"kidneyVolume"},
-        "richlyPerfusedVolume":{"derived":"richlyPerfusedVolume"},
-        "fatVolume":{"derived":"fatVolume"},
-        "hairVolume":{"function":"hairGrowth"},
-        "hairGrowthDuration":{"derived":"hairGrowthDuration"},
-        "hairVolumeMax":{"derived":"hairVolumeMax"},
-        "slowlyPerfusedVolume":{"derived":"slowlyPerfusedVolume"},
-        "brainBloodVolume":{"derived":"brainBloodVolume"},
-        "brainVolume":{"derived":"brainVolume"},
-        "liverVolume":{"derived":"liverVolume"},
-        "gutVolume":{"derived":"gutVolume"},
-        "intestineVolume":{"derived":"intestineVolume"},
-        "placentaVolume":{"derived":"placentaVolume"},
-        "fetusWeight":{"function":"fetusWeight"},
-        "fetusWeightMax":{"value":4.0,"unit":"kg","dist":"normal","cv":0.1},
-        "commentFractions":"X",
-        "plasmaVolumeFraction":{"value":0.024,"dist":"normal","cv":0.14},
-        "redBloodCellsVolumeFraction":{"value":0.024,"dist":"normal","cv":0.25},
-        "kidneyVolumeFraction":{"value":0.004,"dist":"normal","cv":0.3},
-        "richlyPerfusedVolumeFraction":{"value":0.1,"dist":"normal","cv":0.3},
-        "fatVolumeFraction":{"value":0.273,"dist":"normal","cv":0.24},
-        "hairVolumeFraction":{"value":0.002,"dist":"normal","cv":0.5},
-        "slowlyPerfusedVolumeFraction":{"value":0.35,"dist":"normal","cv":0.16},
-        "brainBloodVolumeFraction":{"value":0.007,"dist":"normal","cv":0.3},
-        "brainVolumeFraction":{"value":0.02,"dist":"normal","cv":0.3},
-        "liverVolumeFraction":{"value":0.026,"dist":"normal","cv":0.25},
-        "placentaVolumeFraction":{"value":0.18,"dist":"normal","cv":0.13},
-        "placentaVolumeFractionSurce":"https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3530253",
-        "gutVolumeFraction":{"value":0.017,"dist":"normal","cv":0.15},
-        "intestineVolumeFraction":{"value":0.14,"dist":"normal","cv":0.3},
-        "commentDiff":"X",
-        "kRBC":{"value":0.60,"unit":"l/min"},
-        "kU":{"value":0,"unit":"l/min"},
-        "commentkH":"assume pc-times larger input flow, 2.823e-6*248.7",
-        "kH":{"value":2.823e-6,"unit":"l/min"},
-        "kBR":{"value":4.033e-3,"unit":"l/min"},
-        "kI":{"value":4.033e-6,"unit":"l/min"},
-        "kB":{"value":4.033e-5,"unit":"l/min"},
-        "kD":{"value":4.033e-5,"unit":"l/min"},
-        "kF":{"value":8.066e-5,"unit":"l/min"},
-        "kF1":{"value":0,"unit":"l/min"},
-        "kR":{"value":2.016e-3,"unit":"l/min"},
-        "zero":{"value":0},
-        "threeQuarters":{"value":0.75},
-        "heavisideTransition":{"value":100},
-        "hairGrowthStart":{"value":0e6,"unit":"min"},
-        "hairGrowthStop":{"derived":"hairGrowthStop"},
-        "hairGrowth":{"derived":"hairGrowth"},
-        "fetusGrowthStart":{"value":8.6e5,"unit":"min"},
-        "fetusGrowthDuration":{"value":4e5,"unit":"min"},
-        "fetusGrowthStop":{"derived":"fetusGrowthStop"}},
-    "functions":{
-       "commentHairGrowth":"2yr hair growth to a total mass of 140g",
-       "hairGrowth":{
-           "type":"linearGrowth",
-           "t1":"hairGrowthStart",
-           "W1":"heavisideTransition",
-           "t2":"hairGrowthStop",
-           "W2":"heavisideTransition",
-           "C":"hairVolumeMax"},
-       "fetusWeight":{
-           "type":"linearGrowth",
-           "t1":"fetusGrowthStart",
-           "t2":"fetusGrowthStop",
-           "W1":"heavisideTransition",
-           "W2":"heavisideTransition",
-           "C":"fetusWeightMax"}},
-    "derivedParameters":{
-        "plasmaVolume":{
-           "type":"product",
-           "a":"plasmaVolumeFraction",
-           "b":"bodyWeight"},
-        "redBloodCellsVolume":{
-           "type":"product",
-           "a":"redBloodCellsVolumeFraction",
-           "b":"bodyWeight"},
-        "kidneyVolume":{
-           "type":"product",
-           "a":"kidneyVolumeFraction",
-           "b":"bodyWeight"},
-        "richlyPerfusedVolume":{
-           "type":"product",
-           "a":"richlyPerfusedVolumeFraction",
-           "b":"bodyWeight"},
-        "fatVolume":{
-           "type":"product",
-           "a":"fatVolumeFraction",
-           "b":"bodyWeight"},
-        "slowlyPerfusedVolume":{
-           "type":"product",
-           "a":"slowlyPerfusedVolumeFraction",
-           "b":"bodyWeight"},
-        "brainBloodVolume":{
-           "type":"product",
-           "a":"brainBloodVolumeFraction",
-           "b":"bodyWeight"},
-        "brainVolume":{
-           "type":"product",
-           "a":"brainVolumeFraction",
-           "b":"bodyWeight"},
-        "liverVolume":{
-           "type":"product",
-           "a":"liverVolumeFraction",
-           "b":"bodyWeight"},
-        "gutVolume":{
-           "type":"product",
-           "a":"gutVolumeFraction",
-           "b":"bodyWeight"},
-        "intestineVolume":{
-           "type":"product",
-           "a":"intestineVolumeFraction",
-           "b":"bodyWeight"},
-        "placentaVolume":{
-           "type":"product",
-           "a":"placentaVolumeFraction",
-           "b":"fetusWeight"},
-       "hairVolumeMax":{
-           "type":"product",
-           "a":"hairVolumeFraction",
-           "b":"bodyWeight"},
-        "hairGrowthStop":{
-           "type":"sum",
-           "a":"hairGrowthStart",
-           "b":"hairGrowthDuration"},
-        "hairGrowthDuration":{
-            "type":"ratio",
-            "a":"hairVolumeMax",
-            "b":"hairGrowth"},
-        "hairGrowth":{
-            "type":"ratio",
-            "a":"kH",
-            "b":"hairPC"},
-       "fetusGrowthStop":{
-            "type":"sum",
-            "a":"fetusGrowthStart",
-            "b":"fetusGrowthDuration"},
-       "bwPower0p75":{
-          "type":"power",
-          "a":"bodyWeight",
-          "n":"threeQuarters"},
-       "plasmaFlow":{
-          "type":"product",
-          "a":"plasmaFlowScaled",
-          "b":"bodyWeight0p75"},
-       "hairPC":{
-          "type":"ratio",
-          "a":"hairPCBlood",
-          "b":"slowlyPerfusedPC"}}
-}

+ 72 - 0
models/humanHG_withHairPC.json

@@ -0,0 +1,72 @@
+{
+   "timeUnit":"min",
+   "compartments":[
+      "redBloodCells","plasma","venous","kidney","urine",
+      "richlyPerfused","fat","slowlyPerfused","hair",
+      "brainBlood","brain",
+      "liver","gut","intestine","feces","inorganicMercury"],
+   "commentParameters":"every parameter must have a value, name is optional and used in SE computation",
+   "volumeComment":"in a compartment w/o volume, value is mass",
+   "volumes":{
+      "plasma":"plasmaVolume",
+      "venous":"plasmaVolume",
+      "kidney":"kidneyVolume",
+      "richlyPerfused":"richlyPerfusedVolume",
+      "fat":"fatVolume",
+      "slowlyPerfused":"slowlyPerfusedVolume",
+      "brainBlood":"brainBloodVolume",
+      "gut":"gutVolume",
+      "intestine":"intestineVolume",
+      "redBloodCells":"redBloodCellsVolume",
+      "hair":"hairVolume",
+      "brain":"brainVolume",
+      "liver":"liverVolume"
+      },
+   "flows":{
+      "(plasma,venous):kidney":"kidneyFlow",
+      "(plasma,venous):richlyPerfused":"richlyPerfusedFlow",
+      "(plasma,venous):fat":"fatFlow",
+      "(plasma,venous):slowlyPerfused":"slowlyPerfusedFlow",
+      "(plasma,venous):brainBlood":"brainBloodFlow",
+      "plasma:liver":"liverInFlow",
+      "liver:venous":"liverOutFlow",
+      "(plasma,liver):gut":"gutFlow",
+      "plasma:venous":"plasmaFlow"},
+   "commentSources":"constants in concentration units per s",
+   "commentHeavyside":"value is mass of exogene/volume of container/duration",
+   "sources":{
+      "intestine":{"name":"constant","value":0.0486,"unit":"ug/min"}},
+   "commentBindings":"split to flow and diffusion dominated",
+   "bindings": {
+      "flowComments":"group common sources or targets with brackets",
+      "flow":[
+         "(kidney,richlyPerfused,fat,slowlyPerfused,brainBlood,liver)->venous",
+         "gut->liver",
+         "plasma->(kidney,richlyPerfused,fat,slowlyPerfused,brainBlood,liver,gut)",
+         "venous->plasma"],
+      "diffusion":{
+         "plasma->redBloodCells":"kRBC",
+         "redBloodCells->plasma":"kRBC",
+         "kidney->urine":"kU",
+         "slowlyPerfused->hair":"kH",
+         "hair->venous":"kH",
+         "brainBlood->brain":"kBR",
+         "liver->intestine":"kB",
+         "liver->inorganicMercury":"kI",
+         "intestine->gut":"kR",
+         "intestine->inorganicMercury":"kD",
+         "intestine->feces":"kF",
+         "inorganicMercury->feces":"kIF"}},
+    "pcComments":"always related to outflow of organs", 
+    "partitionCoefficients":{
+       "kidney":"kidneyPC",
+       "richlyPerfused":"richlyPerfusedPC",
+       "fat":"fatPC",
+       "slowlyPerfused":"slowlyPerfusedPC",
+       "brainBlood":"brainBloodPC",
+       "liver":"liverPC",
+       "gut":"gutPC",
+       "brainBlood->brain":"brainPC",
+       "hair->venous":"hairPC",
+       "redBloodCells->plasma":"rbcPC"}
+}

+ 86 - 0
models/humanHGplusI.json

@@ -0,0 +1,86 @@
+{
+   "timeUnit":"min",
+   "compartments":[
+      "redBloodCells","plasma","venous","kidney","urine",
+      "richlyPerfused","fat","slowlyPerfused","hair",
+      "brainBlood","brain",
+      "liver","gut","intestine","feces",
+      "plasmaI","liverI","kidneyI","hairI","brainI"],
+   "commentParameters":"every parameter must have a value, name is optional and used in SE computation",
+   "volumeComment":"in a compartment w/o volume, value is mass",
+   "volumes":{
+      "plasma":"plasmaVolume",
+      "venous":"plasmaVolume",
+      "kidney":"kidneyVolume",
+      "richlyPerfused":"richlyPerfusedVolume",
+      "fat":"fatVolume",
+      "slowlyPerfused":"slowlyPerfusedVolume",
+      "brainBlood":"brainBloodVolume",
+      "gut":"gutVolume",
+      "intestine":"intestineVolume",
+      "redBloodCells":"redBloodCellsVolume",
+      "hair":"hairVolume",
+      "brain":"brainVolume",
+      "liver":"liverVolume",
+      "plasmaI":"plasmaVolume",
+      "liverI":"liverVolume",
+      "kidneyI":"kidneyVolume",
+      "hairI":"hairVolume",
+      "brainI":"brainVolume"
+      },
+   "flows":{
+      "(plasma,venous):kidney":"kidneyFlow",
+      "(plasma,venous):richlyPerfused":"richlyPerfusedFlow",
+      "(plasma,venous):fat":"fatFlow",
+      "(plasma,venous):slowlyPerfused":"slowlyPerfusedFlow",
+      "(plasma,venous):brainBlood":"brainBloodFlow",
+      "plasma:liver":"liverInFlow",
+      "liver:venous":"liverOutFlow",
+      "(plasma,liver):gut":"gutFlow",
+      "plasma:venous":"plasmaFlow"},
+   "commentSources":"constants in concentration units per s",
+   "commentHeavyside":"value is mass of exogene/volume of container/duration",
+   "sources":{
+      "intestine":{"name":"constant","value":0.0486,"unit":"ug/min"}},
+   "commentBindings":"split to flow and diffusion dominated",
+   "bindings": {
+      "flowComments":"group common sources or targets with brackets",
+      "flow":[
+         "(kidney,richlyPerfused,fat,slowlyPerfused,brainBlood,liver)->venous",
+         "gut->liver",
+         "plasma->(kidney,richlyPerfused,fat,slowlyPerfused,brainBlood,liver,gut)",
+         "venous->plasma"],
+      "diffusion":{
+         "plasma->redBloodCells":"kRBC",
+         "redBloodCells->plasma":"kRBC",
+         "kidney->urine":"kU",
+         "slowlyPerfused->hair":"kH",
+         "brainBlood->brain":"kBR",
+         "brain->venous":"kBR",
+         "liver->intestine":"kB",
+         "intestine->gut":"kR",
+         "plasma->liverI":"dBL",
+         "liverI->plasmaI":"kLB:I",
+         "liverI->feces":"kLF:I",
+         "plasmaI->kidneyI":"kBK:I",
+         "kidneyI->plasmaI":"kKB:I",
+         "kidneyI->urine":"kKU:I",
+         "plasmaI->hairI":"kBH:I",
+         "brainI->plasmaI":"kBrB:I",
+         "plasmaI->urine":"kBU:I",
+         "plasmaI->brainI":"kBBr:I",
+         "plasmaI->feces":"kBF:I",
+         "plasma->brainI":"dBBr"}},
+    "pcComments":"always related to outflow of organs", 
+    "partitionCoefficients":{
+       "kidney":"kidneyPC",
+       "richlyPerfused":"richlyPerfusedPC",
+       "fat":"fatPC",
+       "slowlyPerfused":"slowlyPerfusedPC",
+       "brainBlood":"brainBloodPC",
+       "liver":"liverPC",
+       "gut":"gutPC",
+       "brain->venous":"brainPC",
+       "hair->venous":"hairPC",
+       "redBloodCells->plasma":"rbcPC"}
+}

+ 298 - 0
models/humanHGplusI_parameters.json

@@ -0,0 +1,298 @@
+{"parameters":{
+        "bodyWeight":{"value":67.77,"units":"kg","dist":"lognormal","cv":0.26},
+        "bwPower0p75":{"derived":"bwPower0p75"},
+        "commentPC":"X",
+        "brainBloodPC":{"value":1,"dist":"lognormal","cv":0.3},
+        "brainPC":{"value":3,"dist":"lognormal","cv":0.3},
+        "fatPC":{"value":0.15,"dist":"lognormal","cv":0.3},
+        "gutPC":{"value":1,"dist":"lognormal","cv":0.7},
+        "hairPC":{"derived":"hairPC"},
+        "hairPCBlood":{"value":248.7,"dist":"lognormal","cv":0.7},
+        "kidneyPC":{"value":4.0,"dist":"lognormal","cv":0.3},
+        "liverPC":{"value":5.0,"dist":"lognormal","cv":0.3},
+        "rbcPC":{"value":12.0,"dist":"lognormal","cv":0.3},
+        "richlyPerfusedPC":{"value":1.0,"dist":"lognormal","cv":0.3},
+        "slowlyPerfusedPC":{"value":2.0,"dist":"lognormal","cv":0.3},
+        "commentCardiacOutput":"X",
+        "cardiacOutput":{"derived":"cardiacOutput"},
+        "cardiacOutputScaled":{"value":0.333,"unit":"l/min","dist":"normal","cv":0.22},
+        "commentFlows":"X",
+        "plasmaFlow":{"derived":"plasmaFlow"},
+        "kidneyFlow":{"derived":"kidneyFlow"},
+        "richlyPerfusedFlow":{"derived":"richlyPerfusedFlow"},
+        "fatFlow":{"derived":"fatFlow"},
+        "slowlyPerfusedFlow":{"derived":"slowlyPerfusedFlow"},
+        "brainBloodFlow":{"derived":"brainBloodFlow"},
+        "liverInFlow":{"derived":"liverInFlow"},
+        "liverOutFlow":{"derived":"liverOutFlow"},
+        "gutFlow":{"derived":"gutFlow"},
+        "commentFlowFraction":"X",
+        "plasmaFlowFraction":{"value":1},
+        "kidneyFlowFraction":{"value":0.175,"dist":"normal","cv":0.3},
+        "richlyPerfusedFlowFraction":{"value":0.183,"dist":"normal","cv":0.3},
+        "fatFlowFraction":{"value":0.052,"dist":"normal","cv":0.3},
+        "slowlyPerfusedFlowFraction":{"value":0.249,"dist":"normal","cv":0.3},
+        "brainBloodFlowFraction":{"value":0.114,"dist":"normal","cv":0.3},
+        "liverInFlowFraction":{"value":0.046,"dist":"normal","cv":0.32},
+        "commentLiverOutFlow":"sum of liver in and gut",
+        "liverOutFlowFraction":{"value":0.227,"dist":"normal","cv":0.3},
+        "gutFlowFraction":{"value":0.181,"dist":"normal","cv":0.33},
+        "commentVolumes":"X",
+        "plasmaVolume":{"derived":"plasmaVolume"},
+        "redBloodCellsVolume":{"derived":"redBloodCellsVolume"},
+        "kidneyVolume":{"derived":"kidneyVolume"},
+        "richlyPerfusedVolume":{"derived":"richlyPerfusedVolume"},
+        "fatVolume":{"derived":"fatVolume"},
+        "hairVolume":{"value":1},
+        "fecesVolume":{"value":1},
+        "slowlyPerfusedVolume":{"derived":"slowlyPerfusedVolume"},
+        "brainBloodVolume":{"derived":"brainBloodVolume"},
+        "brainVolume":{"derived":"brainVolume"},
+        "liverVolume":{"derived":"liverVolume"},
+        "gutVolume":{"derived":"gutVolume"},
+        "intestineVolume":{"derived":"intestineVolume"},
+        "commentFractions":"X",
+        "plasmaVolumeFraction":{"value":0.024,"dist":"normal","cv":0.14},
+        "redBloodCellsVolumeFraction":{"value":0.024,"dist":"normal","cv":0.25},
+        "kidneyVolumeFraction":{"value":0.004,"dist":"normal","cv":0.3},
+        "richlyPerfusedVolumeFraction":{"value":0.1,"dist":"normal","cv":0.3},
+        "fatVolumeFraction":{"value":0.273,"dist":"normal","cv":0.24},
+        "hairVolumeFraction":{"value":0.002,"dist":"normal","cv":0.5},
+        "slowlyPerfusedVolumeFraction":{"value":0.35,"dist":"normal","cv":0.16},
+        "brainBloodVolumeFraction":{"value":0.007,"dist":"normal","cv":0.3},
+        "brainVolumeFraction":{"value":0.02,"dist":"normal","cv":0.3},
+        "liverVolumeFraction":{"value":0.026,"dist":"normal","cv":0.25},
+        "gutVolumeFraction":{"value":0.017,"dist":"normal","cv":0.15},
+        "intestineVolumeFraction":{"value":0.14,"dist":"normal","cv":0.3},
+        "commentDiff":"X",
+        "kB":{"derived":"kB"},
+        "kBR":{"derived":"kBR"},
+        "kD":{"derived":"kD"},
+        "kF":{"derived":"kF"},
+        "kH":{"derived":"kH"},
+        "kI":{"derived":"kI"},
+        "kIF":{"derived":"kIF"},
+        "kRBC":{"derived":"kRBC"},
+        "kR":{"derived":"kR"},
+        "kU":{"derived":"kU"},
+        "commentInorganicMercury":"X",
+        "dBL":{"derived":"dBL"},
+        "dBBr":{"derived":"dBBr"},
+        "kLB:I":{"derived":"kLB:I"},
+        "kBK:I":{"derived":"kBK:I"},
+        "kKB:I":{"derived":"kKB:I"},
+        "kKU:I":{"derived":"kKU:I"},
+        "kBH:I":{"derived":"kBH:I"},
+        "kBU:I":{"derived":"kBU:I"},
+        "kBF:I":{"derived":"kBF:I"},
+        "kLF:I":{"derived":"kLF:I"},
+        "kBBr:I":{"derived":"kBBr:I"},
+        "kBrB:I":{"derived":"kBrB:I"},
+        "commentDiffScaled":"X",
+        "kBScaled":{"value":1.67e-6,"unit":"l/min","dist":"lognormal","cv":0.3},
+        "kBRScaled":{"value":1.67e-4,"unit":"l/min","dist":"lognormal","cv":0.3},
+        "kDScaled":{"value":1.67e-6,"unit":"l/min","dist":"lognormal","cv":0.3},
+        "kFScaled":{"value":3.33e-6,"unit":"l/min","dist":"lognormal","cv":0.36},
+        "kHScaled":{"value":1.17e-7,"unit":"l/min","dist":"lognormal","cv":0.25},
+        "kIScaled":{"value":1.67e-5,"unit":"l/min","dist":"lognormal","cv":0.3},
+        "kIFScaled":{"value":0,"unit":"l/min","noDist":"lognormal","cv":0.3},
+        "kRBCScaled":{"value":2.5e-2,"unit":"l/min","dist":"lognormal","cv":0.3},
+        "kRScaled":{"value":8.33e-5,"unit":"l/min","dist":"lognormal","cv":0.3},
+        "kUScaled":{"value":0,"unit":"l/min"},
+        "commentInorganicMerucryFromPaper":"X",
+        "dBLPaper":{"value":0.175,"unit":"/day","dist":"lognormal","cv":0.3},
+        "dBBrPaper":{"value":0.0,"unit":"/day","noDist":"lognormal","cv":0.3},
+        "kLB:IPaper":{"value":0.894,"unit":"/day","dist":"lognormal","cv":0.3},
+        "kBK:IPaper":{"value":17.1234,"unit":"/day","dist":"lognormal","cv":0.3},
+        "kKB:IPaper":{"value":0.001,"unit":"/day","dist":"lognormal","cv":0.3},
+        "kKU:IPaper":{"value":0.006949,"unit":"/day","dist":"lognormal","cv":0.3},
+        "kBH:IPaper":{"value":0.14,"unit":"/day","dist":"lognormal","cv":0.3},
+        "kBU:IPaper":{"value":0.006949,"unit":"/day","dist":"lognormal","cv":0.3},
+        "kBF:IPaper":{"value":3.9917,"unit":"/day","dist":"lognormal","cv":0.3},
+        "kLF:IPaper":{"value":1.5476,"unit":"/day","dist":"lognormal","cv":0.3},
+        "kBBr:IPaper":{"value":0.0028,"unit":"/day","dist":"lognormal","cv":0.3},
+        "kBrB:IPaper":{"value":0.052,"unit":"/day","dist":"lognormal","cv":0.3},
+        "zero":{"value":0},
+        "threeQuarters":{"value":0.75}},
+    "derivedParameters":{
+       "bwPower0p75":{
+          "type":"power",
+          "a":"bodyWeight",
+          "n":"threeQuarters"},
+       "cardiacOutput":{
+          "type":"product",
+          "a":"cardiacOutputScaled",
+          "b":"bwPower0p75"},
+        "plasmaFlow":{
+           "type":"product",
+           "a":"cardiacOutput",
+           "b":"plasmaFlowFraction"},
+        "kidneyFlow":{
+           "type":"product",
+           "a":"cardiacOutput",
+           "b":"kidneyFlowFraction"},
+        "richlyPerfusedFlow":{
+           "type":"product",
+           "a":"cardiacOutput",
+           "b":"richlyPerfusedFlowFraction"},
+        "fatFlow":{
+           "type":"product",
+           "a":"cardiacOutput",
+           "b":"fatFlowFraction"},
+        "slowlyPerfusedFlow":{
+           "type":"product",
+           "a":"cardiacOutput",
+           "b":"slowlyPerfusedFlowFraction"},
+        "brainBloodFlow":{
+           "type":"product",
+           "a":"cardiacOutput",
+           "b":"brainBloodFlowFraction"},
+        "liverInFlow":{
+           "type":"product",
+           "a":"cardiacOutput",
+           "b":"liverInFlowFraction"},
+        "liverOutFlow":{
+           "type":"product",
+           "a":"cardiacOutput",
+           "b":"liverOutFlowFraction"},
+        "gutFlow":{
+           "type":"product",
+           "a":"cardiacOutput",
+           "b":"gutFlowFraction"},
+        "plasmaVolume":{
+           "type":"product",
+           "a":"plasmaVolumeFraction",
+           "b":"bodyWeight"},
+        "redBloodCellsVolume":{
+           "type":"product",
+           "a":"redBloodCellsVolumeFraction",
+           "b":"bodyWeight"},
+        "kidneyVolume":{
+           "type":"product",
+           "a":"kidneyVolumeFraction",
+           "b":"bodyWeight"},
+        "richlyPerfusedVolume":{
+           "type":"product",
+           "a":"richlyPerfusedVolumeFraction",
+           "b":"bodyWeight"},
+        "fatVolume":{
+           "type":"product",
+           "a":"fatVolumeFraction",
+           "b":"bodyWeight"},
+        "slowlyPerfusedVolume":{
+           "type":"product",
+           "a":"slowlyPerfusedVolumeFraction",
+           "b":"bodyWeight"},
+        "brainBloodVolume":{
+           "type":"product",
+           "a":"brainBloodVolumeFraction",
+           "b":"bodyWeight"},
+        "brainVolume":{
+           "type":"product",
+           "a":"brainVolumeFraction",
+           "b":"bodyWeight"},
+        "liverVolume":{
+           "type":"product",
+           "a":"liverVolumeFraction",
+           "b":"bodyWeight"},
+        "gutVolume":{
+           "type":"product",
+           "a":"gutVolumeFraction",
+           "b":"bodyWeight"},
+        "intestineVolume":{
+           "type":"product",
+           "a":"intestineVolumeFraction",
+           "b":"bodyWeight"},
+       "hairPC":{
+          "type":"ratio",
+          "a":"hairPCBlood",
+          "b":"slowlyPerfusedPC"},
+       "kB":{
+          "type":"product",
+          "a":"kBScaled",
+          "b":"bwPower0p75"},
+       "kBR":{
+          "type":"product",
+          "a":"kBRScaled",
+          "b":"bwPower0p75"},
+       "kD":{
+          "type":"product",
+          "a":"kDScaled",
+          "b":"bwPower0p75"},
+       "kF":{
+          "type":"product",
+          "a":"kFScaled",
+          "b":"bwPower0p75"},
+       "kH":{
+          "type":"product",
+          "a":"kHScaled",
+          "b":"bwPower0p75"},
+       "kI":{
+          "type":"product",
+          "a":"kIScaled",
+          "b":"bwPower0p75"},
+       "kIF":{
+          "type":"product",
+          "a":"kIFScaled",
+          "b":"bwPower0p75"},
+       "kRBC":{
+          "type":"product",
+          "a":"kRBCScaled",
+          "b":"bwPower0p75"},
+       "kR":{
+          "type":"product",
+          "a":"kRScaled",
+          "b":"bwPower0p75"},
+       "kU":{
+          "type":"product",
+          "a":"kUScaled",
+          "b":"bwPower0p75"},
+       "dBL":{
+          "type":"product",
+          "a":"dBLPaper",
+          "b":"plasmaVolume"},
+       "dBBr":{
+          "type":"product",
+          "a":"dBBrPaper",
+          "b":"plasmaVolume"},
+       "kLB:I":{
+          "type":"product",
+          "a":"kLB:IPaper",
+          "b":"liverVolume"},
+       "kBK:I":{
+          "type":"product",
+          "a":"kBK:IPaper",
+          "b":"plasmaVolume"},
+       "kKB:I":{
+          "type":"product",
+          "a":"kKB:IPaper",
+          "b":"kidneyVolume"},
+       "kKU:I":{
+          "type":"product",
+          "a":"kKU:IPaper",
+          "b":"kidneyVolume"},
+       "kBH:I":{
+          "type":"product",
+          "a":"kBH:IPaper",
+          "b":"plasmaVolume"},
+       "kBU:I":{
+          "type":"product",
+          "a":"kBU:IPaper",
+          "b":"plasmaVolume"},
+       "kBF:I":{
+          "type":"product",
+          "a":"kBF:IPaper",
+          "b":"plasmaVolume"},
+       "kLF:I":{
+          "type":"product",
+          "a":"kLF:IPaper",
+          "b":"liverVolume"},
+       "kBBr:I":{
+          "type":"product",
+          "a":"kBBr:IPaper",
+          "b":"plasmaVolume"},
+       "kBrB:I":{
+          "type":"product",
+          "a":"kBrB:IPaper",
+          "b":"brainVolume"}}
+}

+ 52 - 27
pythonScripts/cModel.py

@@ -389,32 +389,51 @@ class model:
       for i in range(self.n):
          fY[i]=scipy.interpolate.splev(t, self.tck[i], der=0)
       return fY
-    
-   def calculateUncertainty(self,sol,se):
-      s2out=numpy.zeros(sol.shape)
-      #pars=self.mod['parameters']
+   
+   def getWeight(self,parName):
       pars=self.parSetup['parameters']
-      for parName in pars:
-         par=pars[parName]
-         if not calculateDerivative(par):
-            continue
-         v=par["value"]
-         if par['dist']=='lognormal':
-            #this is sigma^2_lnx
-            sln2=numpy.log(par["cv"]*par["cv"]+1)
-            #have to multiplied by value to get the derivative 
-            #with respect to lnx
-            s2=sln2*v*v
-         else:
-            #for Gaussian, cv is sigma/value; get sigma by value multiplication
-            s2=par["cv"]*par["cv"]*v*v
-         j=self.lutSE[parName]
-         fse=se[:,:,j]
-         print('Calculating for {}/{}:{} [{}]'.format(parName,j,fse.shape,s2))
-         #se2 is nt x n
-         se2=numpy.multiply(fse,fse)
-         s2out+=se2*s2
-      return numpy.sqrt(s2out)
+      par=pars[parName]
+      #self.get parses the units
+      v=self.get(parName)["value"]
+      if par['dist']=='lognormal':
+         #this is sigma^2_lnx
+         sln2=numpy.log(par["cv"]*par["cv"]+1)
+         #have to multiplied by value to get the derivative 
+         #with respect to lnx
+         return sln2*v*v
+      else:
+         #for Gaussian, cv is sigma/value; get sigma by value multiplication
+         return par["cv"]*par["cv"]*v*v
+      
+   def getMax(lutSE):
+      fm=-1
+      for x in lutSE:
+         if int(lutSE[x])>fm:
+            fm=lutSE[x]
+      return fm
+
+   def getWeights(self,lutSE):
+      #pars=self.parSetup['parameters']
+      wts=numpy.zeros((model.getMax(lutSE)+1))
+      for parName in lutSE:
+         j=lutSE[parName]
+         wts[j]=self.getWeight(parName)
+      return wts
+
+   def getDerivatives(self,se,i):
+      #return latest point derivatives
+      fse=se[-1][i]
+      #fse is an m-vector
+      return fse*fse
+
+  
+
+   def calculateUncertainty(self,se):
+      
+      s2out=numpy.zeros(se.shape[1:])
+      se2=numpy.multiply(se,se)
+      return numpy.sqrt(numpy.dot(se2,self.getWeights(self.lutSE)))
+
 
    def get(self,parName):
       pars=self.parSetup['parameters']
@@ -449,11 +468,17 @@ class model:
          return valueObject(v,parName)
 
       if parUnits[1]=='min' and timeUnit=='s':
-         return valueObject(lambda t,v=v: v(t)/60,parName)
+         return valueObject(v/60,parName)
       
       if parUnits[1]=='s' and timeUnit=='min':
-         return valueObject(lambda t,v=v: 60*v(t),parName)
+         return valueObject(60*v,parName)
+
+      if parUnits[1]=='day' and timeUnit=='min':
+         return valueObject(v/24/60,parName)
+
 
+      if parUnits[1]=='hour' and timeUnit=='min':
+         return valueObject(v/60,parName)
       #no idea what to do
       return valueObject(v,parName)
 

Разлика између датотеке није приказан због своје велике величине
+ 58 - 111
pythonScripts/compartmentModel.ipynb


+ 30 - 28
pythonScripts/ivp.py

@@ -66,26 +66,26 @@ def jacobiSEFull(t,S,system):
         fJ[i*system.n:(i+1)*system.n,i*system.n:(i+1)*system.n]=system.M(t)
     return fJ
 
-def solveSimultaneous(model,tmax,atol,rtol,method='LSODA',t0=0,y0=numpy.array([]), Sin=numpy.array([])):
-    S1=numpy.zeros((model.n,model.m+1))
-    if Sin.size!=0:
-       S1[:,1:]=Sin
+def solveSimultaneous(model,tmax,atol,rtol,method='LSODA',t0=0,y0=numpy.array([]), sIn=numpy.array([])):
+    s0=numpy.zeros((model.n,model.m+1))
+    if sIn.size!=0:
+       s0[:,1:]=sIn
     if y0.size==0:
        y0=numpy.zeros(model.n)
     #set initial condition
-    S1[:,0]=y0
-    S1=S1.ravel()
-    sol=scipy.integrate.solve_ivp(dfdySFull,[t0, tmax],S1, args=(model,), jac=jacobiSEFull,
+    s0[:,0]=y0
+    s0=s0.ravel()
+    sol=scipy.integrate.solve_ivp(dfdySFull,[t0, tmax],s0, args=(model,), jac=jacobiSEFull,
                                   method=method, atol=atol, rtol=rtol)
     t=sol.t
     sFull=numpy.reshape(numpy.transpose(sol.y),(len(t),model.n,model.m+1))
     s1=sFull[:,:,1:]
     ysol=sFull[:,:,0]
-    se=model.calculateUncertainty(ysol,s1)
+    se=model.calculateUncertainty(s1)
     print('Done simultaneous LSODA SE')
     return t,ysol,se,s1
 
-def solveSequential(model,tmax,atol,rtol,method='LSODA',t0=0,y0=numpy.array([]), S1=numpy.array([])):
+def solveSequential(model,tmax,atol,rtol,method='LSODA',t0=0,y0=numpy.array([]), sIn=numpy.array([])):
    if y0.size==0:
       y0=numpy.zeros(model.n)
    model.iPrint=0
@@ -96,11 +96,12 @@ def solveSequential(model,tmax,atol,rtol,method='LSODA',t0=0,y0=numpy.array([]),
    t=solIVP.t
    print('shape (y) {}'.format(sol.shape))
    model.setY(t,sol)
-   if S1.size==0:
-      S1=numpy.zeros((model.n,model.m))
-   S1=S1.ravel()
+   s0=numpy.zeros((model.n,model.m))
+   if sIn.size==0:
+      s0=sIn
+   s0=s0.ravel()
     
-   solIVPSE=scipy.integrate.solve_ivp(dfdyS,[0, tmax],S1, args=(model,), jac=jacobiSE,
+   solIVPSE=scipy.integrate.solve_ivp(dfdyS,[0, tmax],s0, args=(model,), jac=jacobiSE,
                                method=method, atol=atol, rtol=rtol)
    sraw=numpy.reshape(numpy.transpose(solIVPSE.y),(len(solIVPSE.t),model.n,model.m))
    #interpolate on t
@@ -110,29 +111,29 @@ def solveSequential(model,tmax,atol,rtol,method='LSODA',t0=0,y0=numpy.array([]),
          tck = scipy.interpolate.splrep(solIVPSE.t, sraw[:,i,j], s=0)
          s1[:,i,j]=scipy.interpolate.splev(t, tck, der=0)
 
-   se=model.calculateUncertainty(sol,s1)
+   se=model.calculateUncertainty(s1)
    return t,sol,se,s1
 
-def solveSimultaneousOdeint(model,tmax,nt=201,t0=0,y0=numpy.array([]), Sin=numpy.array([])):
+def solveSimultaneousOdeint(model,tmax,nt=201,t0=0,y0=numpy.array([]), sIn=numpy.array([])):
    t = numpy.linspace(t0,tmax, nt)
    if y0.size==0:
       y0=numpy.zeros(model.n)
    
-   S1=numpy.zeros((model.n,model.m+1))
-   if Sin.size!=0:
-      S1[:,1:]=Sin
+   s0=numpy.zeros((model.n,model.m+1))
+   if sIn.size!=0:
+      s0[:,1:]=sIn
    #set initial condition
-   S1[:,0]=y0
-   S1=S1.ravel()
-   solSE1=scipy.integrate.odeint(dfdySFull, S1, t, args=(model,),Dfun=jacobiSEFull,tfirst=True)
+   s0[:,0]=y0
+   s0=s0.ravel()
+   solSE1=scipy.integrate.odeint(dfdySFull, s0, t, args=(model,),Dfun=jacobiSEFull,tfirst=True)
    sFull=numpy.reshape(solSE1,(len(t),model.n,model.m+1))
    s1=sFull[:,:,1:]
    sol=sFull[:,:,0]
-   se=sys.calculateUncertainty(sol,s1)
+   se=sys.calculateUncertainty(s1)
    print('Done simultaneous SE')
    return t,sol,se,s1
 
-def solveSequentialOdeint(model,tmax,nt=201,t0=0,y0=numpy.array([]),S1=numpy.array([])):
+def solveSequentialOdeint(model,tmax,nt=201,t0=0,y0=numpy.array([]),sIn=numpy.array([])):
    t = numpy.linspace(t0,tmax, nt)
    if y0.size==0:
       y0=numpy.zeros(sys.n)
@@ -140,12 +141,13 @@ def solveSequentialOdeint(model,tmax,nt=201,t0=0,y0=numpy.array([]),S1=numpy.arr
    print('shape (y) {}'.format(sol.shape))
 
    model.setY(t,sol)
-   if S1.size==0:
-      S1=numpy.zeros((model.n,model.m))
-   S1=S1.ravel()
-   solSE=scipy.integrate.odeint(dfdyS, S1, t, args=(model,),Dfun=jacobiSE,tfirst=True)
+   s0=numpy.zeros((model.n,model.m))
+   if sIn.size==0:
+      s0=sIn
+   s0=s0.ravel()
+   solSE=scipy.integrate.odeint(dfdyS, s0, t, args=(model,),Dfun=jacobiSE,tfirst=True)
    s1=numpy.reshape(solSE,(len(t),model.n,model.m))
-   se=model.calculateUncertainty(sol,s1)
+   se=model.calculateUncertainty(s1)
    print('Done sequential SE')
    return t,sol,se,s1
 

+ 16 - 13
pythonScripts/runSolver.py

@@ -65,30 +65,30 @@ def main(parFiles,jobDir):
    scale=getScale(setup)
    tmax=setup['tmax']*scale
    print('Using {}'.format(jobDir))
-   t0,y0,S1,lut,lutSE=getStartPoint(setup)
+   t0,y0,s0,lut,lutSE=getStartPoint(setup)
    #we should reorder S1 to match model.lutSE
    #S1 is nxm, so we should reorder columns
-   Sin=numpy.zeros(S1.shape)
-   if S1.size>0:
+   sIn=numpy.zeros(s0.shape)
+   if s0.size>0:
       for x in model.lutSE:
          #this could be modified for different ordering of lut as well
-         Sin[:,model.lutSE[x]]=S1[:,lutSE[x]]
+         sIn[:,model.lutSE[x]]=s0[:,lutSE[x]]
 
    start_time=time.time()
    if setup['mode']=='SequentialOdeint':
-      t,sol,se,s1=ivp.solveSequentialOdeint(model,tmax,setup['nt'],t0,y0,Sin)
+      t,sol,se,s1=ivp.solveSequentialOdeint(model,tmax,setup['nt'],t0,y0,sIn)
    if setup['mode']=='SimultaneousOdeint':
-      t,sol,se,s1=ivp.solveSimultaneousOdeint(model,tmax,setup['nt'],t0,y0,Sin)
+      t,sol,se,s1=ivp.solveSimultaneousOdeint(model,tmax,setup['nt'],t0,y0,sIn)
 
    if setup['mode']=='IVP':
       t,sol,se,s1=ivp.solveSequential(model,tmax,atol=setup['atol'],\
          rtol=setup['rtol'],method=setup['method'],\
-         t0=t0,y0=y0,Sin=Sin)
+         t0=t0,y0=y0,sIn=sIn)
         
    if setup['mode']=='IVPSimultaneous':
       t,sol,se,s1=ivp.solveSimultaneous(model,tmax,atol=setup['atol'],\
          rtol=setup['rtol'],method=setup['method'],\
-         t0=t0,y0=y0,Sin=Sin)
+         t0=t0,y0=y0,sIn=sIn)
 
    end_time=time.time()
    print('Time: {:.3f} s'.format(end_time-start_time))
@@ -212,11 +212,14 @@ def loadSolutionFromRef(setup):
        remotePath='/'.join([remoteDir,f])
        fb.readFileToFile(remotePath,localPath)
 
-   t=numpy.loadtxt(os.path.join(localDir,'t.txt'))
-   sol=numpy.loadtxt(os.path.join(localDir,'sol.txt'))
-   se=numpy.loadtxt(os.path.join(localDir,'se.txt'))
-   sOut,lut,lutSE=read3D(os.path.join(localDir,'sOut.txt'))
-   qt=numpy.loadtxt(os.path.join(localDir,'qt.txt'))
+   return loadSolutionFromDir(localDir)
+
+def loadSolutionFromDir(jobDir):
+   t=numpy.loadtxt(os.path.join(jobDir,'t.txt'))
+   sol=numpy.loadtxt(os.path.join(jobDir,'sol.txt'))
+   se=numpy.loadtxt(os.path.join(jobDir,'se.txt'))
+   sOut,lut,lutSE=read3D(os.path.join(jobDir,'sOut.txt'))
+   qt=numpy.loadtxt(os.path.join(jobDir,'qt.txt'))
    return t,sol,se,sOut,qt,lut,lutSE
 
 

+ 2 - 2
setup/setup.json → setup/setupDay.json

@@ -1,6 +1,6 @@
 {"method":"LSODA",
-"atol":1e-4,
-"rtol":1e-4,
+"atol":1e-8,
+"rtol":1e-8,
 "mode":"IVPSimultaneous",
 "nt":201,
 "tmax":1,

+ 2 - 2
setup/setupFast.json

@@ -1,6 +1,6 @@
 {"method":"LSODA",
-"atol":1e-4,
-"rtol":1e-4,
+"atol":1e-8,
+"rtol":1e-8,
 "mode":"IVPSimultaneous",
 "nt":201,
 "tmax":1,

+ 1 - 1
setup/setupFastLoad.json

@@ -5,5 +5,5 @@
 "nt":201,
 "tmax":1.05,
 "tUnit":"day",
-"startFromRef":"1668337037"
+"startFromRef":"1668433754"
 }

+ 7 - 0
setup/setupMonth.json

@@ -0,0 +1,7 @@
+{"method":"LSODA",
+"atol":1e-8,
+"rtol":1e-8,
+"mode":"IVPSimultaneous",
+"nt":201,
+"tmax":1,
+"tUnit":"month"}

+ 7 - 0
setup/setupYear.json

@@ -0,0 +1,7 @@
+{"method":"LSODA",
+"atol":1e-8,
+"rtol":1e-8,
+"mode":"IVPSimultaneous",
+"nt":201,
+"tmax":1,
+"tUnit":"year"}

Неке датотеке нису приказане због велике количине промена