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 1 entries in each of the rate and state variable arrays.
   There are a total of 19 entries in the constant variable array.
 */
/*
 * VOI is time in component environment (minute).
 * CONSTANTS[0] is ADHC in component thirst_drinking_and_salt_appetite (dimensionless).
 * CONSTANTS[1] is ANM in component thirst_drinking_and_salt_appetite (dimensionless).
 * CONSTANTS[2] is POT in component thirst_drinking_and_salt_appetite (mmHg).
 * CONSTANTS[12] is STH in component effect_of_salt_appetite_stimulation_on_thirst (dimensionless).
 * CONSTANTS[3] is ANMSLT in component parameter_values (dimensionless).
 * CONSTANTS[4] is Z10 in component parameter_values (mmHg).
 * CONSTANTS[5] is Z11 in component parameter_values (per_mmHg2).
 * CONSTANTS[10] is ANMSML in component effect_of_salt_appetite_stimulation_on_thirst (dimensionless).
 * CONSTANTS[11] is STH1 in component effect_of_salt_appetite_stimulation_on_thirst (dimensionless).
 * CONSTANTS[13] is AHCM in component effect_of_antidiuretic_hormone_on_thirst (dimensionless).
 * CONSTANTS[6] is AHTHM in component parameter_values (dimensionless).
 * CONSTANTS[14] is ANMTH in component effect_of_angiotensin_on_thirst (dimensionless).
 * CONSTANTS[7] is ANMTM in component parameter_values (dimensionless).
 * STATES[0] is TVD in component rate_of_fluid_intake (L_per_minute).
 * CONSTANTS[8] is DR in component parameter_values (L_per_minute).
 * CONSTANTS[9] is TVDDL in component parameter_values (minute).
 * CONSTANTS[16] is AHTH in component rate_of_fluid_intake (dimensionless).
 * CONSTANTS[15] is AHTH1 in component rate_of_fluid_intake (dimensionless).
 * CONSTANTS[18] is TVZ in component rate_of_fluid_intake (L_per_minute).
 * CONSTANTS[17] is TVZ1 in component rate_of_fluid_intake (L_per_minute).
 * RATES[0] is d/dt TVD in component rate_of_fluid_intake (L_per_minute).
 * There are a total of 0 condition variables.
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
CONSTANTS[0] = 1.0;
CONSTANTS[1] = 0.987545;
CONSTANTS[2] = 35.1148;
CONSTANTS[3] = 2;
CONSTANTS[4] = 45;
CONSTANTS[5] = 0.01;
CONSTANTS[6] = 2;
CONSTANTS[7] = 1.5;
STATES[0] = 0.000980838;
CONSTANTS[8] = 0;
CONSTANTS[9] = 30;
CONSTANTS[10] =  (CONSTANTS[1] - 1.00000)*CONSTANTS[3]+1.00000;
CONSTANTS[11] =  pow(CONSTANTS[4] - CONSTANTS[2], 2.00000)*CONSTANTS[5]*CONSTANTS[10];
CONSTANTS[12] = (CONSTANTS[11]<0.800000 ? 0.800000 : CONSTANTS[11]>8.00000 ? 8.00000 : CONSTANTS[11]);
CONSTANTS[13] =  (CONSTANTS[0] - 1.00000)*CONSTANTS[6]+1.00000;
CONSTANTS[14] =  (CONSTANTS[1] - 1.00000)*CONSTANTS[7]*0.00100000;
CONSTANTS[15] =  CONSTANTS[13]*CONSTANTS[12]*0.00100000;
CONSTANTS[16] = (CONSTANTS[15]<0.00000 ? 0.00000 : CONSTANTS[15]);
CONSTANTS[17] =  (CONSTANTS[14]+CONSTANTS[16])*1.00000;
CONSTANTS[18] = (CONSTANTS[17]<0.00000 ? 0.00000 : CONSTANTS[17]);
RATES[0] = 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[18]+CONSTANTS[8]) - STATES[0])/CONSTANTS[9];
}
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;
}
void
computeRoots(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
             double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
}