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 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[7] is i_K in component potassium_channel (microA_per_cm2).
* ALGEBRAIC[14] is i_Leak in component leakage_current (microA_per_cm2).
* ALGEBRAIC[15] is i_s in component calcium_channel (microA_per_cm2).
* ALGEBRAIC[16] 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[8] is beta_m in component sodium_channel_m_gate (per_millisecond).
* ALGEBRAIC[2] is alpha_h in component sodium_channel_h_gate (per_millisecond).
* ALGEBRAIC[9] is beta_h in component sodium_channel_h_gate (per_millisecond).
* STATES[3] is n in component potassium_channel_n_gate (dimensionless).
* ALGEBRAIC[3] is alpha_n in component potassium_channel_n_gate (per_millisecond).
* ALGEBRAIC[10] 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[4] 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[5] is alpha_f in component calcium_channel_f_gate (per_millisecond).
* ALGEBRAIC[12] is beta_f in component calcium_channel_f_gate (per_millisecond).
* STATES[6] is q in component hyperpolarization_activated_channel_q_gate (dimensionless).
* ALGEBRAIC[6] is alpha_q in component hyperpolarization_activated_channel_q_gate (per_millisecond).
* ALGEBRAIC[13] 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).
*/
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;
}
void
computeRates(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[1] = ( 1.00000*(STATES[0]+37.0000))/(- exp((STATES[0]+37.0000)/- 10.0000)+1.00000);
ALGEBRAIC[8] = 40.0000*exp((STATES[0]+62.0000)/- 17.8000);
RATES[1] = ALGEBRAIC[1]*(1.00000 - STATES[1]) - ALGEBRAIC[8]*STATES[1];
ALGEBRAIC[2] = 0.00120900*exp((STATES[0]+20.0000)/- 6.53400);
ALGEBRAIC[9] = 1.00000/(1.00000+exp((STATES[0]+30.0000)/- 10.0000));
RATES[2] = ALGEBRAIC[2]*(1.00000 - STATES[2]) - ALGEBRAIC[9]*STATES[2];
ALGEBRAIC[3] = ( 0.00900000*1.00000)/(1.00000+exp(- (STATES[0]+3.80000)/9.71000))+0.000600000;
ALGEBRAIC[10] = ( - 0.000225000*(STATES[0]+40.0000))/(1.00000 - exp((STATES[0]+40.0000)/13.3000));
RATES[3] = ALGEBRAIC[3]*(1.00000 - STATES[3]) - ALGEBRAIC[10]*STATES[3];
ALGEBRAIC[4] = ( 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);
RATES[4] = ALGEBRAIC[4]*(1.00000 - STATES[4]) - ALGEBRAIC[11]*STATES[4];
ALGEBRAIC[5] = ( - 0.000355000*(STATES[0]+20.0000))/(- exp((STATES[0]+20.0000)/5.63300)+1.00000);
ALGEBRAIC[12] = ( 0.000944000*(STATES[0]+60.0000))/(1.00000+exp(- (STATES[0]+29.5000)/4.16000));
RATES[5] = ALGEBRAIC[5]*(1.00000 - STATES[5]) - ALGEBRAIC[12]*STATES[5];
ALGEBRAIC[6] = ( 0.000340000*(STATES[0]+100.000))/(exp((STATES[0]+100.000)/4.40000) - 1.00000)+4.95000e-05;
ALGEBRAIC[13] = ( 0.000500000*(STATES[0]+40.0000))/(1.00000 - exp(- (STATES[0]+40.0000)/6.00000))+8.45000e-05;
RATES[6] = ALGEBRAIC[6]*(1.00000 - STATES[6]) - ALGEBRAIC[13]*STATES[6];
ALGEBRAIC[0] = 0.500000*pow(STATES[1], 3.00000)*STATES[2]*(STATES[0] - 30.0000);
ALGEBRAIC[7] = ( 0.700000*STATES[3]*(exp( 0.0277000*(STATES[0]+90.0000)) - 1.00000))/exp( 0.0277000*(STATES[0]+40.0000));
ALGEBRAIC[14] = 0.800000*(1.00000 - exp(- (STATES[0]+60.0000)/20.0000));
ALGEBRAIC[15] = 12.5000*( 0.950000*STATES[4]+0.0500000)*( 0.950000*STATES[5]+0.0500000)*(exp((STATES[0] - 10.0000)/15.0000) - 1.00000);
ALGEBRAIC[16] = 0.400000*STATES[6]*(STATES[0]+45.0000);
RATES[0] = - (ALGEBRAIC[0]+ALGEBRAIC[7]+ALGEBRAIC[14]+ALGEBRAIC[15]+ALGEBRAIC[16])/CONSTANTS[0];
}
void
computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[1] = ( 1.00000*(STATES[0]+37.0000))/(- exp((STATES[0]+37.0000)/- 10.0000)+1.00000);
ALGEBRAIC[8] = 40.0000*exp((STATES[0]+62.0000)/- 17.8000);
ALGEBRAIC[2] = 0.00120900*exp((STATES[0]+20.0000)/- 6.53400);
ALGEBRAIC[9] = 1.00000/(1.00000+exp((STATES[0]+30.0000)/- 10.0000));
ALGEBRAIC[3] = ( 0.00900000*1.00000)/(1.00000+exp(- (STATES[0]+3.80000)/9.71000))+0.000600000;
ALGEBRAIC[10] = ( - 0.000225000*(STATES[0]+40.0000))/(1.00000 - exp((STATES[0]+40.0000)/13.3000));
ALGEBRAIC[4] = ( 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[5] = ( - 0.000355000*(STATES[0]+20.0000))/(- exp((STATES[0]+20.0000)/5.63300)+1.00000);
ALGEBRAIC[12] = ( 0.000944000*(STATES[0]+60.0000))/(1.00000+exp(- (STATES[0]+29.5000)/4.16000));
ALGEBRAIC[6] = ( 0.000340000*(STATES[0]+100.000))/(exp((STATES[0]+100.000)/4.40000) - 1.00000)+4.95000e-05;
ALGEBRAIC[13] = ( 0.000500000*(STATES[0]+40.0000))/(1.00000 - exp(- (STATES[0]+40.0000)/6.00000))+8.45000e-05;
ALGEBRAIC[0] = 0.500000*pow(STATES[1], 3.00000)*STATES[2]*(STATES[0] - 30.0000);
ALGEBRAIC[7] = ( 0.700000*STATES[3]*(exp( 0.0277000*(STATES[0]+90.0000)) - 1.00000))/exp( 0.0277000*(STATES[0]+40.0000));
ALGEBRAIC[14] = 0.800000*(1.00000 - exp(- (STATES[0]+60.0000)/20.0000));
ALGEBRAIC[15] = 12.5000*( 0.950000*STATES[4]+0.0500000)*( 0.950000*STATES[5]+0.0500000)*(exp((STATES[0] - 10.0000)/15.0000) - 1.00000);
ALGEBRAIC[16] = 0.400000*STATES[6]*(STATES[0]+45.0000);
}
