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 11 entries in the algebraic variable array.
C There are a total of 3 entries in each of the rate and state variable arrays.
C There are a total of 21 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 (nanoF).
C CONSTS(2) is i_app in component membrane (nanoA).
C ALGBRC(11) is i_tonic_e in component tonic_current (nanoA).
C ALGBRC(4) is i_Na in component fast_sodium_current (nanoA).
C ALGBRC(9) is i_NaP in component persistent_sodium_current (nanoA).
C ALGBRC(7) is i_K in component potassium_current (nanoA).
C ALGBRC(10) is i_leak in component leakage_current (nanoA).
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 potassium_current_n_gate (dimensionless).
C CONSTS(5) is theta_m in component fast_sodium_current_m_gate (millivolt).
C CONSTS(6) is omega_m in component fast_sodium_current_m_gate (millivolt).
C CONSTS(7) is g_K in component potassium_current (nanoS).
C CONSTS(8) is E_K in component potassium_current (millivolt).
C ALGBRC(2) is n_infinity in component potassium_current_n_gate (dimensionless).
C ALGBRC(5) is tau_n in component potassium_current_n_gate (millisecond).
C CONSTS(9) is tau_n_max in component potassium_current_n_gate (millisecond).
C CONSTS(10) is theta_n in component potassium_current_n_gate (millivolt).
C CONSTS(11) is omega_n in component potassium_current_n_gate (millivolt).
C CONSTS(12) is g_NaP in component persistent_sodium_current (nanoS).
C ALGBRC(8) is m_infinity in component persistent_sodium_current_m_gate (dimensionless).
C STATES(3) is h in component persistent_sodium_current_h_gate (dimensionless).
C CONSTS(13) is theta_m in component persistent_sodium_current_m_gate (millivolt).
C CONSTS(14) is omega_m in component persistent_sodium_current_m_gate (millivolt).
C ALGBRC(3) is h_infinity in component persistent_sodium_current_h_gate (dimensionless).
C ALGBRC(6) is tau_h in component persistent_sodium_current_h_gate (millisecond).
C CONSTS(15) is tau_h_max in component persistent_sodium_current_h_gate (millisecond).
C CONSTS(16) is theta_h in component persistent_sodium_current_h_gate (millivolt).
C CONSTS(17) is omega_h in component persistent_sodium_current_h_gate (millivolt).
C CONSTS(18) is g_leak in component leakage_current (nanoS).
C CONSTS(19) is E_leak in component leakage_current (millivolt).
C CONSTS(20) is g_tonic_e in component tonic_current (nanoS).
C CONSTS(21) 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 potassium_current_n_gate (dimensionless).
C RATES(3) 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) = 0.021
      CONSTS(2) = 0
      CONSTS(3) = 50
      CONSTS(4) = 28
      STATES(2) = 0.01
      CONSTS(5) = -34
      CONSTS(6) = -5
      CONSTS(7) = 11.2
      CONSTS(8) = -85
      CONSTS(9) = 10
      CONSTS(10) = -29
      CONSTS(11) = -4
      CONSTS(12) = 2.5
      STATES(3) = 0.92
      CONSTS(13) = -45.1
      CONSTS(14) = -6
      CONSTS(15) = 10000
      CONSTS(16) = -53
      CONSTS(17) = 6
      CONSTS(18) = 2.2
      CONSTS(19) = -57.5
      CONSTS(20) = 0.2
      CONSTS(21) = 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(10))/CONSTS(11)))
      ALGBRC(5) = CONSTS(9)/cosh((STATES(1) - CONSTS(10))/( 2.00000*CONSTS(11)))
      RATES(2) = (ALGBRC(2) - STATES(2))/ALGBRC(5)
      ALGBRC(3) = 1.00000/(1.00000+EXP((STATES(1) - CONSTS(16))/CONSTS(17)))
      ALGBRC(6) = CONSTS(15)/cosh((STATES(1) - CONSTS(16))/( 2.00000*CONSTS(17)))
      RATES(3) = (ALGBRC(3) - STATES(3))/ALGBRC(6)
      ALGBRC(11) =  CONSTS(20)*(1.00000/1000.00)*(STATES(1) - CONSTS(21))
      ALGBRC(1) = 1.00000/(1.00000+EXP((STATES(1) - CONSTS(5))/CONSTS(6)))
      ALGBRC(4) =  CONSTS(4)*ALGBRC(1) ** 3.00000*(1.00000 - STATES(2))*(1.00000/1000.00)*(STATES(1) - CONSTS(3))
      ALGBRC(8) = 1.00000/(1.00000+EXP((STATES(1) - CONSTS(13))/CONSTS(14)))
      ALGBRC(9) =  CONSTS(12)*ALGBRC(8)*STATES(3)*(1.00000/1000.00)*(STATES(1) - CONSTS(3))
      ALGBRC(7) =  CONSTS(7)*STATES(2) ** 4.00000*(1.00000/1000.00)*(STATES(1) - CONSTS(8))
      ALGBRC(10) =  CONSTS(18)*(1.00000/1000.00)*(STATES(1) - CONSTS(19))
      RATES(1) = (- (ALGBRC(4)+ALGBRC(9)+ALGBRC(7)+ALGBRC(10))+ALGBRC(11)+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(10))/CONSTS(11)))
      ALGBRC(5) = CONSTS(9)/cosh((STATES(1) - CONSTS(10))/( 2.00000*CONSTS(11)))
      ALGBRC(3) = 1.00000/(1.00000+EXP((STATES(1) - CONSTS(16))/CONSTS(17)))
      ALGBRC(6) = CONSTS(15)/cosh((STATES(1) - CONSTS(16))/( 2.00000*CONSTS(17)))
      ALGBRC(11) =  CONSTS(20)*(1.00000/1000.00)*(STATES(1) - CONSTS(21))
      ALGBRC(1) = 1.00000/(1.00000+EXP((STATES(1) - CONSTS(5))/CONSTS(6)))
      ALGBRC(4) =  CONSTS(4)*ALGBRC(1) ** 3.00000*(1.00000 - STATES(2))*(1.00000/1000.00)*(STATES(1) - CONSTS(3))
      ALGBRC(8) = 1.00000/(1.00000+EXP((STATES(1) - CONSTS(13))/CONSTS(14)))
      ALGBRC(9) =  CONSTS(12)*ALGBRC(8)*STATES(3)*(1.00000/1000.00)*(STATES(1) - CONSTS(3))
      ALGBRC(7) =  CONSTS(7)*STATES(2) ** 4.00000*(1.00000/1000.00)*(STATES(1) - CONSTS(8))
      ALGBRC(10) =  CONSTS(18)*(1.00000/1000.00)*(STATES(1) - CONSTS(19))
      RETURN
      END