# Generated Code

The following is matlab code generated by the CellML API from this CellML file. (Back to language selection)

The raw code is available.

```function [VOI, STATES, ALGEBRAIC, CONSTANTS] = mainFunction()
% This is the "main function".  In Matlab, things work best if you rename this function to match the filename.
[VOI, STATES, ALGEBRAIC, CONSTANTS] = solveModel();
end

function [algebraicVariableCount] = getAlgebraicVariableCount()
% Used later when setting a global variable with the number of algebraic variables.
% Note: This is not the "main method".
algebraicVariableCount =148;
end
% There are a total of 103 entries in each of the rate and state variable arrays.
% There are a total of 96 entries in the constant variable array.
%

function [VOI, STATES, ALGEBRAIC, CONSTANTS] = solveModel()
% Create ALGEBRAIC of correct size
global algebraicVariableCount;  algebraicVariableCount = getAlgebraicVariableCount();
% Initialise constants and state variables
[INIT_STATES, CONSTANTS] = initConsts;

% Set timespan to solve over
tspan = [0, 10];

% Set numerical accuracy options for ODE solver
options = odeset('RelTol', 1e-06, 'AbsTol', 1e-06, 'MaxStep', 1);

% Solve model with ODE solver
[VOI, STATES] = ode15s(@(VOI, STATES)computeRates(VOI, STATES, CONSTANTS), tspan, INIT_STATES, options);

% Compute algebraic variables
[RATES, ALGEBRAIC] = computeRates(VOI, STATES, CONSTANTS);
ALGEBRAIC = computeAlgebraic(ALGEBRAIC, CONSTANTS, STATES, VOI);

% Plot state variables against variable of integration
[LEGEND_STATES, LEGEND_ALGEBRAIC, LEGEND_VOI, LEGEND_CONSTANTS] = createLegends();
figure();
plot(VOI, STATES);
xlabel(LEGEND_VOI);
l = legend(LEGEND_STATES);
set(l,'Interpreter','none');
end

function [LEGEND_STATES, LEGEND_ALGEBRAIC, LEGEND_VOI, LEGEND_CONSTANTS] = createLegends()
LEGEND_STATES = ''; LEGEND_ALGEBRAIC = ''; LEGEND_VOI = ''; LEGEND_CONSTANTS = '';
LEGEND_VOI = strpad('time in component environment (second)');
LEGEND_STATES(:,1) = strpad('c1 in component c1 (molar)');
LEGEND_ALGEBRAIC(:,1) = strpad('v1 in component v1 (flux)');
LEGEND_STATES(:,2) = strpad('c2 in component c2 (molar)');
LEGEND_ALGEBRAIC(:,6) = strpad('v6 in component v6 (flux)');
LEGEND_ALGEBRAIC(:,7) = strpad('v13 in component v13 (flux)');
LEGEND_STATES(:,3) = strpad('c3 in component c3 (molar)');
LEGEND_ALGEBRAIC(:,2) = strpad('v2 in component v2 (flux)');
LEGEND_STATES(:,4) = strpad('c4 in component c4 (molar)');
LEGEND_ALGEBRAIC(:,3) = strpad('v3 in component v3 (flux)');
LEGEND_STATES(:,5) = strpad('c5 in component c5 (molar)');
LEGEND_ALGEBRAIC(:,8) = strpad('v7 in component v7 (flux)');
LEGEND_ALGEBRAIC(:,9) = strpad('v8 in component v8 (flux)');
LEGEND_STATES(:,6) = strpad('c6 in component c6 (molar)');
LEGEND_ALGEBRAIC(:,11) = strpad('v10 in component v10 (flux)');
LEGEND_ALGEBRAIC(:,12) = strpad('v60 in component v60 (flux)');
LEGEND_STATES(:,7) = strpad('c7 in component c7 (molar)');
LEGEND_ALGEBRAIC(:,4) = strpad('v4 in component v4 (flux)');
LEGEND_ALGEBRAIC(:,5) = strpad('v5 in component v5 (flux)');
LEGEND_STATES(:,8) = strpad('c8 in component c8 (molar)');
LEGEND_ALGEBRAIC(:,15) = strpad('v12 in component v12 (flux)');
LEGEND_ALGEBRAIC(:,16) = strpad('v14 in component v14 (flux)');
LEGEND_ALGEBRAIC(:,62) = strpad('v62 in component v62 (flux)');
LEGEND_STATES(:,9) = strpad('c9 in component c9 (molar)');
LEGEND_ALGEBRAIC(:,17) = strpad('v15 in component v15 (flux)');
LEGEND_ALGEBRAIC(:,107) = strpad('v107 in component v107 (flux)');
LEGEND_ALGEBRAIC(:,110) = strpad('v110 in component v110 (flux)');
LEGEND_ALGEBRAIC(:,113) = strpad('v113 in component v113 (flux)');
LEGEND_ALGEBRAIC(:,116) = strpad('v116 in component v116 (flux)');
LEGEND_ALGEBRAIC(:,119) = strpad('v119 in component v119 (flux)');
LEGEND_ALGEBRAIC(:,122) = strpad('v122 in component v122 (flux)');
LEGEND_ALGEBRAIC(:,125) = strpad('v125 in component v125 (flux)');
LEGEND_STATES(:,10) = strpad('c10 in component c10 (molar)');
LEGEND_ALGEBRAIC(:,13) = strpad('v11 in component v11 (flux)');
LEGEND_STATES(:,11) = strpad('c11 in component c11 (molar)');
LEGEND_STATES(:,12) = strpad('c12 in component c12 (molar)');
LEGEND_ALGEBRAIC(:,106) = strpad('v106 in component v106 (flux)');
LEGEND_ALGEBRAIC(:,109) = strpad('v109 in component v109 (flux)');
LEGEND_ALGEBRAIC(:,112) = strpad('v112 in component v112 (flux)');
LEGEND_ALGEBRAIC(:,115) = strpad('v115 in component v115 (flux)');
LEGEND_ALGEBRAIC(:,118) = strpad('v118 in component v118 (flux)');
LEGEND_ALGEBRAIC(:,121) = strpad('v121 in component v121 (flux)');
LEGEND_ALGEBRAIC(:,124) = strpad('v124 in component v124 (flux)');
LEGEND_STATES(:,13) = strpad('c13 in component c13 (molar)');
LEGEND_ALGEBRAIC(:,14) = strpad('v61 in component v61 (flux)');
LEGEND_STATES(:,14) = strpad('c14 in component c14 (molar)');
LEGEND_STATES(:,15) = strpad('c15 in component c15 (molar)');
LEGEND_ALGEBRAIC(:,18) = strpad('v16 in component v16 (flux)');
LEGEND_ALGEBRAIC(:,24) = strpad('v22 in component v22 (flux)');
LEGEND_ALGEBRAIC(:,34) = strpad('v32 in component v32 (flux)');
LEGEND_ALGEBRAIC(:,36) = strpad('v34 in component v34 (flux)');
LEGEND_ALGEBRAIC(:,39) = strpad('v37 in component v37 (flux)');
LEGEND_ALGEBRAIC(:,41) = strpad('v39 in component v39 (flux)');
LEGEND_ALGEBRAIC(:,99) = strpad('v102 in component v102 (flux)');
LEGEND_STATES(:,16) = strpad('c16 in component c16 (molar)');
LEGEND_STATES(:,17) = strpad('c17 in component c17 (molar)');
LEGEND_ALGEBRAIC(:,63) = strpad('v63 in component v63 (flux)');
LEGEND_ALGEBRAIC(:,69) = strpad('v69 in component v69 (flux)');
LEGEND_ALGEBRAIC(:,79) = strpad('v79 in component v79 (flux)');
LEGEND_ALGEBRAIC(:,80) = strpad('v80 in component v80 (flux)');
LEGEND_ALGEBRAIC(:,81) = strpad('v81 in component v81 (flux)');
LEGEND_ALGEBRAIC(:,82) = strpad('v82 in component v82 (flux)');
LEGEND_ALGEBRAIC(:,130) = strpad('v132 in component v132 (flux)');
LEGEND_STATES(:,18) = strpad('c18 in component c18 (molar)');
LEGEND_ALGEBRAIC(:,10) = strpad('v9 in component v9 (flux)');
LEGEND_ALGEBRAIC(:,64) = strpad('v64 in component v64 (flux)');
LEGEND_ALGEBRAIC(:,132) = strpad('v133 in component v133 (flux)');
LEGEND_STATES(:,19) = strpad('c19 in component c19 (molar)');
LEGEND_ALGEBRAIC(:,65) = strpad('v65 in component v65 (flux)');
LEGEND_ALGEBRAIC(:,66) = strpad('v66 in component v66 (flux)');
LEGEND_ALGEBRAIC(:,67) = strpad('v67 in component v67 (flux)');
LEGEND_ALGEBRAIC(:,68) = strpad('v68 in component v68 (flux)');
LEGEND_ALGEBRAIC(:,105) = strpad('v105 in component v105 (flux)');
LEGEND_ALGEBRAIC(:,127) = strpad('v127 in component v127 (flux)');
LEGEND_ALGEBRAIC(:,134) = strpad('v134 in component v134 (flux)');
LEGEND_STATES(:,20) = strpad('c20 in component c20 (molar)');
LEGEND_ALGEBRAIC(:,108) = strpad('v108 in component v108 (flux)');
LEGEND_ALGEBRAIC(:,136) = strpad('v135 in component v135 (flux)');
LEGEND_STATES(:,21) = strpad('c21 in component c21 (molar)');
LEGEND_ALGEBRAIC(:,111) = strpad('v111 in component v111 (flux)');
LEGEND_ALGEBRAIC(:,138) = strpad('v136 in component v136 (flux)');
LEGEND_STATES(:,22) = strpad('c22 in component c22 (molar)');
LEGEND_ALGEBRAIC(:,26) = strpad('v24 in component v24 (flux)');
LEGEND_ALGEBRAIC(:,37) = strpad('v35 in component v35 (flux)');
LEGEND_ALGEBRAIC(:,40) = strpad('v38 in component v38 (flux)');
LEGEND_ALGEBRAIC(:,71) = strpad('v71 in component v71 (flux)');
LEGEND_STATES(:,23) = strpad('c23 in component c23 (molar)');
LEGEND_ALGEBRAIC(:,19) = strpad('v17 in component v17 (flux)');
LEGEND_STATES(:,24) = strpad('c24 in component c24 (molar)');
LEGEND_ALGEBRAIC(:,72) = strpad('v72 in component v72 (flux)');
LEGEND_ALGEBRAIC(:,131) = strpad('v130 in component v130 (flux)');
LEGEND_ALGEBRAIC(:,133) = strpad('v131 in component v131 (flux)');
LEGEND_ALGEBRAIC(:,27) = strpad('v25 in component v25 (flux)');
LEGEND_ALGEBRAIC(:,42) = strpad('v40 in component v40 (flux)');
LEGEND_STATES(:,25) = strpad('c25 in component c25 (molar)');
LEGEND_ALGEBRAIC(:,20) = strpad('v18 in component v18 (flux)');
LEGEND_ALGEBRAIC(:,21) = strpad('v19 in component v19 (flux)');
LEGEND_ALGEBRAIC(:,22) = strpad('v20 in component v20 (flux)');
LEGEND_ALGEBRAIC(:,23) = strpad('v21 in component v21 (flux)');
LEGEND_ALGEBRAIC(:,126) = strpad('v126 in component v126 (flux)');
LEGEND_STATES(:,26) = strpad('c26 in component c26 (molar)');
LEGEND_ALGEBRAIC(:,28) = strpad('v26 in component v26 (flux)');
LEGEND_ALGEBRAIC(:,33) = strpad('v31 in component v31 (flux)');
LEGEND_ALGEBRAIC(:,78) = strpad('v78 in component v78 (flux)');
LEGEND_ALGEBRAIC(:,73) = strpad('v73 in component v73 (flux)');
LEGEND_STATES(:,27) = strpad('c27 in component c27 (molar)');
LEGEND_STATES(:,28) = strpad('c28 in component c28 (molar)');
LEGEND_ALGEBRAIC(:,29) = strpad('v27 in component v27 (flux)');
LEGEND_ALGEBRAIC(:,30) = strpad('v28 in component v28 (flux)');
LEGEND_STATES(:,29) = strpad('c29 in component c29 (molar)');
LEGEND_STATES(:,30) = strpad('c30 in component c30 (molar)');
LEGEND_ALGEBRAIC(:,35) = strpad('v33 in component v33 (flux)');
LEGEND_ALGEBRAIC(:,43) = strpad('v41 in component v41 (flux)');
LEGEND_ALGEBRAIC(:,83) = strpad('v83 in component v83 (flux)');
LEGEND_STATES(:,31) = strpad('c31 in component c31 (molar)');
LEGEND_ALGEBRAIC(:,38) = strpad('v36 in component v36 (flux)');
LEGEND_STATES(:,32) = strpad('c32 in component c32 (molar)');
LEGEND_ALGEBRAIC(:,25) = strpad('v23 in component v23 (flux)');
LEGEND_ALGEBRAIC(:,101) = strpad('v103 in component v103 (flux)');
LEGEND_STATES(:,33) = strpad('c33 in component c33 (molar)');
LEGEND_ALGEBRAIC(:,103) = strpad('v104 in component v104 (flux)');
LEGEND_STATES(:,34) = strpad('c34 in component c34 (molar)');
LEGEND_ALGEBRAIC(:,114) = strpad('v114 in component v114 (flux)');
LEGEND_STATES(:,35) = strpad('c35 in component c35 (molar)');
LEGEND_ALGEBRAIC(:,32) = strpad('v30 in component v30 (flux)');
LEGEND_ALGEBRAIC(:,117) = strpad('v117 in component v117 (flux)');
LEGEND_ALGEBRAIC(:,128) = strpad('v128 in component v128 (flux)');
LEGEND_STATES(:,36) = strpad('c36 in component c36 (molar)');
LEGEND_ALGEBRAIC(:,120) = strpad('v120 in component v120 (flux)');
LEGEND_STATES(:,37) = strpad('c37 in component c37 (molar)');
LEGEND_ALGEBRAIC(:,123) = strpad('v123 in component v123 (flux)');
LEGEND_STATES(:,38) = strpad('c38 in component c38 (molar)');
LEGEND_STATES(:,39) = strpad('c39 in component c39 (molar)');
LEGEND_STATES(:,40) = strpad('c40 in component c40 (molar)');
LEGEND_STATES(:,41) = strpad('c41 in component c41 (molar)');
LEGEND_ALGEBRAIC(:,45) = strpad('v43 in component v43 (flux)');
LEGEND_ALGEBRAIC(:,75) = strpad('v75 in component v75 (flux)');
LEGEND_ALGEBRAIC(:,85) = strpad('v85 in component v85 (flux)');
LEGEND_STATES(:,42) = strpad('c42 in component c42 (molar)');
LEGEND_ALGEBRAIC(:,31) = strpad('v29 in component v29 (flux)');
LEGEND_STATES(:,43) = strpad('c43 in component c43 (molar)');
LEGEND_STATES(:,44) = strpad('c44 in component c44 (molar)');
LEGEND_ALGEBRAIC(:,44) = strpad('v42 in component v42 (flux)');
LEGEND_ALGEBRAIC(:,84) = strpad('v84 in component v84 (flux)');
LEGEND_STATES(:,45) = strpad('c45 in component c45 (molar)');
LEGEND_ALGEBRAIC(:,46) = strpad('v44 in component v44 (flux)');
LEGEND_ALGEBRAIC(:,47) = strpad('v45 in component v45 (flux)');
LEGEND_ALGEBRAIC(:,48) = strpad('v46 in component v46 (flux)');
LEGEND_ALGEBRAIC(:,49) = strpad('v47 in component v47 (flux)');
LEGEND_STATES(:,46) = strpad('c46 in component c46 (molar)');
LEGEND_STATES(:,47) = strpad('c47 in component c47 (molar)');
LEGEND_ALGEBRAIC(:,53) = strpad('v51 in component v51 (flux)');
LEGEND_ALGEBRAIC(:,86) = strpad('v86 in component v86 (flux)');
LEGEND_ALGEBRAIC(:,96) = strpad('v93 in component v93 (flux)');
LEGEND_STATES(:,48) = strpad('c48 in component c48 (molar)');
LEGEND_STATES(:,49) = strpad('c49 in component c49 (molar)');
LEGEND_ALGEBRAIC(:,51) = strpad('v49 in component v49 (flux)');
LEGEND_ALGEBRAIC(:,52) = strpad('v50 in component v50 (flux)');
LEGEND_STATES(:,50) = strpad('c50 in component c50 (molar)');
LEGEND_STATES(:,51) = strpad('c51 in component c51 (molar)');
LEGEND_ALGEBRAIC(:,50) = strpad('v48 in component v48 (flux)');
LEGEND_ALGEBRAIC(:,54) = strpad('v52 in component v52 (flux)');
LEGEND_ALGEBRAIC(:,55) = strpad('v53 in component v53 (flux)');
LEGEND_ALGEBRAIC(:,56) = strpad('v54 in component v54 (flux)');
LEGEND_ALGEBRAIC(:,57) = strpad('v55 in component v55 (flux)');
LEGEND_STATES(:,52) = strpad('c52 in component c52 (molar)');
LEGEND_STATES(:,53) = strpad('c53 in component c53 (molar)');
LEGEND_ALGEBRAIC(:,90) = strpad('v90 in component v90 (flux)');
LEGEND_ALGEBRAIC(:,92) = strpad('v91 in component v91 (flux)');
LEGEND_ALGEBRAIC(:,94) = strpad('v92 in component v92 (flux)');
LEGEND_STATES(:,54) = strpad('c54 in component c54 (molar)');
LEGEND_STATES(:,55) = strpad('c55 in component c55 (molar)');
LEGEND_ALGEBRAIC(:,61) = strpad('v59 in component v59 (flux)');
LEGEND_ALGEBRAIC(:,91) = strpad('v94 in component v94 (flux)');
LEGEND_ALGEBRAIC(:,104) = strpad('v101 in component v101 (flux)');
LEGEND_STATES(:,56) = strpad('c56 in component c56 (molar)');
LEGEND_STATES(:,57) = strpad('c57 in component c57 (molar)');
LEGEND_ALGEBRAIC(:,59) = strpad('v57 in component v57 (flux)');
LEGEND_ALGEBRAIC(:,60) = strpad('v58 in component v58 (flux)');
LEGEND_STATES(:,58) = strpad('c58 in component c58 (molar)');
LEGEND_STATES(:,59) = strpad('c59 in component c59 (molar)');
LEGEND_ALGEBRAIC(:,58) = strpad('v56 in component v56 (flux)');
LEGEND_ALGEBRAIC(:,135) = strpad('v143 in component v143 (flux)');
LEGEND_ALGEBRAIC(:,137) = strpad('v144 in component v144 (flux)');
LEGEND_ALGEBRAIC(:,139) = strpad('v145 in component v145 (flux)');
LEGEND_STATES(:,60) = strpad('c60 in component c60 (molar)');
LEGEND_ALGEBRAIC(:,98) = strpad('v98 in component v98 (flux)');
LEGEND_ALGEBRAIC(:,100) = strpad('v99 in component v99 (flux)');
LEGEND_ALGEBRAIC(:,102) = strpad('v100 in component v100 (flux)');
LEGEND_STATES(:,61) = strpad('c61 in component c61 (molar)');
LEGEND_STATES(:,62) = strpad('c62 in component c62 (molar)');
LEGEND_STATES(:,63) = strpad('c63 in component c63 (molar)');
LEGEND_ALGEBRAIC(:,70) = strpad('v70 in component v70 (flux)');
LEGEND_ALGEBRAIC(:,140) = strpad('v137 in component v137 (flux)');
LEGEND_STATES(:,64) = strpad('c64 in component c64 (molar)');
LEGEND_ALGEBRAIC(:,142) = strpad('v138 in component v138 (flux)');
LEGEND_STATES(:,65) = strpad('c65 in component c65 (molar)');
LEGEND_ALGEBRAIC(:,144) = strpad('v139 in component v139 (flux)');
LEGEND_STATES(:,66) = strpad('c66 in component c66 (molar)');
LEGEND_ALGEBRAIC(:,74) = strpad('v74 in component v74 (flux)');
LEGEND_ALGEBRAIC(:,77) = strpad('v77 in component v77 (flux)');
LEGEND_ALGEBRAIC(:,129) = strpad('v129 in component v129 (flux)');
LEGEND_ALGEBRAIC(:,146) = strpad('v140 in component v140 (flux)');
LEGEND_STATES(:,67) = strpad('c67 in component c67 (molar)');
LEGEND_ALGEBRAIC(:,147) = strpad('v141 in component v141 (flux)');
LEGEND_STATES(:,68) = strpad('c68 in component c68 (molar)');
LEGEND_ALGEBRAIC(:,148) = strpad('v142 in component v142 (flux)');
LEGEND_STATES(:,69) = strpad('c69 in component c69 (molar)');
LEGEND_STATES(:,70) = strpad('c70 in component c70 (molar)');
LEGEND_ALGEBRAIC(:,76) = strpad('v76 in component v76 (flux)');
LEGEND_STATES(:,71) = strpad('c71 in component c71 (molar)');
LEGEND_STATES(:,72) = strpad('c72 in component c72 (molar)');
LEGEND_ALGEBRAIC(:,87) = strpad('v87 in component v87 (flux)');
LEGEND_ALGEBRAIC(:,88) = strpad('v88 in component v88 (flux)');
LEGEND_ALGEBRAIC(:,89) = strpad('v89 in component v89 (flux)');
LEGEND_STATES(:,73) = strpad('c73 in component c73 (molar)');
LEGEND_STATES(:,74) = strpad('c74 in component c74 (molar)');
LEGEND_STATES(:,75) = strpad('c75 in component c75 (molar)');
LEGEND_STATES(:,76) = strpad('c76 in component c76 (molar)');
LEGEND_STATES(:,77) = strpad('c77 in component c77 (molar)');
LEGEND_ALGEBRAIC(:,93) = strpad('v95 in component v95 (flux)');
LEGEND_ALGEBRAIC(:,95) = strpad('v96 in component v96 (flux)');
LEGEND_ALGEBRAIC(:,97) = strpad('v97 in component v97 (flux)');
LEGEND_STATES(:,78) = strpad('c78 in component c78 (molar)');
LEGEND_STATES(:,79) = strpad('c79 in component c79 (molar)');
LEGEND_STATES(:,80) = strpad('c80 in component c80 (molar)');
LEGEND_STATES(:,81) = strpad('c81 in component c81 (molar)');
LEGEND_STATES(:,82) = strpad('c82 in component c82 (molar)');
LEGEND_STATES(:,83) = strpad('c83 in component c83 (molar)');
LEGEND_ALGEBRAIC(:,141) = strpad('v146 in component v146 (flux)');
LEGEND_ALGEBRAIC(:,143) = strpad('v147 in component v147 (flux)');
LEGEND_ALGEBRAIC(:,145) = strpad('v148 in component v148 (flux)');
LEGEND_STATES(:,84) = strpad('c84 in component c84 (molar)');
LEGEND_STATES(:,85) = strpad('c85 in component c85 (molar)');
LEGEND_STATES(:,86) = strpad('c86 in component c86 (molar)');
LEGEND_STATES(:,87) = strpad('c87 in component c87 (molar)');
LEGEND_STATES(:,88) = strpad('c88 in component c88 (molar)');
LEGEND_STATES(:,89) = strpad('c89 in component c89 (molar)');
LEGEND_STATES(:,90) = strpad('c90 in component c90 (molar)');
LEGEND_STATES(:,91) = strpad('c91 in component c91 (molar)');
LEGEND_STATES(:,92) = strpad('c92 in component c92 (molar)');
LEGEND_STATES(:,93) = strpad('c93 in component c93 (molar)');
LEGEND_STATES(:,94) = strpad('c94 in component c94 (molar)');
LEGEND_STATES(:,95) = strpad('c95 in component c95 (molar)');
LEGEND_STATES(:,96) = strpad('c96 in component c96 (molar)');
LEGEND_STATES(:,97) = strpad('c97 in component c97 (molar)');
LEGEND_STATES(:,98) = strpad('c98 in component c98 (molar)');
LEGEND_STATES(:,99) = strpad('c99 in component c99 (molar)');
LEGEND_STATES(:,100) = strpad('c100 in component c100 (molar)');
LEGEND_STATES(:,101) = strpad('c101 in component c101 (molar)');
LEGEND_STATES(:,102) = strpad('c102 in component c102 (molar)');
LEGEND_STATES(:,103) = strpad('c103 in component c103 (molar)');
LEGEND_CONSTANTS(:,1) = strpad('k1 in component reaction_rates (second_order_rate_constant)');
LEGEND_CONSTANTS(:,2) = strpad('kd1 in component reaction_rates (first_order_rate_constant)');
LEGEND_CONSTANTS(:,3) = strpad('k2 in component reaction_rates (second_order_rate_constant)');
LEGEND_CONSTANTS(:,4) = strpad('kd2 in component reaction_rates (first_order_rate_constant)');
LEGEND_CONSTANTS(:,5) = strpad('k3 in component reaction_rates (first_order_rate_constant)');
LEGEND_CONSTANTS(:,6) = strpad('kd3 in component reaction_rates (first_order_rate_constant)');
LEGEND_CONSTANTS(:,7) = strpad('k4 in component reaction_rates (second_order_rate_constant)');
LEGEND_CONSTANTS(:,8) = strpad('kd4 in component reaction_rates (first_order_rate_constant)');
LEGEND_CONSTANTS(:,9) = strpad('k5 in component reaction_rates (second_order_rate_constant)');
LEGEND_CONSTANTS(:,10) = strpad('kd5 in component reaction_rates (first_order_rate_constant)');
LEGEND_CONSTANTS(:,11) = strpad('k6 in component reaction_rates (first_order_rate_constant)');
LEGEND_CONSTANTS(:,12) = strpad('kd6 in component reaction_rates (first_order_rate_constant)');
LEGEND_CONSTANTS(:,13) = strpad('k8 in component reaction_rates (second_order_rate_constant)');
LEGEND_CONSTANTS(:,14) = strpad('kd8 in component reaction_rates (first_order_rate_constant)');
LEGEND_CONSTANTS(:,15) = strpad('k10b in component reaction_rates (second_order_rate_constant)');
LEGEND_CONSTANTS(:,16) = strpad('kd10 in component reaction_rates (first_order_rate_constant)');
LEGEND_CONSTANTS(:,17) = strpad('k13 in component reaction_rates (first_order_rate_constant)');
LEGEND_CONSTANTS(:,18) = strpad('kd13 in component reaction_rates (first_order_rate_constant)');
LEGEND_CONSTANTS(:,19) = strpad('k15 in component reaction_rates (first_order_rate_constant)');
LEGEND_CONSTANTS(:,20) = strpad('kd15 in component reaction_rates (first_order_rate_constant)');
LEGEND_CONSTANTS(:,21) = strpad('k16 in component reaction_rates (second_order_rate_constant)');
LEGEND_CONSTANTS(:,22) = strpad('kd63 in component reaction_rates (first_order_rate_constant)');
LEGEND_CONSTANTS(:,23) = strpad('k17 in component reaction_rates (second_order_rate_constant)');
LEGEND_CONSTANTS(:,24) = strpad('kd17 in component reaction_rates (first_order_rate_constant)');
LEGEND_CONSTANTS(:,25) = strpad('k18 in component reaction_rates (second_order_rate_constant)');
LEGEND_CONSTANTS(:,26) = strpad('kd18 in component reaction_rates (first_order_rate_constant)');
LEGEND_CONSTANTS(:,27) = strpad('k19 in component reaction_rates (second_order_rate_constant)');
LEGEND_CONSTANTS(:,28) = strpad('kd19 in component reaction_rates (first_order_rate_constant)');
LEGEND_CONSTANTS(:,29) = strpad('k20 in component reaction_rates (second_order_rate_constant)');
LEGEND_CONSTANTS(:,30) = strpad('kd20 in component reaction_rates (first_order_rate_constant)');
LEGEND_CONSTANTS(:,31) = strpad('k21 in component reaction_rates (second_order_rate_constant)');
LEGEND_CONSTANTS(:,32) = strpad('kd21 in component reaction_rates (first_order_rate_constant)');
LEGEND_CONSTANTS(:,33) = strpad('k22 in component reaction_rates (second_order_rate_constant)');
LEGEND_CONSTANTS(:,34) = strpad('kd22 in component reaction_rates (first_order_rate_constant)');
LEGEND_CONSTANTS(:,35) = strpad('k23 in component reaction_rates (first_order_rate_constant)');
LEGEND_CONSTANTS(:,36) = strpad('kd23 in component reaction_rates (first_order_rate_constant)');
LEGEND_CONSTANTS(:,37) = strpad('kd24 in component reaction_rates (first_order_rate_constant)');
LEGEND_CONSTANTS(:,38) = strpad('k25 in component reaction_rates (second_order_rate_constant)');
LEGEND_CONSTANTS(:,39) = strpad('kd25 in component reaction_rates (first_order_rate_constant)');
LEGEND_CONSTANTS(:,40) = strpad('k28 in component reaction_rates (second_order_rate_constant)');
LEGEND_CONSTANTS(:,41) = strpad('kd28 in component reaction_rates (first_order_rate_constant)');
LEGEND_CONSTANTS(:,42) = strpad('k29 in component reaction_rates (second_order_rate_constant)');
LEGEND_CONSTANTS(:,43) = strpad('kd29 in component reaction_rates (first_order_rate_constant)');
LEGEND_CONSTANTS(:,44) = strpad('k32 in component reaction_rates (second_order_rate_constant)');
LEGEND_CONSTANTS(:,45) = strpad('kd32 in component reaction_rates (first_order_rate_constant)');
LEGEND_CONSTANTS(:,46) = strpad('k33 in component reaction_rates (second_order_rate_constant)');
LEGEND_CONSTANTS(:,47) = strpad('kd33 in component reaction_rates (first_order_rate_constant)');
LEGEND_CONSTANTS(:,48) = strpad('k34 in component reaction_rates (second_order_rate_constant)');
LEGEND_CONSTANTS(:,49) = strpad('kd34 in component reaction_rates (first_order_rate_constant)');
LEGEND_CONSTANTS(:,50) = strpad('k35 in component reaction_rates (second_order_rate_constant)');
LEGEND_CONSTANTS(:,51) = strpad('kd35 in component reaction_rates (first_order_rate_constant)');
LEGEND_CONSTANTS(:,52) = strpad('k36 in component reaction_rates (first_order_rate_constant)');
LEGEND_CONSTANTS(:,53) = strpad('kd36 in component reaction_rates (first_order_rate_constant)');
LEGEND_CONSTANTS(:,54) = strpad('k37 in component reaction_rates (second_order_rate_constant)');
LEGEND_CONSTANTS(:,55) = strpad('kd37 in component reaction_rates (first_order_rate_constant)');
LEGEND_CONSTANTS(:,56) = strpad('k40 in component reaction_rates (second_order_rate_constant)');
LEGEND_CONSTANTS(:,57) = strpad('kd40 in component reaction_rates (first_order_rate_constant)');
LEGEND_CONSTANTS(:,58) = strpad('k41 in component reaction_rates (second_order_rate_constant)');
LEGEND_CONSTANTS(:,59) = strpad('kd41 in component reaction_rates (first_order_rate_constant)');
LEGEND_CONSTANTS(:,60) = strpad('k42 in component reaction_rates (second_order_rate_constant)');
LEGEND_CONSTANTS(:,61) = strpad('kd42 in component reaction_rates (first_order_rate_constant)');
LEGEND_CONSTANTS(:,62) = strpad('k43 in component reaction_rates (second_order_rate_constant)');
LEGEND_CONSTANTS(:,63) = strpad('kd43 in component reaction_rates (first_order_rate_constant)');
LEGEND_CONSTANTS(:,64) = strpad('k44 in component reaction_rates (second_order_rate_constant)');
LEGEND_CONSTANTS(:,65) = strpad('kd52 in component reaction_rates (first_order_rate_constant)');
LEGEND_CONSTANTS(:,66) = strpad('k45 in component reaction_rates (second_order_rate_constant)');
LEGEND_CONSTANTS(:,67) = strpad('kd45 in component reaction_rates (first_order_rate_constant)');
LEGEND_CONSTANTS(:,68) = strpad('k47 in component reaction_rates (second_order_rate_constant)');
LEGEND_CONSTANTS(:,69) = strpad('kd47 in component reaction_rates (first_order_rate_constant)');
LEGEND_CONSTANTS(:,70) = strpad('k48 in component reaction_rates (second_order_rate_constant)');
LEGEND_CONSTANTS(:,71) = strpad('kd48 in component reaction_rates (first_order_rate_constant)');
LEGEND_CONSTANTS(:,72) = strpad('k49 in component reaction_rates (second_order_rate_constant)');
LEGEND_CONSTANTS(:,73) = strpad('kd49 in component reaction_rates (first_order_rate_constant)');
LEGEND_CONSTANTS(:,74) = strpad('k50 in component reaction_rates (second_order_rate_constant)');
LEGEND_CONSTANTS(:,75) = strpad('kd50 in component reaction_rates (first_order_rate_constant)');
LEGEND_CONSTANTS(:,76) = strpad('k52 in component reaction_rates (second_order_rate_constant)');
LEGEND_CONSTANTS(:,77) = strpad('kd44 in component reaction_rates (first_order_rate_constant)');
LEGEND_CONSTANTS(:,78) = strpad('k53 in component reaction_rates (second_order_rate_constant)');
LEGEND_CONSTANTS(:,79) = strpad('kd53 in component reaction_rates (first_order_rate_constant)');
LEGEND_CONSTANTS(:,80) = strpad('k55 in component reaction_rates (second_order_rate_constant)');
LEGEND_CONSTANTS(:,81) = strpad('kd55 in component reaction_rates (first_order_rate_constant)');
LEGEND_CONSTANTS(:,82) = strpad('k56 in component reaction_rates (second_order_rate_constant)');
LEGEND_CONSTANTS(:,83) = strpad('kd56 in component reaction_rates (first_order_rate_constant)');
LEGEND_CONSTANTS(:,84) = strpad('k57 in component reaction_rates (second_order_rate_constant)');
LEGEND_CONSTANTS(:,85) = strpad('kd57 in component reaction_rates (first_order_rate_constant)');
LEGEND_CONSTANTS(:,86) = strpad('k58 in component reaction_rates (second_order_rate_constant)');
LEGEND_CONSTANTS(:,87) = strpad('kd58 in component reaction_rates (first_order_rate_constant)');
LEGEND_CONSTANTS(:,88) = strpad('k60 in component reaction_rates (first_order_rate_constant)');
LEGEND_CONSTANTS(:,89) = strpad('kd60 in component reaction_rates (first_order_rate_constant)');
LEGEND_CONSTANTS(:,90) = strpad('k61 in component reaction_rates (first_order_rate_constant)');
LEGEND_CONSTANTS(:,91) = strpad('kd61 in component reaction_rates (first_order_rate_constant)');
LEGEND_CONSTANTS(:,92) = strpad('k126 in component reaction_rates (second_order_rate_constant)');
LEGEND_CONSTANTS(:,93) = strpad('kd126 in component reaction_rates (first_order_rate_constant)');
LEGEND_CONSTANTS(:,94) = strpad('k127 in component reaction_rates (second_order_rate_constant)');
LEGEND_CONSTANTS(:,95) = strpad('kd127 in component reaction_rates (first_order_rate_constant)');
LEGEND_RATES(:,1) = strpad('d/dt c1 in component c1 (molar)');
LEGEND_RATES(:,2) = strpad('d/dt c2 in component c2 (molar)');
LEGEND_RATES(:,3) = strpad('d/dt c3 in component c3 (molar)');
LEGEND_RATES(:,4) = strpad('d/dt c4 in component c4 (molar)');
LEGEND_RATES(:,5) = strpad('d/dt c5 in component c5 (molar)');
LEGEND_RATES(:,6) = strpad('d/dt c6 in component c6 (molar)');
LEGEND_RATES(:,7) = strpad('d/dt c7 in component c7 (molar)');
LEGEND_RATES(:,8) = strpad('d/dt c8 in component c8 (molar)');
LEGEND_RATES(:,9) = strpad('d/dt c9 in component c9 (molar)');
LEGEND_RATES(:,10) = strpad('d/dt c10 in component c10 (molar)');
LEGEND_RATES(:,11) = strpad('d/dt c11 in component c11 (molar)');
LEGEND_RATES(:,12) = strpad('d/dt c12 in component c12 (molar)');
LEGEND_RATES(:,13) = strpad('d/dt c13 in component c13 (molar)');
LEGEND_RATES(:,14) = strpad('d/dt c14 in component c14 (molar)');
LEGEND_RATES(:,15) = strpad('d/dt c15 in component c15 (molar)');
LEGEND_RATES(:,16) = strpad('d/dt c16 in component c16 (molar)');
LEGEND_RATES(:,17) = strpad('d/dt c17 in component c17 (molar)');
LEGEND_RATES(:,18) = strpad('d/dt c18 in component c18 (molar)');
LEGEND_RATES(:,19) = strpad('d/dt c19 in component c19 (molar)');
LEGEND_RATES(:,20) = strpad('d/dt c20 in component c20 (molar)');
LEGEND_RATES(:,21) = strpad('d/dt c21 in component c21 (molar)');
LEGEND_RATES(:,22) = strpad('d/dt c22 in component c22 (molar)');
LEGEND_RATES(:,23) = strpad('d/dt c23 in component c23 (molar)');
LEGEND_RATES(:,24) = strpad('d/dt c24 in component c24 (molar)');
LEGEND_RATES(:,25) = strpad('d/dt c25 in component c25 (molar)');
LEGEND_RATES(:,26) = strpad('d/dt c26 in component c26 (molar)');
LEGEND_RATES(:,27) = strpad('d/dt c27 in component c27 (molar)');
LEGEND_RATES(:,28) = strpad('d/dt c28 in component c28 (molar)');
LEGEND_RATES(:,29) = strpad('d/dt c29 in component c29 (molar)');
LEGEND_RATES(:,30) = strpad('d/dt c30 in component c30 (molar)');
LEGEND_RATES(:,31) = strpad('d/dt c31 in component c31 (molar)');
LEGEND_RATES(:,32) = strpad('d/dt c32 in component c32 (molar)');
LEGEND_RATES(:,33) = strpad('d/dt c33 in component c33 (molar)');
LEGEND_RATES(:,34) = strpad('d/dt c34 in component c34 (molar)');
LEGEND_RATES(:,35) = strpad('d/dt c35 in component c35 (molar)');
LEGEND_RATES(:,36) = strpad('d/dt c36 in component c36 (molar)');
LEGEND_RATES(:,37) = strpad('d/dt c37 in component c37 (molar)');
LEGEND_RATES(:,38) = strpad('d/dt c38 in component c38 (molar)');
LEGEND_RATES(:,39) = strpad('d/dt c39 in component c39 (molar)');
LEGEND_RATES(:,40) = strpad('d/dt c40 in component c40 (molar)');
LEGEND_RATES(:,41) = strpad('d/dt c41 in component c41 (molar)');
LEGEND_RATES(:,42) = strpad('d/dt c42 in component c42 (molar)');
LEGEND_RATES(:,43) = strpad('d/dt c43 in component c43 (molar)');
LEGEND_RATES(:,44) = strpad('d/dt c44 in component c44 (molar)');
LEGEND_RATES(:,45) = strpad('d/dt c45 in component c45 (molar)');
LEGEND_RATES(:,46) = strpad('d/dt c46 in component c46 (molar)');
LEGEND_RATES(:,47) = strpad('d/dt c47 in component c47 (molar)');
LEGEND_RATES(:,48) = strpad('d/dt c48 in component c48 (molar)');
LEGEND_RATES(:,49) = strpad('d/dt c49 in component c49 (molar)');
LEGEND_RATES(:,50) = strpad('d/dt c50 in component c50 (molar)');
LEGEND_RATES(:,51) = strpad('d/dt c51 in component c51 (molar)');
LEGEND_RATES(:,52) = strpad('d/dt c52 in component c52 (molar)');
LEGEND_RATES(:,53) = strpad('d/dt c53 in component c53 (molar)');
LEGEND_RATES(:,54) = strpad('d/dt c54 in component c54 (molar)');
LEGEND_RATES(:,55) = strpad('d/dt c55 in component c55 (molar)');
LEGEND_RATES(:,56) = strpad('d/dt c56 in component c56 (molar)');
LEGEND_RATES(:,57) = strpad('d/dt c57 in component c57 (molar)');
LEGEND_RATES(:,58) = strpad('d/dt c58 in component c58 (molar)');
LEGEND_RATES(:,59) = strpad('d/dt c59 in component c59 (molar)');
LEGEND_RATES(:,60) = strpad('d/dt c60 in component c60 (molar)');
LEGEND_RATES(:,61) = strpad('d/dt c61 in component c61 (molar)');
LEGEND_RATES(:,62) = strpad('d/dt c62 in component c62 (molar)');
LEGEND_RATES(:,63) = strpad('d/dt c63 in component c63 (molar)');
LEGEND_RATES(:,64) = strpad('d/dt c64 in component c64 (molar)');
LEGEND_RATES(:,65) = strpad('d/dt c65 in component c65 (molar)');
LEGEND_RATES(:,66) = strpad('d/dt c66 in component c66 (molar)');
LEGEND_RATES(:,67) = strpad('d/dt c67 in component c67 (molar)');
LEGEND_RATES(:,68) = strpad('d/dt c68 in component c68 (molar)');
LEGEND_RATES(:,69) = strpad('d/dt c69 in component c69 (molar)');
LEGEND_RATES(:,70) = strpad('d/dt c70 in component c70 (molar)');
LEGEND_RATES(:,71) = strpad('d/dt c71 in component c71 (molar)');
LEGEND_RATES(:,72) = strpad('d/dt c72 in component c72 (molar)');
LEGEND_RATES(:,73) = strpad('d/dt c73 in component c73 (molar)');
LEGEND_RATES(:,74) = strpad('d/dt c74 in component c74 (molar)');
LEGEND_RATES(:,75) = strpad('d/dt c75 in component c75 (molar)');
LEGEND_RATES(:,76) = strpad('d/dt c76 in component c76 (molar)');
LEGEND_RATES(:,77) = strpad('d/dt c77 in component c77 (molar)');
LEGEND_RATES(:,78) = strpad('d/dt c78 in component c78 (molar)');
LEGEND_RATES(:,79) = strpad('d/dt c79 in component c79 (molar)');
LEGEND_RATES(:,80) = strpad('d/dt c80 in component c80 (molar)');
LEGEND_RATES(:,81) = strpad('d/dt c81 in component c81 (molar)');
LEGEND_RATES(:,82) = strpad('d/dt c82 in component c82 (molar)');
LEGEND_RATES(:,83) = strpad('d/dt c83 in component c83 (molar)');
LEGEND_RATES(:,84) = strpad('d/dt c84 in component c84 (molar)');
LEGEND_RATES(:,85) = strpad('d/dt c85 in component c85 (molar)');
LEGEND_RATES(:,86) = strpad('d/dt c86 in component c86 (molar)');
LEGEND_RATES(:,87) = strpad('d/dt c87 in component c87 (molar)');
LEGEND_RATES(:,88) = strpad('d/dt c88 in component c88 (molar)');
LEGEND_RATES(:,89) = strpad('d/dt c89 in component c89 (molar)');
LEGEND_RATES(:,90) = strpad('d/dt c90 in component c90 (molar)');
LEGEND_RATES(:,91) = strpad('d/dt c91 in component c91 (molar)');
LEGEND_RATES(:,92) = strpad('d/dt c92 in component c92 (molar)');
LEGEND_RATES(:,93) = strpad('d/dt c93 in component c93 (molar)');
LEGEND_RATES(:,94) = strpad('d/dt c94 in component c94 (molar)');
LEGEND_RATES(:,95) = strpad('d/dt c95 in component c95 (molar)');
LEGEND_RATES(:,96) = strpad('d/dt c96 in component c96 (molar)');
LEGEND_RATES(:,97) = strpad('d/dt c97 in component c97 (molar)');
LEGEND_RATES(:,98) = strpad('d/dt c98 in component c98 (molar)');
LEGEND_RATES(:,99) = strpad('d/dt c99 in component c99 (molar)');
LEGEND_RATES(:,100) = strpad('d/dt c100 in component c100 (molar)');
LEGEND_RATES(:,101) = strpad('d/dt c101 in component c101 (molar)');
LEGEND_RATES(:,102) = strpad('d/dt c102 in component c102 (molar)');
LEGEND_RATES(:,103) = strpad('d/dt c103 in component c103 (molar)');
LEGEND_STATES  = LEGEND_STATES';
LEGEND_ALGEBRAIC = LEGEND_ALGEBRAIC';
LEGEND_RATES = LEGEND_RATES';
LEGEND_CONSTANTS = LEGEND_CONSTANTS';
end

function [STATES, CONSTANTS] = initConsts()
VOI = 0; CONSTANTS = []; STATES = []; ALGEBRAIC = [];
STATES(:,1) = 5.0E-8;
STATES(:,2) = 5.0E4;
STATES(:,3) = 0.0;
STATES(:,4) = 0.0;
STATES(:,5) = 0.0;
STATES(:,6) = 0.0;
STATES(:,7) = 0.0;
STATES(:,8) = 0.0;
STATES(:,9) = 0.0;
STATES(:,10) = 0.0;
STATES(:,11) = 0.0;
STATES(:,12) = 8.1E4;
STATES(:,13) = 0.0;
STATES(:,14) = 1.2E4;
STATES(:,15) = 0.0;
STATES(:,16) = 0.0;
STATES(:,17) = 0.0;
STATES(:,18) = 0.0;
STATES(:,19) = 0.0;
STATES(:,20) = 0.0;
STATES(:,21) = 0.0;
STATES(:,22) = 1.1E4;
STATES(:,23) = 0.0;
STATES(:,24) = 2.63E4;
STATES(:,25) = 0.0;
STATES(:,26) = 7.2E4;
STATES(:,27) = 0.0;
STATES(:,28) = 0.0;
STATES(:,29) = 0.0;
STATES(:,30) = 4.0E4;
STATES(:,31) = 1.01E5;
STATES(:,32) = 0.0;
STATES(:,33) = 0.0;
STATES(:,34) = 0.0;
STATES(:,35) = 0.0;
STATES(:,36) = 0.0;
STATES(:,37) = 0.0;
STATES(:,38) = 0.0;
STATES(:,39) = 0.0;
STATES(:,40) = 0.0;
STATES(:,41) = 4.0E4;
STATES(:,42) = 0.0;
STATES(:,43) = 0.0;
STATES(:,44) = 4.0E4;
STATES(:,45) = 0.0;
STATES(:,46) = 0.0;
STATES(:,47) = 2.1E7;
STATES(:,48) = 0.0;
STATES(:,49) = 0.0;
STATES(:,50) = 0.0;
STATES(:,51) = 0.0;
STATES(:,52) = 0.0;
STATES(:,53) = 4.0E4;
STATES(:,54) = 0.0;
STATES(:,55) = 2.21E7;
STATES(:,56) = 0.0;
STATES(:,57) = 0.0;
STATES(:,58) = 0.0;
STATES(:,59) = 0.0;
STATES(:,60) = 1.0E7;
STATES(:,61) = 0.0;
STATES(:,62) = 0.0;
STATES(:,63) = 0.0;
STATES(:,64) = 0.0;
STATES(:,65) = 0.0;
STATES(:,66) = 0.0;
STATES(:,67) = 0.0;
STATES(:,68) = 0.0;
STATES(:,69) = 0.0;
STATES(:,70) = 0.0;
STATES(:,71) = 0.0;
STATES(:,72) = 0.0;
STATES(:,73) = 0.0;
STATES(:,74) = 0.0;
STATES(:,75) = 0.0;
STATES(:,76) = 0.0;
STATES(:,77) = 0.0;
STATES(:,78) = 0.0;
STATES(:,79) = 0.0;
STATES(:,80) = 0.0;
STATES(:,81) = 0.0;
STATES(:,82) = 0.0;
STATES(:,83) = 0.0;
STATES(:,84) = 0.0;
STATES(:,85) = 0.0;
STATES(:,86) = 0.0;
STATES(:,87) = 0.0;
STATES(:,88) = 0.0;
STATES(:,89) = 0.0;
STATES(:,90) = 0.0;
STATES(:,91) = 0.0;
STATES(:,92) = 0.0;
STATES(:,93) = 0.0;
STATES(:,94) = 0.0;
STATES(:,95) = 0.0;
STATES(:,96) = 0.0;
STATES(:,97) = 0.0;
STATES(:,98) = 0.0;
STATES(:,99) = 0.0;
STATES(:,100) = 0.0;
STATES(:,101) = 0.0;
STATES(:,102) = 0.0;
STATES(:,103) = 0.0;
CONSTANTS(:,1) = 3.0E7;
CONSTANTS(:,2) = 3.84E-3;
CONSTANTS(:,3) = 1.66E-5;
CONSTANTS(:,4) = 1E-1;
CONSTANTS(:,5) = 1E0;
CONSTANTS(:,6) = 1E-2;
CONSTANTS(:,7) = 1.73E-7;
CONSTANTS(:,8) = 1.66E-3;
CONSTANTS(:,9) = 0E0;
CONSTANTS(:,10) = 1.46E-2;
CONSTANTS(:,11) = 5E-4;
CONSTANTS(:,12) = 5E-3;
CONSTANTS(:,13) = 1.66E-6;
CONSTANTS(:,14) = 2E-1;
CONSTANTS(:,15) = 5.43E-2;
CONSTANTS(:,16) = 1.1E-2;
CONSTANTS(:,17) = 2.17E0;
CONSTANTS(:,18) = 0E0;
CONSTANTS(:,19) = 1E4;
CONSTANTS(:,20) = 0E0;
CONSTANTS(:,21) = 1.66E-5;
CONSTANTS(:,22) = 2.75E-1;
CONSTANTS(:,23) = 1.66E-5;
CONSTANTS(:,24) = 6E-2;
CONSTANTS(:,25) = 2.5E-5;
CONSTANTS(:,26) = 1.3E0;
CONSTANTS(:,27) = 1.66E-7;
CONSTANTS(:,28) = 5E-1;
CONSTANTS(:,29) = 3.5E-6;
CONSTANTS(:,30) = 4E-1;
CONSTANTS(:,31) = 3.66E-7;
CONSTANTS(:,32) = 2.3E-2;
CONSTANTS(:,33) = 3.5E-5;
CONSTANTS(:,34) = 1E-1;
CONSTANTS(:,35) = 6E0;
CONSTANTS(:,36) = 6E-2;
CONSTANTS(:,37) = 5.5E-1;
CONSTANTS(:,38) = 1.66E-5;
CONSTANTS(:,39) = 2.14E-2;
CONSTANTS(:,40) = 1.66E-6;
CONSTANTS(:,41) = 5.3E-3;
CONSTANTS(:,42) = 1.17E-6;
CONSTANTS(:,43) = 1E0;
CONSTANTS(:,44) = 4E-7;
CONSTANTS(:,45) = 1E-1;
CONSTANTS(:,46) = 3.5E-5;
CONSTANTS(:,47) = 2E-1;
CONSTANTS(:,48) = 7.5E-6;
CONSTANTS(:,49) = 3E-2;
CONSTANTS(:,50) = 7.5E-6;
CONSTANTS(:,51) = 1.5E-3;
CONSTANTS(:,52) = 5E-3;
CONSTANTS(:,53) = 0E0;
CONSTANTS(:,54) = 1.5E-6;
CONSTANTS(:,55) = 3E-1;
CONSTANTS(:,56) = 5E-5;
CONSTANTS(:,57) = 6.4E-2;
CONSTANTS(:,58) = 5E-5;
CONSTANTS(:,59) = 4.29E-2;
CONSTANTS(:,60) = 1.18E-4;
CONSTANTS(:,61) = 2E-1;
CONSTANTS(:,62) = 0E0;
CONSTANTS(:,63) = 1E0;
CONSTANTS(:,64) = 1.95E-5;
CONSTANTS(:,65) = 3.3E-2;
CONSTANTS(:,66) = 0E0;
CONSTANTS(:,67) = 3.5E0;
CONSTANTS(:,68) = 0E0;
CONSTANTS(:,69) = 2.9E0;
CONSTANTS(:,70) = 2.38E-5;
CONSTANTS(:,71) = 8E-1;
CONSTANTS(:,72) = 0E0;
CONSTANTS(:,73) = 5.68E-2;
CONSTANTS(:,74) = 4.5E-7;
CONSTANTS(:,75) = 5E-1;
CONSTANTS(:,76) = 8.91E-5;
CONSTANTS(:,77) = 1.83E-2;
CONSTANTS(:,78) = 0E0;
CONSTANTS(:,79) = 1.6E1;
CONSTANTS(:,80) = 0E0;
CONSTANTS(:,81) = 5.7E0;
CONSTANTS(:,82) = 2.35E-5;
CONSTANTS(:,83) = 6E-1;
CONSTANTS(:,84) = 0E0;
CONSTANTS(:,85) = 2.46E-1;
CONSTANTS(:,86) = 8.33E-6;
CONSTANTS(:,87) = 5E-1;
CONSTANTS(:,88) = 5.5E-3;
CONSTANTS(:,89) = 0E0;
CONSTANTS(:,90) = 6.7E-4;
CONSTANTS(:,91) = 0E0;
CONSTANTS(:,92) = 1.66E-7;
CONSTANTS(:,93) = 2E0;
CONSTANTS(:,94) = 0E0;
CONSTANTS(:,95) = 1E-4;
CONSTANTS(:,95) = 0.00000;
if (isempty(STATES)), warning('Initial values for states not set');, end
end

function [RATES, ALGEBRAIC] = computeRates(VOI, STATES, CONSTANTS)
global algebraicVariableCount;
statesSize = size(STATES);
statesColumnCount = statesSize(2);
if ( statesColumnCount == 1)
STATES = STATES';
ALGEBRAIC = zeros(1, algebraicVariableCount);
utilOnes = 1;
else
statesRowCount = statesSize(1);
ALGEBRAIC = zeros(statesRowCount, algebraicVariableCount);
RATES = zeros(statesRowCount, statesColumnCount);
utilOnes = ones(statesRowCount, 1);
end
RATES(:,1) = CONSTANTS(:,95);
ALGEBRAIC(:,1) =  CONSTANTS(:,1).*STATES(:,1).*STATES(:,2) -  CONSTANTS(:,2).*STATES(:,3);
ALGEBRAIC(:,2) =  CONSTANTS(:,3).*STATES(:,3).*STATES(:,3) -  CONSTANTS(:,4).*STATES(:,4);
RATES(:,3) = ALGEBRAIC(:,1) -  2.00000.*ALGEBRAIC(:,2);
ALGEBRAIC(:,3) =  CONSTANTS(:,5).*STATES(:,4).*1.00000 -  CONSTANTS(:,6).*STATES(:,5);
RATES(:,4) = ALGEBRAIC(:,2) - ALGEBRAIC(:,3);
ALGEBRAIC(:,4) =  CONSTANTS(:,7).*STATES(:,23).*STATES(:,12) -  CONSTANTS(:,8).*STATES(:,7);
ALGEBRAIC(:,5) =  CONSTANTS(:,9).*STATES(:,18).*STATES(:,9) -  CONSTANTS(:,10).*STATES(:,7);
RATES(:,7) = ALGEBRAIC(:,4)+ALGEBRAIC(:,5);
ALGEBRAIC(:,6) =  CONSTANTS(:,11).*STATES(:,2) -  CONSTANTS(:,12).*STATES(:,6);
ALGEBRAIC(:,7) =  CONSTANTS(:,17).*1.00000 -  CONSTANTS(:,18).*STATES(:,2);
RATES(:,2) = ALGEBRAIC(:,7) - (ALGEBRAIC(:,1)+ALGEBRAIC(:,6));
ALGEBRAIC(:,8) =  CONSTANTS(:,11).*STATES(:,5) -  CONSTANTS(:,12).*STATES(:,8);
ALGEBRAIC(:,9) =  CONSTANTS(:,13).*STATES(:,5).*STATES(:,14) -  CONSTANTS(:,14).*STATES(:,15);
RATES(:,5) = ALGEBRAIC(:,3) - (ALGEBRAIC(:,8)+ALGEBRAIC(:,9));
ALGEBRAIC(:,11) =  CONSTANTS(:,15).*STATES(:,6).*STATES(:,16) -  CONSTANTS(:,16).*STATES(:,10);
ALGEBRAIC(:,12) =  CONSTANTS(:,88).*STATES(:,6) -  CONSTANTS(:,89).*STATES(:,86);
RATES(:,6) = ALGEBRAIC(:,6) - (ALGEBRAIC(:,11)+ALGEBRAIC(:,12));
ALGEBRAIC(:,13) =  CONSTANTS(:,3).*STATES(:,10).*STATES(:,10) -  CONSTANTS(:,4).*STATES(:,11);
RATES(:,10) = ALGEBRAIC(:,11) -  2.00000.*ALGEBRAIC(:,13);
ALGEBRAIC(:,14) =  CONSTANTS(:,90).*STATES(:,16) -  CONSTANTS(:,91).*STATES(:,13);
RATES(:,13) = ALGEBRAIC(:,14);
RATES(:,16) =  - (ALGEBRAIC(:,11)+ALGEBRAIC(:,14));
RATES(:,86) = ALGEBRAIC(:,12);
ALGEBRAIC(:,15) =  CONSTANTS(:,5).*STATES(:,11) -  CONSTANTS(:,6).*STATES(:,8);
RATES(:,11) = ALGEBRAIC(:,13) - ALGEBRAIC(:,15);
ALGEBRAIC(:,16) =  CONSTANTS(:,13).*STATES(:,8).*STATES(:,14) -  CONSTANTS(:,14).*STATES(:,17);
RATES(:,14) =  - (ALGEBRAIC(:,9)+ALGEBRAIC(:,16));
ALGEBRAIC(:,18) =  CONSTANTS(:,21).*STATES(:,22).*STATES(:,15) -  CONSTANTS(:,22).*STATES(:,23);
ALGEBRAIC(:,10) =  CONSTANTS(:,11).*STATES(:,23) -  CONSTANTS(:,12).*STATES(:,18);
ALGEBRAIC(:,19) =  CONSTANTS(:,23).*STATES(:,24).*STATES(:,23) -  CONSTANTS(:,24).*STATES(:,25);
RATES(:,23) = ALGEBRAIC(:,18) - (ALGEBRAIC(:,4)+ALGEBRAIC(:,10)+ALGEBRAIC(:,19));
ALGEBRAIC(:,21) =  CONSTANTS(:,27).*STATES(:,28).*STATES(:,25) -  CONSTANTS(:,28).*STATES(:,27);
ALGEBRAIC(:,29) =  CONSTANTS(:,27).*STATES(:,35).*STATES(:,28) -  CONSTANTS(:,28).*STATES(:,36);
ALGEBRAIC(:,30) =  CONSTANTS(:,40).*STATES(:,28).*STATES(:,41) -  CONSTANTS(:,41).*STATES(:,42);
RATES(:,28) =  - (ALGEBRAIC(:,21)+ALGEBRAIC(:,29)+ALGEBRAIC(:,30));
ALGEBRAIC(:,31) =  CONSTANTS(:,42).*STATES(:,43).*STATES(:,45) -  CONSTANTS(:,43).*STATES(:,42);
RATES(:,42) = ALGEBRAIC(:,30)+ALGEBRAIC(:,31);
ALGEBRAIC(:,22) =  CONSTANTS(:,29).*STATES(:,25).*STATES(:,43) -  CONSTANTS(:,30).*STATES(:,29);
ALGEBRAIC(:,32) =  CONSTANTS(:,29).*STATES(:,35).*STATES(:,43) -  CONSTANTS(:,30).*STATES(:,37);
RATES(:,43) =  - (ALGEBRAIC(:,31)+ALGEBRAIC(:,22)+ALGEBRAIC(:,32));
ALGEBRAIC(:,45) =  CONSTANTS(:,62).*STATES(:,41).*STATES(:,44) -  CONSTANTS(:,63).*STATES(:,46);
ALGEBRAIC(:,44) =  CONSTANTS(:,60).*STATES(:,44).*STATES(:,45) -  CONSTANTS(:,61).*STATES(:,46);
RATES(:,46) = ALGEBRAIC(:,44)+ALGEBRAIC(:,45);
ALGEBRAIC(:,46) =  CONSTANTS(:,64).*STATES(:,47).*STATES(:,45) -  CONSTANTS(:,65).*STATES(:,48);
ALGEBRAIC(:,47) =  CONSTANTS(:,66).*STATES(:,49).*STATES(:,45) -  CONSTANTS(:,67).*STATES(:,48);
RATES(:,48) = ALGEBRAIC(:,46)+ALGEBRAIC(:,47);
ALGEBRAIC(:,48) =  CONSTANTS(:,64).*STATES(:,49).*STATES(:,45) -  CONSTANTS(:,65).*STATES(:,50);
ALGEBRAIC(:,49) =  CONSTANTS(:,68).*STATES(:,51).*STATES(:,45) -  CONSTANTS(:,69).*STATES(:,50);
RATES(:,45) =  - (ALGEBRAIC(:,31)+ALGEBRAIC(:,44)+ALGEBRAIC(:,46)+ALGEBRAIC(:,47)+ALGEBRAIC(:,48)+ALGEBRAIC(:,49));
RATES(:,50) = ALGEBRAIC(:,48)+ALGEBRAIC(:,49);
ALGEBRAIC(:,51) =  CONSTANTS(:,72).*STATES(:,49).*STATES(:,53) -  CONSTANTS(:,73).*STATES(:,52);
ALGEBRAIC(:,50) =  CONSTANTS(:,70).*STATES(:,51).*STATES(:,53) -  CONSTANTS(:,71).*STATES(:,52);
RATES(:,52) = ALGEBRAIC(:,50)+ALGEBRAIC(:,51);
ALGEBRAIC(:,52) =  CONSTANTS(:,74).*STATES(:,53).*STATES(:,49) -  CONSTANTS(:,75).*STATES(:,54);
RATES(:,49) =  - (ALGEBRAIC(:,47)+ALGEBRAIC(:,48)+ALGEBRAIC(:,51)+ALGEBRAIC(:,52));
ALGEBRAIC(:,53) =  CONSTANTS(:,72).*STATES(:,47).*STATES(:,53) -  CONSTANTS(:,73).*STATES(:,54);
RATES(:,54) = ALGEBRAIC(:,52)+ALGEBRAIC(:,53);
ALGEBRAIC(:,54) =  CONSTANTS(:,76).*STATES(:,55).*STATES(:,51) -  CONSTANTS(:,77).*STATES(:,56);
ALGEBRAIC(:,55) =  CONSTANTS(:,78).*STATES(:,51).*STATES(:,57) -  CONSTANTS(:,79).*STATES(:,56);
RATES(:,56) = ALGEBRAIC(:,54)+ALGEBRAIC(:,55);
ALGEBRAIC(:,56) =  CONSTANTS(:,76).*STATES(:,51).*STATES(:,57) -  CONSTANTS(:,77).*STATES(:,58);
ALGEBRAIC(:,57) =  CONSTANTS(:,80).*STATES(:,59).*STATES(:,51) -  CONSTANTS(:,81).*STATES(:,58);
RATES(:,51) =  - (ALGEBRAIC(:,49)+ALGEBRAIC(:,55)+ALGEBRAIC(:,57)+ALGEBRAIC(:,50)+ALGEBRAIC(:,54)+ALGEBRAIC(:,56));
RATES(:,58) = ALGEBRAIC(:,56)+ALGEBRAIC(:,57);
ALGEBRAIC(:,59) =  CONSTANTS(:,84).*STATES(:,57).*STATES(:,60) -  CONSTANTS(:,85).*STATES(:,61);
ALGEBRAIC(:,58) =  CONSTANTS(:,82).*STATES(:,59).*STATES(:,60) -  CONSTANTS(:,83).*STATES(:,61);
RATES(:,61) = ALGEBRAIC(:,58)+ALGEBRAIC(:,59);
ALGEBRAIC(:,60) =  CONSTANTS(:,86).*STATES(:,60).*STATES(:,57) -  CONSTANTS(:,87).*STATES(:,62);
RATES(:,57) =  - (ALGEBRAIC(:,55)+ALGEBRAIC(:,56)+ALGEBRAIC(:,59)+ALGEBRAIC(:,60));
ALGEBRAIC(:,61) =  CONSTANTS(:,84).*STATES(:,55).*STATES(:,60) -  CONSTANTS(:,85).*STATES(:,62);
RATES(:,62) = ALGEBRAIC(:,60)+ALGEBRAIC(:,61);
ALGEBRAIC(:,62) =  CONSTANTS(:,88).*STATES(:,8) -  CONSTANTS(:,89).*STATES(:,87);
RATES(:,8) = (ALGEBRAIC(:,8)+ALGEBRAIC(:,15)) - (ALGEBRAIC(:,16)+ALGEBRAIC(:,62));
ALGEBRAIC(:,24) =  CONSTANTS(:,33).*STATES(:,31).*STATES(:,15) -  CONSTANTS(:,34).*STATES(:,32);
ALGEBRAIC(:,69) =  CONSTANTS(:,33).*STATES(:,31).*STATES(:,17) -  CONSTANTS(:,34).*STATES(:,63);
ALGEBRAIC(:,38) =  CONSTANTS(:,52).*STATES(:,40) -  CONSTANTS(:,53).*STATES(:,31);
RATES(:,31) = ALGEBRAIC(:,38) - (ALGEBRAIC(:,24)+ALGEBRAIC(:,69));
ALGEBRAIC(:,63) =  CONSTANTS(:,21).*STATES(:,17).*STATES(:,22) -  CONSTANTS(:,22).*STATES(:,18);
ALGEBRAIC(:,26) =  CONSTANTS(:,21).*STATES(:,22).*STATES(:,33) -  CONSTANTS(:,37).*STATES(:,34);
ALGEBRAIC(:,37) =  CONSTANTS(:,50).*STATES(:,24).*STATES(:,22) -  CONSTANTS(:,51).*STATES(:,30);
ALGEBRAIC(:,40) =  CONSTANTS(:,21).*STATES(:,22).*STATES(:,40) -  CONSTANTS(:,37).*STATES(:,39);
ALGEBRAIC(:,71) =  CONSTANTS(:,21).*STATES(:,22).*STATES(:,64) -  CONSTANTS(:,37).*STATES(:,65);
RATES(:,22) =  - (ALGEBRAIC(:,18)+ALGEBRAIC(:,26)+ALGEBRAIC(:,37)+ALGEBRAIC(:,40)+ALGEBRAIC(:,63)+ALGEBRAIC(:,71));
ALGEBRAIC(:,66) =  CONSTANTS(:,27).*STATES(:,69).*STATES(:,19) -  CONSTANTS(:,28).*STATES(:,20);
ALGEBRAIC(:,75) =  CONSTANTS(:,40).*STATES(:,69).*STATES(:,41) -  CONSTANTS(:,41).*STATES(:,70);
ALGEBRAIC(:,74) =  CONSTANTS(:,27).*STATES(:,66).*STATES(:,69) -  CONSTANTS(:,28).*STATES(:,67);
RATES(:,69) =  - (ALGEBRAIC(:,66)+ALGEBRAIC(:,74)+ALGEBRAIC(:,75));
ALGEBRAIC(:,76) =  CONSTANTS(:,42).*STATES(:,71).*STATES(:,72) -  CONSTANTS(:,43).*STATES(:,70);
RATES(:,70) = ALGEBRAIC(:,75)+ALGEBRAIC(:,76);
ALGEBRAIC(:,67) =  CONSTANTS(:,29).*STATES(:,71).*STATES(:,19) -  CONSTANTS(:,30).*STATES(:,21);
ALGEBRAIC(:,77) =  CONSTANTS(:,29).*STATES(:,71).*STATES(:,66) -  CONSTANTS(:,30).*STATES(:,68);
RATES(:,71) =  - (ALGEBRAIC(:,67)+ALGEBRAIC(:,76)+ALGEBRAIC(:,77));
ALGEBRAIC(:,65) =  CONSTANTS(:,25).*STATES(:,26).*STATES(:,19) -  CONSTANTS(:,26).*STATES(:,20);
ALGEBRAIC(:,68) =  CONSTANTS(:,31).*STATES(:,19).*STATES(:,26) -  CONSTANTS(:,32).*STATES(:,21);
ALGEBRAIC(:,20) =  CONSTANTS(:,25).*STATES(:,26).*STATES(:,25) -  CONSTANTS(:,26).*STATES(:,27);
ALGEBRAIC(:,23) =  CONSTANTS(:,31).*STATES(:,25).*STATES(:,26) -  CONSTANTS(:,32).*STATES(:,29);
ALGEBRAIC(:,28) =  CONSTANTS(:,25).*STATES(:,26).*STATES(:,35) -  CONSTANTS(:,26).*STATES(:,36);
ALGEBRAIC(:,33) =  CONSTANTS(:,31).*STATES(:,35).*STATES(:,26) -  CONSTANTS(:,32).*STATES(:,37);
ALGEBRAIC(:,78) =  CONSTANTS(:,31).*STATES(:,66).*STATES(:,26) -  CONSTANTS(:,32).*STATES(:,68);
ALGEBRAIC(:,73) =  CONSTANTS(:,25).*STATES(:,26).*STATES(:,66) -  CONSTANTS(:,26).*STATES(:,67);
RATES(:,26) =  - (ALGEBRAIC(:,20)+ALGEBRAIC(:,23)+ALGEBRAIC(:,28)+ALGEBRAIC(:,33)+ALGEBRAIC(:,65)+ALGEBRAIC(:,68)+ALGEBRAIC(:,73)+ALGEBRAIC(:,78));
ALGEBRAIC(:,34) =  CONSTANTS(:,44).*STATES(:,38).*STATES(:,15) -  CONSTANTS(:,45).*STATES(:,35);
ALGEBRAIC(:,79) =  CONSTANTS(:,44).*STATES(:,17).*STATES(:,38) -  CONSTANTS(:,45).*STATES(:,66);
ALGEBRAIC(:,42) =  CONSTANTS(:,56).*STATES(:,24).*STATES(:,39) -  CONSTANTS(:,57).*STATES(:,38);
ALGEBRAIC(:,35) =  CONSTANTS(:,46).*STATES(:,40).*STATES(:,30) -  CONSTANTS(:,47).*STATES(:,38);
RATES(:,38) = (ALGEBRAIC(:,35)+ALGEBRAIC(:,42)) - (ALGEBRAIC(:,34)+ALGEBRAIC(:,79));
ALGEBRAIC(:,39) =  CONSTANTS(:,54).*STATES(:,15).*STATES(:,40) -  CONSTANTS(:,55).*STATES(:,33);
ALGEBRAIC(:,81) =  CONSTANTS(:,54).*STATES(:,17).*STATES(:,40) -  CONSTANTS(:,55).*STATES(:,64);
RATES(:,40) =  - (ALGEBRAIC(:,35)+ALGEBRAIC(:,38)+ALGEBRAIC(:,39)+ALGEBRAIC(:,40)+ALGEBRAIC(:,81));
ALGEBRAIC(:,41) =  CONSTANTS(:,54).*STATES(:,15).*STATES(:,39) -  CONSTANTS(:,55).*STATES(:,34);
ALGEBRAIC(:,82) =  CONSTANTS(:,54).*STATES(:,17).*STATES(:,39) -  CONSTANTS(:,55).*STATES(:,65);
RATES(:,39) = ALGEBRAIC(:,40) - (ALGEBRAIC(:,41)+ALGEBRAIC(:,42)+ALGEBRAIC(:,82));
ALGEBRAIC(:,36) =  CONSTANTS(:,48).*STATES(:,15).*STATES(:,30) -  CONSTANTS(:,49).*STATES(:,25);
ALGEBRAIC(:,80) =  CONSTANTS(:,48).*STATES(:,17).*STATES(:,30) -  CONSTANTS(:,49).*STATES(:,19);
ALGEBRAIC(:,43) =  CONSTANTS(:,58).*STATES(:,30).*STATES(:,33) -  CONSTANTS(:,59).*STATES(:,35);
ALGEBRAIC(:,83) =  CONSTANTS(:,58).*STATES(:,30).*STATES(:,64) -  CONSTANTS(:,59).*STATES(:,66);
RATES(:,30) = ALGEBRAIC(:,37) - (ALGEBRAIC(:,35)+ALGEBRAIC(:,36)+ALGEBRAIC(:,43)+ALGEBRAIC(:,80)+ALGEBRAIC(:,83));
ALGEBRAIC(:,85) =  CONSTANTS(:,62).*STATES(:,41).*STATES(:,44) -  CONSTANTS(:,63).*STATES(:,73);
RATES(:,41) =  - (ALGEBRAIC(:,30)+ALGEBRAIC(:,45)+ALGEBRAIC(:,75)+ALGEBRAIC(:,85));
ALGEBRAIC(:,84) =  CONSTANTS(:,60).*STATES(:,44).*STATES(:,72) -  CONSTANTS(:,61).*STATES(:,73);
RATES(:,44) =  - (ALGEBRAIC(:,44)+ALGEBRAIC(:,45)+ALGEBRAIC(:,84)+ALGEBRAIC(:,85));
RATES(:,73) = ALGEBRAIC(:,84)+ALGEBRAIC(:,85);
ALGEBRAIC(:,86) =  CONSTANTS(:,64).*STATES(:,47).*STATES(:,72) -  CONSTANTS(:,65).*STATES(:,74);
ALGEBRAIC(:,87) =  CONSTANTS(:,66).*STATES(:,75).*STATES(:,72) -  CONSTANTS(:,67).*STATES(:,74);
RATES(:,74) = ALGEBRAIC(:,86)+ALGEBRAIC(:,87);
ALGEBRAIC(:,88) =  CONSTANTS(:,64).*STATES(:,72).*STATES(:,75) -  CONSTANTS(:,65).*STATES(:,76);
ALGEBRAIC(:,89) =  CONSTANTS(:,68).*STATES(:,72).*STATES(:,77) -  CONSTANTS(:,69).*STATES(:,76);
RATES(:,72) =  - (ALGEBRAIC(:,76)+ALGEBRAIC(:,84)+ALGEBRAIC(:,86)+ALGEBRAIC(:,87)+ALGEBRAIC(:,88)+ALGEBRAIC(:,89));
RATES(:,76) = ALGEBRAIC(:,88)+ALGEBRAIC(:,89);
ALGEBRAIC(:,90) =  CONSTANTS(:,70).*STATES(:,77).*STATES(:,53) -  CONSTANTS(:,71).*STATES(:,78);
ALGEBRAIC(:,92) =  CONSTANTS(:,72).*STATES(:,75).*STATES(:,53) -  CONSTANTS(:,73).*STATES(:,78);
RATES(:,78) = ALGEBRAIC(:,90)+ALGEBRAIC(:,92);
ALGEBRAIC(:,94) =  CONSTANTS(:,74).*STATES(:,53).*STATES(:,75) -  CONSTANTS(:,75).*STATES(:,79);
RATES(:,75) =  - (ALGEBRAIC(:,87)+ALGEBRAIC(:,88)+ALGEBRAIC(:,92)+ALGEBRAIC(:,94));
ALGEBRAIC(:,91) =  CONSTANTS(:,76).*STATES(:,55).*STATES(:,77) -  CONSTANTS(:,77).*STATES(:,80);
ALGEBRAIC(:,93) =  CONSTANTS(:,78).*STATES(:,81).*STATES(:,77) -  CONSTANTS(:,79).*STATES(:,80);
RATES(:,80) = ALGEBRAIC(:,91)+ALGEBRAIC(:,93);
ALGEBRAIC(:,96) =  CONSTANTS(:,72).*STATES(:,47).*STATES(:,53) -  CONSTANTS(:,73).*STATES(:,79);
RATES(:,47) =  - (ALGEBRAIC(:,46)+ALGEBRAIC(:,53)+ALGEBRAIC(:,86)+ALGEBRAIC(:,96));
RATES(:,53) =  - (ALGEBRAIC(:,50)+ALGEBRAIC(:,51)+ALGEBRAIC(:,52)+ALGEBRAIC(:,53)+ALGEBRAIC(:,90)+ALGEBRAIC(:,92)+ALGEBRAIC(:,94)+ALGEBRAIC(:,96));
RATES(:,79) = ALGEBRAIC(:,94)+ALGEBRAIC(:,96);
ALGEBRAIC(:,95) =  CONSTANTS(:,76).*STATES(:,77).*STATES(:,81) -  CONSTANTS(:,77).*STATES(:,82);
ALGEBRAIC(:,97) =  CONSTANTS(:,80).*STATES(:,83).*STATES(:,77) -  CONSTANTS(:,81).*STATES(:,82);
RATES(:,77) =  - (ALGEBRAIC(:,89)+ALGEBRAIC(:,90)+ALGEBRAIC(:,91)+ALGEBRAIC(:,93)+ALGEBRAIC(:,95)+ALGEBRAIC(:,97));
RATES(:,82) = ALGEBRAIC(:,95)+ALGEBRAIC(:,97);
ALGEBRAIC(:,99) =  CONSTANTS(:,11).*STATES(:,15) -  CONSTANTS(:,12).*STATES(:,17);
RATES(:,15) = ALGEBRAIC(:,9) - (ALGEBRAIC(:,18)+ALGEBRAIC(:,24)+ALGEBRAIC(:,34)+ALGEBRAIC(:,36)+ALGEBRAIC(:,39)+ALGEBRAIC(:,41)+ALGEBRAIC(:,99));
ALGEBRAIC(:,98) =  CONSTANTS(:,82).*STATES(:,83).*STATES(:,60) -  CONSTANTS(:,83).*STATES(:,84);
ALGEBRAIC(:,100) =  CONSTANTS(:,84).*STATES(:,81).*STATES(:,60) -  CONSTANTS(:,85).*STATES(:,84);
RATES(:,84) = ALGEBRAIC(:,98)+ALGEBRAIC(:,100);
ALGEBRAIC(:,25) =  CONSTANTS(:,35).*STATES(:,32) -  CONSTANTS(:,36).*STATES(:,33);
ALGEBRAIC(:,101) =  CONSTANTS(:,11).*STATES(:,32) -  CONSTANTS(:,12).*STATES(:,63);
RATES(:,32) = ALGEBRAIC(:,24) - (ALGEBRAIC(:,25)+ALGEBRAIC(:,101));
ALGEBRAIC(:,102) =  CONSTANTS(:,86).*STATES(:,60).*STATES(:,81) -  CONSTANTS(:,87).*STATES(:,85);
RATES(:,81) =  - (ALGEBRAIC(:,93)+ALGEBRAIC(:,95)+ALGEBRAIC(:,100)+ALGEBRAIC(:,102));
ALGEBRAIC(:,103) =  CONSTANTS(:,11).*STATES(:,33) -  CONSTANTS(:,12).*STATES(:,64);
RATES(:,33) = (ALGEBRAIC(:,25)+ALGEBRAIC(:,39)) - (ALGEBRAIC(:,26)+ALGEBRAIC(:,43)+ALGEBRAIC(:,103));
ALGEBRAIC(:,104) =  CONSTANTS(:,84).*STATES(:,55).*STATES(:,60) -  CONSTANTS(:,85).*STATES(:,85);
RATES(:,55) =  - (ALGEBRAIC(:,54)+ALGEBRAIC(:,61)+ALGEBRAIC(:,91)+ALGEBRAIC(:,104));
RATES(:,60) =  - (ALGEBRAIC(:,58)+ALGEBRAIC(:,59)+ALGEBRAIC(:,60)+ALGEBRAIC(:,61)+ALGEBRAIC(:,98)+ALGEBRAIC(:,100)+ALGEBRAIC(:,102)+ALGEBRAIC(:,104));
RATES(:,85) = ALGEBRAIC(:,102)+ALGEBRAIC(:,104);
ALGEBRAIC(:,107) =  CONSTANTS(:,9).*STATES(:,9).*STATES(:,19) -  CONSTANTS(:,10).*STATES(:,88);
ALGEBRAIC(:,106) =  CONSTANTS(:,7).*STATES(:,25).*STATES(:,12) -  CONSTANTS(:,8).*STATES(:,88);
RATES(:,88) = ALGEBRAIC(:,106)+ALGEBRAIC(:,107);
ALGEBRAIC(:,109) =  CONSTANTS(:,7).*STATES(:,27).*STATES(:,12) -  CONSTANTS(:,8).*STATES(:,89);
ALGEBRAIC(:,108) =  CONSTANTS(:,11).*STATES(:,27) -  CONSTANTS(:,12).*STATES(:,20);
RATES(:,27) = (ALGEBRAIC(:,20)+ALGEBRAIC(:,21)) - (ALGEBRAIC(:,108)+ALGEBRAIC(:,109));
ALGEBRAIC(:,110) =  CONSTANTS(:,9).*STATES(:,9).*STATES(:,20) -  CONSTANTS(:,10).*STATES(:,89);
RATES(:,89) = ALGEBRAIC(:,109)+ALGEBRAIC(:,110);
ALGEBRAIC(:,112) =  CONSTANTS(:,7).*STATES(:,29).*STATES(:,12) -  CONSTANTS(:,8).*STATES(:,90);
ALGEBRAIC(:,111) =  CONSTANTS(:,11).*STATES(:,29) -  CONSTANTS(:,12).*STATES(:,21);
RATES(:,29) = (ALGEBRAIC(:,22)+ALGEBRAIC(:,23)) - (ALGEBRAIC(:,111)+ALGEBRAIC(:,112));
ALGEBRAIC(:,113) =  CONSTANTS(:,9).*STATES(:,9).*STATES(:,21) -  CONSTANTS(:,10).*STATES(:,90);
RATES(:,90) = ALGEBRAIC(:,112)+ALGEBRAIC(:,113);
ALGEBRAIC(:,115) =  CONSTANTS(:,7).*STATES(:,34).*STATES(:,12) -  CONSTANTS(:,8).*STATES(:,91);
ALGEBRAIC(:,27) =  CONSTANTS(:,38).*STATES(:,24).*STATES(:,34) -  CONSTANTS(:,39).*STATES(:,35);
ALGEBRAIC(:,114) =  CONSTANTS(:,11).*STATES(:,34) -  CONSTANTS(:,12).*STATES(:,65);
RATES(:,34) = (ALGEBRAIC(:,41)+ALGEBRAIC(:,26)) - (ALGEBRAIC(:,27)+ALGEBRAIC(:,114)+ALGEBRAIC(:,115));
ALGEBRAIC(:,116) =  CONSTANTS(:,9).*STATES(:,9).*STATES(:,65) -  CONSTANTS(:,10).*STATES(:,91);
RATES(:,91) = ALGEBRAIC(:,115)+ALGEBRAIC(:,116);
ALGEBRAIC(:,119) =  CONSTANTS(:,9).*STATES(:,9).*STATES(:,66) -  CONSTANTS(:,10).*STATES(:,92);
ALGEBRAIC(:,118) =  CONSTANTS(:,7).*STATES(:,35).*STATES(:,12) -  CONSTANTS(:,8).*STATES(:,92);
RATES(:,92) = ALGEBRAIC(:,118)+ALGEBRAIC(:,119);
ALGEBRAIC(:,121) =  CONSTANTS(:,7).*STATES(:,36).*STATES(:,12) -  CONSTANTS(:,8).*STATES(:,93);
ALGEBRAIC(:,120) =  CONSTANTS(:,11).*STATES(:,36) -  CONSTANTS(:,12).*STATES(:,67);
RATES(:,36) = (ALGEBRAIC(:,29)+ALGEBRAIC(:,28)) - (ALGEBRAIC(:,120)+ALGEBRAIC(:,121));
ALGEBRAIC(:,122) =  CONSTANTS(:,9).*STATES(:,9).*STATES(:,67) -  CONSTANTS(:,10).*STATES(:,93);
RATES(:,93) = ALGEBRAIC(:,121)+ALGEBRAIC(:,122);
ALGEBRAIC(:,17) =  CONSTANTS(:,19).*STATES(:,9) -  CONSTANTS(:,20).*STATES(:,12);
ALGEBRAIC(:,124) =  CONSTANTS(:,7).*STATES(:,37).*STATES(:,12) -  CONSTANTS(:,8).*STATES(:,94);
RATES(:,12) = ALGEBRAIC(:,17) - (ALGEBRAIC(:,4)+ALGEBRAIC(:,106)+ALGEBRAIC(:,109)+ALGEBRAIC(:,112)+ALGEBRAIC(:,115)+ALGEBRAIC(:,118)+ALGEBRAIC(:,121)+ALGEBRAIC(:,124));
ALGEBRAIC(:,123) =  CONSTANTS(:,11).*STATES(:,37) -  CONSTANTS(:,12).*STATES(:,68);
RATES(:,37) = (ALGEBRAIC(:,32)+ALGEBRAIC(:,33)) - (ALGEBRAIC(:,123)+ALGEBRAIC(:,124));
ALGEBRAIC(:,125) =  CONSTANTS(:,9).*STATES(:,68).*STATES(:,9) -  CONSTANTS(:,10).*STATES(:,94);
RATES(:,9) =  - (ALGEBRAIC(:,5)+ALGEBRAIC(:,17)+ALGEBRAIC(:,107)+ALGEBRAIC(:,110)+ALGEBRAIC(:,113)+ALGEBRAIC(:,116)+ALGEBRAIC(:,119)+ALGEBRAIC(:,122)+ALGEBRAIC(:,125));
RATES(:,94) = ALGEBRAIC(:,124)+ALGEBRAIC(:,125);
ALGEBRAIC(:,105) =  CONSTANTS(:,11).*STATES(:,25) -  CONSTANTS(:,12).*STATES(:,19);
ALGEBRAIC(:,126) =  CONSTANTS(:,92).*STATES(:,59).*STATES(:,25) -  CONSTANTS(:,93).*STATES(:,95);
RATES(:,25) = (ALGEBRAIC(:,19)+ALGEBRAIC(:,36)) - (ALGEBRAIC(:,20)+ALGEBRAIC(:,21)+ALGEBRAIC(:,22)+ALGEBRAIC(:,23)+ALGEBRAIC(:,105)+ALGEBRAIC(:,106)+ALGEBRAIC(:,126));
ALGEBRAIC(:,117) =  CONSTANTS(:,11).*STATES(:,35) -  CONSTANTS(:,12).*STATES(:,66);
ALGEBRAIC(:,128) =  CONSTANTS(:,92).*STATES(:,59).*STATES(:,35) -  CONSTANTS(:,93).*STATES(:,97);
RATES(:,35) = (ALGEBRAIC(:,27)+ALGEBRAIC(:,34)+ALGEBRAIC(:,43)) - (ALGEBRAIC(:,117)+ALGEBRAIC(:,118)+ALGEBRAIC(:,128)+ALGEBRAIC(:,28)+ALGEBRAIC(:,29)+ALGEBRAIC(:,32)+ALGEBRAIC(:,33));
ALGEBRAIC(:,130) =  CONSTANTS(:,88).*STATES(:,17) -  CONSTANTS(:,89).*STATES(:,87);
RATES(:,17) = (ALGEBRAIC(:,16)+ALGEBRAIC(:,99)) - (ALGEBRAIC(:,63)+ALGEBRAIC(:,69)+ALGEBRAIC(:,79)+ALGEBRAIC(:,80)+ALGEBRAIC(:,81)+ALGEBRAIC(:,82)+ALGEBRAIC(:,130));
ALGEBRAIC(:,64) =  CONSTANTS(:,23).*STATES(:,24).*STATES(:,18) -  CONSTANTS(:,24).*STATES(:,19);
ALGEBRAIC(:,132) =  CONSTANTS(:,88).*STATES(:,18) -  CONSTANTS(:,89).*STATES(:,87);
RATES(:,18) = (ALGEBRAIC(:,10)+ALGEBRAIC(:,63)) - (ALGEBRAIC(:,5)+ALGEBRAIC(:,64)+ALGEBRAIC(:,132));
ALGEBRAIC(:,72) =  CONSTANTS(:,38).*STATES(:,24).*STATES(:,65) -  CONSTANTS(:,39).*STATES(:,66);
ALGEBRAIC(:,131) =  CONSTANTS(:,92).*STATES(:,59).*STATES(:,24) -  CONSTANTS(:,93).*STATES(:,101);
ALGEBRAIC(:,133) =  CONSTANTS(:,92).*STATES(:,83).*STATES(:,24) -  CONSTANTS(:,93).*STATES(:,102);
RATES(:,24) =  - (ALGEBRAIC(:,19)+ALGEBRAIC(:,27)+ALGEBRAIC(:,37)+ALGEBRAIC(:,42)+ALGEBRAIC(:,64)+ALGEBRAIC(:,72)+ALGEBRAIC(:,131)+ALGEBRAIC(:,133));
ALGEBRAIC(:,127) =  CONSTANTS(:,92).*STATES(:,83).*STATES(:,19) -  CONSTANTS(:,93).*STATES(:,96);
ALGEBRAIC(:,134) =  CONSTANTS(:,88).*STATES(:,19) -  CONSTANTS(:,89).*STATES(:,87);
RATES(:,19) = (ALGEBRAIC(:,80)+ALGEBRAIC(:,64)+ALGEBRAIC(:,105)) - (ALGEBRAIC(:,65)+ALGEBRAIC(:,66)+ALGEBRAIC(:,67)+ALGEBRAIC(:,68)+ALGEBRAIC(:,107)+ALGEBRAIC(:,127)+ALGEBRAIC(:,134));
ALGEBRAIC(:,135) =  CONSTANTS(:,94).*STATES(:,59).*STATES(:,99) -  CONSTANTS(:,95).*STATES(:,95);
RATES(:,95) = ALGEBRAIC(:,126)+ALGEBRAIC(:,135);
ALGEBRAIC(:,136) =  CONSTANTS(:,88).*STATES(:,20) -  CONSTANTS(:,89).*STATES(:,87);
RATES(:,20) = (ALGEBRAIC(:,65)+ALGEBRAIC(:,66)+ALGEBRAIC(:,108)) - (ALGEBRAIC(:,110)+ALGEBRAIC(:,136));
ALGEBRAIC(:,137) =  CONSTANTS(:,94).*STATES(:,59).*STATES(:,99) -  CONSTANTS(:,95).*STATES(:,97);
RATES(:,97) = ALGEBRAIC(:,128)+ALGEBRAIC(:,137);
RATES(:,99) =  - (ALGEBRAIC(:,135)+ALGEBRAIC(:,137));
ALGEBRAIC(:,138) =  CONSTANTS(:,88).*STATES(:,21) -  CONSTANTS(:,89).*STATES(:,87);
RATES(:,21) = (ALGEBRAIC(:,67)+ALGEBRAIC(:,68)+ALGEBRAIC(:,111)) - (ALGEBRAIC(:,113)+ALGEBRAIC(:,138));
ALGEBRAIC(:,139) =  CONSTANTS(:,94).*STATES(:,59).*STATES(:,103) -  CONSTANTS(:,95).*STATES(:,101);
RATES(:,59) =  - (ALGEBRAIC(:,57)+ALGEBRAIC(:,58)+ALGEBRAIC(:,126)+ALGEBRAIC(:,128)+ALGEBRAIC(:,131)+ALGEBRAIC(:,135)+ALGEBRAIC(:,137)+ALGEBRAIC(:,139));
RATES(:,101) = ALGEBRAIC(:,131)+ALGEBRAIC(:,139);
ALGEBRAIC(:,70) =  CONSTANTS(:,35).*STATES(:,63) -  CONSTANTS(:,36).*STATES(:,64);
ALGEBRAIC(:,140) =  CONSTANTS(:,88).*STATES(:,63) -  CONSTANTS(:,89).*STATES(:,87);
RATES(:,63) = (ALGEBRAIC(:,69)+ALGEBRAIC(:,101)) - (ALGEBRAIC(:,70)+ALGEBRAIC(:,140));
ALGEBRAIC(:,141) =  CONSTANTS(:,94).*STATES(:,83).*STATES(:,100) -  CONSTANTS(:,95).*STATES(:,96);
RATES(:,96) = ALGEBRAIC(:,127)+ALGEBRAIC(:,141);
ALGEBRAIC(:,142) =  CONSTANTS(:,88).*STATES(:,64) -  CONSTANTS(:,89).*STATES(:,87);
RATES(:,64) = (ALGEBRAIC(:,70)+ALGEBRAIC(:,81)+ALGEBRAIC(:,103)) - (ALGEBRAIC(:,71)+ALGEBRAIC(:,83)+ALGEBRAIC(:,142));
ALGEBRAIC(:,129) =  CONSTANTS(:,92).*STATES(:,83).*STATES(:,66) -  CONSTANTS(:,93).*STATES(:,98);
ALGEBRAIC(:,143) =  CONSTANTS(:,94).*STATES(:,83).*STATES(:,100) -  CONSTANTS(:,95).*STATES(:,98);
RATES(:,98) = ALGEBRAIC(:,129)+ALGEBRAIC(:,143);
RATES(:,100) =  - (ALGEBRAIC(:,141)+ALGEBRAIC(:,143));
ALGEBRAIC(:,144) =  CONSTANTS(:,88).*STATES(:,65) -  CONSTANTS(:,89).*STATES(:,87);
RATES(:,65) = (ALGEBRAIC(:,71)+ALGEBRAIC(:,82)+ALGEBRAIC(:,114)) - (ALGEBRAIC(:,72)+ALGEBRAIC(:,116)+ALGEBRAIC(:,144));
ALGEBRAIC(:,145) =  CONSTANTS(:,94).*STATES(:,83).*STATES(:,103) -  CONSTANTS(:,95).*STATES(:,102);
RATES(:,83) =  - (ALGEBRAIC(:,97)+ALGEBRAIC(:,98)+ALGEBRAIC(:,127)+ALGEBRAIC(:,129)+ALGEBRAIC(:,133)+ALGEBRAIC(:,141)+ALGEBRAIC(:,143)+ALGEBRAIC(:,145));
RATES(:,102) = ALGEBRAIC(:,133)+ALGEBRAIC(:,145);
RATES(:,103) =  - (ALGEBRAIC(:,139)+ALGEBRAIC(:,145));
ALGEBRAIC(:,146) =  CONSTANTS(:,88).*STATES(:,66) -  CONSTANTS(:,89).*STATES(:,87);
RATES(:,66) = (ALGEBRAIC(:,72)+ALGEBRAIC(:,79)+ALGEBRAIC(:,83)+ALGEBRAIC(:,117)) - (ALGEBRAIC(:,73)+ALGEBRAIC(:,74)+ALGEBRAIC(:,77)+ALGEBRAIC(:,78)+ALGEBRAIC(:,119)+ALGEBRAIC(:,129)+ALGEBRAIC(:,146));
ALGEBRAIC(:,147) =  CONSTANTS(:,88).*STATES(:,67) -  CONSTANTS(:,89).*STATES(:,87);
RATES(:,67) = (ALGEBRAIC(:,73)+ALGEBRAIC(:,74)+ALGEBRAIC(:,120)) - (ALGEBRAIC(:,122)+ALGEBRAIC(:,147));
ALGEBRAIC(:,148) =  CONSTANTS(:,88).*STATES(:,68) -  CONSTANTS(:,89).*STATES(:,87);
RATES(:,68) = (ALGEBRAIC(:,77)+ALGEBRAIC(:,78)+ALGEBRAIC(:,123)) - (ALGEBRAIC(:,125)+ALGEBRAIC(:,148));
RATES(:,87) = ALGEBRAIC(:,62)+ALGEBRAIC(:,130)+ALGEBRAIC(:,132)+ALGEBRAIC(:,134)+ALGEBRAIC(:,136)+ALGEBRAIC(:,138)+ALGEBRAIC(:,140)+ALGEBRAIC(:,142)+ALGEBRAIC(:,144)+ALGEBRAIC(:,146)+ALGEBRAIC(:,147)+ALGEBRAIC(:,148);
RATES = RATES';
end

% Calculate algebraic variables
function ALGEBRAIC = computeAlgebraic(ALGEBRAIC, CONSTANTS, STATES, VOI)
statesSize = size(STATES);
statesColumnCount = statesSize(2);
if ( statesColumnCount == 1)
STATES = STATES';
utilOnes = 1;
else
statesRowCount = statesSize(1);
utilOnes = ones(statesRowCount, 1);
end
ALGEBRAIC(:,1) =  CONSTANTS(:,1).*STATES(:,1).*STATES(:,2) -  CONSTANTS(:,2).*STATES(:,3);
ALGEBRAIC(:,2) =  CONSTANTS(:,3).*STATES(:,3).*STATES(:,3) -  CONSTANTS(:,4).*STATES(:,4);
ALGEBRAIC(:,3) =  CONSTANTS(:,5).*STATES(:,4).*1.00000 -  CONSTANTS(:,6).*STATES(:,5);
ALGEBRAIC(:,4) =  CONSTANTS(:,7).*STATES(:,23).*STATES(:,12) -  CONSTANTS(:,8).*STATES(:,7);
ALGEBRAIC(:,5) =  CONSTANTS(:,9).*STATES(:,18).*STATES(:,9) -  CONSTANTS(:,10).*STATES(:,7);
ALGEBRAIC(:,6) =  CONSTANTS(:,11).*STATES(:,2) -  CONSTANTS(:,12).*STATES(:,6);
ALGEBRAIC(:,7) =  CONSTANTS(:,17).*1.00000 -  CONSTANTS(:,18).*STATES(:,2);
ALGEBRAIC(:,8) =  CONSTANTS(:,11).*STATES(:,5) -  CONSTANTS(:,12).*STATES(:,8);
ALGEBRAIC(:,9) =  CONSTANTS(:,13).*STATES(:,5).*STATES(:,14) -  CONSTANTS(:,14).*STATES(:,15);
ALGEBRAIC(:,11) =  CONSTANTS(:,15).*STATES(:,6).*STATES(:,16) -  CONSTANTS(:,16).*STATES(:,10);
ALGEBRAIC(:,12) =  CONSTANTS(:,88).*STATES(:,6) -  CONSTANTS(:,89).*STATES(:,86);
ALGEBRAIC(:,13) =  CONSTANTS(:,3).*STATES(:,10).*STATES(:,10) -  CONSTANTS(:,4).*STATES(:,11);
ALGEBRAIC(:,14) =  CONSTANTS(:,90).*STATES(:,16) -  CONSTANTS(:,91).*STATES(:,13);
ALGEBRAIC(:,15) =  CONSTANTS(:,5).*STATES(:,11) -  CONSTANTS(:,6).*STATES(:,8);
ALGEBRAIC(:,16) =  CONSTANTS(:,13).*STATES(:,8).*STATES(:,14) -  CONSTANTS(:,14).*STATES(:,17);
ALGEBRAIC(:,18) =  CONSTANTS(:,21).*STATES(:,22).*STATES(:,15) -  CONSTANTS(:,22).*STATES(:,23);
ALGEBRAIC(:,10) =  CONSTANTS(:,11).*STATES(:,23) -  CONSTANTS(:,12).*STATES(:,18);
ALGEBRAIC(:,19) =  CONSTANTS(:,23).*STATES(:,24).*STATES(:,23) -  CONSTANTS(:,24).*STATES(:,25);
ALGEBRAIC(:,21) =  CONSTANTS(:,27).*STATES(:,28).*STATES(:,25) -  CONSTANTS(:,28).*STATES(:,27);
ALGEBRAIC(:,29) =  CONSTANTS(:,27).*STATES(:,35).*STATES(:,28) -  CONSTANTS(:,28).*STATES(:,36);
ALGEBRAIC(:,30) =  CONSTANTS(:,40).*STATES(:,28).*STATES(:,41) -  CONSTANTS(:,41).*STATES(:,42);
ALGEBRAIC(:,31) =  CONSTANTS(:,42).*STATES(:,43).*STATES(:,45) -  CONSTANTS(:,43).*STATES(:,42);
ALGEBRAIC(:,22) =  CONSTANTS(:,29).*STATES(:,25).*STATES(:,43) -  CONSTANTS(:,30).*STATES(:,29);
ALGEBRAIC(:,32) =  CONSTANTS(:,29).*STATES(:,35).*STATES(:,43) -  CONSTANTS(:,30).*STATES(:,37);
ALGEBRAIC(:,45) =  CONSTANTS(:,62).*STATES(:,41).*STATES(:,44) -  CONSTANTS(:,63).*STATES(:,46);
ALGEBRAIC(:,44) =  CONSTANTS(:,60).*STATES(:,44).*STATES(:,45) -  CONSTANTS(:,61).*STATES(:,46);
ALGEBRAIC(:,46) =  CONSTANTS(:,64).*STATES(:,47).*STATES(:,45) -  CONSTANTS(:,65).*STATES(:,48);
ALGEBRAIC(:,47) =  CONSTANTS(:,66).*STATES(:,49).*STATES(:,45) -  CONSTANTS(:,67).*STATES(:,48);
ALGEBRAIC(:,48) =  CONSTANTS(:,64).*STATES(:,49).*STATES(:,45) -  CONSTANTS(:,65).*STATES(:,50);
ALGEBRAIC(:,49) =  CONSTANTS(:,68).*STATES(:,51).*STATES(:,45) -  CONSTANTS(:,69).*STATES(:,50);
ALGEBRAIC(:,51) =  CONSTANTS(:,72).*STATES(:,49).*STATES(:,53) -  CONSTANTS(:,73).*STATES(:,52);
ALGEBRAIC(:,50) =  CONSTANTS(:,70).*STATES(:,51).*STATES(:,53) -  CONSTANTS(:,71).*STATES(:,52);
ALGEBRAIC(:,52) =  CONSTANTS(:,74).*STATES(:,53).*STATES(:,49) -  CONSTANTS(:,75).*STATES(:,54);
ALGEBRAIC(:,53) =  CONSTANTS(:,72).*STATES(:,47).*STATES(:,53) -  CONSTANTS(:,73).*STATES(:,54);
ALGEBRAIC(:,54) =  CONSTANTS(:,76).*STATES(:,55).*STATES(:,51) -  CONSTANTS(:,77).*STATES(:,56);
ALGEBRAIC(:,55) =  CONSTANTS(:,78).*STATES(:,51).*STATES(:,57) -  CONSTANTS(:,79).*STATES(:,56);
ALGEBRAIC(:,56) =  CONSTANTS(:,76).*STATES(:,51).*STATES(:,57) -  CONSTANTS(:,77).*STATES(:,58);
ALGEBRAIC(:,57) =  CONSTANTS(:,80).*STATES(:,59).*STATES(:,51) -  CONSTANTS(:,81).*STATES(:,58);
ALGEBRAIC(:,59) =  CONSTANTS(:,84).*STATES(:,57).*STATES(:,60) -  CONSTANTS(:,85).*STATES(:,61);
ALGEBRAIC(:,58) =  CONSTANTS(:,82).*STATES(:,59).*STATES(:,60) -  CONSTANTS(:,83).*STATES(:,61);
ALGEBRAIC(:,60) =  CONSTANTS(:,86).*STATES(:,60).*STATES(:,57) -  CONSTANTS(:,87).*STATES(:,62);
ALGEBRAIC(:,61) =  CONSTANTS(:,84).*STATES(:,55).*STATES(:,60) -  CONSTANTS(:,85).*STATES(:,62);
ALGEBRAIC(:,62) =  CONSTANTS(:,88).*STATES(:,8) -  CONSTANTS(:,89).*STATES(:,87);
ALGEBRAIC(:,24) =  CONSTANTS(:,33).*STATES(:,31).*STATES(:,15) -  CONSTANTS(:,34).*STATES(:,32);
ALGEBRAIC(:,69) =  CONSTANTS(:,33).*STATES(:,31).*STATES(:,17) -  CONSTANTS(:,34).*STATES(:,63);
ALGEBRAIC(:,38) =  CONSTANTS(:,52).*STATES(:,40) -  CONSTANTS(:,53).*STATES(:,31);
ALGEBRAIC(:,63) =  CONSTANTS(:,21).*STATES(:,17).*STATES(:,22) -  CONSTANTS(:,22).*STATES(:,18);
ALGEBRAIC(:,26) =  CONSTANTS(:,21).*STATES(:,22).*STATES(:,33) -  CONSTANTS(:,37).*STATES(:,34);
ALGEBRAIC(:,37) =  CONSTANTS(:,50).*STATES(:,24).*STATES(:,22) -  CONSTANTS(:,51).*STATES(:,30);
ALGEBRAIC(:,40) =  CONSTANTS(:,21).*STATES(:,22).*STATES(:,40) -  CONSTANTS(:,37).*STATES(:,39);
ALGEBRAIC(:,71) =  CONSTANTS(:,21).*STATES(:,22).*STATES(:,64) -  CONSTANTS(:,37).*STATES(:,65);
ALGEBRAIC(:,66) =  CONSTANTS(:,27).*STATES(:,69).*STATES(:,19) -  CONSTANTS(:,28).*STATES(:,20);
ALGEBRAIC(:,75) =  CONSTANTS(:,40).*STATES(:,69).*STATES(:,41) -  CONSTANTS(:,41).*STATES(:,70);
ALGEBRAIC(:,74) =  CONSTANTS(:,27).*STATES(:,66).*STATES(:,69) -  CONSTANTS(:,28).*STATES(:,67);
ALGEBRAIC(:,76) =  CONSTANTS(:,42).*STATES(:,71).*STATES(:,72) -  CONSTANTS(:,43).*STATES(:,70);
ALGEBRAIC(:,67) =  CONSTANTS(:,29).*STATES(:,71).*STATES(:,19) -  CONSTANTS(:,30).*STATES(:,21);
ALGEBRAIC(:,77) =  CONSTANTS(:,29).*STATES(:,71).*STATES(:,66) -  CONSTANTS(:,30).*STATES(:,68);
ALGEBRAIC(:,65) =  CONSTANTS(:,25).*STATES(:,26).*STATES(:,19) -  CONSTANTS(:,26).*STATES(:,20);
ALGEBRAIC(:,68) =  CONSTANTS(:,31).*STATES(:,19).*STATES(:,26) -  CONSTANTS(:,32).*STATES(:,21);
ALGEBRAIC(:,20) =  CONSTANTS(:,25).*STATES(:,26).*STATES(:,25) -  CONSTANTS(:,26).*STATES(:,27);
ALGEBRAIC(:,23) =  CONSTANTS(:,31).*STATES(:,25).*STATES(:,26) -  CONSTANTS(:,32).*STATES(:,29);
ALGEBRAIC(:,28) =  CONSTANTS(:,25).*STATES(:,26).*STATES(:,35) -  CONSTANTS(:,26).*STATES(:,36);
ALGEBRAIC(:,33) =  CONSTANTS(:,31).*STATES(:,35).*STATES(:,26) -  CONSTANTS(:,32).*STATES(:,37);
ALGEBRAIC(:,78) =  CONSTANTS(:,31).*STATES(:,66).*STATES(:,26) -  CONSTANTS(:,32).*STATES(:,68);
ALGEBRAIC(:,73) =  CONSTANTS(:,25).*STATES(:,26).*STATES(:,66) -  CONSTANTS(:,26).*STATES(:,67);
ALGEBRAIC(:,34) =  CONSTANTS(:,44).*STATES(:,38).*STATES(:,15) -  CONSTANTS(:,45).*STATES(:,35);
ALGEBRAIC(:,79) =  CONSTANTS(:,44).*STATES(:,17).*STATES(:,38) -  CONSTANTS(:,45).*STATES(:,66);
ALGEBRAIC(:,42) =  CONSTANTS(:,56).*STATES(:,24).*STATES(:,39) -  CONSTANTS(:,57).*STATES(:,38);
ALGEBRAIC(:,35) =  CONSTANTS(:,46).*STATES(:,40).*STATES(:,30) -  CONSTANTS(:,47).*STATES(:,38);
ALGEBRAIC(:,39) =  CONSTANTS(:,54).*STATES(:,15).*STATES(:,40) -  CONSTANTS(:,55).*STATES(:,33);
ALGEBRAIC(:,81) =  CONSTANTS(:,54).*STATES(:,17).*STATES(:,40) -  CONSTANTS(:,55).*STATES(:,64);
ALGEBRAIC(:,41) =  CONSTANTS(:,54).*STATES(:,15).*STATES(:,39) -  CONSTANTS(:,55).*STATES(:,34);
ALGEBRAIC(:,82) =  CONSTANTS(:,54).*STATES(:,17).*STATES(:,39) -  CONSTANTS(:,55).*STATES(:,65);
ALGEBRAIC(:,36) =  CONSTANTS(:,48).*STATES(:,15).*STATES(:,30) -  CONSTANTS(:,49).*STATES(:,25);
ALGEBRAIC(:,80) =  CONSTANTS(:,48).*STATES(:,17).*STATES(:,30) -  CONSTANTS(:,49).*STATES(:,19);
ALGEBRAIC(:,43) =  CONSTANTS(:,58).*STATES(:,30).*STATES(:,33) -  CONSTANTS(:,59).*STATES(:,35);
ALGEBRAIC(:,83) =  CONSTANTS(:,58).*STATES(:,30).*STATES(:,64) -  CONSTANTS(:,59).*STATES(:,66);
ALGEBRAIC(:,85) =  CONSTANTS(:,62).*STATES(:,41).*STATES(:,44) -  CONSTANTS(:,63).*STATES(:,73);
ALGEBRAIC(:,84) =  CONSTANTS(:,60).*STATES(:,44).*STATES(:,72) -  CONSTANTS(:,61).*STATES(:,73);
ALGEBRAIC(:,86) =  CONSTANTS(:,64).*STATES(:,47).*STATES(:,72) -  CONSTANTS(:,65).*STATES(:,74);
ALGEBRAIC(:,87) =  CONSTANTS(:,66).*STATES(:,75).*STATES(:,72) -  CONSTANTS(:,67).*STATES(:,74);
ALGEBRAIC(:,88) =  CONSTANTS(:,64).*STATES(:,72).*STATES(:,75) -  CONSTANTS(:,65).*STATES(:,76);
ALGEBRAIC(:,89) =  CONSTANTS(:,68).*STATES(:,72).*STATES(:,77) -  CONSTANTS(:,69).*STATES(:,76);
ALGEBRAIC(:,90) =  CONSTANTS(:,70).*STATES(:,77).*STATES(:,53) -  CONSTANTS(:,71).*STATES(:,78);
ALGEBRAIC(:,92) =  CONSTANTS(:,72).*STATES(:,75).*STATES(:,53) -  CONSTANTS(:,73).*STATES(:,78);
ALGEBRAIC(:,94) =  CONSTANTS(:,74).*STATES(:,53).*STATES(:,75) -  CONSTANTS(:,75).*STATES(:,79);
ALGEBRAIC(:,91) =  CONSTANTS(:,76).*STATES(:,55).*STATES(:,77) -  CONSTANTS(:,77).*STATES(:,80);
ALGEBRAIC(:,93) =  CONSTANTS(:,78).*STATES(:,81).*STATES(:,77) -  CONSTANTS(:,79).*STATES(:,80);
ALGEBRAIC(:,96) =  CONSTANTS(:,72).*STATES(:,47).*STATES(:,53) -  CONSTANTS(:,73).*STATES(:,79);
ALGEBRAIC(:,95) =  CONSTANTS(:,76).*STATES(:,77).*STATES(:,81) -  CONSTANTS(:,77).*STATES(:,82);
ALGEBRAIC(:,97) =  CONSTANTS(:,80).*STATES(:,83).*STATES(:,77) -  CONSTANTS(:,81).*STATES(:,82);
ALGEBRAIC(:,99) =  CONSTANTS(:,11).*STATES(:,15) -  CONSTANTS(:,12).*STATES(:,17);
ALGEBRAIC(:,98) =  CONSTANTS(:,82).*STATES(:,83).*STATES(:,60) -  CONSTANTS(:,83).*STATES(:,84);
ALGEBRAIC(:,100) =  CONSTANTS(:,84).*STATES(:,81).*STATES(:,60) -  CONSTANTS(:,85).*STATES(:,84);
ALGEBRAIC(:,25) =  CONSTANTS(:,35).*STATES(:,32) -  CONSTANTS(:,36).*STATES(:,33);
ALGEBRAIC(:,101) =  CONSTANTS(:,11).*STATES(:,32) -  CONSTANTS(:,12).*STATES(:,63);
ALGEBRAIC(:,102) =  CONSTANTS(:,86).*STATES(:,60).*STATES(:,81) -  CONSTANTS(:,87).*STATES(:,85);
ALGEBRAIC(:,103) =  CONSTANTS(:,11).*STATES(:,33) -  CONSTANTS(:,12).*STATES(:,64);
ALGEBRAIC(:,104) =  CONSTANTS(:,84).*STATES(:,55).*STATES(:,60) -  CONSTANTS(:,85).*STATES(:,85);
ALGEBRAIC(:,107) =  CONSTANTS(:,9).*STATES(:,9).*STATES(:,19) -  CONSTANTS(:,10).*STATES(:,88);
ALGEBRAIC(:,106) =  CONSTANTS(:,7).*STATES(:,25).*STATES(:,12) -  CONSTANTS(:,8).*STATES(:,88);
ALGEBRAIC(:,109) =  CONSTANTS(:,7).*STATES(:,27).*STATES(:,12) -  CONSTANTS(:,8).*STATES(:,89);
ALGEBRAIC(:,108) =  CONSTANTS(:,11).*STATES(:,27) -  CONSTANTS(:,12).*STATES(:,20);
ALGEBRAIC(:,110) =  CONSTANTS(:,9).*STATES(:,9).*STATES(:,20) -  CONSTANTS(:,10).*STATES(:,89);
ALGEBRAIC(:,112) =  CONSTANTS(:,7).*STATES(:,29).*STATES(:,12) -  CONSTANTS(:,8).*STATES(:,90);
ALGEBRAIC(:,111) =  CONSTANTS(:,11).*STATES(:,29) -  CONSTANTS(:,12).*STATES(:,21);
ALGEBRAIC(:,113) =  CONSTANTS(:,9).*STATES(:,9).*STATES(:,21) -  CONSTANTS(:,10).*STATES(:,90);
ALGEBRAIC(:,115) =  CONSTANTS(:,7).*STATES(:,34).*STATES(:,12) -  CONSTANTS(:,8).*STATES(:,91);
ALGEBRAIC(:,27) =  CONSTANTS(:,38).*STATES(:,24).*STATES(:,34) -  CONSTANTS(:,39).*STATES(:,35);
ALGEBRAIC(:,114) =  CONSTANTS(:,11).*STATES(:,34) -  CONSTANTS(:,12).*STATES(:,65);
ALGEBRAIC(:,116) =  CONSTANTS(:,9).*STATES(:,9).*STATES(:,65) -  CONSTANTS(:,10).*STATES(:,91);
ALGEBRAIC(:,119) =  CONSTANTS(:,9).*STATES(:,9).*STATES(:,66) -  CONSTANTS(:,10).*STATES(:,92);
ALGEBRAIC(:,118) =  CONSTANTS(:,7).*STATES(:,35).*STATES(:,12) -  CONSTANTS(:,8).*STATES(:,92);
ALGEBRAIC(:,121) =  CONSTANTS(:,7).*STATES(:,36).*STATES(:,12) -  CONSTANTS(:,8).*STATES(:,93);
ALGEBRAIC(:,120) =  CONSTANTS(:,11).*STATES(:,36) -  CONSTANTS(:,12).*STATES(:,67);
ALGEBRAIC(:,122) =  CONSTANTS(:,9).*STATES(:,9).*STATES(:,67) -  CONSTANTS(:,10).*STATES(:,93);
ALGEBRAIC(:,17) =  CONSTANTS(:,19).*STATES(:,9) -  CONSTANTS(:,20).*STATES(:,12);
ALGEBRAIC(:,124) =  CONSTANTS(:,7).*STATES(:,37).*STATES(:,12) -  CONSTANTS(:,8).*STATES(:,94);
ALGEBRAIC(:,123) =  CONSTANTS(:,11).*STATES(:,37) -  CONSTANTS(:,12).*STATES(:,68);
ALGEBRAIC(:,125) =  CONSTANTS(:,9).*STATES(:,68).*STATES(:,9) -  CONSTANTS(:,10).*STATES(:,94);
ALGEBRAIC(:,105) =  CONSTANTS(:,11).*STATES(:,25) -  CONSTANTS(:,12).*STATES(:,19);
ALGEBRAIC(:,126) =  CONSTANTS(:,92).*STATES(:,59).*STATES(:,25) -  CONSTANTS(:,93).*STATES(:,95);
ALGEBRAIC(:,117) =  CONSTANTS(:,11).*STATES(:,35) -  CONSTANTS(:,12).*STATES(:,66);
ALGEBRAIC(:,128) =  CONSTANTS(:,92).*STATES(:,59).*STATES(:,35) -  CONSTANTS(:,93).*STATES(:,97);
ALGEBRAIC(:,130) =  CONSTANTS(:,88).*STATES(:,17) -  CONSTANTS(:,89).*STATES(:,87);
ALGEBRAIC(:,64) =  CONSTANTS(:,23).*STATES(:,24).*STATES(:,18) -  CONSTANTS(:,24).*STATES(:,19);
ALGEBRAIC(:,132) =  CONSTANTS(:,88).*STATES(:,18) -  CONSTANTS(:,89).*STATES(:,87);
ALGEBRAIC(:,72) =  CONSTANTS(:,38).*STATES(:,24).*STATES(:,65) -  CONSTANTS(:,39).*STATES(:,66);
ALGEBRAIC(:,131) =  CONSTANTS(:,92).*STATES(:,59).*STATES(:,24) -  CONSTANTS(:,93).*STATES(:,101);
ALGEBRAIC(:,133) =  CONSTANTS(:,92).*STATES(:,83).*STATES(:,24) -  CONSTANTS(:,93).*STATES(:,102);
ALGEBRAIC(:,127) =  CONSTANTS(:,92).*STATES(:,83).*STATES(:,19) -  CONSTANTS(:,93).*STATES(:,96);
ALGEBRAIC(:,134) =  CONSTANTS(:,88).*STATES(:,19) -  CONSTANTS(:,89).*STATES(:,87);
ALGEBRAIC(:,135) =  CONSTANTS(:,94).*STATES(:,59).*STATES(:,99) -  CONSTANTS(:,95).*STATES(:,95);
ALGEBRAIC(:,136) =  CONSTANTS(:,88).*STATES(:,20) -  CONSTANTS(:,89).*STATES(:,87);
ALGEBRAIC(:,137) =  CONSTANTS(:,94).*STATES(:,59).*STATES(:,99) -  CONSTANTS(:,95).*STATES(:,97);
ALGEBRAIC(:,138) =  CONSTANTS(:,88).*STATES(:,21) -  CONSTANTS(:,89).*STATES(:,87);
ALGEBRAIC(:,139) =  CONSTANTS(:,94).*STATES(:,59).*STATES(:,103) -  CONSTANTS(:,95).*STATES(:,101);
ALGEBRAIC(:,70) =  CONSTANTS(:,35).*STATES(:,63) -  CONSTANTS(:,36).*STATES(:,64);
ALGEBRAIC(:,140) =  CONSTANTS(:,88).*STATES(:,63) -  CONSTANTS(:,89).*STATES(:,87);
ALGEBRAIC(:,141) =  CONSTANTS(:,94).*STATES(:,83).*STATES(:,100) -  CONSTANTS(:,95).*STATES(:,96);
ALGEBRAIC(:,142) =  CONSTANTS(:,88).*STATES(:,64) -  CONSTANTS(:,89).*STATES(:,87);
ALGEBRAIC(:,129) =  CONSTANTS(:,92).*STATES(:,83).*STATES(:,66) -  CONSTANTS(:,93).*STATES(:,98);
ALGEBRAIC(:,143) =  CONSTANTS(:,94).*STATES(:,83).*STATES(:,100) -  CONSTANTS(:,95).*STATES(:,98);
ALGEBRAIC(:,144) =  CONSTANTS(:,88).*STATES(:,65) -  CONSTANTS(:,89).*STATES(:,87);
ALGEBRAIC(:,145) =  CONSTANTS(:,94).*STATES(:,83).*STATES(:,103) -  CONSTANTS(:,95).*STATES(:,102);
ALGEBRAIC(:,146) =  CONSTANTS(:,88).*STATES(:,66) -  CONSTANTS(:,89).*STATES(:,87);
ALGEBRAIC(:,147) =  CONSTANTS(:,88).*STATES(:,67) -  CONSTANTS(:,89).*STATES(:,87);
ALGEBRAIC(:,148) =  CONSTANTS(:,88).*STATES(:,68) -  CONSTANTS(:,89).*STATES(:,87);
end

% Pad out or shorten strings to a set length
req_length = 160;
insize = size(strin,2);
if insize > req_length
strout = strin(1:req_length);
else
strout = [strin, blanks(req_length - insize)];
end
end

```
Collaboration
To begin collaborating on this work, please use your git client and issue this command: