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 12 entries in the algebraic variable array. There are a total of 5 entries in each of the rate and state variable arrays. There are a total of 39 entries in the constant variable array. */ /* * CONSTANTS[0] is t_ss in component Vstim_para (second). * CONSTANTS[1] is V_actHolding in component Vstim_para (mV). * CONSTANTS[2] is t_act in component Vstim_para (second). * CONSTANTS[3] is V_actTest in component Vstim_para (mV). * CONSTANTS[4] is Nai in component control_para (mM). * CONSTANTS[5] is Cai_init in component control_para (mM). * CONSTANTS[6] is inhPump in component control_para (dimensionless). * CONSTANTS[7] is K_Cahalf in component control_para (mV). * VOI is time in component time_s (second). * ALGEBRAIC[2] is V in component sPulse_protocol_s (mV). * STATES[0] is Cai in component Cai (mM). * ALGEBRAIC[11] is J_VOCC in component J_VOCC (mM_per_s). * ALGEBRAIC[6] is J_CaPump in component J_CaPump (mM_per_s). * ALGEBRAIC[9] is J_NaCa in component J_NaCa (mM_per_s). * ALGEBRAIC[0] is stress in component CB4HM (dimensionless). * ALGEBRAIC[1] is phosphorylation in component CB4HM (dimensionless). * CONSTANTS[8] is R in component constants (J_per_K_mol). * CONSTANTS[9] is F in component constants (C_per_mmol). * CONSTANTS[10] is T in component model_para (kelvin). * CONSTANTS[11] is Nao in component model_para (mM). * CONSTANTS[12] is Cao in component model_para (mM). * CONSTANTS[13] is V_cell in component model_para (fm3). * CONSTANTS[14] is V_Cahalf in component model_para (mV). * CONSTANTS[15] is g_mCa in component model_para (nS). * CONSTANTS[16] is V_pmax in component model_para (mM_per_s). * CONSTANTS[17] is n in component model_para (dimensionless). * CONSTANTS[18] is K_ph in component model_para (mM). * CONSTANTS[19] is K_NaCa in component model_para (mM). * CONSTANTS[20] is G_NaCa in component model_para (mM_per_s_mV). * CONSTANTS[21] is n_M in component model_para (dimensionless). * CONSTANTS[22] is Ca_halfMLCK in component model_para (mM). * CONSTANTS[23] is M_init in component initials (dimensionless). * CONSTANTS[24] is Mp_init in component initials (dimensionless). * CONSTANTS[25] is AM_init in component initials (dimensionless). * CONSTANTS[26] is AMp_init in component initials (dimensionless). * CONSTANTS[27] is K_7 in component model_para (per_s). * CONSTANTS[28] is K_2 in component model_para (per_s). * CONSTANTS[29] is K_3 in component model_para (per_s). * CONSTANTS[30] is K_4 in component model_para (per_s). * CONSTANTS[31] is K_5 in component model_para (per_s). * ALGEBRAIC[4] is rho_vCa in component J_VOCC (dimensionless). * CONSTANTS[32] is Nai in component model_para (mM). * CONSTANTS[33] is K_Cahalf in component model_para (mV). * CONSTANTS[34] is inhPump in component model_para (dimensionless). * CONSTANTS[35] is Cai_init in component initials (mM). * CONSTANTS[36] is z_Ca in component E_Ca (dimensionless). * ALGEBRAIC[7] is E in component Nernst_potential (mV). * CONSTANTS[37] is z_Na in component E_Na (dimensionless). * CONSTANTS[38] is E in component Nernst_potential (mV). * ALGEBRAIC[10] is I in component Ionic_currents (pA). * ALGEBRAIC[8] is V_mNaCa in component J_NaCa (mV). * ALGEBRAIC[5] is K_1 in component K_1 (per_s). * ALGEBRAIC[3] is norm in component CB4HM (dimensionless). * STATES[1] is M in component CB4HM (dimensionless). * STATES[2] is Mp in component CB4HM (dimensionless). * STATES[3] is AM in component CB4HM (dimensionless). * STATES[4] is AMp in component CB4HM (dimensionless). * RATES[0] is d/dt Cai in component Cai (mM). * RATES[1] is d/dt M in component CB4HM (dimensionless). * RATES[2] is d/dt Mp in component CB4HM (dimensionless). * RATES[3] is d/dt AM in component CB4HM (dimensionless). * RATES[4] is d/dt AMp in component CB4HM (dimensionless). */ void initConsts(double* CONSTANTS, double* RATES, double *STATES) { CONSTANTS[0] = 0; CONSTANTS[1] = -80; CONSTANTS[2] = 1; CONSTANTS[3] = 0; CONSTANTS[4] = 16.55; CONSTANTS[5] = 0.1e-3; CONSTANTS[6] = 1; CONSTANTS[7] = 11; CONSTANTS[8] = 8.314; CONSTANTS[9] = 96.48534; CONSTANTS[10] = 310; CONSTANTS[11] = 140; CONSTANTS[12] = 2; CONSTANTS[13] = 21; CONSTANTS[14] = -27; CONSTANTS[15] = 0.046842; CONSTANTS[16] = 5.1449e-4; CONSTANTS[17] = 1.9015; CONSTANTS[18] = 0.6e-3; CONSTANTS[19] = 7e-3; CONSTANTS[20] = 5.7297e-5; CONSTANTS[21] = 8.7613; CONSTANTS[22] = 256.98e-6; CONSTANTS[23] = 1; CONSTANTS[24] = 0; CONSTANTS[25] = 0; CONSTANTS[26] = 0; CONSTANTS[27] = 0.0378; CONSTANTS[28] = 1.2387; CONSTANTS[29] = 0.1419; CONSTANTS[30] = 0.035475; CONSTANTS[31] = 1.2387; CONSTANTS[32] = 2.9836; CONSTANTS[33] = 11; CONSTANTS[34] = 1; CONSTANTS[35] = 0.1e-6; CONSTANTS[36] = 2; CONSTANTS[37] = 1; CONSTANTS[38] = (( CONSTANTS[8]*CONSTANTS[10])/( CONSTANTS[37]*CONSTANTS[9]))*log(CONSTANTS[11]/CONSTANTS[4]); STATES[0] = CONSTANTS[5]; STATES[1] = CONSTANTS[23]; STATES[2] = CONSTANTS[24]; STATES[3] = CONSTANTS[25]; STATES[4] = CONSTANTS[26]; } void computeRates(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC) { ALGEBRAIC[5] = (pow(STATES[0], CONSTANTS[21])/(pow(CONSTANTS[22], CONSTANTS[21])+pow(STATES[0], CONSTANTS[21])))*1.00000; ALGEBRAIC[3] = STATES[1]+STATES[2]+STATES[3]+STATES[4]; RATES[1] = ( - ALGEBRAIC[5]*STATES[1])/ALGEBRAIC[3]+( CONSTANTS[28]*STATES[2])/ALGEBRAIC[3]+( CONSTANTS[27]*STATES[3])/ALGEBRAIC[3]; RATES[2] = (( CONSTANTS[30]*STATES[4])/ALGEBRAIC[3]+( ALGEBRAIC[5]*STATES[1])/ALGEBRAIC[3]) - ( (CONSTANTS[28]+CONSTANTS[29])*STATES[2])/ALGEBRAIC[3]; RATES[3] = ( CONSTANTS[31]*STATES[4])/ALGEBRAIC[3] - ( (ALGEBRAIC[5]+CONSTANTS[27])*STATES[3])/ALGEBRAIC[3]; RATES[4] = (( CONSTANTS[29]*STATES[2])/ALGEBRAIC[3]+( ALGEBRAIC[5]*STATES[3])/ALGEBRAIC[3]) - ( (CONSTANTS[30]+CONSTANTS[31])*STATES[4])/ALGEBRAIC[3]; ALGEBRAIC[2] = (VOI<CONSTANTS[0] ? CONSTANTS[1] : VOI>=CONSTANTS[0]&&VOI<CONSTANTS[2]+CONSTANTS[0] ? CONSTANTS[3] : CONSTANTS[1]); ALGEBRAIC[4] = 1.00000/(1.00000+exp((CONSTANTS[14] - ALGEBRAIC[2])/CONSTANTS[7])); ALGEBRAIC[7] = (( CONSTANTS[8]*CONSTANTS[10])/( CONSTANTS[36]*CONSTANTS[9]))*log(CONSTANTS[12]/STATES[0]); ALGEBRAIC[10] = CONSTANTS[15]*ALGEBRAIC[4]*(ALGEBRAIC[2] - ALGEBRAIC[7]); ALGEBRAIC[11] = - ALGEBRAIC[10]/( 2.00000*CONSTANTS[13]*CONSTANTS[9]); ALGEBRAIC[6] = ( - CONSTANTS[16]*pow(STATES[0], CONSTANTS[17]))/(pow(CONSTANTS[18], CONSTANTS[17])+pow(STATES[0], CONSTANTS[17])); ALGEBRAIC[8] = 3.00000*CONSTANTS[38] - 2.00000*ALGEBRAIC[7]; ALGEBRAIC[9] = (( CONSTANTS[20]*STATES[0])/(STATES[0]+CONSTANTS[19]))*(ALGEBRAIC[2] - ALGEBRAIC[8]); RATES[0] = ALGEBRAIC[11]+ CONSTANTS[6]*ALGEBRAIC[6]+ALGEBRAIC[9]; } void computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC) { ALGEBRAIC[5] = (pow(STATES[0], CONSTANTS[21])/(pow(CONSTANTS[22], CONSTANTS[21])+pow(STATES[0], CONSTANTS[21])))*1.00000; ALGEBRAIC[3] = STATES[1]+STATES[2]+STATES[3]+STATES[4]; ALGEBRAIC[2] = (VOI<CONSTANTS[0] ? CONSTANTS[1] : VOI>=CONSTANTS[0]&&VOI<CONSTANTS[2]+CONSTANTS[0] ? CONSTANTS[3] : CONSTANTS[1]); ALGEBRAIC[4] = 1.00000/(1.00000+exp((CONSTANTS[14] - ALGEBRAIC[2])/CONSTANTS[7])); ALGEBRAIC[7] = (( CONSTANTS[8]*CONSTANTS[10])/( CONSTANTS[36]*CONSTANTS[9]))*log(CONSTANTS[12]/STATES[0]); ALGEBRAIC[10] = CONSTANTS[15]*ALGEBRAIC[4]*(ALGEBRAIC[2] - ALGEBRAIC[7]); ALGEBRAIC[11] = - ALGEBRAIC[10]/( 2.00000*CONSTANTS[13]*CONSTANTS[9]); ALGEBRAIC[6] = ( - CONSTANTS[16]*pow(STATES[0], CONSTANTS[17]))/(pow(CONSTANTS[18], CONSTANTS[17])+pow(STATES[0], CONSTANTS[17])); ALGEBRAIC[8] = 3.00000*CONSTANTS[38] - 2.00000*ALGEBRAIC[7]; ALGEBRAIC[9] = (( CONSTANTS[20]*STATES[0])/(STATES[0]+CONSTANTS[19]))*(ALGEBRAIC[2] - ALGEBRAIC[8]); ALGEBRAIC[0] = STATES[4]+STATES[3]; ALGEBRAIC[1] = STATES[4]+STATES[2]; }