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 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[22] is v_TCC in component TCC (fmol_per_sec).
 * ALGEBRAIC[28] 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[6] is Am_TCC in component TCC (J_per_mol).
 * ALGEBRAIC[20] is Af_Ca in component TCC (J_per_mol).
 * ALGEBRAIC[21] is Ar_Ca in component TCC (J_per_mol).
 * ALGEBRAIC[18] is v_s00_TCC in component TCC (fmol_per_sec).
 * ALGEBRAIC[29] is v_s10_TCC in component TCC (fmol_per_sec).
 * ALGEBRAIC[26] is v_s01_TCC in component TCC (fmol_per_sec).
 * ALGEBRAIC[30] is v_s11_TCC in component TCC (fmol_per_sec).
 * ALGEBRAIC[13] is v_R1_TCC in component TCC (fmol_per_sec).
 * ALGEBRAIC[25] is v_R2_TCC in component TCC (fmol_per_sec).
 * ALGEBRAIC[17] is v_R3_TCC in component TCC (fmol_per_sec).
 * ALGEBRAIC[27] is v_R4_TCC in component TCC (fmol_per_sec).
 * ALGEBRAIC[7] is mu_s00_TCC in component TCC (J_per_mol).
 * ALGEBRAIC[10] is mu_s10_TCC in component TCC (J_per_mol).
 * ALGEBRAIC[14] is mu_s01_TCC in component TCC (J_per_mol).
 * ALGEBRAIC[19] is mu_s11_TCC in component TCC (J_per_mol).
 * ALGEBRAIC[8] is Af_R1_TCC in component TCC (J_per_mol).
 * ALGEBRAIC[11] is Ar_R1_TCC in component TCC (J_per_mol).
 * ALGEBRAIC[15] is Af_R2_TCC in component TCC (J_per_mol).
 * ALGEBRAIC[23] is Ar_R2_TCC in component TCC (J_per_mol).
 * ALGEBRAIC[9] is Af_R3_TCC in component TCC (J_per_mol).
 * ALGEBRAIC[16] is Ar_R3_TCC in component TCC (J_per_mol).
 * ALGEBRAIC[12] is Af_R4_TCC in component TCC (J_per_mol).
 * ALGEBRAIC[24] 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).
 */
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;
}
void
computeRates(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[1] = (VOI>=0.00000&&VOI<0.400000 ? - 0.0900000 : VOI>1.10000&&VOI<2.10000 ? - 0.0600000 : VOI>2.20000&&VOI<3.10000 ? 0.0400000 : VOI>3.50000 ? - 0.0900000 : - 0.0800000);
ALGEBRAIC[2] =  ALGEBRAIC[1]*CONSTANTS[0];
ALGEBRAIC[5] = ALGEBRAIC[2]/CONSTANTS[0];
ALGEBRAIC[7] =  CONSTANTS[1]*CONSTANTS[2]*log( CONSTANTS[13]*STATES[2]);
ALGEBRAIC[8] = ALGEBRAIC[7]+ CONSTANTS[18]*CONSTANTS[3]*ALGEBRAIC[5];
ALGEBRAIC[10] =  CONSTANTS[1]*CONSTANTS[2]*log( CONSTANTS[14]*STATES[3]);
ALGEBRAIC[11] = ALGEBRAIC[10]+ CONSTANTS[20]*CONSTANTS[3]*ALGEBRAIC[5];
ALGEBRAIC[13] =  CONSTANTS[7]*(exp(ALGEBRAIC[8]/( CONSTANTS[1]*CONSTANTS[2])) - exp(ALGEBRAIC[11]/( CONSTANTS[1]*CONSTANTS[2])));
ALGEBRAIC[9] = ALGEBRAIC[7]+ CONSTANTS[19]*CONSTANTS[3]*ALGEBRAIC[5];
ALGEBRAIC[14] =  CONSTANTS[1]*CONSTANTS[2]*log( CONSTANTS[15]*STATES[4]);
ALGEBRAIC[16] = ALGEBRAIC[14]+ CONSTANTS[21]*CONSTANTS[3]*ALGEBRAIC[5];
ALGEBRAIC[17] =  CONSTANTS[9]*(exp(ALGEBRAIC[9]/( CONSTANTS[1]*CONSTANTS[2])) - exp(ALGEBRAIC[16]/( CONSTANTS[1]*CONSTANTS[2])));
ALGEBRAIC[18] = - ALGEBRAIC[13] - ALGEBRAIC[17];
RATES[2] = ALGEBRAIC[18];
ALGEBRAIC[6] =  CONSTANTS[17]*CONSTANTS[3]*ALGEBRAIC[5];
ALGEBRAIC[3] =  CONSTANTS[1]*CONSTANTS[2]*log( CONSTANTS[11]*STATES[1]);
ALGEBRAIC[19] =  CONSTANTS[1]*CONSTANTS[2]*log( CONSTANTS[16]*STATES[5]);
ALGEBRAIC[20] = ALGEBRAIC[19]+ALGEBRAIC[3]+ALGEBRAIC[6];
ALGEBRAIC[4] =  CONSTANTS[1]*CONSTANTS[2]*log( CONSTANTS[12]*STATES[0]);
ALGEBRAIC[21] = ALGEBRAIC[19]+ALGEBRAIC[4];
ALGEBRAIC[22] = (ALGEBRAIC[6]==0.00000 ?  CONSTANTS[6]*(exp(ALGEBRAIC[20]/( CONSTANTS[1]*CONSTANTS[2])) - exp(ALGEBRAIC[21]/( CONSTANTS[1]*CONSTANTS[2]))) :  ((( CONSTANTS[6]*ALGEBRAIC[6])/( CONSTANTS[1]*CONSTANTS[2]))/(exp(ALGEBRAIC[6]/( CONSTANTS[1]*CONSTANTS[2])) - 1.00000))*(exp(ALGEBRAIC[20]/( CONSTANTS[1]*CONSTANTS[2])) - exp(ALGEBRAIC[21]/( CONSTANTS[1]*CONSTANTS[2]))));
RATES[1] = - ALGEBRAIC[22];
RATES[0] = ALGEBRAIC[22];
ALGEBRAIC[15] = ALGEBRAIC[14]+ CONSTANTS[18]*CONSTANTS[3]*ALGEBRAIC[5];
ALGEBRAIC[23] = ALGEBRAIC[19]+ CONSTANTS[20]*CONSTANTS[3]*ALGEBRAIC[5];
ALGEBRAIC[25] =  CONSTANTS[8]*(exp(ALGEBRAIC[15]/( CONSTANTS[1]*CONSTANTS[2])) - exp(ALGEBRAIC[23]/( CONSTANTS[1]*CONSTANTS[2])));
ALGEBRAIC[26] = ALGEBRAIC[17] - ALGEBRAIC[25];
RATES[4] = ALGEBRAIC[26];
ALGEBRAIC[12] = ALGEBRAIC[10]+ CONSTANTS[19]*CONSTANTS[3]*ALGEBRAIC[5];
ALGEBRAIC[24] = ALGEBRAIC[19]+ CONSTANTS[21]*CONSTANTS[3]*ALGEBRAIC[5];
ALGEBRAIC[27] =  CONSTANTS[10]*(exp(ALGEBRAIC[12]/( CONSTANTS[1]*CONSTANTS[2])) - exp(ALGEBRAIC[24]/( CONSTANTS[1]*CONSTANTS[2])));
ALGEBRAIC[29] = ALGEBRAIC[13] - ALGEBRAIC[27];
RATES[3] = ALGEBRAIC[29];
ALGEBRAIC[30] = ALGEBRAIC[25]+ALGEBRAIC[27];
RATES[5] = ALGEBRAIC[30];
}
void
computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[1] = (VOI>=0.00000&&VOI<0.400000 ? - 0.0900000 : VOI>1.10000&&VOI<2.10000 ? - 0.0600000 : VOI>2.20000&&VOI<3.10000 ? 0.0400000 : VOI>3.50000 ? - 0.0900000 : - 0.0800000);
ALGEBRAIC[2] =  ALGEBRAIC[1]*CONSTANTS[0];
ALGEBRAIC[5] = ALGEBRAIC[2]/CONSTANTS[0];
ALGEBRAIC[7] =  CONSTANTS[1]*CONSTANTS[2]*log( CONSTANTS[13]*STATES[2]);
ALGEBRAIC[8] = ALGEBRAIC[7]+ CONSTANTS[18]*CONSTANTS[3]*ALGEBRAIC[5];
ALGEBRAIC[10] =  CONSTANTS[1]*CONSTANTS[2]*log( CONSTANTS[14]*STATES[3]);
ALGEBRAIC[11] = ALGEBRAIC[10]+ CONSTANTS[20]*CONSTANTS[3]*ALGEBRAIC[5];
ALGEBRAIC[13] =  CONSTANTS[7]*(exp(ALGEBRAIC[8]/( CONSTANTS[1]*CONSTANTS[2])) - exp(ALGEBRAIC[11]/( CONSTANTS[1]*CONSTANTS[2])));
ALGEBRAIC[9] = ALGEBRAIC[7]+ CONSTANTS[19]*CONSTANTS[3]*ALGEBRAIC[5];
ALGEBRAIC[14] =  CONSTANTS[1]*CONSTANTS[2]*log( CONSTANTS[15]*STATES[4]);
ALGEBRAIC[16] = ALGEBRAIC[14]+ CONSTANTS[21]*CONSTANTS[3]*ALGEBRAIC[5];
ALGEBRAIC[17] =  CONSTANTS[9]*(exp(ALGEBRAIC[9]/( CONSTANTS[1]*CONSTANTS[2])) - exp(ALGEBRAIC[16]/( CONSTANTS[1]*CONSTANTS[2])));
ALGEBRAIC[18] = - ALGEBRAIC[13] - ALGEBRAIC[17];
ALGEBRAIC[6] =  CONSTANTS[17]*CONSTANTS[3]*ALGEBRAIC[5];
ALGEBRAIC[3] =  CONSTANTS[1]*CONSTANTS[2]*log( CONSTANTS[11]*STATES[1]);
ALGEBRAIC[19] =  CONSTANTS[1]*CONSTANTS[2]*log( CONSTANTS[16]*STATES[5]);
ALGEBRAIC[20] = ALGEBRAIC[19]+ALGEBRAIC[3]+ALGEBRAIC[6];
ALGEBRAIC[4] =  CONSTANTS[1]*CONSTANTS[2]*log( CONSTANTS[12]*STATES[0]);
ALGEBRAIC[21] = ALGEBRAIC[19]+ALGEBRAIC[4];
ALGEBRAIC[22] = (ALGEBRAIC[6]==0.00000 ?  CONSTANTS[6]*(exp(ALGEBRAIC[20]/( CONSTANTS[1]*CONSTANTS[2])) - exp(ALGEBRAIC[21]/( CONSTANTS[1]*CONSTANTS[2]))) :  ((( CONSTANTS[6]*ALGEBRAIC[6])/( CONSTANTS[1]*CONSTANTS[2]))/(exp(ALGEBRAIC[6]/( CONSTANTS[1]*CONSTANTS[2])) - 1.00000))*(exp(ALGEBRAIC[20]/( CONSTANTS[1]*CONSTANTS[2])) - exp(ALGEBRAIC[21]/( CONSTANTS[1]*CONSTANTS[2]))));
ALGEBRAIC[15] = ALGEBRAIC[14]+ CONSTANTS[18]*CONSTANTS[3]*ALGEBRAIC[5];
ALGEBRAIC[23] = ALGEBRAIC[19]+ CONSTANTS[20]*CONSTANTS[3]*ALGEBRAIC[5];
ALGEBRAIC[25] =  CONSTANTS[8]*(exp(ALGEBRAIC[15]/( CONSTANTS[1]*CONSTANTS[2])) - exp(ALGEBRAIC[23]/( CONSTANTS[1]*CONSTANTS[2])));
ALGEBRAIC[26] = ALGEBRAIC[17] - ALGEBRAIC[25];
ALGEBRAIC[12] = ALGEBRAIC[10]+ CONSTANTS[19]*CONSTANTS[3]*ALGEBRAIC[5];
ALGEBRAIC[24] = ALGEBRAIC[19]+ CONSTANTS[21]*CONSTANTS[3]*ALGEBRAIC[5];
ALGEBRAIC[27] =  CONSTANTS[10]*(exp(ALGEBRAIC[12]/( CONSTANTS[1]*CONSTANTS[2])) - exp(ALGEBRAIC[24]/( CONSTANTS[1]*CONSTANTS[2])));
ALGEBRAIC[29] = ALGEBRAIC[13] - ALGEBRAIC[27];
ALGEBRAIC[30] = ALGEBRAIC[25]+ALGEBRAIC[27];
ALGEBRAIC[0] = VOI -  floor(VOI/CONSTANTS[4])*CONSTANTS[4];
ALGEBRAIC[28] =  CONSTANTS[3]*( - CONSTANTS[17]*ALGEBRAIC[22]+ ALGEBRAIC[13]*(CONSTANTS[20] - CONSTANTS[18])+ ALGEBRAIC[25]*(CONSTANTS[20] - CONSTANTS[18])+ ALGEBRAIC[17]*(CONSTANTS[21] - CONSTANTS[19])+ ALGEBRAIC[27]*(CONSTANTS[21] - CONSTANTS[19]));
}
Source
Derived from workspace CaT protein knowledge page at changeset b7e7f45db3c7.
Collaboration
To begin collaborating on this work, please use your git client and issue this command:
License
The terms of use/license for this work is unspecified.