Generated Code
The following is f77 code generated by the CellML API from this CellML file. (Back to language selection)
The raw code is available.
C
C There are a total of 8 entries in the algebraic variable array.
C There are a total of 6 entries in each of the rate and state variable arrays.
C There are a total of 21 entries in the constant variable array.
C
C
C VOI is time in component environment (min).
C CONSTS(1) is Vp in component environment (l).
C CONSTS(2) is Vi in component environment (l).
C CONSTS(3) is Vg in component environment (l).
C CONSTS(4) is E in component environment (l_per_min).
C STATES(1) is Ip in component plasma_insulin (mU).
C ALGBRC(1) is Ip_conc in component plasma_insulin (mU_per_l).
C CONSTS(5) is tp in component plasma_insulin (min).
C ALGBRC(2) is f1_G in component plasma_insulin (mU_per_min).
C CONSTS(6) is Rm in component plasma_insulin (mU_per_min).
C CONSTS(7) is C1 in component plasma_insulin (mg_per_l).
C CONSTS(8) is a1 in component plasma_insulin (mg_per_l).
C STATES(2) is Ii in component intercellular_insulin (mU).
C STATES(3) is G in component glucose (mg).
C ALGBRC(3) is Ii_conc in component intercellular_insulin (mU_per_l).
C CONSTS(9) is ti in component intercellular_insulin (min).
C ALGBRC(4) is G_conc in component glucose (mg_per_dl).
C CONSTS(10) is Gin in component glucose (mg_per_min).
C ALGBRC(5) is f2_G in component glucose (mg_per_min).
C ALGBRC(6) is f3_G in component glucose (dimensionless).
C ALGBRC(7) is f4_Ii in component glucose (mg_per_min).
C ALGBRC(8) is f5_x3 in component glucose (mg_per_min).
C CONSTS(11) is C2 in component glucose (mg_per_l).
C CONSTS(12) is C3 in component glucose (mg_per_l).
C CONSTS(13) is C4 in component glucose (mU_per_l).
C CONSTS(14) is C5 in component glucose (mU_per_l).
C CONSTS(15) is U0 in component glucose (mg_per_min).
C CONSTS(16) is Um in component glucose (mg_per_min).
C CONSTS(17) is Ub in component glucose (mg_per_min).
C CONSTS(18) is beta in component glucose (dimensionless).
C CONSTS(19) is Rg in component glucose (mg_per_min).
C CONSTS(20) is alpha in component glucose (l_per_mU).
C STATES(4) is x3 in component delay (min).
C CONSTS(21) is td in component delay (min).
C STATES(5) is x1 in component delay (min).
C STATES(6) is x2 in component delay (min).
C RATES(1) is d/dt Ip in component plasma_insulin (mU).
C RATES(2) is d/dt Ii in component intercellular_insulin (mU).
C RATES(3) is d/dt G in component glucose (mg).
C RATES(5) is d/dt x1 in component delay (min).
C RATES(6) is d/dt x2 in component delay (min).
C RATES(4) is d/dt x3 in component delay (min).
C
SUBROUTINE initConsts(CONSTS, RATES, STATES)
REAL CONSTS(*), RATES(*), STATES(*)
CONSTS(1) = 3
CONSTS(2) = 11
CONSTS(3) = 10
CONSTS(4) = 0.2
STATES(1) = 93.36441699
CONSTS(5) = 6
CONSTS(6) = 210
CONSTS(7) = 2000
CONSTS(8) = 300
STATES(2) = 243.2865183
STATES(3) = 12342.61665
CONSTS(9) = 100
CONSTS(10) = 216
CONSTS(11) = 144
CONSTS(12) = 1000
CONSTS(13) = 80
CONSTS(14) = 26
CONSTS(15) = 40
CONSTS(16) = 940
CONSTS(17) = 72
CONSTS(18) = 1.77
CONSTS(19) = 180
CONSTS(20) = 0.29
STATES(4) = 104.5878705
CONSTS(21) = 36
STATES(5) = 110.420253
STATES(6) = 112.7601171
RETURN
END
SUBROUTINE computeRates(VOI, CONSTS, RATES, STATES, ALGBRC)
REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*)
RATES(2) = CONSTS(4)*(STATES(1)/CONSTS(1) - STATES(2)/CONSTS(2)) - STATES(2)/CONSTS(9)
RATES(5) = (3.00000/CONSTS(21))*(STATES(1)/1.00000 - STATES(5))
RATES(6) = (3.00000/CONSTS(21))*(STATES(5) - STATES(6))
RATES(4) = (3.00000/CONSTS(21))*(STATES(6) - STATES(4))
ALGBRC(2) = CONSTS(6)/(1.00000+EXP((CONSTS(7) - STATES(3)/CONSTS(3))/CONSTS(8)))
RATES(1) = ALGBRC(2) - ( CONSTS(4)*(STATES(1)/CONSTS(1) - STATES(2)/CONSTS(2))+STATES(1)/CONSTS(5))
ALGBRC(5) = CONSTS(17)*(1.00000 - EXP(- STATES(3)/( CONSTS(11)*CONSTS(3))))
ALGBRC(6) = STATES(3)/( CONSTS(12)*CONSTS(3))
ALGBRC(7) = CONSTS(15)+(CONSTS(16) - CONSTS(15))/(1.00000+EXP( - CONSTS(18)*log( (STATES(2)/CONSTS(13))*(1.00000/CONSTS(2)+1.00000/( CONSTS(4)*CONSTS(9))))))
ALGBRC(8) = CONSTS(19)/(1.00000+EXP( CONSTS(20)*(( STATES(4)*1.00000)/CONSTS(1) - CONSTS(14))))
RATES(3) = CONSTS(10)+ALGBRC(8)+- (ALGBRC(5)+ ALGBRC(6)*ALGBRC(7))
RETURN
END
SUBROUTINE computeVariables(VOI, CONSTS, RATES, STATES, ALGBRC)
REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*)
ALGBRC(2) = CONSTS(6)/(1.00000+EXP((CONSTS(7) - STATES(3)/CONSTS(3))/CONSTS(8)))
ALGBRC(5) = CONSTS(17)*(1.00000 - EXP(- STATES(3)/( CONSTS(11)*CONSTS(3))))
ALGBRC(6) = STATES(3)/( CONSTS(12)*CONSTS(3))
ALGBRC(7) = CONSTS(15)+(CONSTS(16) - CONSTS(15))/(1.00000+EXP( - CONSTS(18)*log( (STATES(2)/CONSTS(13))*(1.00000/CONSTS(2)+1.00000/( CONSTS(4)*CONSTS(9))))))
ALGBRC(8) = CONSTS(19)/(1.00000+EXP( CONSTS(20)*(( STATES(4)*1.00000)/CONSTS(1) - CONSTS(14))))
ALGBRC(1) = STATES(1)/CONSTS(1)
ALGBRC(3) = STATES(2)/CONSTS(2)
ALGBRC(4) = STATES(3)/( CONSTS(3)*10.0000)
RETURN
END
