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 2 entries in each of the rate and state variable arrays. There are a total of 4 entries in the constant variable array. */ /* * VOI is t in component all (dimensionless). * STATES[0] is x in component all (dimensionless). * STATES[1] is y in component all (dimensionless). * CONSTANTS[0] is A in component all (dimensionless). * CONSTANTS[1] is B in component all (dimensionless). * CONSTANTS[2] is C in component all (dimensionless). * CONSTANTS[3] is D in component all (dimensionless). * RATES[0] is d/dt x in component all (dimensionless). * RATES[1] is d/dt y in component all (dimensionless). */ void initConsts(double* CONSTANTS, double* RATES, double *STATES) { STATES[0] = 10; STATES[1] = 5; CONSTANTS[0] = 1.5; CONSTANTS[1] = 1; CONSTANTS[2] = 3; CONSTANTS[3] = 1; } void computeRates(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC) { RATES[0] = CONSTANTS[0]*STATES[0] - CONSTANTS[1]*STATES[0]*STATES[1]; RATES[1] = - CONSTANTS[2]*STATES[1]+ CONSTANTS[3]*STATES[0]*STATES[1]; } void computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC) { }