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 8 entries in each of the rate and state variable arrays.
There are a total of 12 entries in the constant variable array.
*/
/*
* VOI is time in component environment (minute).
* STATES[0] is Rs in component Rs (number_per_cell).
* STATES[1] is L in component L (picomolar).
* STATES[2] is Cs in component Cs (number_per_cell).
* CONSTANTS[0] is Vs in component model_parameters (number_per_cell_minute).
* CONSTANTS[1] is kf in component model_parameters (second_order_rate_constant).
* CONSTANTS[2] is kr in component model_parameters (first_order_rate_constant).
* CONSTANTS[3] is kt in component model_parameters (first_order_rate_constant).
* CONSTANTS[4] is ksyn in component model_parameters (first_order_rate_constant).
* CONSTANTS[5] is ke in component model_parameters (first_order_rate_constant).
* STATES[3] is Ri in component Ri (number_per_cell).
* STATES[4] is Li in component Li (picomolar).
* STATES[5] is Ci in component Ci (number_per_cell).
* CONSTANTS[6] is kfe in component model_parameters (second_order_rate_constant).
* CONSTANTS[7] is kre in component model_parameters (first_order_rate_constant).
* CONSTANTS[8] is kh in component model_parameters (first_order_rate_constant).
* CONSTANTS[9] is kx in component model_parameters (first_order_rate_constant).
* CONSTANTS[10] is Ve in component model_parameters (L_per_cell).
* CONSTANTS[11] is NA in component model_parameters (number_per_mole).
* STATES[6] is Ld in component Ld (number_per_cell).
* STATES[7] is Y in component Y (cell_per_L).
* RATES[0] is d/dt Rs in component Rs (number_per_cell).
* RATES[2] is d/dt Cs in component Cs (number_per_cell).
* RATES[3] is d/dt Ri in component Ri (number_per_cell).
* RATES[5] is d/dt Ci in component Ci (number_per_cell).
* RATES[4] is d/dt Li in component Li (picomolar).
* RATES[6] is d/dt Ld in component Ld (number_per_cell).
* RATES[1] is d/dt L in component L (picomolar).
* RATES[7] is d/dt Y in component Y (cell_per_L).
* There are a total of 0 condition variables.
*/
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
STATES[0] = 1500.0;
STATES[1] = 10.0;
STATES[2] = 1.0;
CONSTANTS[0] = 11;
CONSTANTS[1] = 0.0012432;
CONSTANTS[2] = 0.0138;
CONSTANTS[3] = 0.007;
CONSTANTS[4] = 0.0011;
CONSTANTS[5] = 0.04;
STATES[3] = 300.0;
STATES[4] = 0.01;
STATES[5] = 1.0;
CONSTANTS[6] = 0.0001104;
CONSTANTS[7] = 0.1104;
CONSTANTS[8] = 0.035;
CONSTANTS[9] = 0.15;
CONSTANTS[10] = 1E-14;
CONSTANTS[11] = 6.02E23;
STATES[6] = 1.0;
STATES[7] = 2.5E8;
RATES[0] = 0.1001;
RATES[2] = 0.1001;
RATES[3] = 0.1001;
RATES[5] = 0.1001;
RATES[4] = 0.1001;
RATES[6] = 0.1001;
RATES[1] = 0.1001;
RATES[7] = 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[2]+CONSTANTS[4])*STATES[2]+CONSTANTS[0]) - ( CONSTANTS[1]*STATES[1]*STATES[0]+ CONSTANTS[3]*STATES[0]);
resid[1] = RATES[2] - CONSTANTS[1]*STATES[1]*STATES[0] - (CONSTANTS[2]+CONSTANTS[5])*STATES[2];
resid[2] = RATES[3] - ( CONSTANTS[7]*STATES[5]+ CONSTANTS[3]*STATES[0]) - ( CONSTANTS[6]*STATES[4]*STATES[3]+ CONSTANTS[8]*STATES[3]);
resid[3] = RATES[5] - ( CONSTANTS[6]*STATES[4]*STATES[3]+ CONSTANTS[5]*STATES[2]) - (CONSTANTS[7]+CONSTANTS[8])*STATES[5];
resid[4] = RATES[4] - ( CONSTANTS[7]*STATES[5] - CONSTANTS[6]*STATES[4]*STATES[3])/( CONSTANTS[10]*CONSTANTS[11]) - CONSTANTS[9]*STATES[4];
resid[5] = RATES[6] - CONSTANTS[8]*STATES[5];
resid[6] = RATES[1] - ( (( CONSTANTS[2]*STATES[2]+ CONSTANTS[9]*STATES[4]*CONSTANTS[10]*CONSTANTS[11]) - CONSTANTS[1]*STATES[1]*STATES[0])*STATES[7])/CONSTANTS[11];
resid[7] = RATES[7] - multi_max(1, ( 600.000*STATES[2])/(250.000+STATES[2]) - 200.000)*1000.00;
}
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;
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;
}
void
computeRoots(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
}
