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 7 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 6 entries in the constant variable array.
C
C
C VOI is t in component main (second).
C CONSTS(1) is RT in component main (J_per_mol).
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(7) is v_r in component main (mol_per_s).
C ALGBRC(1) is u_1 in component main (J_per_mol).
C ALGBRC(2) is u_2 in component main (J_per_mol).
C ALGBRC(4) is u_3 in component main (J_per_mol).
C ALGBRC(5) is u_4 in component main (J_per_mol).
C ALGBRC(3) is u_f in component main (J_per_mol).
C ALGBRC(6) is u_r in component main (J_per_mol).
C CONSTS(2) is K_q_1 in component main (per_mol).
C CONSTS(3) is K_q_2 in component main (per_mol).
C CONSTS(4) is K_q_3 in component main (per_mol).
C CONSTS(5) is K_q_4 in component main (per_mol).
C CONSTS(6) is kappa_r 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(*)
      CONSTS(1) = 2578.73058
      STATES(1) = 1
      STATES(2) = 1
      STATES(3) = 0
      STATES(4) = 0
      CONSTS(2) = 2
      CONSTS(3) = 2
      CONSTS(4) = 2
      CONSTS(5) = 2
      CONSTS(6) = 0.1
      RETURN
      END
      SUBROUTINE computeRates(VOI, CONSTS,  RATES, STATES, ALGBRC)
      REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*)
      ALGBRC(1) =  CONSTS(1)*log( CONSTS(2)*STATES(1))
      ALGBRC(2) =  CONSTS(1)*log( CONSTS(3)*STATES(2))
      ALGBRC(3) = ALGBRC(1)+ 2.00000*ALGBRC(2)
      ALGBRC(4) =  CONSTS(1)*log( CONSTS(4)*STATES(3))
      ALGBRC(5) =  CONSTS(1)*log( CONSTS(5)*STATES(4))
      ALGBRC(6) = ALGBRC(4)+ 2.00000*ALGBRC(5)
      ALGBRC(7) =  CONSTS(6)*(EXP(ALGBRC(3)/CONSTS(1)) - EXP(ALGBRC(6)/CONSTS(1)))
      RATES(1) = - ALGBRC(7)
      RATES(2) =  - 2.00000*ALGBRC(7)
      RATES(3) = ALGBRC(7)
      RATES(4) =  2.00000*ALGBRC(7)
      RETURN
      END
      SUBROUTINE computeVariables(VOI, CONSTS, RATES, STATES, ALGBRC)
      REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*)
      ALGBRC(1) =  CONSTS(1)*log( CONSTS(2)*STATES(1))
      ALGBRC(2) =  CONSTS(1)*log( CONSTS(3)*STATES(2))
      ALGBRC(3) = ALGBRC(1)+ 2.00000*ALGBRC(2)
      ALGBRC(4) =  CONSTS(1)*log( CONSTS(4)*STATES(3))
      ALGBRC(5) =  CONSTS(1)*log( CONSTS(5)*STATES(4))
      ALGBRC(6) = ALGBRC(4)+ 2.00000*ALGBRC(5)
      ALGBRC(7) =  CONSTS(6)*(EXP(ALGBRC(3)/CONSTS(1)) - EXP(ALGBRC(6)/CONSTS(1)))
      RETURN
      END