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 16 entries in the algebraic variable array. C There are a total of 6 entries in each of the rate and state variable arrays. C There are a total of 11 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 STATES(5) is q_e0 in component main (mole). C STATES(6) is q_e1 in component main (mole). C ALGBRC(15) is v_1 in component main (mol_per_s). C ALGBRC(16) is v_2 in component main (mol_per_s). C ALGBRC(1) is u_1 in component main (J_per_mol). C ALGBRC(3) is u_2 in component main (J_per_mol). C ALGBRC(5) is u_3 in component main (J_per_mol). C ALGBRC(7) is u_4 in component main (J_per_mol). C ALGBRC(9) is u_e0 in component main (J_per_mol). C ALGBRC(12) is u_e1 in component main (J_per_mol). C ALGBRC(10) is u_f_1 in component main (J_per_mol). C ALGBRC(13) is u_r_1 in component main (J_per_mol). C ALGBRC(14) is u_f_2 in component main (J_per_mol). C ALGBRC(11) is u_r_2 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 K_q_e0 in component main (per_mol). C CONSTS(7) is K_q_e1 in component main (per_mol). C CONSTS(8) is kappa_1 in component main (mol_per_s). C CONSTS(9) is kappa_2 in component main (mol_per_s). C ALGBRC(2) is q_e_tot in component main (mole). C ALGBRC(4) is A_f in component main (per_mol3_per_s). C ALGBRC(6) is A_r in component main (per_mol3_per_s). C CONSTS(10) is B_f in component main (per_mol3). C CONSTS(11) is B_r in component main (per_mol3). C ALGBRC(8) is v_SS 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 RATES(5) is d/dt q_e0 in component main (mole). C RATES(6) is d/dt q_e1 in component main (mole). C SUBROUTINE initConsts(CONSTS, RATES, STATES) REAL CONSTS(*), RATES(*), STATES(*) CONSTS(1) = 2578.73058 STATES(1) = 3 STATES(2) = 1 STATES(3) = 0 STATES(4) = 0 STATES(5) = 1 STATES(6) = 1 CONSTS(2) = 2 CONSTS(3) = 2 CONSTS(4) = 2 CONSTS(5) = 2 CONSTS(6) = 2 CONSTS(7) = 2 CONSTS(8) = 0.20 CONSTS(9) = 0.1 CONSTS(10) = (( (CONSTS(6)/CONSTS(7))*CONSTS(8))/(CONSTS(8)+CONSTS(9)))*CONSTS(2)*CONSTS(3) ** 2.00000 CONSTS(11) = (( (CONSTS(6)/CONSTS(7))*CONSTS(8))/(CONSTS(8)+CONSTS(9)))*CONSTS(4)*CONSTS(5) ** 2.00000 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(3) = CONSTS(1)*log( CONSTS(3)*STATES(2)) ALGBRC(9) = CONSTS(1)*log( CONSTS(6)*STATES(5)) ALGBRC(10) = ALGBRC(1)+ 2.00000*ALGBRC(3)+ALGBRC(9) ALGBRC(12) = CONSTS(1)*log( CONSTS(7)*STATES(6)) ALGBRC(13) = ALGBRC(12) ALGBRC(15) = CONSTS(8)*(EXP(ALGBRC(10)/CONSTS(1)) - EXP(ALGBRC(13)/CONSTS(1))) RATES(1) = - ALGBRC(15) RATES(2) = - 2.00000*ALGBRC(15) ALGBRC(14) = ALGBRC(12) ALGBRC(5) = CONSTS(1)*log( CONSTS(4)*STATES(3)) ALGBRC(7) = CONSTS(1)*log( CONSTS(5)*STATES(4)) ALGBRC(11) = ALGBRC(5)+ 2.00000*ALGBRC(7)+ALGBRC(9) ALGBRC(16) = CONSTS(9)*(EXP(ALGBRC(14)/CONSTS(1)) - EXP(ALGBRC(11)/CONSTS(1))) RATES(3) = ALGBRC(16) RATES(4) = 2.00000*ALGBRC(16) RATES(5) = ALGBRC(16) - ALGBRC(15) RATES(6) = ALGBRC(15) - ALGBRC(16) 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(3) = CONSTS(1)*log( CONSTS(3)*STATES(2)) ALGBRC(9) = CONSTS(1)*log( CONSTS(6)*STATES(5)) ALGBRC(10) = ALGBRC(1)+ 2.00000*ALGBRC(3)+ALGBRC(9) ALGBRC(12) = CONSTS(1)*log( CONSTS(7)*STATES(6)) ALGBRC(13) = ALGBRC(12) ALGBRC(15) = CONSTS(8)*(EXP(ALGBRC(10)/CONSTS(1)) - EXP(ALGBRC(13)/CONSTS(1))) ALGBRC(14) = ALGBRC(12) ALGBRC(5) = CONSTS(1)*log( CONSTS(4)*STATES(3)) ALGBRC(7) = CONSTS(1)*log( CONSTS(5)*STATES(4)) ALGBRC(11) = ALGBRC(5)+ 2.00000*ALGBRC(7)+ALGBRC(9) ALGBRC(16) = CONSTS(9)*(EXP(ALGBRC(14)/CONSTS(1)) - EXP(ALGBRC(11)/CONSTS(1))) ALGBRC(2) = STATES(5)+STATES(6) ALGBRC(4) = (( ALGBRC(2)*CONSTS(6)*CONSTS(8)*CONSTS(9))/(CONSTS(8)+CONSTS(9)))*CONSTS(2)*CONSTS(3) ** 2.00000 ALGBRC(6) = (( ALGBRC(2)*CONSTS(6)*CONSTS(8)*CONSTS(9))/(CONSTS(8)+CONSTS(9)))*CONSTS(4)*CONSTS(5) ** 2.00000 ALGBRC(8) = ( ALGBRC(4)*STATES(1)*STATES(2) ** 2.00000 - ALGBRC(6)*STATES(3)*STATES(4) ** 2.00000)/(1.00000+ CONSTS(10)*STATES(1)*STATES(2) ** 2.00000+ CONSTS(11)*STATES(3)*STATES(4) ** 2.00000) RETURN END