Generated Code

The following is c_ida 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 3 entries in the constant variable array.
 */
/*
 * VOI is t in component Main (dimensionless).
 * STATES[0] is x in component Main (dimensionless).
 * STATES[1] is y in component Main (dimensionless).
 * STATES[2] is z in component Main (dimensionless).
 * CONSTANTS[0] is beta in component Main (dimensionless).
 * CONSTANTS[1] is rho in component Main (dimensionless).
 * CONSTANTS[2] is sigma in component Main (dimensionless).
 * RATES[0] is d/dt x in component Main (dimensionless).
 * RATES[1] is d/dt y in component Main (dimensionless).
 * RATES[2] is d/dt z in component Main (dimensionless).
 * There are a total of 0 condition variables.
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
STATES[0] = 0;
STATES[1] = 1;
STATES[2] = 1.05;
CONSTANTS[0] = 8.00000/3.00000;
CONSTANTS[1] = 28.0000;
CONSTANTS[2] = 10.0000;
RATES[0] = 0.1001;
RATES[1] = 0.1001;
RATES[2] = 0.1001;
}
void
computeResiduals(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
                 double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
resid[0] = RATES[0] -  CONSTANTS[2]*(STATES[1] - STATES[0]);
resid[1] = RATES[1] -  STATES[0]*(CONSTANTS[1] - STATES[2]) - STATES[1];
resid[2] = RATES[2] -  STATES[0]*STATES[1] -  CONSTANTS[0]*STATES[2];
}
void
computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
}
void
computeEssentialVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
}
void
getStateInformation(double* SI)
{
SI[0] = 1.0;
SI[1] = 1.0;
SI[2] = 1.0;
}
void
computeRoots(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
             double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
}