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 21 entries in the algebraic variable array.
   There are a total of 20 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[5] is LRG in component beta_adrenergic_receptor_module (micromolar).
 * ALGEBRAIC[7] 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).
 * ALGEBRAIC[9] 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[2] 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[1] 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[6] 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).
 * ALGEBRAIC[10] is cAMP in component PKA_activation_module (micromolar).
 * ALGEBRAIC[11] is PKACII in component PKA_activation_module (micromolar).
 * ALGEBRAIC[12] is PKAtemp in component PKA_activation_module (micromolar).
 * ALGEBRAIC[13] is ARCI in component PKA_activation_module (micromolar).
 * ALGEBRAIC[14] is A2RCI in component PKA_activation_module (micromolar).
 * ALGEBRAIC[15] is A2RI in component PKA_activation_module (micromolar).
 * ALGEBRAIC[16] is A2RCII in component PKA_activation_module (micromolar).
 * ALGEBRAIC[17] is A2RII in component PKA_activation_module (micromolar).
 * ALGEBRAIC[18] 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).
 * ALGEBRAIC[19] is PKI in component PKA_activation_module (micromolar).
 * ALGEBRAIC[3] is fracPLBp in component phospholamban_regulation_module (dimensionless).
 * ALGEBRAIC[20] 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[8] 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[4] 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).
 */
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;
}
void
computeRates(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
RATES[8] =  CONSTANTS[10]*STATES[7] -  CONSTANTS[11]*STATES[8]*STATES[6];
ALGEBRAIC[2] = ( STATES[11]*STATES[10])/CONSTANTS[26];
RATES[11] = STATES[7] - (ALGEBRAIC[2]+STATES[11]);
RATES[10] = CONSTANTS[12] - (ALGEBRAIC[2]+STATES[10]);
ALGEBRAIC[1] = ( STATES[12]*STATES[13])/CONSTANTS[27];
RATES[12] = CONSTANTS[14] - (ALGEBRAIC[1]+STATES[12]);
RATES[13] = CONSTANTS[15] - (ALGEBRAIC[1]+STATES[13]);
ALGEBRAIC[4] = ( STATES[19]*STATES[18])/CONSTANTS[49];
RATES[19] = CONSTANTS[37] - (ALGEBRAIC[4]+STATES[19]);
RATES[18] = STATES[16] - (ALGEBRAIC[4]+STATES[18]);
ALGEBRAIC[5] = ( STATES[5]*STATES[0]*STATES[1])/( CONSTANTS[1]*CONSTANTS[2]);
ALGEBRAIC[0] = ( STATES[5]*STATES[0])/CONSTANTS[1];
RATES[5] = CONSTANTS[0] - (ALGEBRAIC[0]+ALGEBRAIC[5]+STATES[5]);
RATES[3] =  CONSTANTS[5]*(ALGEBRAIC[0]+ALGEBRAIC[5]) -  CONSTANTS[6]*STATES[3];
ALGEBRAIC[6] = ( STATES[14]*STATES[10])/CONSTANTS[24];
RATES[14] = CONSTANTS[16] - (ALGEBRAIC[6]+STATES[14]);
RATES[9] = (( CONSTANTS[17]*STATES[10]*CONSTANTS[13])/(CONSTANTS[21]+CONSTANTS[13])+( CONSTANTS[20]*ALGEBRAIC[2]*CONSTANTS[13])/(CONSTANTS[25]+CONSTANTS[13])+( CONSTANTS[18]*ALGEBRAIC[6]*CONSTANTS[13])/(CONSTANTS[23]+CONSTANTS[13])) - ( CONSTANTS[19]*STATES[12]*STATES[9])/(CONSTANTS[22]+STATES[9]);
ALGEBRAIC[7] = ( STATES[0]*STATES[1])/CONSTANTS[3];
RATES[1] = CONSTANTS[4] - (ALGEBRAIC[7]+ALGEBRAIC[5]+STATES[1]);
RATES[0] = STATES[2] - (ALGEBRAIC[0]+ALGEBRAIC[5]+ALGEBRAIC[7]+STATES[0]);
RATES[7] =  CONSTANTS[9]*(ALGEBRAIC[7]+ALGEBRAIC[5]) -  CONSTANTS[10]*STATES[7];
RATES[6] =  CONSTANTS[9]*(ALGEBRAIC[7]+ALGEBRAIC[5]) -  CONSTANTS[11]*STATES[8]*STATES[6];
rootfind_0(VOI, CONSTANTS, RATES, STATES, ALGEBRAIC, pret);
RATES[2] = ( CONSTANTS[6]*STATES[3] -  CONSTANTS[5]*(ALGEBRAIC[0]+ALGEBRAIC[5]))+( CONSTANTS[8]*STATES[4] -  CONSTANTS[7]*ALGEBRAIC[9]*STATES[2]);
RATES[4] =  CONSTANTS[7]*ALGEBRAIC[9]*STATES[2] -  CONSTANTS[8]*STATES[4];
ALGEBRAIC[8] = CONSTANTS[38] - STATES[15];
RATES[15] = ( CONSTANTS[41]*ALGEBRAIC[9]*ALGEBRAIC[8])/(CONSTANTS[42]+ALGEBRAIC[8]) - ( CONSTANTS[44]*STATES[19]*STATES[15])/(CONSTANTS[45]+STATES[15]);
RATES[16] = ( CONSTANTS[43]*ALGEBRAIC[9]*STATES[16])/(CONSTANTS[46]+STATES[16]) - ( CONSTANTS[47]*STATES[17])/(CONSTANTS[48]+STATES[17]);
RATES[17] = ( CONSTANTS[47]*STATES[17])/(CONSTANTS[48]+STATES[17]) - ( CONSTANTS[43]*ALGEBRAIC[9]*STATES[16])/(CONSTANTS[46]+STATES[16]);
}
void
computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[2] = ( STATES[11]*STATES[10])/CONSTANTS[26];
ALGEBRAIC[1] = ( STATES[12]*STATES[13])/CONSTANTS[27];
ALGEBRAIC[4] = ( STATES[19]*STATES[18])/CONSTANTS[49];
ALGEBRAIC[5] = ( STATES[5]*STATES[0]*STATES[1])/( CONSTANTS[1]*CONSTANTS[2]);
ALGEBRAIC[0] = ( STATES[5]*STATES[0])/CONSTANTS[1];
ALGEBRAIC[6] = ( STATES[14]*STATES[10])/CONSTANTS[24];
ALGEBRAIC[7] = ( STATES[0]*STATES[1])/CONSTANTS[3];
ALGEBRAIC[8] = CONSTANTS[38] - STATES[15];
ALGEBRAIC[3] = STATES[15]/CONSTANTS[38];
ALGEBRAIC[20] = ALGEBRAIC[8]/CONSTANTS[38];
}

