C C There are a total of 7 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 19 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(6) is v_cc in component contraction (mm_per_second). C ALGBRC(7) is f_v in component contraction (dimensionless). C ALGBRC(2) is f_L in component contraction (newton). C ALGBRC(5) is f_sec in component contraction (newton). C ALGBRC(1) is f_pec in component contraction (newton). C ALGBRC(4) is delta_L_sec in component contraction (mm). C CONSTS(16) is delta_L_sec1 in component contraction (mm). C STATES(1) is delta_L_pec in component contraction (mm). C CONSTS(17) is k in component contraction (newton_per_mm). C ALGBRC(3) is L_mtc in component contraction (mm). C CONSTS(18) is A in component contraction (dimensionless). C CONSTS(19) is L_mslack in component contraction (mm). C RATES(1) is d/dt delta_L_pec in component contraction (mm). C SUBROUTINE initConsts(CONSTS, RATES, STATES) REAL CONSTS(*), RATES(*), STATES(*) CONSTS(1) = -23 CONSTS(2) = -14 CONSTS(3) = 2 CONSTS(4) = 19 CONSTS(5) = 0.49 CONSTS(6) = -141 CONSTS(7) = 5.8 CONSTS(8) = 0.012 CONSTS(9) = 0.317 CONSTS(10) = 4.1 CONSTS(11) = 4.1 CONSTS(12) = 3.3 CONSTS(13) = 0.3 CONSTS(14) = 18.1 CONSTS(15) = 0.006 CONSTS(16) = 4.1 STATES(1) = 0.2 CONSTS(17) = 3.5 CONSTS(18) = 1 CONSTS(19) = 0.3 RETURN END SUBROUTINE computeRates(VOI, CONSTS, RATES, STATES, ALGBRC) REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*) ALGBRC(2) = 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(3) = TERNRY(VOI.LE.1.00000, 0.290000, TERNRY(VOI.GT.1.00000.AND.VOI.LT.5.00000, 0.220000, 0.190000) ALGBRC(4) = (ALGBRC(3) - STATES(1)) - CONSTS(19) ALGBRC(5) = TERNRY(ALGBRC(4).GT.0.00000.AND.ALGBRC(4).LT.CONSTS(16), (CONSTS(10)/(EXP(CONSTS(12)) - 1.00000))*(EXP(( CONSTS(12)*ALGBRC(4))/CONSTS(16)) - 1.00000), TERNRY(ALGBRC(4).LE.CONSTS(16), CONSTS(10)+ CONSTS(17)*(ALGBRC(4) - CONSTS(16)), 0.0/0.0) ALGBRC(1) = TERNRY(STATES(1).GT.0.00000, CONSTS(8)*(EXP( CONSTS(9)*STATES(1)) - 1.00000), TERNRY(STATES(1).LE.0.00000, 0.00000, 0.0/0.0) CALL minimize(minfunc_0, CONSTS, VARIABLES, ) RATES(1) = ALGBRC(6) RETURN END SUBROUTINE computeVariables(VOI, CONSTS, RATES, STATES, ALGBRC) REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*) ALGBRC(2) = 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(3) = TERNRY(VOI.LE.1.00000, 0.290000, TERNRY(VOI.GT.1.00000.AND.VOI.LT.5.00000, 0.220000, 0.190000) ALGBRC(4) = (ALGBRC(3) - STATES(1)) - CONSTS(19) ALGBRC(5) = TERNRY(ALGBRC(4).GT.0.00000.AND.ALGBRC(4).LT.CONSTS(16), (CONSTS(10)/(EXP(CONSTS(12)) - 1.00000))*(EXP(( CONSTS(12)*ALGBRC(4))/CONSTS(16)) - 1.00000), TERNRY(ALGBRC(4).LE.CONSTS(16), CONSTS(10)+ CONSTS(17)*(ALGBRC(4) - CONSTS(16)), 0.0/0.0) ALGBRC(1) = TERNRY(STATES(1).GT.0.00000, CONSTS(8)*(EXP( CONSTS(9)*STATES(1)) - 1.00000), TERNRY(STATES(1).LE.0.00000, 0.00000, 0.0/0.0) RETURN END REAL FUNCTION minfunc_0(CONSTS, VARIABLES) REAL CONSTS(*), VARIABLES(*) minfunc_0[1] = abs(ALGBRC(6) - (1.00000/ALGBRC(7))*((ALGBRC(5) - ALGBRC(1))/( CONSTS(18)*ALGBRC(2)*CONSTS(14)))) minfunc_0[2] = abs(ALGBRC(7) - (CONSTS(6) - ALGBRC(6))/(CONSTS(6)+ ALGBRC(6)*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