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 4 entries in each of the rate and state variable arrays.
There are a total of 9 entries in the constant variable array.
*/
/*
* VOI is time in component environment (day).
* CONSTANTS[0] is lambda in component uninfected (first_order_rate_constant).
* CONSTANTS[1] is d in component uninfected (first_order_rate_constant).
* CONSTANTS[2] is beta in component infected (first_order_rate_constant).
* STATES[0] is v in component virus (dimensionless).
* STATES[1] is x in component uninfected (dimensionless).
* CONSTANTS[3] is a in component infected (first_order_rate_constant).
* CONSTANTS[4] is p in component infected (first_order_rate_constant).
* STATES[2] is z in component CTL (dimensionless).
* STATES[3] is y in component infected (dimensionless).
* CONSTANTS[5] is k in component virus (first_order_rate_constant).
* CONSTANTS[6] is u in component virus (first_order_rate_constant).
* CONSTANTS[7] is c in component CTL (first_order_rate_constant).
* CONSTANTS[8] is b in component CTL (first_order_rate_constant).
* RATES[1] is d/dt x in component uninfected (dimensionless).
* RATES[3] is d/dt y in component infected (dimensionless).
* RATES[0] is d/dt v in component virus (dimensionless).
* RATES[2] is d/dt z in component CTL (dimensionless).
*/
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
CONSTANTS[0] = 1;
CONSTANTS[1] = 0.01;
CONSTANTS[2] = 0.02;
STATES[0] = 10;
STATES[1] = 100;
CONSTANTS[3] = 0.5;
CONSTANTS[4] = 1;
STATES[2] = 1;
STATES[3] = 0;
CONSTANTS[5] = 1;
CONSTANTS[6] = 1;
CONSTANTS[7] = 1;
CONSTANTS[8] = 0.05;
}
void
computeRates(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
RATES[1] = (CONSTANTS[0] - CONSTANTS[1]*STATES[1]) - CONSTANTS[2]*STATES[1]*STATES[0];
RATES[3] = ( CONSTANTS[2]*STATES[1]*STATES[0] - CONSTANTS[3]*STATES[3]) - CONSTANTS[4]*STATES[3]*STATES[2];
RATES[0] = CONSTANTS[5]*STATES[3] - CONSTANTS[6]*STATES[0];
RATES[2] = CONSTANTS[7]*STATES[3]*STATES[2] - CONSTANTS[8]*STATES[2];
}
void
computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
}
