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 14 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 25 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(12) 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(10) is i_KS in component slow_potassium_current (picoA).
C ALGBRC(13) is i_L in component leakage_current (picoA).
C ALGBRC(14) 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 E_K in component potassium_current (millivolt).
C CONSTS(11) is g_K in component potassium_current (nanoS).
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_KS in component slow_potassium_current (nanoS).
C STATES(4) is k in component slow_potassium_current_k_gate (dimensionless).
C ALGBRC(4) is k_infinity in component slow_potassium_current_k_gate (dimensionless).
C ALGBRC(8) is tau_k in component slow_potassium_current_k_gate (millisecond).
C CONSTS(16) is tau_k_max in component slow_potassium_current_k_gate (millisecond).
C CONSTS(17) is theta_k in component slow_potassium_current_k_gate (millivolt).
C CONSTS(18) is sigma_k in component slow_potassium_current_k_gate (millivolt).
C CONSTS(19) is g_NaP in component persistent_sodium_current (nanoS).
C ALGBRC(11) is m_infinity in component persistent_sodium_current_m_gate (dimensionless).
C CONSTS(20) is theta_m in component persistent_sodium_current_m_gate (millivolt).
C CONSTS(21) is sigma_m in component persistent_sodium_current_m_gate (millivolt).
C CONSTS(22) is g_L in component leakage_current (nanoS).
C CONSTS(23) is E_L in component leakage_current (millivolt).
C CONSTS(24) is g_tonic_e in component tonic_current (nanoS).
C CONSTS(25) 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 k in component slow_potassium_current_k_gate (dimensionless).
C
      SUBROUTINE initConsts(CONSTS, RATES, STATES)
      REAL CONSTS(*), RATES(*), STATES(*)
      STATES(1) = -55.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) = -85.0
      CONSTS(11) = 11.2
      STATES(3) = 0.01
      CONSTS(12) = 10.0
      CONSTS(13) = -29.0
      CONSTS(14) = -4.0
      CONSTS(15) = 5.6
      STATES(4) = 0.22
      CONSTS(16) = 10000.0
      CONSTS(17) = -38.0
      CONSTS(18) = -6.0
      CONSTS(19) = 2.8
      CONSTS(20) = -40.0
      CONSTS(21) = -6.0
      CONSTS(22) = 2.8
      CONSTS(23) = -50.0
      CONSTS(24) = 0.0
      CONSTS(25) = 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(17))/CONSTS(18)))
      ALGBRC(8) = CONSTS(16)/cosh((STATES(1) - CONSTS(17))/( 2.00000*CONSTS(18)))
      RATES(4) = (ALGBRC(4) - STATES(4))/ALGBRC(8)
      ALGBRC(11) = 1.00000/(1.00000+EXP((STATES(1) - CONSTS(20))/CONSTS(21)))
      ALGBRC(12) =  CONSTS(19)*ALGBRC(11)*(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(11)*STATES(3) ** 4.00000*(STATES(1) - CONSTS(10))
      ALGBRC(10) =  CONSTS(15)*STATES(4)*(STATES(1) - CONSTS(10))
      ALGBRC(13) =  CONSTS(22)*(STATES(1) - CONSTS(23))
      ALGBRC(14) =  CONSTS(24)*(STATES(1) - CONSTS(25))
      RATES(1) = (- (ALGBRC(12)+ALGBRC(10)+ALGBRC(5)+ALGBRC(9)+ALGBRC(13)+ALGBRC(14))+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(17))/CONSTS(18)))
      ALGBRC(8) = CONSTS(16)/cosh((STATES(1) - CONSTS(17))/( 2.00000*CONSTS(18)))
      ALGBRC(11) = 1.00000/(1.00000+EXP((STATES(1) - CONSTS(20))/CONSTS(21)))
      ALGBRC(12) =  CONSTS(19)*ALGBRC(11)*(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(11)*STATES(3) ** 4.00000*(STATES(1) - CONSTS(10))
      ALGBRC(10) =  CONSTS(15)*STATES(4)*(STATES(1) - CONSTS(10))
      ALGBRC(13) =  CONSTS(22)*(STATES(1) - CONSTS(23))
      ALGBRC(14) =  CONSTS(24)*(STATES(1) - CONSTS(25))
      RETURN
      END