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 0 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 8 entries in the constant variable array.
*/
/*
* VOI is time in component environment (day).
* STATES[0] is T in component target_cells (dimensionless).
* CONSTANTS[0] is s in component target_cells (first_order_rate_constant).
* CONSTANTS[1] is d in component target_cells (first_order_rate_constant).
* CONSTANTS[2] is eta in component model_parameters (dimensionless).
* STATES[1] is V in component viral_load (dimensionless).
* CONSTANTS[3] is beta in component model_parameters (first_order_rate_constant).
* STATES[2] is I in component infected_cells (dimensionless).
* CONSTANTS[4] is delta in component infected_cells (first_order_rate_constant).
* CONSTANTS[5] is epsilon in component viral_load (dimensionless).
* CONSTANTS[6] is p in component viral_load (first_order_rate_constant).
* CONSTANTS[7] is c in component viral_load (first_order_rate_constant).
* RATES[0] is d/dt T in component target_cells (dimensionless).
* RATES[2] is d/dt I in component infected_cells (dimensionless).
* RATES[1] is d/dt V in component viral_load (dimensionless).
*/
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
STATES[0] = 1000;
CONSTANTS[0] = 10.0;
CONSTANTS[1] = 0.02;
CONSTANTS[2] = 0.8;
STATES[1] = 9.4e6;
CONSTANTS[3] = 3e-7;
STATES[2] = 0;
CONSTANTS[4] = 0.5;
CONSTANTS[5] = 0.99;
CONSTANTS[6] = 100.0;
CONSTANTS[7] = 5.0;
}
void
computeRates(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
RATES[0] = CONSTANTS[0] - ( CONSTANTS[1]*STATES[0]+ (1.00000 - CONSTANTS[2])*CONSTANTS[3]*STATES[1]*STATES[0]);
RATES[2] = (1.00000 - CONSTANTS[2])*CONSTANTS[3]*STATES[1]*STATES[0] - CONSTANTS[4]*STATES[2];
RATES[1] = (1.00000 - CONSTANTS[5])*CONSTANTS[6]*STATES[2] - CONSTANTS[7]*STATES[1];
}
void
computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
}
