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 10 entries in the algebraic variable array.
   There are a total of 31 entries in each of the rate and state variable arrays.
   There are a total of 50 entries in the constant variable array.
 */
/*
 * VOI is time in component environment (second).
 * ALGEBRAIC[1] is LRG in component beta_adrenergic_receptor_module (micromolar).
 * ALGEBRAIC[2] is RG in component beta_adrenergic_receptor_module (micromolar).
 * ALGEBRAIC[0] is LR in component beta_adrenergic_receptor_module (micromolar).
 * STATES[0] is beta1_AR in component beta_adrenergic_receptor_module (micromolar).
 * STATES[1] is Gs in component beta_adrenergic_receptor_module (micromolar).
 * STATES[2] is beta1_ARact in component beta_adrenergic_receptor_module (micromolar).
 * STATES[3] is beta1_AR_S464 in component beta_adrenergic_receptor_module (micromolar).
 * STATES[4] is beta1_AR_S301 in component beta_adrenergic_receptor_module (micromolar).
 * STATES[5] is L in component beta_adrenergic_receptor_module (micromolar).
 * CONSTANTS[0] is Ltotmax in component beta_adrenergic_receptor_module (micromolar).
 * CONSTANTS[1] is KL in component beta_adrenergic_receptor_module (micromolar).
 * CONSTANTS[2] is KR in component beta_adrenergic_receptor_module (micromolar).
 * CONSTANTS[3] is KC in component beta_adrenergic_receptor_module (micromolar).
 * CONSTANTS[4] is Gstot in component beta_adrenergic_receptor_module (micromolar).
 * CONSTANTS[5] is k_betaARK_plus in component beta_adrenergic_receptor_module (first_order_rate_constant).
 * CONSTANTS[6] is k_betaARK_minus in component beta_adrenergic_receptor_module (first_order_rate_constant).
 * CONSTANTS[7] is k_PKA_plus in component beta_adrenergic_receptor_module (second_order_rate_constant).
 * CONSTANTS[8] is k_PKA_minus in component beta_adrenergic_receptor_module (first_order_rate_constant).
 * STATES[6] is Gs_beta_gamma in component Gs_activation_module (micromolar).
 * STATES[20] is PKACI in component PKA_activation_module (micromolar).
 * STATES[7] is Gs_alpha_GTPtot in component Gs_activation_module (micromolar).
 * STATES[8] is Gs_alpha_GDP in component Gs_activation_module (micromolar).
 * CONSTANTS[9] is k_gact in component Gs_activation_module (first_order_rate_constant).
 * CONSTANTS[10] is k_hyd in component Gs_activation_module (first_order_rate_constant).
 * CONSTANTS[11] is k_reassoc in component Gs_activation_module (second_order_rate_constant).
 * STATES[9] is cAMPtot in component cyclic_AMP_metabolism_module (micromolar).
 * STATES[10] is AC in component cyclic_AMP_metabolism_module (micromolar).
 * STATES[11] is Gs_alpha_GTP in component cyclic_AMP_metabolism_module (micromolar).
 * ALGEBRAIC[3] is Gs_alpha_GTP_AC in component cyclic_AMP_metabolism_module (micromolar).
 * STATES[12] is PDE in component cyclic_AMP_metabolism_module (micromolar).
 * CONSTANTS[12] is ACtot in component cyclic_AMP_metabolism_module (micromolar).
 * CONSTANTS[13] is ATP in component cyclic_AMP_metabolism_module (micromolar).
 * CONSTANTS[14] is PDEtot in component cyclic_AMP_metabolism_module (micromolar).
 * ALGEBRAIC[5] is PDEinhib in component cyclic_AMP_metabolism_module (micromolar).
 * CONSTANTS[15] is IBMXtot in component cyclic_AMP_metabolism_module (micromolar).
 * STATES[13] is IBMX in component cyclic_AMP_metabolism_module (micromolar).
 * CONSTANTS[16] is fsktot in component cyclic_AMP_metabolism_module (micromolar).
 * STATES[14] is fsk in component cyclic_AMP_metabolism_module (micromolar).
 * ALGEBRAIC[4] is fsk_AC in component cyclic_AMP_metabolism_module (micromolar).
 * CONSTANTS[17] is kAC_basal in component cyclic_AMP_metabolism_module (first_order_rate_constant).
 * CONSTANTS[18] is kAC_fsk in component cyclic_AMP_metabolism_module (first_order_rate_constant).
 * CONSTANTS[19] is k_PDE in component cyclic_AMP_metabolism_module (first_order_rate_constant).
 * CONSTANTS[20] is kAC_Gs_alpha in component cyclic_AMP_metabolism_module (first_order_rate_constant).
 * CONSTANTS[21] is Km_basal in component cyclic_AMP_metabolism_module (micromolar).
 * CONSTANTS[22] is Km_PDE in component cyclic_AMP_metabolism_module (micromolar).
 * CONSTANTS[23] is Km_fsk in component cyclic_AMP_metabolism_module (micromolar).
 * CONSTANTS[24] is K_fsk in component cyclic_AMP_metabolism_module (micromolar).
 * CONSTANTS[25] is Km_Gs_alpha_GTP in component cyclic_AMP_metabolism_module (micromolar).
 * CONSTANTS[26] is K_Gs_alpha in component cyclic_AMP_metabolism_module (micromolar).
 * CONSTANTS[27] is K_IBMX in component cyclic_AMP_metabolism_module (micromolar).
 * STATES[21] is cAMP in component PKA_activation_module (micromolar).
 * STATES[22] is PKACII in component PKA_activation_module (micromolar).
 * STATES[23] is PKAtemp in component PKA_activation_module (micromolar).
 * STATES[24] is ARCI in component PKA_activation_module (micromolar).
 * STATES[25] is A2RCI in component PKA_activation_module (micromolar).
 * STATES[26] is A2RI in component PKA_activation_module (micromolar).
 * STATES[27] is A2RCII in component PKA_activation_module (micromolar).
 * STATES[28] is A2RII in component PKA_activation_module (micromolar).
 * STATES[29] is ARCII in component PKA_activation_module (micromolar).
 * CONSTANTS[28] is Ki_pki in component PKA_activation_module (micromolar).
 * CONSTANTS[29] is PKAItot in component PKA_activation_module (micromolar).
 * CONSTANTS[30] is PKAIItot in component PKA_activation_module (micromolar).
 * CONSTANTS[31] is PKItot in component PKA_activation_module (micromolar).
 * CONSTANTS[32] is KA in component PKA_activation_module (micromolar).
 * CONSTANTS[33] is KB in component PKA_activation_module (micromolar).
 * CONSTANTS[34] is KD in component PKA_activation_module (micromolar).
 * CONSTANTS[35] is KPKI in component PKA_activation_module (micromolar).
 * STATES[30] is PKI in component PKA_activation_module (micromolar).
 * ALGEBRAIC[8] is fracPLBp in component phospholamban_regulation_module (dimensionless).
 * ALGEBRAIC[9] is fracPLB in component phospholamban_regulation_module (dimensionless).
 * CONSTANTS[36] is fracPLBo in component phospholamban_regulation_module (dimensionless).
 * STATES[15] is PLBp in component phospholamban_regulation_module (micromolar).
 * ALGEBRAIC[7] is PLB in component phospholamban_regulation_module (micromolar).
 * STATES[16] is Inhib1ptot in component phospholamban_regulation_module (micromolar).
 * STATES[17] is Inhib1 in component phospholamban_regulation_module (micromolar).
 * STATES[18] is Inhib1p in component phospholamban_regulation_module (micromolar).
 * ALGEBRAIC[6] is PP1_Inhib1p in component phospholamban_regulation_module (micromolar).
 * STATES[19] is PP1 in component phospholamban_regulation_module (micromolar).
 * CONSTANTS[37] is PP1tot in component phospholamban_regulation_module (micromolar).
 * CONSTANTS[38] is PLBtot in component phospholamban_regulation_module (micromolar).
 * CONSTANTS[39] is Inhib1tot in component phospholamban_regulation_module (micromolar).
 * CONSTANTS[40] is epsilon in component phospholamban_regulation_module (dimensionless).
 * CONSTANTS[41] is kPKA_PLB in component phospholamban_regulation_module (first_order_rate_constant).
 * CONSTANTS[42] is KmPKA_PLB in component phospholamban_regulation_module (micromolar).
 * CONSTANTS[43] is kPKA_Inhib1 in component phospholamban_regulation_module (first_order_rate_constant).
 * CONSTANTS[44] is kPP1_PLB in component phospholamban_regulation_module (first_order_rate_constant).
 * CONSTANTS[45] is KmPP1_PLB in component phospholamban_regulation_module (micromolar).
 * CONSTANTS[46] is KmPKA_Inhib1 in component phospholamban_regulation_module (micromolar).
 * CONSTANTS[47] is VmaxPP2A_Inhib1 in component phospholamban_regulation_module (flux).
 * CONSTANTS[48] is KmPP2A_Inhib1 in component phospholamban_regulation_module (micromolar).
 * CONSTANTS[49] is KInhib1 in component phospholamban_regulation_module (micromolar).
 * RATES[5] is d/dt L in component beta_adrenergic_receptor_module (micromolar).
 * RATES[1] is d/dt Gs in component beta_adrenergic_receptor_module (micromolar).
 * RATES[0] is d/dt beta1_AR in component beta_adrenergic_receptor_module (micromolar).
 * RATES[2] is d/dt beta1_ARact in component beta_adrenergic_receptor_module (micromolar).
 * RATES[3] is d/dt beta1_AR_S464 in component beta_adrenergic_receptor_module (micromolar).
 * RATES[4] is d/dt beta1_AR_S301 in component beta_adrenergic_receptor_module (micromolar).
 * RATES[7] is d/dt Gs_alpha_GTPtot in component Gs_activation_module (micromolar).
 * RATES[6] is d/dt Gs_beta_gamma in component Gs_activation_module (micromolar).
 * RATES[8] is d/dt Gs_alpha_GDP in component Gs_activation_module (micromolar).
 * RATES[11] is d/dt Gs_alpha_GTP in component cyclic_AMP_metabolism_module (micromolar).
 * RATES[14] is d/dt fsk in component cyclic_AMP_metabolism_module (micromolar).
 * RATES[10] is d/dt AC in component cyclic_AMP_metabolism_module (micromolar).
 * RATES[12] is d/dt PDE in component cyclic_AMP_metabolism_module (micromolar).
 * RATES[13] is d/dt IBMX in component cyclic_AMP_metabolism_module (micromolar).
 * RATES[9] is d/dt cAMPtot in component cyclic_AMP_metabolism_module (micromolar).
 * RATES[19] is d/dt PP1 in component phospholamban_regulation_module (micromolar).
 * RATES[18] is d/dt Inhib1p in component phospholamban_regulation_module (micromolar).
 * RATES[15] is d/dt PLBp in component phospholamban_regulation_module (micromolar).
 * RATES[16] is d/dt Inhib1ptot in component phospholamban_regulation_module (micromolar).
 * RATES[17] is d/dt Inhib1 in component phospholamban_regulation_module (micromolar).
 * There are a total of 0 condition variables.
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
STATES[0] = 0.0001;
STATES[1] = 3.182;
STATES[2] = 0.01205;
STATES[3] = 0;
STATES[4] = 1.154e-3;
STATES[5] = 0.988;
CONSTANTS[0] = 1;
CONSTANTS[1] = 0.285;
CONSTANTS[2] = 0.062;
CONSTANTS[3] = 33;
CONSTANTS[4] = 3.83;
CONSTANTS[5] = 1.1e-3;
CONSTANTS[6] = 2.2e-3;
CONSTANTS[7] = 3.6e-3;
CONSTANTS[8] = 2.2e-3;
STATES[6] = 0.02569;
STATES[7] = 0.02505;
STATES[8] = 6.44e-4;
CONSTANTS[9] = 16;
CONSTANTS[10] = 0.8;
CONSTANTS[11] = 1.21e3;
STATES[9] = 0.8453;
STATES[10] = 0.04706295;
STATES[11] = 0.02241295;
STATES[12] = 0.0389;
CONSTANTS[12] = 49.7e-3;
CONSTANTS[13] = 5e3;
CONSTANTS[14] = 38.9e-3;
CONSTANTS[15] = 0;
STATES[13] = 0;
CONSTANTS[16] = 0;
STATES[14] = 0;
CONSTANTS[17] = 0.2;
CONSTANTS[18] = 7.3;
CONSTANTS[19] = 5;
CONSTANTS[20] = 8.5;
CONSTANTS[21] = 1.03e3;
CONSTANTS[22] = 1.3;
CONSTANTS[23] = 860;
CONSTANTS[24] = 44;
CONSTANTS[25] = 0.4;
CONSTANTS[26] = 0.4;
CONSTANTS[27] = 30;
CONSTANTS[28] = 0.2e-3;
CONSTANTS[29] = 0.59;
CONSTANTS[30] = 0.025;
CONSTANTS[31] = 0.18;
CONSTANTS[32] = 9.14e-3;
CONSTANTS[33] = 1.64e-3;
CONSTANTS[34] = 4.375e-3;
CONSTANTS[35] = 2e-4;
CONSTANTS[36] = 0.9613;
STATES[15] = 4.105;
STATES[16] = 0.0526;
STATES[17] = 0.2474;
STATES[18] = 6.27339e-5;
STATES[19] = 0.8374627;
CONSTANTS[37] = 0.89;
CONSTANTS[38] = 106;
CONSTANTS[39] = 0.3;
CONSTANTS[40] = 10;
CONSTANTS[41] = 54;
CONSTANTS[42] = 21;
CONSTANTS[43] = 60;
CONSTANTS[44] = 8.5;
CONSTANTS[45] = 7;
CONSTANTS[46] = 1;
CONSTANTS[47] = 14;
CONSTANTS[48] = 1;
CONSTANTS[49] = 1e-3;
STATES[20] = 0.1001;
STATES[21] = 0.1001;
STATES[22] = 0.1001;
STATES[23] = 0.1001;
STATES[24] = 0.1001;
STATES[25] = 0.1001;
STATES[26] = 0.1001;
STATES[27] = 0.1001;
STATES[28] = 0.1001;
STATES[29] = 0.1001;
STATES[30] = 0.1001;
RATES[5] = 0.1001;
RATES[1] = 0.1001;
RATES[0] = 0.1001;
RATES[2] = 0.1001;
RATES[3] = 0.1001;
RATES[4] = 0.1001;
RATES[7] = 0.1001;
RATES[6] = 0.1001;
RATES[8] = 0.1001;
RATES[11] = 0.1001;
RATES[14] = 0.1001;
RATES[10] = 0.1001;
RATES[12] = 0.1001;
RATES[13] = 0.1001;
RATES[9] = 0.1001;
RATES[19] = 0.1001;
RATES[18] = 0.1001;
RATES[15] = 0.1001;
RATES[16] = 0.1001;
RATES[17] = 0.1001;
}
void
computeResiduals(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
                 double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
resid[0] = RATES[5] - CONSTANTS[0] - (ALGEBRAIC[0]+ALGEBRAIC[1]+STATES[5]);
resid[1] = RATES[1] - CONSTANTS[4] - (ALGEBRAIC[2]+ALGEBRAIC[1]+STATES[1]);
resid[2] = RATES[0] - STATES[2] - (ALGEBRAIC[0]+ALGEBRAIC[1]+ALGEBRAIC[2]+STATES[0]);
resid[3] = RATES[2] - ( CONSTANTS[6]*STATES[3] -  CONSTANTS[5]*(ALGEBRAIC[0]+ALGEBRAIC[1]))+( CONSTANTS[8]*STATES[4] -  CONSTANTS[7]*STATES[20]*STATES[2]);
resid[4] = RATES[3] -  CONSTANTS[5]*(ALGEBRAIC[0]+ALGEBRAIC[1]) -  CONSTANTS[6]*STATES[3];
resid[5] = RATES[4] -  CONSTANTS[7]*STATES[20]*STATES[2] -  CONSTANTS[8]*STATES[4];
resid[6] = RATES[7] -  CONSTANTS[9]*(ALGEBRAIC[2]+ALGEBRAIC[1]) -  CONSTANTS[10]*STATES[7];
resid[7] = RATES[6] -  CONSTANTS[9]*(ALGEBRAIC[2]+ALGEBRAIC[1]) -  CONSTANTS[11]*STATES[8]*STATES[6];
resid[8] = RATES[8] -  CONSTANTS[10]*STATES[7] -  CONSTANTS[11]*STATES[8]*STATES[6];
resid[9] = RATES[11] - STATES[7] - (ALGEBRAIC[3]+STATES[11]);
resid[10] = RATES[14] - CONSTANTS[16] - (ALGEBRAIC[4]+STATES[14]);
resid[11] = RATES[10] - CONSTANTS[12] - (ALGEBRAIC[3]+STATES[10]);
resid[12] = RATES[12] - CONSTANTS[14] - (ALGEBRAIC[5]+STATES[12]);
resid[13] = RATES[13] - CONSTANTS[15] - (ALGEBRAIC[5]+STATES[13]);
resid[14] = RATES[9] - (( CONSTANTS[17]*STATES[10]*CONSTANTS[13])/(CONSTANTS[21]+CONSTANTS[13])+( CONSTANTS[20]*ALGEBRAIC[3]*CONSTANTS[13])/(CONSTANTS[25]+CONSTANTS[13])+( CONSTANTS[18]*ALGEBRAIC[4]*CONSTANTS[13])/(CONSTANTS[23]+CONSTANTS[13])) - ( CONSTANTS[19]*STATES[12]*STATES[9])/(CONSTANTS[22]+STATES[9]);
resid[15] = STATES[30] - ( CONSTANTS[31]*CONSTANTS[28])/(CONSTANTS[28]+STATES[20]+STATES[22]);
resid[16] = STATES[25] -  (STATES[20]/CONSTANTS[34])*STATES[20]*(1.00000+STATES[30]/CONSTANTS[28]);
resid[17] = STATES[26] -  STATES[20]*(1.00000+STATES[30]/CONSTANTS[28]);
resid[18] = STATES[27] -  (STATES[22]/CONSTANTS[34])*STATES[22]*(1.00000+STATES[30]/CONSTANTS[28]);
resid[19] = STATES[28] -  STATES[22]*(1.00000+STATES[30]/CONSTANTS[28]);
resid[20] = STATES[24] -  (CONSTANTS[32]/STATES[21])*STATES[25];
resid[21] = STATES[29] -  (CONSTANTS[32]/STATES[21])*STATES[27];
resid[22] = STATES[21] - (STATES[9] - (STATES[24]+ 2.00000*STATES[25]+ 2.00000*STATES[26])) - (STATES[29]+ 2.00000*STATES[27]+ 2.00000*STATES[28]);
resid[23] = STATES[23] - ( CONSTANTS[32]*CONSTANTS[33])/CONSTANTS[34]+( CONSTANTS[32]*STATES[21])/CONSTANTS[34]+( STATES[21]*STATES[21])/CONSTANTS[34];
resid[24] = STATES[20] -  2.00000*CONSTANTS[29]*STATES[21]*STATES[21] -  STATES[20]*(1.00000+STATES[30]/CONSTANTS[28])*( STATES[23]*STATES[20]+ STATES[21]*STATES[21]);
resid[25] = STATES[22] -  2.00000*CONSTANTS[30]*STATES[21]*STATES[21] -  STATES[22]*(1.00000+STATES[30]/CONSTANTS[28])*( STATES[23]*STATES[22]+ STATES[21]*STATES[21]);
resid[26] = RATES[19] - CONSTANTS[37] - (ALGEBRAIC[6]+STATES[19]);
resid[27] = RATES[18] - STATES[16] - (ALGEBRAIC[6]+STATES[18]);
resid[28] = RATES[15] - ( CONSTANTS[41]*STATES[20]*ALGEBRAIC[7])/(CONSTANTS[42]+ALGEBRAIC[7]) - ( CONSTANTS[44]*STATES[19]*STATES[15])/(CONSTANTS[45]+STATES[15]);
resid[29] = RATES[16] - ( CONSTANTS[43]*STATES[20]*STATES[16])/(CONSTANTS[46]+STATES[16]) - ( CONSTANTS[47]*STATES[17])/(CONSTANTS[48]+STATES[17]);
resid[30] = RATES[17] - ( CONSTANTS[47]*STATES[17])/(CONSTANTS[48]+STATES[17]) - ( CONSTANTS[43]*STATES[20]*STATES[16])/(CONSTANTS[46]+STATES[16]);
}
void
computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[8] = STATES[15]/CONSTANTS[38];
ALGEBRAIC[9] = ALGEBRAIC[7]/CONSTANTS[38];
}
void
computeEssentialVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[0] = ( STATES[5]*STATES[0])/CONSTANTS[1];
ALGEBRAIC[1] = ( STATES[5]*STATES[0]*STATES[1])/( CONSTANTS[1]*CONSTANTS[2]);
ALGEBRAIC[2] = ( STATES[0]*STATES[1])/CONSTANTS[3];
ALGEBRAIC[3] = ( STATES[11]*STATES[10])/CONSTANTS[26];
ALGEBRAIC[4] = ( STATES[14]*STATES[10])/CONSTANTS[24];
ALGEBRAIC[5] = ( STATES[12]*STATES[13])/CONSTANTS[27];
ALGEBRAIC[6] = ( STATES[19]*STATES[18])/CONSTANTS[49];
ALGEBRAIC[7] = CONSTANTS[38] - STATES[15];
}
void
getStateInformation(double* SI)
{
SI[0] = 1.0;
SI[1] = 1.0;
SI[2] = 1.0;
SI[3] = 1.0;
SI[4] = 1.0;
SI[5] = 1.0;
SI[6] = 1.0;
SI[20] = 0.0;
SI[7] = 1.0;
SI[8] = 1.0;
SI[9] = 1.0;
SI[10] = 1.0;
SI[11] = 1.0;
SI[12] = 1.0;
SI[13] = 1.0;
SI[14] = 1.0;
SI[21] = 0.0;
SI[22] = 0.0;
SI[23] = 0.0;
SI[24] = 0.0;
SI[25] = 0.0;
SI[26] = 0.0;
SI[27] = 0.0;
SI[28] = 0.0;
SI[29] = 0.0;
SI[30] = 0.0;
SI[15] = 1.0;
SI[16] = 1.0;
SI[17] = 1.0;
SI[18] = 1.0;
SI[19] = 1.0;
}
void
computeRoots(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
             double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
}