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 26 entries in the algebraic variable array. There are a total of 12 entries in each of the rate and state variable arrays. There are a total of 37 entries in the constant variable array. */ /* * VOI is time in component environment (second). * STATES[0] is V_s in component soma_compartment (mV). * CONSTANTS[0] is V_Na in component soma_compartment (mV). * ALGEBRAIC[25] is I_Na_s in component soma_compartment (uA_per_cm2). * ALGEBRAIC[0] is I_K_DR_s in component soma_compartment (uA_per_cm2). * ALGEBRAIC[10] is I_Ca_T in component soma_compartment (uA_per_cm2). * ALGEBRAIC[15] is I_K_Ca in component soma_compartment (uA_per_cm2). * ALGEBRAIC[17] is I_A in component soma_compartment (uA_per_cm2). * ALGEBRAIC[20] is I_h in component soma_compartment (uA_per_cm2). * CONSTANTS[1] is g_Na_s in component soma_compartment (mS_per_cm2). * CONSTANTS[2] is g_K_DR_s in component soma_compartment (mS_per_cm2). * CONSTANTS[3] is g_Ca_T in component soma_compartment (mS_per_cm2). * CONSTANTS[4] is g_K_Ca in component soma_compartment (mS_per_cm2). * CONSTANTS[5] is g_A in component soma_compartment (mS_per_cm2). * CONSTANTS[6] is g_h in component soma_compartment (mS_per_cm2). * STATES[1] is Ca in component soma_compartment (mM). * CONSTANTS[7] is k_Ca in component soma_compartment (per_second). * CONSTANTS[8] is K_Ca in component soma_compartment (mM). * CONSTANTS[9] is V_h in component soma_compartment (mV). * CONSTANTS[10] is beta in component soma_compartment (mMcm2_per_uAs). * CONSTANTS[11] is I_APP in component soma_compartment (uA_per_cm2). * CONSTANTS[12] is V_Ca in component general_variables (mV). * CONSTANTS[13] is V_K in component general_variables (mV). * STATES[2] is n in component gating_variables (dimensionless). * STATES[3] is h in component gating_variables (dimensionless). * ALGEBRAIC[22] is m_infinity in component gating_variables (dimensionless). * CONSTANTS[14] is g_c in component general_variables (mS_per_cm2). * CONSTANTS[15] is p in component general_variables (dimensionless). * STATES[4] is V_D in component dendritic_compartment (mV). * CONSTANTS[16] is C_m in component general_variables (uF_per_cm2). * STATES[5] is m_T in component gating_variables (dimensionless). * STATES[6] is h_T in component gating_variables (dimensionless). * STATES[7] is a in component gating_variables (dimensionless). * STATES[8] is b in component gating_variables (dimensionless). * STATES[9] is m_h in component gating_variables (dimensionless). * STATES[10] is Na in component dendritic_compartment (mM). * CONSTANTS[17] is K_p in component dendritic_compartment (mM). * ALGEBRAIC[18] is I_L in component dendritic_compartment (uA_per_cm2). * ALGEBRAIC[16] is I_pump in component dendritic_compartment (uA_per_cm2). * CONSTANTS[18] is R_pump in component dendritic_compartment (uA_per_cm2). * CONSTANTS[19] is Na_eq in component dendritic_compartment (mM). * ALGEBRAIC[11] is phi_Na in component dendritic_compartment (dimensionless). * CONSTANTS[31] is phi_Na_eq in component dendritic_compartment (dimensionless). * CONSTANTS[20] is alpha in component dendritic_compartment (mMcm2_per_uAs). * ALGEBRAIC[21] is I_NMDA in component dendritic_compartment (uA_per_cm2). * ALGEBRAIC[19] is I_Na_NMDA in component dendritic_compartment (uA_per_cm2). * CONSTANTS[21] is g_NMDA in component dendritic_compartment (mS_per_cm2). * CONSTANTS[22] is g_Na_NMDA in component dendritic_compartment (mS_per_cm2). * CONSTANTS[23] is g_L in component dendritic_compartment (mS_per_cm2). * CONSTANTS[24] is Mg_o in component dendritic_compartment (mM). * CONSTANTS[25] is K_Mg in component dendritic_compartment (mM). * CONSTANTS[26] is q in component dendritic_compartment (mV). * CONSTANTS[27] is V_NMDA in component dendritic_compartment (mV). * CONSTANTS[28] is V_L in component dendritic_compartment (mV). * ALGEBRAIC[23] is I_D in component dendritic_compartment (uA_per_cm2). * ALGEBRAIC[24] is I_Ca_L in component dendritic_compartment (uA_per_cm2). * CONSTANTS[29] is g_Ca_L in component dendritic_compartment (mS_per_cm2). * CONSTANTS[30] is g_K_DR_D in component dendritic_compartment (mS_per_cm2). * ALGEBRAIC[1] is I_K_DR_D in component dendritic_compartment (uA_per_cm2). * STATES[11] is m_L in component gating_variables (dimensionless). * ALGEBRAIC[2] is m_T_infinity in component gating_variables (dimensionless). * ALGEBRAIC[3] is h_T_infinity in component gating_variables (dimensionless). * ALGEBRAIC[4] is a_infinity in component gating_variables (dimensionless). * ALGEBRAIC[5] is b_infinity in component gating_variables (dimensionless). * ALGEBRAIC[6] is m_h_infinity in component gating_variables (dimensionless). * ALGEBRAIC[7] is m_L_infinity in component gating_variables (dimensionless). * ALGEBRAIC[8] is n_infinity in component gating_variables (dimensionless). * ALGEBRAIC[9] is h_infinity in component gating_variables (dimensionless). * ALGEBRAIC[12] is tau_h in component gating_variables (second). * ALGEBRAIC[13] is tau_n in component gating_variables (second). * CONSTANTS[32] is tau_m_T in component gating_variables (second). * CONSTANTS[33] is tau_h_T in component gating_variables (second). * ALGEBRAIC[14] is tau_m_L in component gating_variables (second). * CONSTANTS[34] is tau_a in component gating_variables (second). * CONSTANTS[35] is tau_b in component gating_variables (second). * CONSTANTS[36] is tau_m_h in component gating_variables (second). * RATES[0] is d/dt V_s in component soma_compartment (mV). * RATES[1] is d/dt Ca in component soma_compartment (mM). * RATES[4] is d/dt V_D in component dendritic_compartment (mV). * RATES[10] is d/dt Na in component dendritic_compartment (mM). * RATES[3] is d/dt h in component gating_variables (dimensionless). * RATES[2] is d/dt n in component gating_variables (dimensionless). * RATES[5] is d/dt m_T in component gating_variables (dimensionless). * RATES[11] is d/dt m_L in component gating_variables (dimensionless). * RATES[9] is d/dt m_h in component gating_variables (dimensionless). * RATES[7] is d/dt a in component gating_variables (dimensionless). * RATES[8] is d/dt b in component gating_variables (dimensionless). * RATES[6] is d/dt h_T in component gating_variables (dimensionless). */ void initConsts(double* CONSTANTS, double* RATES, double *STATES) { STATES[0] = -64.0; CONSTANTS[0] = 55; CONSTANTS[1] = 3.2; CONSTANTS[2] = 6.4; CONSTANTS[3] = 1.5; CONSTANTS[4] = 1.2; CONSTANTS[5] = 2; CONSTANTS[6] = 0.1; STATES[1] = 0; CONSTANTS[7] = 1; CONSTANTS[8] = 0.0004; CONSTANTS[9] = -30; CONSTANTS[10] = 0.104; CONSTANTS[11] = -6.7; CONSTANTS[12] = 120; CONSTANTS[13] = -85; STATES[2] = 0.002; STATES[3] = 1.0; CONSTANTS[14] = 0.1; CONSTANTS[15] = 0.5; STATES[4] = -77.0; CONSTANTS[16] = 1; STATES[5] = 0.1; STATES[6] = 0.1; STATES[7] = 0.1; STATES[8] = 0.1; STATES[9] = 0.1; STATES[10] = 5.09; CONSTANTS[17] = 15; CONSTANTS[18] = 18; CONSTANTS[19] = 8; CONSTANTS[20] = 0.173; CONSTANTS[21] = 25; CONSTANTS[22] = 5; CONSTANTS[23] = 0.18; CONSTANTS[24] = 1.4; CONSTANTS[25] = 10; CONSTANTS[26] = 12.5; CONSTANTS[27] = 0; CONSTANTS[28] = -50; CONSTANTS[29] = 0.19; CONSTANTS[30] = 0.14; STATES[11] = 0.1; CONSTANTS[31] = pow(CONSTANTS[19], 3.00000)/(pow(CONSTANTS[19], 3.00000)+pow(CONSTANTS[17], 3.00000)); CONSTANTS[32] = 1.00000; CONSTANTS[33] = 10.0000; CONSTANTS[34] = 0.500000; CONSTANTS[35] = 10.0000; CONSTANTS[36] = 190.000; } void computeRates(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC) { ALGEBRAIC[2] = 1.00000/(1.00000+exp(- (STATES[0]+55.0000)/7.00000)); RATES[5] = (ALGEBRAIC[2] - STATES[5])/CONSTANTS[32]; ALGEBRAIC[6] = 1.00000/(1.00000+exp((STATES[0]+80.0000)/8.00000)); RATES[9] = (ALGEBRAIC[6] - STATES[9])/CONSTANTS[36]; ALGEBRAIC[4] = 1.00000/(1.00000+exp(- (STATES[0]+60.0000)/10.0000)); RATES[7] = (ALGEBRAIC[4] - STATES[7])/CONSTANTS[34]; ALGEBRAIC[5] = 1.00000/(1.00000+exp((STATES[0]+70.0000)/5.70000)); RATES[8] = (ALGEBRAIC[5] - STATES[8])/CONSTANTS[35]; ALGEBRAIC[3] = 1.00000/(1.00000+exp((STATES[0]+81.0000)/11.0000)); RATES[6] = (ALGEBRAIC[3] - STATES[6])/CONSTANTS[33]; ALGEBRAIC[10] = CONSTANTS[3]*STATES[6]*(STATES[0] - CONSTANTS[12])*pow(STATES[5], 2.00000); RATES[1] = - ( CONSTANTS[10]*ALGEBRAIC[10]+ CONSTANTS[7]*STATES[1]); ALGEBRAIC[9] = 1.00000/(1.00000+exp((STATES[0]+30.0000)/8.30000)); ALGEBRAIC[12] = 0.400000*(1.00000+2.00000/(1.00000+exp((STATES[0]+25.0000)/5.00000))); RATES[3] = (ALGEBRAIC[9] - STATES[3])/ALGEBRAIC[12]; ALGEBRAIC[8] = 1.00000/(1.00000+exp(- (STATES[0]+31.0000)/5.30000)); ALGEBRAIC[13] = ( 0.800000*(1.00000+2.00000/(1.00000+exp((STATES[0]+25.0000)/10.0000))))/(1.00000+exp(- (STATES[0]+70.0000)/10.0000)); RATES[2] = (ALGEBRAIC[8] - STATES[2])/ALGEBRAIC[13]; ALGEBRAIC[7] = 1.00000/(1.00000+exp(- (STATES[4]+20.0000)/5.30000)); ALGEBRAIC[14] = 0.400000/( 5.00000*exp(- (STATES[4]+11.0000)/8.30000)+(- (STATES[4]+11.0000)/8.30000)/(exp(- (STATES[4]+11.0000)/8.30000) - 1.00000)); RATES[11] = (ALGEBRAIC[7] - STATES[11])/ALGEBRAIC[14]; ALGEBRAIC[11] = pow(STATES[10], 3.00000)/(pow(STATES[10], 3.00000)+pow(CONSTANTS[17], 3.00000)); ALGEBRAIC[16] = CONSTANTS[18]*(ALGEBRAIC[11] - CONSTANTS[31]); ALGEBRAIC[19] = (CONSTANTS[22]/(1.00000+ (CONSTANTS[24]/CONSTANTS[25])*exp(- STATES[4]/CONSTANTS[26])))*(STATES[4] - CONSTANTS[0]); RATES[10] = CONSTANTS[20]*(- ALGEBRAIC[19] - ALGEBRAIC[16]*3.00000); ALGEBRAIC[18] = CONSTANTS[23]*(STATES[4] - CONSTANTS[28]); ALGEBRAIC[21] = (CONSTANTS[21]/(1.00000+ (CONSTANTS[24]/CONSTANTS[25])*exp(- STATES[4]/CONSTANTS[26])))*(STATES[4] - CONSTANTS[27]); ALGEBRAIC[24] = CONSTANTS[29]*(STATES[4] - CONSTANTS[12])*pow(STATES[11], 2.00000); ALGEBRAIC[1] = CONSTANTS[30]*(STATES[4] - CONSTANTS[13])*pow(STATES[2], 2.00000); RATES[4] = - ( 1000.00*(ALGEBRAIC[24]+ALGEBRAIC[1]+ALGEBRAIC[21]+ALGEBRAIC[16]+ALGEBRAIC[18]+ (CONSTANTS[14]/(1.00000 - CONSTANTS[15]))*(STATES[4] - STATES[0])))/CONSTANTS[16]; ALGEBRAIC[22] = 1.00000/(1.00000+exp(- (STATES[0]+35.0000)/6.20000)); ALGEBRAIC[25] = CONSTANTS[1]*STATES[3]*(STATES[0] - CONSTANTS[0])*pow(ALGEBRAIC[22], 3.00000); ALGEBRAIC[0] = CONSTANTS[2]*(STATES[0] - CONSTANTS[13])*pow(STATES[2], 2.00000); ALGEBRAIC[15] = (( CONSTANTS[4]*pow(STATES[1], 4.00000))/(pow(STATES[1], 4.00000)+pow(CONSTANTS[8], 4.00000)))*(STATES[0] - CONSTANTS[13]); ALGEBRAIC[17] = CONSTANTS[5]*STATES[8]*(STATES[0] - CONSTANTS[13])*pow(STATES[7], 4.00000); ALGEBRAIC[20] = CONSTANTS[6]*STATES[9]*(STATES[0] - CONSTANTS[9]); RATES[0] = ( 1000.00*(CONSTANTS[11] - (ALGEBRAIC[25]+ALGEBRAIC[10]+ALGEBRAIC[0]+ALGEBRAIC[15]+ALGEBRAIC[17]+ALGEBRAIC[20]+ (CONSTANTS[14]/CONSTANTS[15])*(STATES[0] - STATES[4]))))/CONSTANTS[16]; } void computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC) { ALGEBRAIC[2] = 1.00000/(1.00000+exp(- (STATES[0]+55.0000)/7.00000)); ALGEBRAIC[6] = 1.00000/(1.00000+exp((STATES[0]+80.0000)/8.00000)); ALGEBRAIC[4] = 1.00000/(1.00000+exp(- (STATES[0]+60.0000)/10.0000)); ALGEBRAIC[5] = 1.00000/(1.00000+exp((STATES[0]+70.0000)/5.70000)); ALGEBRAIC[3] = 1.00000/(1.00000+exp((STATES[0]+81.0000)/11.0000)); ALGEBRAIC[10] = CONSTANTS[3]*STATES[6]*(STATES[0] - CONSTANTS[12])*pow(STATES[5], 2.00000); ALGEBRAIC[9] = 1.00000/(1.00000+exp((STATES[0]+30.0000)/8.30000)); ALGEBRAIC[12] = 0.400000*(1.00000+2.00000/(1.00000+exp((STATES[0]+25.0000)/5.00000))); ALGEBRAIC[8] = 1.00000/(1.00000+exp(- (STATES[0]+31.0000)/5.30000)); ALGEBRAIC[13] = ( 0.800000*(1.00000+2.00000/(1.00000+exp((STATES[0]+25.0000)/10.0000))))/(1.00000+exp(- (STATES[0]+70.0000)/10.0000)); ALGEBRAIC[7] = 1.00000/(1.00000+exp(- (STATES[4]+20.0000)/5.30000)); ALGEBRAIC[14] = 0.400000/( 5.00000*exp(- (STATES[4]+11.0000)/8.30000)+(- (STATES[4]+11.0000)/8.30000)/(exp(- (STATES[4]+11.0000)/8.30000) - 1.00000)); ALGEBRAIC[11] = pow(STATES[10], 3.00000)/(pow(STATES[10], 3.00000)+pow(CONSTANTS[17], 3.00000)); ALGEBRAIC[16] = CONSTANTS[18]*(ALGEBRAIC[11] - CONSTANTS[31]); ALGEBRAIC[19] = (CONSTANTS[22]/(1.00000+ (CONSTANTS[24]/CONSTANTS[25])*exp(- STATES[4]/CONSTANTS[26])))*(STATES[4] - CONSTANTS[0]); ALGEBRAIC[18] = CONSTANTS[23]*(STATES[4] - CONSTANTS[28]); ALGEBRAIC[21] = (CONSTANTS[21]/(1.00000+ (CONSTANTS[24]/CONSTANTS[25])*exp(- STATES[4]/CONSTANTS[26])))*(STATES[4] - CONSTANTS[27]); ALGEBRAIC[24] = CONSTANTS[29]*(STATES[4] - CONSTANTS[12])*pow(STATES[11], 2.00000); ALGEBRAIC[1] = CONSTANTS[30]*(STATES[4] - CONSTANTS[13])*pow(STATES[2], 2.00000); ALGEBRAIC[22] = 1.00000/(1.00000+exp(- (STATES[0]+35.0000)/6.20000)); ALGEBRAIC[25] = CONSTANTS[1]*STATES[3]*(STATES[0] - CONSTANTS[0])*pow(ALGEBRAIC[22], 3.00000); ALGEBRAIC[0] = CONSTANTS[2]*(STATES[0] - CONSTANTS[13])*pow(STATES[2], 2.00000); ALGEBRAIC[15] = (( CONSTANTS[4]*pow(STATES[1], 4.00000))/(pow(STATES[1], 4.00000)+pow(CONSTANTS[8], 4.00000)))*(STATES[0] - CONSTANTS[13]); ALGEBRAIC[17] = CONSTANTS[5]*STATES[8]*(STATES[0] - CONSTANTS[13])*pow(STATES[7], 4.00000); ALGEBRAIC[20] = CONSTANTS[6]*STATES[9]*(STATES[0] - CONSTANTS[9]); ALGEBRAIC[23] = ALGEBRAIC[21]+ALGEBRAIC[16]+ALGEBRAIC[18]; }