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 12 entries in the algebraic variable array.
There are a total of 4 entries in each of the rate and state variable arrays.
There are a total of 44 entries in the constant variable array.
*/
/*
* VOI is time in component environment (day).
* STATES[0] is OB_p in component OB_p (dimensionless).
* CONSTANTS[0] is D_OB_u in component OB_p (first_order_rate_constant).
* CONSTANTS[1] is K_D1_TGF_beta in component OB_p (pM).
* CONSTANTS[2] is K_D2_TGF_beta in component model_parameters (pM).
* CONSTANTS[3] is D_OB_p in component model_parameters (first_order_rate_constant).
* ALGEBRAIC[2] is TGF_beta in component TGF_beta (pM).
* STATES[1] is OB_a in component OB_a (dimensionless).
* CONSTANTS[4] is A_OB_a in component OB_a (first_order_rate_constant).
* STATES[2] is OC_a in component OC_a (dimensionless).
* CONSTANTS[5] is D_OC_p in component OC_a (first_order_rate_constant).
* CONSTANTS[6] is A_OC_a in component OC_a (first_order_rate_constant).
* CONSTANTS[7] is K_D3_TGF_beta in component OC_a (pM).
* CONSTANTS[8] is OC_p in component OC_a (dimensionless).
* ALGEBRAIC[6] is RANKL in component RANKL (pM).
* ALGEBRAIC[8] is pi_RANKL_act_OC_p in component RANKL (dimensionless).
* STATES[3] is BV in component BV (dimensionless).
* ALGEBRAIC[0] is OC_a_tilde in component BV (dimensionless).
* ALGEBRAIC[1] is OB_a_tilde in component BV (dimensionless).
* CONSTANTS[9] is OC_a_initial in component BV (dimensionless).
* CONSTANTS[10] is OB_a_initial in component BV (dimensionless).
* CONSTANTS[11] is k_form in component BV (first_order_rate_constant).
* CONSTANTS[12] is k_res in component model_parameters (first_order_rate_constant).
* CONSTANTS[13] is alpha in component TGF_beta (pM).
* CONSTANTS[14] is D_TGF_beta_tilde in component TGF_beta (first_order_rate_constant).
* CONSTANTS[15] is S_TGF_beta in component TGF_beta (flux).
* CONSTANTS[37] is PTH in component PTH (pM).
* CONSTANTS[38] is pi_PTH_rep_OB_p in component PTH (dimensionless).
* CONSTANTS[39] is pi_PTH_act_OB_p in component PTH (dimensionless).
* CONSTANTS[16] is beta_PTH in component PTH (flux).
* CONSTANTS[17] is D_PTH_tilde in component PTH (first_order_rate_constant).
* CONSTANTS[18] is P_PTH_d in component PTH (flux).
* CONSTANTS[19] is K_D4_PTH in component PTH (pM).
* CONSTANTS[20] is K_D5_PTH in component PTH (pM).
* CONSTANTS[21] is K_D6_PTH in component PTH (pM).
* CONSTANTS[22] is K_D7_PTH in component PTH (pM).
* CONSTANTS[40] is pi_PTH_act_OB_a in component PTH (dimensionless).
* CONSTANTS[41] is pi_PTH_rep_OB_a in component PTH (dimensionless).
* ALGEBRAIC[3] is OPG in component OPG (pM).
* CONSTANTS[23] is beta1_OPG in component OPG (flux).
* CONSTANTS[24] is beta2_OPG in component OPG (flux).
* CONSTANTS[25] is OPG_max in component OPG (pM).
* ALGEBRAIC[4] is P_OPG_e in component OPG (flux).
* CONSTANTS[26] is P_OPG_d in component OPG (flux).
* CONSTANTS[27] is D_OPG_tilde in component OPG (first_order_rate_constant).
* CONSTANTS[42] is pi_PTH_rep_OB in component OPG (dimensionless).
* CONSTANTS[28] is K_A2_RANKL in component RANKL (per_pM).
* CONSTANTS[29] is K_A1_RANKL in component RANKL (per_pM).
* CONSTANTS[30] is RANK in component RANKL (pM).
* ALGEBRAIC[5] is RANKL_eff in component RANKL (pM).
* ALGEBRAIC[7] is RANKL_tot in component RANKL (pM).
* ALGEBRAIC[11] is P_RANKL in component RANKL (flux).
* ALGEBRAIC[9] is P_RANKL_e in component RANKL (flux).
* CONSTANTS[31] is P_RANKL_d in component RANKL (flux).
* CONSTANTS[32] is R1_RANKL in component RANKL (pM).
* CONSTANTS[33] is R2_RANKL in component RANKL (pM).
* CONSTANTS[34] is beta_RANKL in component RANKL (flux).
* ALGEBRAIC[10] is D_RANKL in component RANKL (flux).
* CONSTANTS[35] is D_RANKL_tilde in component RANKL (first_order_rate_constant).
* CONSTANTS[43] is pi_PTH_act_OB in component RANKL (dimensionless).
* CONSTANTS[36] is K_D8_RANKL in component RANKL (pM).
* RATES[0] is d/dt OB_p in component OB_p (dimensionless).
* RATES[1] is d/dt OB_a in component OB_a (dimensionless).
* RATES[2] is d/dt OC_a in component OC_a (dimensionless).
* RATES[3] is d/dt BV in component BV (dimensionless).
* There are a total of 0 condition variables.
*/
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
STATES[0] = 1.0;
CONSTANTS[0] = 7.000e-4;
CONSTANTS[1] = 4.545e-3;
CONSTANTS[2] = 1.416e-3;
CONSTANTS[3] = 5.348e-0;
STATES[1] = 1.0;
CONSTANTS[4] = 1.890e-1;
STATES[2] = 1.0;
CONSTANTS[5] = 2.100e-3;
CONSTANTS[6] = 7.000e-1;
CONSTANTS[7] = 1.416e-3;
CONSTANTS[8] = 1.0;
STATES[3] = 100.0;
CONSTANTS[9] = 1.0;
CONSTANTS[10] = 1.0;
CONSTANTS[11] = 1.571e0;
CONSTANTS[12] = 1.000e0;
CONSTANTS[13] = 1.000e0;
CONSTANTS[14] = 1.000e0;
CONSTANTS[15] = 0.0;
CONSTANTS[16] = 2.500e2;
CONSTANTS[17] = 8.600e1;
CONSTANTS[18] = 0.0;
CONSTANTS[19] = 1.5e2;
CONSTANTS[20] = 1.5e2;
CONSTANTS[21] = 2.226e-1;
CONSTANTS[22] = 2.226e-1;
CONSTANTS[23] = 1.464e8;
CONSTANTS[24] = 1.464e8;
CONSTANTS[25] = 2.000e8;
CONSTANTS[26] = 0.0;
CONSTANTS[27] = 3.500e-1;
CONSTANTS[28] = 3.412e-2;
CONSTANTS[29] = 1.000e-3;
CONSTANTS[30] = 1.000e1;
CONSTANTS[31] = 0.0;
CONSTANTS[32] = 3.000e6;
CONSTANTS[33] = 3.000e6;
CONSTANTS[34] = 1.684e4;
CONSTANTS[35] = 1.013e1;
CONSTANTS[36] = 1.306e1;
CONSTANTS[37] = (CONSTANTS[16]+CONSTANTS[18])/CONSTANTS[17];
CONSTANTS[38] = 1.00000/(1.00000+CONSTANTS[37]/CONSTANTS[21]);
CONSTANTS[39] = CONSTANTS[37]/(CONSTANTS[19]+CONSTANTS[37]);
CONSTANTS[40] = CONSTANTS[37]/(CONSTANTS[20]+CONSTANTS[37]);
CONSTANTS[41] = 1.00000/(1.00000+CONSTANTS[37]/CONSTANTS[22]);
CONSTANTS[42] = CONSTANTS[38];
CONSTANTS[43] = CONSTANTS[39];
RATES[0] = 0.1001;
RATES[1] = 0.1001;
RATES[2] = 0.1001;
RATES[3] = 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]*(ALGEBRAIC[2]/(CONSTANTS[1]+ALGEBRAIC[2])) - CONSTANTS[3]*STATES[0]*(1.00000/(1.00000+ALGEBRAIC[2]/CONSTANTS[2]));
resid[1] = RATES[1] - CONSTANTS[3]*STATES[0]*(1.00000/(1.00000+ALGEBRAIC[2]/CONSTANTS[2])) - CONSTANTS[4]*STATES[1];
resid[2] = RATES[2] - CONSTANTS[5]*CONSTANTS[8]*ALGEBRAIC[8] - CONSTANTS[6]*STATES[2]*(ALGEBRAIC[2]/(CONSTANTS[7]+ALGEBRAIC[2]));
resid[3] = RATES[3] - CONSTANTS[11]*ALGEBRAIC[1] - CONSTANTS[12]*ALGEBRAIC[0];
}
void
computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[4] = ( CONSTANTS[23]*STATES[0]+ CONSTANTS[24]*STATES[1])*CONSTANTS[42]*(1.00000 - ALGEBRAIC[3]/CONSTANTS[25]);
ALGEBRAIC[7] = ALGEBRAIC[6]*(1.00000+ CONSTANTS[29]*ALGEBRAIC[3]+ CONSTANTS[28]*CONSTANTS[30]);
ALGEBRAIC[9] = CONSTANTS[34]*(1.00000 - ALGEBRAIC[7]/ALGEBRAIC[5]);
ALGEBRAIC[10] = - CONSTANTS[35]*ALGEBRAIC[7];
ALGEBRAIC[11] = ALGEBRAIC[9]+CONSTANTS[31];
}
void
computeEssentialVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[0] = STATES[2] - CONSTANTS[9];
ALGEBRAIC[1] = STATES[1] - CONSTANTS[10];
ALGEBRAIC[2] = ( CONSTANTS[13]*CONSTANTS[12]*STATES[2]+CONSTANTS[15])/CONSTANTS[14];
ALGEBRAIC[3] = ( ( CONSTANTS[23]*STATES[0]+ CONSTANTS[24]*STATES[1])*CONSTANTS[42]+CONSTANTS[26])/(( ( CONSTANTS[23]*STATES[0]+ CONSTANTS[24]*STATES[1])*CONSTANTS[42])/CONSTANTS[25]+CONSTANTS[27]);
ALGEBRAIC[5] = ( CONSTANTS[32]*STATES[0]+ CONSTANTS[33]*STATES[1])*CONSTANTS[43];
ALGEBRAIC[6] = (ALGEBRAIC[5]/(1.00000+ CONSTANTS[29]*ALGEBRAIC[3]+ CONSTANTS[28]*CONSTANTS[30]))*((CONSTANTS[34]+CONSTANTS[31])/(CONSTANTS[34]+ CONSTANTS[35]*ALGEBRAIC[5]));
ALGEBRAIC[8] = ALGEBRAIC[6]/(CONSTANTS[36]+ALGEBRAIC[6]);
}
void
getStateInformation(double* SI)
{
SI[0] = 1.0;
SI[1] = 1.0;
SI[2] = 1.0;
SI[3] = 1.0;
}
void
computeRoots(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
}
