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 1 entries in the algebraic variable array.
There are a total of 1 entries in each of the rate and state variable arrays.
There are a total of 11 entries in the constant variable array.
*/
/*
* VOI is time in component environment (millisecond).
* CONSTANTS[0] is C in component membrane (microF_per_mm2).
* CONSTANTS[1] is T in component membrane (per_millisecond).
* STATES[0] is Y in component membrane (dimensionless).
* CONSTANTS[7] is Y_infinity_Vm in component membrane (dimensionless).
* CONSTANTS[2] is Vm in component membrane (millivolt).
* ALGEBRAIC[0] is I_ion in component membrane (microA_per_mm2).
* CONSTANTS[8] is i1_Vm in component membrane (microA_per_mm2).
* CONSTANTS[10] is i0_Vm in component membrane (microA_per_mm2).
* CONSTANTS[9] is f_Vm in component membrane (microA_per_mm2).
* CONSTANTS[3] is af in component membrane (dimensionless).
* CONSTANTS[4] is bf in component membrane (dimensionless).
* CONSTANTS[5] is cf in component membrane (dimensionless).
* CONSTANTS[6] is df in component membrane (dimensionless).
* RATES[0] is d/dt Y in component membrane (dimensionless).
* There are a total of 0 condition variables.
*/
void
initConsts(double* CONSTANTS, double* RATES, double *STATES)
{
CONSTANTS[0] = 0.01;
CONSTANTS[1] = 50.0;
STATES[0] = 0.07;
CONSTANTS[2] = -78.6;
CONSTANTS[3] = 0.00003837854;
CONSTANTS[4] = 0.00584649;
CONSTANTS[5] = 0.2531834;
CONSTANTS[6] = 2.356256;
CONSTANTS[7] = (CONSTANTS[2]<-80.0000 ? 0.00000 : CONSTANTS[2]>-60.0000 ? 1.00000 : (CONSTANTS[2]+80.0000)/20.0000);
CONSTANTS[8] = (CONSTANTS[2]<-70.0000 ? 0.0500000+ 0.00500000*(CONSTANTS[2]+70.0000) : CONSTANTS[2]>0.00000 ? 0.0600000+ 0.00425000*CONSTANTS[2] : 0.0500000+( 0.0100000*(CONSTANTS[2]+70.0000))/70.0000);
CONSTANTS[9] = (CONSTANTS[2]<-74.3000 ? 0.0784000+ 0.0200000*(CONSTANTS[2]+74.3000) : CONSTANTS[2]>-27.8000 ? -0.988400+ 0.0171000*(CONSTANTS[2]+27.8000) : CONSTANTS[3]*pow(CONSTANTS[2], 3.00000)+ CONSTANTS[4]*pow(CONSTANTS[2], 2.00000)+ CONSTANTS[5]*CONSTANTS[2]+CONSTANTS[6]);
CONSTANTS[10] = CONSTANTS[8]+CONSTANTS[9];
RATES[0] = 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[1])*(CONSTANTS[7] - STATES[0]);
}
void
computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
ALGEBRAIC[0] = - STATES[0]*CONSTANTS[8] - (1.00000 - STATES[0])*CONSTANTS[10];
}
void
computeEssentialVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC)
{
}
void
getStateInformation(double* SI)
{
SI[0] = 1.0;
}
void
computeRoots(double VOI, double* CONSTANTS, double* RATES, double* OLDRATES, double* STATES,
double* OLDSTATES, double* ALGEBRAIC, double* CONDVARS)
{
}
