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 4 entries in the algebraic variable array.
There are a total of 2 entries in each of the rate and state variable arrays.
There are a total of 13 entries in the constant variable array.
*/
/*
* VOI is time in component environment (minute).
* ALGEBRAIC[0] is B in component B (micromolar).
* CONSTANTS[0] is F in component B (micromolar).
* CONSTANTS[1] is n2 in component B (dimensionless).
* CONSTANTS[2] is K2 in component B (per_micromolar).
* STATES[0] is Ca in component Ca (micromolar).
* ALGEBRAIC[3] is R in component R (flux).
* CONSTANTS[3] is Vmax in component R (flux).
* CONSTANTS[4] is Km in component R (micromolar).
* ALGEBRAIC[1] is fu in component R (dimensionless).
* CONSTANTS[12] is ISF in component R (dimensionless).
* CONSTANTS[5] is age in component R (dimensionless).
* STATES[1] is C in component C (micromolar).
* CONSTANTS[6] is Va in component Ca (ml).
* CONSTANTS[7] is Vv in component Ca (ml).
* CONSTANTS[8] is Qc in component model_constants (flow).
* ALGEBRAIC[2] is Cv in component Cv (micromolar).
* CONSTANTS[9] is Q in component model_constants (flow).
* CONSTANTS[10] is P in component model_constants (dimensionless).
* CONSTANTS[11] is V in component C (ml).
* RATES[0] is d/dt Ca in component Ca (micromolar).
* RATES[1] is d/dt C in component C (micromolar).
* There are a total of 0 condition variables.
*/
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
CONSTANTS[0] = 0.48;
CONSTANTS[1] = 1;
CONSTANTS[2] = 0.8532;
STATES[0] = 6.6685;
CONSTANTS[3] = 9.433e-3;
CONSTANTS[4] = 198;
CONSTANTS[5] = 5;
STATES[1] = 0;
CONSTANTS[6] = 2148;
CONSTANTS[7] = 3431;
CONSTANTS[8] = 6445.65;
CONSTANTS[9] = 1221.34;
CONSTANTS[10] = 15.61;
CONSTANTS[11] = 1454;
CONSTANTS[12] = - 8.32120+ 2.04010*CONSTANTS[5]+ 4.19620*arbitrary_log( CONSTANTS[5]*365.000, 10);
RATES[0] = 0.1001;
RATES[1] = 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[8]*(ALGEBRAIC[2] - STATES[0]))/(CONSTANTS[6]+CONSTANTS[7]);
resid[1] = RATES[1] - ( CONSTANTS[9]*(STATES[0] - STATES[1]/CONSTANTS[10]) - ALGEBRAIC[3]*1.00000)/CONSTANTS[11];
}
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[2] = (( CONSTANTS[9]*STATES[1])/CONSTANTS[10])/CONSTANTS[8];
ALGEBRAIC[0] = ( CONSTANTS[0]*CONSTANTS[1]*CONSTANTS[2]*STATES[0])/(1.00000+ CONSTANTS[2]*CONSTANTS[0]);
ALGEBRAIC[1] = CONSTANTS[0]/(CONSTANTS[0]+ALGEBRAIC[0]);
ALGEBRAIC[3] = ( CONSTANTS[12]*CONSTANTS[3]*ALGEBRAIC[1]*STATES[1])/(CONSTANTS[4]+ ALGEBRAIC[1]*STATES[1]);
}
void
getStateInformation(double* SI)
{
SI[0] = 1.0;
SI[1] = 1.0;
}
void
computeRoots(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
}
