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 23 entries in the algebraic variable array.
C There are a total of 5 entries in each of the rate and state variable arrays.
C There are a total of 22 entries in the constant variable array.
C
C
C VOI is time in component environment (millisecond).
C STATES(1) is V in component membrane (millivolt).
C CONSTS(1) is RToF in component membrane (millivolt).
C CONSTS(2) is K_c in component membrane (millimolar).
C CONSTS(3) is K_i in component membrane (millimolar).
C CONSTS(4) is Na_c in component membrane (millimolar).
C CONSTS(5) is Na_i in component membrane (millimolar).
C ALGBRC(6) is i_ns in component non_specific_current (picoA_per_picoF).
C ALGBRC(11) is i_to in component transient_outward_K_current (picoA_per_picoF).
C ALGBRC(21) is i_K1 in component inward_rectifier (picoA_per_picoF).
C ALGBRC(16) is i_Kur in component ultra_rapid_K_current (picoA_per_picoF).
C ALGBRC(22) is i_b_Na in component background_currents (picoA_per_picoF).
C ALGBRC(23) is i_NaK in component sodium_potassium_pump (picoA_per_picoF).
C ALGBRC(1) is i_Stim in component membrane (picoA_per_picoF).
C CONSTS(6) is stim_start in component membrane (millisecond).
C CONSTS(7) is stim_end in component membrane (millisecond).
C CONSTS(8) is stim_period in component membrane (millisecond).
C CONSTS(9) is stim_duration in component membrane (millisecond).
C CONSTS(10) is stim_amplitude in component membrane (picoA_per_picoF).
C CONSTS(11) is g_ns in component non_specific_current (nanoS_per_picoF).
C CONSTS(21) is E_K in component transient_outward_K_current (millivolt).
C CONSTS(12) is g_to in component transient_outward_K_current (nanoS_per_picoF).
C STATES(2) is oa in component transient_outward_K_current_oa_gate (dimensionless).
C STATES(3) is oi in component transient_outward_K_current_oi_gate (dimensionless).
C ALGBRC(2) is alpha_oa in component transient_outward_K_current_oa_gate (per_millisecond).
C ALGBRC(7) is beta_oa in component transient_outward_K_current_oa_gate (per_millisecond).
C ALGBRC(17) is tau_oa in component transient_outward_K_current_oa_gate (millisecond).
C ALGBRC(12) is oa_inf in component transient_outward_K_current_oa_gate (dimensionless).
C ALGBRC(3) is alpha_oi in component transient_outward_K_current_oi_gate (per_millisecond).
C ALGBRC(8) is beta_oi in component transient_outward_K_current_oi_gate (per_millisecond).
C ALGBRC(18) is tau_oi in component transient_outward_K_current_oi_gate (millisecond).
C ALGBRC(13) is oi_inf in component transient_outward_K_current_oi_gate (dimensionless).
C CONSTS(13) is g_Kur in component ultra_rapid_K_current (nanoS_per_picoF).
C STATES(4) is ua in component ultra_rapid_K_current_ua_gate (dimensionless).
C STATES(5) is ui in component ultra_rapid_K_current_ui_gate (dimensionless).
C ALGBRC(4) is alpha_ua in component ultra_rapid_K_current_ua_gate (per_millisecond).
C ALGBRC(9) is beta_ua in component ultra_rapid_K_current_ua_gate (per_millisecond).
C ALGBRC(19) is tau_ua in component ultra_rapid_K_current_ua_gate (millisecond).
C ALGBRC(14) is ua_inf in component ultra_rapid_K_current_ua_gate (dimensionless).
C ALGBRC(5) is alpha_ui in component ultra_rapid_K_current_ui_gate (per_millisecond).
C ALGBRC(10) is beta_ui in component ultra_rapid_K_current_ui_gate (per_millisecond).
C ALGBRC(20) is tau_ui in component ultra_rapid_K_current_ui_gate (millisecond).
C ALGBRC(15) is ui_inf in component ultra_rapid_K_current_ui_gate (dimensionless).
C CONSTS(14) is g_K1 in component inward_rectifier (nanoS_per_picoF).
C CONSTS(15) is g_b_Na in component background_currents (nanoS_per_picoF).
C CONSTS(22) is E_Na in component background_currents (millivolt).
C CONSTS(16) is k_NaK_K in component sodium_potassium_pump (millimolar).
C CONSTS(17) is k_NaK_Na in component sodium_potassium_pump (millimolar).
C CONSTS(18) is i_NaK_max in component sodium_potassium_pump (picoA_per_picoF).
C CONSTS(19) is V_rev in component sodium_potassium_pump (millivolt).
C CONSTS(20) is B in component sodium_potassium_pump (millivolt).
C RATES(1) is d/dt V in component membrane (millivolt).
C RATES(2) is d/dt oa in component transient_outward_K_current_oa_gate (dimensionless).
C RATES(3) is d/dt oi in component transient_outward_K_current_oi_gate (dimensionless).
C RATES(4) is d/dt ua in component ultra_rapid_K_current_ua_gate (dimensionless).
C RATES(5) is d/dt ui in component ultra_rapid_K_current_ui_gate (dimensionless).
C
      SUBROUTINE initConsts(CONSTS, RATES, STATES)
      REAL CONSTS(*), RATES(*), STATES(*)
      STATES(1) = -80
      CONSTS(1) = 26.54
      CONSTS(2) = 5.4
      CONSTS(3) = 139
      CONSTS(4) = 140
      CONSTS(5) = 11.2
      CONSTS(6) = 100
      CONSTS(7) = 10000
      CONSTS(8) = 5000
      CONSTS(9) = 2
      CONSTS(10) = -100
      CONSTS(11) = 0.018
      CONSTS(12) = 0.01652
      STATES(2) = 0.2488
      STATES(3) = 0.1866
      CONSTS(13) = 0.6
      STATES(4) = 0.9933
      STATES(5) = 0.0999
      CONSTS(14) = 0.03
      CONSTS(15) = 0.00607
      CONSTS(16) = 1
      CONSTS(17) = 11
      CONSTS(18) = 2.002
      CONSTS(19) = -150
      CONSTS(20) = -200
      CONSTS(21) =  CONSTS(1)*log(CONSTS(2)/CONSTS(3))
      CONSTS(22) =  CONSTS(1)*log(CONSTS(4)/CONSTS(5))
      RETURN
      END
      SUBROUTINE computeRates(VOI, CONSTS,  RATES, STATES, ALGBRC)
      REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*)
      ALGBRC(2) = 0.650000/(EXP((STATES(1)+10.0000)/- 8.50000)+EXP((STATES(1) - 30.0000)/- 59.0000))
      ALGBRC(7) = 0.650000/(2.50000+EXP((STATES(1)+82.0000)/17.0000))
      ALGBRC(17) = 15.0000/(ALGBRC(2)+ALGBRC(7))
      ALGBRC(12) = 1.00000/(1.00000+EXP((STATES(1)+20.4700)/- 17.5400))
      RATES(2) = (ALGBRC(12) - STATES(2))/ALGBRC(17)
      ALGBRC(3) = 1.00000/(18.5300+EXP((STATES(1)+113.700)/10.9500))
      ALGBRC(8) = 1.00000/(35.5600+EXP((STATES(1)+1.26000)/- 7.44000))
      ALGBRC(18) = 15.0000/(ALGBRC(3)+ALGBRC(8))
      ALGBRC(13) = 1.00000/(1.00000+EXP((STATES(1)+43.1000)/5.30000))
      RATES(3) = (ALGBRC(13) - STATES(3))/ALGBRC(18)
      ALGBRC(4) = 0.650000/(EXP((STATES(1)+10.0000)/- 8.50000)+EXP((STATES(1) - 30.0000)/- 59.0000))
      ALGBRC(9) = 0.650000/(2.50000+EXP((STATES(1)+82.0000)/17.0000))
      ALGBRC(19) = 1.00000/(ALGBRC(4)+ALGBRC(9))
      ALGBRC(14) = 1.00000/(1.00000+EXP((STATES(1)+33.3000)/- 9.60000))
      RATES(4) = (ALGBRC(14) - STATES(4))/ALGBRC(19)
      ALGBRC(5) = 1.00000/(21.0000+EXP((STATES(1) - 185.000)/28.0000))
      ALGBRC(10) = 1.00000/EXP((STATES(1) - 158.000)/- 16.0000)
      ALGBRC(20) = 5.00000/(ALGBRC(5)+ALGBRC(10))
      ALGBRC(15) = 1.00000/(1.00000+EXP((STATES(1) - 99.4500)/27.4800))
      RATES(5) = (ALGBRC(15) - STATES(5))/ALGBRC(20)
      ALGBRC(6) =  CONSTS(11)*STATES(1)
      ALGBRC(11) =  CONSTS(12)*STATES(2) ** 3.00000*STATES(3)*(STATES(1) - CONSTS(21))
      ALGBRC(21) = ( CONSTS(14)*(STATES(1)+86.7500))/(1.00000+EXP((STATES(1)+20.0000)/20.0000))
      ALGBRC(16) =  ( CONSTS(13)*0.00500000+0.0500000/(1.00000+EXP(- (STATES(1) - 15.0000)/13.0000)))*STATES(4) ** 3.00000*STATES(5)*(STATES(1) - CONSTS(21))
      ALGBRC(22) =  CONSTS(15)*(STATES(1) - CONSTS(22))
      ALGBRC(23) = ( (( (( CONSTS(18)*CONSTS(2))/(CONSTS(2)+CONSTS(16)))*CONSTS(5) ** 1.50000)/(CONSTS(5) ** 1.50000+CONSTS(17) ** 1.50000))*(STATES(1) - CONSTS(19)))/(STATES(1) - CONSTS(20))
      ALGBRC(1) = TERNRY(VOI.GE.CONSTS(6).AND.VOI.LE.CONSTS(7).AND.(VOI - CONSTS(6)) -  INT((VOI - CONSTS(6))/CONSTS(8))*CONSTS(8).LE.CONSTS(9), CONSTS(10), 0.00000)
      RATES(1) = - (ALGBRC(6)+ALGBRC(16)+ALGBRC(11)+ALGBRC(21)+ALGBRC(22)+ALGBRC(23)+ALGBRC(1))
      RETURN
      END
      SUBROUTINE computeVariables(VOI, CONSTS, RATES, STATES, ALGBRC)
      REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*)
      ALGBRC(2) = 0.650000/(EXP((STATES(1)+10.0000)/- 8.50000)+EXP((STATES(1) - 30.0000)/- 59.0000))
      ALGBRC(7) = 0.650000/(2.50000+EXP((STATES(1)+82.0000)/17.0000))
      ALGBRC(17) = 15.0000/(ALGBRC(2)+ALGBRC(7))
      ALGBRC(12) = 1.00000/(1.00000+EXP((STATES(1)+20.4700)/- 17.5400))
      ALGBRC(3) = 1.00000/(18.5300+EXP((STATES(1)+113.700)/10.9500))
      ALGBRC(8) = 1.00000/(35.5600+EXP((STATES(1)+1.26000)/- 7.44000))
      ALGBRC(18) = 15.0000/(ALGBRC(3)+ALGBRC(8))
      ALGBRC(13) = 1.00000/(1.00000+EXP((STATES(1)+43.1000)/5.30000))
      ALGBRC(4) = 0.650000/(EXP((STATES(1)+10.0000)/- 8.50000)+EXP((STATES(1) - 30.0000)/- 59.0000))
      ALGBRC(9) = 0.650000/(2.50000+EXP((STATES(1)+82.0000)/17.0000))
      ALGBRC(19) = 1.00000/(ALGBRC(4)+ALGBRC(9))
      ALGBRC(14) = 1.00000/(1.00000+EXP((STATES(1)+33.3000)/- 9.60000))
      ALGBRC(5) = 1.00000/(21.0000+EXP((STATES(1) - 185.000)/28.0000))
      ALGBRC(10) = 1.00000/EXP((STATES(1) - 158.000)/- 16.0000)
      ALGBRC(20) = 5.00000/(ALGBRC(5)+ALGBRC(10))
      ALGBRC(15) = 1.00000/(1.00000+EXP((STATES(1) - 99.4500)/27.4800))
      ALGBRC(6) =  CONSTS(11)*STATES(1)
      ALGBRC(11) =  CONSTS(12)*STATES(2) ** 3.00000*STATES(3)*(STATES(1) - CONSTS(21))
      ALGBRC(21) = ( CONSTS(14)*(STATES(1)+86.7500))/(1.00000+EXP((STATES(1)+20.0000)/20.0000))
      ALGBRC(16) =  ( CONSTS(13)*0.00500000+0.0500000/(1.00000+EXP(- (STATES(1) - 15.0000)/13.0000)))*STATES(4) ** 3.00000*STATES(5)*(STATES(1) - CONSTS(21))
      ALGBRC(22) =  CONSTS(15)*(STATES(1) - CONSTS(22))
      ALGBRC(23) = ( (( (( CONSTS(18)*CONSTS(2))/(CONSTS(2)+CONSTS(16)))*CONSTS(5) ** 1.50000)/(CONSTS(5) ** 1.50000+CONSTS(17) ** 1.50000))*(STATES(1) - CONSTS(19)))/(STATES(1) - CONSTS(20))
      ALGBRC(1) = TERNRY(VOI.GE.CONSTS(6).AND.VOI.LE.CONSTS(7).AND.(VOI - CONSTS(6)) -  INT((VOI - CONSTS(6))/CONSTS(8))*CONSTS(8).LE.CONSTS(9), CONSTS(10), 0.00000)
      RETURN
      END
      REAL FUNCTION TERNRY(TEST, VALA, VALB)
      LOGICAL TEST
      REAL VALA, VALB
      IF (TEST) THEN
        TERNRY = VALA
      ELSE
        TERNRY = VALB
      ENDIF
      RETURN
      END