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 3 entries in each of the rate and state variable arrays. There are a total of 14 entries in the constant variable array. */ /* * VOI is time in component environment (dimensionless). * STATES[0] is x in component x (dimensionless). * CONSTANTS[0] is a1 in component model_parameters (dimensionless). * CONSTANTS[1] is k1 in component model_parameters (dimensionless). * CONSTANTS[2] is b1 in component model_parameters (dimensionless). * CONSTANTS[3] is kp in component model_parameters (dimensionless). * STATES[1] is y in component y (dimensionless). * CONSTANTS[4] is epsilon in component model_parameters (dimensionless). * CONSTANTS[5] is a2 in component model_parameters (dimensionless). * CONSTANTS[6] is a3 in component model_parameters (dimensionless). * CONSTANTS[7] is k2 in component model_parameters (dimensionless). * CONSTANTS[8] is b2 in component model_parameters (dimensionless). * STATES[2] is z in component z (dimensionless). * CONSTANTS[9] is delta in component model_parameters (dimensionless). * CONSTANTS[10] is a4 in component model_parameters (dimensionless). * CONSTANTS[11] is a5 in component model_parameters (dimensionless). * CONSTANTS[12] is k3 in component model_parameters (dimensionless). * CONSTANTS[13] is b3 in component model_parameters (dimensionless). * RATES[0] is d/dt x in component x (dimensionless). * RATES[1] is d/dt y in component y (dimensionless). * RATES[2] is d/dt z in component z (dimensionless). */ void initConsts(double* CONSTANTS, double* RATES, double *STATES) { STATES[0] = 2.0; CONSTANTS[0] = 0.05; CONSTANTS[1] = 0.1; CONSTANTS[2] = 0.1; CONSTANTS[3] = 0.5; STATES[1] = 1.0; CONSTANTS[4] = 0.1; CONSTANTS[5] = 0.009; CONSTANTS[6] = 0.675; CONSTANTS[7] = 0.5; CONSTANTS[8] = 0.3; STATES[2] = 0.15; CONSTANTS[9] = 0.9; CONSTANTS[10] = 0.01; CONSTANTS[11] = 0.005; CONSTANTS[12] = 0.025; CONSTANTS[13] = 0.01; } void computeRates(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC) { RATES[0] = (VOI>=0.00000&&VOI<10000.0 ? CONSTANTS[0]/(CONSTANTS[1]+STATES[1]) - CONSTANTS[2]*STATES[0] : VOI>=10000.0&&VOI<10360.0 ? (CONSTANTS[0]/(CONSTANTS[1]+STATES[1]) - CONSTANTS[2]*STATES[0])+CONSTANTS[3] : VOI>=10360.0&&VOI<11440.0 ? CONSTANTS[0]/(CONSTANTS[1]+STATES[1]) - CONSTANTS[2]*STATES[0] : VOI>=11440.0&&VOI<11800.0 ? (CONSTANTS[0]/(CONSTANTS[1]+STATES[1]) - CONSTANTS[2]*STATES[0])+CONSTANTS[3] : VOI>=11800.0&&VOI<12880.0 ? CONSTANTS[0]/(CONSTANTS[1]+STATES[1]) - CONSTANTS[2]*STATES[0] : VOI>=12880.0&&VOI<13240.0 ? (CONSTANTS[0]/(CONSTANTS[1]+STATES[1]) - CONSTANTS[2]*STATES[0])+CONSTANTS[3] : VOI>=13240.0&&VOI<14320.0 ? CONSTANTS[0]/(CONSTANTS[1]+STATES[1]) - CONSTANTS[2]*STATES[0] : VOI>=14320.0&&VOI<14680.0 ? (CONSTANTS[0]/(CONSTANTS[1]+STATES[1]) - CONSTANTS[2]*STATES[0])+CONSTANTS[3] : VOI>=14680.0&&VOI<15760.0 ? CONSTANTS[0]/(CONSTANTS[1]+STATES[1]) - CONSTANTS[2]*STATES[0] : VOI>=15760.0&&VOI<16120.0 ? (CONSTANTS[0]/(CONSTANTS[1]+STATES[1]) - CONSTANTS[2]*STATES[0])+CONSTANTS[3] : 0.0/0.0); RATES[1] = CONSTANTS[4]*(( (CONSTANTS[5]+ CONSTANTS[6]*STATES[0])*STATES[1]*STATES[2])/(CONSTANTS[7]+pow(STATES[0], 2.00000)) - CONSTANTS[8]*STATES[1]); RATES[2] = CONSTANTS[4]*CONSTANTS[9]*( CONSTANTS[10]*STATES[0] - (( CONSTANTS[11]*STATES[0]*STATES[2])/(CONSTANTS[12]+STATES[0])+ CONSTANTS[13]*STATES[2])); } void computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC) { }