C C There are a total of 5 entries in the algebraic variable array. C There are a total of 2 entries in each of the rate and state variable arrays. C There are a total of 17 entries in the constant variable array. C C C VOI is time in component environment (minute). C STATES(1) is x1 in component x1 (picomole). C CONSTS(15) is k in component k (flux). C ALGBRC(5) is lambda_Ca in component lambda_Ca (per_minute). C CONSTS(1) is lambda1 in component model_parameters (per_minute). C CONSTS(16) is A in component A (per_minute). C CONSTS(17) is B in component B (per_minute). C ALGBRC(1) is Ca in component Ca (millimolar). C ALGBRC(4) is S in component S (millimolar). C ALGBRC(3) is m_Ca in component m_Ca (dimensionless). C CONSTS(2) is m1 in component model_parameters (dimensionless). C CONSTS(3) is m2 in component model_parameters (dimensionless). C CONSTS(4) is beta in component model_parameters (litre_per_millimole). C CONSTS(5) is R in component model_parameters (millimolar). C STATES(2) is x2 in component x2 (picomole). C ALGBRC(2) is PTH in component x2 (picomole). C CONSTS(6) is lambda2 in component model_parameters (per_minute). C CONSTS(7) is Ca_0 in component model_parameters (millimolar). C CONSTS(8) is Ca_1 in component model_parameters (millimolar). C CONSTS(9) is alpha in component model_parameters (per_minute). C CONSTS(10) is t0 in component model_parameters (minute). C CONSTS(11) is x1_n in component model_parameters (picomole). C CONSTS(12) is x2_n in component model_parameters (picomole). C CONSTS(13) is x2_max in component model_parameters (picomole). C CONSTS(14) is x2_min in component model_parameters (picomole). C RATES(1) is d/dt x1 in component x1 (picomole). C RATES(2) is d/dt x2 in component x2 (picomole). C SUBROUTINE initConsts(CONSTS, RATES, STATES) REAL CONSTS(*), RATES(*), STATES(*) STATES(1) = 0.00 CONSTS(1) = 0.0125 CONSTS(2) = 112.5200 CONSTS(3) = 15.00 CONSTS(4) = 1e6 CONSTS(5) = 1.2162 STATES(2) = 0.00 CONSTS(6) = 0.5595 CONSTS(7) = 1.255 CONSTS(8) = 0.1817 CONSTS(9) = 0.0442 CONSTS(10) = 575.0 CONSTS(11) = 490.7800 CONSTS(12) = 6.6290 CONSTS(13) = 14.0430 CONSTS(14) = 0.6697 CONSTS(15) = CONSTS(6)*CONSTS(12)+ CONSTS(1)*CONSTS(11) CONSTS(16) = ( CONSTS(1)*CONSTS(6)*CONSTS(13))/(CONSTS(15) - CONSTS(6)*CONSTS(13)) CONSTS(17) = ( CONSTS(1)*CONSTS(6)*CONSTS(14))/(CONSTS(15) - CONSTS(6)*CONSTS(14)) RETURN END SUBROUTINE computeRates(VOI, CONSTS, RATES, STATES, ALGBRC) REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*) ALGBRC(1) = TERNRY(VOI.LT.CONSTS(10), CONSTS(7), CONSTS(7) - CONSTS(8)*(1.00000 - EXP( - CONSTS(9)*(VOI - CONSTS(10))))) ALGBRC(3) = CONSTS(2)/(1.00000+EXP( - CONSTS(4)*(CONSTS(5) - ALGBRC(1))))+CONSTS(3) ALGBRC(4) = CONSTS(7)*- (( CONSTS(11)*CONSTS(17) - CONSTS(6)*CONSTS(12))/( CONSTS(11)*CONSTS(16) - CONSTS(6)*CONSTS(12))) ** 1.00000/ALGBRC(3) ALGBRC(5) = (CONSTS(16) - CONSTS(17))/(1.00000+ALGBRC(1)/ALGBRC(4) ** ALGBRC(3))+CONSTS(17) RATES(1) = CONSTS(15) - ( ALGBRC(5)*STATES(1)+ CONSTS(1)*STATES(1)) RATES(2) = ALGBRC(5)*STATES(1) - CONSTS(6)*STATES(2) RETURN END SUBROUTINE computeVariables(VOI, CONSTS, RATES, STATES, ALGBRC) REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*) ALGBRC(1) = TERNRY(VOI.LT.CONSTS(10), CONSTS(7), CONSTS(7) - CONSTS(8)*(1.00000 - EXP( - CONSTS(9)*(VOI - CONSTS(10))))) ALGBRC(3) = CONSTS(2)/(1.00000+EXP( - CONSTS(4)*(CONSTS(5) - ALGBRC(1))))+CONSTS(3) ALGBRC(4) = CONSTS(7)*- (( CONSTS(11)*CONSTS(17) - CONSTS(6)*CONSTS(12))/( CONSTS(11)*CONSTS(16) - CONSTS(6)*CONSTS(12))) ** 1.00000/ALGBRC(3) ALGBRC(5) = (CONSTS(16) - CONSTS(17))/(1.00000+ALGBRC(1)/ALGBRC(4) ** ALGBRC(3))+CONSTS(17) ALGBRC(2) = STATES(2)/2.75000 RETURN END REAL FUNCTION TERNRY(TEST, VALA, VALB) LOGICAL TEST REAL VALA, VALB IF (TEST) THEN TERNRY = VALA ELSE TERNRY = VALB ENDIF RETURN END