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 13 entries in the constant variable array. C C C VOI is t in component environment (second). C CONSTS(1) is C_m in component environment (fF). C CONSTS(2) is w_i in component environment (pL). C CONSTS(3) is w_o in component environment (pL). C STATES(1) is q_mem in component environment (fC). C CONSTS(4) is R in component environment (J_per_K_per_mol). C CONSTS(5) is T in component environment (kelvin). C CONSTS(6) is F in component environment (C_per_mol). C ALGBRC(7) is v_KACh in component KACh (fmol_per_sec). C STATES(2) is q_K_o in component environment (fmol). C STATES(3) is q_K_i in component environment (fmol). C CONSTS(7) is q_Gibetagamma in component environment (fmol). C ALGBRC(1) is V_mem in component environment (J_per_C). C ALGBRC(8) is I_mem_KACh in component KACh (fA). C CONSTS(8) is kappa_KACh in component KACh_parameters (fmol_per_sec). C CONSTS(9) is K_K_i in component KACh_parameters (per_fmol). C CONSTS(10) is K_K_o in component KACh_parameters (per_fmol). C CONSTS(11) is K_Gibetagamma in component KACh_parameters (per_fmol). C CONSTS(12) is zK in component KACh_parameters (dimensionless). C ALGBRC(2) is mu_K_i in component KACh (J_per_mol). C ALGBRC(3) is mu_K_o in component KACh (J_per_mol). C CONSTS(13) is mu_Gibetagamma in component KACh (J_per_mol). C ALGBRC(5) is Af_KACh in component KACh (J_per_mol). C ALGBRC(6) is Ar_KACh in component KACh (J_per_mol). C ALGBRC(4) is Am_KACh in component KACh (J_per_mol). C RATES(3) is d/dt q_K_i in component environment (fmol). C RATES(2) is d/dt q_K_o in component environment (fmol). C RATES(1) is d/dt q_mem in component environment (fC). C SUBROUTINE initConsts(CONSTS, RATES, STATES) REAL CONSTS(*), RATES(*), STATES(*) CONSTS(1) = 1e6 CONSTS(2) = 25.8 CONSTS(3) = 3.52 STATES(1) = -8.5e4 CONSTS(4) = 8.31 CONSTS(5) = 310 CONSTS(6) = 96500 STATES(2) = 9.3276 STATES(3) = 0.00456 CONSTS(7) = 1e-6 CONSTS(8) = 0.217237 CONSTS(9) = 0.013549 CONSTS(10) = 0.0899434 CONSTS(11) = 1e-6 CONSTS(12) = 1 CONSTS(13) = CONSTS(4)*CONSTS(5)*log( CONSTS(11)*CONSTS(7)) RETURN END SUBROUTINE computeRates(VOI, CONSTS, RATES, STATES, ALGBRC) REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*) ALGBRC(1) = STATES(1)/CONSTS(1) ALGBRC(2) = CONSTS(4)*CONSTS(5)*log( CONSTS(9)*STATES(3)) ALGBRC(5) = ALGBRC(2)+ CONSTS(12)*CONSTS(6)*ALGBRC(1)+CONSTS(13) ALGBRC(3) = CONSTS(4)*CONSTS(5)*log( CONSTS(10)*STATES(2)) ALGBRC(6) = ALGBRC(3) ALGBRC(4) = CONSTS(12)*CONSTS(6)*ALGBRC(1) ALGBRC(7) = TERNRY(ALGBRC(4).EQ.0.00000, CONSTS(8)*(EXP(ALGBRC(5)/( CONSTS(4)*CONSTS(5))) - EXP(ALGBRC(6)/( CONSTS(4)*CONSTS(5)))), ((( CONSTS(8)*ALGBRC(4))/( CONSTS(4)*CONSTS(5)))/(EXP(ALGBRC(4)/( CONSTS(4)*CONSTS(5))) - 1.00000))*(EXP(ALGBRC(5)/( CONSTS(4)*CONSTS(5))) - EXP(ALGBRC(6)/( CONSTS(4)*CONSTS(5))))) RATES(3) = - ALGBRC(7) RATES(2) = ALGBRC(7) ALGBRC(8) = - CONSTS(12)*CONSTS(6)*ALGBRC(7) RATES(1) = ALGBRC(8) RETURN END SUBROUTINE computeVariables(VOI, CONSTS, RATES, STATES, ALGBRC) REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*) ALGBRC(1) = STATES(1)/CONSTS(1) ALGBRC(2) = CONSTS(4)*CONSTS(5)*log( CONSTS(9)*STATES(3)) ALGBRC(5) = ALGBRC(2)+ CONSTS(12)*CONSTS(6)*ALGBRC(1)+CONSTS(13) ALGBRC(3) = CONSTS(4)*CONSTS(5)*log( CONSTS(10)*STATES(2)) ALGBRC(6) = ALGBRC(3) ALGBRC(4) = CONSTS(12)*CONSTS(6)*ALGBRC(1) ALGBRC(7) = TERNRY(ALGBRC(4).EQ.0.00000, CONSTS(8)*(EXP(ALGBRC(5)/( CONSTS(4)*CONSTS(5))) - EXP(ALGBRC(6)/( CONSTS(4)*CONSTS(5)))), ((( CONSTS(8)*ALGBRC(4))/( CONSTS(4)*CONSTS(5)))/(EXP(ALGBRC(4)/( CONSTS(4)*CONSTS(5))) - 1.00000))*(EXP(ALGBRC(5)/( CONSTS(4)*CONSTS(5))) - EXP(ALGBRC(6)/( CONSTS(4)*CONSTS(5))))) ALGBRC(8) = - CONSTS(12)*CONSTS(6)*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