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 4 entries in the constant variable array.
 */
/*
 * VOI is time in component environment (dimensionless).
 * STATES[0] is x in component x (dimensionless).
 * STATES[1] is y in component y (dimensionless).
 * CONSTANTS[0] is beta in component model_parameters (dimensionless).
 * CONSTANTS[1] is delta1 in component model_parameters (dimensionless).
 * STATES[2] is z in component z (dimensionless).
 * CONSTANTS[2] is delta2 in component model_parameters (dimensionless).
 * CONSTANTS[3] is delta3 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] = 1.0;
STATES[1] = 0.01;
CONSTANTS[0] = 1.091;
CONSTANTS[1] = 0.5;
STATES[2] = 0.01;
CONSTANTS[2] = 0.38;
CONSTANTS[3] = 0.6;
}
void
computeRates(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
RATES[0] =  CONSTANTS[1]*exp( CONSTANTS[0]*(1.00000 - pow(STATES[1], 2.00000))) -  CONSTANTS[1]*STATES[0];
RATES[1] =  CONSTANTS[2]*STATES[0]*exp( CONSTANTS[0]*(1.00000 - pow(STATES[2], 2.00000))) -  CONSTANTS[2]*STATES[1];
RATES[2] =  CONSTANTS[3]*STATES[1] -  CONSTANTS[3]*STATES[2];
}
void
computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
}