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 12 entries in the algebraic variable array.
C There are a total of 4 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 VOI is time in component environment (second).
C STATES(1) is V in component membrane (millivolt).
C CONSTS(1) is Cm in component membrane (microF).
C ALGBRC(5) is i_Na in component sodium_channel (nanoA).
C ALGBRC(11) is i_K in component potassium_channel (nanoA).
C ALGBRC(12) is i_Leak in component leakage_current (nanoA).
C CONSTS(2) is g_Na_max in component sodium_channel (microS).
C ALGBRC(1) is g_Na in component sodium_channel (microS).
C CONSTS(3) is E_Na in component sodium_channel (millivolt).
C STATES(2) is m in component sodium_channel_m_gate (dimensionless).
C STATES(3) is h in component sodium_channel_h_gate (dimensionless).
C ALGBRC(2) is alpha_m in component sodium_channel_m_gate (per_second).
C ALGBRC(6) is beta_m in component sodium_channel_m_gate (per_second).
C ALGBRC(3) is alpha_h in component sodium_channel_h_gate (per_second).
C ALGBRC(7) is beta_h in component sodium_channel_h_gate (per_second).
C ALGBRC(9) is g_K1 in component potassium_channel (microS).
C ALGBRC(10) is g_K2 in component potassium_channel (microS).
C STATES(4) is n in component potassium_channel_n_gate (dimensionless).
C ALGBRC(4) is alpha_n in component potassium_channel_n_gate (per_second).
C ALGBRC(8) is beta_n in component potassium_channel_n_gate (per_second).
C CONSTS(4) is g_L in component leakage_current (microS).
C CONSTS(5) is E_L in component leakage_current (millivolt).
C RATES(1) is d/dt V in component membrane (millivolt).
C RATES(2) is d/dt m in component sodium_channel_m_gate (dimensionless).
C RATES(3) is d/dt h in component sodium_channel_h_gate (dimensionless).
C RATES(4) is d/dt n in component potassium_channel_n_gate (dimensionless).
C
      SUBROUTINE initConsts(CONSTS, RATES, STATES)
      REAL CONSTS(*), RATES(*), STATES(*)
      STATES(1) = -87
      CONSTS(1) = 12
      CONSTS(2) = 400000
      CONSTS(3) = 40
      STATES(2) = 0.01
      STATES(3) = 0.8
      STATES(4) = 0.01
      CONSTS(4) = 75
      CONSTS(5) = -60
      RETURN
      END
      SUBROUTINE computeRates(VOI, CONSTS,  RATES, STATES, ALGBRC)
      REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*)
      ALGBRC(2) = ( 100.000*(- STATES(1) - 48.0000))/(EXP((- STATES(1) - 48.0000)/15.0000) - 1.00000)
      ALGBRC(6) = ( 120.000*(STATES(1)+8.00000))/(EXP((STATES(1)+8.00000)/5.00000) - 1.00000)
      RATES(2) =  ALGBRC(2)*(1.00000 - STATES(2)) -  ALGBRC(6)*STATES(2)
      ALGBRC(3) =  170.000*EXP((- STATES(1) - 90.0000)/20.0000)
      ALGBRC(7) = 1000.00/(1.00000+EXP((- STATES(1) - 42.0000)/10.0000))
      RATES(3) =  ALGBRC(3)*(1.00000 - STATES(3)) -  ALGBRC(7)*STATES(3)
      ALGBRC(4) = ( 0.100000*(- STATES(1) - 50.0000))/(EXP((- STATES(1) - 50.0000)/10.0000) - 1.00000)
      ALGBRC(8) =  2.00000*EXP((- STATES(1) - 90.0000)/80.0000)
      RATES(4) =  ALGBRC(4)*(1.00000 - STATES(4)) -  ALGBRC(8)*STATES(4)
      ALGBRC(1) =  STATES(2) ** 3.00000*STATES(3)*CONSTS(2)
      ALGBRC(5) =  (ALGBRC(1)+140.000)*(STATES(1) - CONSTS(3))
      ALGBRC(9) =  1200.00*EXP((- STATES(1) - 90.0000)/50.0000)+ 15.0000*EXP((STATES(1)+90.0000)/60.0000)
      ALGBRC(10) =  1200.00*STATES(4) ** 4.00000
      ALGBRC(11) =  (ALGBRC(9)+ALGBRC(10))*(STATES(1)+100.000)
      ALGBRC(12) =  CONSTS(4)*(STATES(1) - CONSTS(5))
      RATES(1) = - (ALGBRC(5)+ALGBRC(11)+ALGBRC(12))/CONSTS(1)
      RETURN
      END
      SUBROUTINE computeVariables(VOI, CONSTS, RATES, STATES, ALGBRC)
      REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*)
      ALGBRC(2) = ( 100.000*(- STATES(1) - 48.0000))/(EXP((- STATES(1) - 48.0000)/15.0000) - 1.00000)
      ALGBRC(6) = ( 120.000*(STATES(1)+8.00000))/(EXP((STATES(1)+8.00000)/5.00000) - 1.00000)
      ALGBRC(3) =  170.000*EXP((- STATES(1) - 90.0000)/20.0000)
      ALGBRC(7) = 1000.00/(1.00000+EXP((- STATES(1) - 42.0000)/10.0000))
      ALGBRC(4) = ( 0.100000*(- STATES(1) - 50.0000))/(EXP((- STATES(1) - 50.0000)/10.0000) - 1.00000)
      ALGBRC(8) =  2.00000*EXP((- STATES(1) - 90.0000)/80.0000)
      ALGBRC(1) =  STATES(2) ** 3.00000*STATES(3)*CONSTS(2)
      ALGBRC(5) =  (ALGBRC(1)+140.000)*(STATES(1) - CONSTS(3))
      ALGBRC(9) =  1200.00*EXP((- STATES(1) - 90.0000)/50.0000)+ 15.0000*EXP((STATES(1)+90.0000)/60.0000)
      ALGBRC(10) =  1200.00*STATES(4) ** 4.00000
      ALGBRC(11) =  (ALGBRC(9)+ALGBRC(10))*(STATES(1)+100.000)
      ALGBRC(12) =  CONSTS(4)*(STATES(1) - CONSTS(5))
      RETURN
      END