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 13 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 24 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 C in component membrane (picoF).
C CONSTS(2) is i_app in component membrane (picoA).
C ALGBRC(11) is i_NaP in component persistent_sodium_current (picoA).
C ALGBRC(5) is i_Na in component fast_sodium_current (picoA).
C ALGBRC(9) is i_K in component potassium_current (picoA).
C ALGBRC(12) is i_L in component leakage_current (picoA).
C ALGBRC(13) is i_tonic_e in component tonic_current (picoA).
C CONSTS(3) is E_Na in component fast_sodium_current (millivolt).
C CONSTS(4) is g_Na in component fast_sodium_current (nanoS).
C ALGBRC(1) is m_infinity in component fast_sodium_current_m_gate (dimensionless).
C STATES(2) is n in component fast_sodium_current_n_gate (dimensionless).
C CONSTS(5) is theta_m in component fast_sodium_current_m_gate (millivolt).
C CONSTS(6) is sigma_m in component fast_sodium_current_m_gate (millivolt).
C ALGBRC(2) is n_infinity in component fast_sodium_current_n_gate (dimensionless).
C ALGBRC(6) is tau_n in component fast_sodium_current_n_gate (millisecond).
C CONSTS(7) is tau_n_max in component fast_sodium_current_n_gate (millisecond).
C CONSTS(8) is theta_n in component fast_sodium_current_n_gate (millivolt).
C CONSTS(9) is sigma_n in component fast_sodium_current_n_gate (millivolt).
C CONSTS(10) is g_K in component potassium_current (nanoS).
C CONSTS(11) is E_K in component potassium_current (millivolt).
C STATES(3) is n in component potassium_current_n_gate (dimensionless).
C ALGBRC(3) is n_infinity in component potassium_current_n_gate (dimensionless).
C ALGBRC(7) is tau_n in component potassium_current_n_gate (millisecond).
C CONSTS(12) is tau_n_max in component potassium_current_n_gate (millisecond).
C CONSTS(13) is theta_n in component potassium_current_n_gate (millivolt).
C CONSTS(14) is sigma_n in component potassium_current_n_gate (millivolt).
C CONSTS(15) is g_NaP in component persistent_sodium_current (nanoS).
C ALGBRC(10) is m_infinity in component persistent_sodium_current_m_gate (dimensionless).
C STATES(4) is h in component persistent_sodium_current_h_gate (dimensionless).
C CONSTS(16) is theta_m in component persistent_sodium_current_m_gate (millivolt).
C CONSTS(17) is sigma_m in component persistent_sodium_current_m_gate (millivolt).
C ALGBRC(4) is h_infinity in component persistent_sodium_current_h_gate (dimensionless).
C ALGBRC(8) is tau_h in component persistent_sodium_current_h_gate (millisecond).
C CONSTS(18) is tau_h_max in component persistent_sodium_current_h_gate (millisecond).
C CONSTS(19) is theta_h in component persistent_sodium_current_h_gate (millivolt).
C CONSTS(20) is sigma_h in component persistent_sodium_current_h_gate (millivolt).
C CONSTS(21) is g_L in component leakage_current (nanoS).
C CONSTS(22) is E_L in component leakage_current (millivolt).
C CONSTS(23) is g_tonic_e in component tonic_current (nanoS).
C CONSTS(24) is E_syn_e in component tonic_current (millivolt).
C RATES(1) is d/dt V in component membrane (millivolt).
C RATES(2) is d/dt n in component fast_sodium_current_n_gate (dimensionless).
C RATES(3) is d/dt n in component potassium_current_n_gate (dimensionless).
C RATES(4) is d/dt h in component persistent_sodium_current_h_gate (dimensionless).
C
      SUBROUTINE initConsts(CONSTS, RATES, STATES)
      REAL CONSTS(*), RATES(*), STATES(*)
      STATES(1) = -50.0
      CONSTS(1) = 21.0
      CONSTS(2) = 0.0
      CONSTS(3) = 50.0
      CONSTS(4) = 28.0
      STATES(2) = 0.01
      CONSTS(5) = -34.0
      CONSTS(6) = -5.0
      CONSTS(7) = 10.0
      CONSTS(8) = -29.0
      CONSTS(9) = -4.0
      CONSTS(10) = 11.2
      CONSTS(11) = -85.0
      STATES(3) = 0.01
      CONSTS(12) = 10.0
      CONSTS(13) = -29.0
      CONSTS(14) = -4.0
      CONSTS(15) = 2.8
      STATES(4) = 0.46
      CONSTS(16) = -40.0
      CONSTS(17) = -6.0
      CONSTS(18) = 10000.0
      CONSTS(19) = -48.0
      CONSTS(20) = 6.0
      CONSTS(21) = 2.8
      CONSTS(22) = -57.5
      CONSTS(23) = 0.0
      CONSTS(24) = 0.0
      RETURN
      END
      SUBROUTINE computeRates(VOI, CONSTS,  RATES, STATES, ALGBRC)
      REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*)
      ALGBRC(2) = 1.00000/(1.00000+EXP((STATES(1) - CONSTS(8))/CONSTS(9)))
      ALGBRC(6) = CONSTS(7)/cosh((STATES(1) - CONSTS(8))/( 2.00000*CONSTS(9)))
      RATES(2) = (ALGBRC(2) - STATES(2))/ALGBRC(6)
      ALGBRC(3) = 1.00000/(1.00000+EXP((STATES(1) - CONSTS(13))/CONSTS(14)))
      ALGBRC(7) = CONSTS(12)/cosh((STATES(1) - CONSTS(13))/( 2.00000*CONSTS(14)))
      RATES(3) = (ALGBRC(3) - STATES(3))/ALGBRC(7)
      ALGBRC(4) = 1.00000/(1.00000+EXP((STATES(1) - CONSTS(19))/CONSTS(20)))
      ALGBRC(8) = CONSTS(18)/cosh((STATES(1) - CONSTS(19))/( 2.00000*CONSTS(20)))
      RATES(4) = (ALGBRC(4) - STATES(4))/ALGBRC(8)
      ALGBRC(10) = 1.00000/(1.00000+EXP((STATES(1) - CONSTS(16))/CONSTS(17)))
      ALGBRC(11) =  CONSTS(15)*ALGBRC(10)*STATES(4)*(STATES(1) - CONSTS(3))
      ALGBRC(1) = 1.00000/(1.00000+EXP((STATES(1) - CONSTS(5))/CONSTS(6)))
      ALGBRC(5) =  CONSTS(4)*ALGBRC(1) ** 3.00000*(1.00000 - STATES(2))*(STATES(1) - CONSTS(3))
      ALGBRC(9) =  CONSTS(10)*STATES(3) ** 4.00000*(STATES(1) - CONSTS(11))
      ALGBRC(12) =  CONSTS(21)*(STATES(1) - CONSTS(22))
      ALGBRC(13) =  CONSTS(23)*(STATES(1) - CONSTS(24))
      RATES(1) = (- (ALGBRC(11)+ALGBRC(5)+ALGBRC(9)+ALGBRC(12)+ALGBRC(13))+CONSTS(2))/CONSTS(1)
      RETURN
      END
      SUBROUTINE computeVariables(VOI, CONSTS, RATES, STATES, ALGBRC)
      REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*)
      ALGBRC(2) = 1.00000/(1.00000+EXP((STATES(1) - CONSTS(8))/CONSTS(9)))
      ALGBRC(6) = CONSTS(7)/cosh((STATES(1) - CONSTS(8))/( 2.00000*CONSTS(9)))
      ALGBRC(3) = 1.00000/(1.00000+EXP((STATES(1) - CONSTS(13))/CONSTS(14)))
      ALGBRC(7) = CONSTS(12)/cosh((STATES(1) - CONSTS(13))/( 2.00000*CONSTS(14)))
      ALGBRC(4) = 1.00000/(1.00000+EXP((STATES(1) - CONSTS(19))/CONSTS(20)))
      ALGBRC(8) = CONSTS(18)/cosh((STATES(1) - CONSTS(19))/( 2.00000*CONSTS(20)))
      ALGBRC(10) = 1.00000/(1.00000+EXP((STATES(1) - CONSTS(16))/CONSTS(17)))
      ALGBRC(11) =  CONSTS(15)*ALGBRC(10)*STATES(4)*(STATES(1) - CONSTS(3))
      ALGBRC(1) = 1.00000/(1.00000+EXP((STATES(1) - CONSTS(5))/CONSTS(6)))
      ALGBRC(5) =  CONSTS(4)*ALGBRC(1) ** 3.00000*(1.00000 - STATES(2))*(STATES(1) - CONSTS(3))
      ALGBRC(9) =  CONSTS(10)*STATES(3) ** 4.00000*(STATES(1) - CONSTS(11))
      ALGBRC(12) =  CONSTS(21)*(STATES(1) - CONSTS(22))
      ALGBRC(13) =  CONSTS(23)*(STATES(1) - CONSTS(24))
      RETURN
      END