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 31 entries in the algebraic variable array. There are a total of 6 entries in each of the rate and state variable arrays. There are a total of 23 entries in the constant variable array. */ /* * VOI is time in component environment (second). * CONSTANTS[0] is C_m in component environment (fF). * STATES[0] is q_Ca_o in component environment (fmol). * STATES[1] is q_Ca_i in component environment (fmol). * STATES[2] is q_s00_TCC in component environment (fmol). * STATES[3] is q_s10_TCC in component environment (fmol). * STATES[4] is q_s01_TCC in component environment (fmol). * STATES[5] is q_s11_TCC in component environment (fmol). * ALGEBRAIC[2] is q_mem in component environment (fC). * ALGEBRAIC[1] is V_mem in component environment (volt). * CONSTANTS[1] is R in component environment (J_per_K_per_mol). * CONSTANTS[2] is T in component environment (kelvin). * CONSTANTS[3] is F in component environment (C_per_mol). * ALGEBRAIC[13] is v_TCC in component TCC (fmol_per_sec). * ALGEBRAIC[30] is I_mem_TCC in component TCC (fA). * CONSTANTS[22] is I_stim in component environment (fA). * CONSTANTS[4] is stimPeriod in component environment (second). * CONSTANTS[5] is stimDuration in component environment (second). * ALGEBRAIC[0] is tPeriod in component environment (second). * CONSTANTS[6] is kappa_TCC in component TCC_parameters (fmol_per_sec). * CONSTANTS[7] is kappa_R1_TCC in component TCC_parameters (fmol_per_sec). * CONSTANTS[8] is kappa_R2_TCC in component TCC_parameters (fmol_per_sec). * CONSTANTS[9] is kappa_R3_TCC in component TCC_parameters (fmol_per_sec). * CONSTANTS[10] is kappa_R4_TCC in component TCC_parameters (fmol_per_sec). * CONSTANTS[11] is K_Ca_i in component TCC_parameters (per_fmol). * CONSTANTS[12] is K_Ca_o in component TCC_parameters (per_fmol). * CONSTANTS[13] is K_S00_TCC in component TCC_parameters (per_fmol). * CONSTANTS[14] is K_S10_TCC in component TCC_parameters (per_fmol). * CONSTANTS[15] is K_S01_TCC in component TCC_parameters (per_fmol). * CONSTANTS[16] is K_S11_TCC in component TCC_parameters (per_fmol). * CONSTANTS[17] is zCa in component TCC_parameters (dimensionless). * CONSTANTS[18] is z_df in component TCC_parameters (dimensionless). * CONSTANTS[19] is z_ff in component TCC_parameters (dimensionless). * CONSTANTS[20] is z_dr in component TCC_parameters (dimensionless). * CONSTANTS[21] is z_fr in component TCC_parameters (dimensionless). * ALGEBRAIC[3] is u_Ca_i in component TCC (J_per_mol). * ALGEBRAIC[4] is u_Ca_o in component TCC (J_per_mol). * ALGEBRAIC[5] is V_mem in component TCC (J_per_C). * ALGEBRAIC[10] is Am_TCC in component TCC (J_per_mol). * ALGEBRAIC[11] is Af_Ca in component TCC (J_per_mol). * ALGEBRAIC[12] is Ar_Ca in component TCC (J_per_mol). * ALGEBRAIC[26] is v_s00_TCC in component TCC (fmol_per_sec). * ALGEBRAIC[27] is v_s10_TCC in component TCC (fmol_per_sec). * ALGEBRAIC[28] is v_s01_TCC in component TCC (fmol_per_sec). * ALGEBRAIC[29] is v_s11_TCC in component TCC (fmol_per_sec). * ALGEBRAIC[22] is v_R1_TCC in component TCC (fmol_per_sec). * ALGEBRAIC[23] is v_R2_TCC in component TCC (fmol_per_sec). * ALGEBRAIC[24] is v_R3_TCC in component TCC (fmol_per_sec). * ALGEBRAIC[25] is v_R4_TCC in component TCC (fmol_per_sec). * ALGEBRAIC[6] is mu_s00_TCC in component TCC (J_per_mol). * ALGEBRAIC[7] is mu_s10_TCC in component TCC (J_per_mol). * ALGEBRAIC[8] is mu_s01_TCC in component TCC (J_per_mol). * ALGEBRAIC[9] is mu_s11_TCC in component TCC (J_per_mol). * ALGEBRAIC[14] is Af_R1_TCC in component TCC (J_per_mol). * ALGEBRAIC[15] is Ar_R1_TCC in component TCC (J_per_mol). * ALGEBRAIC[16] is Af_R2_TCC in component TCC (J_per_mol). * ALGEBRAIC[17] is Ar_R2_TCC in component TCC (J_per_mol). * ALGEBRAIC[18] is Af_R3_TCC in component TCC (J_per_mol). * ALGEBRAIC[19] is Ar_R3_TCC in component TCC (J_per_mol). * ALGEBRAIC[20] is Af_R4_TCC in component TCC (J_per_mol). * ALGEBRAIC[21] is Ar_R4_TCC in component TCC (J_per_mol). * RATES[1] is d/dt q_Ca_i in component environment (fmol). * RATES[0] is d/dt q_Ca_o in component environment (fmol). * RATES[2] is d/dt q_s00_TCC in component environment (fmol). * RATES[3] is d/dt q_s10_TCC in component environment (fmol). * RATES[4] is d/dt q_s01_TCC in component environment (fmol). * RATES[5] is d/dt q_s11_TCC in component environment (fmol). * There are a total of 7 condition variables. */ void initConsts(double* CONSTANTS, double* RATES, double *STATES) { CONSTANTS[0] = 60000; STATES[0] = 0.04653; STATES[1] = 0.000001551; STATES[2] = 3.653271338425772e-07; STATES[3] = 1e-16; STATES[4] = 1e-16; STATES[5] = 1e-16; CONSTANTS[1] = 8.31; CONSTANTS[2] = 310; CONSTANTS[3] = 96500; CONSTANTS[4] = 1; CONSTANTS[5] = 0.0001; CONSTANTS[6] = 11414.6; CONSTANTS[7] = 1266.14; CONSTANTS[8] = 4.33488; CONSTANTS[9] = 1.34962; CONSTANTS[10] = 7.44777; CONSTANTS[11] = 28.7976; CONSTANTS[12] = 211.182; CONSTANTS[13] = 2.10659; CONSTANTS[14] = 0.381738; CONSTANTS[15] = 615.294; CONSTANTS[16] = 111.498; CONSTANTS[17] = 2; CONSTANTS[18] = 0.876568910405296; CONSTANTS[19] = -0.576510778245838; CONSTANTS[20] = -0.872117216889333; CONSTANTS[21] = 1.73582739545622; CONSTANTS[22] = 0.00000; RATES[1] = 0.1001; RATES[0] = 0.1001; RATES[2] = 0.1001; RATES[3] = 0.1001; RATES[4] = 0.1001; RATES[5] = 0.1001; } void computeResiduals(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES, double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS) { resid[0] = RATES[1] - - ALGEBRAIC[13]; resid[1] = RATES[0] - ALGEBRAIC[13]; resid[2] = RATES[2] - ALGEBRAIC[26]; resid[3] = RATES[3] - ALGEBRAIC[27]; resid[4] = RATES[4] - ALGEBRAIC[28]; resid[5] = RATES[5] - ALGEBRAIC[29]; } void computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC) { ALGEBRAIC[0] = VOI - floor(VOI/CONSTANTS[4])*CONSTANTS[4]; ALGEBRAIC[30] = CONSTANTS[3]*( - CONSTANTS[17]*ALGEBRAIC[13]+ ALGEBRAIC[22]*(CONSTANTS[20] - CONSTANTS[18])+ ALGEBRAIC[23]*(CONSTANTS[20] - CONSTANTS[18])+ ALGEBRAIC[24]*(CONSTANTS[21] - CONSTANTS[19])+ ALGEBRAIC[25]*(CONSTANTS[21] - CONSTANTS[19])); } void computeEssentialVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC) { ALGEBRAIC[1] = (CONDVAR[0]>=0.00000&&CONDVAR[1]<0.00000 ? - 0.0900000 : CONDVAR[2]>0.00000&&CONDVAR[3]<0.00000 ? - 0.0600000 : CONDVAR[4]>0.00000&&CONDVAR[5]<0.00000 ? 0.0400000 : CONDVAR[6]>0.00000 ? - 0.0900000 : - 0.0800000); ALGEBRAIC[2] = ALGEBRAIC[1]*CONSTANTS[0]; ALGEBRAIC[5] = ALGEBRAIC[2]/CONSTANTS[0]; ALGEBRAIC[10] = CONSTANTS[17]*CONSTANTS[3]*ALGEBRAIC[5]; ALGEBRAIC[3] = CONSTANTS[1]*CONSTANTS[2]*log( CONSTANTS[11]*STATES[1]); ALGEBRAIC[9] = CONSTANTS[1]*CONSTANTS[2]*log( CONSTANTS[16]*STATES[5]); ALGEBRAIC[11] = ALGEBRAIC[9]+ALGEBRAIC[3]+ALGEBRAIC[10]; ALGEBRAIC[4] = CONSTANTS[1]*CONSTANTS[2]*log( CONSTANTS[12]*STATES[0]); ALGEBRAIC[12] = ALGEBRAIC[9]+ALGEBRAIC[4]; ALGEBRAIC[13] = (ALGEBRAIC[10]==0.00000 ? CONSTANTS[6]*(exp(ALGEBRAIC[11]/( CONSTANTS[1]*CONSTANTS[2])) - exp(ALGEBRAIC[12]/( CONSTANTS[1]*CONSTANTS[2]))) : ((( CONSTANTS[6]*ALGEBRAIC[10])/( CONSTANTS[1]*CONSTANTS[2]))/(exp(ALGEBRAIC[10]/( CONSTANTS[1]*CONSTANTS[2])) - 1.00000))*(exp(ALGEBRAIC[11]/( CONSTANTS[1]*CONSTANTS[2])) - exp(ALGEBRAIC[12]/( CONSTANTS[1]*CONSTANTS[2])))); ALGEBRAIC[6] = CONSTANTS[1]*CONSTANTS[2]*log( CONSTANTS[13]*STATES[2]); ALGEBRAIC[14] = ALGEBRAIC[6]+ CONSTANTS[18]*CONSTANTS[3]*ALGEBRAIC[5]; ALGEBRAIC[7] = CONSTANTS[1]*CONSTANTS[2]*log( CONSTANTS[14]*STATES[3]); ALGEBRAIC[15] = ALGEBRAIC[7]+ CONSTANTS[20]*CONSTANTS[3]*ALGEBRAIC[5]; ALGEBRAIC[22] = CONSTANTS[7]*(exp(ALGEBRAIC[14]/( CONSTANTS[1]*CONSTANTS[2])) - exp(ALGEBRAIC[15]/( CONSTANTS[1]*CONSTANTS[2]))); ALGEBRAIC[18] = ALGEBRAIC[6]+ CONSTANTS[19]*CONSTANTS[3]*ALGEBRAIC[5]; ALGEBRAIC[8] = CONSTANTS[1]*CONSTANTS[2]*log( CONSTANTS[15]*STATES[4]); ALGEBRAIC[19] = ALGEBRAIC[8]+ CONSTANTS[21]*CONSTANTS[3]*ALGEBRAIC[5]; ALGEBRAIC[24] = CONSTANTS[9]*(exp(ALGEBRAIC[18]/( CONSTANTS[1]*CONSTANTS[2])) - exp(ALGEBRAIC[19]/( CONSTANTS[1]*CONSTANTS[2]))); ALGEBRAIC[26] = - ALGEBRAIC[22] - ALGEBRAIC[24]; ALGEBRAIC[20] = ALGEBRAIC[7]+ CONSTANTS[19]*CONSTANTS[3]*ALGEBRAIC[5]; ALGEBRAIC[21] = ALGEBRAIC[9]+ CONSTANTS[21]*CONSTANTS[3]*ALGEBRAIC[5]; ALGEBRAIC[25] = CONSTANTS[10]*(exp(ALGEBRAIC[20]/( CONSTANTS[1]*CONSTANTS[2])) - exp(ALGEBRAIC[21]/( CONSTANTS[1]*CONSTANTS[2]))); ALGEBRAIC[27] = ALGEBRAIC[22] - ALGEBRAIC[25]; ALGEBRAIC[16] = ALGEBRAIC[8]+ CONSTANTS[18]*CONSTANTS[3]*ALGEBRAIC[5]; ALGEBRAIC[17] = ALGEBRAIC[9]+ CONSTANTS[20]*CONSTANTS[3]*ALGEBRAIC[5]; ALGEBRAIC[23] = CONSTANTS[8]*(exp(ALGEBRAIC[16]/( CONSTANTS[1]*CONSTANTS[2])) - exp(ALGEBRAIC[17]/( CONSTANTS[1]*CONSTANTS[2]))); ALGEBRAIC[28] = ALGEBRAIC[24] - ALGEBRAIC[23]; ALGEBRAIC[29] = ALGEBRAIC[23]+ALGEBRAIC[25]; } 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; } void computeRoots(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES, double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS) { CONDVAR[0] = VOI - 0.00000; CONDVAR[1] = VOI - 0.400000; CONDVAR[2] = VOI - 1.10000; CONDVAR[3] = VOI - 2.10000; CONDVAR[4] = VOI - 2.20000; CONDVAR[5] = VOI - 3.10000; CONDVAR[6] = VOI - 3.50000; }