Generated Code
The following is c code generated by the CellML API from this CellML file. (Back to language selection)
The raw code is available.
/*
There are a total of 0 entries in the algebraic variable array.
There are a total of 11 entries in each of the rate and state variable arrays.
There are a total of 18 entries in the constant variable array.
*/
/*
* VOI is time in component environment (second).
* CONSTANTS[0] is k11 in component kinetic_constants (second_order_rate_constant).
* CONSTANTS[1] is k11_ in component kinetic_constants (first_order_rate_constant).
* CONSTANTS[2] is k71 in component kinetic_constants (first_order_rate_constant).
* CONSTANTS[3] is k72 in component kinetic_constants (first_order_rate_constant).
* CONSTANTS[4] is k12 in component kinetic_constants (second_order_rate_constant).
* CONSTANTS[5] is k12_ in component kinetic_constants (first_order_rate_constant).
* CONSTANTS[6] is k51 in component kinetic_constants (first_order_rate_constant).
* CONSTANTS[7] is k52 in component kinetic_constants (first_order_rate_constant).
* CONSTANTS[8] is k41 in component kinetic_constants (first_order_rate_constant).
* CONSTANTS[9] is k31 in component kinetic_constants (first_order_rate_constant).
* CONSTANTS[10] is k32 in component kinetic_constants (first_order_rate_constant).
* CONSTANTS[11] is k42 in component kinetic_constants (first_order_rate_constant).
* CONSTANTS[12] is k22 in component kinetic_constants (first_order_rate_constant).
* CONSTANTS[13] is k22_ in component kinetic_constants (first_order_rate_constant).
* CONSTANTS[14] is k21 in component kinetic_constants (first_order_rate_constant).
* CONSTANTS[15] is k21_ in component kinetic_constants (first_order_rate_constant).
* STATES[0] is PB in component PB (micromolar).
* CONSTANTS[16] is kreset1 in component kreset1 (first_order_rate_constant).
* STATES[1] is A1 in component A1 (micromolar).
* STATES[2] is A2 in component A2 (micromolar).
* STATES[3] is PC1 in component PC1 (micromolar).
* STATES[4] is PF1 in component PF1 (micromolar).
* STATES[5] is PG1 in component PG1 (micromolar).
* STATES[6] is PC2 in component PC2 (micromolar).
* STATES[7] is PF2 in component PF2 (micromolar).
* STATES[8] is PD1 in component PD1 (micromolar).
* STATES[9] is PE1 in component PE1 (micromolar).
* STATES[10] is PD2 in component PD2 (micromolar).
* CONSTANTS[17] is PE2 in component PE2 (micromolar).
* RATES[0] is d/dt PB in component PB (micromolar).
* RATES[1] is d/dt A1 in component A1 (micromolar).
* RATES[2] is d/dt A2 in component A2 (micromolar).
* RATES[3] is d/dt PC1 in component PC1 (micromolar).
* RATES[8] is d/dt PD1 in component PD1 (micromolar).
* RATES[9] is d/dt PE1 in component PE1 (micromolar).
* RATES[4] is d/dt PF1 in component PF1 (micromolar).
* RATES[5] is d/dt PG1 in component PG1 (micromolar).
* RATES[6] is d/dt PC2 in component PC2 (micromolar).
* RATES[10] is d/dt PD2 in component PD2 (micromolar).
* RATES[7] is d/dt PF2 in component PF2 (micromolar).
*/
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
CONSTANTS[0] = 110.0;
CONSTANTS[1] = 25.0;
CONSTANTS[2] = 0.1;
CONSTANTS[3] = 60.0;
CONSTANTS[4] = 110.0;
CONSTANTS[5] = 0.2;
CONSTANTS[6] = 7.0;
CONSTANTS[7] = 0.0;
CONSTANTS[8] = 60.0;
CONSTANTS[9] = 500.0;
CONSTANTS[10] = 50.0;
CONSTANTS[11] = 70.0;
CONSTANTS[12] = 100.0;
CONSTANTS[13] = 17.0;
CONSTANTS[14] = 100.0;
CONSTANTS[15] = 0.2;
STATES[0] = 0.1;
CONSTANTS[16] = 35.0;
STATES[1] = 0.1;
STATES[2] = 0.1;
STATES[3] = 0.1;
STATES[4] = 0.1;
STATES[5] = 0.1;
STATES[6] = 0.1;
STATES[7] = 0.1;
STATES[8] = 0.1;
STATES[9] = 0.1;
STATES[10] = 0.1;
CONSTANTS[17] = 0.1;
}
void
computeRates(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
RATES[0] = ( CONSTANTS[1]*STATES[3]+ CONSTANTS[2]*STATES[4]+ CONSTANTS[16]*STATES[5]+ CONSTANTS[5]*STATES[6]+ CONSTANTS[3]*STATES[7]) - ( CONSTANTS[0]*STATES[1]*STATES[0]+ CONSTANTS[4]*STATES[2]*STATES[0]);
RATES[1] = CONSTANTS[1]*STATES[3] - CONSTANTS[0]*STATES[1]*STATES[0];
RATES[2] = CONSTANTS[5]*STATES[6] - CONSTANTS[4]*STATES[2]*STATES[0];
RATES[3] = ( CONSTANTS[0]*STATES[1]*STATES[0] - (CONSTANTS[1]+CONSTANTS[14])*STATES[3])+ CONSTANTS[15]*STATES[8];
RATES[8] = CONSTANTS[14]*STATES[3] - (CONSTANTS[15]+CONSTANTS[9])*STATES[8];
RATES[9] = CONSTANTS[9]*STATES[8] - CONSTANTS[8]*STATES[9];
RATES[4] = CONSTANTS[8]*STATES[9] - (CONSTANTS[6]+CONSTANTS[2])*STATES[4];
RATES[5] = CONSTANTS[6]*STATES[4] - CONSTANTS[16]*STATES[5];
RATES[6] = ( CONSTANTS[4]*STATES[2]*STATES[0] - (CONSTANTS[5]+CONSTANTS[12])*STATES[6])+ CONSTANTS[13]*STATES[10];
RATES[10] = CONSTANTS[12]*STATES[6] - (CONSTANTS[13]+CONSTANTS[10])*STATES[10];
RATES[7] = CONSTANTS[11]*CONSTANTS[17] - (CONSTANTS[7]+CONSTANTS[3])*STATES[7];
}
void
computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
}
