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 5 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 5 entries in the constant variable array.
C
C
C ALGBRC(1) is V in component environment (millivolt).
C VOI is t in component environment (millisec).
C STATES(1) is n in component potassium_channel_n_gate (dimensionless).
C ALGBRC(4) is i_K in component potassium_channel (microA_per_cm2).
C CONSTS(1) is g_K in component potassium_channel (milliS_per_cm2).
C CONSTS(2) is Ki in component potassium_channel (mM).
C CONSTS(3) is Ko in component potassium_channel (mM).
C CONSTS(4) is RTF in component potassium_channel (millivolt).
C CONSTS(5) is E_K in component potassium_channel (millivolt).
C ALGBRC(2) is K_conductance in component potassium_channel (milliS_per_cm2).
C ALGBRC(3) is alpha_n in component potassium_channel_n_gate (per_millisec).
C ALGBRC(5) is beta_n in component potassium_channel_n_gate (per_millisec).
C RATES(1) is d/dt n in component potassium_channel_n_gate (dimensionless).
C
SUBROUTINE initConsts(CONSTS, RATES, STATES)
REAL CONSTS(*), RATES(*), STATES(*)
STATES(1) = 0.325
CONSTS(1) = 36
CONSTS(2) = 90
CONSTS(3) = 3
CONSTS(4) = 25
CONSTS(5) = CONSTS(4)*log(CONSTS(3)/CONSTS(2))
RETURN
END
SUBROUTINE computeRates(VOI, CONSTS, RATES, STATES, ALGBRC)
REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*)
ALGBRC(1) = TERNRY(VOI.GT.5.00000.AND.VOI.LT.15.0000, - 85.0000, 0.00000)
ALGBRC(3) = ( 0.0100000*(ALGBRC(1)+10.0000))/(EXP((ALGBRC(1)+10.0000)/10.0000) - 1.00000)
ALGBRC(5) = 0.125000*EXP(ALGBRC(1)/80.0000)
RATES(1) = ALGBRC(3)*(1.00000 - STATES(1)) - ALGBRC(5)*STATES(1)
RETURN
END
SUBROUTINE computeVariables(VOI, CONSTS, RATES, STATES, ALGBRC)
REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*)
ALGBRC(1) = TERNRY(VOI.GT.5.00000.AND.VOI.LT.15.0000, - 85.0000, 0.00000)
ALGBRC(3) = ( 0.0100000*(ALGBRC(1)+10.0000))/(EXP((ALGBRC(1)+10.0000)/10.0000) - 1.00000)
ALGBRC(5) = 0.125000*EXP(ALGBRC(1)/80.0000)
ALGBRC(2) = CONSTS(1)*STATES(1) ** 4.00000
ALGBRC(4) = ALGBRC(2)*(ALGBRC(1) - CONSTS(5))
RETURN
END
REAL FUNCTION TERNRY(TEST, VALA, VALB)
LOGICAL TEST
REAL VALA, VALB
IF (TEST) THEN
TERNRY = VALA
ELSE
TERNRY = VALB
ENDIF
RETURN
END
