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 4 entries in the algebraic variable array. There are a total of 3 entries in each of the rate and state variable arrays. There are a total of 25 entries in the constant variable array. */ /* * VOI is time in component environment (second). * STATES[0] is Vm in component membrane (millivolt). * CONSTANTS[0] is C in component membrane (picoF). * ALGEBRAIC[3] is i_K in component potassium_current (picoA). * ALGEBRAIC[2] is i_R in component repolarising_current (picoA). * STATES[1] is IP3 in component IP3 (nanomolar). * CONSTANTS[1] is m3IP3 in component IP3 (dimensionless). * CONSTANTS[2] is m4IP3 in component IP3 (dimensionless). * CONSTANTS[3] is kIP3 in component IP3 (first_order_rate_constant). * CONSTANTS[4] is A in component IP3 (dimensionless). * STATES[2] is Ca in component Ca (nanomolar). * CONSTANTS[5] is m3SR in component Ca (dimensionless). * CONSTANTS[6] is m4SR in component Ca (dimensionless). * CONSTANTS[7] is m3PMCA in component Ca (dimensionless). * CONSTANTS[8] is m4PMCA in component Ca (dimensionless). * CONSTANTS[9] is kSR_rel in component Ca (flux). * CONSTANTS[10] is kPMCA in component Ca (flux). * ALGEBRAIC[0] is Jcat in component Jcat (flux). * CONSTANTS[11] is ECa in component Jcat (millivolt). * CONSTANTS[12] is Gcat in component Jcat (nanomolar_per_millivolt_second). * CONSTANTS[13] is m3cat in component Jcat (dimensionless). * CONSTANTS[14] is m4cat in component Jcat (dimensionless). * CONSTANTS[15] is Gtot in component potassium_current (picoS). * ALGEBRAIC[1] is PoBKCa in component potassium_current (dimensionless). * CONSTANTS[16] is PoSKCa in component potassium_current (dimensionless). * CONSTANTS[17] is E_K in component potassium_current (millivolt). * CONSTANTS[18] is a in component potassium_current (dimensionless). * CONSTANTS[19] is b in component potassium_current (dimensionless). * CONSTANTS[20] is c in component potassium_current (dimensionless). * CONSTANTS[21] is m3 in component potassium_current (dimensionless). * CONSTANTS[22] is m4 in component potassium_current (dimensionless). * CONSTANTS[23] is GR in component repolarising_current (picoS). * CONSTANTS[24] is Vrest in component repolarising_current (millivolt). * RATES[0] is d/dt Vm in component membrane (millivolt). * RATES[1] is d/dt IP3 in component IP3 (nanomolar). * RATES[2] is d/dt Ca in component Ca (nanomolar). * There are a total of 0 condition variables. */ void initConsts(double* CONSTANTS, double* RATES, double *STATES) { STATES[0] = -31.1; CONSTANTS[0] = 1.0; STATES[1] = 1.0; CONSTANTS[1] = 4.0; CONSTANTS[2] = 55.0; CONSTANTS[3] = 0.1733; CONSTANTS[4] = 0.211; STATES[2] = 50.0; CONSTANTS[5] = 1.1; CONSTANTS[6] = 0.3; CONSTANTS[7] = -6.19; CONSTANTS[8] = 0.39; CONSTANTS[9] = 180.0; CONSTANTS[10] = 0.679; CONSTANTS[11] = 50.0; CONSTANTS[12] = 0.66; CONSTANTS[13] = -6.18; CONSTANTS[14] = 0.37; CONSTANTS[15] = 6927; CONSTANTS[16] = 0.5; CONSTANTS[17] = -80.0; CONSTANTS[18] = 53.3; CONSTANTS[19] = -80.8; CONSTANTS[20] = -6.4; CONSTANTS[21] = 1.32E-3; CONSTANTS[22] = 0.30; CONSTANTS[23] = 955.0; CONSTANTS[24] = -31.1; RATES[0] = 0.1001; RATES[1] = 0.1001; RATES[2] = 0.1001; } void computeResiduals(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES, double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS) { resid[0] = RATES[0] - - (1.00000/CONSTANTS[0])*(ALGEBRAIC[3]+ALGEBRAIC[2]); resid[1] = RATES[1] - CONSTANTS[4]*(1.00000+ tanh((CONSTANTS[1] - VOI)/CONSTANTS[2])) - CONSTANTS[3]*STATES[1]; resid[2] = RATES[2] - (CONSTANTS[9]/2.00000)*(1.00000+ tanh((STATES[1] - CONSTANTS[5])/CONSTANTS[6])) - (CONSTANTS[10]/2.00000)*(1.00000+ tanh((arbitrary_log(STATES[2], 10) - CONSTANTS[7])/CONSTANTS[8])); } void computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC) { ALGEBRAIC[0] = ( CONSTANTS[12]*(CONSTANTS[11] - STATES[0]))*( 0.500000*(1.00000+ tanh((arbitrary_log(STATES[2], 10) - CONSTANTS[13])/CONSTANTS[14]))); } void computeEssentialVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC) { ALGEBRAIC[2] = CONSTANTS[23]*(STATES[0] - CONSTANTS[24]); ALGEBRAIC[1] = 0.500000*(1.00000+ tanh(( (arbitrary_log(STATES[2], 10) - CONSTANTS[20])*(STATES[0] - CONSTANTS[19]) - CONSTANTS[18])/( CONSTANTS[21]*pow((STATES[0]+ CONSTANTS[18]*(arbitrary_log(STATES[2], 10) - CONSTANTS[20])) - CONSTANTS[19], 2.00000)+CONSTANTS[22]))); ALGEBRAIC[3] = CONSTANTS[15]*(STATES[0] - CONSTANTS[17])*( 0.400000*ALGEBRAIC[1]+ 0.600000*CONSTANTS[16]); } void getStateInformation(double* SI) { SI[0] = 1.0; SI[1] = 1.0; SI[2] = 1.0; } void computeRoots(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES, double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS) { }