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 1 entries in the algebraic variable array.
   There are a total of 1 entries in each of the rate and state variable arrays.
   There are a total of 6 entries in the constant variable array.
 */
/*
 * VOI is time in component environment (day).
 * STATES[0] is p in component serum_PSA_dynamics (ng_per_mm3).
 * ALGEBRAIC[0] is Vc in component serum_PSA_dynamics (mm3).
 * CONSTANTS[0] is Vo in component serum_PSA_dynamics (mm3).
 * CONSTANTS[1] is Vh in component serum_PSA_dynamics (mm3).
 * CONSTANTS[2] is beta_h in component serum_PSA_dynamics (ng_per_mm3_per_day).
 * CONSTANTS[3] is beta_c in component serum_PSA_dynamics (ng_per_mm3_per_day).
 * CONSTANTS[4] is gamma in component serum_PSA_dynamics (per_day).
 * CONSTANTS[5] is rho in component serum_PSA_dynamics (per_day).
 * RATES[0] is d/dt p in component serum_PSA_dynamics (ng_per_mm3).
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
STATES[0] = 0.0;
CONSTANTS[0] = 20.0;
CONSTANTS[1] = 0.0;
CONSTANTS[2] = 0.0;
CONSTANTS[3] = 1.7210;
CONSTANTS[4] = 1.2896;
CONSTANTS[5] = 0.0655;
}
void
computeRates(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[0] =  CONSTANTS[0]*exp( CONSTANTS[5]*VOI);
RATES[0] = ( 1.00000*CONSTANTS[2]*CONSTANTS[1]+ 1.00000*CONSTANTS[3]*ALGEBRAIC[0]) -  CONSTANTS[4]*STATES[0];
}
void
computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[0] =  CONSTANTS[0]*exp( CONSTANTS[5]*VOI);
}