void objfunc_0(double *p, double *hx, int m, int n, void *adata)
{
  struct rootfind_info* rfi = (struct rootfind_info*)adata;
#define VOI rfi->aVOI
#define CONSTANTS rfi->aCONSTANTS
#define RATES rfi->aRATES
#define STATES rfi->aSTATES
#define ALGEBRAIC rfi->aALGEBRAIC
#define pret rfi->aPRET
  ALGEBRAIC[9] = p[0];
  ALGEBRAIC[10] = p[1];
  ALGEBRAIC[11] = p[2];
  ALGEBRAIC[12] = p[3];
  ALGEBRAIC[13] = p[4];
  ALGEBRAIC[14] = p[5];
  ALGEBRAIC[15] = p[6];
  ALGEBRAIC[16] = p[7];
  ALGEBRAIC[17] = p[8];
  ALGEBRAIC[18] = p[9];
  ALGEBRAIC[19] = p[10];
  hx[0] = ALGEBRAIC[19] - ( CONSTANTS[31]*CONSTANTS[28])/(CONSTANTS[28]+ALGEBRAIC[9]+ALGEBRAIC[11]);
  hx[1] = ALGEBRAIC[14] -  (ALGEBRAIC[9]/CONSTANTS[34])*ALGEBRAIC[9]*(1.00000+ALGEBRAIC[19]/CONSTANTS[28]);
  hx[2] = ALGEBRAIC[15] -  ALGEBRAIC[9]*(1.00000+ALGEBRAIC[19]/CONSTANTS[28]);
  hx[3] = ALGEBRAIC[16] -  (ALGEBRAIC[11]/CONSTANTS[34])*ALGEBRAIC[11]*(1.00000+ALGEBRAIC[19]/CONSTANTS[28]);
  hx[4] = ALGEBRAIC[17] -  ALGEBRAIC[11]*(1.00000+ALGEBRAIC[19]/CONSTANTS[28]);
  hx[5] = ALGEBRAIC[13] -  (CONSTANTS[32]/ALGEBRAIC[10])*ALGEBRAIC[14];
  hx[6] = ALGEBRAIC[18] -  (CONSTANTS[32]/ALGEBRAIC[10])*ALGEBRAIC[16];
  hx[7] = ALGEBRAIC[10] - ((STATES[9] - (ALGEBRAIC[13]+ 2.00000*ALGEBRAIC[14]+ 2.00000*ALGEBRAIC[15])) - (ALGEBRAIC[18]+ 2.00000*ALGEBRAIC[16]+ 2.00000*ALGEBRAIC[17]));
  hx[8] = ALGEBRAIC[12] - (( CONSTANTS[32]*CONSTANTS[33])/CONSTANTS[34]+( CONSTANTS[32]*ALGEBRAIC[10])/CONSTANTS[34]+( ALGEBRAIC[10]*ALGEBRAIC[10])/CONSTANTS[34]);
  hx[9] = ALGEBRAIC[9] - ( 2.00000*CONSTANTS[29]*ALGEBRAIC[10]*ALGEBRAIC[10] -  ALGEBRAIC[9]*(1.00000+ALGEBRAIC[19]/CONSTANTS[28])*( ALGEBRAIC[12]*ALGEBRAIC[9]+ ALGEBRAIC[10]*ALGEBRAIC[10]));
  hx[10] = ALGEBRAIC[11] - ( 2.00000*CONSTANTS[30]*ALGEBRAIC[10]*ALGEBRAIC[10] -  ALGEBRAIC[11]*(1.00000+ALGEBRAIC[19]/CONSTANTS[28])*( ALGEBRAIC[12]*ALGEBRAIC[11]+ ALGEBRAIC[10]*ALGEBRAIC[10]));
#undef VOI
#undef CONSTANTS
#undef RATES
#undef STATES
#undef ALGEBRAIC
#undef pret
}
void rootfind_0(double VOI, double* CONSTANTS, double* RATES,
double* STATES, double* ALGEBRAIC, int* pret)
{
  static double p[11] = {0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1};
  double bp[11], work[LM_DIF_WORKSZ(11, 11)];
  struct rootfind_info rfi;
  rfi.aVOI = VOI;
  rfi.aCONSTANTS = CONSTANTS;
  rfi.aRATES = RATES;
  rfi.aSTATES = STATES;
  rfi.aALGEBRAIC = ALGEBRAIC;
  rfi.aPRET = pret;
  do_levmar(objfunc_0, p, bp, work, pret, 11, &rfi);
  ALGEBRAIC[9] = p[0];
  ALGEBRAIC[10] = p[1];
  ALGEBRAIC[11] = p[2];
  ALGEBRAIC[12] = p[3];
  ALGEBRAIC[13] = p[4];
  ALGEBRAIC[14] = p[5];
  ALGEBRAIC[15] = p[6];
  ALGEBRAIC[16] = p[7];
  ALGEBRAIC[17] = p[8];
  ALGEBRAIC[18] = p[9];
  ALGEBRAIC[19] = p[10];
}