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 4 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 (day). * STATES[0] is A in component A (dimensionless). * CONSTANTS[0] is v_tilday in component A (first_order_rate_constant). * CONSTANTS[1] is f in component A (dimensionless). * CONSTANTS[2] is muA in component A (first_order_rate_constant). * STATES[1] is G in component G (dimensionless). * STATES[2] is R in component R (dimensionless). * CONSTANTS[3] is pi3 in component R (first_order_rate_constant). * CONSTANTS[4] is beta in component R (first_order_rate_constant). * CONSTANTS[5] is muR in component R (first_order_rate_constant). * STATES[3] is E in component E (dimensionless). * CONSTANTS[6] is lambdaE in component E (first_order_rate_constant). * CONSTANTS[7] is muE in component E (first_order_rate_constant). * CONSTANTS[8] is sigma3 in component E (first_order_rate_constant). * CONSTANTS[9] is b3 in component E (first_order_rate_constant). * CONSTANTS[10] is gamma in component G (first_order_rate_constant). * CONSTANTS[11] is muG in component G (first_order_rate_constant). * RATES[0] is d/dt A in component A (dimensionless). * RATES[2] is d/dt R in component R (dimensionless). * RATES[3] is d/dt E in component E (dimensionless). * RATES[1] is d/dt G in component G (dimensionless). * There are a total of 0 condition variables. */ void initConsts(double* CONSTANTS, double* RATES, double *STATES) { STATES[0] = 1.0; CONSTANTS[0] = 0.0025; CONSTANTS[1] = 1e-4; CONSTANTS[2] = 0.25; STATES[1] = 1e8; STATES[2] = 0.0; CONSTANTS[3] = 0.0256; CONSTANTS[4] = 200.0; CONSTANTS[5] = 0.25; STATES[3] = 0.0; CONSTANTS[6] = 1000.0; CONSTANTS[7] = 0.25; CONSTANTS[8] = 3e-6; CONSTANTS[9] = 0.25; CONSTANTS[10] = 2000.0; CONSTANTS[11] = 5.0; RATES[0] = 0.1001; RATES[2] = 0.1001; RATES[3] = 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[1]*CONSTANTS[0]*STATES[1] - CONSTANTS[2]*STATES[0]; resid[1] = RATES[2] - ( CONSTANTS[3]*STATES[3]+CONSTANTS[4])*STATES[0] - CONSTANTS[5]*STATES[2]; resid[2] = RATES[3] - CONSTANTS[6]*STATES[0] - ( ( CONSTANTS[8]*STATES[2]+CONSTANTS[9])*STATES[3]+ CONSTANTS[7]*STATES[3]); resid[3] = RATES[1] - CONSTANTS[10]*STATES[3] - ( CONSTANTS[0]*STATES[1]+ CONSTANTS[11]*STATES[1]); } 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; } void computeRoots(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES, double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS) { }