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 5 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 26 entries in the constant variable array.
 */
/*
 * VOI is time in component environment (second).
 * STATES[0] is R_des in component R_des (micromolar).
 * CONSTANTS[24] is K_plus in component model_parameters (per_micromolar_per_second).
 * STATES[1] is C_cyto in component C_cyto (micromolar).
 * CONSTANTS[0] is n_i in component model_parameters (dimensionless).
 * CONSTANTS[1] is K_act in component model_parameters (micromolar).
 * CONSTANTS[2] is n_a in component model_parameters (dimensionless).
 * CONSTANTS[3] is K_minus in component model_parameters (per_second).
 * CONSTANTS[4] is K_1 in component model_parameters (per_second).
 * CONSTANTS[5] is b in component model_parameters (per_second).
 * ALGEBRAIC[2] is I_ra in component I_ra (micromolar).
 * CONSTANTS[6] is Ca_tot in component model_parameters (micromolar).
 * CONSTANTS[7] is alpha in component model_parameters (dimensionless).
 * CONSTANTS[8] is V_MP in component model_parameters (micromolar_per_second).
 * CONSTANTS[9] is n_p in component model_parameters (dimensionless).
 * CONSTANTS[10] is K_p in component model_parameters (micromolar).
 * ALGEBRAIC[0] is I_rable in component I_rable (micromolar).
 * STATES[2] is IP3 in component IP3 (micromolar).
 * CONSTANTS[11] is K_IP in component model_parameters (micromolar).
 * CONSTANTS[25] is V_PLC in component V_PLC (micromolar).
 * ALGEBRAIC[1] is V_3K in component V_3K (micromolar).
 * ALGEBRAIC[3] is V_5P in component V_5P (micromolar).
 * CONSTANTS[12] is V_plc in component model_parameters (micromolar_per_second).
 * CONSTANTS[13] is gamma in component model_parameters (dimensionless).
 * CONSTANTS[14] is V_k in component model_parameters (micromolar_per_second).
 * CONSTANTS[15] is K_k in component model_parameters (micromolar).
 * CONSTANTS[16] is n_d in component model_parameters (dimensionless).
 * CONSTANTS[17] is K_d in component model_parameters (micromolar).
 * STATES[3] is IP4 in component IP4 (micromolar).
 * CONSTANTS[18] is V_p1 in component model_parameters (micromolar_per_second).
 * CONSTANTS[19] is K_p1 in component model_parameters (micromolar).
 * CONSTANTS[20] is K_p2 in component model_parameters (micromolar).
 * ALGEBRAIC[4] is V_15P in component V_15P (micromolar).
 * CONSTANTS[21] is k in component model_parameters (per_second).
 * CONSTANTS[22] is V_p2 in component model_parameters (micromolar_per_second).
 * CONSTANTS[23] is K_inh in component model_parameters (micromolar).
 * RATES[0] is d/dt R_des in component R_des (micromolar).
 * RATES[1] is d/dt C_cyto in component C_cyto (micromolar).
 * RATES[2] is d/dt IP3 in component IP3 (micromolar).
 * RATES[3] is d/dt IP4 in component IP4 (micromolar).
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
STATES[0] = 0.1;
STATES[1] = 0.1;
CONSTANTS[0] = 4;
CONSTANTS[1] = 0.56;
CONSTANTS[2] = 3;
CONSTANTS[3] = 0.5;
CONSTANTS[4] = 2.57;
CONSTANTS[5] = 7e-4;
CONSTANTS[6] = 80;
CONSTANTS[7] = 0.1;
CONSTANTS[8] = 4;
CONSTANTS[9] = 2;
CONSTANTS[10] = 0.35;
STATES[2] = 0.1;
CONSTANTS[11] = 1;
CONSTANTS[12] = 1.3;
CONSTANTS[13] = 0.2;
CONSTANTS[14] = 0.5;
CONSTANTS[15] = 1;
CONSTANTS[16] = 2;
CONSTANTS[17] = 0.3;
STATES[3] = 0.1;
CONSTANTS[18] = 5;
CONSTANTS[19] = 10;
CONSTANTS[20] = 2;
CONSTANTS[21] = 0.01;
CONSTANTS[22] = 0.2;
CONSTANTS[23] = 0.15;
CONSTANTS[24] = CONSTANTS[3]/pow(CONSTANTS[23], CONSTANTS[0]);
CONSTANTS[25] =  CONSTANTS[13]*CONSTANTS[12]*1.00000;
}
void
computeRates(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
RATES[0] =  CONSTANTS[24]*pow(STATES[1], CONSTANTS[0])*1.00000*( ((1.00000 - STATES[0])/(1.00000+pow(STATES[1]/CONSTANTS[1], CONSTANTS[2])))*1.00000) -  CONSTANTS[3]*STATES[0];
ALGEBRAIC[0] = ( (1.00000 - STATES[0])*STATES[2])/(CONSTANTS[11]+STATES[2]);
ALGEBRAIC[2] = ( ALGEBRAIC[0]*1.00000)/(1.00000+pow(CONSTANTS[1]/STATES[1], CONSTANTS[2]));
RATES[1] =  CONSTANTS[4]*1.00000*( CONSTANTS[5]*1.00000+ ALGEBRAIC[2]*1.00000)*( (CONSTANTS[6] -  STATES[1]*(CONSTANTS[7]+1.00000))*1.00000) -  CONSTANTS[8]*( (pow(STATES[1], CONSTANTS[9])/(pow(CONSTANTS[10], CONSTANTS[9])+pow(STATES[1], CONSTANTS[9])))*1.00000);
ALGEBRAIC[1] =  CONSTANTS[14]*(STATES[2]/(CONSTANTS[15]+STATES[2]))*(pow(STATES[1], CONSTANTS[16])/(pow(CONSTANTS[17], CONSTANTS[16])+pow(STATES[1], CONSTANTS[16])))*1.00000;
ALGEBRAIC[3] =  CONSTANTS[18]*1.00000*(STATES[2]/( CONSTANTS[19]*(1.00000+STATES[3]/CONSTANTS[20])+STATES[2]));
RATES[2] = ((CONSTANTS[25] - ALGEBRAIC[1]) - ALGEBRAIC[3])/1.00000;
ALGEBRAIC[4] = ( CONSTANTS[22]*1.00000*STATES[3])/( CONSTANTS[20]*(1.00000+STATES[2]/CONSTANTS[19])+STATES[3]);
RATES[3] =  (ALGEBRAIC[1] - ALGEBRAIC[4])*1.00000 -  CONSTANTS[21]*STATES[3];
}
void
computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[0] = ( (1.00000 - STATES[0])*STATES[2])/(CONSTANTS[11]+STATES[2]);
ALGEBRAIC[2] = ( ALGEBRAIC[0]*1.00000)/(1.00000+pow(CONSTANTS[1]/STATES[1], CONSTANTS[2]));
ALGEBRAIC[1] =  CONSTANTS[14]*(STATES[2]/(CONSTANTS[15]+STATES[2]))*(pow(STATES[1], CONSTANTS[16])/(pow(CONSTANTS[17], CONSTANTS[16])+pow(STATES[1], CONSTANTS[16])))*1.00000;
ALGEBRAIC[3] =  CONSTANTS[18]*1.00000*(STATES[2]/( CONSTANTS[19]*(1.00000+STATES[3]/CONSTANTS[20])+STATES[2]));
ALGEBRAIC[4] = ( CONSTANTS[22]*1.00000*STATES[3])/( CONSTANTS[20]*(1.00000+STATES[2]/CONSTANTS[19])+STATES[3]);
}