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 17 entries in the algebraic variable array.
   There are a total of 7 entries in each of the rate and state variable arrays.
   There are a total of 1 entries in the constant variable array.
 */
/*
 * VOI is time in component environment (millisecond).
 * STATES[0] is V in component membrane (millivolt).
 * CONSTANTS[0] is Cm in component membrane (microF_per_cm2).
 * ALGEBRAIC[0] is i_Na in component sodium_channel (microA_per_cm2).
 * ALGEBRAIC[5] is i_K in component potassium_channel (microA_per_cm2).
 * ALGEBRAIC[8] is i_Leak in component leakage_current (microA_per_cm2).
 * ALGEBRAIC[9] is i_s in component calcium_channel (microA_per_cm2).
 * ALGEBRAIC[14] is i_h in component hyperpolarization_activated_channel (microA_per_cm2).
 * STATES[1] is m in component sodium_channel_m_gate (dimensionless).
 * STATES[2] is h in component sodium_channel_h_gate (dimensionless).
 * ALGEBRAIC[1] is alpha_m in component sodium_channel_m_gate (per_millisecond).
 * ALGEBRAIC[2] is beta_m in component sodium_channel_m_gate (per_millisecond).
 * ALGEBRAIC[3] is alpha_h in component sodium_channel_h_gate (per_millisecond).
 * ALGEBRAIC[4] is beta_h in component sodium_channel_h_gate (per_millisecond).
 * STATES[3] is n in component potassium_channel_n_gate (dimensionless).
 * ALGEBRAIC[6] is alpha_n in component potassium_channel_n_gate (per_millisecond).
 * ALGEBRAIC[7] is beta_n in component potassium_channel_n_gate (per_millisecond).
 * STATES[4] is d in component calcium_channel_d_gate (dimensionless).
 * STATES[5] is f in component calcium_channel_f_gate (dimensionless).
 * ALGEBRAIC[10] is alpha_d in component calcium_channel_d_gate (per_millisecond).
 * ALGEBRAIC[11] is beta_d in component calcium_channel_d_gate (per_millisecond).
 * ALGEBRAIC[12] is alpha_f in component calcium_channel_f_gate (per_millisecond).
 * ALGEBRAIC[13] is beta_f in component calcium_channel_f_gate (per_millisecond).
 * STATES[6] is q in component hyperpolarization_activated_channel_q_gate (dimensionless).
 * ALGEBRAIC[15] is alpha_q in component hyperpolarization_activated_channel_q_gate (per_millisecond).
 * ALGEBRAIC[16] is beta_q in component hyperpolarization_activated_channel_q_gate (per_millisecond).
 * RATES[0] is d/dt V in component membrane (millivolt).
 * RATES[1] is d/dt m in component sodium_channel_m_gate (dimensionless).
 * RATES[2] is d/dt h in component sodium_channel_h_gate (dimensionless).
 * RATES[3] is d/dt n in component potassium_channel_n_gate (dimensionless).
 * RATES[4] is d/dt d in component calcium_channel_d_gate (dimensionless).
 * RATES[5] is d/dt f in component calcium_channel_f_gate (dimensionless).
 * RATES[6] is d/dt q in component hyperpolarization_activated_channel_q_gate (dimensionless).
 * There are a total of 0 condition variables.
 */
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
STATES[0] = -62.83;
CONSTANTS[0] = 1;
STATES[1] = 0.047938;
STATES[2] = 0.95994;
STATES[3] = 0.509494;
STATES[4] = 0.000032;
STATES[5] = 1;
STATES[6] = 0.010759;
RATES[0] = 0.1001;
RATES[1] = 0.1001;
RATES[2] = 0.1001;
RATES[3] = 0.1001;
RATES[4] = 0.1001;
RATES[5] = 0.1001;
RATES[6] = 0.1001;
}
void
computeResiduals(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
                 double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
resid[0] = RATES[0] - - (ALGEBRAIC[0]+ALGEBRAIC[5]+ALGEBRAIC[8]+ALGEBRAIC[9]+ALGEBRAIC[14])/CONSTANTS[0];
resid[1] = RATES[1] -  ALGEBRAIC[1]*(1.00000 - STATES[1]) -  ALGEBRAIC[2]*STATES[1];
resid[2] = RATES[2] -  ALGEBRAIC[3]*(1.00000 - STATES[2]) -  ALGEBRAIC[4]*STATES[2];
resid[3] = RATES[3] -  ALGEBRAIC[6]*(1.00000 - STATES[3]) -  ALGEBRAIC[7]*STATES[3];
resid[4] = RATES[4] -  ALGEBRAIC[10]*(1.00000 - STATES[4]) -  ALGEBRAIC[11]*STATES[4];
resid[5] = RATES[5] -  ALGEBRAIC[12]*(1.00000 - STATES[5]) -  ALGEBRAIC[13]*STATES[5];
resid[6] = RATES[6] -  ALGEBRAIC[15]*(1.00000 - STATES[6]) -  ALGEBRAIC[16]*STATES[6];
}
void
computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
}
void
computeEssentialVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[0] =  0.500000*pow(STATES[1], 3.00000)*STATES[2]*(STATES[0] - 30.0000);
ALGEBRAIC[1] = ( 1.00000*(STATES[0]+37.0000))/(- exp((STATES[0]+37.0000)/- 10.0000)+1.00000);
ALGEBRAIC[2] =  40.0000*exp((STATES[0]+62.0000)/- 17.8000);
ALGEBRAIC[3] =  0.00120900*exp((STATES[0]+20.0000)/- 6.53400);
ALGEBRAIC[4] = 1.00000/(1.00000+exp((STATES[0]+30.0000)/- 10.0000));
ALGEBRAIC[5] = ( 0.700000*STATES[3]*(exp( 0.0277000*(STATES[0]+90.0000)) - 1.00000))/exp( 0.0277000*(STATES[0]+40.0000));
ALGEBRAIC[6] = ( 0.00900000*1.00000)/(1.00000+exp(- (STATES[0]+3.80000)/9.71000))+0.000600000;
ALGEBRAIC[7] = ( - 0.000225000*(STATES[0]+40.0000))/(1.00000 - exp((STATES[0]+40.0000)/13.3000));
ALGEBRAIC[8] =  0.800000*(1.00000 - exp(- (STATES[0]+60.0000)/20.0000));
ALGEBRAIC[9] =  12.5000*( 0.950000*STATES[4]+0.0500000)*( 0.950000*STATES[5]+0.0500000)*(exp((STATES[0] - 10.0000)/15.0000) - 1.00000);
ALGEBRAIC[10] = ( 0.0145000*(STATES[0]+35.0000))/(1.00000 - exp(- (STATES[0]+35.0000)/2.50000))+( 0.0312500*STATES[0])/(1.00000 - exp(- STATES[0]/4.80000));
ALGEBRAIC[11] = ( - 0.00421000*(STATES[0] - 5.00000))/(- exp((STATES[0] - 5.00000)/2.50000)+1.00000);
ALGEBRAIC[12] = ( - 0.000355000*(STATES[0]+20.0000))/(- exp((STATES[0]+20.0000)/5.63300)+1.00000);
ALGEBRAIC[13] = ( 0.000944000*(STATES[0]+60.0000))/(1.00000+exp(- (STATES[0]+29.5000)/4.16000));
ALGEBRAIC[14] =  0.400000*STATES[6]*(STATES[0]+45.0000);
ALGEBRAIC[15] = ( 0.000340000*(STATES[0]+100.000))/(exp((STATES[0]+100.000)/4.40000) - 1.00000)+4.95000e-05;
ALGEBRAIC[16] = ( 0.000500000*(STATES[0]+40.0000))/(1.00000 - exp(- (STATES[0]+40.0000)/6.00000))+8.45000e-05;
}
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;
}
void
computeRoots(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
             double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
}