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 3 entries in each of the rate and state variable arrays.
   There are a total of 10 entries in the constant variable array.
 */
/*
 * VOI is time in component environment (minute).
 * CONSTANTS[0] is QAO in component heart_hypertrophy_or_deterioration (L_per_minute).
 * CONSTANTS[1] is PA in component heart_hypertrophy_or_deterioration (mmHg).
 * CONSTANTS[2] is POT in component heart_hypertrophy_or_deterioration (mmHg).
 * CONSTANTS[3] is PPA in component heart_hypertrophy_or_deterioration (mmHg).
 * STATES[0] is HPL in component left_ventricular_hypertrophy (dimensionless).
 * CONSTANTS[4] is HSL in component parameter_values (dimensionless).
 * CONSTANTS[5] is Z13 in component parameter_values (dimensionless).
 * STATES[1] is HPR in component right_ventricular_hypertrophy (dimensionless).
 * CONSTANTS[6] is HSR in component parameter_values (dimensionless).
 * ALGEBRAIC[0] is HMD in component heart_deterioration (dimensionless).
 * CONSTANTS[7] is DHDTR in component parameter_values (per_mmHg_per_minute).
 * STATES[2] is HMD1 in component heart_deterioration (dimensionless).
 * CONSTANTS[8] is DHM in component heart_deterioration (per_minute).
 * RATES[0] is d/dt HPL in component left_ventricular_hypertrophy (dimensionless).
 * RATES[1] is d/dt HPR in component right_ventricular_hypertrophy (dimensionless).
 * RATES[2] is d/dt HMD1 in component heart_deterioration (dimensionless).
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
CONSTANTS[0] = 5.00707;
CONSTANTS[1] = 103.525;
CONSTANTS[2] = 35.1148;
CONSTANTS[3] = 15.6376;
STATES[0] = 1.00163;
CONSTANTS[4] = 1;
CONSTANTS[5] = 0.625;
STATES[1] = 1.00237;
CONSTANTS[6] = 1;
CONSTANTS[7] = 0.05;
STATES[2] = 1.0;
CONSTANTS[8] =  (CONSTANTS[2] - 10.0000)*CONSTANTS[7];
CONSTANTS[9] = CONSTANTS[8];
}
void
computeRates(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
RATES[2] = CONSTANTS[9];
RATES[0] = (pow(( CONSTANTS[1]*CONSTANTS[0])/( 500.000*CONSTANTS[4]), CONSTANTS[5]) - STATES[0])/57600.0;
RATES[1] = (pow(( CONSTANTS[3]*CONSTANTS[0])/( 75.0000*CONSTANTS[6]), CONSTANTS[5]) - STATES[1])/57600.0;
}
void
computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[0] = (STATES[2]>1.00000 ? 1.00000 : STATES[2]);
}