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 6 entries in the algebraic variable array. C There are a total of 1 entries in each of the rate and state variable arrays. C There are a total of 18 entries in the constant variable array. C C C VOI is time in component environment (second). C CONSTS(1) is L_1 in component contraction (mm). C CONSTS(2) is L_2 in component contraction (mm). C CONSTS(3) is L_3 in component contraction (mm). C CONSTS(4) is L_4 in component contraction (mm). C CONSTS(5) is f_c in component contraction (newton). C CONSTS(6) is v_max in component contraction (mm_per_second). C CONSTS(7) is curv in component contraction (dimensionless). C CONSTS(8) is k_1 in component contraction (newton). C CONSTS(9) is k_2 in component contraction (per_mm). C CONSTS(10) is F_1 in component contraction (newton). C CONSTS(11) is d_LSEC1 in component contraction (mm). C CONSTS(12) is k_sh in component contraction (dimensionless). C CONSTS(13) is L_m in component contraction (mm). C CONSTS(14) is F_im in component contraction (newton). C CONSTS(15) is tau in component contraction (second). C ALGBRC(5) is v_cc in component contraction (mm_per_second). C ALGBRC(6) is f_v in component contraction (dimensionless). C ALGBRC(1) is f_L in component contraction (newton). C ALGBRC(4) is f_sec in component contraction (newton). C ALGBRC(3) is delta_L_sec in component contraction (mm). C CONSTS(16) is delta_L_sec1 in component contraction (mm). C CONSTS(17) is k in component contraction (newton_per_mm). C STATES(1) is L_cc in component contraction (mm). C ALGBRC(2) is L_mtc in component contraction (mm). C CONSTS(18) is A in component contraction (dimensionless). C RATES(1) is d/dt L_cc in component contraction (mm). C SUBROUTINE initConsts(CONSTS, RATES, STATES) REAL CONSTS(*), RATES(*), STATES(*) CONSTS(1) = -24 CONSTS(2) = -14 CONSTS(3) = 4 CONSTS(4) = 14 CONSTS(5) = 0.51 CONSTS(6) = -152 CONSTS(7) = 9.5 CONSTS(8) = 0.0064 CONSTS(9) = 0.414 CONSTS(10) = 8.9 CONSTS(11) = 2.9 CONSTS(12) = 2.5 CONSTS(13) = 2.6 CONSTS(14) = 20.6 CONSTS(15) = 0.065 CONSTS(16) = 4.1 CONSTS(17) = 8.2 STATES(1) = 0.2 CONSTS(18) = 1 RETURN END SUBROUTINE computeRates(VOI, CONSTS, RATES, STATES, ALGBRC) REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*) ALGBRC(1) = TERNRY(STATES(1).GE.CONSTS(1).AND.STATES(1).LE.CONSTS(2), (CONSTS(5)/(CONSTS(2) - CONSTS(1)))*(STATES(1) - CONSTS(1)), TERNRY(STATES(1).GT.CONSTS(2).AND.STATES(1).LE.0.00000, ((1.00000 - CONSTS(5))/- CONSTS(2))*(STATES(1) - CONSTS(2)), TERNRY(STATES(1).GT.0.00000.AND.STATES(1).LE.CONSTS(3), 1.00000, TERNRY(STATES(1).GT.CONSTS(3).AND.STATES(1).LE.CONSTS(4), (- 1.00000/(CONSTS(4) - CONSTS(3)))*(STATES(1) - CONSTS(3)), 0.0/0.0) ALGBRC(2) = TERNRY(VOI.LE.1.00000, 0.290000, TERNRY(VOI.GT.1.00000.AND.VOI.LT.5.00000, 0.220000, 0.190000) ALGBRC(3) = (ALGBRC(2) - STATES(1)) - CONSTS(13) ALGBRC(4) = TERNRY(ALGBRC(3).GT.0.00000.AND.ALGBRC(3).LT.CONSTS(16), (CONSTS(10)/(EXP(CONSTS(12)) - 1.00000))*(EXP(( CONSTS(12)*ALGBRC(3))/CONSTS(16)) - 1.00000), TERNRY(ALGBRC(3).LE.CONSTS(16), CONSTS(10)+ CONSTS(17)*(ALGBRC(3) - CONSTS(16)), 0.0/0.0) CALL minimize(minfunc_0, CONSTS, VARIABLES, <VAR>) RATES(1) = ALGBRC(5) RETURN END SUBROUTINE computeVariables(VOI, CONSTS, RATES, STATES, ALGBRC) REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*) ALGBRC(1) = TERNRY(STATES(1).GE.CONSTS(1).AND.STATES(1).LE.CONSTS(2), (CONSTS(5)/(CONSTS(2) - CONSTS(1)))*(STATES(1) - CONSTS(1)), TERNRY(STATES(1).GT.CONSTS(2).AND.STATES(1).LE.0.00000, ((1.00000 - CONSTS(5))/- CONSTS(2))*(STATES(1) - CONSTS(2)), TERNRY(STATES(1).GT.0.00000.AND.STATES(1).LE.CONSTS(3), 1.00000, TERNRY(STATES(1).GT.CONSTS(3).AND.STATES(1).LE.CONSTS(4), (- 1.00000/(CONSTS(4) - CONSTS(3)))*(STATES(1) - CONSTS(3)), 0.0/0.0) ALGBRC(2) = TERNRY(VOI.LE.1.00000, 0.290000, TERNRY(VOI.GT.1.00000.AND.VOI.LT.5.00000, 0.220000, 0.190000) ALGBRC(3) = (ALGBRC(2) - STATES(1)) - CONSTS(13) ALGBRC(4) = TERNRY(ALGBRC(3).GT.0.00000.AND.ALGBRC(3).LT.CONSTS(16), (CONSTS(10)/(EXP(CONSTS(12)) - 1.00000))*(EXP(( CONSTS(12)*ALGBRC(3))/CONSTS(16)) - 1.00000), TERNRY(ALGBRC(3).LE.CONSTS(16), CONSTS(10)+ CONSTS(17)*(ALGBRC(3) - CONSTS(16)), 0.0/0.0) RETURN END REAL FUNCTION minfunc_0(CONSTS, VARIABLES) REAL CONSTS(*), VARIABLES(*) minfunc_0[1] = abs(ALGBRC(5) - (1.00000/ALGBRC(6))*(ALGBRC(4)/( CONSTS(18)*ALGBRC(1)*CONSTS(14)))) minfunc_0[2] = abs(ALGBRC(6) - (CONSTS(6) - ALGBRC(5))/(CONSTS(6)+ ALGBRC(5)*CONSTS(7))) RETURN END REAL FUNCTION TERNRY(TEST, VALA, VALB) LOGICAL TEST REAL VALA, VALB IF (TEST) THEN TERNRY = VALA ELSE TERNRY = VALB ENDIF RETURN END