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 1 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 t in component Test (second). * ALGEBRAIC[0] is J in component PingPongBiBi (mM_per_second). * STATES[0] is S1 in component Test (mM). * STATES[1] is S2 in component Test (mM). * STATES[2] is P1 in component Test (mM). * STATES[3] is P2 in component Test (mM). * CONSTANTS[0] is V_f in component Test (mM_per_second). * CONSTANTS[1] is V_b in component Test (mM_per_second). * CONSTANTS[2] is Keq in component Test (dimensionless). * CONSTANTS[3] is Km_S1 in component Test (mM). * CONSTANTS[4] is Km_S2 in component Test (mM). * CONSTANTS[5] is Km_P1 in component Test (mM). * CONSTANTS[6] is Km_P2 in component Test (mM). * CONSTANTS[7] is Ki_S1 in component Test (mM). * CONSTANTS[8] is Ki_P2 in component Test (mM). * RATES[0] is d/dt S1 in component Test (mM). * RATES[1] is d/dt S2 in component Test (mM). * RATES[2] is d/dt P1 in component Test (mM). * RATES[3] is d/dt P2 in component Test (mM). */ void initConsts(double* CONSTANTS, double* RATES, double *STATES) { STATES[0] = 2; STATES[1] = 1; STATES[2] = 1; STATES[3] = 0; CONSTANTS[0] = 10.0000; CONSTANTS[1] = 3.00000; CONSTANTS[2] = 0.200000; CONSTANTS[3] = 0.100000; CONSTANTS[4] = 0.500000; CONSTANTS[5] = 0.100000; CONSTANTS[6] = 0.500000; CONSTANTS[7] = 0.500000; CONSTANTS[8] = 0.500000; } void computeRates(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC) { ALGEBRAIC[0] = ( CONSTANTS[0]*( STATES[0]*STATES[0] - ( STATES[2]*STATES[3])/CONSTANTS[2]))/( STATES[0]*STATES[0]+ CONSTANTS[4]*STATES[0]+ CONSTANTS[3]*STATES[0]*(1.00000+STATES[3]/CONSTANTS[8])+ (CONSTANTS[0]/( CONSTANTS[1]*CONSTANTS[2]))*( CONSTANTS[6]*STATES[2]*(1.00000+STATES[0]/CONSTANTS[7])+ STATES[3]*(CONSTANTS[5]+STATES[2]))); RATES[0] = - ALGEBRAIC[0]; RATES[1] = - ALGEBRAIC[0]; RATES[2] = ALGEBRAIC[0]; RATES[3] = ALGEBRAIC[0]; } void computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC) { ALGEBRAIC[0] = ( CONSTANTS[0]*( STATES[0]*STATES[0] - ( STATES[2]*STATES[3])/CONSTANTS[2]))/( STATES[0]*STATES[0]+ CONSTANTS[4]*STATES[0]+ CONSTANTS[3]*STATES[0]*(1.00000+STATES[3]/CONSTANTS[8])+ (CONSTANTS[0]/( CONSTANTS[1]*CONSTANTS[2]))*( CONSTANTS[6]*STATES[2]*(1.00000+STATES[0]/CONSTANTS[7])+ STATES[3]*(CONSTANTS[5]+STATES[2]))); }