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 54 entries in the algebraic variable array.
C There are a total of 7 entries in each of the rate and state variable arrays.
C There are a total of 46 entries in the constant variable array.
C
C
C VOI is t in component params_BG (second).
C CONSTS(1) is R in component params_BG (J_per_K_mol).
C CONSTS(2) is T in component params_BG (kelvin).
C CONSTS(3) is F in component params_BG (C_per_mol).
C CONSTS(4) is K_Nai in component params_BG (per_fmol).
C CONSTS(39) is q_Nai in component params_BG (fmol).
C CONSTS(5) is K_Nao in component params_BG (per_fmol).
C CONSTS(41) is q_Nao in component params_BG (fmol).
C CONSTS(6) is K_Glci in component params_BG (per_fmol).
C CONSTS(43) is q_Glci in component params_BG (fmol).
C CONSTS(7) is K_Glco in component params_BG (per_fmol).
C CONSTS(45) is q_Glco in component params_BG (fmol).
C CONSTS(8) is K_1 in component params_BG (per_fmol).
C CONSTS(9) is q_init_1 in component params_BG (fmol).
C CONSTS(10) is K_2 in component params_BG (per_fmol).
C CONSTS(11) is q_init_2 in component params_BG (fmol).
C CONSTS(12) is K_3 in component params_BG (per_fmol).
C CONSTS(13) is q_init_3 in component params_BG (fmol).
C CONSTS(14) is K_4 in component params_BG (per_fmol).
C CONSTS(15) is q_init_4 in component params_BG (fmol).
C CONSTS(16) is K_5 in component params_BG (per_fmol).
C CONSTS(17) is q_init_5 in component params_BG (fmol).
C CONSTS(18) is K_6 in component params_BG (per_fmol).
C CONSTS(19) is q_init_6 in component params_BG (fmol).
C ALGBRC(25) is V0_Vm in component params_BG (volt).
C CONSTS(20) is z_zf1 in component params_BG (dimensionless).
C CONSTS(21) is z_zr1 in component params_BG (dimensionless).
C CONSTS(22) is z_zf6 in component params_BG (dimensionless).
C CONSTS(23) is z_zr6 in component params_BG (dimensionless).
C CONSTS(24) is kappa_r1 in component params_BG (fmol_per_s).
C CONSTS(25) is kappa_r2 in component params_BG (fmol_per_s).
C CONSTS(26) is kappa_r3 in component params_BG (fmol_per_s).
C CONSTS(27) is kappa_r4 in component params_BG (fmol_per_s).
C CONSTS(28) is kappa_r5 in component params_BG (fmol_per_s).
C CONSTS(29) is kappa_r6 in component params_BG (fmol_per_s).
C CONSTS(30) is kappa_r7 in component params_BG (fmol_per_s).
C CONSTS(40) is mu_Nai in component SGLT1_BG (J_per_mol).
C CONSTS(42) is mu_Nao in component SGLT1_BG (J_per_mol).
C CONSTS(44) is mu_Glci in component SGLT1_BG (J_per_mol).
C CONSTS(46) is mu_Glco in component SGLT1_BG (J_per_mol).
C ALGBRC(1) is mu_1 in component SGLT1_BG (J_per_mol).
C ALGBRC(47) is v_1 in component SGLT1_BG (fmol_per_s).
C ALGBRC(3) is mu_2 in component SGLT1_BG (J_per_mol).
C ALGBRC(39) is v_2 in component SGLT1_BG (fmol_per_s).
C ALGBRC(4) is mu_3 in component SGLT1_BG (J_per_mol).
C ALGBRC(14) is v_3 in component SGLT1_BG (fmol_per_s).
C ALGBRC(5) is mu_4 in component SGLT1_BG (J_per_mol).
C ALGBRC(18) is v_4 in component SGLT1_BG (fmol_per_s).
C ALGBRC(6) is mu_5 in component SGLT1_BG (J_per_mol).
C ALGBRC(26) is v_5 in component SGLT1_BG (fmol_per_s).
C ALGBRC(7) is mu_6 in component SGLT1_BG (J_per_mol).
C ALGBRC(48) is v_6 in component SGLT1_BG (fmol_per_s).
C ALGBRC(27) is V_Vm in component SGLT1_BG (volt).
C ALGBRC(28) is V_zf1 in component SGLT1_BG (volt).
C ALGBRC(41) is I_zf1 in component SGLT1_BG (fA).
C ALGBRC(29) is mu_zf1 in component SGLT1_BG (J_per_mol).
C ALGBRC(40) is v_zf1 in component SGLT1_BG (fmol_per_s).
C ALGBRC(30) is V_zr1 in component SGLT1_BG (volt).
C ALGBRC(43) is I_zr1 in component SGLT1_BG (fA).
C ALGBRC(31) is mu_zr1 in component SGLT1_BG (J_per_mol).
C ALGBRC(42) is v_zr1 in component SGLT1_BG (fmol_per_s).
C ALGBRC(32) is V_zf6 in component SGLT1_BG (volt).
C ALGBRC(51) is I_zf6 in component SGLT1_BG (fA).
C ALGBRC(33) is mu_zf6 in component SGLT1_BG (J_per_mol).
C ALGBRC(49) is v_zf6 in component SGLT1_BG (fmol_per_s).
C ALGBRC(34) is V_zr6 in component SGLT1_BG (volt).
C ALGBRC(53) is I_zr6 in component SGLT1_BG (fA).
C ALGBRC(35) is mu_zr6 in component SGLT1_BG (J_per_mol).
C ALGBRC(52) is v_zr6 in component SGLT1_BG (fmol_per_s).
C ALGBRC(36) is A_f_r1 in component SGLT1_BG (J_per_mol).
C ALGBRC(38) is v_r1 in component SGLT1_BG (fmol_per_s).
C ALGBRC(37) is A_r_r1 in component SGLT1_BG (J_per_mol).
C ALGBRC(8) is A_f_r2 in component SGLT1_BG (J_per_mol).
C ALGBRC(10) is v_r2 in component SGLT1_BG (fmol_per_s).
C ALGBRC(9) is A_r_r2 in component SGLT1_BG (J_per_mol).
C ALGBRC(11) is A_f_r3 in component SGLT1_BG (J_per_mol).
C ALGBRC(13) is v_r3 in component SGLT1_BG (fmol_per_s).
C ALGBRC(12) is A_r_r3 in component SGLT1_BG (J_per_mol).
C ALGBRC(15) is A_f_r4 in component SGLT1_BG (J_per_mol).
C ALGBRC(17) is v_r4 in component SGLT1_BG (fmol_per_s).
C ALGBRC(16) is A_r_r4 in component SGLT1_BG (J_per_mol).
C ALGBRC(19) is A_f_r5 in component SGLT1_BG (J_per_mol).
C ALGBRC(21) is v_r5 in component SGLT1_BG (fmol_per_s).
C ALGBRC(20) is A_r_r5 in component SGLT1_BG (J_per_mol).
C ALGBRC(44) is A_f_r6 in component SGLT1_BG (J_per_mol).
C ALGBRC(46) is v_r6 in component SGLT1_BG (fmol_per_s).
C ALGBRC(45) is A_r_r6 in component SGLT1_BG (J_per_mol).
C ALGBRC(22) is A_f_r7 in component SGLT1_BG (J_per_mol).
C ALGBRC(24) is v_r7 in component SGLT1_BG (fmol_per_s).
C ALGBRC(23) is A_r_r7 in component SGLT1_BG (J_per_mol).
C STATES(1) is q_1 in component SGLT1_BG (fmol).
C STATES(2) is q_2 in component SGLT1_BG (fmol).
C STATES(3) is q_3 in component SGLT1_BG (fmol).
C STATES(4) is q_4 in component SGLT1_BG (fmol).
C STATES(5) is q_5 in component SGLT1_BG (fmol).
C STATES(6) is q_6 in component SGLT1_BG (fmol).
C ALGBRC(54) is Ii in component SGLT1_BG (fA).
C ALGBRC(50) is I_ss in component SGLT1_BG (fA).
C CONSTS(31) is Nai in component params_BG (mM).
C CONSTS(32) is Nao in component params_BG (mM).
C CONSTS(33) is Glci in component params_BG (mM).
C CONSTS(34) is Glco in component params_BG (mM).
C CONSTS(35) is V_i in component params_BG (pL).
C CONSTS(36) is V_o in component params_BG (pL).
C STATES(7) is V_E in component params_BG (volt).
C CONSTS(37) is test_volt in component params_BG (volt).
C ALGBRC(2) is rate_VE in component params_BG (volt_per_s).
C CONSTS(38) is dt in component params_BG (second).
C RATES(1) is d/dt q_1 in component SGLT1_BG (fmol).
C RATES(2) is d/dt q_2 in component SGLT1_BG (fmol).
C RATES(3) is d/dt q_3 in component SGLT1_BG (fmol).
C RATES(4) is d/dt q_4 in component SGLT1_BG (fmol).
C RATES(5) is d/dt q_5 in component SGLT1_BG (fmol).
C RATES(6) is d/dt q_6 in component SGLT1_BG (fmol).
C RATES(7) is d/dt V_E in component params_BG (volt).
C
      SUBROUTINE initConsts(CONSTS, RATES, STATES)
      REAL CONSTS(*), RATES(*), STATES(*)
      CONSTS(1) = 8.31
      CONSTS(2) = 293
      CONSTS(3) = 96485
      CONSTS(4) = 3.216e-08
      CONSTS(5) = 3.216e-08
      CONSTS(6) = 4.848e-06
      CONSTS(7) = 4.848e-06
      CONSTS(8) = 2.235
      CONSTS(9) = 13.7727015449461
      CONSTS(10) = 10.437
      CONSTS(11) = 72.295598813025
      CONSTS(12) = 8.602
      CONSTS(13) = 0.16701061319503
      CONSTS(14) = 8.602
      CONSTS(15) = 0.233806833618937
      CONSTS(16) = 28.628
      CONSTS(17) = 1.73527350102727
      CONSTS(18) = 0.192
      CONSTS(19) = 11.4302815603453
      CONSTS(20) = 0.3
      CONSTS(21) = 0.3
      CONSTS(22) = 0.7
      CONSTS(23) = 0.7
      CONSTS(24) = 47.905
      CONSTS(25) = 2.325
      CONSTS(26) = 5.812
      CONSTS(27) = 92.998
      CONSTS(28) = 0.349
      CONSTS(29) = 15.661
      CONSTS(30) = 0.029
      CONSTS(31) = 20
      CONSTS(32) = 100
      CONSTS(33) = 10e-3
      CONSTS(34) = 1e-12
      CONSTS(35) = 8.5e5
      CONSTS(36) = 8.5e5
      STATES(7) = -0.05
      CONSTS(37) = 0
      CONSTS(38) = 1e-3
      CONSTS(39) =  CONSTS(31)*CONSTS(35)
      CONSTS(40) =  CONSTS(1)*CONSTS(2)*log( CONSTS(4)*CONSTS(39))
      CONSTS(41) =  CONSTS(32)*CONSTS(36)
      CONSTS(42) =  CONSTS(1)*CONSTS(2)*log( CONSTS(5)*CONSTS(41))
      CONSTS(43) =  CONSTS(33)*CONSTS(35)
      CONSTS(44) =  CONSTS(1)*CONSTS(2)*log( CONSTS(6)*CONSTS(43))
      CONSTS(45) =  CONSTS(34)*CONSTS(36)
      CONSTS(46) =  CONSTS(1)*CONSTS(2)*log( CONSTS(7)*CONSTS(45))
      STATES(1) = CONSTS(9)
      STATES(2) = CONSTS(11)
      STATES(3) = CONSTS(13)
      STATES(4) = CONSTS(15)
      STATES(5) = CONSTS(17)
      STATES(6) = CONSTS(19)
      RETURN
      END
      SUBROUTINE computeRates(VOI, CONSTS,  RATES, STATES, ALGBRC)
      REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*)
      ALGBRC(2) = TERNRY(VOI.LT.1.20475, 0.00000, TERNRY(VOI.GE.1.20475.AND.VOI.LT.1.20475+CONSTS(38), (CONSTS(37)+0.0500000)/CONSTS(38), TERNRY(VOI.GE.1.20475+CONSTS(38).AND.VOI.LT.2.98475, 0.00000, TERNRY(VOI.GE.2.98475.AND.VOI.LT.2.98475+CONSTS(38), - (CONSTS(37)+0.0500000)/CONSTS(38), 0.00000)
      RATES(7) = ALGBRC(2)
      ALGBRC(3) =  CONSTS(1)*CONSTS(2)*log( CONSTS(10)*STATES(2))
      ALGBRC(8) = CONSTS(46)+ALGBRC(3)
      ALGBRC(4) =  CONSTS(1)*CONSTS(2)*log( CONSTS(12)*STATES(3))
      ALGBRC(9) = ALGBRC(4)
      ALGBRC(10) =  CONSTS(25)*(EXP(ALGBRC(8)/( CONSTS(1)*CONSTS(2))) - EXP(ALGBRC(9)/( CONSTS(1)*CONSTS(2))))
      ALGBRC(11) = ALGBRC(4)
      ALGBRC(5) =  CONSTS(1)*CONSTS(2)*log( CONSTS(14)*STATES(4))
      ALGBRC(12) = ALGBRC(5)
      ALGBRC(13) =  CONSTS(26)*(EXP(ALGBRC(11)/( CONSTS(1)*CONSTS(2))) - EXP(ALGBRC(12)/( CONSTS(1)*CONSTS(2))))
      ALGBRC(14) = ALGBRC(10) - ALGBRC(13)
      RATES(3) = ALGBRC(14)
      ALGBRC(15) = ALGBRC(5)
      ALGBRC(6) =  CONSTS(1)*CONSTS(2)*log( CONSTS(16)*STATES(5))
      ALGBRC(16) = CONSTS(44)+ALGBRC(6)
      ALGBRC(17) =  CONSTS(27)*(EXP(ALGBRC(15)/( CONSTS(1)*CONSTS(2))) - EXP(ALGBRC(16)/( CONSTS(1)*CONSTS(2))))
      ALGBRC(18) = ALGBRC(13) - ALGBRC(17)
      RATES(4) = ALGBRC(18)
      ALGBRC(19) = ALGBRC(6)
      ALGBRC(7) =  CONSTS(1)*CONSTS(2)*log( CONSTS(18)*STATES(6))
      ALGBRC(20) =  2.00000*CONSTS(40)+ALGBRC(7)
      ALGBRC(21) =  CONSTS(28)*(EXP(ALGBRC(19)/( CONSTS(1)*CONSTS(2))) - EXP(ALGBRC(20)/( CONSTS(1)*CONSTS(2))))
      ALGBRC(22) = ALGBRC(3)
      ALGBRC(23) = ALGBRC(6)
      ALGBRC(24) =  CONSTS(30)*(EXP(ALGBRC(22)/( CONSTS(1)*CONSTS(2))) - EXP(ALGBRC(23)/( CONSTS(1)*CONSTS(2))))
      ALGBRC(26) = (ALGBRC(17) - ALGBRC(21))+ALGBRC(24)
      RATES(5) = ALGBRC(26)
      ALGBRC(1) =  CONSTS(1)*CONSTS(2)*log( CONSTS(8)*STATES(1))
      ALGBRC(25) = STATES(7)
      ALGBRC(27) = ALGBRC(25)
      ALGBRC(28) = ALGBRC(27)
      ALGBRC(29) =  CONSTS(20)*CONSTS(3)*ALGBRC(28)
      ALGBRC(36) = ( 2.00000*CONSTS(42)+ALGBRC(1)) - ALGBRC(29)
      ALGBRC(30) = ALGBRC(27)
      ALGBRC(31) =  CONSTS(21)*CONSTS(3)*ALGBRC(30)
      ALGBRC(37) = ALGBRC(3)+ALGBRC(31)
      ALGBRC(38) =  CONSTS(24)*(EXP(ALGBRC(36)/( CONSTS(1)*CONSTS(2))) - EXP(ALGBRC(37)/( CONSTS(1)*CONSTS(2))))
      ALGBRC(39) = (ALGBRC(38) - ALGBRC(10)) - ALGBRC(24)
      RATES(2) = ALGBRC(39)
      ALGBRC(32) = ALGBRC(27)
      ALGBRC(33) =  CONSTS(22)*CONSTS(3)*ALGBRC(32)
      ALGBRC(44) = ALGBRC(7) - ALGBRC(33)
      ALGBRC(34) = ALGBRC(27)
      ALGBRC(35) =  CONSTS(23)*CONSTS(3)*ALGBRC(34)
      ALGBRC(45) = ALGBRC(1)+ALGBRC(35)
      ALGBRC(46) =  CONSTS(29)*(EXP(ALGBRC(44)/( CONSTS(1)*CONSTS(2))) - EXP(ALGBRC(45)/( CONSTS(1)*CONSTS(2))))
      ALGBRC(47) = - ALGBRC(38)+ALGBRC(46)
      RATES(1) = ALGBRC(47)
      ALGBRC(48) = ALGBRC(21) - ALGBRC(46)
      RATES(6) = ALGBRC(48)
      RETURN
      END
      SUBROUTINE computeVariables(VOI, CONSTS, RATES, STATES, ALGBRC)
      REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*)
      ALGBRC(2) = TERNRY(VOI.LT.1.20475, 0.00000, TERNRY(VOI.GE.1.20475.AND.VOI.LT.1.20475+CONSTS(38), (CONSTS(37)+0.0500000)/CONSTS(38), TERNRY(VOI.GE.1.20475+CONSTS(38).AND.VOI.LT.2.98475, 0.00000, TERNRY(VOI.GE.2.98475.AND.VOI.LT.2.98475+CONSTS(38), - (CONSTS(37)+0.0500000)/CONSTS(38), 0.00000)
      ALGBRC(3) =  CONSTS(1)*CONSTS(2)*log( CONSTS(10)*STATES(2))
      ALGBRC(8) = CONSTS(46)+ALGBRC(3)
      ALGBRC(4) =  CONSTS(1)*CONSTS(2)*log( CONSTS(12)*STATES(3))
      ALGBRC(9) = ALGBRC(4)
      ALGBRC(10) =  CONSTS(25)*(EXP(ALGBRC(8)/( CONSTS(1)*CONSTS(2))) - EXP(ALGBRC(9)/( CONSTS(1)*CONSTS(2))))
      ALGBRC(11) = ALGBRC(4)
      ALGBRC(5) =  CONSTS(1)*CONSTS(2)*log( CONSTS(14)*STATES(4))
      ALGBRC(12) = ALGBRC(5)
      ALGBRC(13) =  CONSTS(26)*(EXP(ALGBRC(11)/( CONSTS(1)*CONSTS(2))) - EXP(ALGBRC(12)/( CONSTS(1)*CONSTS(2))))
      ALGBRC(14) = ALGBRC(10) - ALGBRC(13)
      ALGBRC(15) = ALGBRC(5)
      ALGBRC(6) =  CONSTS(1)*CONSTS(2)*log( CONSTS(16)*STATES(5))
      ALGBRC(16) = CONSTS(44)+ALGBRC(6)
      ALGBRC(17) =  CONSTS(27)*(EXP(ALGBRC(15)/( CONSTS(1)*CONSTS(2))) - EXP(ALGBRC(16)/( CONSTS(1)*CONSTS(2))))
      ALGBRC(18) = ALGBRC(13) - ALGBRC(17)
      ALGBRC(19) = ALGBRC(6)
      ALGBRC(7) =  CONSTS(1)*CONSTS(2)*log( CONSTS(18)*STATES(6))
      ALGBRC(20) =  2.00000*CONSTS(40)+ALGBRC(7)
      ALGBRC(21) =  CONSTS(28)*(EXP(ALGBRC(19)/( CONSTS(1)*CONSTS(2))) - EXP(ALGBRC(20)/( CONSTS(1)*CONSTS(2))))
      ALGBRC(22) = ALGBRC(3)
      ALGBRC(23) = ALGBRC(6)
      ALGBRC(24) =  CONSTS(30)*(EXP(ALGBRC(22)/( CONSTS(1)*CONSTS(2))) - EXP(ALGBRC(23)/( CONSTS(1)*CONSTS(2))))
      ALGBRC(26) = (ALGBRC(17) - ALGBRC(21))+ALGBRC(24)
      ALGBRC(1) =  CONSTS(1)*CONSTS(2)*log( CONSTS(8)*STATES(1))
      ALGBRC(25) = STATES(7)
      ALGBRC(27) = ALGBRC(25)
      ALGBRC(28) = ALGBRC(27)
      ALGBRC(29) =  CONSTS(20)*CONSTS(3)*ALGBRC(28)
      ALGBRC(36) = ( 2.00000*CONSTS(42)+ALGBRC(1)) - ALGBRC(29)
      ALGBRC(30) = ALGBRC(27)
      ALGBRC(31) =  CONSTS(21)*CONSTS(3)*ALGBRC(30)
      ALGBRC(37) = ALGBRC(3)+ALGBRC(31)
      ALGBRC(38) =  CONSTS(24)*(EXP(ALGBRC(36)/( CONSTS(1)*CONSTS(2))) - EXP(ALGBRC(37)/( CONSTS(1)*CONSTS(2))))
      ALGBRC(39) = (ALGBRC(38) - ALGBRC(10)) - ALGBRC(24)
      ALGBRC(32) = ALGBRC(27)
      ALGBRC(33) =  CONSTS(22)*CONSTS(3)*ALGBRC(32)
      ALGBRC(44) = ALGBRC(7) - ALGBRC(33)
      ALGBRC(34) = ALGBRC(27)
      ALGBRC(35) =  CONSTS(23)*CONSTS(3)*ALGBRC(34)
      ALGBRC(45) = ALGBRC(1)+ALGBRC(35)
      ALGBRC(46) =  CONSTS(29)*(EXP(ALGBRC(44)/( CONSTS(1)*CONSTS(2))) - EXP(ALGBRC(45)/( CONSTS(1)*CONSTS(2))))
      ALGBRC(47) = - ALGBRC(38)+ALGBRC(46)
      ALGBRC(48) = ALGBRC(21) - ALGBRC(46)
      ALGBRC(40) = ALGBRC(38)
      ALGBRC(41) =  CONSTS(20)*CONSTS(3)*ALGBRC(40)
      ALGBRC(42) = ALGBRC(38)
      ALGBRC(43) =  CONSTS(21)*CONSTS(3)*ALGBRC(42)
      ALGBRC(49) = ALGBRC(46)
      ALGBRC(50) =  2.00000*CONSTS(3)*- ALGBRC(46)
      ALGBRC(51) =  CONSTS(22)*CONSTS(3)*ALGBRC(49)
      ALGBRC(52) = ALGBRC(46)
      ALGBRC(53) =  CONSTS(23)*CONSTS(3)*ALGBRC(52)
      ALGBRC(54) = ALGBRC(41)+ALGBRC(43)+ALGBRC(51)+ALGBRC(53)
      RETURN
      END
      REAL FUNCTION TERNRY(TEST, VALA, VALB)
      LOGICAL TEST
      REAL VALA, VALB
      IF (TEST) THEN
        TERNRY = VALA
      ELSE
        TERNRY = VALB
      ENDIF
      RETURN
      END