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 6 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 7 entries in the constant variable array.
C
C
C VOI is t in component main (second).
C STATES(1) is q_1 in component main (mole).
C STATES(2) is q_2 in component main (mole).
C STATES(3) is q_3 in component main (mole).
C STATES(4) is q_4 in component main (mole).
C ALGBRC(1) is v_1 in component main (mol_per_s).
C ALGBRC(3) is v_2 in component main (mol_per_s).
C ALGBRC(4) is v_SS in component main (mol_per_s).
C ALGBRC(6) is v_MM in component main (mol_per_s).
C CONSTS(1) is K_1 in component main (per_mol).
C CONSTS(2) is K_2 in component main (per_mol).
C CONSTS(3) is K_3 in component main (per_mol).
C CONSTS(4) is K_4 in component main (per_mol).
C CONSTS(5) is kappa_1 in component main (mol_per_s).
C CONSTS(6) is kappa_2 in component main (mol_per_s).
C ALGBRC(2) is E_0 in component main (mole).
C CONSTS(7) is k_m in component main (mole).
C ALGBRC(5) is v_max in component main (mol_per_s).
C RATES(1) is d/dt q_1 in component main (mole).
C RATES(2) is d/dt q_2 in component main (mole).
C RATES(3) is d/dt q_3 in component main (mole).
C RATES(4) is d/dt q_4 in component main (mole).
C
      SUBROUTINE initConsts(CONSTS, RATES, STATES)
      REAL CONSTS(*), RATES(*), STATES(*)
      STATES(1) = 30
      STATES(2) = 0
      STATES(3) = 10
      STATES(4) = 0
      CONSTS(1) = 0.1
      CONSTS(2) = 0.1
      CONSTS(3) = 0.1
      CONSTS(4) = 0.1
      CONSTS(5) = 10
      CONSTS(6) = 10
      CONSTS(7) = ( (CONSTS(5)+CONSTS(6))*CONSTS(4))/( CONSTS(5)*CONSTS(1)*CONSTS(3))
      RETURN
      END
      SUBROUTINE computeRates(VOI, CONSTS,  RATES, STATES, ALGBRC)
      REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*)
      ALGBRC(1) =  CONSTS(5)*( CONSTS(1)*STATES(1)*CONSTS(3)*STATES(3) -  CONSTS(4)*STATES(4))
      RATES(1) = - ALGBRC(1)
      ALGBRC(3) =  CONSTS(6)*( CONSTS(4)*STATES(4) -  CONSTS(2)*STATES(2)*CONSTS(3)*STATES(3))
      RATES(2) = ALGBRC(3)
      RATES(3) = ALGBRC(3) - ALGBRC(1)
      RATES(4) = ALGBRC(1) - ALGBRC(3)
      RETURN
      END
      SUBROUTINE computeVariables(VOI, CONSTS, RATES, STATES, ALGBRC)
      REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*)
      ALGBRC(1) =  CONSTS(5)*( CONSTS(1)*STATES(1)*CONSTS(3)*STATES(3) -  CONSTS(4)*STATES(4))
      ALGBRC(3) =  CONSTS(6)*( CONSTS(4)*STATES(4) -  CONSTS(2)*STATES(2)*CONSTS(3)*STATES(3))
      ALGBRC(2) = STATES(3)+STATES(4)
      ALGBRC(4) = ( ALGBRC(2)*CONSTS(5)*CONSTS(6)*CONSTS(3)*CONSTS(4)*( CONSTS(1)*STATES(1) -  CONSTS(2)*STATES(2)))/( CONSTS(4)*(CONSTS(5)+CONSTS(6))+ CONSTS(5)*CONSTS(1)*CONSTS(3)*STATES(1)+ CONSTS(6)*CONSTS(2)*CONSTS(3)*STATES(2))
      ALGBRC(5) =  ALGBRC(2)*CONSTS(6)*CONSTS(4)
      ALGBRC(6) =  ALGBRC(5)*(STATES(1)/(CONSTS(7)+STATES(1)))
      RETURN
      END