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 3 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 8 entries in the constant variable array. */ /* * VOI is time in component environment (minute). * CONSTANTS[0] is PRA in component volume_receptors (mmHg). * CONSTANTS[7] is AHZ in component effect_of_pressure_on_volume_receptors (dimensionless). * CONSTANTS[1] is AH10 in component parameter_values (dimensionless). * CONSTANTS[2] is AH9 in component parameter_values (per_mmHg). * CONSTANTS[6] is AHZ1 in component effect_of_pressure_on_volume_receptors (dimensionless). * STATES[0] is AHY in component time_dependent_volume_receptor_adaptation (dimensionless). * CONSTANTS[3] is AH11 in component parameter_values (minute). * ALGEBRAIC[0] is AH7 in component total_volume_nervous_feedback (dimensionless). * ALGEBRAIC[1] is ATRRFB in component volume_effect_on_arteries (dimensionless). * CONSTANTS[4] is ATRFBM in component parameter_values (dimensionless). * ALGEBRAIC[2] is ATRVFB in component volume_effect_on_unstressed_venous_volume (litre). * CONSTANTS[5] is ATRVM in component parameter_values (litre). * RATES[0] is d/dt AHY in component time_dependent_volume_receptor_adaptation (dimensionless). */ void initConsts(double* CONSTANTS, double* RATES, double *STATES) { CONSTANTS[0] = 0.00852183; CONSTANTS[1] = 0.333; CONSTANTS[2] = 1; STATES[0] = 0.301963; CONSTANTS[3] = 1000; CONSTANTS[4] = 0; CONSTANTS[5] = 0; CONSTANTS[6] = pow(fabs(CONSTANTS[0]), CONSTANTS[1])*CONSTANTS[2]; CONSTANTS[7] = (CONSTANTS[0]<0.00000 ? - CONSTANTS[6] : CONSTANTS[6]); } void computeRates(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC) { RATES[0] = (CONSTANTS[7] - STATES[0])/CONSTANTS[3]; } void computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC) { ALGEBRAIC[0] = CONSTANTS[7] - STATES[0]; ALGEBRAIC[1] = ALGEBRAIC[0]*CONSTANTS[4]+1.00000; ALGEBRAIC[2] = ALGEBRAIC[0]*CONSTANTS[5]; }