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 3 entries in each of the rate and state variable arrays. C There are a total of 8 entries in the constant variable array. C C C VOI is t in component environment (second). C CONSTS(1) is R in component environment (J_per_K_per_mol). C CONSTS(2) is T in component environment (kelvin). C CONSTS(3) is F in component environment (C_per_mol). C CONSTS(4) is C_m in component environment (fF). C STATES(1) is q_K_o in component environment (fmol). C STATES(2) is q_K_i in component environment (fmol). C ALGBRC(7) is v_K_ATP in component K_ATP (fmol_per_sec). C STATES(3) is q_mem in component environment (fC). C ALGBRC(8) is I_mem_K_ATP in component K_ATP (fA). C CONSTS(5) is kappa_K_ATP in component K_ATP_parameters (fmol_per_sec). C CONSTS(6) is K_K_i in component K_ATP_parameters (per_fmol). C CONSTS(7) is K_K_o in component K_ATP_parameters (per_fmol). C CONSTS(8) is zK in component K_ATP_parameters (dimensionless). C ALGBRC(2) is mu_K_o in component K_ATP (J_per_mol). C ALGBRC(3) is mu_K_i in component K_ATP (J_per_mol). C ALGBRC(5) is Am_K_ATP in component K_ATP (J_per_mol). C ALGBRC(4) is Af_K_ATP in component K_ATP (J_per_mol). C ALGBRC(6) is Ar_K_ATP in component K_ATP (J_per_mol). C ALGBRC(1) is V_mem in component K_ATP (volt). C RATES(1) is d/dt q_K_o in component environment (fmol). C RATES(2) is d/dt q_K_i in component environment (fmol). C RATES(3) is d/dt q_mem in component environment (fC). C SUBROUTINE initConsts(CONSTS, RATES, STATES) REAL CONSTS(*), RATES(*), STATES(*) CONSTS(1) = 8.314 CONSTS(2) = 310 CONSTS(3) = 96485 CONSTS(4) = 153400 STATES(1) = 27.9828 STATES(2) = 5510 STATES(3) = -13039 CONSTS(5) = 1.1812e-05 CONSTS(6) = 9.99086e-05 CONSTS(7) = 0.000663229 CONSTS(8) = 1 RETURN END SUBROUTINE computeRates(VOI, CONSTS, RATES, STATES, ALGBRC) REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*) ALGBRC(1) = STATES(3)/CONSTS(4) ALGBRC(5) = CONSTS(8)*CONSTS(3)*ALGBRC(1) ALGBRC(3) = CONSTS(1)*CONSTS(2)*log( CONSTS(6)*STATES(2)) ALGBRC(4) = ALGBRC(3)+ CONSTS(8)*CONSTS(3)*ALGBRC(1) ALGBRC(2) = CONSTS(1)*CONSTS(2)*log( CONSTS(7)*STATES(1)) ALGBRC(6) = ALGBRC(2) ALGBRC(7) = TERNRY(ALGBRC(5).EQ.0.00000, CONSTS(5)*(EXP(ALGBRC(4)/( CONSTS(1)*CONSTS(2))) - EXP(ALGBRC(6)/( CONSTS(1)*CONSTS(2)))), ((( CONSTS(5)*ALGBRC(5))/( CONSTS(1)*CONSTS(2)))/(EXP(ALGBRC(5)/( CONSTS(1)*CONSTS(2))) - 1.00000))*(EXP(ALGBRC(4)/( CONSTS(1)*CONSTS(2))) - EXP(ALGBRC(6)/( CONSTS(1)*CONSTS(2))))) RATES(1) = ALGBRC(7) RATES(2) = - ALGBRC(7) ALGBRC(8) = CONSTS(3)*- CONSTS(8)*ALGBRC(7) RATES(3) = ALGBRC(8) RETURN END SUBROUTINE computeVariables(VOI, CONSTS, RATES, STATES, ALGBRC) REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*) ALGBRC(1) = STATES(3)/CONSTS(4) ALGBRC(5) = CONSTS(8)*CONSTS(3)*ALGBRC(1) ALGBRC(3) = CONSTS(1)*CONSTS(2)*log( CONSTS(6)*STATES(2)) ALGBRC(4) = ALGBRC(3)+ CONSTS(8)*CONSTS(3)*ALGBRC(1) ALGBRC(2) = CONSTS(1)*CONSTS(2)*log( CONSTS(7)*STATES(1)) ALGBRC(6) = ALGBRC(2) ALGBRC(7) = TERNRY(ALGBRC(5).EQ.0.00000, CONSTS(5)*(EXP(ALGBRC(4)/( CONSTS(1)*CONSTS(2))) - EXP(ALGBRC(6)/( CONSTS(1)*CONSTS(2)))), ((( CONSTS(5)*ALGBRC(5))/( CONSTS(1)*CONSTS(2)))/(EXP(ALGBRC(5)/( CONSTS(1)*CONSTS(2))) - 1.00000))*(EXP(ALGBRC(4)/( CONSTS(1)*CONSTS(2))) - EXP(ALGBRC(6)/( CONSTS(1)*CONSTS(2))))) ALGBRC(8) = CONSTS(3)*- CONSTS(8)*ALGBRC(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