/******************************************************************* psim.cpp Revision 1.2 under construction ********************************************************************/ /* Copyright (C) 2000,2001 Doug Neubauer * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define MILLISECONDSPERHOUR (3600000) // double stomachPeptides = 0.0; #include #include #include #include #include #include #include "psim.h" /* begin physiological data */ tissueConstant tissueConstants[] = { {"lymphNode", {3.0e8 * 0.52 , 3.0e8 * 0.52 * STRAINFREQUENCY , 3.0e8 * 0.52 * STRAINFREQUENCY }, /* numberOfBCellsNaive */ {3.0e8 * 0.48 , 3.0e8 * 0.48 * STRAINFREQUENCY , 3.0e8 * 0.48 * STRAINFREQUENCY }, /* numberOfBCellsRecirculate */ {0.0 , 0.0 }, /* numberOfBCellsMarginalZone */ {7.0e8 * 0.9, 7.0e8 * 0.9 * STRAINFREQUENCY, 7.0e8 * 0.9 * STRAINFREQUENCY }, /* numberOfThCellsNaive */ {7.0e8 * 0.9, 7.0e8 * 0.9 * STRAINFREQUENCY, 7.0e8 * 0.9 * STRAINFREQUENCY }, /* numberOfTcCellsNaive */ 3.5e6, /* numberOfMacrophage */ 3.2e7, /* numberOfDendritic */ 0.0, /* epitheliaCell */ 1.15, /* k2BloodInput_bCellNaive */ 0.24, /* k2BloodInput_bCellNaiveRecirculate */ 0.35, /* k2BloodInput_thNaive */ 0.21, /* k2BloodInput_tcNaive */ 0.0, /* k2BloodInput_tcEffector */ 0.0, /* k2BloodInput_Dendritic */ 0.0, /* k2BloodInput_rbc */ 0.0 , /* k2BloodInput_platelets */ 0.0 , /* k2BloodInput_Macrophage */ 0.0 , /* k2BloodOutput_bCellNaive */ 0.0 , /* k2BloodOutput_bCellNaiveRecirculate */ 0.0 , /* k2BloodOutput_thNaive */ 0.0 , /* k2BloodOutput_tcNaive */ 0.05 , /* k2LymphInput_bCellNaiveRecirculate */ 0.05 , /* k2LymphInput_macrophageApc */ 0.05 , /* k2LymphInput_dendriticApc */ 23.0 * 24.0 , /* k2LymphOutput_bCellNaiveRecirculate */ 0.05 , /* k2LymphOutput_tcEffectorfector */ 0.0 , /* k2LymphOutput_macrophageApc */ 0.0 , /* k2LymphOutput_dendriticApc */ 16.3 * 24.0 , /* k2LymphOutput_thNaive */ 54.7 * 24.0 , /* k2LymphOutput_tcNaive */ 0.0 , /* k2macrophageReplicate */ 0.0 , /* k2dendriticReplicate */ 0.0, /* k2BloodInput_plasmaCell */ 0.05 , /* k2LymphOutput_plasmaCell */ 0.0, /* k2BloodInput_thEffector */ 0.05 , /* k2LymphOutput_thEffectorfector */ 2000.0 , /* fdcGerminalCenters */ 0.0, /* k2BloodInput_bCellMemory */ 0.0, /* k2BloodInput_thMemory */ 0.0, /* k2BloodInput_tcMemory */ 0.0, /* k2BloodOutput_bCellMemory */ 0.0, /* k2BloodOutput_thMemory */ 0.0, /* k2BloodOutput_tcMemory */ 23.0 * 24.0 , /* k2LymphOutput_bCellMemory ul/sec */ 23.0 * 24.0 , /* k2LymphOutput_thMemory */ 23.0 * 24.0 , /* k2LymphOutput_tcMemory */ 0.05, /* k2LymphInput_bCellMemory */ 0.05, /* k2LymphInput_thMemory */ 0.05, /* k2LymphInput_tcMemory */ 0.0, /* numberOfmastCell */ 0.0, /* numberOfeosinophil */ 0.0, /* k2BloodInput_mastCell */ 0.0, /* k2BloodInput_eosinophil */ }, {"spleen", {3.5e10 * 0.5 * 0.7 / 3.5, 3.5e10 * 0.5 * 0.7 / 3.5 * STRAINFREQUENCY,3.5e10 * 0.5 * 0.7 / 3.5 * STRAINFREQUENCY}, /* numberOfBCellsNaive */ {3.5e10 * 1.3 / 3.5 , 3.5e10 * 1.3 / 3.5 * STRAINFREQUENCY,3.5e10 * 1.3 / 3.5 * STRAINFREQUENCY}, /* numberOfBCellsRecirculate */ {3.5e10 * 1.5 / 3.5, 3.5e10 * 1.5 / 3.5 * STRAINFREQUENCY,3.5e10 * 1.5 / 3.5 * STRAINFREQUENCY}, /* numberOfBCellsMarginalZone */ {2.73e10 * 0.69, 2.73e10 * 0.69 * STRAINFREQUENCY,2.73e10 * 0.69 * STRAINFREQUENCY}, /* numberOfThCellsNaive */ {7.7e9, 7.7e9 * STRAINFREQUENCY,7.7e9 * STRAINFREQUENCY}, /* numberOfTcCellsNaive */ 4.6e10, /* numberOfMacrophage */ 0.0 , /* numberOfDendritic */ 0.0 , /* epitheliaCell */ 1151.0 , /* k2BloodInput_bCellNaive */ 1151.0 , /* k2BloodInput_bCellNaiveRecirculate */ 1151.0 , /* k2BloodInput_thNaive */ 1151.0, /* k2BloodInput_tcNaive */ 0.0, /* k2BloodInput_tcEffector */ 0.0, /* k2BloodInput_Dendritic */ 0.36, /* k2BloodInput_rbc */ 6.84 , /* k2BloodInput_platelets */ 24.0 , /* k2BloodInput_Macrophage */ 1.5 , /* k2BloodOutput_bCellNaive */ 11.7 , /* k2BloodOutput_bCellNaiveRecirculate */ 2.5 , /* k2BloodOutput_thNaive */ 2.1 , /* k2BloodOutput_tcNaive */ 0.0 , /* k2LymphInput_bCellNaiveRecirculate */ 0.0 , /* k2LymphInput_macrophageApc */ 0.0 , /* k2LymphInput_dendriticApc */ 0.0 , /* k2LymphOutput_bCellNaiveRecirculate */ 0.0 , /* k2LymphOutput_tcEffector */ 0.0 , /* k2LymphOutput_macrophageApc */ 0.0 , /* k2LymphOutput_dendriticApc */ 0.0 , /* k2LymphOutput_thNaive */ 0.0 , /* k2LymphOutput_tcNaive */ 4.0 * 24.0 , /* k2macrophageReplicate */ 0.0 , /* k2dendriticReplicate */ 0.0, /* k2BloodInput_plasmaCell */ 0.0 , /* k2LymphOutput_plasmaCell */ 0.0, /* k2BloodInput_thEffector */ 0.0 , /* k2LymphOutput_thEffectorfector */ 75000.0 , /* fdcGerminalCenters */ 1151.0, /* k2BloodInput_bCellMemory */ 1151.0, /* k2BloodInput_thMemory */ 1151.0, /* k2BloodInput_tcMemory */ 2.5, /* k2BloodOutput_bCellMemory */ 2.5, /* k2BloodOutput_thMemory */ 2.5, /* k2BloodOutput_tcMemory */ 0.0, /* k2LymphOutput_bCellMemory */ 0.0, /* k2LymphOutput_thMemory */ 0.0, /* k2LymphOutput_tcMemory */ 0.0, /* k2LymphInput_bCellMemory */ 0.0, /* k2LymphInput_thMemory */ 0.0, /* k2LymphInput_tcMemory */ 0.0, /* numberOfmastCell */ 0.0, /* numberOfeosinophil */ 0.0, /* k2BloodInput_mastCell */ 0.0, /* k2BloodInput_eosinophil */ }, {"liver", {0.0, 0.0 * STRAINFREQUENCY, 0.0 * STRAINFREQUENCY}, /* numberOfBCellsNaive */ {1.6e8 , 1.6e8 * STRAINFREQUENCY,1.6e8 * STRAINFREQUENCY}, /* numberOfBCellsRecirculate */ {0.0, 0.0 * STRAINFREQUENCY, 0.0 * STRAINFREQUENCY}, /* numberOfBCellsMarginalZone */ {4.0e8, 4.0e8 * STRAINFREQUENCY,4.0e8 * STRAINFREQUENCY}, /* numberOfThCellsNaive */ {5.6e8, 5.6e8 * STRAINFREQUENCY,5.6e8 * STRAINFREQUENCY}, /* numberOfTcCellsNaive */ 1.0e11, /* numberOfMacrophage */ 0.0 , /* numberOfDendritic */ 0.0 , /* epitheliaCell */ 0.0 , /* k2BloodInput_bCellNaive */ 1.61e-2 * 77.0, /* k2BloodInput_bCellNaiveRecirculate */ 0.0 , /* k2BloodInput_thNaive */ 0.0, /* k2BloodInput_tcNaive */ 5.2, /* k2BloodInput_tcEffector */ 0.0, /* k2BloodInput_Dendritic */ 0.0, /* k2BloodInput_rbc */ 0.0 , /* k2BloodInput_platelets */ 50.0 , /* k2BloodInput_Macrophage */ 0.0 , /* k2BloodOutput_bCellNaive */ 0.0 , /* k2BloodOutput_bCellNaiveRecirculate */ 0.0 , /* k2BloodOutput_thNaive */ 0.0 , /* k2BloodOutput_tcNaive */ 0.0 , /* k2LymphInput_bCellNaiveRecirculate */ 0.0 , /* k2LymphInput_macrophageApc */ 0.0 , /* k2LymphInput_dendriticApc */ 5.6 * 24.0 , /* k2LymphOutput_bCellNaiveRecirculate */ 0.0 , /* k2LymphOutput_tcEffector */ 0.0 , /* k2LymphOutput_macrophageApc */ 0.0 , /* k2LymphOutput_dendriticApc */ 0.0 , /* k2LymphOutput_thNaive */ 0.0 , /* k2LymphOutput_tcNaive */ 0.0 , /* k2macrophageReplicate */ 0.0 , /* k2dendriticReplicate */ 5.2, /* k2BloodInput_plasmaCell */ 0.0 , /* k2LymphOutput_plasmaCell */ 5.2, /* k2BloodInput_thEffector */ 0.0 , /* k2LymphOutput_thEffectorfector */ 0.0 , /* fdcGerminalCenters */ 5.2, /* k2BloodInput_bCellMemory */ 5.2, /* k2BloodInput_thMemory */ 5.2, /* k2BloodInput_tcMemory */ 0.0, /* k2BloodOutput_bCellMemory */ 0.0, /* k2BloodOutput_thMemory */ 0.0, /* k2BloodOutput_tcMemory */ 4.0 * 24.0, /* k2LymphOutput_bCellMemory */ 4.0 * 24.0, /* k2LymphOutput_thMemory */ 4.0 * 24.0, /* k2LymphOutput_tcMemory */ 0.0, /* k2LymphInput_bCellMemory */ 0.0, /* k2LymphInput_thMemory */ 0.0, /* k2LymphInput_tcMemory */ 0.0, /* numberOfmastCell */ 0.0, /* numberOfeosinophil */ 0.0, /* k2BloodInput_mastCell */ 0.0, /* k2BloodInput_eosinophil */ }, {"skin", {0.0, 0.0 , 0.0 }, /* numberOfBCellsNaive */ {8.0e6 , 8.0e6 * STRAINFREQUENCY,8.0e6 * STRAINFREQUENCY }, /* numberOfBCellsRecirculate */ {0.0 , 0.0 ,0.0 }, /* numberOfBCellsMarginalZone */ {3.6e8, 3.6e8 * STRAINFREQUENCY,3.6e8 * STRAINFREQUENCY}, /* numberOfThCellsNaive */ {3.6e8, 3.6e8 * STRAINFREQUENCY,3.6e8 * STRAINFREQUENCY}, /* numberOfTcCellsNaive */ 0.0, /* numberOfMacrophage */ 1.0e9 , /* numberOfDendritic */ 0.0 , /* epitheliaCell */ 0.0 , /* k2BloodInput_bCellNaive */ 1.61e-2 * 7.0, /* k2BloodInput_bCellNaiveRecirculate */ 0.0 , /* k2BloodInput_thNaive */ 0.0, /* k2BloodInput_tcNaive */ 3.5, /* k2BloodInput_tcEffector */ 0.0, /* k2BloodInput_Dendritic */ 0.0, /* k2BloodInput_rbc */ 0.0 , /* k2BloodInput_platelets */ 0.0 , /* k2BloodInput_Macrophage */ 0.0 , /* k2BloodOutput_bCellNaive */ 0.0 , /* k2BloodOutput_bCellNaiveRecirculate */ 0.0 , /* k2BloodOutput_thNaive */ 0.0 , /* k2BloodOutput_tcNaive */ 0.0 , /* k2LymphInput_bCellNaiveRecirculate */ 0.0 , /* k2LymphInput_macrophageApc */ 0.0 , /* k2LymphInput_dendriticApc */ 3.1 * 24.0 , /* k2LymphOutput_bCellNaiveRecirculate */ 0.0 , /* k2LymphOutput_tcEffector */ 0.0 , /* k2LymphOutput_macrophageApc */ 0.0 , /* k2LymphOutput_dendriticApc */ 0.0 , /* k2LymphOutput_thNaive */ 0.0 , /* k2LymphOutput_tcNaive */ 0.0 , /* k2macrophageReplicate */ 0.0 , /* k2dendriticReplicate */ 3.5, /* k2BloodInput_plasmaCell */ 0.0 , /* k2LymphOutput_plasmaCell */ 3.5, /* k2BloodInput_thEffector */ 0.0 , /* k2LymphOutput_thEffectorfector */ 0.0 , /* fdcGerminalCenters */ 3.5, /* k2BloodInput_bCellMemory */ 3.5, /* k2BloodInput_thMemory */ 3.5, /* k2BloodInput_tcMemory */ 0.0, /* k2BloodOutput_bCellMemory */ 0.0, /* k2BloodOutput_thMemory */ 0.0, /* k2BloodOutput_tcMemory */ 4.0 * 24.0, /* k2LymphOutput_bCellMemory */ 4.0 * 24.0, /* k2LymphOutput_thMemory */ 4.0 * 24.0, /* k2LymphOutput_tcMemory */ 0.0, /* k2LymphInput_bCellMemory */ 0.0, /* k2LymphInput_thMemory */ 0.0, /* k2LymphInput_tcMemory */ 0.0, /* numberOfmastCell */ 0.0, /* numberOfeosinophil */ 0.0, /* k2BloodInput_mastCell */ 0.0, /* k2BloodInput_eosinophil */ }, {"miscellaneousTissue", {0.0, 0.0 , 0.0 }, /* numberOfBCellsNaive */ {2.0e10 ,2.0e10 * STRAINFREQUENCY,2.0e10 * STRAINFREQUENCY }, /* numberOfBCellsRecirculate */ {0.0, 0.0 , 0.0 }, /* numberOfBCellsMarginalZone */ {1.0e10, 1.0e10 * STRAINFREQUENCY,1.0e10 * STRAINFREQUENCY }, /* numberOfThCellsNaive */ {1.0e10, 1.0e10 * STRAINFREQUENCY,1.0e10 * STRAINFREQUENCY }, /* numberOfTcCellsNaive */ 0.0, /* numberOfMacrophage */ 0.0 , /* numberOfDendritic */ 0.0 , /* epitheliaCell */ 0.0 , /* k2BloodInput_bCellNaive */ 1.61e-2 * 175.0, /* k2BloodInput_bCellNaiveRecirculate */ 0.0 , /* k2BloodInput_thNaive */ 0.0, /* k2BloodInput_tcNaive */ 5.2, /* k2BloodInput_tcEffector */ 0.0, /* k2BloodInput_Dendritic */ 0.0, /* k2BloodInput_rbc */ 0.0 , /* k2BloodInput_platelets */ 0.0 , /* k2BloodInput_Macrophage */ 0.0 , /* k2BloodOutput_bCellNaive */ 0.0 , /* k2BloodOutput_bCellNaiveRecirculate */ 0.0 , /* k2BloodOutput_thNaive */ 0.0 , /* k2BloodOutput_tcNaive */ 0.0 , /* k2LymphInput_bCellNaiveRecirculate */ 0.0 , /* k2LymphInput_macrophageApc */ 0.0 , /* k2LymphInput_dendriticApc */ 306.0 * 24.0 , /* k2LymphOutput_bCellNaiveRecirculate */ 0.0 , /* k2LymphOutput_tcEffector */ 0.0 , /* k2LymphOutput_macrophageApc */ 0.0 , /* k2LymphOutput_dendriticApc */ 0.0 , /* k2LymphOutput_thNaive */ 0.0 , /* k2LymphOutput_tcNaive */ 0.0 , /* k2macrophageReplicate */ 0.0 , /* k2dendriticReplicate */ 5.2, /* k2BloodInput_plasmaCell */ 0.0 , /* k2LymphOutput_plasmaCell */ 5.2, /* k2BloodInput_thEffector */ 0.0 , /* k2LymphOutput_thEffectorfector */ 0.0 , /* fdcGerminalCenters */ 5.2, /* k2BloodInput_bCellMemory */ 5.2, /* k2BloodInput_thMemory */ 5.2, /* k2BloodInput_tcMemory */ 0.0, /* k2BloodOutput_bCellMemory */ 0.0, /* k2BloodOutput_thMemory */ 0.0, /* k2BloodOutput_tcMemory */ 4.0 * 24.0, /* k2LymphOutput_bCellMemory */ 4.0 * 24.0, /* k2LymphOutput_thMemory */ 4.0 * 24.0, /* k2LymphOutput_tcMemory */ 0.0, /* k2LymphInput_bCellMemory */ 0.0, /* k2LymphInput_thMemory */ 0.0, /* k2LymphInput_tcMemory */ 0.0, /* numberOfmastCell */ 2.0e11, /* numberOfeosinophil */ 0.0, /* k2BloodInput_mastCell */ 104.8, /* k2BloodInput_eosinophil */ }, {"respiratoryTract", {0.0, 0.0 , 0.0 }, /* numberOfBCellsNaive */ {1.1e9 , 1.1e9 * STRAINFREQUENCY , 1.1e9 * STRAINFREQUENCY }, /* numberOfBCellsRecirculate */ {0.0 , 0.0 , 0.0 }, /* numberOfBCellsMarginalZone */ {9.7e9 , 9.7e9 * STRAINFREQUENCY , 9.7e9 * STRAINFREQUENCY }, /* numberOfThCellsNaive */ {2.0e10, 2.0e10 * STRAINFREQUENCY, 2.0e10 * STRAINFREQUENCY}, /* numberOfTcCellsNaive */ 2.3e10, /* numberOfMacrophage */ 2.3e8 , /* numberOfDendritic */ 1.6e11 , /* epitheliaCell */ 0.0 , /* k2BloodInput_bCellNaive */ 1.61e-2 * 168.0, /* k2BloodInput_bCellNaiveRecirculate */ 0.0 , /* k2BloodInput_thNaive */ 0.0, /* k2BloodInput_tcNaive */ 6.2, /* k2BloodInput_tcEffector */ 0.0, /* k2BloodInput_Dendritic */ 0.0, /* k2BloodInput_rbc */ 0.0 , /* k2BloodInput_platelets */ 14.0 , /* k2BloodInput_Macrophage */ 0.0 , /* k2BloodOutput_bCellNaive */ 0.0 , /* k2BloodOutput_bCellNaiveRecirculate */ 0.0 , /* k2BloodOutput_thNaive */ 0.0 , /* k2BloodOutput_tcNaive */ 0.0 , /* k2LymphInput_bCellNaiveRecirculate */ 0.0 , /* k2LymphInput_macrophageApc */ 0.0 , /* k2LymphInput_dendriticApc */ 17.5 * 24.0 , /* k2LymphOutput_bCellNaiveRecirculate */ 0.0 , /* k2LymphOutput_tcEffector */ 0.0 , /* k2LymphOutput_macrophageApc */ 0.0 , /* k2LymphOutput_dendriticApc */ 0.0 , /* k2LymphOutput_thNaive */ 0.0 , /* k2LymphOutput_tcNaive */ 4.0 * 24.0 , /* k2macrophageReplicate */ 1.0 * 24.0 , /* k2dendriticReplicate */ 6.2, /* k2BloodInput_plasmaCell */ 0.0 , /* k2LymphOutput_plasmaCell */ 6.2, /* k2BloodInput_thEffector */ 0.0 , /* k2LymphOutput_thEffectorfector */ 0.0 , /* fdcGerminalCenters */ 6.2, /* k2BloodInput_bCellMemory */ 6.2, /* k2BloodInput_thMemory */ 6.2, /* k2BloodInput_tcMemory */ 0.0, /* k2BloodOutput_bCellMemory */ 0.0, /* k2BloodOutput_thMemory */ 0.0, /* k2BloodOutput_tcMemory */ 4.0 * 24.0, /* k2LymphOutput_bCellMemory */ 4.0 * 24.0, /* k2LymphOutput_thMemory */ 4.0 * 24.0, /* k2LymphOutput_tcMemory */ 0.0, /* k2LymphInput_bCellMemory */ 0.0, /* k2LymphInput_thMemory */ 0.0, /* k2LymphInput_tcMemory */ 4.0e8, /* numberOfmastCell */ 2.4e8, /* numberOfeosinophil */ 267.0, /* k2BloodInput_mastCell */ 0.13, /* k2BloodInput_eosinophil */ }, {"bronchialTest", { 0.0, 0.0 ,0.0 }, /* numberOfBCellsNaive */ { 1.1e9 * BRONCHIALFRACTION , 1.1e9 * BRONCHIALFRACTION * STRAINFREQUENCY ,1.1e9 * BRONCHIALFRACTION * STRAINFREQUENCY }, /* numberOfBCellsRecirculate */ { 0.0 , 0.0 ,0.0 }, /* numberOfBCellsMarginalZone */ { 9.7e9 * BRONCHIALFRACTION , 9.7e9 * BRONCHIALFRACTION * STRAINFREQUENCY ,9.7e9 * BRONCHIALFRACTION * STRAINFREQUENCY }, /* numberOfThCellsNaive */ { 2.0e10 * BRONCHIALFRACTION, 2.0e10 * BRONCHIALFRACTION * STRAINFREQUENCY,2.0e10 * BRONCHIALFRACTION * STRAINFREQUENCY}, /* numberOfTcCellsNaive */ 2.3e10 * BRONCHIALFRACTION, /* numberOfMacrophage */ 2.3e8 * BRONCHIALFRACTION, /* numberOfDendritic */ 1.6e11 * BRONCHIALFRACTION , /* epitheliaCell */ 0.0 , /* k2BloodInput_bCellNaive */ 1.61e-2 * 168.0 * BRONCHIALFRACTION, /* k2BloodInput_bCellNaiveRecirculate */ 0.0 , /* k2BloodInput_thNaive */ 0.0, /* k2BloodInput_tcNaive */ BRONCHIALFLOWVALUE, /* k2BloodInput_tcEffector */ 0.14 * BRONCHIALFRACTION , /* k2BloodInput_Dendritic */ 0.0, /* k2BloodInput_rbc */ 0.0 , /* k2BloodInput_platelets */ 14.0 * BRONCHIALFRACTION , /* k2BloodInput_Macrophage */ 0.0 , /* k2BloodOutput_bCellNaive */ 0.0 , /* k2BloodOutput_bCellNaiveRecirculate */ 0.0 , /* k2BloodOutput_thNaive */ 0.0 , /* k2BloodOutput_tcNaive */ 0.0 , /* k2LymphInput_bCellNaiveRecirculate */ 0.0 , /* k2LymphInput_macrophageApc */ 0.0 , /* k2LymphInput_dendriticApc */ 17.5 * 24.0 , /* k2LymphOutput_bCellNaiveRecirculate */ 0.0 , /* k2LymphOutput_tcEffector */ 8.33 * BRONCHIALFRACTION , /* k2LymphOutput_macrophageApc */ 8.33 * BRONCHIALFRACTION , /* k2LymphOutput_dendriticApc */ 0.0 , /* k2LymphOutput_thNaive */ 0.0 , /* k2LymphOutput_tcNaive */ 1.0 * 24.0 , /* k2macrophageReplicate */ 1.0 * 24.0 , /* k2dendriticReplicate */ BRONCHIALFLOWVALUE, /* k2BloodInput_plasmaCell */ 0.0 , /* k2LymphOutput_plasmaCell */ BRONCHIALFLOWVALUE, /* k2BloodInput_thEffector */ 0.0 , /* k2LymphOutput_thEffectorfector */ 0.0 , /* fdcGerminalCenters */ BRONCHIALFLOWVALUE, /* k2BloodInput_bCellMemory */ BRONCHIALFLOWVALUE, /* k2BloodInput_thMemory */ BRONCHIALFLOWVALUE, /* k2BloodInput_tcMemory */ 0.0, /* k2BloodOutput_bCellMemory */ 0.0, /* k2BloodOutput_thMemory */ 0.0, /* k2BloodOutput_tcMemory */ 4.0 * 24.0, /* k2LymphOutput_bCellMemory */ 4.0 * 24.0, /* k2LymphOutput_thMemory */ 4.0 * 24.0, /* k2LymphOutput_tcMemory */ 0.0, /* k2LymphInput_bCellMemory */ 0.0, /* k2LymphInput_thMemory */ 0.0, /* k2LymphInput_tcMemory */ 4.0e8 * BRONCHIALFRACTION, /* numberOfmastCell */ 2.4e8 * BRONCHIALFRACTION, /* numberOfeosinophil */ 267.0 * BRONCHIALFRACTION, /* k2BloodInput_mastCell */ 0.13 * BRONCHIALFRACTION, /* k2BloodInput_eosinophil */ }, {"intestines", {0.0, 0.0 , 0.0 }, /* numberOfBCellsNaive */ {7.6e9, 7.6e9 * STRAINFREQUENCY,7.6e9 * STRAINFREQUENCY }, /* numberOfBCellsRecirculate */ {0.0 , 0.0 ,0.0 }, /* numberOfBCellsMarginalZone */ {1.45e10, 1.45e10 * STRAINFREQUENCY,1.45e10 * STRAINFREQUENCY }, /* numberOfThCellsNaive */ {1.35e10, 1.35e10 * STRAINFREQUENCY,1.35e10 * STRAINFREQUENCY }, /* numberOfTcCellsNaive */ 2.8e10, /* numberOfMacrophage */ 2.8e9 , /* numberOfDendritic */ 2.7e11 , /* epitheliaCell */ 0.0 , /* k2BloodInput_bCellNaive */ 1.61e-2 * 273.0, /* k2BloodInput_bCellNaiveRecirculate */ 0.0 , /* k2BloodInput_thNaive */ 0.0, /* k2BloodInput_tcNaive */ 6.9, /* k2BloodInput_tcEffector */ 0.0, /* k2BloodInput_Dendritic */ 0.0, /* k2BloodInput_rbc */ 0.0 , /* k2BloodInput_platelets */ 7.0 , /* k2BloodInput_Macrophage */ 0.0 , /* k2BloodOutput_bCellNaive */ 0.0 , /* k2BloodOutput_bCellNaiveRecirculate */ 0.0 , /* k2BloodOutput_thNaive */ 0.0 , /* k2BloodOutput_tcNaive */ 0.0 , /* k2LymphInput_bCellNaiveRecirculate */ 0.0 , /* k2LymphInput_macrophageApc */ 0.0 , /* k2LymphInput_dendriticApc */ 133.0 * 24.0 , /* k2LymphOutput_bCellNaiveRecirculate */ 0.0 , /* k2LymphOutput_tcEffector */ 0.0 , /* k2LymphOutput_macrophageApc */ 0.0 , /* k2LymphOutput_dendriticApc */ 0.0 , /* k2LymphOutput_thNaive */ 0.0 , /* k2LymphOutput_tcNaive */ 4.0 * 24.0 , /* k2macrophageReplicate */ 4.3 * 24.0 , /* k2dendriticReplicate */ 6.9, /* k2BloodInput_plasmaCell */ 0.0 , /* k2LymphOutput_plasmaCell */ 6.9, /* k2BloodInput_thEffector */ 0.0 , /* k2LymphOutput_thEffectorfector */ 0.0 , /* fdcGerminalCenters */ 6.9, /* k2BloodInput_bCellMemory */ 6.9, /* k2BloodInput_thMemory */ 6.9, /* k2BloodInput_tcMemory */ 0.0, /* k2BloodOutput_bCellMemory */ 0.0, /* k2BloodOutput_thMemory */ 0.0, /* k2BloodOutput_tcMemory */ 4.0 * 24.0, /* k2LymphOutput_bCellMemory */ 4.0 * 24.0, /* k2LymphOutput_thMemory */ 4.0 * 24.0, /* k2LymphOutput_tcMemory */ 0.0, /* k2LymphInput_bCellMemory */ 0.0, /* k2LymphInput_thMemory */ 0.0, /* k2LymphInput_tcMemory */ 3.5e9, /* numberOfmastCell */ 3.4e9, /* numberOfeosinophil */ 0.0, /* k2BloodInput_mastCell */ 0.0, /* k2BloodInput_eosinophil */ }, {"laminaProperiaTest", {0.0, 0.0 , 0.0 }, /* numberOfBCellsNaive */ {7.6e9, 7.6e9 * LPFRACTION * STRAINFREQUENCY,7.6e9 * LPFRACTION * STRAINFREQUENCY }, /* numberOfBCellsRecirculate */ {0.0 , 0.0 ,0.0 }, /* numberOfBCellsMarginalZone */ {1.45e10, 1.45e10 * LPFRACTION * STRAINFREQUENCY,1.45e10 * LPFRACTION * STRAINFREQUENCY }, /* numberOfThCellsNaive */ {1.35e10, 1.35e10 * LPFRACTION * STRAINFREQUENCY,1.35e10 * LPFRACTION * STRAINFREQUENCY }, /* numberOfTcCellsNaive */ 2.8e10 * LPFRACTION, /* numberOfMacrophage */ 2.8e9 * LPFRACTION, /* numberOfDendritic */ 2.7e11 * LPFRACTION , /* epitheliaCell */ 0.0 , /* k2BloodInput_bCellNaive */ 1.61e-2 * 273.0 * LPFRACTION, /* k2BloodInput_bCellNaiveRecirculate */ 0.0 , /* k2BloodInput_thNaive */ 0.0, /* k2BloodInput_tcNaive */ LPFLOWVALUE, /* k2BloodInput_tcEffector */ 0.7 * LPFRACTION, /* k2BloodInput_Dendritic */ 0.0, /* k2BloodInput_rbc */ 0.0 , /* k2BloodInput_platelets */ 7.0 * LPFRACTION , /* k2BloodInput_Macrophage */ 0.0 , /* k2BloodOutput_bCellNaive */ 0.0 , /* k2BloodOutput_bCellNaiveRecirculate */ 0.0 , /* k2BloodOutput_thNaive */ 0.0 , /* k2BloodOutput_tcNaive */ 0.0 , /* k2LymphInput_bCellNaiveRecirculate */ 0.0 , /* k2LymphInput_macrophageApc */ 0.0 , /* k2LymphInput_dendriticApc */ 133.0 * 24.0 , /* k2LymphOutput_bCellNaiveRecirculate */ 0.0 , /* k2LymphOutput_tcEffector */ 13.6 * LPFRACTION / 2.0 , /* k2LymphOutput_macrophageApc */ 13.6 * LPFRACTION , /* k2LymphOutput_dendriticApc */ 0.0 , /* k2LymphOutput_thNaive */ 0.0 , /* k2LymphOutput_tcNaive */ 4.0 * 24.0 , /* k2macrophageReplicate */ 4.3 * 24.0 , /* k2dendriticReplicate */ LPFLOWVALUE, /* k2BloodInput_plasmaCell */ 0.0 , /* k2LymphOutput_plasmaCell */ LPFLOWVALUE, /* k2BloodInput_thEffector */ 0.0 , /* k2LymphOutput_thEffectorfector */ 0.0 , /* fdcGerminalCenters */ LPFLOWVALUE, /* k2BloodInput_bCellMemory */ LPFLOWVALUE, /* k2BloodInput_thMemory */ LPFLOWVALUE, /* k2BloodInput_tcMemory */ 0.0, /* k2BloodOutput_bCellMemory */ 0.0, /* k2BloodOutput_thMemory */ 0.0, /* k2BloodOutput_tcMemory */ 4.0 * 24.0, /* k2LymphOutput_bCellMemory */ 4.0 * 24.0, /* k2LymphOutput_thMemory */ 4.0 * 24.0, /* k2LymphOutput_tcMemory */ 0.0, /* k2LymphInput_bCellMemory */ 0.0, /* k2LymphInput_thMemory */ 0.0, /* k2LymphInput_tcMemory */ 3.5e9 * LPFRACTION, /* numberOfmastCell */ 3.4e9 * LPFRACTION, /* numberOfeosinophil */ 0.0, /* k2BloodInput_mastCell */ 0.0, /* k2BloodInput_eosinophil */ }, {"boneMarrow", {0.0 , 0.0 , 0.0 }, /* numberOfBCellsNaive */ {0.0 , 0.0 , 0.0 }, /* numberOfBCellsRecirculate */ {0.0 , 0.0 , 0.0 }, /* numberOfBCellsMarginalZone */ {0.0 , 0.0 , 0.0 }, /* numberOfThCellsNaive */ {0.0 , 0.0 , 0.0 }, /* numberOfTcCellsNaive */ 0.0 , /* numberOfMacrophage */ 0.0 , /* numberOfDendritic */ 0.0 , /* epitheliaCell */ 0.0 , /* k2BloodInput_bCellNaive */ 0.0 , /* k2BloodInput_bCellNaiveRecirculate */ 0.0 , /* k2BloodInput_thNaive */ 0.0, /* k2BloodInput_tcNaive */ 6.9, /* k2BloodInput_tcEffector */ 0.0, /* k2BloodInput_Dendritic */ 0.0, /* k2BloodInput_rbc */ 0.0 , /* k2BloodInput_platelets */ 0.0 , /* k2BloodInput_Macrophage */ 0.0 , /* k2BloodOutput_bCellNaive */ 0.0 , /* k2BloodOutput_bCellNaiveRecirculate */ 0.0 , /* k2BloodOutput_thNaive */ 0.0 , /* k2BloodOutput_tcNaive */ 0.0 , /* k2LymphInput_bCellNaiveRecirculate */ 0.0 , /* k2LymphOutput_bCellNaiveRecirculate */ 0.0 , /* k2LymphOutput_tcEffector */ 0.0 , /* k2LymphOutput_macrophageApc */ 0.0 , /* k2LymphOutput_dendriticApc */ 0.0 , /* k2LymphOutput_thNaive */ 0.0 , /* k2LymphOutput_tcNaive */ 0.0 , /* k2macrophageReplicate */ 0.0 , /* k2dendriticReplicate */ 6.9, /* k2BloodInput_plasmaCell */ 0.0 , /* k2LymphOutput_plasmaCell */ 6.9, /* k2BloodInput_thEffector */ 0.0 , /* k2LymphOutput_thEffectorfector */ 0.0 , /* fdcGerminalCenters */ 0.0, /* k2BloodInput_bCellMemory */ 0.0, /* k2BloodInput_thMemory */ 0.0, /* k2BloodInput_tcMemory */ 0.0, /* k2BloodOutput_bCellMemory */ 0.0, /* k2BloodOutput_thMemory */ 0.0, /* k2BloodOutput_tcMemory */ 0.0, /* k2LymphOutput_bCellMemory */ 0.0, /* k2LymphOutput_thMemory */ 0.0, /* k2LymphOutput_tcMemory */ 0.0, /* k2LymphInput_bCellMemory */ 0.0, /* k2LymphInput_thMemory */ 0.0, /* k2LymphInput_tcMemory */ 0.0, /* numberOfmastCell */ 0.0, /* numberOfeosinophil */ 0.0, /* k2BloodInput_mastCell */ 0.0, /* k2BloodInput_eosinophil */ }, {"lymphJunction", {0.0 , 0.0 , 0.0 }, /* numberOfBCellsNaive */ {0.0 , 0.0 , 0.0 }, /* numberOfBCellsRecirculate */ {0.0 , 0.0 , 0.0 }, /* numberOfBCellsMarginalZone */ {0.0 , 0.0 , 0.0 }, /* numberOfThCellsNaive */ {0.0 , 0.0 , 0.0 }, /* numberOfTcCellsNaive */ 0.0 , /* numberOfMacrophage */ 0.0 , /* numberOfDendritic */ 0.0 , /* epitheliaCell */ 0.0 , /* k2BloodInput_bCellNaive */ 0.0 , /* k2BloodInput_bCellNaiveRecirculate */ 0.0 , /* k2BloodInput_thNaive */ 0.0, /* k2BloodInput_tcNaive */ 0.0, /* k2BloodInput_tcEffector */ 0.0, /* k2BloodInput_Dendritic */ 0.0, /* k2BloodInput_rbc */ 0.0 , /* k2BloodInput_platelets */ 0.0 , /* k2BloodInput_Macrophage */ 0.0 , /* k2BloodOutput_bCellNaive */ 0.0 , /* k2BloodOutput_bCellNaiveRecirculate */ 0.0 , /* k2BloodOutput_thNaive */ 0.0 , /* k2BloodOutput_tcNaive */ 0.0 , /* k2LymphInput_bCellNaiveRecirculate */ 0.0 , /* k2LymphInput_macrophageApc */ 0.0 , /* k2LymphInput_dendriticApc */ 0.0 , /* k2LymphOutput_bCellNaiveRecirculate */ 0.0 , /* k2LymphOutput_tcEffector */ 0.0 , /* k2LymphOutput_macrophageApc */ 0.0 , /* k2LymphOutput_dendriticApc */ 0.0 , /* k2LymphOutput_thNaive */ 0.0 , /* k2LymphOutput_tcNaive */ 0.0 , /* k2macrophageReplicate */ 0.0 , /* k2dendriticReplicate */ 0.0, /* k2BloodInput_plasmaCell */ 0.0 , /* k2LymphOutput_plasmaCell */ 0.0, /* k2BloodInput_thEffector */ 0.0 , /* k2LymphOutput_thEffectorfector */ 0.0 , /* fdcGerminalCenters */ 0.0, /* k2BloodInput_bCellMemory */ 0.0, /* k2BloodInput_thMemory */ 0.0, /* k2BloodInput_tcMemory */ 0.0, /* k2BloodOutput_bCellMemory */ 0.0, /* k2BloodOutput_thMemory */ 0.0, /* k2BloodOutput_tcMemory */ 0.0, /* k2LymphOutput_bCellMemory */ 0.0, /* k2LymphOutput_thMemory */ 0.0, /* k2LymphOutput_tcMemory */ 0.0, /* k2LymphInput_bCellMemory */ 0.0, /* k2LymphInput_thMemory */ 0.0, /* k2LymphInput_tcMemory */ 0.0, /* numberOfmastCell */ 0.0, /* numberOfeosinophil */ 0.0, /* k2BloodInput_mastCell */ 0.01234, /* check point k2BloodInput_eosinophil */ }, }; immuneCellEntry immuneCellData[] = { // (P=plasma,T=total) // initial initial quantity concentration volume quantity which profile // name Concentration profile units units conFact conFact volume style {'R', "igG" ,{ 600.0 , 0.0} ,{{0.0,1.0,0.0},{0.0,1.0,0.0}} , "mg" , "mg/dl" , 1.0e5 , 146.0 , 'P' , '0'} , {'R', "igM" ,{ 40.0 , 0.0} ,{{1.0,0.0,0.0},{1.0,0.0,0.0}} , "mg" , "mg/dl" , 1.0e5 , 970.0 , 'P' , '0'} , {'R', "igA" ,{ 60.0 , 0.0} ,{{0.0,0.0,1.0},{0.0,0.0,1.0}} , "mg" , "mg/dl" , 1.0e5 , 160.0 , 'P' , '0'} , {'R', "bCellNaive" ,{ 403.0 , 403.0 * STRAINFREQUENCY} ,{{1.0,0.0,0.0},{1.0,0.0,0.0}} , "#" , "#/ul" , 1.0 , 1.0 , 'T', 'b'} , {'R', "bCellNaiveRecirculate" ,{ 186.0 , 186.0 * STRAINFREQUENCY} ,{{1.0,0.0,0.0},{1.0,0.0,0.0}} , "#" , "#/ul" , 1.0 , 1.0 , 'T' ,'b'} , {'R', "plasmaCell" ,{ 0.0 , 0.0} ,{{0.0,0.0,0.0},{0.0,0.0,0.0}} , "#" , "#/ul" , 1.0 , 1.0 , 'T' , 'b' } , {'R', "thNaive" ,{1278.0 , 1278.0 * STRAINFREQUENCY} ,{{1.0,0.0,0.0},{1.0,0.0,0.0}} , "#" , "#/ul" , 1.0 , 1.0 , 'T' ,'t'} , {'R', "tcNaive" ,{ 620.0 , 620.0 * STRAINFREQUENCY} ,{{1.0,0.0,0.0},{1.0,0.0,0.0}} , "#" , "#/ul" , 1.0 , 1.0 , 'T' , 't'} , {'R', "thEffector" ,{ 0.0 , 0.0} ,{{0.0,0.0,0.0},{0.0,0.0,0.0}} , "#" , "#/ul" , 1.0 , 1.0 , 'T' , 't'} , {'R', "tcEffector" ,{ 0.0 , 0.0} ,{{0.0,0.0,0.0},{0.0,0.0,0.0}} , "#" , "#/ul" , 1.0 , 1.0 , 'T' , 't' } , {'R', "bCellMemory" ,{ 0.0 , 0.0} ,{{0.0,0.0,0.0},{0.0,0.0,0.0}} , "#" , "#/ul" , 1.0 , 1.0 , 'T' , 't' } , {'R', "thMemory" ,{ 0.0 , 0.0} ,{{0.0,0.0,0.0},{0.0,0.0,0.0}} , "#" , "#/ul" , 1.0 , 1.0 , 'T' , 't' } , {'R', "tcMemory" ,{ 0.0 , 0.0} ,{{0.0,0.0,0.0},{0.0,0.0,0.0}} , "#" , "#/ul" , 1.0 , 1.0 , 'T' , 't' } , {'l', "igG" ,{ 0.0 , 0.0} ,{{0.0,1.0,0.0},{0.0,1.0,0.0}} , "mg" , "mg/dl" , 1.0e5 , 146.0 , 'P' , '0'} , {'l', "igM" ,{ 0.0 , 0.0} ,{{1.0,0.0,0.0},{1.0,0.0,0.0}} , "mg" , "mg/dl" , 1.0e5 , 970.0 , 'P' , '0'} , {'l', "igA" ,{ 0.0 , 0.0} ,{{0.0,0.0,1.0},{0.0,0.0,1.0}} , "mg" , "mg/dl" , 1.0e5 , 160.0 , 'P' , '0'} , {'l', "bCellNaiveRecirculate" ,{1000.0 , 1000.0 * STRAINFREQUENCY} ,{{1.0,0.0,0.0},{1.0,0.0,0.0}} , "#" , "#/ul" , 1.0 , 1.0 , 'T' , 'b'} , {'l', "plasmaCell" ,{ 0.0 , 0.0} ,{{0.0,0.0,0.0},{0.0,0.0,0.0}} , "#" , "#/ul" , 1.0 , 1.0 , 'T' , 'b' } , {'l', "thNaive" ,{6600.0 , 6600.0 * STRAINFREQUENCY} ,{{1.0,0.0,0.0},{1.0,0.0,0.0}} , "#" , "#/ul" , 1.0 , 1.0 , 'T' , 't'} , {'l', "tcNaive" ,{2000.0 , 2000.0 * STRAINFREQUENCY} ,{{1.0,0.0,0.0},{1.0,0.0,0.0}} , "#" , "#/ul" , 1.0 , 1.0 , 'T' , 't'} , {'l', "thEffector" ,{ 0.0 , 0.0} ,{{0.0,0.0,0.0},{0.0,0.0,0.0}} , "#" , "#/ul" , 1.0 , 1.0 , 'T' , 't'} , {'l', "tcEffector" ,{ 0.0 , 0.0} ,{{0.0,0.0,0.0},{0.0,0.0,0.0}} , "#" , "#/ul" , 1.0 , 1.0 , 'T' , 't' } , {'l', "macrophageApc" ,{ 0.0 , 0.0} ,{{0.0,0.0,0.0},{0.0,0.0,0.0}} , "#" , "#/ul" , 1.0 , 1.0 , 'T' , 't'} , {'l', "dendriticApc" ,{ 0.0 , 0.0} ,{{0.0,0.0,0.0},{0.0,0.0,0.0}} , "#" , "#/ul" , 1.0 , 1.0 , 'T' , 't'} , {'l', "bCellMemory" ,{ 0.0 , 0.0} ,{{0.0,0.0,0.0},{0.0,0.0,0.0}} , "#" , "#/ul" , 1.0 , 1.0 , 'T' , 't' } , {'l', "thMemory" ,{ 0.0 , 0.0} ,{{0.0,0.0,0.0},{0.0,0.0,0.0}} , "#" , "#/ul" , 1.0 , 1.0 , 'T' , 't' } , {'l', "tcMemory" ,{ 0.0 , 0.0} ,{{0.0,0.0,0.0},{0.0,0.0,0.0}} , "#" , "#/ul" , 1.0 , 1.0 , 'T' , 't' } , {'a', "igG" ,{ 0.0 , 0.0} ,{{0.0,1.0,0.0},{0.0,1.0,0.0}} , "mg" , "mg/dl" , 1.0e5 , 146.0 , 'P' , '0'} , {'a', "igM" ,{ 0.0 , 0.0} ,{{1.0,0.0,0.0},{1.0,0.0,0.0}} , "mg" , "mg/dl" , 1.0e5 , 970.0 , 'P' , '0'} , {'a', "igA" ,{ 0.0 , 0.0} ,{{0.0,0.0,1.0},{0.0,0.0,1.0}} , "mg" , "mg/dl" , 1.0e5 , 160.0 , 'P' , '0'} , {'a', "bCellNaiveRecirculate" ,{60.0 , 60.0 * STRAINFREQUENCY} ,{{1.0,0.0,0.0},{1.0,0.0,0.0}} , "#" , "#/ul" , 1.0 , 1.0 , 'T' , 'b'} , {'a', "plasmaCell" ,{ 0.0 , 0.0} ,{{0.0,0.0,0.0},{0.0,0.0,0.0}} , "#" , "#/ul" , 1.0 , 1.0 , 'T' , 'b' } , {'a', "thNaive" ,{ 0.0 , 0.0} ,{{0.0,0.0,0.0},{0.0,0.0,0.0}} , "#" , "#/ul" , 1.0 , 1.0 , 'T' , 't'} , {'a', "tcNaive" ,{ 0.0 , 0.0} ,{{0.0,0.0,0.0},{0.0,0.0,0.0}} , "#" , "#/ul" , 1.0 , 1.0 , 'T' , 't'} , {'a', "thEffector" ,{ 0.0 , 0.0} ,{{0.0,0.0,0.0},{0.0,0.0,0.0}} , "#" , "#/ul" , 1.0 , 1.0 , 'T' , 't'} , {'a', "tcEffector" ,{ 0.0 , 0.0} ,{{0.0,0.0,0.0},{0.0,0.0,0.0}} , "#" , "#/ul" , 1.0 , 1.0 , 'T' , 't' } , {'a', "macrophageApc" ,{ 0.0 , 0.0} ,{{0.0,0.0,0.0},{0.0,0.0,0.0}} , "#" , "#/ul" , 1.0 , 1.0 , 'T' , 't'} , {'a', "dendriticApc" ,{ 0.0 , 0.0} ,{{0.0,0.0,0.0},{0.0,0.0,0.0}} , "#" , "#/ul" , 1.0 , 1.0 , 'T' , 't'} , {'a', "bCellMemory" ,{ 0.0 , 0.0} ,{{0.0,0.0,0.0},{0.0,0.0,0.0}} , "#" , "#/ul" , 1.0 , 1.0 , 'T' , 't' } , {'a', "thMemory" ,{ 0.0 , 0.0} ,{{0.0,0.0,0.0},{0.0,0.0,0.0}} , "#" , "#/ul" , 1.0 , 1.0 , 'T' , 't' } , {'a', "tcMemory" ,{ 0.0 , 0.0} ,{{0.0,0.0,0.0},{0.0,0.0,0.0}} , "#" , "#/ul" , 1.0 , 1.0 , 'T' , 't' } , }; substanceEntry substanceData[] = { // (P=plasma,T=total) // initial quantity concentration volume quantity which // name Concentration units units conFact conFact volume auxiliary // kidney {'c', "angiotensin2" , 1.0 , "xg" , "xg/L", 1.0e6 , 1.0 , 'P' ,0 } , // hypothalamus {'c', "trh" , 60.0 , "pg" , "pg/ml", 1.0e3 , 3.62e6 , 'P' ,0 } , {'c', "crh" , 0.1 , "ng" , "ng/ml", 1.0e3 , 4.5e6 , 'P' ,0 } , {'c', "ghrh" , 1.0 , "xg" , "xg/L", 1.0e6 , 1.0 , 'P' ,0 } , {'c', "somatostatin" , 2.0 , "ng" , "ng/dl", 1.0e5 , 1.64e3 , 'P' ,0 } , {'c', "dopamine" , 1.0 , "xg" , "xg/L", 1.0e6 , 1.0 , 'P' ,0 } , // pituitary {'c', "prl" , 10.0 , "ng" , "ng/ml", 1.0e3 , 1.0 , 'P' ,0 } , {'c', "acth" , 50.0 , "pg" , "pg/ml", 1.0e3 , 4.5e9 , 'P' ,0 } , {'c', "vasopressin" , 1.0 , "pg" , "pg/ml", 1.0e3 , 1.0 , 'P' ,0 } , {'c', "growthHormone" , 3.0 , "ng" , "ng/ml", 1.0e3 , 1.0 , 'P' ,0 } , {'c', "tsh" , 1.0 , "uU" , "uU/ml", 1.0e3 , 1.0 , 'P' ,0 } , // thyroid {'c', "t4" , 8.0 , "ug" , "ug/dl", 1.0e5 , 777.0 , 'P' ,0 } , {'c', "t3" , 0.1 , "ug" , "ug/dl", 1.0e5 , 650.0 , 'P' ,0 } , // adrenal {'c', "cortisol" , 10.0 , "ug" , "ug/dl", 1.0e5 , 362.0 , 'P' ,0 } , {'c', "aldosterone" , 6.0 , "ng" , "ng/dl", 1.0e5 , 1.0 , 'P' ,0 } , {'c', "epinephrine" , 34.0 , "pg" , "pg/ml", 1.0e3 , 183.0e6 , 'P' ,0 } , {'c', "norepinephrine" , 228.0 , "pg" , "pg/ml", 1.0e3 , 1.0 , 'P' ,0 } , // liver {'c', "igf1" , 300.0 , "ug" , "ug/L", 1.0e6 , 1.0 , 'P' ,0 } , // pancreas {'c', "insulin" , 11.6 , "uU" , "uU/ml", 1.0e3 , 1.449e8 , 'P' ,0 } , {'c', "glucagon" , 72.0 , "pg" , "pg/ml", 1.0e3 , 3.485e9 , 'P' ,0 } , // small intestine, stomach {'c', "gastrin" , 50.0 , "pg" , "pg/ml", 1.0e3 , 2.1e9 , 'P' ,0 } , {'c', "cck" , 3.9 , "ng" , "ng/ml", 1.0e3 , 3.9e9 , 'P' ,0 } , {'c', "secretin" , 8.0 , "pg" , "pg/ml", 1.0e3 , 3.0e9 , 'P' ,0 } , {'c', "gip" , 250.0 , "pg" , "pg/ml", 1.0e3 , 5.0e9 , 'P' ,0 } , // nutrients, etc. {'c', "oxygen" , 8900.0 , "uMol" , "uMol/L", 1.0e6 , 1.0 , 'T' ,0 } , {'c', "CO2" , 48000.0 , "uMol" , "uMol/L", 1.0e6 , 1.0 , 'T' ,0 } , {'c', "Na" , 144.0 , "mEq" , "mEq/L", 1.0e6 , 1.0e-3 , 'P' ,0 } , {'c', "potassium" , 4.5 , "mEq" , "mEq/L", 1.0e6 , 1.0e-3 , 'P' ,0 } , {'c', "iodine" , 0.6 , "ug" , "ug/dl", 1.0e5 , 127.0 , 'P' ,0 } , {'c', "monocyte" , 47.0 , "#" , "#/ul" , 1.0 , 1.0 , 'T' , 0 } , {'c', "eosinophil" , 203.0 , "#" , "#/ul" , 1.0 , 1.0 , 'T' , 0 } , {'c', "mastCell" , 0.6 , "#" , "#/ul" , 1.0 , 1.0 , 'T' , 0 } , {'c', "platelets" , 250.0e3 , "#" , "#/ul" , 1.0 , 1.0 , 'T' , 0 } , {'c', "rbc" , 5.0e6 , "#" , "#/ul" , 1.0 , 1.0 , 'T' , 0 } , {'c', "gmcsf" , 0.0 , "ng" , "ng/ml", 1.0e3 , 5.0e7 , 'P' ,0 } , {'c', "il3" , 0.0 , "ng" , "ng/ml", 1.0e3 , 1.8e7 , 'P' ,0 } , {'c', "il5" , 0.0 , "ng" , "ng/ml", 1.0e3 , 3.0e7 , 'P' ,0 } , // {'c', "glucose" , 56.0 , "mg" , "mg/dl", 1.0e5 , 0.18 , 'P' ,0 } , {'c', "glucose" , 90.0 , "mg" , "mg/dl", 1.0e5 , 0.18 , 'P' ,0 } , {'c', "aminoAcids" , 40.0 , "mg" , "mg/dl", 1.0e5 , 0.115 , 'P' ,0 } , {'c', "ketones" , 0.3 , "mg" , "mg/dl", 1.0e5 , 0.1 , 'P' ,0 } , {'c', "lactate" , 9.0 , "mg" , "mg/dl", 1.0e5 , 9.0e-2 , 'P' ,0 } , {'c', "glycerol" , 50.0 , "uMol" , "uMol/L", 1.0e6 , 1.0 , 'P' ,0 } , {'c', "fattyAcids" , 5.7 , "mg" , "mg/dl", 1.0e5 , .256 , 'P' ,0 } , {'c', "vldl" , 15.0 , "mg" , "mg/dl", 1.0e5 , 7.5e3 , 'P' ,0 } , {'c', "ldl" , 120.0 , "mg" , "mg/dl", 1.0e5 , 2.8e3 , 'P' ,0 } , {'c', "hdl" , 50.0 , "mg" , "mg/dl", 1.0e5 , 200.0 , 'P' ,0 } , {'c', "idl" , 4.1 , "mg" , "mg/dl", 1.0e5 , 3.7e3 , 'P' ,0 } , {'c', "chylomicrons" , 0.0 , "mg" , "mg/dl", 1.0e5 , 400.0e3 , 'P' ,0 } , {'c', "chylomicronRemnant" , 0.0 , "mg" , "mg/dl", 1.0e5 , 1.36e5 , 'P' ,0 } , {'c', "ammonia" , 30.0 , "ug" , "ug/dl", 1.0e5 , 1.0 , 'P' ,0 } , // {'c', "acetoaceticAcid" , 10.0 , "mg" , "mg/dl", 1.0e5 , 1.0 , 'P' ,0 } , {'c', "urea" , 34.0 , "mg" , "mg/dl", 1.0e5 , 1.0 , 'P' ,0 } , {'c', "plasmaProteins" , 7.3 , "g" , "g/dl", 1.0e5 , 4.4e-2 , 'P' ,0 } , {'c', "bilirubin" , 0.5 , "mg" , "mg/dl", 1.0e5 , 1.0 , 'P' ,0 } , {'c', "bileSalts" , 0.05 , "mg" , "mg/dl", 1.0e5 , 4.0e-4 , 'P' ,0 } , {'d', "proteinSolid" , 0.0 , "g" , "g/dl", 1.0e5 , 1.15e-2 , 'T' ,0 } , {'d', "proteinChyme" , 0.0 , "g" , "g/dl", 1.0e5 , 1.15e-2 , 'T' ,0 } , {'d', "carbohydrates" , 0.0 , "g" , "g/dl", 1.0e5 , 1.8e-2 , 'T' ,0 } , {'d', "fats" , 0.0 , "g" , "g/dl", 1.0e5 , 1.0 , 'T' ,0 } , {'d', "peptides" , 0.0 , "g" , "g/dl", 1.0e5 , 1.15e-3, 'T' ,0 } , {'d', "aminoAcids" , 0.0 , "mg" , "mg/dl", 1.0e5 , 0.115 , 'T' ,0 } , {'d', "triglycerides" , 0.0 , "g" , "g/dl", 1.0e5 , 8.3e-4 , 'T' ,0 } , {'d', "aminopeptidase" , 0.0 , "kunits" , "kunits/ml", 1.0e3 , 1.0 , 'T' ,0 } , {'d', "pepsin" , 0.0 , "kunits" , "kunits/ml", 1.0e3 , 1.0 , 'T' ,0 } , {'d', "bicarbonate" , 0.0 , "mEq" , "mEq/L", 1.0e6 , 1.0e-3 , 'T' ,0 } , {'d', "bilirubin" , 0.0 , "g" , "g/dl", 1.0e5 , 1.0 , 'T' ,0 } , {'d', "trypsin" , 0.0 , "kunits" , "kunits/ml", 1.0e3 , 1.0 , 'T' ,0 } , {'d', "chymotrypsin" , 0.0 , "kunits" , "kunits/ml", 1.0e3 , 1.0 , 'T' ,0 } , {'d', "carboxypeptidase" , 0.0 , "kunits" , "kunits/ml", 1.0e3 , 1.0 , 'T' ,0 } , {'d', "lipase" , 0.0 , "kunits" , "kunits/ml", 1.0e3 , 1.0 , 'T' ,0 } , {'d', "amylase" , 0.0 , "kunits" , "kunits/ml", 1.0e3 , 1.0 , 'T' ,0 } , {'d', "cholesterol" , 0.0 , "g" , "g/dl", 1.0e5 , 1.0 , 'T' ,0 } , {'d', "fattyAcids" , 0.0 , "g" , "g/dl", 1.0e5 , 1.0 , 'T' ,0 } , {'d', "bileSalts" , 0.0 , "g" , "g/dl", 1.0e5 , 4.0e-4 , 'T' ,0 } , {'d', "hcl" , 0.0 , "mEq" , "mEq/L", 1.0e6 , 1.0e-3 , 'T' ,0 } , {'b', "bicarbonate" , 20.0 , "mEq" , "mEq/L", 1.0e6 , 1.0e-3 , 'T' ,0 } , {'b', "bilirubin" , 0.0 , "g" , "g/dl", 1.0e5 , 1.0 , 'T' ,0 } , {'b', "trypsin" , 0.0 , "kunits" , "kunits/ml", 1.0e3 , 1.0 , 'T' ,0 } , {'b', "chymotrypsin" , 0.0 , "kunits" , "kunits/ml", 1.0e3 , 1.0 , 'T' ,0 } , {'b', "carboxypeptidase" , 0.0 , "kunits" , "kunits/ml", 1.0e3 , 1.0 , 'T' ,0 } , {'b', "lipase" , 0.0 , "kunits" , "kunits/ml", 1.0e3 , 1.0 , 'T' ,0 } , {'b', "amylase" , 0.0 , "kunits" , "kunits/ml", 1.0e3 , 1.0 , 'T' ,0 } , {'b', "cholesterol" , 1.0 /* ? */ , "g" , "g/dl", 1.0e5 , 3.85e-4 , 'T' ,0 } , {'b', "fattyAcids" , 0.0 , "g" , "g/dl", 1.0e5 , 1.0 , 'T' ,0 } , {'b', "bileSalts" , 1.5 , "g" , "g/dl", 1.0e5 , 4.0e-4 , 'T' ,0 } , {'l', "chylomicrons" , 0.0 , "mg" , "mg/dl", 1.0e5 , 400e3 , 'P' ,0 } , {'r', "glucose" , 90.0 , "mg" , "mg/dl", 1.0e5 , 0.18 , 'P' ,0 } , {'r', "t4" , 8.0 , "ug" , "ug/dl", 1.0e5 , 777.0 , 'P' ,0 } , {'r', "t3" , 0.1 , "ug" , "ug/dl", 1.0e5 , 650.0 , 'P' ,0 } , }; vesselEntry vesselData[] = { /* mm3/msec mm3/msec mm3 mm3 */ /* flowOut flowIn TotVolume PlasmaVol quantity length pressure previous next */ {'c', "pulmonaryCapillary", 82.5, -1.0, 864000.0, 475200.0, 7161241700.0, 0.31, 6.97, "venaCava", "aorta"}, {'c', "venaCava", 82.5, -1.0, 3432792.0, 1888036.0, 1.0, 550.00, 1.02, "genericCapillary", "pulmonaryCapillary"}, {'c', "aorta", 28.3, -1.0, 702000.0, 386100.0, 1.0, 550.00, 99.53, "pulmonaryCapillary", "genericCapillary"}, {'c', "cerebralCapillary", 12.49, 12.5, 55621.0, 30592.0, 2785211504.0, 1.00, 12.02, "aorta", "venaCava"}, {'c', "hypophysealPortalVein", 0.01, 0.01, 118.0, 65.0, 11.0, 20.00, 21.73, "cerebralCapillary", "venaCava"}, {'c', "hepaticSinusoid", 21.7, 4.2, 105458.0, 58002.0, 596831037.0, 2.07, 1.86, "aorta", "venaCava"}, {'c', "portalVein", 17.5, 15.0, 23090.0, 12700.0, 1.0, 150.00, 8.95, "aorta", "hepaticSinusoid"}, {'c', "splenicCapillary", 2.5, 2.5, 6075.0, 3341.0, 596831037.0, 0.81, 15.81, "aorta", "portalVein"}, {'c', "glomularCapillary", 20.0, 20.0, 88994.0, 40047.0, 273547558.0, 1.00, 59.55, "aorta", "venaCava"}, {'c', "genericCapillary", 28.3, -1.0, 119852.0, 65919.0, 1.0, 114.0, 15.51, "aorta", "venaCava"}, {'R', "bloodReservoir", -1.0, -1.0, 5400000.0, 2970000.0, 1.0, 1.0, 15.51, "_end", "_end"}, {'d', "sigmoidColon", 0.10, -1.0, 3.8e6, 3.8e6, 1.0, 300.00, 0.01,"descendingColon","_end"}, {'d', "descendingColon", 0.1, -1.0, 3.8e6, 3.8e6, 1.0, 300.00, 0.01,"transverseColon","sigmoidColon"}, {'d', "transverseColon", 0.1, -1.0, 3.8e6, 3.8e6, 1.0, 300.00, 0.01,"ascendingColon","descendingColon"}, {'d', "ascendingColon", 0.1, -1.0, 3.8e6, 3.8e6, 1.0, 300.00, 0.01,"ileum","transverseColon"}, {'d', "ileum", 0.2, -1.0, 4.2e6, 4.2e6, 1.0, 920.00, 0.01,"jejunum","ascendingColon"}, {'d', "jejunum", 0.2, -1.0, 4.2e6, 4.2e6, 1.0, 920.00, 0.01,"duodenum","ileum"}, {'d', "duodenum", 0.2, -1.0, 4.2e6, 4.2e6, 1.0, 920.00, 0.01,"stomach","jejunum"}, {'d', "stomach", 15.4, -1.0, 1.0e6, 1.0e6, 1.0, 100.00, 0.01,"esophagus","duodenum"}, {'d', "esophagus", 1500.0, -1.0, 1.0e6, 1.0e6, 1.0, 230.00, 0.01,"_end","stomach"}, {'b', "commonBileDuct", 58.3 , -1.0, 10.0e4, 10.0e4, 1.0, 100.00, 0.01,"commonHepaticDuct","_end"}, {'b', "commonHepaticDuct", 58.3 , -1.0, 5.0e4, 5.0e4, 1.0, 100.00, 0.01,"_end","commonBileDuct"}, {'b', "pancreaticDuct", 58.3 , -1.0, 5.0e4, 5.0e4, 1.0, 100.00, 0.01,"_end","commonBileDuct"}, {'l', "thoracicDuct5", 0.0347, -1.0, 2.0e5, 2.0e5, 1.0, 100.00, 0.01, "thoracicDuct4","_end"}, {'l', "thoracicDuct4", 4.167e4, -1.0, 1.0e5, 1.0e5, 1.0, 100.00, 0.01, "thoracicDuct3","thoracicDuct5"}, {'l', "thoracicDuct3", 4.167e4, -1.0, 1.0e5, 1.0e5, 1.0, 100.00, 0.01, "thoracicDuct2","thoracicDuct4"}, {'l', "thoracicDuct2", 4.167e4, -1.0, 1.0e5, 1.0e5, 1.0, 100.00, 0.01, "thoracicDuct1","thoracicDuct3"}, {'l', "thoracicDuct1", 4.167e4, -1.0, 1.0e5, 1.0e5, 1.0, 100.00, 0.01, "lymphaticVein","thoracicDuct2"}, {'a', "hepaticAfferent", -1.0, -1.0, 33000, 33000, 1.0, 100.00, 0.01, "_end","_end"}, {'a', "subcutaneousAfferent", -1.0, -1.0, 440000, 440000, 1.0, 100.00, 0.01, "_end","_end"}, {'a', "miscellaneousAfferent", -1.0, -1.0, 160000, 160000, 1.0, 100.00, 0.01, "_end","_end"}, {'a', "mediastinalAfferent", -1.0, -1.0, 200000, 200000, 1.0, 100.00, 0.01, "_end","_end"}, {'a', "mediastinalAfferentTest", -1.0, -1.0, 1500, 1500, 1.0, 100.00, 0.01, "_end","_end"}, {'a', "mesentericAfferent", -1.0, -1.0, 260000, 260000, 1.0, 100.00, 0.01, "_end","_end"}, {'a', "mesentericAfferentTest", -1.0, -1.0, 2600, 2600, 1.0, 100.00, 0.01, "_end","_end"}, {'r', "interstitialReservoir", -1.0, -1.0, 11.5e6, 11.5e6, 1.0, 100.00, 0.01, "_end","_end"}, }; /* end physiological data */ #define NUMBEROFTISSUECONSTANTS (sizeof(tissueConstants) / sizeof(tissueConstant)) #define TOTALSUBSTANCES (sizeof(substanceData) / sizeof(substanceEntry)) #define TOTALIMMUNECELLS (sizeof(immuneCellData) / sizeof(immuneCellEntry)) #define NUMBEROFVESSELS (sizeof(vesselData) / sizeof(vesselEntry)) #define INDEX_END (-1) Nerve smallIntestineNerve; int VesselSegment::vesselIndex = 0 ; void VesselSegment::HelpPrint () { int i; char ch; for (i = 0; i < TOTALSUBSTANCES; i++) { ch = substanceData[i].type ; switch (ch) { case 'c': printf(" static int blood_%s = printCapillary->FindSubstanceIndex(\"%s\") ;\n",substanceData[i].name,substanceData[i].name); break; case 'R': printf(" static int reservoir_%s = printReservoir->FindSubstanceIndex(\"%s\") ;\n",substanceData[i].name,substanceData[i].name); break; case 'l': printf(" static int lymph_%s = printEfferent->FindSubstanceIndex(\"%s\") ;\n",substanceData[i].name,substanceData[i].name); break; case 'a': printf(" static int afferent_%s = printAfferent->FindSubstanceIndex(\"%s\") ;\n",substanceData[i].name,substanceData[i].name); break; default: break; } /* switch */ } /* forLoop */ for (i = 0; i < TOTALSUBSTANCES; i++) { ch = substanceData[i].type ; switch (ch) { case 'c': printf(" printCapillary->PrintSubstance(blood_%s, 'c');\n",substanceData[i].name); break; case 'R': printf(" printReservoir->PrintSubstance(reservoir_%s, 'c');\n",substanceData[i].name); break; case 'l': printf(" printEfferent->PrintSubstance(lymph_%s, 'c');\n",substanceData[i].name); break; case 'a': printf(" printAfferent->PrintSubstance(afferent_%s, 'c');\n",substanceData[i].name); break; default: break; } /* switch */ } /* forLoop */ exit(1); } VesselSegment::VesselSegment () { int i,j ; char ch ; static int currentType = 0 ; static int currentNumberOfSubstances = 0 ; static substanceEntry *currentBase = 0; static int currentNumberOfImmuneCells = 0 ; static immuneCellEntry *currentImmuneBase = 0 ; double immuneQuantity[TOTALSTRAINS]; ch = vesselData[vesselIndex].type ; plasmaVolume = vesselData[vesselIndex].plasmaVolume; totalVolume = vesselData[vesselIndex].totalVolume; name = vesselData[vesselIndex].name; previousSegment = INDEX_END ; nextSegment = INDEX_END ; for (i = 0; i < NUMBEROFVESSELS; i++) { if (i == vesselIndex) { continue; } /* if */ if (ch == vesselData[i].type) { if (strcmp(vesselData[i].name, vesselData[vesselIndex].previousName) == 0) { previousSegment = i; } /* if */ if (strcmp(vesselData[i].name, vesselData[vesselIndex].nextName) == 0) { nextSegment = i; } /* if */ } /* if */ } /* forLoop */ if (ch != currentType) { currentNumberOfSubstances = 0 ; currentBase = 0; for (i = 0; i < TOTALSUBSTANCES; i++) { if (substanceData[i].type == ch) { currentBase = substanceData + i; for ( ; i < TOTALSUBSTANCES; i++) { if (substanceData[i].type != ch) { break; } /* if */ currentNumberOfSubstances++; } /* forLoop */ break; } /* if */ } /* forLoop */ if (currentBase == 0) { printf("Initializesubstances: can't find type: %c (%s)\n",ch,name); // exit(1); currentBase = substanceData ; } /* if */ currentNumberOfImmuneCells = 0 ; currentImmuneBase = 0; for (i = 0; i < TOTALIMMUNECELLS; i++) { if (immuneCellData[i].type == ch) { currentImmuneBase = immuneCellData + i; for ( ; i < TOTALIMMUNECELLS; i++) { if (immuneCellData[i].type != ch) { break; } /* if */ currentNumberOfImmuneCells++; } /* forLoop */ break; } /* if */ } /* forLoop */ if (currentImmuneBase == 0) { printf("initializeimmuneCells: can't find type: %c (%s)\n",ch,name); // exit(1); currentImmuneBase = immuneCellData; } /* if */ currentType = ch ; } /* if */ numberOfSubstances = currentNumberOfSubstances ; substanceBase = currentBase; substanceQuantity = new double [numberOfSubstances]; dSubstanceQuantity = new double [numberOfSubstances]; transferFlag = 0.0; for (i = 0; i < numberOfSubstances; i++) { dSubstanceQuantity[i] = 0.0 ; substanceQuantity[i] = Concentration2Umoles(substanceBase[i].initialConcentration,i); } /* forLoop */ numberOfImmuneCells = currentNumberOfImmuneCells ; immuneCellBase = currentImmuneBase; immuneCells = new GenericImmuneCell [numberOfImmuneCells]; for (i = 0; i < numberOfImmuneCells; i++) { for (j = 0; j < TOTALSTRAINS; j++) { immuneQuantity[j] = ImmuneConcentration2Umoles(immuneCellBase[i].initialConcentration[j], i); } /* jForLoop */ immuneCells[i].ResetImmuneCell(immuneQuantity, immuneCellBase[i].initialProfile, immuneCellBase[i].name, name); } /* forLoop */ vesselIndex++; } VesselSegment *VesselSegment::FindVessel (char *s) { int i; char ch; ch = *s ; s += 2; for (i = 0; i < NUMBEROFVESSELS; i++) { if (ch == vesselData[i].type) { if (strcmp(vesselData[i].name, s) == 0) { return(this + i) ; } /* if */ } /* if */ } /* forLoop */ printf("FindVessel: cannot find:(ch:%c) (s:%s)\n",ch,s); exit(1); return(0) ; } int VesselSegment::FindSubstanceIndex (char *s) { int i; for (i = 0; i < numberOfSubstances; i++) { if (strcmp(substanceBase[i].name, s) == 0) { return(i) ; } /* if */ } /* forLoop */ printf("FindSubstanceindex: cannot find: (Substance:%s),substanceBase[0]:%s, Vessel:%s\n",s,substanceBase[0].name,name); exit(1); return(0) ; } double &VesselSegment::FindSubstance (char *s,char flag) { int substanceIndex ; substanceIndex = FindSubstanceIndex(s) ; return(substanceQuantity[substanceIndex]) ; } int VesselSegment::FindImmuneCellIndex (char *s) { int i; for (i = 0; i < numberOfImmuneCells; i++) { if (strcmp(immuneCells[i].ReadName(), s) == 0) { return(i) ; } /* if */ } /* forLoop */ printf("FindImmuneCellIndex: cannot find: (immune cell:%s),immuneCellBase[0]:%s, Vessel:%s\n",s,immuneCellBase[0].name,name); exit(1); return(0) ; } GenericImmuneCell &VesselSegment::FindImmuneCell (char *s) { int index ; index = FindImmuneCellIndex(s) ; return(immuneCells[index]) ; } int VesselSegment::ConnectJunctions (double dTime) { double x1; int pointer1 ; int index1; int numberOfBloodVessels = 0; VesselSegment *vessels = this; for (index1 = 0; index1 < NUMBEROFVESSELS; index1++) { if ((vessels[index1].nextSegment < 0) && (vessels[index1].previousSegment < 0)) { printf("WARNING: weird segment: %s input and output both turned off\n",vesselData[index1].name); continue; // exit(1); } /* if */ if (vesselData[index1].type == 'c') { numberOfBloodVessels++; x1 = dTime * vesselData[index1].flowOut / vesselData[index1].totalVolume ; } /* if */ else { x1 = vesselData[index1].flowOut / vesselData[index1].totalVolume ; } /* else */ if (x1 >= .99) { // printf("bad time constant out: %s %g\n",vesselData[index1].name,x1); x1 = .99; } /* if */ vessels[index1].timeConstantValueOut = x1; x1 = vesselData[index1].flowIn ; if (x1 < 0) { /* not a junction */ vessels[index1].previousSegment = INDEX_END ; } /* if */ else { pointer1 = vessels[index1].previousSegment; if (pointer1 < 0) { printf("ERROR: invalid junction: no 'previous segment' but FlowIn > 0: %s\n",vesselData[index1].name); exit(1); } /* if */ x1 *= dTime / vesselData[pointer1].totalVolume ; if (x1 >= .99) { // printf("bad time constant in: %s %g\n",vesselData[index1].name,x1); x1 = .99; } /* if */ vessels[index1].timeConstantValueIn = x1; } /* else */ } /* forLoop */ return(numberOfBloodVessels) ; } void VesselSegment::CalculateFlows (int numberOfBloodVessels) { int pointer1 ; double timeConstantValueIn,timeConstantValueOut,temp1; int i; int index1; VesselSegment *vessels = this ; substanceEntry *substanceBase; int numberOfSubstances, numberOfImmuneCells ; VesselSegment *destination; double *quantityPointer ; double *dQuantityPointer; for (index1 = 0; index1 < numberOfBloodVessels; index1++) { pointer1 = vessels[index1].previousSegment; if (pointer1 >= 0) { substanceBase = vessels[index1].substanceBase; timeConstantValueIn = vessels[index1].timeConstantValueIn; numberOfSubstances = vessels[index1].numberOfSubstances; for (i = 0; i < numberOfSubstances; i++) { temp1 = vessels[pointer1].substanceQuantity[i] * timeConstantValueIn ; vessels[pointer1].dSubstanceQuantity[i] -= temp1; vessels[index1].dSubstanceQuantity[i] += temp1; // printf("p:temp1:%g from:%s[%s]:%g to:%s[%s]:%g\n",temp1,vesselData[pointer1].name,vessels[pointer1].substanceBase[i].name,vessels[pointer1].dSubstanceQuantity[i],vesselData[index1].name,vessels[index1].substanceBase[i].name,vessels[index1].dSubstanceQuantity[i]); } /* forLoop */ } /* if */ pointer1 = vessels[index1].nextSegment; if (pointer1 >= 0) { substanceBase = vessels[index1].substanceBase; timeConstantValueOut = vessels[index1].timeConstantValueOut; numberOfSubstances = vessels[index1].numberOfSubstances; for (i = 0; i < numberOfSubstances; i++) { temp1 = timeConstantValueOut * vessels[index1].substanceQuantity[i] ; vessels[pointer1].dSubstanceQuantity[i] += temp1; vessels[index1].dSubstanceQuantity[i] -= temp1; // printf("n:temp1:%g from:%s[%s]:%g to:%s[%s]:%g\n",temp1,vesselData[pointer1].name,vessels[pointer1].substanceBase[i].name,vessels[pointer1].dSubstanceQuantity[i],vesselData[index1].name,vessels[index1].substanceBase[i].name,vessels[index1].dSubstanceQuantity[i]); } /* forLoop */ } /* if */ } for (index1 = 0; index1 < numberOfBloodVessels; index1++) { destination = vessels + index1; numberOfSubstances = destination->numberOfSubstances; quantityPointer = destination->substanceQuantity; dQuantityPointer = destination->dSubstanceQuantity; for (i = 0; i < numberOfSubstances; i++,quantityPointer++,dQuantityPointer++) { *quantityPointer += *dQuantityPointer; #if 1 if (*quantityPointer < 0.0) { printf("ERROR Substance<0: %s[%s] %g (dquantity:%g)\n",vesselData[index1].name,destination->substanceBase[i].name, *quantityPointer, *dQuantityPointer); exit(1); } /* if */ #endif *dQuantityPointer = 0.0; } /* forLoop */ } for (index1 = numberOfBloodVessels; index1 < NUMBEROFVESSELS; index1++) { if (vessels[index1].transferFlag >= 1.0) { // printf("transfer name:%s\n",vessels[index1].name); pointer1 = vessels[index1].nextSegment; if (pointer1 >= 0) { timeConstantValueOut = vessels[index1].timeConstantValueOut; numberOfSubstances = vessels[index1].numberOfSubstances; for (i = 0; i < numberOfSubstances; i++) { /* assumes vessels properly sorted */ temp1 = timeConstantValueOut * vessels[index1].substanceQuantity[i] ; vessels[pointer1].substanceQuantity[i] += temp1; vessels[index1].substanceQuantity[i] -= temp1; } /* forLoop */ numberOfImmuneCells = vessels[index1].numberOfImmuneCells; for (i = 0; i < numberOfImmuneCells; i++) { /* assumes vessels properly sorted */ vessels[index1].immuneCells[i].MigrateOutputWithProfile(vessels[pointer1].immuneCells[i],timeConstantValueOut); } /* forLoop */ } /* if */ vessels[index1].transferFlag = 0; } /* if */ } } void VesselSegment::Snapshot () { int i, j ; VesselSegment *vessels = this; double x1,volume; printf("Snapshot:VesselSegment\n"); for (i = 0; i < NUMBEROFVESSELS; i++) { printf("%s: transferFlag:%g, numberOfSubstances:%d\n",vessels[i].name,vessels[i].transferFlag,vessels[i].numberOfSubstances); for (j = 0; j < vessels[i].numberOfSubstances; j++) { volume = vessels[i].ReadVolume(vessels[i].substanceBase[j].whichVolume); x1 = vessels[i].substanceQuantity[j] * vessels[i].substanceBase[j].quantityConversionFactor * vessels[i].substanceBase[j].volumeConversionFactor / volume; printf(" %s: (q:%g [%g %s] dQ:%g)",vessels[i].substanceBase[j].name,vessels[i].substanceQuantity[j],x1,vessels[i].substanceBase[j].concentrationUnits,vessels[i].dSubstanceQuantity[j]); printf("\n"); } /* forLoop */ for (j = 0; j < vessels[i].numberOfImmuneCells; j++) { immuneCells[i].Snapshot() ; } /* forLoop */ } /* forLoop */ printf("\n"); } void VesselSegment::PrintSubstance (int substanceIndex, char type) { double x1,volume; volume = ReadVolume(substanceBase[substanceIndex].whichVolume); x1 = substanceQuantity[substanceIndex] * substanceBase[substanceIndex].quantityConversionFactor; #if PLOTFLAG switch (type) { case 'c': /* concentration */ printf("%s.%s: %g\n",name,substanceBase[substanceIndex].name,x1 * substanceBase[substanceIndex].volumeConversionFactor / volume); break; case 'q': /* quantity */ printf("%s.%s: %g\n",name,substanceBase[substanceIndex].name,x1); break; case 'm': /* quantity in umoles */ printf("%s.%s: %g\n",name,substanceBase[substanceIndex].name,substanceQuantity[substanceIndex]); break; default: break; } /* switch */ #else // printf(" %s: %s: %g %s (%g %s, %g umoles)\n",name,substanceBase[substanceIndex].name,x1 * substanceBase[substanceIndex].volumeConversionFactor / volume,substanceBase[substanceIndex].concentrationUnits,x1,substanceBase[substanceIndex].quantityUnits,substanceQuantity[substanceIndex] ); printf(" %s: %s: %g %s (%g umoles/mm3, %g umoles)\n",name,substanceBase[substanceIndex].name,x1 * substanceBase[substanceIndex].volumeConversionFactor / volume,substanceBase[substanceIndex].concentrationUnits,substanceQuantity[substanceIndex] / volume,substanceQuantity[substanceIndex] ); #endif } void VesselSegment::PrintImmuneCell (char *s, int index, int strainIndex, int profileIndex, char type) { double x2,volume; volume = ReadVolume(immuneCellBase[index].whichVolume); #if PLOTFLAG switch (type) { case 't': /* total */ x2 = immuneCells[index].ReadTotal(); printf("%s.%s.%s: %g\n",name,immuneCells[index].ReadName(),s,x2 * immuneCellBase[index].quantityConversionFactor * immuneCellBase[index].volumeConversionFactor / volume); break; case 'p': /* with profile */ x2 = immuneCells[index].ReadValueWithProfile(strainIndex,profileIndex); printf("%s.%s.%s: %g\n",name,immuneCells[index].ReadName(),s,x2 * immuneCellBase[index].quantityConversionFactor * immuneCellBase[index].volumeConversionFactor / volume); break; default: break; } /* switch */ #else x2 = immuneCells[index].ReadValueWithProfile(strainIndex,profileIndex); // printf("x2 :%g %g strainIndex:%d profileIndex:%d\n",x2,immuneCells[index].ReadValue(strainIndex),strainIndex,profileIndex); immuneCells[index].Snapshot() ; /* for now */ printf(" %s: %s: %s: %g %s (%g umoles/mm3, %g umoles)\n",name,immuneCells[index].ReadName(),s, x2 * immuneCellBase[index].quantityConversionFactor * immuneCellBase[index].volumeConversionFactor / volume,immuneCellBase[index].concentrationUnits, x2 / volume, x2 ); #endif } void GenericBody::PrintSubstances (double temp2) { // static VesselSegment *printCapillary = vessels->FindVessel("c.hepaticSinusoid") ; static VesselSegment *printCapillary = vessels->FindVessel("c.genericCapillary") ; static VesselSegment *printReservoir = vessels->FindVessel("R.bloodReservoir") ; static VesselSegment *printEfferent = vessels->FindVessel("l.thoracicDuct5") ; static VesselSegment *printEfferent1 = vessels->FindVessel("l.thoracicDuct1") ; static VesselSegment *printEfferent2 = vessels->FindVessel("l.thoracicDuct2") ; static VesselSegment *printEfferent3 = vessels->FindVessel("l.thoracicDuct3") ; static VesselSegment *printEfferent4 = vessels->FindVessel("l.thoracicDuct4") ; static VesselSegment *printAfferent = vessels->FindVessel("a.mediastinalAfferentTest") ; // static VesselSegment *printCapillary = vessels->FindVessel("c.venaCava") ; // static VesselSegment *printCapillary = vessels->FindVessel("c.aorta") ; // static VesselSegment *printCapillary = vessels->FindVessel("c.cerebralCapillary") ; // static VesselSegment *genericCapillary = vessels->FindVessel("c.genericCapillary") ; // static VesselSegment *pituitaryPortal = vessels->FindVessel("c.hypophysealPortalVein") ; static VesselSegment *glomularCapillary = vessels->FindVessel("c.glomularCapillary") ; static VesselSegment *hepaticSinusoid = vessels->FindVessel("c.hepaticSinusoid") ; static VesselSegment *venaCava = vessels->FindVessel("c.venaCava") ; static VesselSegment *aorta = vessels->FindVessel("c.aorta") ; static VesselSegment *cerebralCapillary = vessels->FindVessel("c.cerebralCapillary") ; static VesselSegment *pulmonaryCapillary = vessels->FindVessel("c.pulmonaryCapillary") ; static VesselSegment *portalVein = vessels->FindVessel("c.portalVein") ; static VesselSegment *splenicCapillary = vessels->FindVessel("c.splenicCapillary") ; static VesselSegment *thoracicDuct3 = vessels->FindVessel("l.thoracicDuct3") ; static VesselSegment *thoracicDuct2 = vessels->FindVessel("l.thoracicDuct2") ; static VesselSegment *thoracicDuct1 = vessels->FindVessel("l.thoracicDuct1") ; static VesselSegment *commonBileDuct = vessels->FindVessel("b.commonBileDuct") ; static VesselSegment *pancreaticDuct = vessels->FindVessel("b.pancreaticDuct") ; static VesselSegment *stomach = vessels->FindVessel("d.stomach") ; static VesselSegment *smallIntestine = vessels->FindVessel("d.duodenum") ; static VesselSegment *esophagus = vessels->FindVessel("d.esophagus") ; static int reservoir_bCellNaive = printReservoir->FindImmuneCellIndex("bCellNaive") ; static int reservoir_plasmaCell = printReservoir->FindImmuneCellIndex("plasmaCell") ; static int reservoir_igM = printReservoir->FindImmuneCellIndex("igM") ; static int reservoir_tcEffector = printReservoir->FindImmuneCellIndex("tcEffector") ; static int lymphOutput_plasmaCell = printEfferent->FindImmuneCellIndex("plasmaCell") ; static int monocyte = printCapillary->FindSubstanceIndex("monocyte") ; static int gmcsf = printCapillary->FindSubstanceIndex("gmcsf") ; static int il3 = printCapillary->FindSubstanceIndex("il3") ; static int il5 = printCapillary->FindSubstanceIndex("il5") ; static int reservoir_bCellMemory = printReservoir->FindImmuneCellIndex("bCellMemory") ; static int reservoir_thMemory = printReservoir->FindImmuneCellIndex("thMemory") ; static int reservoir_tcMemory = printReservoir->FindImmuneCellIndex("tcMemory") ; static int lymphOutput_bCellMemory = printEfferent->FindImmuneCellIndex("bCellMemory") ; static int lymphOutput_thMemory = printEfferent->FindImmuneCellIndex("thMemory") ; static int lymphOutput_tcMemory = printEfferent->FindImmuneCellIndex("tcMemory") ; static int lymphInput_bCellMemory = printAfferent->FindImmuneCellIndex("bCellMemory") ; static int lymphInput_thMemory = printAfferent->FindImmuneCellIndex("thMemory") ; static int lymphInput_tcMemory = printAfferent->FindImmuneCellIndex("tcMemory") ; if (temp2 == 0) { printf("; inject\n"); #if 0 printReservoir->InjectSubstance(reservoir_bCellNaiveRecirculate + 1, 1000.0); /* inject 1000 cells */ printf("inject\n"); genericLymphaticCapillary->InjectSubstance(lymphChylomicrons, 6.25e-2); /* inject 25000mg = 25grams */ // printf("feedingTime : %g\n",temp2); esophagus->SetSubstanceQuantity(proteinSolid, 33.0); esophagus->SetSubstanceQuantity(fats, 17.0); esophagus->SetSubstanceQuantity(carbohydrates, 216.0); if (temp2 == 60 * 60000) { printCapillary->InjectSubstance(trh, 7.0); /* inject 25ug trh (Greenspan112) */ printCapillary->InjectSubstance(t3, 0.031); /* inject 15ug t3 (Greenspan112) */ printCapillary->InjectSubstance(t4, 0.077); /* inject 60ug t4 (Greenspan112) */ } /* if */ if (temp2 == 240 * 60000) { printCapillary->InjectSubstance(trh, 110.0); /* inject 400ug trh (Greenspan112) */ printCapillary->InjectSubstance(t3, 0.063); /* inject 30ug t3 (Greenspan112) */ printCapillary->InjectSubstance(t4, 0.154); /* inject 120ug t4 (Greenspan112) */ printCapillary->InjectSubstance(t3, 0.105); /* inject 50ug t3 (Berne918) */ printCapillary->InjectSubstance(t4, 0.257); /* inject 200ug t4 (berne918) */ printCapillary->InjectSubstance(t3, 0.031); /* inject 15ug t3 (Greenspan112) */ printCapillary->InjectSubstance(t4, 0.077); /* inject 60ug t4 (Greenspan112) */ } /* if */ #endif } /* if */ #if RUNERRORS return; #endif #if PLOTFLAG printReservoir->PrintImmuneCell("t", reservoir_bCellMemory, INFLUENZASTRAIN, 0, 't'); printReservoir->PrintImmuneCell("t", reservoir_thMemory, INFLUENZASTRAIN, 0, 't'); printReservoir->PrintImmuneCell("t", reservoir_tcMemory, INFLUENZASTRAIN, 0, 't'); printEfferent->PrintImmuneCell("t", lymphOutput_bCellMemory, INFLUENZASTRAIN, 0, 't'); printEfferent->PrintImmuneCell("t", lymphOutput_thMemory, INFLUENZASTRAIN, 0, 't'); printEfferent->PrintImmuneCell("t", lymphOutput_tcMemory, INFLUENZASTRAIN, 0, 't'); printAfferent->PrintImmuneCell("t", lymphInput_bCellMemory, INFLUENZASTRAIN, 0, 't'); printAfferent->PrintImmuneCell("t", lymphInput_thMemory, INFLUENZASTRAIN, 0, 't'); printAfferent->PrintImmuneCell("t", lymphInput_tcMemory, INFLUENZASTRAIN, 0, 't'); printReservoir->PrintImmuneCell("t", reservoir_tcEffector, INFLUENZASTRAIN, 0, 't'); printEfferent->PrintImmuneCell("t", lymphOutput_plasmaCell, INFLUENZASTRAIN, IGA, 't'); printCapillary->PrintSubstance(gmcsf, 'c'); printCapillary->PrintSubstance(monocyte, 'c'); printCapillary->PrintSubstance(il3, 'c'); printCapillary->PrintSubstance(il5, 'c'); /* printf("%g",temp2 /60000.0); printf(" %g %g %g %g\n",proteinSolid + proteinChyme,bloodAminoAcids,aminoAcids,peptides); printCapillary->PrintSubstance(bloodAminoAcids, 'q'); printCapillary->PrintSubstance(chylomicrons, 'q'); printCapillary->PrintSubstance(glucose, 'q'); printCapillary->PrintSubstance(gastrin, 'c'); printCapillary->PrintSubstance(cck, 'c'); printCapillary->PrintSubstance(secretin, 'c'); stomach->PrintSubstance(hcl, 'c'); printf("\n"); */ return ; #endif printf("\n%g\n",temp2 /60000.0); #if 1 printReservoir->PrintImmuneCell("bkgndIgm", reservoir_bCellNaive, BACKGROUNDSTRAIN, IGM, 'c'); printReservoir->PrintImmuneCell("fluIga", reservoir_plasmaCell, INFLUENZASTRAIN, IGA, 'c'); printReservoir->PrintImmuneCell("fluIgm", reservoir_igM, INFLUENZASTRAIN, IGM, 'c'); printReservoir->PrintImmuneCell("bkgndIgm", reservoir_igM, BACKGROUNDSTRAIN, IGM, 'c'); printEfferent->PrintImmuneCell("fluIga", lymphOutput_plasmaCell, INFLUENZASTRAIN, IGA, 'c'); #endif #if 0 printCapillary->PrintSubstance(glucose, 'c'); printCapillary->PrintSubstance(insulin, 'c'); printCapillary->PrintSubstance(glucagon, 'c'); printCapillary->PrintSubstance(chylomicrons, 'c'); thoracicDuct3->PrintSubstance(lymphChylomicrons, 'c'); thoracicDuct2->PrintSubstance(lymphChylomicrons, 'c'); thoracicDuct1->PrintSubstance(lymphChylomicrons, 'c'); thoracicDuct5->PrintSubstance(lymphChylomicrons, 'c'); genericLymphaticCapillary->PrintSubstance(lymphChylomicrons, 'c'); printCapillary->PrintSubstance(glucose, 'c'); printCapillary->PrintSubstance(lactate, 'c'); printCapillary->PrintSubstance(glycerol, 'c'); printCapillary->PrintSubstance(fattyAcids, 'c'); printCapillary->PrintSubstance(bloodAminoAcids, 'c'); printCapillary->PrintSubstance(ketones, 'c'); printCapillary->PrintSubstance(vldl, 'c'); printCapillary->PrintSubstance(idl, 'c'); printCapillary->PrintSubstance(ldl, 'c'); printCapillary->PrintSubstance(plasmaProteins, 'c'); printCapillary->PrintSubstance(oxygen, 'c'); printCapillary->PrintSubstance(CO2, 'c'); printCapillary->PrintSubstance(insulin, 'c'); printCapillary->PrintSubstance(glucagon, 'c'); glomularCapillary->PrintSubstance(trh, 'c'); pituitaryPortal->PrintSubstance(trh, 'c'); pituitaryPortal->PrintSubstance(crh, 'c'); // genericCapillary->PrintSubstance(trh, 'c'); printCapillary->PrintSubstance(crh, 'c'); printCapillary->PrintSubstance(acth, 'c'); printCapillary->PrintSubstance(cortisol, 'c'); printCapillary->PrintSubstance(trh, 'c'); printCapillary->PrintSubstance(tsh, 'c'); printCapillary->PrintSubstance(t4, 'c'); printCapillary->PrintSubstance(t3, 'c'); printCapillary->PrintSubstance(insulin, 'c'); printCapillary->PrintSubstance(glucagon, 'c'); printCapillary->PrintSubstance(epinephrine, 'c'); printCapillary->PrintSubstance(lactate, 'c'); printCapillary->PrintSubstance(glycerol, 'c'); printCapillary->PrintSubstance(fattyAcids, 'c'); printCapillary->PrintSubstance(bloodAminoAcids, 'c'); printCapillary->PrintSubstance(ketones, 'c'); printCapillary->PrintSubstance(vldl, 'c'); printCapillary->PrintSubstance(idl, 'c'); printCapillary->PrintSubstance(ldl, 'c'); printCapillary->PrintSubstance(plasmaProteins, 'c'); printCapillary->PrintSubstance(iodine, 'c'); commonBileDuct->PrintSubstance(bileBileSalts, 'c'); commonBileDuct->PrintSubstance(bileCholesterol, 'c'); // esophagus->PrintSubstance(proteinSolid, 'c'); printCapillary->PrintSubstance(gastrin, 'c'); printCapillary->PrintSubstance(cck, 'c'); printCapillary->PrintSubstance(secretin, 'c'); printCapillary->PrintSubstance(gip, 'c'); printCapillary->PrintSubstance(insulin, 'c'); printCapillary->PrintSubstance(somatostatin, 'c'); printCapillary->PrintSubstance(glucagon, 'c'); printCapillary->PrintSubstance(bloodAminoAcids, 'c'); printCapillary->PrintSubstance(chylomicrons, 'c'); printCapillary->PrintSubstance(glucose, 'c'); // printf("stomachPeptides: %g\n",stomachPeptides, 'c'); stomach->PrintSubstance(proteinSolid, 'c'); stomach->PrintSubstance(proteinChyme, 'c'); stomach->PrintSubstance(peptides, 'c'); stomach->PrintSubstance(carbohydrates, 'c'); stomach->PrintSubstance(fats, 'c'); stomach->PrintSubstance(pepsin, 'c'); stomach->PrintSubstance(hcl, 'c'); smallIntestine->PrintSubstance(proteinSolid, 'c'); smallIntestine->PrintSubstance(proteinChyme, 'c'); smallIntestine->PrintSubstance(peptides, 'c'); smallIntestine->PrintSubstance(aminoAcids, 'c'); smallIntestine->PrintSubstance(carbohydrates, 'c'); smallIntestine->PrintSubstance(fats, 'c'); smallIntestine->PrintSubstance(triglycerides, 'c'); smallIntestine->PrintSubstance(hcl, 'c'); smallIntestine->PrintSubstance(aminopeptidase, 'c'); smallIntestine->PrintSubstance(carboxypeptidase, 'c'); smallIntestine->PrintSubstance(trypsin, 'c'); smallIntestine->PrintSubstance(chymotrypsin, 'c'); smallIntestine->PrintSubstance(lipase, 'c'); smallIntestine->PrintSubstance(amylase, 'c'); smallIntestine->PrintSubstance(bileSalts, 'c'); smallIntestine->PrintSubstance(bicarbonate, 'c'); commonBileDuct->PrintSubstance(bileCarboxypeptidase, 'c'); commonBileDuct->PrintSubstance(bileTrypsin, 'c'); commonBileDuct->PrintSubstance(bileChymotrypsin, 'c'); commonBileDuct->PrintSubstance(bileLipase, 'c'); commonBileDuct->PrintSubstance(bileAmylase, 'c'); commonBileDuct->PrintSubstance(bileBileSalts, 'c'); commonBileDuct->PrintSubstance(bileBicarbonate, 'c'); pancreaticDuct->PrintSubstance(bileCarboxypeptidase, 'c'); pancreaticDuct->PrintSubstance(bileTrypsin, 'c'); pancreaticDuct->PrintSubstance(bileChymotrypsin, 'c'); pancreaticDuct->PrintSubstance(bileLipase, 'c'); pancreaticDuct->PrintSubstance(bileAmylase, 'c'); pancreaticDuct->PrintSubstance(bileBileSalts, 'c'); pancreaticDuct->PrintSubstance(bileBicarbonate, 'c'); #endif } void GenericBody::Snapshot (double temp2) { printf("\nSnapshot: GenericBody: time:%g (snap ver 1.0)\n",temp2); vessels->Snapshot(); PrintValues(1) ; } void GenericBody::PlotValues (double temp2) { printf("{ %g\n",temp2/ (1000.0 * 60.0 * 60.0 * 24.0) ); PrintSubstances(temp2); laminaProperiaTest->PrintValues (0); mesentericTestLymphNode->PrintValues (0); #if 0 bronchialTest->PrintValues (0); bronchialLymphNode->PrintValues (0); peyersPatchTest->PrintValues (0); // respiratoryTract->PrintValues (0); #endif printf("}\n"); } void VesselSegment::ExecuteInfusion (int index) { immuneCells[index].ClearValues(); } void GenericBody::ExecuteInfusion () { static int infusionCount = 0 ; static int infusionMaximum = 4 * 7 * 24 * 7200; static int infusionMaximum1 = 8 * 7 * 24 * 7200; static VesselSegment *thoracicDuct1 = vessels->FindVessel("l.thoracicDuct1"); static VesselSegment *thoracicDuct2 = vessels->FindVessel("l.thoracicDuct2"); static VesselSegment *thoracicDuct3 = vessels->FindVessel("l.thoracicDuct3"); static VesselSegment *thoracicDuct4 = vessels->FindVessel("l.thoracicDuct4"); static int lymph_plasmaCell = thoracicDuct4->FindImmuneCellIndex("plasmaCell") ; infusionCount++ ; if ((infusionCount == infusionMaximum) || (infusionCount == infusionMaximum1) ) { /* secondary */ printf("$$$$$$$$$$$$$$$$$$$ secondary infusion (%d)\n",infusionCount); fprintf(stderr,"$$$$$$$$$$$$$$$$$$$ secondary infusion (%d)\n",infusionCount); bronchialTest->ExecuteInfusion (1); #if 0 bronchialLymphNode->ExecuteInfusion (0); spleen->ExecuteInfusion (0); liver->ExecuteInfusion (0); hepaticLymphNode->ExecuteInfusion (0); subcutaneousLymphNode->ExecuteInfusion (0); miscellaneousLymphNode->ExecuteInfusion (0); mediastinalLymphNode->ExecuteInfusion (0); mesentericLymphNode->ExecuteInfusion (0); skin->ExecuteInfusion (0); miscellaneousTissue->ExecuteInfusion (0); respiratoryTract->ExecuteInfusion (0); intestines->ExecuteInfusion (0); boneMarrow->ExecuteInfusion (0); thoracicDuct4->ExecuteInfusion(lymph_plasmaCell); thoracicDuct3->ExecuteInfusion(lymph_plasmaCell); thoracicDuct2->ExecuteInfusion(lymph_plasmaCell); thoracicDuct1->ExecuteInfusion(lymph_plasmaCell); #endif } /* if */ } void GenericBody::PrintValues (int snapFlag) { // snapFlag = 1; #if 0 laminaProperiaTest->PrintValues (snapFlag); mesentericTestLymphNode->PrintValues (snapFlag); peyersPatchTest->PrintValues (snapFlag); bronchialTest->PrintValues (snapFlag); bronchialLymphNode->PrintValues (snapFlag); // spleen->PrintValues (snapFlag); liver->PrintValues (snapFlag); hepaticLymphNode->PrintValues (snapFlag); subcutaneousLymphNode->PrintValues (snapFlag); miscellaneousLymphNode->PrintValues (snapFlag); mediastinalLymphNode->PrintValues (snapFlag); mesentericLymphNode->PrintValues (snapFlag); skin->PrintValues (snapFlag); miscellaneousTissue->PrintValues (snapFlag); respiratoryTract->PrintValues (snapFlag); intestines->PrintValues (snapFlag); boneMarrow->PrintValues (snapFlag); #endif // otherTissue->PrintValuesTop (snapFlag); // adiposeTissue->PrintValues (snapFlag); // muscle->PrintValues (snapFlag); // brain->PrintValues (snapFlag); // lungs->PrintValues (snapFlag); // hypothalamus->PrintValues (snapFlag); // pituitary->PrintValues (snapFlag); // thyroid->PrintValues (snapFlag); // adrenal->PrintValues (snapFlag); // kidney->PrintValues (snapFlag); // pancreas->PrintValues (snapFlag); } GenericBody::GenericBody (double stepTime1,double maximumTime1,double plotInterval1) { stepTime = stepTime1; maximumTime = maximumTime1; plotInterval = plotInterval1; vessels = new VesselSegment[NUMBEROFVESSELS] ; numberOfBloodVessels = vessels->ConnectJunctions(stepTime) ; } void Simulate (double stepTime,double maximumTime,double plotInterval) { GenericBody human(stepTime,maximumTime,plotInterval) ; printf("; stepTime:%g, maximumTime:%g plotInterval:%g\n",stepTime,maximumTime,plotInterval); human.Run(); } #if 0 void hack1 (int *stuff) { stuff[0] = 5 ; stuff[1] = 5 ; } void hack () { int stuff[100]; hack1(stuff); } #endif int main(int argc, char **argv) { long count1,count2; double temp1,temp2; if (argc != 4) { printf("usage: sub stepTime(msec) maximumTime(min) plotInterval(msec) > resultsFile\n"); exit(0); } /* if */ // hack(); temp1 = atof(argv[2]); time(&count1); Simulate(atof(argv[1]), temp1 * 60000.0, atof(argv[3]) ); time(&count2); temp2 = (double )(count2 - count1) / 60.0 ; printf("; simulation time: %gmin actual time:%gmin (ratio:%g)\n",temp1, temp2, temp1 / temp2); return(0) ; } void GenericBody::ResetSystem () { } void GenericBody::Run () { int iStepTime; double temp2; double count_print = 0; double flowConstantLymphJunction = stepTime / ( 20.0 * 60000.0); /* 20min */ VesselSegment *emptySegmente = vessels->FindVessel("l.thoracicDuct1"); VesselSegment *emptySegmenta = vessels->FindVessel("a.miscellaneousAfferent"); VesselSegment *thoracicDuct1 = vessels->FindVessel("l.thoracicDuct1"); VesselSegment *thoracicDuct2 = vessels->FindVessel("l.thoracicDuct2"); VesselSegment *thoracicDuct3 = vessels->FindVessel("l.thoracicDuct3"); VesselSegment *thoracicDuct4 = vessels->FindVessel("l.thoracicDuct4"); hepaticLymphNode = new GenericImmuneTissue( vessels->FindVessel("c.hepaticSinusoid") , vessels->FindVessel("a.hepaticAfferent"), vessels->FindVessel("l.thoracicDuct1") , vessels->FindVessel("R.bloodReservoir") , 77.0 /* grams */ , 77.0 * 1000.0 /* ul */ , "lymphNode", "hepaticLymphNode", stepTime); subcutaneousLymphNode = new GenericImmuneTissue( vessels->FindVessel("c.genericCapillary") , vessels->FindVessel("a.subcutaneousAfferent"), vessels->FindVessel("l.thoracicDuct1") , vessels->FindVessel("R.bloodReservoir") , 7.0 /* grams */ , 7.0 * 1000.0 /* ul */ , "lymphNode", "subcutaneousLymphNode", stepTime); miscellaneousLymphNode = new GenericImmuneTissue( vessels->FindVessel("c.genericCapillary") , vessels->FindVessel("a.miscellaneousAfferent"), vessels->FindVessel("l.thoracicDuct1") , vessels->FindVessel("R.bloodReservoir") , 175.0 /* grams */ , 175.0 * 1000.0 /* ul */ , "lymphNode", "miscellaneousLymphNode", stepTime); mediastinalLymphNode = new GenericImmuneTissue( vessels->FindVessel("c.pulmonaryCapillary") , vessels->FindVessel("a.mediastinalAfferent"), vessels->FindVessel("l.thoracicDuct1") , vessels->FindVessel("R.bloodReservoir") , 168.0 /* grams */ , 168.0 * 1000.0 /* ul */ , "lymphNode", "mediastinalLymphNode", stepTime); bronchialLymphNode = new GenericImmuneTissue( vessels->FindVessel("c.pulmonaryCapillary") , vessels->FindVessel("a.mediastinalAfferentTest"), vessels->FindVessel("l.thoracicDuct1") , vessels->FindVessel("R.bloodReservoir") , 12.0 /* was.13 grams */ , 12.0 * 1000.0 /* was.13 ul */ , "lymphNode", "bronchialLymphNode", stepTime); mesentericLymphNode = new GenericImmuneTissue( vessels->FindVessel("c.portalVein") , vessels->FindVessel("a.mesentericAfferent"), vessels->FindVessel("l.thoracicDuct1") , vessels->FindVessel("R.bloodReservoir") , 273.0 /* grams */ , 273.0 * 1000.0 /* ul */ , "lymphNode", "mesentericLymphNode", stepTime); mesentericTestLymphNode = new GenericImmuneTissue( vessels->FindVessel("c.portalVein") , vessels->FindVessel("a.mesentericAfferentTest"), vessels->FindVessel("l.thoracicDuct1") , vessels->FindVessel("R.bloodReservoir") , 30.0 /* grams */ , 30.0 * 1000.0 /* ul */ , "lymphNode", "mesentericTestLymphNode", stepTime); peyersPatchTest = new GenericImmuneTissue( vessels->FindVessel("c.portalVein") , emptySegmenta, vessels->FindVessel("a.mesentericAfferentTest") , vessels->FindVessel("R.bloodReservoir") , 0.1 /* grams */ , 0.1 * 1000.0 /* ul */ , "lymphNode", "peyersPatchTest", stepTime); spleen = new GenericImmuneTissue( vessels->FindVessel("c.splenicCapillary"), emptySegmenta , emptySegmente , vessels->FindVessel("R.bloodReservoir") , 150.0 /* grams */ , 150.0 * 1000.0 /* ul */ , "spleen", "spleen" ,stepTime); boneMarrow = new GenericImmuneTissue( vessels->FindVessel("c.genericCapillary"), emptySegmenta , emptySegmente, vessels->FindVessel("R.bloodReservoir") , 9.8e3 /* grams */ , 9.8e3 * 1000.0 /* ul */ , "boneMarrow", "boneMarrow" ,stepTime); lymphJunction = new GenericImmuneTissue( vessels->FindVessel("c.venaCava"), emptySegmenta , vessels->FindVessel("l.thoracicDuct5"), vessels->FindVessel("R.bloodReservoir") , 0.0 /* grams */ , 0.0 * 1000.0 /* ul */ , "lymphJunction", "lymphJunction" ,stepTime); liver = new GenericImmuneTissue( vessels->FindVessel("c.hepaticSinusoid") , emptySegmenta, vessels->FindVessel("a.hepaticAfferent"), vessels->FindVessel("R.bloodReservoir") , 1600.0 /* grams */ , 1600.0 * 1000.0 /* ul */ , "tissue", "liver", stepTime); skin = new GenericImmuneTissue( vessels->FindVessel("c.genericCapillary") , emptySegmenta, vessels->FindVessel("a.subcutaneousAfferent"), vessels->FindVessel("R.bloodReservoir") , 3800.0 /* grams */ , 3800.0 * 1000.0 /* ul */ , "tissue", "skin", stepTime); miscellaneousTissue = new GenericImmuneTissue( vessels->FindVessel("c.genericCapillary") , emptySegmenta, vessels->FindVessel("a.miscellaneousAfferent"), vessels->FindVessel("R.bloodReservoir") , 35000.0 /* grams */ , 26000.0 * 1000.0 /* ul */ , "tissue", "miscellaneousTissue", stepTime); respiratoryTract = new GenericImmuneTissue( vessels->FindVessel("c.pulmonaryCapillary") , emptySegmenta, vessels->FindVessel("a.mediastinalAfferent"), vessels->FindVessel("R.bloodReservoir") , 2000.0 /* grams */ , 2000.0 * 1000.0 /* ul */ , "tissue", "respiratoryTract", stepTime); bronchialTest = new GenericImmuneTissue( vessels->FindVessel("c.pulmonaryCapillary") , emptySegmenta, vessels->FindVessel("a.mediastinalAfferentTest"), vessels->FindVessel("R.bloodReservoir") , 1.5 /* grams */ , 1.5 * 1000.0 /* ul */ , "tissue", "bronchialTest", stepTime); intestines = new GenericImmuneTissue( vessels->FindVessel("c.portalVein") , emptySegmenta, vessels->FindVessel("a.mesentericAfferent"), vessels->FindVessel("R.bloodReservoir") , 4000.0 /* grams */ , 4000.0 * 1000.0 /* ul */ , "tissue", "intestines", stepTime); laminaProperiaTest = new GenericImmuneTissue( vessels->FindVessel("c.portalVein") , emptySegmenta, vessels->FindVessel("a.mesentericAfferentTest"), vessels->FindVessel("R.bloodReservoir") , 0.1 /* grams */ , 0.1 * 1000.0 /* ul */ , "tissue", "laminaProperiaTest", stepTime); lungs = new GenericLungs(vessels->FindVessel("c.pulmonaryCapillary"),2.0e-5, 1.0e10 , "lungs" , stepTime ) ; // lymphJunction = new GenericLymphJunction(vessels->FindVessel("l.thoracicDuct3") ,vessels->FindVessel("l.thoracicDuct2") ,vessels->FindVessel("l.thoracicDuct1") ,vessels->FindVessel("l.lymphaticVein"), vessels->FindVessel("l.spleenLymphaticCapillary") , vessels->FindVessel("l.hepaticLymphaticCapillary") , vessels->FindVessel("l.smallIntestineLymphaticCapillary") , vessels->FindVessel("l.genericLymphaticCapillary") , vessels->FindVessel("l.extracellularFluid") ,vessels->FindVessel("c.venaCava"), lymphaticTime , "lymphJunction" , stepTime ) ; mouth = new GenericMouth( vessels->FindVessel("d.esophagus"), "mouth" , stepTime ) ; esophagus = new GenericEsophagus( vessels->FindVessel("d.esophagus"), stepTime / 5000.0, "esophagus" , stepTime ) ; /* flowConstant = 15 seconds */ smallIntestine = new GenericSmallIntestine(vessels->FindVessel("d.duodenum"), vessels->FindVessel("d.jejunum"), vessels->FindVessel("c.portalVein"), "smallIntestine" , stepTime ) ; stomach = new GenericStomach(vessels->FindVessel("c.portalVein"), vessels->FindVessel("d.stomach"), stepTime / 20000.0, "stomach" , stepTime ) ; kidney = new GenericKidney(vessels->FindVessel("c.glomularCapillary") , "kidney" , stepTime ) ; sphincterOfOddi = new GenericSphincterOfOddi(vessels->FindVessel("b.commonBileDuct") ,vessels->FindVessel("b.commonHepaticDuct") ,vessels->FindVessel("b.pancreaticDuct") ,vessels->FindVessel("d.duodenum"), vessels->FindVessel("c.genericCapillary"), stepTime / 7000.0 , "sphincterOfOddi" , stepTime ) ; otherTissue = new GenericTissue(vessels->FindVessel("c.genericCapillary") , 4.0e-6, 3.5e12, "otherTissue" , stepTime ) ; adiposeTissue = new GenericAdiposeTissue(vessels->FindVessel("c.genericCapillary"), 5.0e-4, 3.95e9, "adiposeTissue" , stepTime ) ; muscle = new GenericMuscle(vessels->FindVessel("c.genericCapillary"), 0.116, 250e6, "muscle" , stepTime ) ; brain = new GenericBrain(vessels->FindVessel("c.cerebralCapillary"), 2.2e-5, 1.0e11 , "brain" , stepTime ) ; pancreas = new GenericPancreas(vessels->FindVessel("b.pancreaticDuct"), vessels->FindVessel("c.portalVein") , "pancreas", stepTime ) ; hypothalamus = new GenericHypothalamus(vessels->FindVessel("c.cerebralCapillary") ,vessels->FindVessel("c.hypophysealPortalVein") , "hypothalamus" , stepTime ) ; pituitary = new GenericPituitary(vessels->FindVessel("c.cerebralCapillary") ,vessels->FindVessel("c.hypophysealPortalVein") , "pituitary" , stepTime ) ; thyroid = new GenericThyroid(vessels->FindVessel("c.genericCapillary") , "thyroid" , stepTime ) ; adrenal = new GenericAdrenal(vessels->FindVessel("c.genericCapillary") , "adrenal" , stepTime ) ; // VesselSegment::HelpPrint (); ResetSystem(); iStepTime = (int )stepTime; count_print = 0; for (temp2 = 0; temp2 < maximumTime; temp2 += stepTime) { if(temp2 >= count_print){ #if !PLOTFLAG PrintSubstances(temp2); PrintValues(0); #else PlotValues(temp2); #endif count_print += plotInterval; } #if 0 mouth->Run(); esophagus->Run(); stomach->Run(); smallIntestine->Run(); sphincterOfOddi->Run(); hypothalamus->Run(); pituitary->Run(); thyroid->Run(); adrenal->Run(); adiposeTissue->Run(); otherTissue->Run(); muscle->Run(); brain->Run(); lungs->Run(); kidney->Run(); pancreas->Run(); #endif liver->ExecuteLiver(); spleen->ExecuteSpleen(); hepaticLymphNode->ExecuteLymphNodeGeneral(); subcutaneousLymphNode->ExecuteLymphNodeGeneral(); miscellaneousLymphNode->ExecuteLymphNodeGeneral(); mediastinalLymphNode->ExecuteLymphNodeGeneral(); // bronchialLymphNode->ExecuteLymphNode(); mesentericLymphNode->ExecuteLymphNodeGeneral(); mesentericTestLymphNode->ExecuteLymphNode(); // peyersPatchTest->ExecutePeyersPatch(); skin->ExecuteGeneralTissue(); miscellaneousTissue->ExecuteGeneralTissue(); respiratoryTract->ExecuteLungs(); // bronchialTest->ExecuteBronchialTest(); intestines->ExecuteGeneralTissue(); laminaProperiaTest->ExecuteLaminaProperia(); boneMarrow->ExecuteBoneMarrow(); lymphJunction->ExecuteLymphJunction(); thoracicDuct4->SetTransferFlag(flowConstantLymphJunction); thoracicDuct3->SetTransferFlag(flowConstantLymphJunction); thoracicDuct2->SetTransferFlag(flowConstantLymphJunction); thoracicDuct1->SetTransferFlag(flowConstantLymphJunction); vessels->CalculateFlows(numberOfBloodVessels); ExecuteInfusion(); } // Snapshot(temp2); } void GenericStomach::Run () { double rate,x1 ; /* hack: [proteinSolid] + 20?[hcl] -> [proteinChyme] */ rate = kProteinChyme * proteinSolid * hcl; proteinSolid -= rate * hclMultiplier; // printf("Stomach hcl:%g rate:%g proteinSolid:%g\n",hcl,rate,proteinSolid); hcl -= rate ; proteinChyme += rate * hclMultiplier; /* hack... gastrin -> hcl */ rate = k2Hcl * gastrin + kmHcl; // printf("Stomach hcl:%g rate:%g gastrin:%g\n",hcl,rate,gastrin); if (rate >= 0.0) { hcl += rate; } /* if */ /* gastrin -> pepsin */ rate = k2Pepsin * gastrin / (kmPepsin + gastrin) ; pepsin += rate; /* [protein] + [pepsin] -> 10[peptides] */ rate = k2Peptides * pepsin * proteinSolid / (kmPeptides + proteinSolid) ; proteinSolid -= rate ; peptides += 10 * rate; // stomachPeptides += 10 * rate; rate = k2Peptides * pepsin * proteinChyme / (kmPeptides + proteinChyme) ; proteinChyme -= rate ; peptides += 10 * rate; // stomachPeptides += 10 * rate; /* protein,hcl -> gastrin */ x1 = proteinSolid + proteinChyme ; rate = (k2Gastrin * x1 / (kmGastrin + x1)) * (1.0 / (1.0 + kmiGastrin * hcl)) + kbGastrin; gastrin += rate; /* hack... stomach -> smallIntestine: 3ml/contraction, contraction ~20 seconds */ /* 3ml/contraction, ~20seconds/contraction, protein halfLife = 90 minutes */ intestine->SetTransferFlag(flowConstant); if (intestine->ReadTransferFlag() >= 1.0) { x1 = proteinSolid + proteinChyme + carbohydrates + fats ; rate = (1.0 - kStomach2SmallIntestine) * x1 / (1.0e-6 + x1) + kStomach2SmallIntestine; x1 = (1.0 / (1.0 + kiStomach2SmallIntestine * smallIntestineNerve.ReadNerve() )) ; intestine->SetTimeConstant(initialTimeConstantValueOut * rate * x1); // printf("time constant:%g dhcl:%g HCL:%g\n",(initialTimeConstantValueOut * rate * x1),hcl * (initialTimeConstantValueOut * rate * x1),hcl); } /* if */ } void GenericSmallIntestine::Run () { double rate ; double x1; /* (hack for now) Enterohepatic Circulation, bileSalts ->bloodBileSalts */ rate = 42.7; // bileSalts -= rate ; bloodBileSalts += rate; /* [protein] ->trypsin-> 10[peptides] */ rate = k2Peptides * trypsin * proteinSolid / (kmPeptides + proteinSolid) ; proteinSolid -= rate ; peptides += 10 * rate; /* [protein] ->trypsin-> 10[peptides] */ rate = k2Peptides * chymotrypsin * proteinChyme / (kmPeptides + proteinChyme) ; proteinChyme -= rate ; peptides += 10 * rate; /* [peptides] ->carboxypeptidase|aminopeptidase-> 10[aminoAcids] */ rate = ( peptides / (kmAminoAcids + peptides)) * (k2AminoAcids * aminopeptidase + k2cAminoAcids * carboxypeptidase) ; peptides -= rate ; aminoAcids += 10 * rate; /* [fats] ->bileSalts-> 100[triglycerides] */ rate = k2Triglycerides * bileSalts * fats / (kmTriglycerides + fats) ; fats -= rate ; triglycerides += 100 * rate; /* [cck] -> [aminopeptidase] */ rate = k2Aminopeptidase * cck / (kmAminopeptidase + cck) ; aminopeptidase += rate; /* hack... [hcl] + [bicarbonate] -> neutralized */ rate = k2Hcl * hcl * bicarbonate; // printf("smallIntestine hcl:%g rate:%g bicarbonate:%g\n",hcl,rate,bicarbonate); bicarbonate -= rate ; hcl -= rate ; if (hcl < 0.0) { hcl = 0.0; } /* if */ /* [aminoAcids] ->aminopeptidase-> [bloodAminoAcids] */ rate = k2BloodAminoAcids * aminopeptidase * aminoAcids / (kmBloodAminoAcids + aminoAcids) ; aminoAcids -= rate ; bloodAminoAcids += rate; /* hack... aminoAcids,peptides,triglycerides -> cck */ x1 = aminoAcids + peptides * 10.0 ; rate = k2Cck * ( (x1/(kmcck + x1)) + (triglycerides/(kmfcck + triglycerides)) ) + kbcck; cck += rate; /* carbohydrates,fats -> gip */ rate = k2Gip * ( (carbohydrates / (kmGip + carbohydrates)) + (fats / (kmfGip + fats)) ) + kbGip; gip += rate; /* [hcl] -> [secretin] */ rate = (k2Secretin * hcl / (kmSecretin + hcl)) ; // printf("smallIntestine secretin rate: %g, hcl:%g\n",rate,hcl); secretin += rate; /* 100[triglycerides] ->lipase-> [chylomicrons] */ rate = k2Chylomicrons * lipase * triglycerides / (kmChylomicrons + triglycerides) ; triglycerides -= rate ; chylomicrons += 0.01 * rate; /* [carbohydrates] ->amylase-> 100[glucose] */ rate = k2Glucose * amylase * carbohydrates / (kmGlucose + carbohydrates) ; carbohydrates -= rate ; glucose += 100.0 * rate; /* hack: stomach -> smallIntestine */ smallIntestineNerve.SetNerve((fats + proteinSolid + proteinChyme)) ; // printf("rate:%g, x1:%g fats:%g protein:%g \n",rate,x1,fats,proteinSolid + proteinChyme); } void GenericMouth::Run () { } void GenericEsophagus::Run () { intestine->SetTransferFlag(flowConstant); } void GenericSphincterOfOddi::Run () { double rate,timeConstantValueOut ; pancreaticDuct->SetTransferFlag(flowConstant); commonHepaticDuct->SetTransferFlag(flowConstant); if (pancreaticDuct->ReadTransferFlag() >= 1.0) { rate = k2SphincterOfOddi * cck / (kmSphincterOfOddi + cck) ; timeConstantValueOut = initialTimeConstantValueOut * rate; // printf("rate:%g cck%g timeConstantValueOut:%g transferflag:%g\n",rate,cck,timeConstantValueOut,pancreaticDuct->ReadTransferFlag()); pancreaticDuct->SetTimeConstant(timeConstantValueOut); commonHepaticDuct->SetTimeConstant(timeConstantValueOut); rate = bileCarboxypeptidase * timeConstantValueOut ; bileCarboxypeptidase -= rate; carboxypeptidase += rate; rate = bileTrypsin * timeConstantValueOut ; bileTrypsin -= rate; trypsin += rate; rate = bileChymotrypsin * timeConstantValueOut ; bileChymotrypsin -= rate; chymotrypsin += rate; rate = bileBileSalts * timeConstantValueOut ; bileBileSalts -= rate; bileSalts += rate; rate = bileBicarbonate * timeConstantValueOut ; bileBicarbonate -= rate; bicarbonate += rate; rate = bileLipase * timeConstantValueOut ; bileLipase -= rate; lipase += rate; rate = bileAmylase * timeConstantValueOut ; bileAmylase -= rate; amylase += rate; } /* if */ } void GenericHypothalamus::Run () { double rate; /* t3 -> trh rate=1.0e-4/tick */ rate = k2Trh / (1.0 + kiTrh * t3); trh += rate ; if (printFlag) { printf(" %s: t3->trh rate (1.0e-4): %g\n",organName,rate); } /* if */ /* cortisol,acth -> crh rate=1.15e-8/tick */ rate = k2Crh /( (1.0 + ki1Crh * acth) * (1.0 + ki2Crh * cortisol) ); crh += rate ; if (printFlag) { printf(" %s: acth->crh rate (1.16e-8): %g\n",organName,rate); printFlag = 0; } /* if */ } void GenericPituitary::Run () { double rate,x1,x2; /* trh -> tsh rate=.6/tick */ x1 = trh * trh; x2 = t3 * t3 * t3; // x1 = trh; rate = k2Tsh * (x1 / (kaTsh + x1)) * (1.0 / (1.0 + kiTsh * x2)); tsh += rate ; internalTsh -= rate ; internalTsh += rate ; /* ? For now */ if (printFlag) { printf("trh:%g t3:%g k2:%g ka:%g ki:%g x1:%g x2:%g\n",trh,t3,k2Tsh,kaTsh,kiTsh,x1,x2); printf(" %s: trh->tsh rate (.6): %g\n",organName,rate); } /* if */ /* crh -> acth rate=3.45e-8/tick */ rate = k2Acth * crh / (kmActh + crh); acth += rate ; if (printFlag) { printf("crh:%g k2:%g(exp:6.9e-8) km:%g(exp:6.66e-10)\n",crh,k2Acth,kmActh); printf(" %s: crh->acth rate (3.46e-8): %g\n",organName,rate); } /* if */ printFlag = 0; } void GenericThyroid::PrintValues () { printf(" thyroid: internalIodine: %g\n",internalIodine); printFlag = 1; } void GenericThyroid::Run () { double rate; /* tsh -> t4,t3 rate=6.7e-7/tick */ rate = k2T4 * tsh / (kaT4 + tsh) * (internalIodine / (kmT4 + internalIodine)) ; t4 += rate ; t3 += rate * .12 ; internalIodine -= rate * 5.0 ; if (printFlag) { printf(" %s: tsh->t4,t3 rate (6.7e-7): %g\n",organName,rate); } /* if */ /* iodine ->internalIodine rate=3.4e-6/tick */ rate = k2Iodine * iodine / (kmIodine + iodine); internalIodine += rate ; iodine -= rate ; if (printFlag) { printf(" %s: iodine->internalIodine rate (3.4e-6): %g\n",organName,rate); printFlag = 0; } /* if */ } void GenericAdrenal::Run () { double rate; /* acth -> cortisol rate=1.08e-4/tick */ rate = k2Cortisol * acth / (kmCortisol + acth); cortisol += rate ; if (printFlag) { printf(" %s: acth->cortisol rate (1.08e-4): %g\n",organName,rate); printFlag = 0; } /* if */ } void GenericKidney::Run () { double rate; /* ------------------ hack clearance equations for now -------------------------- */ rate = kGastrin * gastrin ; gastrin -= rate; rate = kcck * cck ; // printf("cck rate: %g\n",rate); cck -= rate; rate = kSecretin * secretin ; secretin -= rate; // printf("Liver secretin rate: %g\n",rate); rate = kGip * gip ; gip -= rate; // printf("gip rate: %g\n",rate); rate = kInsulin * insulin ; insulin -= rate; if (printFlag) { printf(" %s: insulin: %g\n",organName,rate); } /* if */ rate = kSomatostatin * somatostatin ; somatostatin -= rate; // printf("somatostatin rate: %g\n",rate); rate = kGlucagon * glucagon ; glucagon -= rate; if (printFlag) { printf(" %s: glucagon: %g\n",organName,rate); } /* if */ rate = kT4 * t4 ; t4 -= rate; rate = kT3 * t3 ; t3 -= rate; rate = kTsh * tsh ; tsh -= rate; rate = kTrh * trh ; trh -= rate; if (printFlag) { printf(" %s: trh (1.0e-4): %g\n",organName,rate); } /* if */ rate = kIodine * iodine ; iodine -= rate; rate = kCrh * crh ; crh -= rate; rate = kActh * acth ; acth -= rate; rate = kCortisol * cortisol ; cortisol -= rate; printFlag = 0; } void GenericPancreas::Run () { double rate,x1 ; // rate = k2Glucagon; // glucagon += rate; // return; /* [glucose] -> [insulin] */ x1 = glucose * kmInsulin ; x1 = x1 * x1 ; x1 = x1 * x1 ; rate = k2Insulin * x1 / (1.0 + x1) + kbInsulin ; insulin += rate; if (printFlag) { printf(" %s: insulin rate: %g\n",organName,rate); } /* if */ /* [glucose] -> [glucagon] */ x1 = glucose * kmGlucagon; x1 = x1 * x1 ; x1 = x1 * x1 ; rate = k2Glucagon / (1.0 + x1) ; glucagon += rate; if (printFlag) { printf(" %s: glucagon rate: %g\n",organName,rate); } /* if */ #if 0 /* [glucose] -> [somatostatin] */ rate = k2Somatostatin * glucose / (kmSomatostatin + glucose) ; somatostatin += rate; /* hack... [secretin] -> [bicarbonate] */ rate = k2Bicarbonate * secretin + kmBicarbonate ; if (rate < 0.0) { rate = 0.0; } /* if */ bicarbonate += rate; /* [cck] -> [trypsin] */ rate = k2Trypsin * cck / (kmTrypsin + cck) ; trypsin += rate; /* [cck] -> [chymotrypsin] */ rate = k2Chymotrypsin * cck / (kmChymotrypsin + cck) ; chymotrypsin += rate; /* [cck] -> [carboxypeptidase] */ rate = k2Carboxypeptidase * cck / (kmCarboxypeptidase + cck) ; carboxypeptidase += rate; /* [cck] -> [lipase] */ rate = k2Lipase * cck / (kmLipase + cck) ; lipase += rate; /* [cck] -> [amylase] */ rate = k2Amylase * cck / (kmAmylase + cck) ; amylase += rate; #endif printFlag = 0; } void GenericOrgan::ResetGenericOrgan() { glucose6Phosphate = 83.0e-6 * cellVolume ; gap = 157.0e-6 * cellVolume ; pyruvate = 51.0e-6 * cellVolume; acetylCoenzymeA = 39.0e-6 * cellVolume ; atp = 1850.0e-6 * cellVolume ; adp = 138.0e-6 * cellVolume ; malonylCoA = 0.0; /* total hack, for beta oxidation control */ fad = 72.0e-6 * cellVolume ; fadh = 180.0e-6 * cellVolume ; nad = 72.0e-6 * cellVolume ; nadh = 180.0e-6 * cellVolume ; hexokinase = 1.0e-6 * cellVolume; phosphofructokinase = 5.0e-6 * cellVolume; pyruvateKinase = 0.2e-6 * cellVolume; pyruvateDehydrogenase = 0.1e-6 * cellVolume; isocitrateDehydrogenase = 0.5e-6 * cellVolume; atpSynthase = 0.1e-6 * cellVolume; atpAse = 1.0e-6 * cellVolume; glycogen = 0.0; protein = 0.0; triglycerides = 0.0; cholesterol = 0.0; internalFattyAcids = 0.0; internalAminoAcids = 0.0; printFlag = 0; } void GenericOrgan::PrintValues (int snapFlag) { return; printf(" %s: glucose6Phosphate: %g\n",organName,glucose6Phosphate); printf(" %s: gap: %g\n",organName,gap); printf(" %s: pyruvate: %g\n",organName,pyruvate); printf(" %s: acetylCoenzymeA: %g\n",organName,acetylCoenzymeA); printf(" %s: atp: %g\n",organName,atp); printf(" %s: adp: %g\n",organName,adp); printf(" %s: nad : %g\n",organName,nad ); printf(" %s: nadh: %g\n",organName,nadh); printf(" %s: fad : %g\n",organName,fad ); printf(" %s: fadh: %g\n",organName,fadh); printf(" %s: glycogen: %g\n",organName,glycogen); printf(" %s: internalFattyAcids: %g\n",organName,internalFattyAcids); printf(" %s: triglycerides: %g\n",organName,triglycerides); printf(" %s: protein: %g\n",organName,protein); printf(" %s: malonylCoA: %g\n",organName,malonylCoA); printFlag = 1; } void GenericBrain::Run () { EvaluateHexokinase() ; EvaluatePhosphofructokinase () ; EvaluatePyruvateKinase() ; EvaluatePyruvateDehydrogenase () ; EvaluateIsocitrateDehydrogenase () ; EvaluateAtpSynthase () ; EvaluateAtpAse () ; #if METABOLISMDEBUG printFlag = 0; #endif } void GenericLungs::Run () { oxygen += 24.0 ; CO2 -= 24.0; // glucose += 4.0; // glucose += 4.4; #if METABOLISMDEBUG printFlag = 0; #endif } void GenericMuscle::Run () { glucose -= glucose * 3.9e-3 / 2.0 ; fattyAcids -= fattyAcids * 0.16 / 2.0 ; lactate += 3.88 / 2.0 ; aminoAcids += 30.0 / 2.0 ; aminoAcids -= aminoAcids * .113 / 2.0 ; plasmaProteins -= plasmaProteins * 3.2e-5 / 2.0; #if METABOLISMDEBUG printFlag = 0; #endif } #if 0 void GenericLiver::Run () { double rate; kupffer.ExecuteKupffer(); return ; glucose += 12.84 / 2.0 ; fattyAcids -= fattyAcids * 3.56e-2 / 2.0 ; vldl += 2.32e-5 / 2.0 ; rate = idl * 1.8e-2 / 2.0 ; idl -= 2.0 * rate ; ldl += rate ; ldl -= ldl * 3.27e-4 / 2.0 ; lactate -= lactate * 6.6e-2 / 2.0 ; aminoAcids -= aminoAcids * 2.97e-2 / 2.0 ; glycerol -= glycerol * .52 / 2.0 ; // glycerol -= glycerol * .99; ketones += .1044 / 2.0 ; plasmaProteins += 3.46e-3 / 2.0; #if METABOLISMDEBUG printFlag = 0; #endif } #endif void GenericAdiposeTissue::Run () { double rate; glucose -= glucose * 8.5e-4 / 2.0 ; fattyAcids += 4.6 / 2.0 ; rate = vldl * 1.78e-2 / 2.0 ; vldl -= rate; ldl += rate ; glycerol += 1.5 / 2.0; #if METABOLISMDEBUG printFlag = 0; #endif } void GenericTissue::Run () { glucose -= glucose * 8.6e-3 / 2.0 ; fattyAcids -= fattyAcids * .11 / 2.0 ; ldl -= ldl * 1.24e-4 / 2.0 ; ketones -= ketones * 5.3e-2 / 2.0; #if METABOLISMDEBUG printFlag = 0; #endif } void GenericImmuneTissue::PrintValues (int snapFlag) { double rate; int i; #if PLOTFLAG #if 0 printf("%s.%s.a: %g\n",organName,mastCell.ReadName(),mastCell.ReadValueWithProfile(RYEGRASSSTRAIN,IGA)); printf("%s.%s.m: %g\n",organName,mastCell.ReadName(),mastCell.ReadValueWithProfile(RYEGRASSSTRAIN,IGM)); printf("%s.%s.g: %g\n",organName,mastCell.ReadName(),mastCell.ReadValueWithProfile(RYEGRASSSTRAIN,IGG)); printf("%s.%s.e: %g\n",organName,mastCell.ReadName(),mastCell.ReadValueWithProfile(RYEGRASSSTRAIN,IGE)); printf("%s.%s.a: %g\n",organName,mastCellDegranulate.ReadName(),mastCellDegranulate.ReadValueWithProfile(RYEGRASSSTRAIN,IGA)); printf("%s.%s.m: %g\n",organName,mastCellDegranulate.ReadName(),mastCellDegranulate.ReadValueWithProfile(RYEGRASSSTRAIN,IGM)); printf("%s.%s.g: %g\n",organName,mastCellDegranulate.ReadName(),mastCellDegranulate.ReadValueWithProfile(RYEGRASSSTRAIN,IGG)); printf("%s.%s.e: %g\n",organName,mastCellDegranulate.ReadName(),mastCellDegranulate.ReadValueWithProfile(RYEGRASSSTRAIN,IGE)); printf("%s.%s.a: %g\n",organName,plasmaCell.ReadName(),plasmaCell.ReadValueWithProfile(RYEGRASSSTRAIN,IGA)); printf("%s.%s.m: %g\n",organName,plasmaCell.ReadName(),plasmaCell.ReadValueWithProfile(RYEGRASSSTRAIN,IGM)); printf("%s.%s.g: %g\n",organName,plasmaCell.ReadName(),plasmaCell.ReadValueWithProfile(RYEGRASSSTRAIN,IGG)); printf("%s.%s.e: %g\n",organName,plasmaCell.ReadName(),plasmaCell.ReadValueWithProfile(RYEGRASSSTRAIN,IGE)); printf("%s.%s.a: %g\n",organName,bCellMemory.ReadName(),bCellMemory.ReadValueWithProfile(RYEGRASSSTRAIN,IGA)); printf("%s.%s.m: %g\n",organName,bCellMemory.ReadName(),bCellMemory.ReadValueWithProfile(RYEGRASSSTRAIN,IGM)); printf("%s.%s.g: %g\n",organName,bCellMemory.ReadName(),bCellMemory.ReadValueWithProfile(RYEGRASSSTRAIN,IGG)); printf("%s.%s.e: %g\n",organName,bCellMemory.ReadName(),bCellMemory.ReadValueWithProfile(RYEGRASSSTRAIN,IGE)); printf("%s.%s.1: %g\n",organName,thEffector.ReadName(),thEffector.ReadValueWithProfile(RYEGRASSSTRAIN,TH1)); printf("%s.%s.2: %g\n",organName,thEffector.ReadName(),thEffector.ReadValueWithProfile(RYEGRASSSTRAIN,TH2)); printf("%s.%s.0: %g\n",organName,thEffector.ReadName(),thEffector.ReadValueWithProfile(RYEGRASSSTRAIN,TH0)); printf("%s.%s.1: %g\n",organName,thMemory.ReadName(),thMemory.ReadValueWithProfile(RYEGRASSSTRAIN,TH1)); printf("%s.%s.2: %g\n",organName,thMemory.ReadName(),thMemory.ReadValueWithProfile(RYEGRASSSTRAIN,TH2)); printf("%s.%s.0: %g\n",organName,thMemory.ReadName(),thMemory.ReadValueWithProfile(RYEGRASSSTRAIN,TH0)); printf("%s.%s.1: %g\n",organName,thMemoryBlast[NUMBEROFTHMEMORYACTIVATE - 1].ReadName(),thMemoryBlast[NUMBEROFTHMEMORYACTIVATE - 1].ReadValueWithProfile(RYEGRASSSTRAIN,TH1)); printf("%s.%s.2: %g\n",organName,thMemoryBlast[NUMBEROFTHMEMORYACTIVATE - 1].ReadName(),thMemoryBlast[NUMBEROFTHMEMORYACTIVATE - 1].ReadValueWithProfile(RYEGRASSSTRAIN,TH2)); printf("%s.%s.0: %g\n",organName,thMemoryBlast[NUMBEROFTHMEMORYACTIVATE - 1].ReadName(),thMemoryBlast[NUMBEROFTHMEMORYACTIVATE - 1].ReadValueWithProfile(RYEGRASSSTRAIN,TH0)); printf("%s.%s.12: %g\n",organName,dendriticApc.ReadName(),dendriticApc.ReadValueWithProfile(RYEGRASSSTRAIN,D_IL12)); printf("%s.%s.10: %g\n",organName,dendriticApc.ReadName(),dendriticApc.ReadValueWithProfile(RYEGRASSSTRAIN,D_IL10)); printf("%s.%s.rye: %g\n",organName,dendriticApc.ReadName(),dendriticApc.ReadValue(RYEGRASSSTRAIN)); printf("%s.il3inflammatoryRate: %g\n",organName,il3inflammatoryRate); printf("%s.il5inflammatoryRate: %g\n",organName,il5inflammatoryRate); printf("%s.%s: %g\n",organName,ige.ReadName(),ige.ReadTotal()); printf("%s.mastCellNaive: %g\n",organName,mastCellNaive ); printf("%s.eosinophil: %g\n",organName,eosinophil ); printf("%s.fev1: %g\n",organName,fev1 ); printf("%s.histamine: %g\n",organName,histamine/( epitheliumvolume/ 1000.0) * 111.0e3 ); /* umole/Milliliter */ printf("%s.ltc4: %g\n",organName,ltc4 /( epitheliumvolume/ 1000.0) * 625.0e6 ); /* umole/Milliliter */ printf("%s.il3: %g\n",organName,il3 /( epitheliumvolume/ 1000.0) * 1.8e7 ); /* ng/Milliliter */ printf("%s.il5: %g\n",organName,il5 /( epitheliumvolume/ 1000.0) * 3.0e7 ); /* Ng/Milliliter */ printf("%s.il5raw: %g\n",organName,il5 ); #endif #if 1 printf("%s.%s.a: %g\n",organName,plasmaCell.ReadName(),plasmaCell.ReadValueWithProfile(INFLUENZASTRAIN,IGA)); printf("%s.%s.m: %g\n",organName,plasmaCell.ReadName(),plasmaCell.ReadValueWithProfile(INFLUENZASTRAIN,IGM)); printf("%s.%s.g: %g\n",organName,plasmaCell.ReadName(),plasmaCell.ReadValueWithProfile(INFLUENZASTRAIN,IGG)); printf("%s.%s.e: %g\n",organName,plasmaCell.ReadName(),plasmaCell.ReadValueWithProfile(INFLUENZASTRAIN,IGE)); printf("%s.%s.a: %g\n",organName,bCellMemory.ReadName(),bCellMemory.ReadValueWithProfile(INFLUENZASTRAIN,IGA)); printf("%s.%s.m: %g\n",organName,bCellMemory.ReadName(),bCellMemory.ReadValueWithProfile(INFLUENZASTRAIN,IGM)); printf("%s.%s.g: %g\n",organName,bCellMemory.ReadName(),bCellMemory.ReadValueWithProfile(INFLUENZASTRAIN,IGG)); printf("%s.%s.e: %g\n",organName,bCellMemory.ReadName(),bCellMemory.ReadValueWithProfile(INFLUENZASTRAIN,IGE)); printf("%s.%s.1: %g\n",organName,thEffector.ReadName(),thEffector.ReadValueWithProfile(INFLUENZASTRAIN,TH1)); printf("%s.%s.2: %g\n",organName,thEffector.ReadName(),thEffector.ReadValueWithProfile(INFLUENZASTRAIN,TH2)); printf("%s.%s.0: %g\n",organName,thEffector.ReadName(),thEffector.ReadValueWithProfile(INFLUENZASTRAIN,TH0)); printf("%s.%s.1: %g\n",organName,thMemory.ReadName(),thMemory.ReadValueWithProfile(INFLUENZASTRAIN,TH1)); printf("%s.%s.2: %g\n",organName,thMemory.ReadName(),thMemory.ReadValueWithProfile(INFLUENZASTRAIN,TH2)); printf("%s.%s.0: %g\n",organName,thMemory.ReadName(),thMemory.ReadValueWithProfile(INFLUENZASTRAIN,TH0)); printf("%s.%s.a: %g\n",organName,bCellMemoryMarginal.ReadName(),bCellMemoryMarginal.ReadValueWithProfile(INFLUENZASTRAIN,IGA)); printf("%s.%s.m: %g\n",organName,bCellMemoryMarginal.ReadName(),bCellMemoryMarginal.ReadValueWithProfile(INFLUENZASTRAIN,IGM)); printf("%s.%s.g: %g\n",organName,bCellMemoryMarginal.ReadName(),bCellMemoryMarginal.ReadValueWithProfile(INFLUENZASTRAIN,IGG)); printf("%s.%s.e: %g\n",organName,bCellMemoryMarginal.ReadName(),bCellMemoryMarginal.ReadValueWithProfile(INFLUENZASTRAIN,IGE)); #endif #if 0 printf("%s.%s.1: %g\n",organName,thMemoryBlast[NUMBEROFTHMEMORYACTIVATE - 1].ReadName(),thMemoryBlast[NUMBEROFTHMEMORYACTIVATE - 1].ReadValueWithProfile(INFLUENZASTRAIN,TH1)); printf("%s.%s.2: %g\n",organName,thMemoryBlast[NUMBEROFTHMEMORYACTIVATE - 1].ReadName(),thMemoryBlast[NUMBEROFTHMEMORYACTIVATE - 1].ReadValueWithProfile(INFLUENZASTRAIN,TH2)); printf("%s.%s.0: %g\n",organName,thMemoryBlast[NUMBEROFTHMEMORYACTIVATE - 1].ReadName(),thMemoryBlast[NUMBEROFTHMEMORYACTIVATE - 1].ReadValueWithProfile(INFLUENZASTRAIN,TH0)); printf("%s.%s.a: %g\n",organName,mastCell.ReadName(),mastCell.ReadValueWithProfile(INFLUENZASTRAIN,IGA)); printf("%s.%s.m: %g\n",organName,mastCell.ReadName(),mastCell.ReadValueWithProfile(INFLUENZASTRAIN,IGM)); printf("%s.%s.g: %g\n",organName,mastCell.ReadName(),mastCell.ReadValueWithProfile(INFLUENZASTRAIN,IGG)); printf("%s.%s.e: %g\n",organName,mastCell.ReadName(),mastCell.ReadValueWithProfile(INFLUENZASTRAIN,IGE)); printf("%s.%s.a: %g\n",organName,mastCellDegranulate.ReadName(),mastCellDegranulate.ReadValueWithProfile(INFLUENZASTRAIN,IGA)); printf("%s.%s.m: %g\n",organName,mastCellDegranulate.ReadName(),mastCellDegranulate.ReadValueWithProfile(INFLUENZASTRAIN,IGM)); printf("%s.%s.g: %g\n",organName,mastCellDegranulate.ReadName(),mastCellDegranulate.ReadValueWithProfile(INFLUENZASTRAIN,IGG)); printf("%s.%s.e: %g\n",organName,mastCellDegranulate.ReadName(),mastCellDegranulate.ReadValueWithProfile(INFLUENZASTRAIN,IGE)); #endif printf("%s.%s: %g\n",organName,tcEffector.ReadName(),tcEffector.ReadTotal()); printf("%s.%s: %g\n",organName,igaBal.ReadName(),igaBal.ReadTotal()); printf("%s.%s: %g\n",organName,antigenBal.ReadName(),antigenBal.ReadTotal()); printf("%s.%s: %g\n",organName,bCellCentroblast.ReadName(),bCellCentroblast.ReadTotal()); printf("%s.%s: %g\n",organName,bCellPlasmaMedullary.ReadName(),bCellPlasmaMedullary.ReadTotal()); printf("%s.%s: %g\n",organName,tcBlast.ReadName(),tcBlast.ReadTotal()); printf("%s.%s: %g\n",organName,thBlast.ReadName(),thBlast.ReadTotal()); printf("%s.%s: %g\n",organName,macrophageApc.ReadName(),macrophageApc.ReadTotal()); printf("%s.%s: %g\n",organName,dendriticApc.ReadName(),dendriticApc.ReadTotal()); dendriticApc.Snapshot(); printf("%s.%s: %g\n",organName,antigen.ReadName(),antigen.ReadTotal()); printf("%s.%s: %g\n",organName,immuneComplex.ReadName(),immuneComplex.ReadTotal()); printf("%s.epitheliaResistive: %g\n",organName,epitheliaResistive); printf("%s.epitheliaApc: %g\n",organName,epitheliaApc ); printf("%s.epitheliaDead: %g\n",organName,epitheliaDead ); printf("%s.epitheliaCell: %g\n",organName,epitheliaCell ); printf("%s.macrophage: %g\n",organName,macrophage ); printf("%s.dendriticImmature: %g\n",organName,dendriticImmature ); printf("%s.%s: %g\n",organName,fdcApc.ReadName(),fdcApc.ReadTotal()); printf("%s.%s: %g\n",organName,thGerminalCenter.ReadName(),thGerminalCenter.ReadTotal()); printf("%s.%s: %g\n",organName,bCellCentrocyteApc.ReadName(),bCellCentrocyteApc.ReadTotal()); printf("%s.%s: %g\n",organName,bCellCentrocyte.ReadName(),bCellCentrocyte.ReadTotal()); printf("%s.%s: %g\n",organName,bCellCentrocyteInitial.ReadName(),bCellCentrocyteInitial.ReadTotal()); printf("%s.%s: %g\n",organName,virtualThEffector.ReadName(),virtualThEffector.ReadTotal()); printf("%s.%s: %g\n",organName,bCellBlast.ReadName(),bCellBlast.ReadTotal()); printf("%s.%s: %g\n",organName,bCellApc.ReadName(),bCellApc.ReadTotal()); printf("%s.%s: %g\n",organName,bCellNaiveRecirculate.ReadName(),bCellNaiveRecirculate.ReadValue(INFLUENZASTRAIN)); printf("%s.%s: %g\n",organName,bCellNaive.ReadName(),bCellNaive.ReadValue(INFLUENZASTRAIN)); printf("%s.%s: %g\n",organName,bCellMemory.ReadName(),bCellMemory.ReadTotal()); printf("%s.%s: %g\n",organName,bCellMemoryMarginal.ReadName(),bCellMemoryMarginal.ReadTotal()); printf("%s.%s: %g\n",organName,thMemory.ReadName(),thMemory.ReadTotal()); printf("%s.%s: %g\n",organName,tcMemory.ReadName(),tcMemory.ReadTotal()); printf("%s.tcTotal: %g\n",organName, tcMemory.ReadTotal() + tcEffector.ReadTotal() ); printf("%s.interferonAlpha: %g\n",organName,interferonAlpha / ( epitheliumvolume/ 1000.0) ); printf("%s.inflammatoryRate: %g\n",organName,inflammatoryRate); printf("%s.inflammatoryOutputRate: %g\n",organName,inflammatoryOutputRate); printf("%s.tnfAlpha: %g\n",organName,tnfAlpha/( epitheliumvolume/ 1000.0) ); printf("%s.fdcGerminalCenter: %g\n",organName,fdcGerminalCenters); printf("%s.il2: %g\n",organName,il2/(tZoneVolume / 1000.0) ); printf("%s.numberOfGerminalCenters: %g\n",organName,numberOfGerminalCenters ); printf("%s.%s: %g\n",organName,igM.ReadName(),igM.ReadTotal()); rate = k2thPrecursorCount * il2 / (kmthPrecursorCount + il2); printf("%s.thPrecursorCount: %g\n",organName, 1.0 / (2.0 * 3600.0 * rate)); rate = k2TcPrecursorCount * il2 / (kmTcPrecursorCount + il2); printf("%s.tcPrecursorCount: %g\n",organName, 1.0 / (2.0 * 3600.0 * rate)); return ; #endif printFlag = 1; snapFlag = 1; bCellNaive.PrintValues(snapFlag); bCellNaiveRecirculate.PrintValues(snapFlag); bCellNaiveMarginalZone.PrintValues(snapFlag); bCellApc.PrintValues(snapFlag); bCellBlast.PrintValues(snapFlag); virtualThEffector.PrintValues(snapFlag); bCellCentroblast.PrintValues(snapFlag); bCellCentrocyteInitial.PrintValues(snapFlag); bCellCentrocyte.PrintValues(snapFlag); bCellCentrocyteApc.PrintValues(snapFlag); thGerminalCenter.PrintValues(snapFlag); fdcApc.PrintValues(snapFlag); plasmaCell.PrintValues(snapFlag); igaBal.PrintValues(snapFlag); bCellPlasmaMedullary.PrintValues(snapFlag); tcEffector.PrintValues(snapFlag); thEffector.PrintValues(snapFlag); dendriticApc.PrintValues(snapFlag); macrophageApc.PrintValues(snapFlag); antigenBal.PrintValues(snapFlag); for (i = 0; i < NUMBEROFBCENTROBLASTPRECURSOR; i++) { bCentroblastPrecursor[i].PrintValues(snapFlag); } /* iForLoop */ for (i = 0; i < NUMBEROFBPLASMAPRECURSOR; i++) { bPlasmaPrecursor[i].PrintValues(snapFlag); } /* iForLoop */ printf("%s:il2 :%g (%g umole/ml) (tZoneVolume:%g ml)\n",organName,il2, il2/(tZoneVolume / 1000.0), (tZoneVolume / 1000.0) ); printf("%s:fdcGerminalCenter :%g\n",organName,fdcGerminalCenters ); return; #if 0 printf("%s:macrophage :%g\n",organName,macrophage ); printf("%s:dendriticImmature :%g\n",organName,dendriticImmature ); printf("%s:interferonAlpha :%g\n",organName,interferonAlpha ); printf("%s:epitheliaResistive :%g\n",organName,epitheliaResistive); printf("%s:epitheliaApc :%g\n",organName,epitheliaApc ); printf("%s:epitheliaDead :%g\n",organName,epitheliaDead ); printf("%s:epitheliaCell :%g\n",organName,epitheliaCell ); thNaive.PrintValues(snapFlag); tcNaive.PrintValues(snapFlag); thBlast.PrintValues(snapFlag); for (i = 0; i < NUMBEROFTHBLASTPRECURSOR; i++) { thBlastPrecursor[i].PrintValues(snapFlag); } /* iForLoop */ for (i = 0; i < NUMBEROFTHEFFECTORPRECURSOR; i++) { thEffectorPrecursor[i].PrintValues(snapFlag); } /* iForLoop */ tcBlast.PrintValues(snapFlag); for (i = 0; i < NUMBEROFTCBLASTPRECURSOR; i++) { tcBlastPrecursor[i].PrintValues(snapFlag); } /* iForLoop */ for (i = 0; i < NUMBEROFTCEFFECTORPRECURSOR; i++) { tcEffectorPrecursor[i].PrintValues(snapFlag); } /* iForLoop */ #endif } void GenericImmuneTissue::ExecuteLymphJunction () { // printf("bloodbCellNaiveRecirculate: rate:%g (k2:%g)\n",lymphOutputbCellNaiveRecirculate[0] * k2LymphJunction, k2LymphJunction); lymphOutputbCellNaiveRecirculate.MigrateOutput( bloodbCellNaiveRecirculate ,k2LymphJunction) ; lymphOutputThNaive.MigrateOutput( bloodThNaive ,k2LymphJunction) ; lymphOutputTcNaive.MigrateOutput( bloodTcNaive ,k2LymphJunction) ; lymphOutputtcEffector.MigrateOutput( bloodtcEffector ,k2LymphJunction) ; lymphOutputthEffector.MigrateOutputWithProfile( bloodthEffector ,k2LymphJunction) ; lymphOutputplasmaCell.MigrateOutputWithProfile( bloodplasmaCell ,k2LymphJunction) ; lymphOutputigM.MigrateOutput( bloodigM ,k2LymphJunction) ; lymphOutputbCellMemory.MigrateOutputWithProfile( bloodbCellMemory ,k2LymphJunction) ; lymphOutputthMemory.MigrateOutputWithProfile( bloodthMemory ,k2LymphJunction) ; lymphOutputtcMemory.MigrateOutputWithProfile( bloodtcMemory ,k2LymphJunction) ; } void GenericImmuneTissue::ExecuteBoneMarrow () { double rate; int i; rate = kHalfLifeGmcsf * bloodgmcsf ; bloodgmcsf -= rate; rate = kHalfLifeil3 * bloodil3 ; bloodil3 -= rate; rate = kHalfLifeil5 * bloodil5 ; bloodil5 -= rate; bloodeosinophil += kGenerateeosinophil * (1.0 + knGenerateeosinophil * bloodil5 / (kmGenerateeosinophil + bloodil5)); bloodmastCell += kGeneratemastCell * (1.0 + knGeneratemastCell * bloodil3 / (kmGeneratemastCell + bloodil3)); bloodmonocyte += kGenerateMonocyte * (1.0 + knGenerateMonocyte * bloodgmcsf / (kmGenerateMonocyte + bloodgmcsf)); bloodplatelets += kGeneratePlatelets; bloodrbc += kGenerateRbc; bloodbCellNaive.AddStrain(BACKGROUNDSTRAIN, kGenerateBCells); bloodThNaive.AddStrain(BACKGROUNDSTRAIN , kGenerateThCells); bloodTcNaive.AddStrain(BACKGROUNDSTRAIN , kGenerateTcCells); for (i = BACKGROUNDSTRAIN + 1; i < TOTALSTRAINS; i++) { bloodbCellNaive.AddStrain(i, kGenerateBCells * STRAINFREQUENCY); bloodThNaive.AddStrain(i , kGenerateThCells * STRAINFREQUENCY); bloodTcNaive.AddStrain(i , kGenerateTcCells * STRAINFREQUENCY); } /* iForLoop */ bloodthEffector.MigrateOutput(thEffector , k2BloodInput_thEffector) ; bloodtcEffector.MigrateOutput(tcEffector , k2BloodInput_tcEffector) ; bloodplasmaCell.MigrateOutputWithProfile(plasmaCell, k2BloodInputPlasmaCell) ; plasmaCell.MigrateOutput(kHalfLifePlasmaCell); tcEffector.MigrateAicd(dendriticApc, k2tcAicd,kmtcAicd,k0tcAicd); thEffector.MigrateAicd(dendriticApc, k2thAicd,kmthAicd,k0thAicd); tcEffector.ApcDeActivate(bloodtcMemory,dendriticApc, k2TcEffector2Memory,kmTcEffector2Memory); thEffector.ApcDeActivate(bloodthMemory,dendriticApc, k2ThEffector2Memory,kmThEffector2Memory); } int GenericImmuneTissue::FindTissueIndex (char *s) { int i ; for (i = 0; i < NUMBEROFTISSUECONSTANTS; i++) { if (strcmp(s, tissueConstants[i].name) == 0) { return(i) ; } /* if */ } /* iForLoop */ printf("FindTissueIndex: can't find: %s\n",s); exit(1) ; return(0) ; } void GenericImmuneTissue::ExecuteIntestines () { ExecuteGeneralTissue(); } void GenericImmuneTissue::ExecuteLungs () { ExecuteGeneralTissue(); } void GenericImmuneTissue::ExecuteLiver () { double rate; rate = bloodplatelets * k2BloodInput_platelets; bloodplatelets -= rate ; ExecuteGeneralTissue(); } void GenericImmuneTissue::ExecuteGeneralTissue () { double rate; bCellMemory.MigrateOutputWithProfile(lymphOutputbCellMemory , k2LymphOutput_bCellMemory) ; thMemory.MigrateOutputWithProfile(lymphOutputthMemory , k2LymphOutput_thMemory) ; tcMemory.MigrateOutputWithProfile(lymphOutputtcMemory , k2LymphOutput_tcMemory) ; bloodbCellMemory.MigrateOutputWithProfile(bCellMemory , k2BloodInput_bCellMemory) ; bloodthMemory.MigrateOutputWithProfile( thMemory, k2BloodInput_thMemory) ; bloodtcMemory.MigrateOutputWithProfile( tcMemory, k2BloodInput_tcMemory) ; bloodbCellNaiveRecirculate.MigrateOutput(bCellNaiveRecirculate , k2BloodInput_bCellNaiveRecirculate) ; bloodthEffector.MigrateOutputWithProfile(thEffector , k2BloodInput_thEffector) ; bloodtcEffector.MigrateOutput(tcEffector , k2BloodInput_tcEffector) ; bloodplasmaCell.MigrateOutputWithProfile(plasmaCell, k2BloodInputPlasmaCell) ; bCellNaiveRecirculate.MigrateOutput(lymphOutputbCellNaiveRecirculate , k2LymphOutput_bCellNaiveRecirculate) ; rate = bloodmonocyte * k2BloodInput_Macrophage; bloodmonocyte -= rate ; macrophage += rate; rate = bloodmastCell * k2BloodInput_mastCell; bloodmastCell -= rate ; mastCellNaive += rate; rate = bloodeosinophil * k2BloodInput_eosinophil ; bloodeosinophil -= rate ; eosinophil += rate; rate = bloodmonocyte * k2BloodInput_Dendritic; bloodmonocyte -= rate ; dendriticImmature += rate; /* die stuff (for now) */ rate = macrophage * (k2MacrophageDie - k2macrophageReplicate); macrophage -= rate; rate = (k2DendriticDie - k2DendriticReplicate) * dendriticImmature; dendriticImmature -= rate; plasmaCell.MigrateOutput(kHalfLifePlasmaCell); tcEffector.MigrateAicd(dendriticApc, k2tcAicd,kmtcAicd,k0tcAicd); thEffector.MigrateAicd(dendriticApc, k2thAicd,kmthAicd,k0thAicd); tcEffector.ApcDeActivate(tcMemory,dendriticApc, k2TcEffector2Memory,kmTcEffector2Memory); thEffector.ApcDeActivate(thMemory,dendriticApc, k2ThEffector2Memory,kmThEffector2Memory); } void GenericImmuneTissue::ExecuteLymphNodeGeneral () { bCellMemory.MigrateOutputWithProfile(lymphOutputbCellMemory , k2LymphOutput_bCellMemory) ; thMemory.MigrateOutputWithProfile(lymphOutputthMemory , k2LymphOutput_thMemory) ; tcMemory.MigrateOutputWithProfile(lymphOutputtcMemory , k2LymphOutput_tcMemory) ; lymphInputbCellMemory.MigrateOutputWithProfile(bCellMemory , k2LymphInput_bCellMemory) ; lymphInputthMemory.MigrateOutputWithProfile( thMemory , k2LymphInput_thMemory) ; lymphInputtcMemory.MigrateOutputWithProfile( tcMemory , k2LymphInput_tcMemory) ; lymphInputbCellNaiveRecirculate.MigrateOutput(bCellNaiveRecirculate , k2LymphInput_bCellNaiveRecirculate) ; bCellNaiveRecirculate.MigrateOutput(lymphOutputbCellNaiveRecirculate , k2LymphOutput_bCellNaiveRecirculate) ; thNaive.MigrateOutput(lymphOutputThNaive , k2LymphOutput_thNaive) ; tcNaive.MigrateOutput(lymphOutputTcNaive , k2LymphOutput_tcNaive) ; bloodTcNaive.MigrateOutput(tcNaive , k2BloodInput_tcNaive) ; tcNaive.MigrateOutput( k2tcNaiveDie) ; bloodThNaive.MigrateOutput(thNaive , k2BloodInput_thNaive) ; thNaive.MigrateOutput( k2thNaiveDie) ; bloodbCellNaive.MigrateOutput(bCellNaive , k2BloodInput_bCellNaive) ; bloodbCellNaiveRecirculate.MigrateOutput(bCellNaiveRecirculate , k2BloodInput_bCellNaiveRecirculate) ; bCellNaive.MigrateOutput( k2bCellNaiveDie) ; bCellNaive.MigrateOutput( bCellNaiveRecirculate ,k2bCellNaiveFollicle / (kibCellNaiveFollicle + bCellNaiveRecirculate.ReadTotal()) ) ; bCellNaiveRecirculate.MigrateOutput(k2bCellRecirculateDie * bCellNaive.ReadTotal() ) ; } void GenericImmuneTissue::ExecutePeyersPatch () { bCellMemory.MigrateOutputWithProfile(lymphOutputbCellMemory , k2LymphOutput_bCellMemory) ; thMemory.MigrateOutputWithProfile(lymphOutputthMemory , k2LymphOutput_thMemory) ; tcMemory.MigrateOutputWithProfile(lymphOutputtcMemory , k2LymphOutput_tcMemory) ; ExecuteLymphNodeInternal (); /* test!!! */ bCellCentrocyte.MigrateOutputWithProfile(lymphOutputbCellMemory,k2Centrocyte2bCellMemory); bCellNaiveRecirculate.MigrateOutput(lymphOutputbCellNaiveRecirculate , k2LymphOutput_bCellNaiveRecirculate) ; thNaive.MigrateOutput(lymphOutputThNaive , k2LymphOutput_thNaive) ; tcNaive.MigrateOutput(lymphOutputTcNaive , k2LymphOutput_tcNaive) ; tcEffector.MigrateOutput(lymphOutputtcEffector , k2LymphOutput_tcEffector) ; thEffector.MigrateOutputWithProfile(lymphOutputthEffector , k2LymphOutput_thEffector) ; plasmaCell.MigrateOutputWithProfile(lymphOutputplasmaCell, k2LymphOutput_plasmaCell); igM.MigrateOutput(lymphOutputigM , k2LymphOutput_igM) ; } void GenericImmuneTissue::ExecuteLymphNode () { bCellMemory.MigrateOutputWithProfile(lymphOutputbCellMemory , k2LymphOutput_bCellMemory) ; thMemory.MigrateOutputWithProfile(lymphOutputthMemory , k2LymphOutput_thMemory) ; tcMemory.MigrateOutputWithProfile(lymphOutputtcMemory , k2LymphOutput_tcMemory) ; lymphInputbCellMemory.MigrateOutputWithProfile(bCellMemory , k2LymphInput_bCellMemory) ; lymphInputthMemory.MigrateOutputWithProfile( thMemory , k2LymphInput_thMemory) ; lymphInputtcMemory.MigrateOutputWithProfile( tcMemory , k2LymphInput_tcMemory) ; lymphInputbCellNaiveRecirculate.MigrateOutput(bCellNaiveRecirculate , k2LymphInput_bCellNaiveRecirculate) ; lymphInputmacrophageApc.MigrateOutput(macrophageApc , k2LymphInput_macrophageApc) ; lymphInputdendriticApc.MigrateOutputWithProfile(dendriticApc , k2LymphInput_dendriticApc) ; ExecuteLymphNodeInternal (); /* test!!! */ bCellCentrocyte.MigrateOutputWithProfile(lymphOutputbCellMemory,k2Centrocyte2bCellMemory); bCellNaiveRecirculate.MigrateOutput(lymphOutputbCellNaiveRecirculate , k2LymphOutput_bCellNaiveRecirculate) ; thNaive.MigrateOutput(lymphOutputThNaive , k2LymphOutput_thNaive) ; tcNaive.MigrateOutput(lymphOutputTcNaive , k2LymphOutput_tcNaive) ; tcEffector.MigrateOutput(lymphOutputtcEffector , k2LymphOutput_tcEffector) ; thEffector.MigrateOutputWithProfile(lymphOutputthEffector , k2LymphOutput_thEffector) ; plasmaCell.MigrateOutputWithProfile(lymphOutputplasmaCell, k2LymphOutput_plasmaCell); igM.MigrateOutput(lymphOutputigM , k2LymphOutput_igM) ; } void GenericImmuneTissue::ExecuteSpleen () { double rate; bloodbCellMemory.MigrateOutputWithProfile(bCellMemory , k2BloodInput_bCellMemory) ; bloodthMemory.MigrateOutputWithProfile( thMemory, k2BloodInput_thMemory) ; bloodtcMemory.MigrateOutputWithProfile( tcMemory, k2BloodInput_tcMemory) ; bCellMemory.MigrateOutputWithProfile( bloodbCellMemory, k2BloodOutput_bCellMemory) ; thMemory.MigrateOutputWithProfile( bloodthMemory, k2BloodOutput_thMemory) ; tcMemory.MigrateOutputWithProfile( bloodtcMemory, k2BloodOutput_tcMemory) ; bCellNaive.MigrateOutput( bloodbCellNaive, k2BloodOutput_bCellNaive) ; bCellNaiveRecirculate.MigrateOutput( bloodbCellNaiveRecirculate, k2BloodOutput_bCellNaiveRecirculate) ; // GenericImmuneCell::ResetPrint(printFlag); thNaive.MigrateOutput( bloodThNaive, k2BloodOutput_thNaive); tcNaive.MigrateOutput( bloodTcNaive, k2BloodOutput_tcNaive); // printFlag = 0; // GenericImmuneCell::ResetPrint(printFlag); bCellNaiveRecirculate.MigrateOutput( bCellNaiveMarginalZone ,k2bCellNaiveFollicle / (kibCellNaiveFollicle + bCellNaiveMarginalZone.ReadTotal()) ) ; bCellNaiveMarginalZone.MigrateOutput(k2bCellRecirculateDie * bCellNaive.ReadTotal() ) ; rate = bloodrbc * k2BloodInput_rbc; bloodrbc -= rate ; rate = bloodplatelets * k2BloodInput_platelets; bloodplatelets -= rate ; rate = bloodmonocyte * k2BloodInput_Macrophage; bloodmonocyte -= rate ; macrophage += rate; /* die stuff (for now) */ rate = macrophage * (k2MacrophageDie - k2macrophageReplicate); macrophage -= rate; } void GenericImmuneTissue::ExecuteLymphNodeInternal () { double rate; int i; dendriticApc.MigrateOutput(kHalfLifeDendriticApc); rate = kHalfLifeIl2 * il2 ; il2 -= rate ; /* Tc cell */ bloodTcNaive.MigrateOutput(tcNaive , k2BloodInput_tcNaive) ; tcNaive.MigrateOutput( k2tcNaiveDie) ; tcNaive.ApcActivate(tcBlastPrecursor[0],dendriticApc,k2TcNaiveActivate,kmTcNaiveActivate); rate = k2BlastIl2 * tcBlastPrecursorTotal; il2 += rate; tcBlastCount += tcBlastDCount ; if (tcBlastCount >= 1.0) { printf("*********************** tcBlastCount\n"); tcBlastCount = 0.0; tcBlastPrecursor[3].ActivatePrecursor(tcBlast,dendriticApc,tcAnergy, k2TcBlastPrecursorActivate,kmTcBlastPrecursorActivate); tcBlastPrecursor[2].ActivatePrecursor(tcBlastPrecursor[3],dendriticApc,tcAnergy, k2TcBlastPrecursorActivate,kmTcBlastPrecursorActivate); tcBlastPrecursor[1].ActivatePrecursor(tcBlastPrecursor[2],dendriticApc,tcAnergy, k2TcBlastPrecursorActivate,kmTcBlastPrecursorActivate); tcBlastPrecursor[0].ActivatePrecursor(tcBlastPrecursor[1],dendriticApc,tcAnergy, k2TcBlastPrecursorActivate,kmTcBlastPrecursorActivate); tcBlastPrecursorTotal = tcBlastPrecursor[1].ReadTotal() + tcBlastPrecursor[2].ReadTotal() + tcBlastPrecursor[3].ReadTotal() + tcBlast.ReadTotal(); } /* if */ rate = k2TcPrecursorCount * il2 / (kmTcPrecursorCount + il2); tcPrecursorCount += rate ; if (tcPrecursorCount >= 1.0) { printf("####################### shifting: rate:%g hours, il2:%g\n",1.0 / (2.0 * 3600.0 * rate),il2); tcPrecursorCount = 0.0 ; tcEffectorPrecursor[NUMBEROFTCEFFECTORPRECURSOR - 1].Replicate(tcEffector,kTcBlastReplicate,2.0) ; for (i = (NUMBEROFTCEFFECTORPRECURSOR - 2); i >= 0; i--) { tcEffectorPrecursor[i].Replicate(tcEffectorPrecursor[i + 1],kTcBlastReplicate,2.0); } /* iForLoop */ tcBlast.Replicate(tcEffectorPrecursor[0],kTcBlastReplicate,2.0) ; for (i = 0, adjustTcBlast = 0.0; i < NUMBEROFTCEFFECTORPRECURSOR; i++) { if (i < TCEFFECTORCUTOFF) { adjustTcBlast += tcEffectorPrecursor[i].ReadTotal(); /* blast transitions to effector */ } /* if */ } /* iForLoop */ } /* if */ tcMemory.ApcActivate(tcBlastMemory,dendriticApc,k2TcMemoryActivate,kmTcMemoryActivate); rate = k2TcPrecursorCountMemory * il2 / (kmTcPrecursorCountMemory + il2); tcPrecursorCountMemory += rate ; if (tcPrecursorCountMemory >= 1.0) { tcPrecursorCountMemory = 0.0 ; tcEffectorPrecursorMemory[NUMBEROFTCEFFECTORPRECURSORMEMORY - 1].Replicate(tcEffector,kTcBlastReplicateMemory,2.0) ; for (i = (NUMBEROFTCEFFECTORPRECURSORMEMORY - 2); i >= 0; i--) { tcEffectorPrecursorMemory[i].Replicate(tcEffectorPrecursorMemory[i + 1],kTcBlastReplicateMemory,2.0); } /* iForLoop */ tcBlastMemory.Replicate(tcEffectorPrecursorMemory[0],kTcBlastReplicateMemory,2.0) ; for (i = 0, adjustTcBlastMemory = 0.0 ; i < NUMBEROFTCEFFECTORPRECURSORMEMORY; i++) { if (i < TCEFFECTORCUTOFFMEMORY) { adjustTcBlastMemory += tcEffectorPrecursorMemory[i].ReadTotal(); /* blast transitions to effector */ } /* if */ } /* iForLoop */ } /* if */ rate = k2EffectorPrecursorIl2 * (adjustTcBlast + adjustTcBlastMemory) ; il2 += rate ; rate = k2EffectorPrecursorIl2Autocrine * (adjustTcBlast + adjustTcBlastMemory) * il2 ; il2 -= rate ; /* Th cell */ bloodThNaive.MigrateOutput(thNaive , k2BloodInput_thNaive) ; thNaive.MigrateOutput( k2thNaiveDie) ; thNaive.ApcActivate(thBlastPrecursor[0],dendriticApc,k2ThNaiveActivate,kmThNaiveActivate); rate = k2BlastIl2 * thBlastPrecursorTotal; il2 += rate; thBlastCount += thBlastDCount ; if (thBlastCount >= 1.0) { thBlastCount = 0.0; thBlastPrecursor[3].ActivatePrecursor(thBlast,dendriticApc,thAnergy, k2thBlastPrecursorActivate,kmthBlastPrecursorActivate); thBlastPrecursor[2].ActivatePrecursor(thBlastPrecursor[3],dendriticApc,thAnergy, k2thBlastPrecursorActivate,kmthBlastPrecursorActivate); thBlastPrecursor[1].ActivatePrecursor(thBlastPrecursor[2],dendriticApc,thAnergy, k2thBlastPrecursorActivate,kmthBlastPrecursorActivate); thBlastPrecursor[0].ActivatePrecursor(thBlastPrecursor[1],dendriticApc,thAnergy, k2thBlastPrecursorActivate,kmthBlastPrecursorActivate); thBlastPrecursorTotal = thBlastPrecursor[2].ReadTotal() + thBlastPrecursor[3].ReadTotal() + thBlast.ReadTotal(); } /* if */ rate = k2thPrecursorCount * il2 / (kmthPrecursorCount + il2); thPrecursorCount += rate ; if (thPrecursorCount >= 1.0) { thPrecursorCount = 0.0 ; thEffectorPrecursor[NUMBEROFTHEFFECTORPRECURSOR - 1].Replicate(thEffector,kthBlastReplicate,2.0) ; for (i = (NUMBEROFTHEFFECTORPRECURSOR - 2); i >= 0; i--) { thEffectorPrecursor[i].Replicate(thEffectorPrecursor[i + 1],kthBlastReplicate,2.0); } /* iForLoop */ thBlast.Replicate(thEffectorPrecursor[0],kthBlastReplicate,2.0) ; virtualThEffector.ClearValues(); for (i = 0; i < NUMBEROFTHEFFECTORPRECURSOR; i++) { thEffectorPrecursor[i].Polarization(dendriticApc, k2PolarizationTh1, kmPolarizationTh1, k2PolarizationTh2, kmPolarizationTh2 ); thEffectorPrecursor[i].CopyOutputWithProfile(virtualThEffector,1.0); } /* iForLoop */ thEffector.CopyOutputWithProfile(virtualThEffector,1.0); thEffectorPrecursorTotal = virtualThEffector.ReadTotal(); th2EffectorPrecursorTotal = virtualThEffector.ReadTotal(TH2); } /* if */ thMemory.ApcActivate(thBlastMemory,dendriticApc,k2ThMemoryActivate,kmThMemoryActivate); rate = k2thPrecursorCountMemory * il2 / (kmthPrecursorCountMemory + il2); thPrecursorCountMemory += rate ; if (thPrecursorCountMemory >= 1.0) { thPrecursorCountMemory = 0.0 ; thEffectorPrecursorMemory[NUMBEROFTHEFFECTORPRECURSORMEMORY - 1].Replicate(thEffector,kthBlastReplicateMemory,2.0) ; for (i = (NUMBEROFTHEFFECTORPRECURSORMEMORY - 2); i >= 0; i--) { thEffectorPrecursorMemory[i].Replicate(thEffectorPrecursorMemory[i + 1],kthBlastReplicateMemory,2.0); } /* iForLoop */ thBlastMemory.Replicate(thEffectorPrecursorMemory[0],kthBlastReplicateMemory,2.0) ; virtualThEffectorMemory.ClearValues(); thEffectorPrecursorMemory[0].RePolarization(dendriticApc, k2PolarizationTh1, kmPolarizationTh1, k2PolarizationTh2, kmPolarizationTh2 ); for (i = 1; i < NUMBEROFTHEFFECTORPRECURSOR; i++) { thEffectorPrecursorMemory[i].Polarization(dendriticApc, k2PolarizationTh1, kmPolarizationTh1, k2PolarizationTh2, kmPolarizationTh2 ); thEffectorPrecursorMemory[i].CopyOutputWithProfile(virtualThEffectorMemory,1.0); } /* iForLoop */ thEffectorPrecursorTotalMemory = virtualThEffectorMemory.ReadTotal(); th2EffectorPrecursorTotalMemory = virtualThEffectorMemory.ReadTotal(TH2); } /* if */ rate = k2EffectorPrecursorIl2 * (thEffectorPrecursorTotal + thEffectorPrecursorTotalMemory - th2EffectorPrecursorTotal - th2EffectorPrecursorTotalMemory ); il2 += rate ; rate = k2EffectorPrecursorIl2Autocrine * (thEffectorPrecursorTotal + thEffectorPrecursorTotalMemory) * il2 ; il2 -= rate ; /* bCell */ bloodbCellNaive.MigrateOutput(bCellNaive , k2BloodInput_bCellNaive) ; bloodbCellNaiveRecirculate.MigrateOutput(bCellNaiveRecirculate , k2BloodInput_bCellNaiveRecirculate) ; bCellNaive.MigrateOutput( k2bCellNaiveDie) ; bCellNaive.MigrateOutput( bCellNaiveRecirculate ,k2bCellNaiveFollicle / (kibCellNaiveFollicle + bCellNaiveRecirculate.ReadTotal()) ) ; bCellNaiveRecirculate.MigrateOutput(k2bCellRecirculateDie * bCellNaive.ReadTotal() ) ; bCellNaiveRecirculate.ApcActivate(bCellApc,dendriticApc,k2bCellNaiveRecirculateActivate,kmbCellNaiveRecirculateActivate); bCellNaive.ApcActivate(bCellApc,dendriticApc,k2bCellNaiveRecirculateActivate,kmbCellNaiveRecirculateActivate); bCellApc.MigrateOutput(kHalfLifebCellApc); bCellApc.ApcActivate(bCellBlast,virtualThEffector,k2bCellApcActivate,kmbCellApcActivate); bCellMemoryMarginal.ApcActivate(bCellApcMemory,antigen,k2bCellMemoryMarginalActivate,kmbCellMemoryMarginalActivate); bCellMemory.ApcActivate(bCellApcMemory,dendriticApc,k2bCellMemoryActivate,kmbCellMemoryActivate); bCellApcMemory.MigrateOutput(kHalfLifebCellApcMemory); bCellApcMemory.ApcActivate(bCellBlastMemory,virtualThEffector,k2bCellApcMemoryActivate,kmbCellApcMemoryActivate); bBlastCount += bBlastDCount ; if (bBlastCount >= 1.0) { bBlastCount = 0.0; bCentroblastPrecursor[NUMBEROFBCENTROBLASTPRECURSOR - 1].Replicate(bCellCentroblast,kbCentroblastReplicate,2.0) ; for (i = (NUMBEROFBCENTROBLASTPRECURSOR - 2); i >= 0; i--) { bCentroblastPrecursor[i].Replicate(bCentroblastPrecursor[i + 1],kbCentroblastReplicate,2.0); } /* iForLoop */ bCellBlast.Replicate(bCentroblastPrecursor[0],kbCentroblastReplicateInitial,2.0) ; bCellBlastMemory.Replicate(bCentroblastPrecursor[0],kbCentroblastReplicateInitialMemory,2.0) ; for (i = 0; i < NUMBEROFBCENTROBLASTPRECURSOR; i++) { bCentroblastPrecursor[i].ClassSwitches (virtualThEffector,dendriticApc, k2SwitchesIgg, kmSwitchesIgg, k2SwitchesIga, kmSwitchesIga, kiSwitchesIga ,k2SwitchesIgg1, kmSwitchesIgg1, k2SwitchesIge, kmSwitchesIge); } /* iForLoop */ printf("number of germinal centers: %g\n",numberOfGerminalCenters); } /* if */ numberOfGerminalCenters = bCellCentroblast.ReadTotal() / CENTROBLASTPERGERMINALCENTER ; if (numberOfGerminalCenters < 0.001) { numberOfGerminalCenters = 0.001; } /* if */ /* bCell germinal center */ bCellCentroblast.MigrateOutput(bCellDeadCentroblast,kHalfLifebCellCentroblast); bCellCentroblast.CopyOutputWithProfile(bCellCentrocyteInitial,k2Centroblast2Centrocyte); bCellCentrocyteInitial.ApcActivateWithoutStrain(bCellCentrocyteApc,fdcApc,fdcGerminalCenters,k2bCellCentrocyteInitialActivate,kmbCellCentrocyteInitialActivate * numberOfGerminalCenters,knbCellCentrocyteInitialActivate); bCellCentrocyteApc.ApcActivate(bCellCentrocyte,thGerminalCenter,k2bCellCentrocyteActivate,kmbCellCentrocyteActivate * numberOfGerminalCenters); bCellCentrocyteInitial.MigrateOutput(kHalfLifebCellCentrocyteInitial); bCellCentrocyteApc.MigrateOutput(kHalfLifebCellCentrocyteApc); bCellCentrocyte.MigrateCentroblastWithProfile(bCellCentroblast,bCellDeadCentroblast, k2Centrocyte2Centroblast); bCellCentrocyte.MigrateOutputWithProfile(plasmaCell,k2Centrocyte2PlasmaCell); // bCellCentrocyte.MigrateOutputWithProfile(bCellMemory,k2Centrocyte2bCellMemory); bCellCentrocyte.MigrateOutputWithProfile(bCellMemoryMarginal,k2Centrocyte2bCellMemoryMarginal); rate = numberOfGerminalCenters * MAXIMUMTHPERGERMINALCENTER - thGerminalCenter.ReadTotal() ; if (rate > 0.0) { thEffector.MigrateOutput(thGerminalCenter, k2Effector2GerminalCenter); } /* if */ thGerminalCenter.MigrateOutput(kHalfLifeThGerminalCenter) ; rate = numberOfGerminalCenters * MAXIMUMFDCPERGERMINALCENTER - fdcApc.ReadTotal() ; if (rate > 0.0) { fdcApc.ApcActivateWithoutStrain(fdcGerminalCenters, immuneComplex,k2FdcApc, kmFdcApc, knFdcApc); } /* if */ /* red pulp */ bPlasmaCount += bPlasmaDCount ; if (bPlasmaCount >= 1.0) { bPlasmaCount = 0.0; bPlasmaPrecursor[NUMBEROFBPLASMAPRECURSOR - 1].ReplicateSpecial(bCellPlasmaMedullary,plasmaCell,kbPlasmaReplicate,kbPlasmaReplicateDecision) ; for (i = (NUMBEROFBPLASMAPRECURSOR - 2); i >= 0; i--) { bPlasmaPrecursor[i].Replicate(bPlasmaPrecursor[i + 1],kbPlasmaReplicate,2.0); } /* iForLoop */ bCellBlast.Replicate(bPlasmaPrecursor[0],kbPlasmaReplicateInitial,2.0) ; bCellBlastMemory.Replicate(bPlasmaPrecursor[0],kbPlasmaReplicateInitialMemory,2.0) ; } /* if */ bCellPlasmaMedullary.CopyOutputExtractProfile(igM,k2PlasmaMedullary2IgM, IGM); bCellPlasmaMedullary.MigrateOutput(kHalfLifebCellPlasmaMedullary); antigen.MigrateOutputWithProfile(immuneComplex,igM,k2immuneComplex,knimmuneComplex); macrophageApc.Replicate(antigen,kHalfLifeMacrophageApc,knMacrophageApc); /* macrophageApc dies */ #if 1 /* ? Tests ? */ rate = k2EffectorKill * macrophageApc.ReadValue(INFLUENZASTRAIN) * tcEffector.ReadValue(INFLUENZASTRAIN) ; macrophageApc.AddStrain(INFLUENZASTRAIN,-rate) ; tcEffector.AddStrain(INFLUENZASTRAIN,-rate * knEffectorKill) ; rate = k2EffectorKillDendritic * dendriticApc.ReadValue(INFLUENZASTRAIN) * tcEffector.ReadValue(INFLUENZASTRAIN) ; dendriticApc.AddStrain(INFLUENZASTRAIN,-rate) ; tcEffector.AddStrain(INFLUENZASTRAIN,-rate * knEffectorKill) ; #endif } void GenericImmuneTissue::ExecuteInfusion (int infusionFlag) { if (infusionFlag) { // antigenBal.AddStrain(INFLUENZASTRAIN, 2.9e4 * 420.0); antigenBal.AddStrain(RYEGRASSSTRAIN, 1.2e8 ); #if 0 macrophage = 0.0; dendriticImmature = 0.0; macrophage += 2.3e10 * BRONCHIALFRACTION; dendriticImmature += 2.3e8 * BRONCHIALFRACTION; #endif } /* if */ #if 0 igaBal.ClearValues(); plasmaCell.ClearValues(); bloodplasmaCell.ClearValues(); // lymphInputplasmaCell.ClearValues(); lymphOutputplasmaCell.ClearValues(); #endif } double GenericImmuneTissue::stepTime = 0.0; GenericImmuneTissue::GenericImmuneTissue(VesselSegment *newCapillary, VesselSegment *newInputLymphDuct, VesselSegment *newOutputLymphDuct, VesselSegment *newbloodReservoir, double newWeight, double newVolume, char *newModelName, char *newOrganName ,double newdTime ) : bloodmonocyte( newCapillary->FindSubstance("monocyte", '-') ), bloodplatelets( newCapillary->FindSubstance("platelets", '-') ), bloodrbc( newCapillary->FindSubstance("rbc", '-') ), bloodgmcsf( newCapillary->FindSubstance("gmcsf", '-') ), bloodil3( newCapillary->FindSubstance("il3", '-') ), bloodil5( newCapillary->FindSubstance("il5", '-') ), bloodeosinophil( newCapillary->FindSubstance("eosinophil", '-') ), bloodmastCell( newCapillary->FindSubstance("mastCell", '-') ), bloodbCellMemory ( newbloodReservoir->FindImmuneCell( "bCellMemory" )), bloodthMemory ( newbloodReservoir->FindImmuneCell( "thMemory" )), bloodtcMemory ( newbloodReservoir->FindImmuneCell( "tcMemory" )), lymphInputbCellMemory ( newInputLymphDuct->FindImmuneCell( "bCellMemory" )), lymphInputthMemory ( newInputLymphDuct->FindImmuneCell( "thMemory" )), lymphInputtcMemory ( newInputLymphDuct->FindImmuneCell( "tcMemory" )), lymphOutputbCellMemory ( newOutputLymphDuct->FindImmuneCell( "bCellMemory" )), lymphOutputthMemory ( newOutputLymphDuct->FindImmuneCell( "thMemory" )), lymphOutputtcMemory ( newOutputLymphDuct->FindImmuneCell( "tcMemory" )), bloodtcEffector ( newbloodReservoir->FindImmuneCell( "tcEffector" )), bloodThNaive ( newbloodReservoir->FindImmuneCell( "thNaive" )), bloodTcNaive ( newbloodReservoir->FindImmuneCell( "tcNaive" )), bloodbCellNaive ( newbloodReservoir->FindImmuneCell( "bCellNaive" )), bloodbCellNaiveRecirculate ( newbloodReservoir->FindImmuneCell( "bCellNaiveRecirculate" )), lymphInputmacrophageApc ( newInputLymphDuct->FindImmuneCell( "macrophageApc" )), lymphInputdendriticApc ( newInputLymphDuct->FindImmuneCell( "dendriticApc" )), lymphInputbCellNaiveRecirculate ( newInputLymphDuct->FindImmuneCell( "bCellNaiveRecirculate" )), lymphInputtcEffector ( newInputLymphDuct->FindImmuneCell( "tcEffector" )), lymphOutputbCellNaiveRecirculate ( newOutputLymphDuct->FindImmuneCell( "bCellNaiveRecirculate" )), lymphOutputThNaive ( newOutputLymphDuct->FindImmuneCell( "thNaive" )), lymphOutputTcNaive ( newOutputLymphDuct->FindImmuneCell( "tcNaive" )), lymphOutputtcEffector ( newOutputLymphDuct->FindImmuneCell( "tcEffector" )), lymphOutputmacrophageApc ( newOutputLymphDuct->FindImmuneCell( "macrophageApc" )), lymphOutputdendriticApc ( newOutputLymphDuct->FindImmuneCell( "dendriticApc" )), bloodigM ( newbloodReservoir->FindImmuneCell( "igM" )), bloodigA ( newbloodReservoir->FindImmuneCell( "igA" )), bloodigG ( newbloodReservoir->FindImmuneCell( "igG" )), bloodthEffector ( newbloodReservoir->FindImmuneCell( "thEffector" )), bloodplasmaCell ( newbloodReservoir->FindImmuneCell( "plasmaCell" )), lymphInputthEffector ( newInputLymphDuct->FindImmuneCell( "thEffector" )), lymphOutputigM ( newOutputLymphDuct->FindImmuneCell( "igM" )), lymphOutputigA ( newOutputLymphDuct->FindImmuneCell( "igA" )), lymphOutputigG ( newOutputLymphDuct->FindImmuneCell( "igG" )), lymphOutputthEffector ( newOutputLymphDuct->FindImmuneCell( "thEffector" )), lymphOutputplasmaCell ( newOutputLymphDuct->FindImmuneCell( "plasmaCell" )) { double reservoirVolume, capillaryVolume,lymphInputVolume, organWeight, organVolume; int tissueIndex,i; double balvolume,x1 ; double emptyStrain[TOTALSTRAINS] = {0.0, 0.0,0.0}; profileData emptyProfile[TOTALSTRAINS] = {{1.0, 0.0, 0.0,0.0},{1.0, 0.0, 0.0,0.0},{1.0, 0.0, 0.0,0.0} }; profileData prekDendriticInfectionProfile[TOTALSTRAINS] = {{0.0, 0.0, 0.0,0.0},{1.0, 1.0, 0.0,0.0},{0.0, 0.0, 0.0,0.0}}; profileData prekDendriticAllergyProfile[TOTALSTRAINS] = {{0.0, 0.0, 0.0,0.0},{0.0, 0.0, 0.0,0.0},{0.0, 1.0, 0.0, 0.0}}; double antigenTestStrain[TOTALSTRAINS] = {0.0, 0.0,0.0}; stepTime = newdTime; modelName = newModelName; organName = newOrganName; organWeight = newWeight ; organVolume = newVolume; outputLymphDuct = newOutputLymphDuct; inputLymphDuct = newInputLymphDuct; bloodReservoir = newbloodReservoir; capillary = newCapillary; capillaryVolume = capillary->ReadVolume('T'); reservoirVolume = bloodReservoir->ReadVolume('T'); lymphInputVolume = inputLymphDuct->ReadVolume('T'); tZoneVolume = 1.0; balvolume = epitheliumvolume = 1.0 ; if (strcmp(modelName, "lymphNode") == 0) { tissueIndex = FindTissueIndex(modelName); tZoneVolume = 0.79 * organVolume; /* kludge: For memory for now */ // k2LymphOutput_bCellMemory = CalculateMigrateFlowConstant(tissueConstants[tissueIndex].k2LymphOutput_bCellMemory * organWeight,tZoneVolume); // k2LymphOutput_thMemory = CalculateMigrateFlowConstant(tissueConstants[tissueIndex].k2LymphOutput_thMemory * organWeight,tZoneVolume); // k2LymphOutput_tcMemory = CalculateMigrateFlowConstant(tissueConstants[tissueIndex].k2LymphOutput_tcMemory * organWeight,tZoneVolume); k2EffectorKill = CalculateHalfLifeConstant(20.0/60.0) / (8000.0 * tZoneVolume); // k2EffectorKillDendritic = CalculateHalfLifeConstant(24.0) / (8000.0 * tZoneVolume); k2EffectorKillDendritic = CalculateHalfLifeConstant(20.0 / 60.0) / (8000.0 * tZoneVolume); k2ThMemoryActivate = CalculateHalfLifeConstant(0.5); /* hours, was .5 */ kmThMemoryActivate = CalculateKmConstant(2063.0, tZoneVolume,"ml"); } /* if */ else { tissueIndex = FindTissueIndex(organName); if (strcmp(modelName, "lymphJunction") == 0) { k2LymphJunction = stepTime * newOutputLymphDuct->ReadTimeConstant(); if (tissueConstants[tissueIndex].k2BloodInput_eosinophil != 0.01234) { printf("ERROR, check point mismatch, expected 0.01234 found %g\n",tissueConstants[tissueIndex].k2BloodInput_eosinophil); exit(1); } /* if */ } /* if */ if (strcmp(modelName, "spleen") == 0) { tZoneVolume = 0.55 * 0.25 * organVolume; } /* if */ if (strcmp(organName, "bronchialTest") == 0) { balvolume = 420.0; /* ul */ epitheliumvolume = 600.0; /* ul */ // antigenTestStrain[INFLUENZASTRAIN] = 2.9e4 * balvolume; /* 2.9e7particles/ml */ // antigenTestStrain[RYEGRASSSTRAIN] = 1.2e8 * 10.0; // was 1.2e8 * 1.0 // antigenTestStrain[RYEGRASSSTRAIN] = 1.2e8 * 1.0; // was 1.2e8 * 1.0 } /* if */ else if (strcmp(organName, "laminaProperiaTest") == 0) { balvolume = 1400.0 * LPFRACTION * 1000.0; /* ul */ epitheliumvolume = 2000.0 * LPFRACTION * 1000.0; /* ul */ antigenTestStrain[INFLUENZASTRAIN] = 2.9e4 * balvolume; /* 2.9e7particles/ml */ // antigenTestStrain[RYEGRASSSTRAIN] = 1.2e8; } /* elseIf */ else { epitheliumvolume = 0.4 * organVolume; /* place holder for now ,ul */ } /* else */ organWeight = 1.0; /* kludge: For memory for now */ // k2LymphOutput_bCellMemory = CalculateHalfLifeConstant(tissueConstants[tissueIndex].k2LymphOutput_bCellMemory ); // k2LymphOutput_thMemory = CalculateHalfLifeConstant(tissueConstants[tissueIndex].k2LymphOutput_thMemory ); // k2LymphOutput_tcMemory = CalculateHalfLifeConstant(tissueConstants[tissueIndex].k2LymphOutput_tcMemory ); k2EffectorKill = CalculateHalfLifeConstant(20.0/60.0) / (8000.0 * epitheliumvolume); // k2EffectorKillDendritic = CalculateHalfLifeConstant(24.0) / (8000.0 * epitheliumvolume); k2EffectorKillDendritic = CalculateHalfLifeConstant(20.0 / 60.0) / (8000.0 * epitheliumvolume); k2ThMemoryActivate = CalculateHalfLifeConstant(0.5); /* hours was .5 */ kmThMemoryActivate = CalculateKmConstant(2063.0, epitheliumvolume,"ml"); } /* else */ printf("%s: volume:%g tZoneVolume:%g balvolume:%g epitheliumvolume:%g\n",organName,organVolume,tZoneVolume,balvolume, epitheliumvolume); /* cell die */ k2DendriticDie = CalculateHalfLifeConstant(3.0 * 24.0); /* was 169 */ k2MacrophageDie = CalculateHalfLifeConstant(4.0 * 24.0); /* was 169 */ kHalfLifeTnfAlpha = CalculateHalfLifeConstant(45.0 / 60.0); kHalfLifeDendriticApc = CalculateHalfLifeConstant(1.0 * 24.0); kHalfLifeInterferonAlpha = CalculateHalfLifeConstant(42.0 / 60.0); kHalfLifeIl2 = CalculateHalfLifeConstant(45.0 / 60.0); kHalfLifeIgA = CalculateHalfLifeConstant(6.0 * 24.0); k2bCellNaiveDie = CalculateHalfLifeConstant(3.0 * 24.0); k2thNaiveDie = CalculateHalfLifeConstant(7.7 * 7.0 * 24.0); k2tcNaiveDie = CalculateHalfLifeConstant(26.7 * 7.0 * 24.0); kHalfLifeGmcsf = CalculateHalfLifeConstant(2.0) ; kHalfLifebCellApc = CalculateHalfLifeConstant(3.0 * 24.0); kHalfLifebCellApcMemory = CalculateHalfLifeConstant(3.0 * 24.0); kHalfLifebCellCentroblast = CalculateHalfLifeConstant(20.0 ); kHalfLifeThGerminalCenter = CalculateHalfLifeConstant(8.0) ; kHalfLifePlasmaCell = CalculateHalfLifeConstant(3.0 * 7.0 * 24.0) ; kHalfLifeMacrophageApc = CalculateHalfLifeConstant(1.0 * 24.0) ; kHalfLifebCellCentrocyteInitial = CalculateHalfLifeConstant(8.0); kHalfLifebCellCentrocyteApc = CalculateHalfLifeConstant(8.0); kHalfLifebCellPlasmaMedullary = CalculateHalfLifeConstant(3.0 * 24.0); kibCellRecirculateDie = tissueConstants[tissueIndex].numberOfBCellsNaive[BACKGROUNDSTRAIN] * organWeight; k2bCellRecirculateDie = CalculateHalfLifeConstant(4.5 * 7.0 * 24.0) / kibCellRecirculateDie ; /* cell creation */ kGenerateMonocyte = CalculateK2Constant(4446.0); knGenerateMonocyte = 2.0; kmGenerateMonocyte = CalculateKmConstant(2.0e-9, reservoirVolume,"ml"); kGenerateGmcsf = CalculateK2Constant(1.3e4 / 6.02e17); /* umoles/sec */ kGenerateBCells = CalculateK2Constant(3.0e10 / (24.0 * 3600.0)); kGenerateThCells = CalculateK2Constant(0.78 * 0.007 * 1.2e12 / (24.0 * 3600.0)); kGenerateTcCells = CalculateK2Constant(0.22 * 0.007 * 1.2e12 / (24.0 * 3600.0)); kGeneratePlatelets = CalculateK2Constant(1.9e6); kGenerateRbc = CalculateK2Constant(1.8e6); k2IgaProduction = CalculateK2Constant(1.3e4 / 6.02e17); /* umoles/sec */ k2PlasmaMedullary2IgM = CalculateK2Constant(2.0e3 / 6.02e17); /* umoles/sec */ kGenerateTnfAlpha = CalculateK2Constant(155 / 6.02e17); /* umoles/sec-cell */ k2BlastIl2 = CalculateK2Constant(300.0 / 6.02e17); /* umoles/sec-cell */ k2EffectorPrecursorIl2 = CalculateK2Constant(300.0 / 6.02e17); /* umoles/sec-cell */ /* cell migration */ k2BloodInput_bCellNaiveRecirculate = CalculateMigrateFlowConstant(tissueConstants[tissueIndex].k2BloodInput_bCellNaiveRecirculate * organWeight, reservoirVolume); k2BloodInput_bCellNaive = CalculateMigrateFlowConstant(tissueConstants[tissueIndex].k2BloodInput_bCellNaive * organWeight, reservoirVolume); k2BloodInput_thNaive = CalculateMigrateFlowConstant(tissueConstants[tissueIndex].k2BloodInput_thNaive * organWeight, reservoirVolume); k2BloodInput_tcNaive = CalculateMigrateFlowConstant(tissueConstants[tissueIndex].k2BloodInput_tcNaive * organWeight, reservoirVolume); k2BloodInput_tcEffector = CalculateMigrateFlowConstant(tissueConstants[tissueIndex].k2BloodInput_tcEffector * organWeight, reservoirVolume); k2BloodInput_thEffector = CalculateMigrateFlowConstant(tissueConstants[tissueIndex].k2BloodInput_thEffector * organWeight, reservoirVolume); k2BloodInput_Dendritic = CalculateMigrateFlowConstant(tissueConstants[tissueIndex].k2BloodInput_Dendritic * organWeight, capillaryVolume); k2BloodInput_rbc = CalculateMigrateFlowConstant(tissueConstants[tissueIndex].k2BloodInput_rbc * organWeight, capillaryVolume); k2BloodInput_platelets = CalculateMigrateFlowConstant(tissueConstants[tissueIndex].k2BloodInput_platelets * organWeight, capillaryVolume); k2BloodInput_Macrophage = CalculateMigrateFlowConstant(tissueConstants[tissueIndex].k2BloodInput_Macrophage * organWeight, capillaryVolume); k2BloodInputPlasmaCell = CalculateMigrateFlowConstant(tissueConstants[tissueIndex].k2BloodInput_plasmaCell * organWeight, reservoirVolume); k2BloodInput_bCellMemory = CalculateMigrateFlowConstant(tissueConstants[tissueIndex].k2BloodInput_bCellMemory * organWeight, reservoirVolume); k2BloodInput_thMemory = CalculateMigrateFlowConstant(tissueConstants[tissueIndex].k2BloodInput_thMemory * organWeight, reservoirVolume); k2BloodInput_tcMemory = CalculateMigrateFlowConstant(tissueConstants[tissueIndex].k2BloodInput_tcMemory * organWeight, reservoirVolume); k2BloodOutput_bCellNaive = CalculateHalfLifeConstant(tissueConstants[tissueIndex].k2BloodOutput_bCellNaive); k2BloodOutput_bCellNaiveRecirculate = CalculateHalfLifeConstant(tissueConstants[tissueIndex].k2BloodOutput_bCellNaiveRecirculate); k2BloodOutput_thNaive = CalculateHalfLifeConstant(tissueConstants[tissueIndex].k2BloodOutput_thNaive ); k2BloodOutput_tcNaive = CalculateHalfLifeConstant(tissueConstants[tissueIndex].k2BloodOutput_tcNaive ); k2BloodOutput_bCellMemory = CalculateHalfLifeConstant(tissueConstants[tissueIndex].k2BloodOutput_bCellMemory ); k2BloodOutput_thMemory = CalculateHalfLifeConstant(tissueConstants[tissueIndex].k2BloodOutput_thMemory ); k2BloodOutput_tcMemory = CalculateHalfLifeConstant(tissueConstants[tissueIndex].k2BloodOutput_tcMemory ); k2LymphInput_bCellNaiveRecirculate = CalculateMigrateFlowConstant(tissueConstants[tissueIndex].k2LymphInput_bCellNaiveRecirculate * organWeight, lymphInputVolume); k2LymphInput_macrophageApc = CalculateMigrateFlowConstant(tissueConstants[tissueIndex].k2LymphInput_macrophageApc * organWeight, lymphInputVolume); k2LymphInput_dendriticApc = CalculateMigrateFlowConstant(tissueConstants[tissueIndex].k2LymphInput_dendriticApc * organWeight, lymphInputVolume); k2LymphInput_bCellMemory = CalculateMigrateFlowConstant(tissueConstants[tissueIndex].k2LymphInput_bCellMemory * organWeight, lymphInputVolume); k2LymphInput_thMemory = CalculateMigrateFlowConstant(tissueConstants[tissueIndex].k2LymphInput_thMemory * organWeight, lymphInputVolume); k2LymphInput_tcMemory = CalculateMigrateFlowConstant(tissueConstants[tissueIndex].k2LymphInput_tcMemory * organWeight, lymphInputVolume); k2LymphOutput_bCellNaiveRecirculate = CalculateHalfLifeConstant(tissueConstants[tissueIndex].k2LymphOutput_bCellNaiveRecirculate); k2LymphOutput_tcEffector = CalculateMigrateFlowConstant(tissueConstants[tissueIndex].k2LymphOutput_tcEffector * organWeight,tZoneVolume); k2LymphOutput_thEffector = CalculateMigrateFlowConstant(tissueConstants[tissueIndex].k2LymphOutput_thEffector * organWeight,tZoneVolume); k2LymphOutput_macrophageApc = CalculateMigrateFlowConstant(tissueConstants[tissueIndex].k2LymphOutput_macrophageApc,epitheliumvolume ); k2LymphOutput_dendriticApc = CalculateMigrateFlowConstant(tissueConstants[tissueIndex].k2LymphOutput_dendriticApc,epitheliumvolume ); k2LymphOutput_thNaive = CalculateHalfLifeConstant(tissueConstants[tissueIndex].k2LymphOutput_thNaive ); k2LymphOutput_tcNaive = CalculateHalfLifeConstant(tissueConstants[tissueIndex].k2LymphOutput_tcNaive ); k2LymphOutput_plasmaCell = CalculateMigrateFlowConstant(tissueConstants[tissueIndex].k2LymphOutput_plasmaCell * organWeight,tZoneVolume); k2LymphOutput_igM = CalculateMigrateFlowConstant(0.05 * organWeight,tZoneVolume); k2LymphOutput_bCellMemory = CalculateHalfLifeConstant(tissueConstants[tissueIndex].k2LymphOutput_bCellMemory ); k2LymphOutput_thMemory = CalculateHalfLifeConstant(tissueConstants[tissueIndex].k2LymphOutput_thMemory ); k2LymphOutput_tcMemory = CalculateHalfLifeConstant(tissueConstants[tissueIndex].k2LymphOutput_tcMemory ); /* bronchial tissue constants */ k2MucociliaryClearance = CalculateHalfLifeConstant(14.0); knInfluenzaNeutralize = 10.0 / 6.02e17; k2InfluenzaNeutralize = CalculateHalfLifeConstant(1.1) / (1.7e-10 * balvolume); k2EpitheliaReplication = CalculateHalfLifeConstant(5.0); k2EpitheliaInfection = CalculateHalfLifeConstant(1.7) / (1.0e7 * balvolume); knEpitheliaInfection = 10.0; k2EpitheliaResistive = CalculateHalfLifeConstant(1.0) / (0.05 * epitheliumvolume); knEpitheliaResistive = 1.3e-7; /* iu */ k2EpitheliaDie = CalculateHalfLifeConstant(30.0); k2EpitheliaResistiveDie = CalculateHalfLifeConstant(24.0); k2EpitheliaApcDie = CalculateHalfLifeConstant(16.0); k2VirusReplication = CalculateK2Constant(7000.0 / (24.0 * 3600.0)); knEffectorKill = 0.05; // was 0.1 k2MacrophageInfection = CalculateHalfLifeConstant(1.0) / (1.0e7 * balvolume); knMacrophageInfection = 5.0; k2GenerateInterferonAlpha = CalculateK2Constant(2.0e-4 / (24.0 * 3600.0)); k2DendriticInfection = CalculateHalfLifeConstant(1.0) / (1.0e7 * balvolume); knDendriticInfection = 5.0; k2macrophageReplicate = CalculateHalfLifeConstant(tissueConstants[tissueIndex].k2macrophageReplicate); k2DendriticReplicate = CalculateHalfLifeConstant(tissueConstants[tissueIndex].k2DendriticReplicate); knInflammatory = 160.0 ; // was 4.0 // knInflammatory = 4.0 ; // was 4.0 knMonocyteInflammatory = 160.0 ; // was 4.0 kmInflammatory = CalculateKmConstant(3.0e-7, epitheliumvolume,"ml"); k2TcEffector2Memory = CalculateHalfLifeConstant(0.05 * 6.0 * 7.0 * 24.0); /* hours */ kmTcEffector2Memory = CalculateKmConstant(1.0e4, epitheliumvolume,"ml"); k2ThEffector2Memory = CalculateHalfLifeConstant(0.05 * 6.0 * 7.0 * 24.0); /* hours */ kmThEffector2Memory = CalculateKmConstant(1.0e4, epitheliumvolume,"ml"); knInflammatoryDendriticOutput = 4.0 ; /* estimate 4 now */ knInflammatoryOutput = 10.0 ; /* estimate 4 now */ kmInflammatoryOutput = CalculateKmConstant(3.0e-7, epitheliumvolume,"ml"); k2tcAicd = CalculateHalfLifeConstant(9.2); kmtcAicd = CalculateKmConstant(121.90, epitheliumvolume,"ml"); k0tcAicd = CalculateHalfLifeConstant(1.0 * 20.0); k2thAicd = CalculateHalfLifeConstant(9.2); kmthAicd = CalculateKmConstant(121.90, epitheliumvolume,"ml"); k0thAicd = CalculateHalfLifeConstant(1.0 * 20.0); /* lymphNode/spleen constants */ /* lymphNode/spleen constants: tc cells */ k2TcNaiveActivate = CalculateHalfLifeConstant(3.14); /* hours */ kmTcNaiveActivate = CalculateKmConstant(2063.0, tZoneVolume,"ml"); k2TcBlastPrecursorActivate = 0.95; kmTcBlastPrecursorActivate = CalculateKmConstant(457.0, tZoneVolume,"ml"); k2TcPrecursorCount = CalculateK2Constant(6.4e-5); kmTcPrecursorCount = CalculateKmConstant(2.1e-8, tZoneVolume,"ml"); kTcBlastReplicate = 0.6; /* dispersion variance */ k2EffectorPrecursorIl2Autocrine = CalculateHalfLifeConstant(45.0) / (2.0e4 * tZoneVolume); /* thl = 45 hours @ blastcount = 2.0e7/ml */ k2TcMemoryActivate = CalculateHalfLifeConstant(1.0); /* hours */ kmTcMemoryActivate = CalculateKmConstant(2063.0, tZoneVolume,"ml"); k2TcPrecursorCountMemory = CalculateK2Constant(6.4e-5); kmTcPrecursorCountMemory = CalculateKmConstant(2.1e-8, tZoneVolume,"ml"); kTcBlastReplicateMemory = 0.6; /* dispersion variance */ /* lymphNode/spleen constants: th cells */ k2ThNaiveActivate = CalculateHalfLifeConstant(3.14); kmThNaiveActivate = CalculateKmConstant(2063.0, tZoneVolume,"ml"); k2thBlastPrecursorActivate = 0.95; kmthBlastPrecursorActivate = CalculateKmConstant(457.0, tZoneVolume,"ml"); k2thPrecursorCount = CalculateK2Constant(6.4e-5); kmthPrecursorCount = CalculateKmConstant(2.1e-8, tZoneVolume,"ml"); kthBlastReplicate = 0.6; #if 0 k2PolarizationTh1 = 0.15; kmPolarizationTh1 = CalculateKmConstant(1.0e4, tZoneVolume,"ml"); k2PolarizationTh2 = 0.06; kmPolarizationTh2 = CalculateKmConstant(1.0e4, tZoneVolume,"ml"); #endif k2PolarizationTh1 = 0.09; // was .15 kmPolarizationTh1 = CalculateKmConstant(1.0e2, tZoneVolume,"ml"); k2PolarizationTh2 = 0.025; // was 0.06 kmPolarizationTh2 = CalculateKmConstant(1.0e2, tZoneVolume,"ml"); k2ThPrecursorCountMemory = CalculateK2Constant(6.4e-5); kmThPrecursorCountMemory = CalculateKmConstant(2.1e-8, tZoneVolume,"ml"); kthBlastReplicateMemory = 0.6; /* dispersion variance */ /* lymphNode/spleen constants: b cells */ kibCellNaiveFollicle = tissueConstants[tissueIndex].numberOfBCellsRecirculate[BACKGROUNDSTRAIN] * organWeight; k2bCellNaiveFollicle = 2.0 * kibCellNaiveFollicle * CalculateHalfLifeConstant(4.5 * 7.0 * 24.0) ; k2bCellNaiveRecirculateActivate = CalculateHalfLifeConstant(3.0); /* gives: t half life = 6 hours @ dendritic = 1,000/ml */ kmbCellNaiveRecirculateActivate = CalculateKmConstant(1000.0, tZoneVolume,"ml"); k2bCellApcActivate = CalculateHalfLifeConstant(2.0); kmbCellApcActivate = CalculateKmConstant(1.0e5, tZoneVolume,"ml"); kbCentroblastReplicateInitial = 0.05; kbCentroblastReplicate = 1.0; #if 0 k2SwitchesIgg = 0.142; kmSwitchesIgg = CalculateKmConstant(1.0e5, tZoneVolume,"ml"); k2SwitchesIga = 0.038; kmSwitchesIga = CalculateKmConstant(1.0e4, tZoneVolume,"ml"); #endif k2SwitchesIgg = 0.22; // was .142 kmSwitchesIgg = CalculateKmConstant(1.0e5, tZoneVolume,"ml"); k2SwitchesIga = 0.038; // was .038 kmSwitchesIga = CalculateKmConstant(1.0e2, tZoneVolume,"ml"); kiSwitchesIga = CalculateKmConstant(1.0e3, tZoneVolume,"ml"); k2SwitchesIgg1 = 0.22; // was .142 kmSwitchesIgg1 = CalculateKmConstant(1.0e5, tZoneVolume,"ml"); k2SwitchesIge = 0.11; // was .142 kmSwitchesIge = CalculateKmConstant(1.0e5, tZoneVolume,"ml"); k2bCellMemoryMarginalActivate = CalculateHalfLifeConstant(3.0 / 10.0); kmbCellMemoryMarginalActivate = CalculateKmConstant(10000.0, tZoneVolume,"ml"); k2bCellMemoryActivate = CalculateHalfLifeConstant(3.0 / 10.0); kmbCellMemoryActivate = CalculateKmConstant(1000.0, tZoneVolume,"ml"); k2bCellApcMemoryActivate = CalculateHalfLifeConstant(2.0 / 4.0); kmbCellApcMemoryActivate = CalculateKmConstant(1.0e5, tZoneVolume,"ml"); kbCentroblastReplicateInitialMemory = 0.05; /* lymphNode/spleen constants: b cells (red pulp, medullary)*/ kbPlasmaReplicateInitial = 1.0 - kbCentroblastReplicateInitial; kbPlasmaReplicateInitialMemory = 1.0 - kbCentroblastReplicateInitialMemory; kbPlasmaReplicate = 0.6; kbPlasmaReplicateDecision = (2.0 - 0.2); // was 2.0 - 0.1 /* lymphNode/spleen constants: b cells, miscellaneous (germinal center) */ k2Centroblast2Centrocyte = CalculateHalfLifeConstant(4.85); k2bCellCentrocyteInitialActivate = CalculateHalfLifeConstant(8.0); kmbCellCentrocyteInitialActivate = CalculateKmConstant(7.5, 1.0,"ul"); knbCellCentrocyteInitialActivate = 0.01; k2bCellCentrocyteActivate = CalculateHalfLifeConstant(2.0); kmbCellCentrocyteActivate = CalculateKmConstant(150.0, 1.0,"ul"); k2Centrocyte2Centroblast = CalculateHalfLifeConstant(28.0 / 60.0); k2Centrocyte2PlasmaCell = CalculateHalfLifeConstant(2.4) ; k2Centrocyte2bCellMemory = CalculateHalfLifeConstant(1.6) ; k2Centrocyte2bCellMemoryMarginal = CalculateHalfLifeConstant(3.0 * 16.0) ; k2Effector2GerminalCenter = CalculateHalfLifeConstant(2.0) ; k2FdcApc = CalculateHalfLifeConstant(30.0 / 60.0); kmFdcApc = CalculateKmConstant(75000.0, 1.0,"ul"); knFdcApc = 1.0 / knbCellCentrocyteInitialActivate; // knMacrophageApc = 10; knMacrophageApc = 2; /* was 1 */ k2immuneComplex = CalculateHalfLifeConstant(10.0 / 60.0) / (1.7e-10 * tZoneVolume); knimmuneComplex = 1.0 / 6.02e17; GenericImmuneCell::CopyProfile(kDendriticInfectionProfile, prekDendriticInfectionProfile ); /* counters */ numberOfGerminalCenters = 0.001; thBlastCount = 0.0; thBlastDCount = CalculateK2Constant(1.0 / (3.0 * 3600.0)); bBlastCount = 0.0; bBlastDCount = CalculateK2Constant(1.0 / (6.0 * 3600.0)); bPlasmaCount = 0.0; bPlasmaDCount = CalculateK2Constant(1.0 / (3.6 * 3600.0)); /* minimum replication time */ tcBlastCount = 0.0; tcBlastDCount = CalculateK2Constant(1.0 / (3.0 * 3600.0)); adjustTcBlast = 0.0; adjustTcBlastMemory = 0.0; inflammatoryRate = 0.0; inflammatoryMonocyteRate = 0.0; inflammatoryOutputRate = 0.0; il3inflammatoryRate = 0.0; il5inflammatoryRate = 0.0; thMemoryActivateCount = 0.0; dthMemoryActivateCount = CalculateK2Constant(1.0 / (0.8 * 3600.0)); /* initialize cells */ antigen.ResetImmuneCell ( emptyStrain, emptyProfile, "antigen" , newOrganName); antigenBal.ResetImmuneCell (antigenTestStrain , emptyProfile , "antigenBal" , newOrganName); bCellNaive.ResetImmuneCell ( BuildStrain(tissueConstants[tissueIndex].numberOfBCellsNaive , organWeight), emptyProfile , "bCellNaive" , newOrganName); bCellNaiveRecirculate.ResetImmuneCell ( BuildStrain(tissueConstants[tissueIndex].numberOfBCellsRecirculate , organWeight), emptyProfile , "bCellNaiveRecirculate" , newOrganName); bCellNaiveMarginalZone.ResetImmuneCell ( BuildStrain(tissueConstants[tissueIndex].numberOfBCellsMarginalZone , organWeight), emptyProfile, "bCellNaiveMarginalZone" , newOrganName); bCellCentrocyteApc.ResetImmuneCell ( emptyStrain, emptyProfile, "bCellCentrocyteApc" , newOrganName); bCellPlasmaMedullary.ResetImmuneCell ( emptyStrain, emptyProfile, "bCellPlasmaMedullary" , newOrganName); bCellApc.ResetImmuneCell ( emptyStrain, emptyProfile, "bCellApc" , newOrganName); bCellDeadCentroblast.ResetImmuneCell ( emptyStrain, emptyProfile, "bCellApc" , newOrganName); bCellCentroblast.ResetImmuneCell ( emptyStrain , emptyProfile, "bCellCentroblast" , newOrganName); bCellCentrocyteInitial.ResetImmuneCell ( emptyStrain, emptyProfile, "bCellCentrocyteInitial" , newOrganName); bCellCentrocyte.ResetImmuneCell ( emptyStrain, emptyProfile, "bCellCentrocyte" , newOrganName); bCellBlast.ResetImmuneCell ( emptyStrain, emptyProfile, "bCellBlast" , newOrganName); for (i = 0; i < NUMBEROFBCENTROBLASTPRECURSOR; i++) { bCentroblastPrecursor[i].ResetImmuneCell ( emptyStrain, emptyProfile , "bCentroblastPrecursor" , newOrganName); } /* iForLoop */ for (i = 0; i < NUMBEROFBPLASMAPRECURSOR; i++) { bPlasmaPrecursor[i].ResetImmuneCell ( emptyStrain, emptyProfile , "bPlasmaPrecursor" , newOrganName); } /* iForLoop */ histamine = 0.0; mastCellNaive = tissueConstants[tissueIndex].numberOfmastCell * organWeight; eosinophil = tissueConstants[tissueIndex].numberOfeosinophil * organWeight; ltc4 = 0.0; fev1 = 100.0; il3 = 0.0; il5 = 0.0; dendriticImmature = tissueConstants[tissueIndex].numberOfDendritic * organWeight; dendriticImmatureInitial = dendriticImmature; dendriticApc.ResetImmuneCell ( emptyStrain, emptyProfile, "dendriticApc" , newOrganName); epitheliaResistive = 0.0; epitheliaApc = 0.0; epitheliaDead = 0.0; epitheliaCell = tissueConstants[tissueIndex].epitheliaCell * organWeight; fdcApc.ResetImmuneCell ( emptyStrain, emptyProfile, "fdcApc" , newOrganName); fdcGerminalCenters = tissueConstants[tissueIndex].fdcGerminalCenters * organWeight; interferonAlpha = 0.0; igM.ResetImmuneCell ( emptyStrain, emptyProfile, "igM" , newOrganName); igaBal.ResetImmuneCell ( emptyStrain , emptyProfile , "igaBal" , newOrganName); il2 = 0.0; immuneComplex.ResetImmuneCell ( emptyStrain, emptyProfile, "immuneComplex" , newOrganName); macrophage = tissueConstants[tissueIndex].numberOfMacrophage * organWeight ; macrophageInitial = macrophage; macrophageApc.ResetImmuneCell ( emptyStrain, emptyProfile, "macrophageApc" , newOrganName); plasmaCell.ResetImmuneCell ( emptyStrain, emptyProfile, "plasmaCell" , newOrganName); tnfAlpha = 0.0; tcPrecursorCount = 0.0; thPrecursorCount = 0.0; thEffectorPrecursorTotal = 0.0; th2EffectorPrecursorTotal = 0.0; thEffectorPrecursorTotalMemory = 0.0; th2EffectorPrecursorTotalMemory = 0.0; tcPrecursorCountMemory = 0.0; thPrecursorCountMemory = 0.0; tcBlastPrecursorTotal = 0.0 ; thBlastPrecursorTotal = 0.0 ; tcBlast.ResetImmuneCell ( emptyStrain, emptyProfile , "tcBlast" , newOrganName); tcAnergy.ResetImmuneCell ( emptyStrain, emptyProfile , "tcAnergy" , newOrganName); tcEffector.ResetImmuneCell ( emptyStrain, emptyProfile , "tcEffector" , newOrganName); thEffector.ResetImmuneCell ( emptyStrain, emptyProfile, "thEffector" , newOrganName); thBlast.ResetImmuneCell ( emptyStrain, emptyProfile, "thBlast" , newOrganName) ; thAnergy.ResetImmuneCell ( emptyStrain, emptyProfile, "thAnergy" , newOrganName); thGerminalCenter.ResetImmuneCell ( emptyStrain, emptyProfile, "thGerminalCenter" , newOrganName); thNaive.ResetImmuneCell ( BuildStrain(tissueConstants[tissueIndex].numberOfThCellsNaive , organWeight), emptyProfile, "thNaive" , newOrganName); tcNaive.ResetImmuneCell ( BuildStrain(tissueConstants[tissueIndex].numberOfTcCellsNaive , organWeight), emptyProfile, "tcNaive" , newOrganName); for (i = 0; i < NUMBEROFTCBLASTPRECURSOR; i++) { tcBlastPrecursor[i].ResetImmuneCell ( emptyStrain, emptyProfile , "tcBlastPrecursor" , newOrganName); } /* iForLoop */ for (i = 0; i < NUMBEROFTCEFFECTORPRECURSOR; i++) { tcEffectorPrecursor[i].ResetImmuneCell ( emptyStrain, emptyProfile , "tcEffectorPrecursor" , newOrganName); } /* iForLoop */ for (i = 0; i < NUMBEROFTHBLASTPRECURSOR; i++) { thBlastPrecursor[i].ResetImmuneCell ( emptyStrain, emptyProfile , "thBlastPrecursor" , newOrganName); } /* iForLoop */ for (i = 0; i < NUMBEROFTHEFFECTORPRECURSOR; i++) { thEffectorPrecursor[i].ResetImmuneCell ( emptyStrain, emptyProfile , "thEffectorPrecursor" , newOrganName); } /* iForLoop */ virtualThEffector.ResetImmuneCell ( emptyStrain, emptyProfile, "virtualThEffector" , newOrganName); mastCellDegranulate.ResetImmuneCell ( emptyStrain, emptyProfile, "mastCellDegranulate" , newOrganName); ige.ResetImmuneCell ( emptyStrain, emptyProfile, "ige" , newOrganName); for (i = 0; i < NUMBEROFTHMEMORYACTIVATE; i++) { thMemoryBlast[i].ResetImmuneCell ( emptyStrain, emptyProfile , "thMemoryBlast" , newOrganName); } /* iForLoop */ bCellMemory.ResetImmuneCell ( emptyStrain, emptyProfile , "bCellMemory" , newOrganName); bCellMemoryMarginal.ResetImmuneCell ( emptyStrain, emptyProfile , "bCellMemoryMarginal" , newOrganName); tcMemory.ResetImmuneCell ( emptyStrain, emptyProfile , "tcMemory" , newOrganName); tcBlastMemory.ResetImmuneCell ( emptyStrain, emptyProfile , "tcBlastMemory" , newOrganName); thBlastMemory.ResetImmuneCell ( emptyStrain, emptyProfile , "thBlastMemory" , newOrganName); virtualThEffectorMemory.ResetImmuneCell ( emptyStrain, emptyProfile , "virtualThEffectorMemory" , newOrganName); bCellApcMemory.ResetImmuneCell ( emptyStrain, emptyProfile , "bCellApcMemory" , newOrganName); bCellBlastMemory.ResetImmuneCell ( emptyStrain, emptyProfile , "bCellBlastMemory" , newOrganName); for (i = 0; i < NUMBEROFTHEFFECTORPRECURSORMEMORY; i++) { thEffectorPrecursorMemory[i].ResetImmuneCell ( emptyStrain, emptyProfile , "thEffectorPrecursorMemory" , newOrganName); } /* iForLoop */ for (i = 0; i < NUMBEROFTCEFFECTORPRECURSORMEMORY; i++) { tcEffectorPrecursorMemory[i].ResetImmuneCell ( emptyStrain, emptyProfile , "tcEffectorPrecursorMemory" , newOrganName); } /* iForLoop */ mastCell.ResetImmuneCell ( emptyStrain, emptyProfile, "mastCell" , newOrganName); thMemory.ResetImmuneCell ( emptyStrain, emptyProfile , "thMemory" , newOrganName); // mastCell.AddStrain(RYEGRASSSTRAIN, igeProfileGlobal ,3.0e5); // 4.4e5 // thMemory.AddStrain(RYEGRASSSTRAIN, th2ProfileGlobal,5.0e3); // was 11e3 kHalfLifeil3 = CalculateHalfLifeConstant(35.0 / 60.0); kHalfLifeil5 = CalculateHalfLifeConstant(45.0 / 60.0); kGenerateeosinophil = CalculateK2Constant(21393.0); knGenerateeosinophil = 3.0; kmGenerateeosinophil = CalculateKmConstant(3.3e-8, reservoirVolume,"ml"); kGeneratemastCell = CalculateK2Constant(160.0); knGeneratemastCell = 1.0; kmGeneratemastCell = CalculateKmConstant(1.1e-7, reservoirVolume,"ml"); kHalfLifeIgE = CalculateHalfLifeConstant(2.0 * 24.0); knInflammatoryil3 = 4.0 / CalculateKmConstant(1.1e-7, epitheliumvolume,"ml"); knInflammatoryil5 = 5.0 / CalculateKmConstant(3.3e-8, epitheliumvolume,"ml"); k2IgeProduction = CalculateK2Constant(1.1e4 / 6.02e17); /* umoles/sec */ x1 = CalculateKmConstant(1000.0, epitheliumvolume,"ml"); /* was 1,000 */ kGenerateIl3 = CalculateK2Constant(6000.0 / 6.02e17) / x1; /* umoles/sec */ kGenerateIl5 = CalculateK2Constant(9600.0 / 6.02e17) / x1; /* umoles/sec */ // was 1460 kHalfLifehistamine = CalculateHalfLifeConstant(13.0 / 60.0); // was 15, 25, 40.0 k2mastCellAllergy = CalculateHalfLifeConstant(5.0 / 60.0) / (1.2e8 * balvolume); // was 5.8, 58.0 kn1mastCellAllergy = 1.6e10 / 6.02e17; kn2mastCellAllergy = 30.0e3; k2mastCellNaive = CalculateHalfLifeConstant(1.1) / (1.7e-10 * balvolume); knmastCellNaive = 3.0e5 / 6.02e17; kHalfLifemastCellNaive = CalculateHalfLifeConstant(20.0 * 24.0); kHalfLifemastCellDegranulate = CalculateHalfLifeConstant(1.0 * 24.0); kHalfLifemastCell = CalculateHalfLifeConstant(20.0 * 24.0); k2BloodInput_mastCell = CalculateMigrateFlowConstant(tissueConstants[tissueIndex].k2BloodInput_mastCell * organWeight, capillaryVolume); ; k2BloodInput_eosinophil = CalculateMigrateFlowConstant(tissueConstants[tissueIndex].k2BloodInput_eosinophil * organWeight, capillaryVolume); ; x1 = CalculateKmConstant(12.0 * 3.3e-8, epitheliumvolume,"ml"); k2eosinophilLtc4 = CalculateK2Constant( 200.0 / 6.02e17) / (x1 * x1 * x1 * x1); /* umoles/sec */ kHalfLifeltc4 = CalculateHalfLifeConstant(20.0 / 60.0); kHalfLifeeosinophil = CalculateHalfLifeConstant(11.0 * 7.0 * 24.0); kltc4multiplier = 500.0; k2fev1 = .57; /* mild asthma */ kmfev1 = CalculateKmConstant(4.5e-5, epitheliumvolume,"ml"); /* 5 ng/ml */ GenericImmuneCell::CopyProfile(kDendriticAllergyProfile, prekDendriticAllergyProfile ); kthBlastActivateMemory = 0.6; kTransferil3 = CalculateHalfLifeConstant(15.0 / 60.0); kTransferil5 = CalculateHalfLifeConstant(15.0 / 60.0); } void GenericImmuneTissue::ExecuteBronchialTest () { double rate,x1; int i ; /* bal equations */ antigenBal.MigrateOutput(k2MucociliaryClearance); rate = antigenBal.ReadValue(INFLUENZASTRAIN); // rate=0.0; if (rate > 1.0e-10) { /* hack, when antigen is essentially gone, don't evaluate */ rate *= k2InfluenzaNeutralize * igaBal.ReadValue(INFLUENZASTRAIN); antigenBal.AddStrain(INFLUENZASTRAIN, -rate); igaBal.AddStrain(INFLUENZASTRAIN, -rate * knInfluenzaNeutralize); } /* if */ igaBal.MigrateOutput(kHalfLifeIgA); ige.MigrateOutput(kHalfLifeIgE); /* Epithelia equations */ rate = k2EpitheliaReplication * epitheliaDead; epitheliaDead -= rate; epitheliaCell += rate; /* replication/fibroblasts */ rate = k2EpitheliaInfection * epitheliaCell * antigenBal.ReadValue(INFLUENZASTRAIN) ; epitheliaCell -= rate ; epitheliaApc += rate ; antigenBal.AddStrain(INFLUENZASTRAIN, -rate * knEpitheliaInfection); rate = k2EpitheliaResistive * epitheliaCell * interferonAlpha ; epitheliaResistive += rate ; epitheliaCell -= rate ; interferonAlpha -= rate * knEpitheliaResistive; rate = k2EpitheliaDie * epitheliaCell ; epitheliaCell -= rate ; epitheliaDead += rate; rate = k2EpitheliaResistiveDie * epitheliaResistive ; epitheliaResistive -= rate ; epitheliaCell += rate; rate = k2VirusReplication * epitheliaApc ; antigenBal.AddStrain(INFLUENZASTRAIN, rate); rate = k2EpitheliaApcDie * epitheliaApc ; epitheliaApc -= rate ; epitheliaDead += rate; rate = k2EffectorKill * epitheliaApc * tcEffector.ReadValue(INFLUENZASTRAIN) ; epitheliaApc -= rate ; epitheliaDead += rate; tcEffector.AddStrain(INFLUENZASTRAIN, -rate * knEffectorKill); tcEffector.MigrateAicd(dendriticApc, k2tcAicd,kmtcAicd,k0tcAicd); thEffector.MigrateAicd(dendriticApc, k2thAicd,kmthAicd,k0thAicd); tcEffector.ApcDeActivate(tcMemory,dendriticApc, k2TcEffector2Memory,kmTcEffector2Memory); thEffector.ApcDeActivate(thMemory,dendriticApc, k2ThEffector2Memory,kmThEffector2Memory); rate = k2MacrophageInfection * macrophage * antigenBal.ReadValue(INFLUENZASTRAIN) ; macrophage -= rate ; macrophageApc.AddStrain(INFLUENZASTRAIN, rate); antigenBal.AddStrain(INFLUENZASTRAIN, -rate * knMacrophageInfection); rate = k2GenerateInterferonAlpha * macrophageApc.ReadTotal() ; interferonAlpha += rate; rate = interferonAlpha * kHalfLifeInterferonAlpha; interferonAlpha -= rate; /* Interstitium equations */ il3inflammatoryRate = 1.0 + knInflammatoryil3 * il3; il5inflammatoryRate = 1.0 + knInflammatoryil5 * il5; inflammatoryRate = 1.0 + knInflammatory * tnfAlpha / (kmInflammatory + tnfAlpha); inflammatoryMonocyteRate = 1.0 + knMonocyteInflammatory * tnfAlpha / (kmInflammatory + tnfAlpha); inflammatoryOutputRate = 1.0 + knInflammatoryOutput * tnfAlpha / (kmInflammatoryOutput + tnfAlpha); inflammatoryDendriticOutputRate = 1.0 + knInflammatoryDendriticOutput * tnfAlpha / (kmInflammatoryOutput + tnfAlpha); rate = k2DendriticInfection * dendriticImmature * antigenBal.ReadValue(INFLUENZASTRAIN) ; dendriticImmature -= rate ; dendriticApc.AddStrain(INFLUENZASTRAIN, kDendriticInfectionProfile, rate); antigenBal.AddStrain(INFLUENZASTRAIN, -rate * knDendriticInfection); x1 = antigenBal.ReadValue(RYEGRASSSTRAIN) ; if (x1 > 1.0e-10) { /* hack, don't evaluate if antigen almost gone */ rate = k2DendriticInfection * dendriticImmature * antigenBal.ReadValue(RYEGRASSSTRAIN) ; dendriticImmature -= rate ; dendriticApc.AddStrain(RYEGRASSSTRAIN, kDendriticAllergyProfile, rate); // dendriticApc.Snapshot(); antigenBal.AddStrain(RYEGRASSSTRAIN, -rate * knDendriticInfection); rate = k2MacrophageInfection * macrophage * antigenBal.ReadValue(RYEGRASSSTRAIN) ; macrophage -= rate ; macrophageApc.AddStrain(RYEGRASSSTRAIN, rate); antigenBal.AddStrain(RYEGRASSSTRAIN, -rate * knMacrophageInfection); rate = k2mastCellAllergy * mastCell.ReadValue(RYEGRASSSTRAIN) * antigenBal.ReadValue(RYEGRASSSTRAIN) ; mastCell.AddStrain(RYEGRASSSTRAIN, -rate); mastCellDegranulate.AddStrain(RYEGRASSSTRAIN, igeProfileGlobal ,rate); histamine += rate * kn1mastCellAllergy; antigenBal.AddStrain(RYEGRASSSTRAIN, -rate * kn2mastCellAllergy); } /* if */ rate = k2IgaProduction * plasmaCell.ReadValueWithProfile(INFLUENZASTRAIN,IGA) ; igaBal.AddStrain(INFLUENZASTRAIN, rate); rate = k2IgeProduction * plasmaCell.ReadValueWithProfile(RYEGRASSSTRAIN,IGE) ; ige.AddStrain(RYEGRASSSTRAIN, rate); rate = kGenerateGmcsf * macrophageApc.ReadTotal() ; bloodgmcsf += rate ; rate = kGenerateTnfAlpha * macrophageApc.ReadTotal() ; tnfAlpha += rate ; rate = kHalfLifeTnfAlpha * tnfAlpha ; tnfAlpha -= rate; bloodbCellNaiveRecirculate.MigrateOutput(bCellNaiveRecirculate , inflammatoryRate * k2BloodInput_bCellNaiveRecirculate) ; bCellNaiveRecirculate.MigrateOutput(lymphOutputbCellNaiveRecirculate , k2LymphOutput_bCellNaiveRecirculate) ; bloodthEffector.MigrateOutputWithProfile(thEffector , inflammatoryRate * k2BloodInput_thEffector) ; bloodtcEffector.MigrateOutput(tcEffector , inflammatoryRate * k2BloodInput_tcEffector) ; bloodplasmaCell.MigrateOutputWithProfile(plasmaCell, inflammatoryRate * k2BloodInputPlasmaCell) ; bloodbCellMemory.MigrateOutputWithProfile(bCellMemory , inflammatoryRate * k2BloodInput_bCellMemory) ; // bloodthMemory.MigrateOutputWithProfile( thMemory, inflammatoryRate * k2BloodInput_thMemory) ; // bloodtcMemory.MigrateOutputWithProfile( tcMemory, inflammatoryRate * k2BloodInput_tcMemory) ; bloodthMemory.MigrateOutputWithProfile( thMemory, k2BloodInput_thMemory) ; bloodtcMemory.MigrateOutputWithProfile( tcMemory, k2BloodInput_tcMemory) ; bCellMemory.MigrateOutputWithProfile(lymphOutputbCellMemory , inflammatoryOutputRate * k2LymphOutput_bCellMemory) ; thMemory.MigrateOutputWithProfile(lymphOutputthMemory , inflammatoryOutputRate * k2LymphOutput_thMemory) ; tcMemory.MigrateOutputWithProfile(lymphOutputtcMemory , inflammatoryOutputRate * k2LymphOutput_tcMemory) ; rate = bloodmonocyte * inflammatoryMonocyteRate * k2BloodInput_Macrophage; bloodmonocyte -= rate ; macrophage += rate; rate = bloodmonocyte * inflammatoryMonocyteRate * k2BloodInput_Dendritic; bloodmonocyte -= rate ; dendriticImmature += rate; macrophageApc.MigrateOutput(lymphOutputmacrophageApc , k2LymphOutput_macrophageApc) ; // dendriticApc.MigrateOutputWithProfile(lymphOutputdendriticApc , k2LymphOutput_dendriticApc) ; dendriticApc.MigrateOutputWithProfile(lymphOutputdendriticApc , inflammatoryDendriticOutputRate * k2LymphOutput_dendriticApc) ; plasmaCell.MigrateOutput(kHalfLifePlasmaCell); macrophageApc.MigrateOutput(kHalfLifeMacrophageApc); rate = macrophage * k2MacrophageDie; macrophage -= rate; x1 = macrophage + macrophageApc.ReadTotal() - macrophageInitial ; if (x1 < 0.0) { rate = macrophage * k2macrophageReplicate; macrophage += rate; } /* if */ rate = k2DendriticDie * dendriticImmature; dendriticImmature -= rate; x1 = dendriticImmature + dendriticApc.ReadTotal() - dendriticImmatureInitial ; if (x1 < 0.0) { rate = k2DendriticReplicate * dendriticImmature; dendriticImmature += rate; } /* if */ rate = k2EffectorKill * macrophageApc.ReadValue(INFLUENZASTRAIN) * tcEffector.ReadValue(INFLUENZASTRAIN) ; macrophageApc.AddStrain(INFLUENZASTRAIN,-rate) ; tcEffector.AddStrain(INFLUENZASTRAIN,-rate * knEffectorKill) ; rate = k2EffectorKillDendritic * dendriticApc.ReadValue(INFLUENZASTRAIN) * tcEffector.ReadValue(INFLUENZASTRAIN) ; dendriticApc.AddStrain(INFLUENZASTRAIN,-rate) ; tcEffector.AddStrain(INFLUENZASTRAIN,-rate * knEffectorKill) ; #if 0 /* disable for now? */ rate = k2EffectorKill * macrophageApc.ReadValue(RYEGRASSSTRAIN) * tcEffector.ReadValue(RYEGRASSSTRAIN) ; macrophageApc.AddStrain(RYEGRASSSTRAIN,-rate) ; tcEffector.AddStrain(RYEGRASSSTRAIN,-rate * knEffectorKill) ; rate = k2EffectorKillDendritic * dendriticApc.ReadValue(RYEGRASSSTRAIN) * tcEffector.ReadValue(RYEGRASSSTRAIN) ; dendriticApc.AddStrain(RYEGRASSSTRAIN,-rate) ; tcEffector.AddStrain(RYEGRASSSTRAIN,-rate * knEffectorKill) ; #endif thMemory.ApcActivate(thMemoryBlast[0],dendriticApc,k2ThMemoryActivate,kmThMemoryActivate); thMemoryActivateCount += dthMemoryActivateCount; if (thMemoryActivateCount >= 1.0) { printf("********************** memory activation count 0:%g 1:%g 2:%g 3:%g kthBlastActivateMemory:%g\n",thMemoryBlast[0].ReadValueWithProfile(RYEGRASSSTRAIN,TH2),thMemoryBlast[1].ReadValueWithProfile(RYEGRASSSTRAIN,TH2),thMemoryBlast[2].ReadValueWithProfile(RYEGRASSSTRAIN,TH2),thMemoryBlast[3].ReadValueWithProfile(RYEGRASSSTRAIN,TH2),kthBlastActivateMemory); thMemoryActivateCount = 0.0 ; for (i = (NUMBEROFTHMEMORYACTIVATE - 2); i >= 0; i--) { thMemoryBlast[i].MigrateOutputWithProfile(thMemoryBlast[i + 1], kthBlastActivateMemory) ; } /* iForLoop */ } /* if */ thMemoryBlast[NUMBEROFTHMEMORYACTIVATE - 1].ApcDeActivate(thMemory,dendriticApc, k2ThEffector2Memory,kmThEffector2Memory); x1 = dendriticApc.ReadValue(RYEGRASSSTRAIN); x1 = thMemoryBlast[NUMBEROFTHMEMORYACTIVATE - 1].ReadValueWithProfile(RYEGRASSSTRAIN,TH2) * x1; rate = kGenerateIl3 * x1; il3 += rate ; rate = kGenerateIl5 * x1; il5 += rate ; rate = kHalfLifeil3 * il3 ; il3 -= rate; rate = kHalfLifeil5 * il5 ; il5 -= rate; rate = kTransferil3 * il3 ; il3 -= rate; bloodil3 += rate; rate = kTransferil5 * il5 ; il5 -= rate; bloodil5 += rate; thMemoryBlast[NUMBEROFTHMEMORYACTIVATE - 1].MigrateOutputWithProfile(lymphOutputthMemory , inflammatoryOutputRate * k2LymphOutput_thMemory) ; rate = kHalfLifehistamine * histamine ; histamine -= rate; rate = k2mastCellNaive * mastCellNaive * ige.ReadValue(RYEGRASSSTRAIN) ; mastCellNaive -= rate ; mastCell.AddStrain(RYEGRASSSTRAIN, igeProfileGlobal ,rate); ige.AddStrain(RYEGRASSSTRAIN, -rate * knmastCellNaive); rate = kHalfLifemastCellNaive * mastCellNaive; mastCellNaive -= rate ; mastCellDegranulate.MigrateOutput(kHalfLifemastCellDegranulate); mastCell.MigrateOutput(kHalfLifemastCell); rate = bloodmastCell * il3inflammatoryRate * k2BloodInput_mastCell; bloodmastCell -= rate ; mastCellNaive += rate; rate = bloodeosinophil * il5inflammatoryRate * k2BloodInput_eosinophil ; bloodeosinophil -= rate ; eosinophil += rate; rate = k2eosinophilLtc4 * eosinophil * il5 * il5 * il5 * il5; // rate = k2eosinophilLtc4 * eosinophil * il5 / (kmeosinophilLtc4 + il5); ltc4 += rate ; // printf("kmeosinophilLtc4:%g k2eosinophilLtc4:%g rate:%g il5:%g x1:%g\n",kmeosinophilLtc4,k2eosinophilLtc4,rate,il5,x1); rate = kHalfLifeltc4 * ltc4 ; ltc4 -= rate; rate = kHalfLifeeosinophil * eosinophil; eosinophil -= rate ; x1 = histamine + (kltc4multiplier * ltc4) ; fev1 = 100.0 * (1.0 - k2fev1 * x1 / (kmfev1 + x1)); } void GenericImmuneTissue::ExecuteLaminaProperia () { double rate,x1; /* bal equations */ antigenBal.MigrateOutput(k2MucociliaryClearance); rate = antigenBal.ReadValue(INFLUENZASTRAIN); if (rate > 1.0e-10) { /* hack, when antigen is essentially gone, don't evaluate */ rate *= k2InfluenzaNeutralize * igaBal.ReadValue(INFLUENZASTRAIN); antigenBal.AddStrain(INFLUENZASTRAIN, -rate); igaBal.AddStrain(INFLUENZASTRAIN, -rate * knInfluenzaNeutralize); } /* if */ igaBal.MigrateOutput(kHalfLifeIgA); /* Epithelia equations */ rate = k2EpitheliaReplication * epitheliaDead; epitheliaDead -= rate; epitheliaCell += rate; /* replication/fibroblasts */ rate = k2EpitheliaInfection * epitheliaCell * antigenBal.ReadValue(INFLUENZASTRAIN) ; epitheliaCell -= rate ; epitheliaApc += rate ; antigenBal.AddStrain(INFLUENZASTRAIN, -rate * knEpitheliaInfection); rate = k2EpitheliaResistive * epitheliaCell * interferonAlpha ; epitheliaResistive += rate ; epitheliaCell -= rate ; interferonAlpha -= rate * knEpitheliaResistive; rate = k2EpitheliaDie * epitheliaCell ; epitheliaCell -= rate ; epitheliaDead += rate; rate = k2EpitheliaResistiveDie * epitheliaResistive ; epitheliaResistive -= rate ; epitheliaCell += rate; rate = k2VirusReplication * epitheliaApc ; antigenBal.AddStrain(INFLUENZASTRAIN, rate); rate = k2EpitheliaApcDie * epitheliaApc ; epitheliaApc -= rate ; epitheliaDead += rate; rate = k2EffectorKill * epitheliaApc * tcEffector.ReadValue(INFLUENZASTRAIN) ; epitheliaApc -= rate ; epitheliaDead += rate; tcEffector.AddStrain(INFLUENZASTRAIN, -rate * knEffectorKill); tcEffector.MigrateAicd(dendriticApc, k2tcAicd,kmtcAicd,k0tcAicd); thEffector.MigrateAicd(dendriticApc, k2thAicd,kmthAicd,k0thAicd); tcEffector.ApcDeActivate(tcMemory,dendriticApc, k2TcEffector2Memory,kmTcEffector2Memory); thEffector.ApcDeActivate(thMemory,dendriticApc, k2ThEffector2Memory,kmThEffector2Memory); rate = k2MacrophageInfection * macrophage * antigenBal.ReadValue(INFLUENZASTRAIN) ; macrophage -= rate ; macrophageApc.AddStrain(INFLUENZASTRAIN, rate); antigenBal.AddStrain(INFLUENZASTRAIN, -rate * knMacrophageInfection); rate = k2GenerateInterferonAlpha * macrophageApc.ReadTotal() ; interferonAlpha += rate; rate = interferonAlpha * kHalfLifeInterferonAlpha; interferonAlpha -= rate; /* Interstitium equations */ inflammatoryRate = 1.0 + knInflammatory * tnfAlpha / (kmInflammatory + tnfAlpha); inflammatoryMonocyteRate = 1.0 + knMonocyteInflammatory * tnfAlpha / (kmInflammatory + tnfAlpha); inflammatoryOutputRate = 1.0 + knInflammatoryOutput * tnfAlpha / (kmInflammatoryOutput + tnfAlpha); inflammatoryDendriticOutputRate = 1.0 + knInflammatoryDendriticOutput * tnfAlpha / (kmInflammatoryOutput + tnfAlpha); rate = k2DendriticInfection * dendriticImmature * antigenBal.ReadValue(INFLUENZASTRAIN) ; dendriticImmature -= rate ; dendriticApc.AddStrain(INFLUENZASTRAIN, kDendriticInfectionProfile, rate); antigenBal.AddStrain(INFLUENZASTRAIN, -rate * knDendriticInfection); rate = k2IgaProduction * plasmaCell.ReadValueWithProfile(INFLUENZASTRAIN,IGA) ; igaBal.AddStrain(INFLUENZASTRAIN, rate); rate = kGenerateGmcsf * macrophageApc.ReadTotal() ; bloodgmcsf += rate ; rate = kGenerateTnfAlpha * macrophageApc.ReadTotal() ; tnfAlpha += rate ; rate = kHalfLifeTnfAlpha * tnfAlpha ; tnfAlpha -= rate; bloodbCellNaiveRecirculate.MigrateOutput(bCellNaiveRecirculate , inflammatoryRate * k2BloodInput_bCellNaiveRecirculate) ; bCellNaiveRecirculate.MigrateOutput(lymphOutputbCellNaiveRecirculate , k2LymphOutput_bCellNaiveRecirculate) ; bloodthEffector.MigrateOutputWithProfile(thEffector , inflammatoryRate * k2BloodInput_thEffector) ; bloodtcEffector.MigrateOutput(tcEffector , inflammatoryRate * k2BloodInput_tcEffector) ; bloodplasmaCell.MigrateOutputWithProfile(plasmaCell, inflammatoryRate * k2BloodInputPlasmaCell) ; bloodbCellMemory.MigrateOutputWithProfile(bCellMemory , inflammatoryRate * k2BloodInput_bCellMemory) ; // bloodthMemory.MigrateOutputWithProfile( thMemory, inflammatoryRate * k2BloodInput_thMemory) ; // bloodtcMemory.MigrateOutputWithProfile( tcMemory, inflammatoryRate * k2BloodInput_tcMemory) ; bloodthMemory.MigrateOutputWithProfile( thMemory, k2BloodInput_thMemory) ; bloodtcMemory.MigrateOutputWithProfile( tcMemory, k2BloodInput_tcMemory) ; bCellMemory.MigrateOutputWithProfile(lymphOutputbCellMemory , inflammatoryOutputRate * k2LymphOutput_bCellMemory) ; thMemory.MigrateOutputWithProfile(lymphOutputthMemory , inflammatoryOutputRate * k2LymphOutput_thMemory) ; tcMemory.MigrateOutputWithProfile(lymphOutputtcMemory , inflammatoryOutputRate * k2LymphOutput_tcMemory) ; rate = bloodmonocyte * inflammatoryMonocyteRate * k2BloodInput_Macrophage; bloodmonocyte -= rate ; macrophage += rate; rate = bloodmonocyte * inflammatoryMonocyteRate * k2BloodInput_Dendritic; bloodmonocyte -= rate ; dendriticImmature += rate; macrophageApc.MigrateOutput(lymphOutputmacrophageApc , k2LymphOutput_macrophageApc) ; // dendriticApc.MigrateOutputWithProfile(lymphOutputdendriticApc , k2LymphOutput_dendriticApc) ; dendriticApc.MigrateOutputWithProfile(lymphOutputdendriticApc , inflammatoryDendriticOutputRate * k2LymphOutput_dendriticApc) ; plasmaCell.MigrateOutput(kHalfLifePlasmaCell); macrophageApc.MigrateOutput(kHalfLifeMacrophageApc); rate = macrophage * k2MacrophageDie; macrophage -= rate; x1 = macrophage + macrophageApc.ReadTotal() - macrophageInitial ; if (x1 < 0.0) { rate = macrophage * k2macrophageReplicate; macrophage += rate; } /* if */ rate = k2DendriticDie * dendriticImmature; dendriticImmature -= rate; x1 = dendriticImmature + dendriticApc.ReadTotal() - dendriticImmatureInitial ; if (x1 < 0.0) { rate = k2DendriticReplicate * dendriticImmature; dendriticImmature += rate; } /* if */ rate = k2EffectorKill * macrophageApc.ReadValue(INFLUENZASTRAIN) * tcEffector.ReadValue(INFLUENZASTRAIN) ; // macrophageApc.AddStrain(INFLUENZASTRAIN,-rate) ; // tcEffector.AddStrain(INFLUENZASTRAIN,-rate * knEffectorKill) ; rate = k2EffectorKillDendritic * dendriticApc.ReadValue(INFLUENZASTRAIN) * tcEffector.ReadValue(INFLUENZASTRAIN) ; dendriticApc.AddStrain(INFLUENZASTRAIN,-rate) ; tcEffector.AddStrain(INFLUENZASTRAIN,-rate * knEffectorKill) ; }