Location: Ikeda BMadonna QKDB @ c560868b736d / ikedaBMfromDAEML.txt

Author:
Ting Yu <ting.yu@auckland.ac.nz>
Date:
2014-05-05 11:11:02+12:00
Desc:
Change the unit from dimensionless to TODO.
Permanent Source URI:
http://models.cellml.org/workspace/194/rawfile/c560868b736d95fd544954a4a3d5875175c194dc/ikedaBMfromDAEML.txt

METHOD stiff
STARTTIME = 0
STOPTIME = 100
DT = 0.002
 
{
  *
  *  Test of DAEML translation to Berkeley Madonna
  *
}

{ *** Model description***

			Implementation of Ikeda Model (1979)
		
}

; ***Units list goes here***

{ Parameter list (values don't change during the simulation):
	   RTOT (mmHg.min/l), types: ;  total resistance in systemic circulation 
	   KR (dimensionless), types: ;  parameter of right heart performance 
	   RTOP (mmHg.min/l), types: ;  total resistance in pulmonary circulation 
	   KL (dimensionless), types: ;  parameter of left heart performance 
	   DEN (dimensionless), types: ;  proportional constant between QCO and VB 
	   XHB (g/dl), types: ;  blood hemoglobin concentration
	   FO2I (dimensionless), types: ;  volume fraction of O2 in dry inspired gas
	   PBA (mmHg), types: ;  barometric pressure
	   PBL (mmHg), types: ;  PBA-vapor pressure
	   VAL (l), types: ;  total alveolar volume
	   MRCO (l(STPD)/min), types: ;  metabolic production rate of CO2
	   MRO2 (l(STPD)/min), types: ;  metabolic production rate of O2
	   VI0 (l), types: ;  normal value of ventilation
	   TRSP1 (min), types: ;  time constant for ventilation
	   TRSP (min), types: ;  time constant for XCO3
	   QIN (l/min), types: ;  rate of drinking
	   QVIN (l/min), types: ;  rate of intravenous water input
	   QIWL (l/min), types: ;  ate of insensible water loss
	   QMWP (l/min), types: ;  rate of metabolic water production
	   QLF0 (l/min), types: ;  rate of lymph flow zero
	   VIF0 (l), types: ;  Interstitial fluid volume zero
	   CFC (l/min/mmHg), types: ;  capillary filtration coefficient
	   VRBC (l), types: ;  volume of red blood cells
	   CRAV (dimensionless), types: ;  arterial resistance/venous resistance
	   CSM (l^2/mEq/min), types: ;  transfer coefficient of water from ECF to ICF caused by osmotic gradient
	   YNIN (mEq/min), types: ;  intake rate of sodium
	   CKEI (dimensionless), types: ;  potassium transfer coeff from ECF to ICF
	   YKIN (mEq/min), types: ;  intake rate of potassium
	   XGL0 (mg/dl), types: ;  reference value of ECF glucose concentration
	   YINS (unit/min), types: ;  intake rate of insulin
	   YGLI (g/min), types: ;  intake rate of glucose
	   YMNI (mEq/min), types: ;  renal excretion rate of mannitol
	   YURI (mEq/min), types: ;  renal excretion rate of urea
	   CGL1 (dimensionless), types: ;  parameter of glucose metabolism
	   CGL2 (dimensionless), types: ;  parameter of glucose metabolism
	   CGL3 (dimensionless), types: ;  parameter of glucose metabolism
	   CHEI (dimensionless), types: ;  transfer coefficient of hydrogen
	   CBFI (dimensionless), types: ;  ?????
	   YCAI (mEq/min), types: ;  intake rate of calcium
	   YCLI (mEq/min), types: ;  intake rate of chloride
	   YMGI (mEq/min), types: ;  intake rate of magnesium
	   YOGI (mM/min), types: ;  intake rate of organic acid
	   YPOI (mM/min), types: ;  intake rate of phosphate
	   YSOI (mEq/min), types: ;  intake rate of sulphate
	   CPRX (dimensionless), types: ;  excretion ratio of filtered load after proximal tubule
	   YNH0 (mEq/min), types: ;  normal excretion rate of ammonium
	   YTA0 (mEq/min), types: ;  intake rate of titratable acid
	   CKAL (dimensionless), types: ;  weight of effect of XKE on aldosterone secretion
	   CNAL (dimensionless), types: ;  weight of effect of YNH on aldosterone secretion
	   COAD (dimensionless), types: ;  weight of effect of OSMP on ADH secretion
	   CPAD (dimensionless), types: ;  weight of effect of PVP on ADH secretion
	   CPAL (dimensionless), types: ;  weight of effect of PAS on aldosterone secretion
	   CPVL (dimensionless), types: ;  weight of effect of PVP on aldosterone secretion
	   GFR0 (dimensionless), types: ;  normal value of GFR 
	   ACTH (dimensionless), types: ;  ??? 
	   VEC0 (l), types: ;  normal value of VEC
	   TADH (min), types: ;  time constant of ADH secretion
	   TALD (min), types: ;  time constant of aldosterone secretion
}


; ***Parameter values:
RTOT = 20
KR = 0.3
RTOP = 3
KL = 0.2
DEN = 1
XHB = 15
FO2I = 0.21
PBA = 760
PBL = PBA-47
VAL=3
MRCO=0.2318
MRO2=0.2591
VI0=5
TRSP1=2
TRSP=1
QIN=0.001
QVIN=0
QIWL=0.0005
QMWP=0.0005
QLF0=0.002
VIF0=8.8
CFC=0.007
VRBC=1.8
CRAV=5.93
CSM = 0.0003
YNIN=0.12
CKEI=0.001
YKIN=0.047
XGL0=108
YINS=0
YGLI=0
YMNI=0
YURI=0.15
CGL1=1
CGL2=1
CGL3=0.03
CHEI=5
CBFI=10^-9
YCAI=0.007
YCLI=0.1328
YMGI=0.008
YOGI=0.01
YPOI=0.025
YSOI=0.02
CPRX=0.2
YNH0=0.024
YTA0=0.0068
CKAL=0.5
CNAL=0.1
COAD=0.5
CPAD=1
CPAL=0.01
CPVL=0.1
GFR0=0.1
ACTH=1
VEC0=11
TADH=30
TALD=30

{ Variables (values may change during the simulation):
	   FCOI (dimensionless), types: output ;  volume fraction of CO2 in dry inspired gas 
	   QCO0 (l/min), types: output ;  cardiac output zero ?????? 
	   QCO (l/min), types: output ;  cardiac output 
	   PAS (mmHg), types: output ;  systemic arterial pressure 
	   PVS (mmHg), types: output ;  systemic venous pressure 
	   PAP (mmHg), types: output ;  pulmonary arterial pressure 
	   PVP (mmHg), types: output ;  pulmonary venous pressure 
	   FCOA (dimensionless), types: state output ;  volume fraction of CO2 in dry alveolar gas 
	   FO2A (dimensionless), types: state output ;  volume fraction of O2 in dry alveolar gas 
	   UCOV (l(STPD)/l.blood), types: state output ;  content of CO2 in venous blood 
	   UO2V (l(STPD)/l.blood), types: state output ;  content of O2 in venous blood 
	   UCOA (l(STPD)/l.blood), types: output ;  content of CO2 in arterial blood 
	   UO2A (l(STPD)/l.blood), types: output ;  content of O2 in arterial blood 
	   VI (l), types: state output ;  ventilation 
	   k1 (dimensionless), types: output ;  coeff ventilation VR
	   k2 (dimensionless), types: output ;  coeff ventilation VR
	   k3 (dimensionless), types: output ;  coeff ventilation VR
	   k4 (dimensionless), types: output ;  coeff ventilation VR
	   k5 (dimensionless), types: output ; coeff ventilation VR
	   k6 (dimensionless), types: output ;  coeff ventilation VR
	   VR (dimensionless), types: output ;  ventilation VR
	   UHBO (l(STPD)/l.blood), types: output ;  blood oxyhemoglobin 
	   DCLA (mEq/l), types: output ;  chloride shift 
	   UHB (l(STPD)/l.blood), types: output ;  blood O2 combining power 
	   PCOA (mmHg), types: output ;  CO2 tension in alveoli 
	   PO2A (mmHg), types: output ;  O2 tension in alveoli 
	   PHA (dimensionless), types: output ;  pH of arterial blood 
	   XCO0 (mEq/l), types: output ;  ECF bicarbonate concentration zero
	   XCO3 (mEq/l), types: state output ;  ECF bicarbonate concentration
	   VB (l), types: output ;  Blood Volume
	   HT (%), types: output ;  hematocrit
	   VEC (l), types: output ;  extracellular fluid volume
	   VIN (l), types: state output ;  volume of water input
	   VIF (l), types: state output ;  Interstitial fluid volume
	   PC (mmHg), types: output ;  Capillary pressure
	   ZPP (g), types: state output ;  total plasma protein
	   XPP (g/l), types: output ;  plasma protein concentration
	   XPIF (g/l), types: output ;  ISF protein concentration
	   YPLC (g/min), types: output ;  flow of protein through capillary
	   ZPIF (g), types: state output ;  ISF protein content 
	   ZPLG (g), types: state output ;  protein content in pulmonary fluid 
	   ZPG (g), types: state output ;  protein content in interstitial gel 
	   YPLG (g/min), types: output ;  flow of protein into pulmonary fluid
	   YPLF (g/min), types: output ;  flow of protein in lymphatic vessel
	   YPLV (g/min), types: output ;  destruction rate of protein in liver
	   YPG (g/min), types: output ;  flow of protein into interstitial gel
	   VP (l), types: state output ;  plasma volume 
	   PIF (mmHg), types: output ;  interstitial fluid pressure 
	   QCFR (l/min), types: output ;  capillary filtration rate
	   QLF (l/min), types: output ;  rate of lymph flow
	   QPLC (l/min), types: output ;  ??? 
	   PPCO (mmHg), types: output ;  plasma colloid osmotic pressure
	   PICO (mmHg), types: output ;  interstitial colloid osmotic pressure
	   ZNE (mEq), types: state output ;  ECF sodium content 
	   ZKE (mEq), types: state output ;  ECF potassium content 
	   ZKI (mEq), types: state output ;  ICF potassium content 
	   YGLU (mEq/min), types: output ;  renal excretion of glucose 
	   XNE (mEq/l), types: output ;  ECF sodium concentration 
	   XKE (mEq/l), types: output ;  ECF potassium concentration 
	   XKI (mEq/l), types: output ;  ICF potassium concentration 
	   ZHI (?), types: state output ;  ICF hydrogen content ??? 
	   PHI (dimensionless), types: output ;  pH of intracellular fluid 
	   YINT (?/min), types: state output ;  ??? 
	   YGLS (unit/min), types: output ;  ????? 
	   ZGLE (mEq), types: state output ;  ECF glucose content 
	   XGLE (mEq/l), types: output ;  ECF glucose concentration 
	   OSMP (mOsm/l), types: output ;  plasma osmolality 
	   ZMNE (mEq), types: state output ;  ECF mannitol content 
	   XMNE (mEq/l), types: output ;  ECF mannitol concentration 
	   ZURE (mEq), types: state output ;  ECF urea content 
	   XURE (mEq/l), types: output ;  ECF urea concentration 
	   VTW (l), types: output ;  total body water 
	   YMNU (mEq/min), types: output ;  intake rate of mannitol 
	   YURU (mEq/min), types: output ;  intake rate of urea 
	   VIC (l), types: state output ;  intracellular fluid volume 
	   QIC (l/min), types: output ;  rate of water flow into intracellular space 
	   YCO3 (mEq/min), types: output ;  renal excretion rate of bicarbonate 
	   YCA (mEq/min), types: output ;  renal excretion rate of calcium 
	   YMG (mEq/min), types: output ;  renal excretion rate of magnesium 
	   YSO4 (mEq/min), types: output ;  renal excretion rate of sulphate 
	   YPO4 (mM/min), types: output ;  renal excretion rate of phosphate 
	   YORG (mM/min), types: output ;  renal excretion rate of organic acid 
	   ZCAE (mEq/min), types: state output ;  ECF calcium content 
	   ZMGE (mEq/min), types: state output ;  ECF magnesium content 
	   ZSO4 (mEq/min), types: state output ;  ECF sulphate content 
	   ZPO4 (mM/min), types: state output ;  ECF phosphate content 
	   ZOGE (mM/min), types: state output ;  ECF organic acid content 
	   ZCLE (mEq/min), types: state output ;  ECF chloride content 
	   XCAE (mEq/l), types: output ;  ECF calcium concentration 
	   XMGE (mEq/l), types: output ;  ECF magnesium concentration 
	   XSO4 (mEq/l), types: output ;  ECF sulphate concentration 
	   XPO4 (mM/l), types: output ;  ECF phosphate concentration 
	   XOGE (mM/l), types: output ;  ECF organic acid concentration 
	   XCLE (mEq/l), types: output ;  ECF chloride concentration 
	   XCLA (mEq/l), types: output ;  arterial chloride concentration 
	   STBC (mEq/l), types: output ;  standard bicarbonate at pH=7,4 
	   YCLU (mEq/min), types: output ;  renal excretion rate of chloride 
	   YNH4 (mEq/min), types: output ;  renal excretion rate of ammonium 
	   YTA1 (mEq/min?), types: output ;  ???? rate of titratable acid 
	   PHU2 (dimensionless), types: state output ;  pH of urine temp 
	   STPO (?), types: output ;  ???? 
	   PHU (dimensionless), types: output ;  pH of urine 
	   STPG (?), types: output ;  ???? 
	   YTA (mEq/min), types: output ;  renal excretion rate of titratable acid 
	   PHA1 (dimensionless), types: state output ;  pH of arterial blood 
	   PHU1 (dimensionless), types: state output ;  pH of urine 
	   YNOD (mEq/min), types: output ;  ???? 
	   YNU (mEq/min), types: output ;  rate of renal loss of sodium 
	   YND (mEq/min), types: output ;  rate of sodium excretion in distal tubule 
	   YKU (mEq/min), types: output ;  rate of renal loss of potassium 
	   YKD (mEq/min), types: output ;  rate of potassium excretion in distal tubule 
	   OSMU (mOsm/l), types: output ;  urine osmolality
	   QWD (l/min), types: output ;  rate of urinary excretion in distal tubule 
	   QWU (l/min), types: output ; rate of urinary output 
	   YNH (mEq/min), types: output ;  rate of sodium excretion in Henle loop 
	   ADH (dimensionless), types: output ;  effect of antidiuretic hormone (ratio to normal) 
	   ALD (dimensionless), types: output ;  effect of aldosterone (ratio to normal) 
	   THDF (dimensionless), types: output ;  effect of third factor (ratio to normal) 
	   GFR1 (??), types: output ;  glomerular filtration rate temp 
	   GFR (l/min), types: output ;  glomerular filtration rate 
	   ALD0 (dimensionless), types: state output ;  effect of aldosterone 
	   ADH0 (dimensionless), types: state output ;  effect of antidiuretic hormone 
	   ALD1 (dimensionless), types: output ;  effect of aldosterone 
}


; ***Variable values and definitions:
FCOI=IF time>5 AND (time)<=35 THEN 0.05 ELSE 0  ;
QCO0 = VB*DEN;
QCO = QCO0+1;
PAS=20+RTOT*QCO0;
PVS=MAX(0,-10.33+QCO0/KR);
PAP=8+RTOP*QCO0;
PVP=MAX(0,-16+QCO0/KL);
UCOA=6.732*10^-4*PCOA+0.02226*XCO3;
UO2A=3.168*10^-5*PO2A+UHBO;
  k1=IF (PHA)<=7.4 THEN 0.22 ELSE 0.0258;
 k2=IF (PCOA)>40 THEN 1 ELSE 0.0396;
 k3=0.58;
 k4=3.496;
 k5=IF (PCOA)>40 THEN -32.08 ELSE 160.11;
 k6=IF (PHA)<=7.4 THEN -12.734 ELSE -5.003;
 VR=k1*(10^(9-PHA))+k2*(k3+k4/(PO2A-32))*(PCOA+k5)+k6;
UHBO=UHB*((1-exp(-PO2A*(0.0066815*PHA^3-0.10098*PHA^2+0.44921*PHA-0.454)))^2);
 DCLA=XCO3-STBC ;
UHB=XHB/75;
PCOA=FCOA*(PBA-47);
PO2A=FO2A*(PBA-47);
PHA=6.1+log10(XCO3/(0.03*PCOA));
XCO0=STBC-(0.527*XHB+3.7)*(PHA-7.4)+0.375*(UHB-UHBO)/0.02226;
VB=VRBC+VP;
HT=VRBC/VB;
VEC=VP+VIF;
PC=(CRAV*PVS+PAS)/(1+CRAV);
XPP=ZPP/VP;
XPIF=ZPIF/VIF;
YPLC=QPLC*(XPP-XPIF);
YPLG=0.00023*(XPP-ZPLG);
YPLF=XPIF*QLF;
YPLV=XPP*0.00047-0.0329;
YPG=0.0057*(XPIF-ZPG);
PIF=IF ((VIF/VIF0)<=0.9) THEN (-15) ELSE IF ((VIF/VIF0)>0.9 AND (VIF/VIF0)<=1) THEN (87*(VIF/VIF0)-93.3) ELSE IF ((VIF/VIF0)>1 AND (VIF/VIF0)<=2) THEN (-6.3*(2-(VIF/VIF0))^10) ELSE ((VIF/VIF0)-2)
 QLF=QLF0*(24/(1+exp(-0.4977*PIF))); 
 QCFR=CFC*(PC-PPCO-PIF+PICO); 
 QPLC=2.768*10^-6*PC^2; 
 PPCO=0.4*XPP; 
 PICO=0.25*XPIF; 
 YGLU=IF (XGLE*GFR)<0.65 THEN 0 ELSE  XGLE*GFR-0.65 ;  
 XNE=ZNE/VEC; 
 XKE=ZKE/VEC; 
 XKI=ZKI/VIC; 
 PHI=-log10(CBFI*ZHI); 
 YGLS=CGL1*YINT+CGL2*YINS; 
 XGLE=ZGLE/VEC; 
 OSMP=(XNE+XKE)*1.86+XGLE+XURE+XMNE+9.73; 
 XMNE=ZMNE/VEC; 
 XURE=ZURE/VTW; 
 VTW=VEC+VIC; 
 YMNU=1*GFR*XMNE; 
 YURU=XURE*GFR*0.6; 
 QIC=CSM*((-XNE-XKE)-XGLE+(10.5+XKI)); 
 YCO3=IF (XCO3*GFR*(-PCOA/120+4/3))<=2 THEN 0 ELSE IF (XCO3*GFR*(-PCOA/120+4/3)>2 AND (XCO3*GFR*(-PCOA/120+4/3))<=4) THEN 0.1638*( XCO3*GFR*(-PCOA/120+4/3)-2)^2.61 ELSE  XCO3*GFR*(-PCOA/120+4/3)-3; 
 YCA=IF (XCAE*GFR)<0.493 THEN 0 ELSE  XCAE*GFR-0.493; 
 YMG=IF (XMGE*GFR)<0.292 THEN 0 ELSE  XMGE*GFR-0.292; 
 YSO4=IF (XSO4*GFR)<0.08 THEN 0 ELSE  XSO4*GFR-0.08; 
 YPO4=IF (XPO4*GFR)<=0.11 THEN 5/22*XPO4*GFR ELSE  XPO4*GFR-0.085; 
 YORG=IF (XOGE*GFR)<=0.6 THEN XOGE*GFR/60 ELSE  XOGE*GFR/3-0.19; 
 XCAE=ZCAE/VEC; 
 XMGE=ZMGE/VEC; 
 XSO4=ZSO4/VEC; 
 XPO4=ZPO4/VEC; 
 XOGE=ZOGE/VEC; 
 XCLE=ZCLE/VEC; 
 XCLA=XCLE-DCLA; 
 STBC=XCAE+XMGE-XSO4-1.8*XPO4-XOGE-XCLE+XNE+XKE-0.2214*XPP; 
 YCLU=MAX(0,YNU+YKU-STPG+YNH4-YCO3+YCA+YMG-YSO4); 
 YNH4=YNH0*(-0.5*PHU1+4); 
 YTA1=IF (PHU2)<=4 THEN 0 ELSE IF (PHU2>4 AND (PHU2)<=5) THEN (YTA0*(-2.5*PHA1+19.5))*(PHU2-4) ELSE YTA0*(-2.5*PHA1+19.5); 
 STPO=YPO4*(1+1/(1+10^(6.8-PHA))); 
 PHU=-log10((-((10^-4.3+10^-6.8)*(STPG-YPO4-(1/(1+10^(PHA-4.3)))*YORG)-10^-6.8*YPO4-10^-4.3*YORG)+(((10^-4.3+10^-6.8)*(STPG-YPO4-(1/(1+10^(PHA-4.3)))*YORG)-10^-6.8*YPO4-10^-4.3*YORG)^2-4*(STPG-YPO4-(1/(1+10^(PHA-4.3)))*YORG)*((10^-4.3*10^-6.8)*((STPG-YPO4-(1/(1+10^(PHA-4.3)))*YORG)-YPO4-YORG)))^(0.5))/2/(STPG-YPO4-(1/(1+10^(PHA-4.3)))*YORG)); 
 STPG=MAX(0,STPO+YORG-YTA); 
 YTA=YTA1+0.009+ALD*0.001; 
 YNOD=MAX(0,YTA1+YNH4-YCO3); 
 YNU=MAX(YND*0.116-YNOD,0); 
 YND=XNE*(THDF*GFR*CPRX)*0.5*0.9-ALD*0.09; 
 YKU=0.39*YKD; 
 YKD=ALD*0.018*XKE+0.9*0.5*(THDF*GFR*CPRX)*XKE; 
 OSMU=(YGLU+YURU+YMNU+1.86*(YKU+YNU))/QWU; 
 QWD=(YGLU+YURU+YMNU+(YND+YKD)*1.86+0.32)/OSMP; 
 QWU=QWD-QWD*0.9*ADH; 
 YNH=0.5*(THDF*GFR*CPRX)*XNE; 
 ADH=1.1/(1+exp(-0.5*(ADH0+4.605))); 
 ALD=10/(1+exp(-0.4394*(ALD0-5))); 
 THDF=IF (PPCO)<=28 THEN -5*(PPCO/28-1)+1 ELSE 1; 
 GFR1=IF (PAS)<40 THEN 0 ELSE IF ((PAS)>=40 AND (PAS)<80) THEN 0.02*PAS-0.8 ELSE IF ((PAS)>=80 AND (PAS)<100) THEN -0.0005*(PAS-100)^2+1 ELSE 1; 
 GFR=GFR1*GFR0*VEC/VEC0; 
 ALD1=(ACTH-1)*1+(XKE-4.5)*CKAL-(PVP-4)*CPVL-(YNH-1.4)*CNAL-(PAS-100)*CPAL; 

; *** initialize state variables ***
INIT FCOA=0.0561
INIT FO2A=0.1473
INIT UCOV=0.6075
INIT UO2V=0.1515
INIT VI=5
INIT XCO3=24
INIT VIN=0.01
INIT VIF=VIF0
INIT ZPP=154
INIT ZPIF=176
INIT ZPLG=70
INIT ZPG=20
INIT VP=2.2
INIT ZNE=1540
INIT ZKE=49.5
INIT ZKI=2800
INIT ZHI=100
INIT YINT=0
INIT ZGLE=66
INIT ZMNE=0
INIT ZURE=77.5
INIT VIC=20
INIT ZCAE=55
INIT ZMGE=33
INIT ZSO4=11
INIT ZPO4=12.1
INIT ZOGE=66
INIT ZCLE=1144
INIT PHU2=6
INIT PHA1=7.4
INIT PHU1=6
INIT ALD0=0
INIT ADH0=0

; *** range conditions for the state variables ***

; *** ODEs ***
 d/dt (FCOA) = (VI*(FCOI-FCOA)+863/(PBA-47)*QCO*(UCOV-UCOA))/VAL; 
 d/dt (FO2A) = (VI*(FO2I-FO2A)+863/(PBA-47)*QCO*(UO2V-UO2A))/VAL; 
 d/dt (UCOV) = (MRCO+QCO*(UCOA-UCOV))/VTW; 
 d/dt (UO2V) = (-MRO2+QCO*(UO2A-UO2V))/VTW; 
 d/dt (VI) = (VR*VI0-VI)/TRSP1; 
 d/dt (XCO3) =  (XCO0-XCO3)/TRSP; 
 d/dt (VIN) = QIN-(VIN/10); 
 d/dt (VIF) = QCFR-QLF-QIC; 
 d/dt (ZPP) = YPLF-YPLG-YPLV-YPLC; 
 d/dt (ZPIF) = YPLC-YPG-YPLF; 
 d/dt (ZPLG) = (XPP-ZPLG)/24; 
 d/dt (ZPG) = (XPIF-ZPG)/150; 
 d/dt (VP) = (VIN/10+QVIN+QMWP+QLF)-(QIWL+QWU+QCFR); 
 d/dt (ZNE) = YNIN-YNU+CHEI*(0.4-PHA+PHI); 
 d/dt (ZKE) = YKIN-YKU-(CGL3*YGLS+CKEI*(2800*(1+0.5*log10(XKE/(56.744-7.06*PHA)))-ZKI)); 
 d/dt (ZKI) = CGL3*YGLS+CKEI*(2800*(1+0.5*log10(XKE/(56.744-7.06*PHA)))-ZKI); 
 d/dt (ZHI) = CHEI*(0.4-PHA+PHI); 
 d/dt (YINT) = 1/1.50*(XGLE-XGL0/18-YINT); 
 d/dt (ZGLE) = YGLI/180-YGLS-YGLU; 
 d/dt (ZMNE) = YMNI-YMNU; 
 d/dt (ZURE) = YURI-YURU; 
 d/dt (VIC) = QIC; 
 d/dt (ZCAE) = YCAI-YCA; 
 d/dt (ZMGE) = YMGI-YMG; 
 d/dt (ZSO4) = YSOI-YSO4; 
 d/dt (ZPO4) = YPOI-YPO4; 
 d/dt (ZOGE) = YOGI-YORG; 
 d/dt (ZCLE) = YCLI-YCLU; 
 d/dt (PHU2) = (PHU-PHU2)/TRSP; 
 d/dt (PHA1) = (PHA-PHA1)/200; 
 d/dt (PHU1) = (PHU-PHU1)/300; 
 d/dt (ALD0) = (ALD1-ALD0)/TALD; 
 d/dt (ADH0) = (((OSMP-287)*COAD-(PVP-4)*CPAD)-ADH0)/TADH;