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 6 entries in the algebraic variable array.
   There are a total of 1 entries in each of the rate and state variable arrays.
   There are a total of 29 entries in the constant variable array.
 */
/*
 * VOI is time in component environment (second).
 * CONSTANTS[0] is k_p1 in component SERCA (second_order_rate_constant).
 * CONSTANTS[1] is k_p2 in component SERCA (first_order_rate_constant).
 * CONSTANTS[2] is k_p3 in component SERCA (first_order_rate_constant).
 * CONSTANTS[3] is k_m1 in component SERCA (first_order_rate_constant).
 * CONSTANTS[4] is k_m2 in component SERCA (second_order_rate_constant).
 * CONSTANTS[5] is k_m3 in component SERCA (second_order_rate_constant).
 * CONSTANTS[6] is kdcai in component SERCA (millimolar).
 * CONSTANTS[7] is kdcasr in component SERCA (millimolar).
 * CONSTANTS[8] is kdh1 in component SERCA (millimolar).
 * CONSTANTS[9] is kdhi in component SERCA (millimolar_squared).
 * CONSTANTS[10] is kdhsr in component SERCA (millimolar_squared).
 * CONSTANTS[11] is kdh in component SERCA (millimolar).
 * CONSTANTS[12] is n in component SERCA (dimensionless).
 * CONSTANTS[13] is Ca_i in component SERCA (millimolar).
 * STATES[0] is Ca_sr in component SERCA (millimolar).
 * CONSTANTS[14] is H_i in component SERCA (millimolar).
 * CONSTANTS[15] is ATP in component SERCA (millimolar).
 * CONSTANTS[16] is ADP in component SERCA (millimolar).
 * CONSTANTS[17] is P_i in component SERCA (millimolar).
 * CONSTANTS[18] is T_Cai in component SERCA (dimensionless).
 * ALGEBRAIC[0] is T_Casr in component SERCA (dimensionless).
 * CONSTANTS[19] is T_H1 in component SERCA (dimensionless).
 * CONSTANTS[20] is T_Hi in component SERCA (dimensionless).
 * CONSTANTS[21] is T_Hsr in component SERCA (dimensionless).
 * CONSTANTS[22] is T_H in component SERCA (dimensionless).
 * CONSTANTS[23] is a_p1 in component SERCA (first_order_rate_constant).
 * CONSTANTS[24] is a_p2 in component SERCA (first_order_rate_constant).
 * ALGEBRAIC[1] is a_p3 in component SERCA (first_order_rate_constant).
 * CONSTANTS[25] is a_m1 in component SERCA (first_order_rate_constant).
 * ALGEBRAIC[2] is a_m2 in component SERCA (first_order_rate_constant).
 * CONSTANTS[26] is a_m3 in component SERCA (first_order_rate_constant).
 * ALGEBRAIC[3] is s1 in component SERCA (per_second_squared).
 * ALGEBRAIC[4] is s2 in component SERCA (per_second_squared).
 * CONSTANTS[27] is s3 in component SERCA (per_second_squared).
 * ALGEBRAIC[5] is v_cycle in component SERCA (first_order_rate_constant).
 * RATES[0] is d/dt Ca_sr in component SERCA (millimolar).
 * There are a total of 0 condition variables.
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
CONSTANTS[0] = 25900;
CONSTANTS[1] = 2540;
CONSTANTS[2] = 20.5;
CONSTANTS[3] = 16;
CONSTANTS[4] = 67200;
CONSTANTS[5] = 149;
CONSTANTS[6] = 0.9;
CONSTANTS[7] = 2.24;
CONSTANTS[8] = 1.09e-5;
CONSTANTS[9] = 3.54e-3;
CONSTANTS[10] = 1.05e-8;
CONSTANTS[11] = 7.24e-5;
CONSTANTS[12] = 2;
CONSTANTS[13] = 150e-6;
STATES[0] = 0;
CONSTANTS[14] = 1e-4;
CONSTANTS[15] = 5;
CONSTANTS[16] = 36.3e-3;
CONSTANTS[17] = 1;
CONSTANTS[18] = CONSTANTS[13]/CONSTANTS[6];
CONSTANTS[28] = 1.00000;
CONSTANTS[19] = CONSTANTS[14]/CONSTANTS[8];
CONSTANTS[20] = pow(CONSTANTS[14], CONSTANTS[12])/CONSTANTS[9];
CONSTANTS[21] = pow(CONSTANTS[14], CONSTANTS[12])/CONSTANTS[10];
CONSTANTS[22] = CONSTANTS[14]/CONSTANTS[11];
CONSTANTS[23] =  CONSTANTS[0]*CONSTANTS[15];
CONSTANTS[24] = ( CONSTANTS[1]*pow(CONSTANTS[18], 2.00000))/(pow(CONSTANTS[18], 2.00000)+ pow(CONSTANTS[18], 2.00000)*CONSTANTS[20]+ CONSTANTS[20]*(1.00000+CONSTANTS[19]));
CONSTANTS[25] = ( CONSTANTS[3]*CONSTANTS[20])/(pow(CONSTANTS[18], 2.00000)+ pow(CONSTANTS[18], 2.00000)*CONSTANTS[20]+ CONSTANTS[20]*(1.00000+CONSTANTS[19]));
CONSTANTS[26] =  CONSTANTS[5]*CONSTANTS[17];
CONSTANTS[27] =  CONSTANTS[23]*CONSTANTS[24]+ CONSTANTS[26]*CONSTANTS[25]+ CONSTANTS[26]*CONSTANTS[24];
}
void
computeResiduals(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
                 double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
resid[0] = RATES[0] - CONSTANTS[28];
}
void
computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[0] = STATES[0]/CONSTANTS[7];
ALGEBRAIC[1] = ( CONSTANTS[2]*CONSTANTS[21])/( pow(ALGEBRAIC[0], 2.00000)*CONSTANTS[22]+CONSTANTS[22]+ CONSTANTS[21]*(1.00000+CONSTANTS[22]));
ALGEBRAIC[2] = ( CONSTANTS[4]*CONSTANTS[16]*pow(ALGEBRAIC[0], 2.00000)*CONSTANTS[22])/( pow(ALGEBRAIC[0], 2.00000)*CONSTANTS[22]+CONSTANTS[22]+ CONSTANTS[21]*(1.00000+CONSTANTS[22]));
ALGEBRAIC[3] =  CONSTANTS[24]*ALGEBRAIC[1]+ CONSTANTS[25]*ALGEBRAIC[1]+ CONSTANTS[25]*ALGEBRAIC[2];
ALGEBRAIC[4] =  CONSTANTS[23]*ALGEBRAIC[1]+ ALGEBRAIC[2]*CONSTANTS[23]+ ALGEBRAIC[2]*CONSTANTS[26];
ALGEBRAIC[5] = ( CONSTANTS[23]*CONSTANTS[24]*ALGEBRAIC[1] -  CONSTANTS[25]*ALGEBRAIC[2]*CONSTANTS[26])/(ALGEBRAIC[3]+ALGEBRAIC[4]+CONSTANTS[27]);
}
void
computeEssentialVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
}
void
getStateInformation(double* SI)
{
SI[0] = 1.0;
}
void
computeRoots(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
             double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
}