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 5 entries in each of the rate and state variable arrays. There are a total of 11 entries in the constant variable array. */ /* * VOI is time in component environment (second). * STATES[0] is T in component T (dimensionless). * CONSTANTS[0] is delta in component model_parameters (first_order_rate_constant). * CONSTANTS[1] is gamma in component model_parameters (first_order_rate_constant). * CONSTANTS[2] is lambda in component model_parameters (first_order_rate_constant). * STATES[1] is v in component v (dimensionless). * STATES[2] is I in component I (dimensionless). * CONSTANTS[3] is alpha in component model_parameters (first_order_rate_constant). * STATES[3] is x in component x (dimensionless). * CONSTANTS[4] is r in component model_parameters (first_order_rate_constant). * STATES[4] is y in component y (dimensionless). * CONSTANTS[5] is k in component model_parameters (dimensionless). * CONSTANTS[6] is d in component model_parameters (first_order_rate_constant). * CONSTANTS[7] is beta in component model_parameters (first_order_rate_constant). * CONSTANTS[8] is a in component model_parameters (first_order_rate_constant). * CONSTANTS[9] is u in component model_parameters (first_order_rate_constant). * CONSTANTS[10] is eta in component model_parameters (first_order_rate_constant). * RATES[0] is d/dt T in component T (dimensionless). * RATES[2] is d/dt I in component I (dimensionless). * RATES[3] is d/dt x in component x (dimensionless). * RATES[4] is d/dt y in component y (dimensionless). * RATES[1] is d/dt v in component v (dimensionless). */ void initConsts(double* CONSTANTS, double* RATES, double *STATES) { STATES[0] = 1000.0; CONSTANTS[0] = 0.01; CONSTANTS[1] = 0.005; CONSTANTS[2] = 1.0; STATES[1] = 0.0001; STATES[2] = 0.0001; CONSTANTS[3] = 0.2; STATES[3] = 10.0; CONSTANTS[4] = 1.0; STATES[4] = 0.0; CONSTANTS[5] = 10.0; CONSTANTS[6] = 0.001; CONSTANTS[7] = 0.3; CONSTANTS[8] = 0.2; CONSTANTS[9] = 1.0; CONSTANTS[10] = 1.0; } void computeRates(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC) { RATES[0] = CONSTANTS[2] - ( CONSTANTS[0]*STATES[0]+ CONSTANTS[1]*STATES[0]*STATES[1]); RATES[2] = CONSTANTS[1]*STATES[0]*STATES[1] - CONSTANTS[3]*STATES[2]; RATES[3] = CONSTANTS[4]*STATES[3]*STATES[1]*(1.00000 - (STATES[3]+STATES[4])/CONSTANTS[5]) - ( CONSTANTS[6]*STATES[3]+ CONSTANTS[7]*STATES[3]*STATES[1]); RATES[4] = ( CONSTANTS[7]*STATES[3]*STATES[1]+ CONSTANTS[4]*STATES[4]*STATES[1]*(1.00000 - (STATES[3]+STATES[4])/CONSTANTS[5])) - CONSTANTS[8]*STATES[4]; RATES[1] = CONSTANTS[10]*(STATES[4]+STATES[2]) - CONSTANTS[9]*STATES[1]; } void computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC) { }