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 2 entries in the algebraic variable array.
   There are a total of 9 entries in each of the rate and state variable arrays.
   There are a total of 30 entries in the constant variable array.
 */
/*
 * VOI is time in component environment (hour).
 * CONSTANTS[29] is F_b_dopa in component gastrointestinal_compartment_L_dopa (dimensionless).
 * STATES[0] is A_dopa_b in component gastrointestinal_compartment_L_dopa (umole).
 * CONSTANTS[0] is ka_b_dopa in component gastrointestinal_compartment_L_dopa (per_hour).
 * CONSTANTS[21] is F_G in component gastrointestinal_compartment_L_dopa (dimensionless).
 * CONSTANTS[28] is F_H in component gastrointestinal_compartment_L_dopa (dimensionless).
 * CONSTANTS[25] is CL_H in component gastrointestinal_compartment_L_dopa (liter_per_hour).
 * CONSTANTS[1] is Q in component gastrointestinal_compartment_L_dopa (liter_per_hour).
 * CONSTANTS[2] is f_H in component gastrointestinal_compartment_L_dopa (dimensionless).
 * CONSTANTS[3] is CL_dopa_0 in component L_dopa_clearance (liter_per_hour).
 * STATES[1] is C_dopa_b in component body_compartment_L_dopa (uM).
 * CONSTANTS[4] is V_dopa in component body_compartment_L_dopa (liter).
 * ALGEBRAIC[1] is CL_dopa in component L_dopa_clearance (liter_per_hour).
 * STATES[2] is C_OMD_b in component body_compartment_3_OMD (uM).
 * CONSTANTS[5] is CL_OMD_b in component body_compartment_3_OMD (liter_per_hour).
 * CONSTANTS[6] is V_OMD_b in component body_compartment_3_OMD (liter).
 * CONSTANTS[22] is CL_COMT in component L_dopa_clearance (liter_per_hour).
 * ALGEBRAIC[0] is CL_AADC in component L_dopa_clearance (liter_per_hour).
 * CONSTANTS[23] is CL_AADC0 in component L_dopa_clearance (liter_per_hour).
 * STATES[3] is C_Ro_central in component central_compartment_Ro (uM).
 * CONSTANTS[26] is CL_REST in component L_dopa_clearance (liter_per_hour).
 * CONSTANTS[7] is ki in component L_dopa_clearance (uM).
 * STATES[4] is A_bens in component gastrointestinal_compartment_benserazide (umole).
 * CONSTANTS[8] is ka_Bens in component gastrointestinal_compartment_benserazide (per_hour).
 * CONSTANTS[9] is F_Bens in component gastrointestinal_compartment_benserazide (dimensionless).
 * STATES[5] is C_bens_central in component central_compartment_benserazide (uM).
 * CONSTANTS[10] is V1_B in component central_compartment_benserazide (liter).
 * CONSTANTS[11] is CLd_B in component central_compartment_benserazide (liter_per_hour).
 * STATES[6] is C_bens_peripheral in component peripheral_compartment_benserazide (uM).
 * CONSTANTS[24] is CL_bens_total in component benserazide_clearance (liter_per_hour).
 * CONSTANTS[12] is V2_B in component peripheral_compartment_benserazide (liter).
 * CONSTANTS[27] is CL_Ro in component benserazide_clearance (liter_per_hour).
 * CONSTANTS[13] is CL_B in component benserazide_clearance (liter_per_hour).
 * CONSTANTS[14] is fm in component benserazide_clearance (dimensionless).
 * STATES[7] is A_Ro in component gastrointestinal_compartment_Ro (umole).
 * CONSTANTS[15] is ka_M in component gastrointestinal_compartment_Ro (per_hour).
 * CONSTANTS[16] is F_Ro in component gastrointestinal_compartment_Ro (dimensionless).
 * CONSTANTS[17] is V1_M in component central_compartment_Ro (liter).
 * CONSTANTS[18] is CLd_M in component central_compartment_Ro (liter_per_hour).
 * CONSTANTS[19] is CL_M in component central_compartment_Ro (liter_per_hour).
 * STATES[8] is C_Ro_peripheral in component peripheral_compartment_Ro (uM).
 * CONSTANTS[20] is V2_M in component peripheral_compartment_Ro (liter).
 * RATES[0] is d/dt A_dopa_b in component gastrointestinal_compartment_L_dopa (umole).
 * RATES[1] is d/dt C_dopa_b in component body_compartment_L_dopa (uM).
 * RATES[2] is d/dt C_OMD_b in component body_compartment_3_OMD (uM).
 * RATES[4] is d/dt A_bens in component gastrointestinal_compartment_benserazide (umole).
 * RATES[5] is d/dt C_bens_central in component central_compartment_benserazide (uM).
 * RATES[6] is d/dt C_bens_peripheral in component peripheral_compartment_benserazide (uM).
 * RATES[7] is d/dt A_Ro in component gastrointestinal_compartment_Ro (umole).
 * RATES[3] is d/dt C_Ro_central in component central_compartment_Ro (uM).
 * RATES[8] is d/dt C_Ro_peripheral in component peripheral_compartment_Ro (uM).
 * There are a total of 0 condition variables.
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
STATES[0] = 101;
CONSTANTS[0] = 2.11;
CONSTANTS[1] = 0.828;
CONSTANTS[2] = 0.13;
CONSTANTS[3] = 0.823;
STATES[1] = 0;
CONSTANTS[4] = 0.496;
STATES[2] = 0;
CONSTANTS[5] = 0.012;
CONSTANTS[6] = 0.196;
STATES[3] = 0;
CONSTANTS[7] = 0.00246;
STATES[4] = 19.51;
CONSTANTS[8] = 0.94;
CONSTANTS[9] = 0.022;
STATES[5] = 0;
CONSTANTS[10] = 0.202;
CONSTANTS[11] = 0.072;
STATES[6] = 0;
CONSTANTS[12] = 0.127;
CONSTANTS[13] = 1.67;
CONSTANTS[14] = 0.15;
STATES[7] = 1.3658;
CONSTANTS[15] = 2.47;
CONSTANTS[16] = 1;
CONSTANTS[17] = 0.0691;
CONSTANTS[18] = 1.06;
CONSTANTS[19] = 4.29;
STATES[8] = 0;
CONSTANTS[20] = 3.2;
CONSTANTS[21] = 0.244000;
CONSTANTS[22] =  CONSTANTS[3]*0.100000;
CONSTANTS[23] =  CONSTANTS[3]*0.690000;
CONSTANTS[24] = CONSTANTS[13]/(1.00000 - CONSTANTS[14]);
CONSTANTS[25] =  CONSTANTS[2]*CONSTANTS[3];
CONSTANTS[26] =  CONSTANTS[3]*0.210000;
CONSTANTS[27] =  CONSTANTS[24]*CONSTANTS[14];
CONSTANTS[28] = 1.00000 - CONSTANTS[25]/CONSTANTS[1];
CONSTANTS[29] =  CONSTANTS[28]*CONSTANTS[21];
RATES[0] = 0.1001;
RATES[1] = 0.1001;
RATES[2] = 0.1001;
RATES[4] = 0.1001;
RATES[5] = 0.1001;
RATES[6] = 0.1001;
RATES[7] = 0.1001;
RATES[3] = 0.1001;
RATES[8] = 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[0]*STATES[0];
resid[1] = RATES[1] -  (1.00000/CONSTANTS[4])*( CONSTANTS[0]*STATES[0]*CONSTANTS[29] -  ALGEBRAIC[1]*STATES[1]);
resid[2] = RATES[2] -  (1.00000/CONSTANTS[6])*( CONSTANTS[22]*STATES[1] -  CONSTANTS[5]*STATES[2]);
resid[3] = RATES[4] -  - CONSTANTS[8]*STATES[4];
resid[4] = RATES[5] -  (1.00000/CONSTANTS[10])*(( CONSTANTS[8]*STATES[4]*CONSTANTS[9] -  CONSTANTS[24]*STATES[5])+ CONSTANTS[11]*(STATES[6] - STATES[5]));
resid[5] = RATES[6] -  (1.00000/CONSTANTS[12])*CONSTANTS[11]*(STATES[5] - STATES[6]);
resid[6] = RATES[7] -  - CONSTANTS[15]*STATES[7];
resid[7] = RATES[3] -  (1.00000/CONSTANTS[17])*(( CONSTANTS[15]*STATES[7]*CONSTANTS[16] -  CONSTANTS[19]*STATES[3])+ CONSTANTS[27]*STATES[5]+ CONSTANTS[18]*(STATES[8] - STATES[3]));
resid[8] = RATES[8] -  (1.00000/CONSTANTS[20])*CONSTANTS[18]*(STATES[3] - STATES[8]);
}
void
computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
}
void
computeEssentialVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[0] = CONSTANTS[23]/(1.00000+STATES[3]/CONSTANTS[7]);
ALGEBRAIC[1] = ALGEBRAIC[0]+CONSTANTS[22]+CONSTANTS[26];
}
void
getStateInformation(double* SI)
{
SI[0] = 1.0;
SI[1] = 1.0;
SI[2] = 1.0;
SI[3] = 1.0;
SI[4] = 1.0;
SI[5] = 1.0;
SI[6] = 1.0;
SI[7] = 1.0;
SI[8] = 1.0;
}
void
computeRoots(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
             double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
}