From 179ea910eb809d8bbf887b5dfb2a3c222b894561 Mon Sep 17 00:00:00 2001 From: Alan Garny Date: Thu, 8 Aug 2024 11:34:04 +0200 Subject: [PATCH] Analyser: track the constant, computed constant, and algebraic indexes. --- src/analyser.cpp | 32 +- tests/resources/coverage/generator/model.c | 434 +++++------ .../generator/model.implementation.out | 434 +++++------ .../generator/model.modified.profile.c | 434 +++++------ .../generator/model.modified.profile.py | 434 +++++------ tests/resources/coverage/generator/model.out | 434 +++++------ tests/resources/coverage/generator/model.py | 434 +++++------ .../algebraic_eqn_const_var_on_rhs/model.c | 4 +- .../algebraic_eqn_const_var_on_rhs/model.py | 4 +- .../algebraic_eqn_derivative_on_rhs/model.c | 2 +- .../algebraic_eqn_derivative_on_rhs/model.py | 2 +- .../model.c | 2 +- .../model.py | 2 +- .../algebraic_eqn_state_var_on_rhs/model.c | 2 +- .../algebraic_eqn_state_var_on_rhs/model.py | 2 +- .../model.c | 2 +- .../model.py | 2 +- .../model.c | 10 +- .../model.external.c | 4 +- .../model.external.py | 4 +- .../model.py | 10 +- .../model.not.ordered.c | 10 +- .../model.not.ordered.py | 10 +- .../model.ordered.c | 28 +- .../model.ordered.py | 28 +- .../generator/cell_geometry_model/model.c | 8 +- .../generator/cell_geometry_model/model.py | 8 +- .../generator/cellml_slc_example/model.py | 20 +- .../cellml_unit_scaling_constant/model.c | 4 +- .../cellml_unit_scaling_constant/model.py | 4 +- .../generator/dae_cellml_1_1_model/model.c | 34 +- .../generator/dae_cellml_1_1_model/model.py | 34 +- .../model.c | 684 +++++++++--------- .../model.py | 684 +++++++++--------- .../model.c | 504 ++++++------- .../model.py | 504 ++++++------- .../model.algebraic.c | 60 +- .../model.algebraic.py | 60 +- .../model.c | 60 +- .../model.computed.constant.c | 64 +- .../model.computed.constant.py | 64 +- .../model.constant.c | 56 +- .../model.constant.py | 56 +- .../model.dae.c | 114 +-- .../model.dae.py | 114 +-- .../model.dependent.algebraic.c | 62 +- .../model.dependent.algebraic.py | 62 +- .../model.dependent.computed.constant.c | 72 +- .../model.dependent.computed.constant.py | 72 +- .../model.dependent.constant.c | 60 +- .../model.dependent.constant.py | 60 +- .../model.dependent.state.c | 42 +- .../model.dependent.state.py | 42 +- .../model.external.c | 42 +- .../model.external.py | 42 +- .../model.py | 60 +- .../model.state.c | 60 +- .../model.state.py | 60 +- .../generator/noble_model_1962/model.c | 66 +- .../generator/noble_model_1962/model.py | 66 +- .../robertson_model_1966/model.dae.c | 18 +- .../robertson_model_1966/model.dae.py | 18 +- .../robertson_model_1966/model.ode.c | 2 +- .../robertson_model_1966/model.ode.py | 2 +- .../generator/sine_model_imports/model.c | 20 +- .../generator/sine_model_imports/model.py | 20 +- .../model.c | 22 +- .../model.py | 22 +- 68 files changed, 3454 insertions(+), 3438 deletions(-) diff --git a/src/analyser.cpp b/src/analyser.cpp index 23a6938618..d9a48da5da 100644 --- a/src/analyser.cpp +++ b/src/analyser.cpp @@ -208,7 +208,8 @@ struct AnalyserInternalEquation bool variableOnRhs(const AnalyserInternalVariablePtr &variable); bool variableOnLhsOrRhs(const AnalyserInternalVariablePtr &variable); - bool check(const AnalyserModelPtr &model, size_t &stateIndex, size_t &variableIndex, bool checkNlaSystems); + bool check(const AnalyserModelPtr &model, size_t &stateIndex, size_t &constantIndex, + size_t &computedConstantIndex, size_t &algebraicIndex, bool checkNlaSystems); }; AnalyserInternalEquationPtr AnalyserInternalEquation::create(const ComponentPtr &component) @@ -321,7 +322,8 @@ bool AnalyserInternalEquation::variableOnLhsOrRhs(const AnalyserInternalVariable } bool AnalyserInternalEquation::check(const AnalyserModelPtr &model, - size_t &stateIndex, size_t &variableIndex, + size_t &stateIndex, size_t &constantIndex, + size_t &computedConstantIndex, size_t &algebraicIndex, bool checkNlaSystems) { // Nothing to check if the equation has a known type. @@ -437,7 +439,12 @@ bool AnalyserInternalEquation::check(const AnalyserModelPtr &model, case AnalyserInternalVariable::Type::ALGEBRAIC: variable->mIndex = (variable->mType == AnalyserInternalVariable::Type::STATE) ? ++stateIndex : - ++variableIndex; + (variable->mType == AnalyserInternalVariable::Type::CONSTANT) ? + ++constantIndex : + ((variable->mType == AnalyserInternalVariable::Type::COMPUTED_TRUE_CONSTANT) + || (variable->mType == AnalyserInternalVariable::Type::COMPUTED_VARIABLE_BASED_CONSTANT)) ? + ++computedConstantIndex : + ++algebraicIndex; mUnknownVariables.push_back(variable); @@ -2748,7 +2755,9 @@ void Analyser::AnalyserImpl::analyseModel(const ModelPtr &model) // model valid). auto stateIndex = MAX_SIZE_T; - auto variableIndex = MAX_SIZE_T; + auto constantIndex = MAX_SIZE_T; + auto computedConstantIndex = MAX_SIZE_T; + auto algebraicIndex = MAX_SIZE_T; auto loopNumber = 1; bool relevantCheck; auto checkNlaSystems = false; @@ -2757,7 +2766,8 @@ void Analyser::AnalyserImpl::analyseModel(const ModelPtr &model) relevantCheck = false; for (const auto &internalEquation : mInternalEquations) { - relevantCheck = internalEquation->check(mModel, stateIndex, variableIndex, checkNlaSystems) + relevantCheck = internalEquation->check(mModel, stateIndex, constantIndex, computedConstantIndex, + algebraicIndex, checkNlaSystems) || relevantCheck; } @@ -2802,7 +2812,7 @@ void Analyser::AnalyserImpl::analyseModel(const ModelPtr &model) case AnalyserInternalVariable::Type::INITIALISED: // The variable is (still) initialised so it has to be a constant. - internalVariable->makeConstant(variableIndex); + internalVariable->makeConstant(constantIndex); break; case AnalyserInternalVariable::Type::OVERCONSTRAINED: @@ -3058,7 +3068,9 @@ void Analyser::AnalyserImpl::analyseModel(const ModelPtr &model) std::map v2avMappings; stateIndex = MAX_SIZE_T; - variableIndex = MAX_SIZE_T; + constantIndex = MAX_SIZE_T; + computedConstantIndex = MAX_SIZE_T; + algebraicIndex = MAX_SIZE_T; for (const auto &internalVariable : mInternalVariables) { // Determine the type of the variable. @@ -3108,7 +3120,11 @@ void Analyser::AnalyserImpl::analyseModel(const ModelPtr &model) variable->mPimpl->populate(type, (type == AnalyserVariable::Type::STATE) ? ++stateIndex : - ++variableIndex, + (type == AnalyserVariable::Type::CONSTANT) ? + ++constantIndex : + (type == AnalyserVariable::Type::COMPUTED_CONSTANT) ? + ++computedConstantIndex : + ++algebraicIndex, (type == AnalyserVariable::Type::EXTERNAL) ? nullptr : internalVariable->mInitialisingVariable, diff --git a/tests/resources/coverage/generator/model.c b/tests/resources/coverage/generator/model.c index 872419de42..0918ab6d4c 100644 --- a/tests/resources/coverage/generator/model.c +++ b/tests/resources/coverage/generator/model.c @@ -356,11 +356,11 @@ void objectiveFunction0(double *u, double *f, void *data) double *rates = ((RootFindingInfo *) data)->rates; double *variables = ((RootFindingInfo *) data)->variables; - algebraic[205] = u[0]; - algebraic[206] = u[1]; + algebraic[0] = u[0]; + algebraic[1] = u[1]; - f[0] = algebraic[205]+algebraic[206]+states[0]-0.0; - f[1] = algebraic[205]-algebraic[206]-(computedConstants[207]+computedConstants[208]); + f[0] = algebraic[0]+algebraic[1]+states[0]-0.0; + f[1] = algebraic[0]-algebraic[1]-(computedConstants[198]+computedConstants[199]); } void findRoot0(double voi, double *states, double *rates, double *variables) @@ -368,231 +368,231 @@ void findRoot0(double voi, double *states, double *rates, double *variables) RootFindingInfo rfi = { voi, states, rates, variables }; double u[2]; - u[0] = algebraic[205]; - u[1] = algebraic[206]; + u[0] = algebraic[0]; + u[1] = algebraic[1]; nlaSolve(objectiveFunction0, u, 2, &rfi); - algebraic[205] = u[0]; - algebraic[206] = u[1]; + algebraic[0] = u[0]; + algebraic[1] = u[1]; } void initialiseVariables(double *states, double *rates, double *constants) { - constants[1] = 1.0; - constants[2] = 2.0; - constants[6] = 3.0; - constants[18] = 4.0; - constants[179] = 5.0; - constants[180] = 6.0; - constants[182] = 7.0; - algebraic[205] = 1.0; - algebraic[206] = 2.0; - computedConstants[184] = 123.0; - computedConstants[185] = 123.456789; - computedConstants[186] = 123.0e99; - computedConstants[187] = 123.456789e99; - computedConstants[189] = 1.0; - computedConstants[190] = 0.0; - computedConstants[191] = 2.71828182845905; - computedConstants[192] = 3.14159265358979; - computedConstants[193] = INFINITY; - computedConstants[194] = NAN; - computedConstants[207] = 1.0; - computedConstants[208] = 3.0; + constants[0] = 1.0; + constants[1] = 2.0; + constants[2] = 3.0; + constants[3] = 4.0; + constants[4] = 5.0; + constants[5] = 6.0; + constants[6] = 7.0; + algebraic[0] = 1.0; + algebraic[1] = 2.0; + computedConstants[177] = 123.0; + computedConstants[178] = 123.456789; + computedConstants[179] = 123.0e99; + computedConstants[180] = 123.456789e99; + computedConstants[182] = 1.0; + computedConstants[183] = 0.0; + computedConstants[184] = 2.71828182845905; + computedConstants[185] = 3.14159265358979; + computedConstants[186] = INFINITY; + computedConstants[187] = NAN; + computedConstants[198] = 1.0; + computedConstants[199] = 3.0; states[0] = 0.0; } void computeComputedConstants(double *constants, double *computedConstants) { - computedConstants[0] = constants[1] == constants[2]; - computedConstants[3] = constants[1]/(constants[2] == constants[2]); - computedConstants[4] = constants[1] != constants[2]; - computedConstants[5] = constants[1]/(constants[2] != constants[6]); - computedConstants[7] = constants[1] < constants[2]; - computedConstants[8] = constants[1]/(constants[2] < constants[6]); - computedConstants[9] = constants[1] <= constants[2]; - computedConstants[10] = constants[1]/(constants[2] <= constants[6]); - computedConstants[11] = constants[1] > constants[2]; - computedConstants[12] = constants[1]/(constants[2] > constants[6]); - computedConstants[13] = constants[1] >= constants[2]; - computedConstants[14] = constants[1]/(constants[2] >= constants[6]); - computedConstants[15] = constants[1] && constants[2]; - computedConstants[16] = constants[1] && constants[2] && constants[6]; - computedConstants[17] = (constants[1] < constants[2]) && (constants[6] > constants[18]); - computedConstants[19] = (constants[1]+constants[2]) && (constants[6] > constants[18]); - computedConstants[20] = constants[1] && (constants[2] > constants[6]); - computedConstants[21] = (constants[1]-constants[2]) && (constants[6] > constants[18]); - computedConstants[22] = -constants[1] && (constants[2] > constants[6]); - computedConstants[23] = pow(constants[1], constants[2]) && (constants[6] > constants[18]); - computedConstants[24] = pow(constants[1], 1.0/constants[2]) && (constants[6] > constants[18]); - computedConstants[25] = (constants[1] < constants[2]) && (constants[6]+constants[18]); - computedConstants[26] = (constants[1] < constants[2]) && constants[6]; - computedConstants[27] = (constants[1] < constants[2]) && (constants[6]-constants[18]); - computedConstants[28] = (constants[1] < constants[2]) && -constants[6]; - computedConstants[29] = (constants[1] < constants[2]) && pow(constants[6], constants[18]); - computedConstants[30] = (constants[1] < constants[2]) && pow(constants[6], 1.0/constants[18]); - computedConstants[31] = constants[1]/(constants[2] && constants[6]); - computedConstants[32] = constants[1] || constants[2]; - computedConstants[33] = constants[1] || constants[2] || constants[6]; - computedConstants[34] = (constants[1] < constants[2]) || (constants[6] > constants[18]); - computedConstants[35] = (constants[1]+constants[2]) || (constants[6] > constants[18]); - computedConstants[36] = constants[1] || (constants[2] > constants[6]); - computedConstants[37] = (constants[1]-constants[2]) || (constants[6] > constants[18]); - computedConstants[38] = -constants[1] || (constants[2] > constants[6]); - computedConstants[39] = pow(constants[1], constants[2]) || (constants[6] > constants[18]); - computedConstants[40] = pow(constants[1], 1.0/constants[2]) || (constants[6] > constants[18]); - computedConstants[41] = (constants[1] < constants[2]) || (constants[6]+constants[18]); - computedConstants[42] = (constants[1] < constants[2]) || constants[6]; - computedConstants[43] = (constants[1] < constants[2]) || (constants[6]-constants[18]); - computedConstants[44] = (constants[1] < constants[2]) || -constants[6]; - computedConstants[45] = (constants[1] < constants[2]) || pow(constants[6], constants[18]); - computedConstants[46] = (constants[1] < constants[2]) || pow(constants[6], 1.0/constants[18]); - computedConstants[47] = constants[1]/(constants[2] || constants[6]); - computedConstants[48] = xor(constants[1], constants[2]); - computedConstants[49] = xor(constants[1], xor(constants[2], constants[6])); - computedConstants[50] = xor(constants[1] < constants[2], constants[6] > constants[18]); - computedConstants[51] = xor(constants[1]+constants[2], constants[6] > constants[18]); - computedConstants[52] = xor(constants[1], constants[2] > constants[6]); - computedConstants[53] = xor(constants[1]-constants[2], constants[6] > constants[18]); - computedConstants[54] = xor(-constants[1], constants[2] > constants[6]); - computedConstants[55] = xor(pow(constants[1], constants[2]), constants[6] > constants[18]); - computedConstants[56] = xor(pow(constants[1], 1.0/constants[2]), constants[6] > constants[18]); - computedConstants[57] = xor(constants[1] < constants[2], constants[6]+constants[18]); - computedConstants[58] = xor(constants[1] < constants[2], constants[6]); - computedConstants[59] = xor(constants[1] < constants[2], constants[6]-constants[18]); - computedConstants[60] = xor(constants[1] < constants[2], -constants[6]); - computedConstants[61] = xor(constants[1] < constants[2], pow(constants[6], constants[18])); - computedConstants[62] = xor(constants[1] < constants[2], pow(constants[6], 1.0/constants[18])); - computedConstants[63] = constants[1]/xor(constants[2], constants[6]); - computedConstants[64] = !constants[1]; - computedConstants[65] = constants[1]+constants[2]; - computedConstants[66] = constants[1]+constants[2]+constants[6]; - computedConstants[67] = (constants[1] < constants[2])+(constants[6] > constants[18]); - computedConstants[68] = constants[1]; - computedConstants[69] = constants[1]-constants[2]; - computedConstants[70] = (constants[1] < constants[2])-(constants[6] > constants[18]); - computedConstants[71] = (constants[1] < constants[2])-(constants[6]+constants[18]); - computedConstants[72] = (constants[1] < constants[2])-constants[6]; - computedConstants[73] = constants[1]-(-constants[2]); - computedConstants[74] = constants[1]-(-constants[2]*constants[6]); - computedConstants[75] = -constants[1]; - computedConstants[76] = -(constants[1] < constants[2]); - computedConstants[77] = constants[1]*constants[2]; - computedConstants[78] = constants[1]*constants[2]*constants[6]; - computedConstants[79] = (constants[1] < constants[2])*(constants[6] > constants[18]); - computedConstants[80] = (constants[1]+constants[2])*(constants[6] > constants[18]); - computedConstants[81] = constants[1]*(constants[2] > constants[6]); - computedConstants[82] = (constants[1]-constants[2])*(constants[6] > constants[18]); - computedConstants[83] = -constants[1]*(constants[2] > constants[6]); - computedConstants[84] = (constants[1] < constants[2])*(constants[6]+constants[18]); - computedConstants[85] = (constants[1] < constants[2])*constants[6]; - computedConstants[86] = (constants[1] < constants[2])*(constants[6]-constants[18]); - computedConstants[87] = (constants[1] < constants[2])*-constants[6]; - computedConstants[88] = constants[1]/constants[2]; - computedConstants[89] = (constants[1] < constants[2])/(constants[18] > constants[6]); - computedConstants[90] = (constants[1]+constants[2])/(constants[18] > constants[6]); - computedConstants[91] = constants[1]/(constants[6] > constants[2]); - computedConstants[92] = (constants[1]-constants[2])/(constants[18] > constants[6]); - computedConstants[93] = -constants[1]/(constants[6] > constants[2]); - computedConstants[94] = (constants[1] < constants[2])/(constants[6]+constants[18]); - computedConstants[95] = (constants[1] < constants[2])/constants[6]; - computedConstants[96] = (constants[1] < constants[2])/(constants[6]-constants[18]); - computedConstants[97] = (constants[1] < constants[2])/-constants[6]; - computedConstants[98] = (constants[1] < constants[2])/(constants[6]*constants[18]); - computedConstants[99] = (constants[1] < constants[2])/(constants[6]/constants[18]); - computedConstants[100] = sqrt(constants[1]); - computedConstants[101] = pow(constants[1], 2.0); - computedConstants[102] = pow(constants[1], 3.0); - computedConstants[103] = pow(constants[1], constants[2]); - computedConstants[104] = pow(constants[1] <= constants[2], constants[6] >= constants[18]); - computedConstants[105] = pow(constants[1]+constants[2], constants[6] >= constants[18]); - computedConstants[106] = pow(constants[1], constants[2] >= constants[6]); - computedConstants[107] = pow(constants[1]-constants[2], constants[6] >= constants[18]); - computedConstants[108] = pow(-constants[1], constants[2] >= constants[6]); - computedConstants[109] = pow(constants[1]*constants[2], constants[6] >= constants[18]); - computedConstants[110] = pow(constants[1]/constants[2], constants[6] >= constants[18]); - computedConstants[111] = pow(constants[1] <= constants[2], constants[6]+constants[18]); - computedConstants[112] = pow(constants[1] <= constants[2], constants[6]); - computedConstants[113] = pow(constants[1] <= constants[2], constants[6]-constants[18]); - computedConstants[114] = pow(constants[1] <= constants[2], -constants[6]); - computedConstants[115] = pow(constants[1] <= constants[2], constants[6]*constants[18]); - computedConstants[116] = pow(constants[1] <= constants[2], constants[6]/constants[18]); - computedConstants[117] = pow(constants[1] <= constants[2], pow(constants[6], constants[18])); - computedConstants[118] = pow(constants[1] <= constants[2], pow(constants[6], 1.0/constants[18])); - computedConstants[119] = sqrt(constants[1]); - computedConstants[120] = sqrt(constants[1]); - computedConstants[121] = pow(constants[1], 1.0/3.0); - computedConstants[122] = pow(constants[1], 1.0/constants[2]); - computedConstants[123] = pow(constants[1] < constants[2], 1.0/(constants[18] > constants[6])); - computedConstants[124] = pow(constants[1]+constants[2], 1.0/(constants[18] > constants[6])); - computedConstants[125] = pow(constants[1], 1.0/(constants[6] > constants[2])); - computedConstants[126] = pow(constants[1]-constants[2], 1.0/(constants[18] > constants[6])); - computedConstants[127] = pow(-constants[1], 1.0/(constants[6] > constants[2])); - computedConstants[128] = pow(constants[1]*constants[2], 1.0/(constants[18] > constants[6])); - computedConstants[129] = pow(constants[1]/constants[2], 1.0/(constants[18] > constants[6])); - computedConstants[130] = pow(constants[1] < constants[2], 1.0/(constants[6]+constants[18])); - computedConstants[131] = pow(constants[1] < constants[2], 1.0/constants[6]); - computedConstants[132] = pow(constants[1] < constants[2], 1.0/(constants[6]-constants[18])); - computedConstants[133] = pow(constants[1] < constants[2], 1.0/-constants[6]); - computedConstants[134] = pow(constants[1] < constants[2], 1.0/(constants[6]*constants[18])); - computedConstants[135] = pow(constants[1] < constants[2], 1.0/(constants[6]/constants[18])); - computedConstants[136] = pow(constants[1] < constants[2], 1.0/pow(constants[6], constants[18])); - computedConstants[137] = pow(constants[1] < constants[2], 1.0/pow(constants[6], 1.0/constants[18])); - computedConstants[138] = fabs(constants[1]); - computedConstants[139] = exp(constants[1]); - computedConstants[140] = log(constants[1]); - computedConstants[141] = log10(constants[1]); - computedConstants[142] = log(constants[1])/log(2.0); - computedConstants[143] = log10(constants[1]); - computedConstants[144] = log(constants[1])/log(constants[2]); - computedConstants[145] = ceil(constants[1]); - computedConstants[146] = floor(constants[1]); - computedConstants[147] = min(constants[1], constants[2]); - computedConstants[148] = min(constants[1], min(constants[2], constants[6])); - computedConstants[149] = max(constants[1], constants[2]); - computedConstants[150] = max(constants[1], max(constants[2], constants[6])); - computedConstants[151] = fmod(constants[1], constants[2]); - computedConstants[152] = sin(constants[1]); - computedConstants[153] = cos(constants[1]); - computedConstants[154] = tan(constants[1]); - computedConstants[155] = sec(constants[1]); - computedConstants[156] = csc(constants[1]); - computedConstants[157] = cot(constants[1]); - computedConstants[158] = sinh(constants[1]); - computedConstants[159] = cosh(constants[1]); - computedConstants[160] = tanh(constants[1]); - computedConstants[161] = sech(constants[1]); - computedConstants[162] = csch(constants[1]); - computedConstants[163] = coth(constants[1]); - computedConstants[164] = asin(constants[1]); - computedConstants[165] = acos(constants[1]); - computedConstants[166] = atan(constants[1]); - computedConstants[167] = asec(constants[1]); - computedConstants[168] = acsc(constants[1]); - computedConstants[169] = acot(constants[1]); - computedConstants[170] = asinh(constants[1]); - computedConstants[171] = acosh(constants[1]); - computedConstants[172] = atanh(constants[1]/2.0); - computedConstants[173] = asech(constants[1]); - computedConstants[174] = acsch(constants[1]); - computedConstants[175] = acoth(2.0*constants[1]); - computedConstants[176] = (constants[1] > constants[2])?constants[1]:NAN; - computedConstants[177] = (constants[1] > constants[2])?constants[1]:constants[6]; - computedConstants[178] = (constants[1] > constants[2])?constants[1]:(constants[6] > constants[18])?constants[6]:(constants[179] > constants[180])?constants[179]:NAN; - computedConstants[181] = (constants[1] > constants[2])?constants[1]:(constants[6] > constants[18])?constants[6]:(constants[179] > constants[180])?constants[179]:constants[182]; - computedConstants[183] = 123.0+((constants[1] > constants[2])?constants[1]:NAN); - computedConstants[188] = constants[1]; - computedConstants[195] = (constants[1] && constants[2])+((constants[6] > constants[18])?constants[2]:NAN)+constants[179]+(constants[180] && constants[182]); - computedConstants[196] = (constants[1] && constants[2])-(((constants[6] > constants[18])?constants[2]:NAN)-(constants[179]-((constants[6] > constants[18])?constants[2]:NAN)))-(constants[180] && constants[182]); - computedConstants[197] = (constants[1] && constants[2])*((constants[6] > constants[18])?constants[2]:NAN)*constants[179]*((constants[6] > constants[18])?constants[2]:NAN)*(constants[180] && constants[182]); - computedConstants[198] = (constants[1] && constants[2])/(((constants[6] > constants[18])?constants[2]:NAN)/(constants[179]/((constants[6] > constants[18])?constants[2]:NAN))); - computedConstants[199] = (constants[1] || constants[2]) && xor(constants[1], constants[2]) && ((constants[6] > constants[18])?constants[2]:NAN) && constants[179] && ((constants[6] > constants[18])?constants[2]:NAN) && xor(constants[1], constants[2]) && (constants[1] || constants[2]); - computedConstants[200] = (constants[1] && constants[2]) || xor(constants[1], constants[2]) || ((constants[6] > constants[18])?constants[2]:NAN) || constants[179] || ((constants[6] > constants[18])?constants[2]:NAN) || xor(constants[1], constants[2]) || (constants[1] && constants[2]); - computedConstants[201] = xor(constants[1] && constants[2], xor(constants[1] || constants[2], xor((constants[6] > constants[18])?constants[2]:NAN, xor(xor(xor(constants[179], (constants[6] > constants[18])?constants[2]:NAN), constants[1] || constants[2]), constants[1] && constants[2])))); - computedConstants[202] = pow(constants[1] && constants[2], pow((constants[6] > constants[18])?constants[2]:NAN, pow(pow(constants[179], (constants[6] > constants[18])?constants[2]:NAN), constants[1] && constants[2]))); - computedConstants[203] = pow(pow(pow(constants[1] && constants[2], 1.0/pow((constants[6] > constants[18])?constants[2]:NAN, 1.0/constants[179])), 1.0/((constants[6] > constants[18])?constants[2]:NAN)), 1.0/(constants[1] && constants[2])); - computedConstants[204] = -(constants[1] && constants[2])+-((constants[6] > constants[18])?constants[2]:NAN); + computedConstants[0] = constants[0] == constants[1]; + computedConstants[1] = constants[0]/(constants[1] == constants[1]); + computedConstants[2] = constants[0] != constants[1]; + computedConstants[3] = constants[0]/(constants[1] != constants[2]); + computedConstants[4] = constants[0] < constants[1]; + computedConstants[5] = constants[0]/(constants[1] < constants[2]); + computedConstants[6] = constants[0] <= constants[1]; + computedConstants[7] = constants[0]/(constants[1] <= constants[2]); + computedConstants[8] = constants[0] > constants[1]; + computedConstants[9] = constants[0]/(constants[1] > constants[2]); + computedConstants[10] = constants[0] >= constants[1]; + computedConstants[11] = constants[0]/(constants[1] >= constants[2]); + computedConstants[12] = constants[0] && constants[1]; + computedConstants[13] = constants[0] && constants[1] && constants[2]; + computedConstants[14] = (constants[0] < constants[1]) && (constants[2] > constants[3]); + computedConstants[15] = (constants[0]+constants[1]) && (constants[2] > constants[3]); + computedConstants[16] = constants[0] && (constants[1] > constants[2]); + computedConstants[17] = (constants[0]-constants[1]) && (constants[2] > constants[3]); + computedConstants[18] = -constants[0] && (constants[1] > constants[2]); + computedConstants[19] = pow(constants[0], constants[1]) && (constants[2] > constants[3]); + computedConstants[20] = pow(constants[0], 1.0/constants[1]) && (constants[2] > constants[3]); + computedConstants[21] = (constants[0] < constants[1]) && (constants[2]+constants[3]); + computedConstants[22] = (constants[0] < constants[1]) && constants[2]; + computedConstants[23] = (constants[0] < constants[1]) && (constants[2]-constants[3]); + computedConstants[24] = (constants[0] < constants[1]) && -constants[2]; + computedConstants[25] = (constants[0] < constants[1]) && pow(constants[2], constants[3]); + computedConstants[26] = (constants[0] < constants[1]) && pow(constants[2], 1.0/constants[3]); + computedConstants[27] = constants[0]/(constants[1] && constants[2]); + computedConstants[28] = constants[0] || constants[1]; + computedConstants[29] = constants[0] || constants[1] || constants[2]; + computedConstants[30] = (constants[0] < constants[1]) || (constants[2] > constants[3]); + computedConstants[31] = (constants[0]+constants[1]) || (constants[2] > constants[3]); + computedConstants[32] = constants[0] || (constants[1] > constants[2]); + computedConstants[33] = (constants[0]-constants[1]) || (constants[2] > constants[3]); + computedConstants[34] = -constants[0] || (constants[1] > constants[2]); + computedConstants[35] = pow(constants[0], constants[1]) || (constants[2] > constants[3]); + computedConstants[36] = pow(constants[0], 1.0/constants[1]) || (constants[2] > constants[3]); + computedConstants[37] = (constants[0] < constants[1]) || (constants[2]+constants[3]); + computedConstants[38] = (constants[0] < constants[1]) || constants[2]; + computedConstants[39] = (constants[0] < constants[1]) || (constants[2]-constants[3]); + computedConstants[40] = (constants[0] < constants[1]) || -constants[2]; + computedConstants[41] = (constants[0] < constants[1]) || pow(constants[2], constants[3]); + computedConstants[42] = (constants[0] < constants[1]) || pow(constants[2], 1.0/constants[3]); + computedConstants[43] = constants[0]/(constants[1] || constants[2]); + computedConstants[44] = xor(constants[0], constants[1]); + computedConstants[45] = xor(constants[0], xor(constants[1], constants[2])); + computedConstants[46] = xor(constants[0] < constants[1], constants[2] > constants[3]); + computedConstants[47] = xor(constants[0]+constants[1], constants[2] > constants[3]); + computedConstants[48] = xor(constants[0], constants[1] > constants[2]); + computedConstants[49] = xor(constants[0]-constants[1], constants[2] > constants[3]); + computedConstants[50] = xor(-constants[0], constants[1] > constants[2]); + computedConstants[51] = xor(pow(constants[0], constants[1]), constants[2] > constants[3]); + computedConstants[52] = xor(pow(constants[0], 1.0/constants[1]), constants[2] > constants[3]); + computedConstants[53] = xor(constants[0] < constants[1], constants[2]+constants[3]); + computedConstants[54] = xor(constants[0] < constants[1], constants[2]); + computedConstants[55] = xor(constants[0] < constants[1], constants[2]-constants[3]); + computedConstants[56] = xor(constants[0] < constants[1], -constants[2]); + computedConstants[57] = xor(constants[0] < constants[1], pow(constants[2], constants[3])); + computedConstants[58] = xor(constants[0] < constants[1], pow(constants[2], 1.0/constants[3])); + computedConstants[59] = constants[0]/xor(constants[1], constants[2]); + computedConstants[60] = !constants[0]; + computedConstants[61] = constants[0]+constants[1]; + computedConstants[62] = constants[0]+constants[1]+constants[2]; + computedConstants[63] = (constants[0] < constants[1])+(constants[2] > constants[3]); + computedConstants[64] = constants[0]; + computedConstants[65] = constants[0]-constants[1]; + computedConstants[66] = (constants[0] < constants[1])-(constants[2] > constants[3]); + computedConstants[67] = (constants[0] < constants[1])-(constants[2]+constants[3]); + computedConstants[68] = (constants[0] < constants[1])-constants[2]; + computedConstants[69] = constants[0]-(-constants[1]); + computedConstants[70] = constants[0]-(-constants[1]*constants[2]); + computedConstants[71] = -constants[0]; + computedConstants[72] = -(constants[0] < constants[1]); + computedConstants[73] = constants[0]*constants[1]; + computedConstants[74] = constants[0]*constants[1]*constants[2]; + computedConstants[75] = (constants[0] < constants[1])*(constants[2] > constants[3]); + computedConstants[76] = (constants[0]+constants[1])*(constants[2] > constants[3]); + computedConstants[77] = constants[0]*(constants[1] > constants[2]); + computedConstants[78] = (constants[0]-constants[1])*(constants[2] > constants[3]); + computedConstants[79] = -constants[0]*(constants[1] > constants[2]); + computedConstants[80] = (constants[0] < constants[1])*(constants[2]+constants[3]); + computedConstants[81] = (constants[0] < constants[1])*constants[2]; + computedConstants[82] = (constants[0] < constants[1])*(constants[2]-constants[3]); + computedConstants[83] = (constants[0] < constants[1])*-constants[2]; + computedConstants[84] = constants[0]/constants[1]; + computedConstants[85] = (constants[0] < constants[1])/(constants[3] > constants[2]); + computedConstants[86] = (constants[0]+constants[1])/(constants[3] > constants[2]); + computedConstants[87] = constants[0]/(constants[2] > constants[1]); + computedConstants[88] = (constants[0]-constants[1])/(constants[3] > constants[2]); + computedConstants[89] = -constants[0]/(constants[2] > constants[1]); + computedConstants[90] = (constants[0] < constants[1])/(constants[2]+constants[3]); + computedConstants[91] = (constants[0] < constants[1])/constants[2]; + computedConstants[92] = (constants[0] < constants[1])/(constants[2]-constants[3]); + computedConstants[93] = (constants[0] < constants[1])/-constants[2]; + computedConstants[94] = (constants[0] < constants[1])/(constants[2]*constants[3]); + computedConstants[95] = (constants[0] < constants[1])/(constants[2]/constants[3]); + computedConstants[96] = sqrt(constants[0]); + computedConstants[97] = pow(constants[0], 2.0); + computedConstants[98] = pow(constants[0], 3.0); + computedConstants[99] = pow(constants[0], constants[1]); + computedConstants[100] = pow(constants[0] <= constants[1], constants[2] >= constants[3]); + computedConstants[101] = pow(constants[0]+constants[1], constants[2] >= constants[3]); + computedConstants[102] = pow(constants[0], constants[1] >= constants[2]); + computedConstants[103] = pow(constants[0]-constants[1], constants[2] >= constants[3]); + computedConstants[104] = pow(-constants[0], constants[1] >= constants[2]); + computedConstants[105] = pow(constants[0]*constants[1], constants[2] >= constants[3]); + computedConstants[106] = pow(constants[0]/constants[1], constants[2] >= constants[3]); + computedConstants[107] = pow(constants[0] <= constants[1], constants[2]+constants[3]); + computedConstants[108] = pow(constants[0] <= constants[1], constants[2]); + computedConstants[109] = pow(constants[0] <= constants[1], constants[2]-constants[3]); + computedConstants[110] = pow(constants[0] <= constants[1], -constants[2]); + computedConstants[111] = pow(constants[0] <= constants[1], constants[2]*constants[3]); + computedConstants[112] = pow(constants[0] <= constants[1], constants[2]/constants[3]); + computedConstants[113] = pow(constants[0] <= constants[1], pow(constants[2], constants[3])); + computedConstants[114] = pow(constants[0] <= constants[1], pow(constants[2], 1.0/constants[3])); + computedConstants[115] = sqrt(constants[0]); + computedConstants[116] = sqrt(constants[0]); + computedConstants[117] = pow(constants[0], 1.0/3.0); + computedConstants[118] = pow(constants[0], 1.0/constants[1]); + computedConstants[119] = pow(constants[0] < constants[1], 1.0/(constants[3] > constants[2])); + computedConstants[120] = pow(constants[0]+constants[1], 1.0/(constants[3] > constants[2])); + computedConstants[121] = pow(constants[0], 1.0/(constants[2] > constants[1])); + computedConstants[122] = pow(constants[0]-constants[1], 1.0/(constants[3] > constants[2])); + computedConstants[123] = pow(-constants[0], 1.0/(constants[2] > constants[1])); + computedConstants[124] = pow(constants[0]*constants[1], 1.0/(constants[3] > constants[2])); + computedConstants[125] = pow(constants[0]/constants[1], 1.0/(constants[3] > constants[2])); + computedConstants[126] = pow(constants[0] < constants[1], 1.0/(constants[2]+constants[3])); + computedConstants[127] = pow(constants[0] < constants[1], 1.0/constants[2]); + computedConstants[128] = pow(constants[0] < constants[1], 1.0/(constants[2]-constants[3])); + computedConstants[129] = pow(constants[0] < constants[1], 1.0/-constants[2]); + computedConstants[130] = pow(constants[0] < constants[1], 1.0/(constants[2]*constants[3])); + computedConstants[131] = pow(constants[0] < constants[1], 1.0/(constants[2]/constants[3])); + computedConstants[132] = pow(constants[0] < constants[1], 1.0/pow(constants[2], constants[3])); + computedConstants[133] = pow(constants[0] < constants[1], 1.0/pow(constants[2], 1.0/constants[3])); + computedConstants[134] = fabs(constants[0]); + computedConstants[135] = exp(constants[0]); + computedConstants[136] = log(constants[0]); + computedConstants[137] = log10(constants[0]); + computedConstants[138] = log(constants[0])/log(2.0); + computedConstants[139] = log10(constants[0]); + computedConstants[140] = log(constants[0])/log(constants[1]); + computedConstants[141] = ceil(constants[0]); + computedConstants[142] = floor(constants[0]); + computedConstants[143] = min(constants[0], constants[1]); + computedConstants[144] = min(constants[0], min(constants[1], constants[2])); + computedConstants[145] = max(constants[0], constants[1]); + computedConstants[146] = max(constants[0], max(constants[1], constants[2])); + computedConstants[147] = fmod(constants[0], constants[1]); + computedConstants[148] = sin(constants[0]); + computedConstants[149] = cos(constants[0]); + computedConstants[150] = tan(constants[0]); + computedConstants[151] = sec(constants[0]); + computedConstants[152] = csc(constants[0]); + computedConstants[153] = cot(constants[0]); + computedConstants[154] = sinh(constants[0]); + computedConstants[155] = cosh(constants[0]); + computedConstants[156] = tanh(constants[0]); + computedConstants[157] = sech(constants[0]); + computedConstants[158] = csch(constants[0]); + computedConstants[159] = coth(constants[0]); + computedConstants[160] = asin(constants[0]); + computedConstants[161] = acos(constants[0]); + computedConstants[162] = atan(constants[0]); + computedConstants[163] = asec(constants[0]); + computedConstants[164] = acsc(constants[0]); + computedConstants[165] = acot(constants[0]); + computedConstants[166] = asinh(constants[0]); + computedConstants[167] = acosh(constants[0]); + computedConstants[168] = atanh(constants[0]/2.0); + computedConstants[169] = asech(constants[0]); + computedConstants[170] = acsch(constants[0]); + computedConstants[171] = acoth(2.0*constants[0]); + computedConstants[172] = (constants[0] > constants[1])?constants[0]:NAN; + computedConstants[173] = (constants[0] > constants[1])?constants[0]:constants[2]; + computedConstants[174] = (constants[0] > constants[1])?constants[0]:(constants[2] > constants[3])?constants[2]:(constants[4] > constants[5])?constants[4]:NAN; + computedConstants[175] = (constants[0] > constants[1])?constants[0]:(constants[2] > constants[3])?constants[2]:(constants[4] > constants[5])?constants[4]:constants[6]; + computedConstants[176] = 123.0+((constants[0] > constants[1])?constants[0]:NAN); + computedConstants[181] = constants[0]; + computedConstants[188] = (constants[0] && constants[1])+((constants[2] > constants[3])?constants[1]:NAN)+constants[4]+(constants[5] && constants[6]); + computedConstants[189] = (constants[0] && constants[1])-(((constants[2] > constants[3])?constants[1]:NAN)-(constants[4]-((constants[2] > constants[3])?constants[1]:NAN)))-(constants[5] && constants[6]); + computedConstants[190] = (constants[0] && constants[1])*((constants[2] > constants[3])?constants[1]:NAN)*constants[4]*((constants[2] > constants[3])?constants[1]:NAN)*(constants[5] && constants[6]); + computedConstants[191] = (constants[0] && constants[1])/(((constants[2] > constants[3])?constants[1]:NAN)/(constants[4]/((constants[2] > constants[3])?constants[1]:NAN))); + computedConstants[192] = (constants[0] || constants[1]) && xor(constants[0], constants[1]) && ((constants[2] > constants[3])?constants[1]:NAN) && constants[4] && ((constants[2] > constants[3])?constants[1]:NAN) && xor(constants[0], constants[1]) && (constants[0] || constants[1]); + computedConstants[193] = (constants[0] && constants[1]) || xor(constants[0], constants[1]) || ((constants[2] > constants[3])?constants[1]:NAN) || constants[4] || ((constants[2] > constants[3])?constants[1]:NAN) || xor(constants[0], constants[1]) || (constants[0] && constants[1]); + computedConstants[194] = xor(constants[0] && constants[1], xor(constants[0] || constants[1], xor((constants[2] > constants[3])?constants[1]:NAN, xor(xor(xor(constants[4], (constants[2] > constants[3])?constants[1]:NAN), constants[0] || constants[1]), constants[0] && constants[1])))); + computedConstants[195] = pow(constants[0] && constants[1], pow((constants[2] > constants[3])?constants[1]:NAN, pow(pow(constants[4], (constants[2] > constants[3])?constants[1]:NAN), constants[0] && constants[1]))); + computedConstants[196] = pow(pow(pow(constants[0] && constants[1], 1.0/pow((constants[2] > constants[3])?constants[1]:NAN, 1.0/constants[4])), 1.0/((constants[2] > constants[3])?constants[1]:NAN)), 1.0/(constants[0] && constants[1])); + computedConstants[197] = -(constants[0] && constants[1])+-((constants[2] > constants[3])?constants[1]:NAN); } void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic) diff --git a/tests/resources/coverage/generator/model.implementation.out b/tests/resources/coverage/generator/model.implementation.out index 9656a17964..03233d9176 100644 --- a/tests/resources/coverage/generator/model.implementation.out +++ b/tests/resources/coverage/generator/model.implementation.out @@ -125,11 +125,11 @@ void objectiveFunction0(double *u, double *f, void *data) double *rates = ((RootFindingInfo *) data)->rates; double *variables = ((RootFindingInfo *) data)->variables; - algebraic[205] = u[0]; - algebraic[206] = u[1]; + algebraic[0] = u[0]; + algebraic[1] = u[1]; - f[0] = algebraic[205]+algebraic[206]+states[0]-0.0; - f[1] = algebraic[205]-algebraic[206]-(computedConstants[207]+computedConstants[208]); + f[0] = algebraic[0]+algebraic[1]+states[0]-0.0; + f[1] = algebraic[0]-algebraic[1]-(computedConstants[198]+computedConstants[199]); } void findRoot0(double voi, double *states, double *rates, double *variables) @@ -137,231 +137,231 @@ void findRoot0(double voi, double *states, double *rates, double *variables) RootFindingInfo rfi = { voi, states, rates, variables }; double u[2]; - u[0] = algebraic[205]; - u[1] = algebraic[206]; + u[0] = algebraic[0]; + u[1] = algebraic[1]; nlaSolve(objectiveFunction0, u, 2, &rfi); - algebraic[205] = u[0]; - algebraic[206] = u[1]; + algebraic[0] = u[0]; + algebraic[1] = u[1]; } void initialiseVariables(double *states, double *rates, double *constants) { - constants[1] = 1.0; - constants[2] = 2.0; - constants[6] = 3.0; - constants[18] = 4.0; - constants[179] = 5.0; - constants[180] = 6.0; - constants[182] = 7.0; - algebraic[205] = 1.0; - algebraic[206] = 2.0; - computedConstants[184] = 123.0; - computedConstants[185] = 123.456789; - computedConstants[186] = 123.0e99; - computedConstants[187] = 123.456789e99; - computedConstants[189] = 1.0; - computedConstants[190] = 0.0; - computedConstants[191] = 2.71828182845905; - computedConstants[192] = 3.14159265358979; - computedConstants[193] = INFINITY; - computedConstants[194] = NAN; - computedConstants[207] = 1.0; - computedConstants[208] = 3.0; + constants[0] = 1.0; + constants[1] = 2.0; + constants[2] = 3.0; + constants[3] = 4.0; + constants[4] = 5.0; + constants[5] = 6.0; + constants[6] = 7.0; + algebraic[0] = 1.0; + algebraic[1] = 2.0; + computedConstants[177] = 123.0; + computedConstants[178] = 123.456789; + computedConstants[179] = 123.0e99; + computedConstants[180] = 123.456789e99; + computedConstants[182] = 1.0; + computedConstants[183] = 0.0; + computedConstants[184] = 2.71828182845905; + computedConstants[185] = 3.14159265358979; + computedConstants[186] = INFINITY; + computedConstants[187] = NAN; + computedConstants[198] = 1.0; + computedConstants[199] = 3.0; states[0] = 0.0; } void computeComputedConstants(double *constants, double *computedConstants) { - computedConstants[0] = eq(constants[1], constants[2]); - computedConstants[3] = constants[1]/eq(constants[2], constants[2]); - computedConstants[4] = neq(constants[1], constants[2]); - computedConstants[5] = constants[1]/neq(constants[2], constants[6]); - computedConstants[7] = lt(constants[1], constants[2]); - computedConstants[8] = constants[1]/lt(constants[2], constants[6]); - computedConstants[9] = leq(constants[1], constants[2]); - computedConstants[10] = constants[1]/leq(constants[2], constants[6]); - computedConstants[11] = gt(constants[1], constants[2]); - computedConstants[12] = constants[1]/gt(constants[2], constants[6]); - computedConstants[13] = geq(constants[1], constants[2]); - computedConstants[14] = constants[1]/geq(constants[2], constants[6]); - computedConstants[15] = and(constants[1], constants[2]); - computedConstants[16] = and(constants[1], and(constants[2], constants[6])); - computedConstants[17] = and(lt(constants[1], constants[2]), gt(constants[6], constants[18])); - computedConstants[19] = and(constants[1]+constants[2], gt(constants[6], constants[18])); - computedConstants[20] = and(constants[1], gt(constants[2], constants[6])); - computedConstants[21] = and(constants[1]-constants[2], gt(constants[6], constants[18])); - computedConstants[22] = and(-constants[1], gt(constants[2], constants[6])); - computedConstants[23] = and(pow(constants[1], constants[2]), gt(constants[6], constants[18])); - computedConstants[24] = and(pow(constants[1], 1.0/constants[2]), gt(constants[6], constants[18])); - computedConstants[25] = and(lt(constants[1], constants[2]), constants[6]+constants[18]); - computedConstants[26] = and(lt(constants[1], constants[2]), constants[6]); - computedConstants[27] = and(lt(constants[1], constants[2]), constants[6]-constants[18]); - computedConstants[28] = and(lt(constants[1], constants[2]), -constants[6]); - computedConstants[29] = and(lt(constants[1], constants[2]), pow(constants[6], constants[18])); - computedConstants[30] = and(lt(constants[1], constants[2]), pow(constants[6], 1.0/constants[18])); - computedConstants[31] = constants[1]/and(constants[2], constants[6]); - computedConstants[32] = or(constants[1], constants[2]); - computedConstants[33] = or(constants[1], or(constants[2], constants[6])); - computedConstants[34] = or(lt(constants[1], constants[2]), gt(constants[6], constants[18])); - computedConstants[35] = or(constants[1]+constants[2], gt(constants[6], constants[18])); - computedConstants[36] = or(constants[1], gt(constants[2], constants[6])); - computedConstants[37] = or(constants[1]-constants[2], gt(constants[6], constants[18])); - computedConstants[38] = or(-constants[1], gt(constants[2], constants[6])); - computedConstants[39] = or(pow(constants[1], constants[2]), gt(constants[6], constants[18])); - computedConstants[40] = or(pow(constants[1], 1.0/constants[2]), gt(constants[6], constants[18])); - computedConstants[41] = or(lt(constants[1], constants[2]), constants[6]+constants[18]); - computedConstants[42] = or(lt(constants[1], constants[2]), constants[6]); - computedConstants[43] = or(lt(constants[1], constants[2]), constants[6]-constants[18]); - computedConstants[44] = or(lt(constants[1], constants[2]), -constants[6]); - computedConstants[45] = or(lt(constants[1], constants[2]), pow(constants[6], constants[18])); - computedConstants[46] = or(lt(constants[1], constants[2]), pow(constants[6], 1.0/constants[18])); - computedConstants[47] = constants[1]/or(constants[2], constants[6]); - computedConstants[48] = xor(constants[1], constants[2]); - computedConstants[49] = xor(constants[1], xor(constants[2], constants[6])); - computedConstants[50] = xor(lt(constants[1], constants[2]), gt(constants[6], constants[18])); - computedConstants[51] = xor(constants[1]+constants[2], gt(constants[6], constants[18])); - computedConstants[52] = xor(constants[1], gt(constants[2], constants[6])); - computedConstants[53] = xor(constants[1]-constants[2], gt(constants[6], constants[18])); - computedConstants[54] = xor(-constants[1], gt(constants[2], constants[6])); - computedConstants[55] = xor(pow(constants[1], constants[2]), gt(constants[6], constants[18])); - computedConstants[56] = xor(pow(constants[1], 1.0/constants[2]), gt(constants[6], constants[18])); - computedConstants[57] = xor(lt(constants[1], constants[2]), constants[6]+constants[18]); - computedConstants[58] = xor(lt(constants[1], constants[2]), constants[6]); - computedConstants[59] = xor(lt(constants[1], constants[2]), constants[6]-constants[18]); - computedConstants[60] = xor(lt(constants[1], constants[2]), -constants[6]); - computedConstants[61] = xor(lt(constants[1], constants[2]), pow(constants[6], constants[18])); - computedConstants[62] = xor(lt(constants[1], constants[2]), pow(constants[6], 1.0/constants[18])); - computedConstants[63] = constants[1]/xor(constants[2], constants[6]); - computedConstants[64] = not(constants[1]); - computedConstants[65] = constants[1]+constants[2]; - computedConstants[66] = constants[1]+constants[2]+constants[6]; - computedConstants[67] = lt(constants[1], constants[2])+gt(constants[6], constants[18]); - computedConstants[68] = constants[1]; - computedConstants[69] = constants[1]-constants[2]; - computedConstants[70] = lt(constants[1], constants[2])-gt(constants[6], constants[18]); - computedConstants[71] = lt(constants[1], constants[2])-(constants[6]+constants[18]); - computedConstants[72] = lt(constants[1], constants[2])-constants[6]; - computedConstants[73] = constants[1]-(-constants[2]); - computedConstants[74] = constants[1]-(-constants[2]*constants[6]); - computedConstants[75] = -constants[1]; - computedConstants[76] = -lt(constants[1], constants[2]); - computedConstants[77] = constants[1]*constants[2]; - computedConstants[78] = constants[1]*constants[2]*constants[6]; - computedConstants[79] = lt(constants[1], constants[2])*gt(constants[6], constants[18]); - computedConstants[80] = (constants[1]+constants[2])*gt(constants[6], constants[18]); - computedConstants[81] = constants[1]*gt(constants[2], constants[6]); - computedConstants[82] = (constants[1]-constants[2])*gt(constants[6], constants[18]); - computedConstants[83] = -constants[1]*gt(constants[2], constants[6]); - computedConstants[84] = lt(constants[1], constants[2])*(constants[6]+constants[18]); - computedConstants[85] = lt(constants[1], constants[2])*constants[6]; - computedConstants[86] = lt(constants[1], constants[2])*(constants[6]-constants[18]); - computedConstants[87] = lt(constants[1], constants[2])*-constants[6]; - computedConstants[88] = constants[1]/constants[2]; - computedConstants[89] = lt(constants[1], constants[2])/gt(constants[18], constants[6]); - computedConstants[90] = (constants[1]+constants[2])/gt(constants[18], constants[6]); - computedConstants[91] = constants[1]/gt(constants[6], constants[2]); - computedConstants[92] = (constants[1]-constants[2])/gt(constants[18], constants[6]); - computedConstants[93] = -constants[1]/gt(constants[6], constants[2]); - computedConstants[94] = lt(constants[1], constants[2])/(constants[6]+constants[18]); - computedConstants[95] = lt(constants[1], constants[2])/constants[6]; - computedConstants[96] = lt(constants[1], constants[2])/(constants[6]-constants[18]); - computedConstants[97] = lt(constants[1], constants[2])/-constants[6]; - computedConstants[98] = lt(constants[1], constants[2])/(constants[6]*constants[18]); - computedConstants[99] = lt(constants[1], constants[2])/(constants[6]/constants[18]); - computedConstants[100] = sqrt(constants[1]); - computedConstants[101] = pow(constants[1], 2.0); - computedConstants[102] = pow(constants[1], 3.0); - computedConstants[103] = pow(constants[1], constants[2]); - computedConstants[104] = pow(leq(constants[1], constants[2]), geq(constants[6], constants[18])); - computedConstants[105] = pow(constants[1]+constants[2], geq(constants[6], constants[18])); - computedConstants[106] = pow(constants[1], geq(constants[2], constants[6])); - computedConstants[107] = pow(constants[1]-constants[2], geq(constants[6], constants[18])); - computedConstants[108] = pow(-constants[1], geq(constants[2], constants[6])); - computedConstants[109] = pow(constants[1]*constants[2], geq(constants[6], constants[18])); - computedConstants[110] = pow(constants[1]/constants[2], geq(constants[6], constants[18])); - computedConstants[111] = pow(leq(constants[1], constants[2]), constants[6]+constants[18]); - computedConstants[112] = pow(leq(constants[1], constants[2]), constants[6]); - computedConstants[113] = pow(leq(constants[1], constants[2]), constants[6]-constants[18]); - computedConstants[114] = pow(leq(constants[1], constants[2]), -constants[6]); - computedConstants[115] = pow(leq(constants[1], constants[2]), constants[6]*constants[18]); - computedConstants[116] = pow(leq(constants[1], constants[2]), constants[6]/constants[18]); - computedConstants[117] = pow(leq(constants[1], constants[2]), pow(constants[6], constants[18])); - computedConstants[118] = pow(leq(constants[1], constants[2]), pow(constants[6], 1.0/constants[18])); - computedConstants[119] = sqrt(constants[1]); - computedConstants[120] = sqrt(constants[1]); - computedConstants[121] = pow(constants[1], 1.0/3.0); - computedConstants[122] = pow(constants[1], 1.0/constants[2]); - computedConstants[123] = pow(lt(constants[1], constants[2]), 1.0/gt(constants[18], constants[6])); - computedConstants[124] = pow(constants[1]+constants[2], 1.0/gt(constants[18], constants[6])); - computedConstants[125] = pow(constants[1], 1.0/gt(constants[6], constants[2])); - computedConstants[126] = pow(constants[1]-constants[2], 1.0/gt(constants[18], constants[6])); - computedConstants[127] = pow(-constants[1], 1.0/gt(constants[6], constants[2])); - computedConstants[128] = pow(constants[1]*constants[2], 1.0/gt(constants[18], constants[6])); - computedConstants[129] = pow(constants[1]/constants[2], 1.0/gt(constants[18], constants[6])); - computedConstants[130] = pow(lt(constants[1], constants[2]), 1.0/(constants[6]+constants[18])); - computedConstants[131] = pow(lt(constants[1], constants[2]), 1.0/constants[6]); - computedConstants[132] = pow(lt(constants[1], constants[2]), 1.0/(constants[6]-constants[18])); - computedConstants[133] = pow(lt(constants[1], constants[2]), 1.0/-constants[6]); - computedConstants[134] = pow(lt(constants[1], constants[2]), 1.0/(constants[6]*constants[18])); - computedConstants[135] = pow(lt(constants[1], constants[2]), 1.0/(constants[6]/constants[18])); - computedConstants[136] = pow(lt(constants[1], constants[2]), 1.0/pow(constants[6], constants[18])); - computedConstants[137] = pow(lt(constants[1], constants[2]), 1.0/pow(constants[6], 1.0/constants[18])); - computedConstants[138] = fabs(constants[1]); - computedConstants[139] = exp(constants[1]); - computedConstants[140] = log(constants[1]); - computedConstants[141] = log10(constants[1]); - computedConstants[142] = log(constants[1])/log(2.0); - computedConstants[143] = log10(constants[1]); - computedConstants[144] = log(constants[1])/log(constants[2]); - computedConstants[145] = ceil(constants[1]); - computedConstants[146] = floor(constants[1]); - computedConstants[147] = min(constants[1], constants[2]); - computedConstants[148] = min(constants[1], min(constants[2], constants[6])); - computedConstants[149] = max(constants[1], constants[2]); - computedConstants[150] = max(constants[1], max(constants[2], constants[6])); - computedConstants[151] = fmod(constants[1], constants[2]); - computedConstants[152] = sin(constants[1]); - computedConstants[153] = cos(constants[1]); - computedConstants[154] = tan(constants[1]); - computedConstants[155] = sec(constants[1]); - computedConstants[156] = csc(constants[1]); - computedConstants[157] = cot(constants[1]); - computedConstants[158] = sinh(constants[1]); - computedConstants[159] = cosh(constants[1]); - computedConstants[160] = tanh(constants[1]); - computedConstants[161] = sech(constants[1]); - computedConstants[162] = csch(constants[1]); - computedConstants[163] = coth(constants[1]); - computedConstants[164] = asin(constants[1]); - computedConstants[165] = acos(constants[1]); - computedConstants[166] = atan(constants[1]); - computedConstants[167] = asec(constants[1]); - computedConstants[168] = acsc(constants[1]); - computedConstants[169] = acot(constants[1]); - computedConstants[170] = asinh(constants[1]); - computedConstants[171] = acosh(constants[1]); - computedConstants[172] = atanh(constants[1]/2.0); - computedConstants[173] = asech(constants[1]); - computedConstants[174] = acsch(constants[1]); - computedConstants[175] = acoth(2.0*constants[1]); - computedConstants[176] = (gt(constants[1], constants[2]))?constants[1]:NAN; - computedConstants[177] = (gt(constants[1], constants[2]))?constants[1]:constants[6]; - computedConstants[178] = (gt(constants[1], constants[2]))?constants[1]:(gt(constants[6], constants[18]))?constants[6]:(gt(constants[179], constants[180]))?constants[179]:NAN; - computedConstants[181] = (gt(constants[1], constants[2]))?constants[1]:(gt(constants[6], constants[18]))?constants[6]:(gt(constants[179], constants[180]))?constants[179]:constants[182]; - computedConstants[183] = 123.0+((gt(constants[1], constants[2]))?constants[1]:NAN); - computedConstants[188] = constants[1]; - computedConstants[195] = and(constants[1], constants[2])+((gt(constants[6], constants[18]))?constants[2]:NAN)+constants[179]+and(constants[180], constants[182]); - computedConstants[196] = and(constants[1], constants[2])-(((gt(constants[6], constants[18]))?constants[2]:NAN)-(constants[179]-((gt(constants[6], constants[18]))?constants[2]:NAN)))-and(constants[180], constants[182]); - computedConstants[197] = and(constants[1], constants[2])*((gt(constants[6], constants[18]))?constants[2]:NAN)*constants[179]*((gt(constants[6], constants[18]))?constants[2]:NAN)*and(constants[180], constants[182]); - computedConstants[198] = and(constants[1], constants[2])/(((gt(constants[6], constants[18]))?constants[2]:NAN)/(constants[179]/((gt(constants[6], constants[18]))?constants[2]:NAN))); - computedConstants[199] = and(or(constants[1], constants[2]), and(xor(constants[1], constants[2]), and((gt(constants[6], constants[18]))?constants[2]:NAN, and(and(and(constants[179], (gt(constants[6], constants[18]))?constants[2]:NAN), xor(constants[1], constants[2])), or(constants[1], constants[2]))))); - computedConstants[200] = or(and(constants[1], constants[2]), or(xor(constants[1], constants[2]), or((gt(constants[6], constants[18]))?constants[2]:NAN, or(or(or(constants[179], (gt(constants[6], constants[18]))?constants[2]:NAN), xor(constants[1], constants[2])), and(constants[1], constants[2]))))); - computedConstants[201] = xor(and(constants[1], constants[2]), xor(or(constants[1], constants[2]), xor((gt(constants[6], constants[18]))?constants[2]:NAN, xor(xor(xor(constants[179], (gt(constants[6], constants[18]))?constants[2]:NAN), or(constants[1], constants[2])), and(constants[1], constants[2]))))); - computedConstants[202] = pow(and(constants[1], constants[2]), pow((gt(constants[6], constants[18]))?constants[2]:NAN, pow(pow(constants[179], (gt(constants[6], constants[18]))?constants[2]:NAN), and(constants[1], constants[2])))); - computedConstants[203] = pow(pow(pow(and(constants[1], constants[2]), 1.0/pow((gt(constants[6], constants[18]))?constants[2]:NAN, 1.0/constants[179])), 1.0/((gt(constants[6], constants[18]))?constants[2]:NAN)), 1.0/and(constants[1], constants[2])); - computedConstants[204] = -and(constants[1], constants[2])+-((gt(constants[6], constants[18]))?constants[2]:NAN); + computedConstants[0] = eq(constants[0], constants[1]); + computedConstants[1] = constants[0]/eq(constants[1], constants[1]); + computedConstants[2] = neq(constants[0], constants[1]); + computedConstants[3] = constants[0]/neq(constants[1], constants[2]); + computedConstants[4] = lt(constants[0], constants[1]); + computedConstants[5] = constants[0]/lt(constants[1], constants[2]); + computedConstants[6] = leq(constants[0], constants[1]); + computedConstants[7] = constants[0]/leq(constants[1], constants[2]); + computedConstants[8] = gt(constants[0], constants[1]); + computedConstants[9] = constants[0]/gt(constants[1], constants[2]); + computedConstants[10] = geq(constants[0], constants[1]); + computedConstants[11] = constants[0]/geq(constants[1], constants[2]); + computedConstants[12] = and(constants[0], constants[1]); + computedConstants[13] = and(constants[0], and(constants[1], constants[2])); + computedConstants[14] = and(lt(constants[0], constants[1]), gt(constants[2], constants[3])); + computedConstants[15] = and(constants[0]+constants[1], gt(constants[2], constants[3])); + computedConstants[16] = and(constants[0], gt(constants[1], constants[2])); + computedConstants[17] = and(constants[0]-constants[1], gt(constants[2], constants[3])); + computedConstants[18] = and(-constants[0], gt(constants[1], constants[2])); + computedConstants[19] = and(pow(constants[0], constants[1]), gt(constants[2], constants[3])); + computedConstants[20] = and(pow(constants[0], 1.0/constants[1]), gt(constants[2], constants[3])); + computedConstants[21] = and(lt(constants[0], constants[1]), constants[2]+constants[3]); + computedConstants[22] = and(lt(constants[0], constants[1]), constants[2]); + computedConstants[23] = and(lt(constants[0], constants[1]), constants[2]-constants[3]); + computedConstants[24] = and(lt(constants[0], constants[1]), -constants[2]); + computedConstants[25] = and(lt(constants[0], constants[1]), pow(constants[2], constants[3])); + computedConstants[26] = and(lt(constants[0], constants[1]), pow(constants[2], 1.0/constants[3])); + computedConstants[27] = constants[0]/and(constants[1], constants[2]); + computedConstants[28] = or(constants[0], constants[1]); + computedConstants[29] = or(constants[0], or(constants[1], constants[2])); + computedConstants[30] = or(lt(constants[0], constants[1]), gt(constants[2], constants[3])); + computedConstants[31] = or(constants[0]+constants[1], gt(constants[2], constants[3])); + computedConstants[32] = or(constants[0], gt(constants[1], constants[2])); + computedConstants[33] = or(constants[0]-constants[1], gt(constants[2], constants[3])); + computedConstants[34] = or(-constants[0], gt(constants[1], constants[2])); + computedConstants[35] = or(pow(constants[0], constants[1]), gt(constants[2], constants[3])); + computedConstants[36] = or(pow(constants[0], 1.0/constants[1]), gt(constants[2], constants[3])); + computedConstants[37] = or(lt(constants[0], constants[1]), constants[2]+constants[3]); + computedConstants[38] = or(lt(constants[0], constants[1]), constants[2]); + computedConstants[39] = or(lt(constants[0], constants[1]), constants[2]-constants[3]); + computedConstants[40] = or(lt(constants[0], constants[1]), -constants[2]); + computedConstants[41] = or(lt(constants[0], constants[1]), pow(constants[2], constants[3])); + computedConstants[42] = or(lt(constants[0], constants[1]), pow(constants[2], 1.0/constants[3])); + computedConstants[43] = constants[0]/or(constants[1], constants[2]); + computedConstants[44] = xor(constants[0], constants[1]); + computedConstants[45] = xor(constants[0], xor(constants[1], constants[2])); + computedConstants[46] = xor(lt(constants[0], constants[1]), gt(constants[2], constants[3])); + computedConstants[47] = xor(constants[0]+constants[1], gt(constants[2], constants[3])); + computedConstants[48] = xor(constants[0], gt(constants[1], constants[2])); + computedConstants[49] = xor(constants[0]-constants[1], gt(constants[2], constants[3])); + computedConstants[50] = xor(-constants[0], gt(constants[1], constants[2])); + computedConstants[51] = xor(pow(constants[0], constants[1]), gt(constants[2], constants[3])); + computedConstants[52] = xor(pow(constants[0], 1.0/constants[1]), gt(constants[2], constants[3])); + computedConstants[53] = xor(lt(constants[0], constants[1]), constants[2]+constants[3]); + computedConstants[54] = xor(lt(constants[0], constants[1]), constants[2]); + computedConstants[55] = xor(lt(constants[0], constants[1]), constants[2]-constants[3]); + computedConstants[56] = xor(lt(constants[0], constants[1]), -constants[2]); + computedConstants[57] = xor(lt(constants[0], constants[1]), pow(constants[2], constants[3])); + computedConstants[58] = xor(lt(constants[0], constants[1]), pow(constants[2], 1.0/constants[3])); + computedConstants[59] = constants[0]/xor(constants[1], constants[2]); + computedConstants[60] = not(constants[0]); + computedConstants[61] = constants[0]+constants[1]; + computedConstants[62] = constants[0]+constants[1]+constants[2]; + computedConstants[63] = lt(constants[0], constants[1])+gt(constants[2], constants[3]); + computedConstants[64] = constants[0]; + computedConstants[65] = constants[0]-constants[1]; + computedConstants[66] = lt(constants[0], constants[1])-gt(constants[2], constants[3]); + computedConstants[67] = lt(constants[0], constants[1])-(constants[2]+constants[3]); + computedConstants[68] = lt(constants[0], constants[1])-constants[2]; + computedConstants[69] = constants[0]-(-constants[1]); + computedConstants[70] = constants[0]-(-constants[1]*constants[2]); + computedConstants[71] = -constants[0]; + computedConstants[72] = -lt(constants[0], constants[1]); + computedConstants[73] = constants[0]*constants[1]; + computedConstants[74] = constants[0]*constants[1]*constants[2]; + computedConstants[75] = lt(constants[0], constants[1])*gt(constants[2], constants[3]); + computedConstants[76] = (constants[0]+constants[1])*gt(constants[2], constants[3]); + computedConstants[77] = constants[0]*gt(constants[1], constants[2]); + computedConstants[78] = (constants[0]-constants[1])*gt(constants[2], constants[3]); + computedConstants[79] = -constants[0]*gt(constants[1], constants[2]); + computedConstants[80] = lt(constants[0], constants[1])*(constants[2]+constants[3]); + computedConstants[81] = lt(constants[0], constants[1])*constants[2]; + computedConstants[82] = lt(constants[0], constants[1])*(constants[2]-constants[3]); + computedConstants[83] = lt(constants[0], constants[1])*-constants[2]; + computedConstants[84] = constants[0]/constants[1]; + computedConstants[85] = lt(constants[0], constants[1])/gt(constants[3], constants[2]); + computedConstants[86] = (constants[0]+constants[1])/gt(constants[3], constants[2]); + computedConstants[87] = constants[0]/gt(constants[2], constants[1]); + computedConstants[88] = (constants[0]-constants[1])/gt(constants[3], constants[2]); + computedConstants[89] = -constants[0]/gt(constants[2], constants[1]); + computedConstants[90] = lt(constants[0], constants[1])/(constants[2]+constants[3]); + computedConstants[91] = lt(constants[0], constants[1])/constants[2]; + computedConstants[92] = lt(constants[0], constants[1])/(constants[2]-constants[3]); + computedConstants[93] = lt(constants[0], constants[1])/-constants[2]; + computedConstants[94] = lt(constants[0], constants[1])/(constants[2]*constants[3]); + computedConstants[95] = lt(constants[0], constants[1])/(constants[2]/constants[3]); + computedConstants[96] = sqrt(constants[0]); + computedConstants[97] = pow(constants[0], 2.0); + computedConstants[98] = pow(constants[0], 3.0); + computedConstants[99] = pow(constants[0], constants[1]); + computedConstants[100] = pow(leq(constants[0], constants[1]), geq(constants[2], constants[3])); + computedConstants[101] = pow(constants[0]+constants[1], geq(constants[2], constants[3])); + computedConstants[102] = pow(constants[0], geq(constants[1], constants[2])); + computedConstants[103] = pow(constants[0]-constants[1], geq(constants[2], constants[3])); + computedConstants[104] = pow(-constants[0], geq(constants[1], constants[2])); + computedConstants[105] = pow(constants[0]*constants[1], geq(constants[2], constants[3])); + computedConstants[106] = pow(constants[0]/constants[1], geq(constants[2], constants[3])); + computedConstants[107] = pow(leq(constants[0], constants[1]), constants[2]+constants[3]); + computedConstants[108] = pow(leq(constants[0], constants[1]), constants[2]); + computedConstants[109] = pow(leq(constants[0], constants[1]), constants[2]-constants[3]); + computedConstants[110] = pow(leq(constants[0], constants[1]), -constants[2]); + computedConstants[111] = pow(leq(constants[0], constants[1]), constants[2]*constants[3]); + computedConstants[112] = pow(leq(constants[0], constants[1]), constants[2]/constants[3]); + computedConstants[113] = pow(leq(constants[0], constants[1]), pow(constants[2], constants[3])); + computedConstants[114] = pow(leq(constants[0], constants[1]), pow(constants[2], 1.0/constants[3])); + computedConstants[115] = sqrt(constants[0]); + computedConstants[116] = sqrt(constants[0]); + computedConstants[117] = pow(constants[0], 1.0/3.0); + computedConstants[118] = pow(constants[0], 1.0/constants[1]); + computedConstants[119] = pow(lt(constants[0], constants[1]), 1.0/gt(constants[3], constants[2])); + computedConstants[120] = pow(constants[0]+constants[1], 1.0/gt(constants[3], constants[2])); + computedConstants[121] = pow(constants[0], 1.0/gt(constants[2], constants[1])); + computedConstants[122] = pow(constants[0]-constants[1], 1.0/gt(constants[3], constants[2])); + computedConstants[123] = pow(-constants[0], 1.0/gt(constants[2], constants[1])); + computedConstants[124] = pow(constants[0]*constants[1], 1.0/gt(constants[3], constants[2])); + computedConstants[125] = pow(constants[0]/constants[1], 1.0/gt(constants[3], constants[2])); + computedConstants[126] = pow(lt(constants[0], constants[1]), 1.0/(constants[2]+constants[3])); + computedConstants[127] = pow(lt(constants[0], constants[1]), 1.0/constants[2]); + computedConstants[128] = pow(lt(constants[0], constants[1]), 1.0/(constants[2]-constants[3])); + computedConstants[129] = pow(lt(constants[0], constants[1]), 1.0/-constants[2]); + computedConstants[130] = pow(lt(constants[0], constants[1]), 1.0/(constants[2]*constants[3])); + computedConstants[131] = pow(lt(constants[0], constants[1]), 1.0/(constants[2]/constants[3])); + computedConstants[132] = pow(lt(constants[0], constants[1]), 1.0/pow(constants[2], constants[3])); + computedConstants[133] = pow(lt(constants[0], constants[1]), 1.0/pow(constants[2], 1.0/constants[3])); + computedConstants[134] = fabs(constants[0]); + computedConstants[135] = exp(constants[0]); + computedConstants[136] = log(constants[0]); + computedConstants[137] = log10(constants[0]); + computedConstants[138] = log(constants[0])/log(2.0); + computedConstants[139] = log10(constants[0]); + computedConstants[140] = log(constants[0])/log(constants[1]); + computedConstants[141] = ceil(constants[0]); + computedConstants[142] = floor(constants[0]); + computedConstants[143] = min(constants[0], constants[1]); + computedConstants[144] = min(constants[0], min(constants[1], constants[2])); + computedConstants[145] = max(constants[0], constants[1]); + computedConstants[146] = max(constants[0], max(constants[1], constants[2])); + computedConstants[147] = fmod(constants[0], constants[1]); + computedConstants[148] = sin(constants[0]); + computedConstants[149] = cos(constants[0]); + computedConstants[150] = tan(constants[0]); + computedConstants[151] = sec(constants[0]); + computedConstants[152] = csc(constants[0]); + computedConstants[153] = cot(constants[0]); + computedConstants[154] = sinh(constants[0]); + computedConstants[155] = cosh(constants[0]); + computedConstants[156] = tanh(constants[0]); + computedConstants[157] = sech(constants[0]); + computedConstants[158] = csch(constants[0]); + computedConstants[159] = coth(constants[0]); + computedConstants[160] = asin(constants[0]); + computedConstants[161] = acos(constants[0]); + computedConstants[162] = atan(constants[0]); + computedConstants[163] = asec(constants[0]); + computedConstants[164] = acsc(constants[0]); + computedConstants[165] = acot(constants[0]); + computedConstants[166] = asinh(constants[0]); + computedConstants[167] = acosh(constants[0]); + computedConstants[168] = atanh(constants[0]/2.0); + computedConstants[169] = asech(constants[0]); + computedConstants[170] = acsch(constants[0]); + computedConstants[171] = acoth(2.0*constants[0]); + computedConstants[172] = (gt(constants[0], constants[1]))?constants[0]:NAN; + computedConstants[173] = (gt(constants[0], constants[1]))?constants[0]:constants[2]; + computedConstants[174] = (gt(constants[0], constants[1]))?constants[0]:(gt(constants[2], constants[3]))?constants[2]:(gt(constants[4], constants[5]))?constants[4]:NAN; + computedConstants[175] = (gt(constants[0], constants[1]))?constants[0]:(gt(constants[2], constants[3]))?constants[2]:(gt(constants[4], constants[5]))?constants[4]:constants[6]; + computedConstants[176] = 123.0+((gt(constants[0], constants[1]))?constants[0]:NAN); + computedConstants[181] = constants[0]; + computedConstants[188] = and(constants[0], constants[1])+((gt(constants[2], constants[3]))?constants[1]:NAN)+constants[4]+and(constants[5], constants[6]); + computedConstants[189] = and(constants[0], constants[1])-(((gt(constants[2], constants[3]))?constants[1]:NAN)-(constants[4]-((gt(constants[2], constants[3]))?constants[1]:NAN)))-and(constants[5], constants[6]); + computedConstants[190] = and(constants[0], constants[1])*((gt(constants[2], constants[3]))?constants[1]:NAN)*constants[4]*((gt(constants[2], constants[3]))?constants[1]:NAN)*and(constants[5], constants[6]); + computedConstants[191] = and(constants[0], constants[1])/(((gt(constants[2], constants[3]))?constants[1]:NAN)/(constants[4]/((gt(constants[2], constants[3]))?constants[1]:NAN))); + computedConstants[192] = and(or(constants[0], constants[1]), and(xor(constants[0], constants[1]), and((gt(constants[2], constants[3]))?constants[1]:NAN, and(and(and(constants[4], (gt(constants[2], constants[3]))?constants[1]:NAN), xor(constants[0], constants[1])), or(constants[0], constants[1]))))); + computedConstants[193] = or(and(constants[0], constants[1]), or(xor(constants[0], constants[1]), or((gt(constants[2], constants[3]))?constants[1]:NAN, or(or(or(constants[4], (gt(constants[2], constants[3]))?constants[1]:NAN), xor(constants[0], constants[1])), and(constants[0], constants[1]))))); + computedConstants[194] = xor(and(constants[0], constants[1]), xor(or(constants[0], constants[1]), xor((gt(constants[2], constants[3]))?constants[1]:NAN, xor(xor(xor(constants[4], (gt(constants[2], constants[3]))?constants[1]:NAN), or(constants[0], constants[1])), and(constants[0], constants[1]))))); + computedConstants[195] = pow(and(constants[0], constants[1]), pow((gt(constants[2], constants[3]))?constants[1]:NAN, pow(pow(constants[4], (gt(constants[2], constants[3]))?constants[1]:NAN), and(constants[0], constants[1])))); + computedConstants[196] = pow(pow(pow(and(constants[0], constants[1]), 1.0/pow((gt(constants[2], constants[3]))?constants[1]:NAN, 1.0/constants[4])), 1.0/((gt(constants[2], constants[3]))?constants[1]:NAN)), 1.0/and(constants[0], constants[1])); + computedConstants[197] = -and(constants[0], constants[1])+-((gt(constants[2], constants[3]))?constants[1]:NAN); } void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic) diff --git a/tests/resources/coverage/generator/model.modified.profile.c b/tests/resources/coverage/generator/model.modified.profile.c index b5bd907469..986e598213 100644 --- a/tests/resources/coverage/generator/model.modified.profile.c +++ b/tests/resources/coverage/generator/model.modified.profile.c @@ -356,11 +356,11 @@ void objectiveFunction0(double *u, double *f, void *data) double *rates = ((RootFindingInfo *) data)->rates; double *variables = ((RootFindingInfo *) data)->variables; - algebraic[205] = u[0]; - algebraic[206] = u[1]; + algebraic[0] = u[0]; + algebraic[1] = u[1]; - f[0] = algebraic[205]+algebraic[206]+states[0]-0.0; - f[1] = algebraic[205]-algebraic[206]-(computedConstants[207]+computedConstants[208]); + f[0] = algebraic[0]+algebraic[1]+states[0]-0.0; + f[1] = algebraic[0]-algebraic[1]-(computedConstants[198]+computedConstants[199]); } void findRoot0(double voi, double *states, double *rates, double *variables) @@ -368,231 +368,231 @@ void findRoot0(double voi, double *states, double *rates, double *variables) RootFindingInfo rfi = { voi, states, rates, variables }; double u[2]; - u[0] = algebraic[205]; - u[1] = algebraic[206]; + u[0] = algebraic[0]; + u[1] = algebraic[1]; nlaSolve(objectiveFunction0, u, 2, &rfi); - algebraic[205] = u[0]; - algebraic[206] = u[1]; + algebraic[0] = u[0]; + algebraic[1] = u[1]; } void initialiseVariables(double *states, double *rates, double *constants) { - constants[1] = 1.0; - constants[2] = 2.0; - constants[6] = 3.0; - constants[18] = 4.0; - constants[179] = 5.0; - constants[180] = 6.0; - constants[182] = 7.0; - algebraic[205] = 1.0; - algebraic[206] = 2.0; - computedConstants[184] = 123.0; - computedConstants[185] = 123.456789; - computedConstants[186] = 123.0e99; - computedConstants[187] = 123.456789e99; - computedConstants[189] = 1.0; - computedConstants[190] = 0.0; - computedConstants[191] = 2.71828182845905; - computedConstants[192] = 3.14159265358979; - computedConstants[193] = INFINITY; - computedConstants[194] = NAN; - computedConstants[207] = 1.0; - computedConstants[208] = 3.0; + constants[0] = 1.0; + constants[1] = 2.0; + constants[2] = 3.0; + constants[3] = 4.0; + constants[4] = 5.0; + constants[5] = 6.0; + constants[6] = 7.0; + algebraic[0] = 1.0; + algebraic[1] = 2.0; + computedConstants[177] = 123.0; + computedConstants[178] = 123.456789; + computedConstants[179] = 123.0e99; + computedConstants[180] = 123.456789e99; + computedConstants[182] = 1.0; + computedConstants[183] = 0.0; + computedConstants[184] = 2.71828182845905; + computedConstants[185] = 3.14159265358979; + computedConstants[186] = INFINITY; + computedConstants[187] = NAN; + computedConstants[198] = 1.0; + computedConstants[199] = 3.0; states[0] = 0.0; } void computeComputedConstants(double *constants, double *computedConstants) { - computedConstants[0] = constants[1] == constants[2]; - computedConstants[3] = constants[1]/(constants[2] == constants[2]); - computedConstants[4] = constants[1] != constants[2]; - computedConstants[5] = constants[1]/(constants[2] != constants[6]); - computedConstants[7] = constants[1] < constants[2]; - computedConstants[8] = constants[1]/(constants[2] < constants[6]); - computedConstants[9] = constants[1] <= constants[2]; - computedConstants[10] = constants[1]/(constants[2] <= constants[6]); - computedConstants[11] = constants[1] > constants[2]; - computedConstants[12] = constants[1]/(constants[2] > constants[6]); - computedConstants[13] = constants[1] >= constants[2]; - computedConstants[14] = constants[1]/(constants[2] >= constants[6]); - computedConstants[15] = constants[1] && constants[2]; - computedConstants[16] = constants[1] && constants[2] && constants[6]; - computedConstants[17] = (constants[1] < constants[2]) && (constants[6] > constants[18]); - computedConstants[19] = (constants[1]+constants[2]) && (constants[6] > constants[18]); - computedConstants[20] = constants[1] && (constants[2] > constants[6]); - computedConstants[21] = (constants[1]-constants[2]) && (constants[6] > constants[18]); - computedConstants[22] = -constants[1] && (constants[2] > constants[6]); - computedConstants[23] = pow(constants[1], constants[2]) && (constants[6] > constants[18]); - computedConstants[24] = pow(constants[1], 1.0/constants[2]) && (constants[6] > constants[18]); - computedConstants[25] = (constants[1] < constants[2]) && (constants[6]+constants[18]); - computedConstants[26] = (constants[1] < constants[2]) && constants[6]; - computedConstants[27] = (constants[1] < constants[2]) && (constants[6]-constants[18]); - computedConstants[28] = (constants[1] < constants[2]) && -constants[6]; - computedConstants[29] = (constants[1] < constants[2]) && pow(constants[6], constants[18]); - computedConstants[30] = (constants[1] < constants[2]) && pow(constants[6], 1.0/constants[18]); - computedConstants[31] = constants[1]/(constants[2] && constants[6]); - computedConstants[32] = constants[1] || constants[2]; - computedConstants[33] = constants[1] || constants[2] || constants[6]; - computedConstants[34] = (constants[1] < constants[2]) || (constants[6] > constants[18]); - computedConstants[35] = (constants[1]+constants[2]) || (constants[6] > constants[18]); - computedConstants[36] = constants[1] || (constants[2] > constants[6]); - computedConstants[37] = (constants[1]-constants[2]) || (constants[6] > constants[18]); - computedConstants[38] = -constants[1] || (constants[2] > constants[6]); - computedConstants[39] = pow(constants[1], constants[2]) || (constants[6] > constants[18]); - computedConstants[40] = pow(constants[1], 1.0/constants[2]) || (constants[6] > constants[18]); - computedConstants[41] = (constants[1] < constants[2]) || (constants[6]+constants[18]); - computedConstants[42] = (constants[1] < constants[2]) || constants[6]; - computedConstants[43] = (constants[1] < constants[2]) || (constants[6]-constants[18]); - computedConstants[44] = (constants[1] < constants[2]) || -constants[6]; - computedConstants[45] = (constants[1] < constants[2]) || pow(constants[6], constants[18]); - computedConstants[46] = (constants[1] < constants[2]) || pow(constants[6], 1.0/constants[18]); - computedConstants[47] = constants[1]/(constants[2] || constants[6]); - computedConstants[48] = xor(constants[1], constants[2]); - computedConstants[49] = xor(constants[1], xor(constants[2], constants[6])); - computedConstants[50] = xor(constants[1] < constants[2], constants[6] > constants[18]); - computedConstants[51] = xor(constants[1]+constants[2], constants[6] > constants[18]); - computedConstants[52] = xor(constants[1], constants[2] > constants[6]); - computedConstants[53] = xor(constants[1]-constants[2], constants[6] > constants[18]); - computedConstants[54] = xor(-constants[1], constants[2] > constants[6]); - computedConstants[55] = xor(pow(constants[1], constants[2]), constants[6] > constants[18]); - computedConstants[56] = xor(pow(constants[1], 1.0/constants[2]), constants[6] > constants[18]); - computedConstants[57] = xor(constants[1] < constants[2], constants[6]+constants[18]); - computedConstants[58] = xor(constants[1] < constants[2], constants[6]); - computedConstants[59] = xor(constants[1] < constants[2], constants[6]-constants[18]); - computedConstants[60] = xor(constants[1] < constants[2], -constants[6]); - computedConstants[61] = xor(constants[1] < constants[2], pow(constants[6], constants[18])); - computedConstants[62] = xor(constants[1] < constants[2], pow(constants[6], 1.0/constants[18])); - computedConstants[63] = constants[1]/xor(constants[2], constants[6]); - computedConstants[64] = !constants[1]; - computedConstants[65] = constants[1]+constants[2]; - computedConstants[66] = constants[1]+constants[2]+constants[6]; - computedConstants[67] = (constants[1] < constants[2])+(constants[6] > constants[18]); - computedConstants[68] = constants[1]; - computedConstants[69] = constants[1]-constants[2]; - computedConstants[70] = (constants[1] < constants[2])-(constants[6] > constants[18]); - computedConstants[71] = (constants[1] < constants[2])-(constants[6]+constants[18]); - computedConstants[72] = (constants[1] < constants[2])-constants[6]; - computedConstants[73] = constants[1]-(-constants[2]); - computedConstants[74] = constants[1]-(-constants[2]*constants[6]); - computedConstants[75] = -constants[1]; - computedConstants[76] = -(constants[1] < constants[2]); - computedConstants[77] = constants[1]*constants[2]; - computedConstants[78] = constants[1]*constants[2]*constants[6]; - computedConstants[79] = (constants[1] < constants[2])*(constants[6] > constants[18]); - computedConstants[80] = (constants[1]+constants[2])*(constants[6] > constants[18]); - computedConstants[81] = constants[1]*(constants[2] > constants[6]); - computedConstants[82] = (constants[1]-constants[2])*(constants[6] > constants[18]); - computedConstants[83] = -constants[1]*(constants[2] > constants[6]); - computedConstants[84] = (constants[1] < constants[2])*(constants[6]+constants[18]); - computedConstants[85] = (constants[1] < constants[2])*constants[6]; - computedConstants[86] = (constants[1] < constants[2])*(constants[6]-constants[18]); - computedConstants[87] = (constants[1] < constants[2])*-constants[6]; - computedConstants[88] = constants[1]/constants[2]; - computedConstants[89] = (constants[1] < constants[2])/(constants[18] > constants[6]); - computedConstants[90] = (constants[1]+constants[2])/(constants[18] > constants[6]); - computedConstants[91] = constants[1]/(constants[6] > constants[2]); - computedConstants[92] = (constants[1]-constants[2])/(constants[18] > constants[6]); - computedConstants[93] = -constants[1]/(constants[6] > constants[2]); - computedConstants[94] = (constants[1] < constants[2])/(constants[6]+constants[18]); - computedConstants[95] = (constants[1] < constants[2])/constants[6]; - computedConstants[96] = (constants[1] < constants[2])/(constants[6]-constants[18]); - computedConstants[97] = (constants[1] < constants[2])/-constants[6]; - computedConstants[98] = (constants[1] < constants[2])/(constants[6]*constants[18]); - computedConstants[99] = (constants[1] < constants[2])/(constants[6]/constants[18]); - computedConstants[100] = sqrt(constants[1]); - computedConstants[101] = pow(constants[1], 2.0); - computedConstants[102] = pow(constants[1], 3.0); - computedConstants[103] = pow(constants[1], constants[2]); - computedConstants[104] = pow(constants[1] <= constants[2], constants[6] >= constants[18]); - computedConstants[105] = pow(constants[1]+constants[2], constants[6] >= constants[18]); - computedConstants[106] = pow(constants[1], constants[2] >= constants[6]); - computedConstants[107] = pow(constants[1]-constants[2], constants[6] >= constants[18]); - computedConstants[108] = pow(-constants[1], constants[2] >= constants[6]); - computedConstants[109] = pow(constants[1]*constants[2], constants[6] >= constants[18]); - computedConstants[110] = pow(constants[1]/constants[2], constants[6] >= constants[18]); - computedConstants[111] = pow(constants[1] <= constants[2], constants[6]+constants[18]); - computedConstants[112] = pow(constants[1] <= constants[2], constants[6]); - computedConstants[113] = pow(constants[1] <= constants[2], constants[6]-constants[18]); - computedConstants[114] = pow(constants[1] <= constants[2], -constants[6]); - computedConstants[115] = pow(constants[1] <= constants[2], constants[6]*constants[18]); - computedConstants[116] = pow(constants[1] <= constants[2], constants[6]/constants[18]); - computedConstants[117] = pow(constants[1] <= constants[2], pow(constants[6], constants[18])); - computedConstants[118] = pow(constants[1] <= constants[2], pow(constants[6], 1.0/constants[18])); - computedConstants[119] = sqrt(constants[1]); - computedConstants[120] = sqrt(constants[1]); - computedConstants[121] = pow(constants[1], 1.0/3.0); - computedConstants[122] = pow(constants[1], 1.0/constants[2]); - computedConstants[123] = pow(constants[1] < constants[2], 1.0/(constants[18] > constants[6])); - computedConstants[124] = pow(constants[1]+constants[2], 1.0/(constants[18] > constants[6])); - computedConstants[125] = pow(constants[1], 1.0/(constants[6] > constants[2])); - computedConstants[126] = pow(constants[1]-constants[2], 1.0/(constants[18] > constants[6])); - computedConstants[127] = pow(-constants[1], 1.0/(constants[6] > constants[2])); - computedConstants[128] = pow(constants[1]*constants[2], 1.0/(constants[18] > constants[6])); - computedConstants[129] = pow(constants[1]/constants[2], 1.0/(constants[18] > constants[6])); - computedConstants[130] = pow(constants[1] < constants[2], 1.0/(constants[6]+constants[18])); - computedConstants[131] = pow(constants[1] < constants[2], 1.0/constants[6]); - computedConstants[132] = pow(constants[1] < constants[2], 1.0/(constants[6]-constants[18])); - computedConstants[133] = pow(constants[1] < constants[2], 1.0/-constants[6]); - computedConstants[134] = pow(constants[1] < constants[2], 1.0/(constants[6]*constants[18])); - computedConstants[135] = pow(constants[1] < constants[2], 1.0/(constants[6]/constants[18])); - computedConstants[136] = pow(constants[1] < constants[2], 1.0/pow(constants[6], constants[18])); - computedConstants[137] = pow(constants[1] < constants[2], 1.0/pow(constants[6], 1.0/constants[18])); - computedConstants[138] = fabs(constants[1]); - computedConstants[139] = exp(constants[1]); - computedConstants[140] = log(constants[1]); - computedConstants[141] = log10(constants[1]); - computedConstants[142] = log(constants[1])/log(2.0); - computedConstants[143] = log10(constants[1]); - computedConstants[144] = log(constants[1])/log(constants[2]); - computedConstants[145] = ceil(constants[1]); - computedConstants[146] = floor(constants[1]); - computedConstants[147] = min(constants[1], constants[2]); - computedConstants[148] = min(constants[1], min(constants[2], constants[6])); - computedConstants[149] = max(constants[1], constants[2]); - computedConstants[150] = max(constants[1], max(constants[2], constants[6])); - computedConstants[151] = fmod(constants[1], constants[2]); - computedConstants[152] = sin(constants[1]); - computedConstants[153] = cos(constants[1]); - computedConstants[154] = tan(constants[1]); - computedConstants[155] = sec(constants[1]); - computedConstants[156] = csc(constants[1]); - computedConstants[157] = cot(constants[1]); - computedConstants[158] = sinh(constants[1]); - computedConstants[159] = cosh(constants[1]); - computedConstants[160] = tanh(constants[1]); - computedConstants[161] = sech(constants[1]); - computedConstants[162] = csch(constants[1]); - computedConstants[163] = coth(constants[1]); - computedConstants[164] = asin(constants[1]); - computedConstants[165] = acos(constants[1]); - computedConstants[166] = atan(constants[1]); - computedConstants[167] = asec(constants[1]); - computedConstants[168] = acsc(constants[1]); - computedConstants[169] = acot(constants[1]); - computedConstants[170] = asinh(constants[1]); - computedConstants[171] = acosh(constants[1]); - computedConstants[172] = atanh(constants[1]/2.0); - computedConstants[173] = asech(constants[1]); - computedConstants[174] = acsch(constants[1]); - computedConstants[175] = acoth(2.0*constants[1]); - computedConstants[176] = (constants[1] > constants[2])?constants[1]:NAN; - computedConstants[177] = (constants[1] > constants[2])?constants[1]:constants[6]; - computedConstants[178] = (constants[1] > constants[2])?constants[1]:(constants[6] > constants[18])?constants[6]:(constants[179] > constants[180])?constants[179]:NAN; - computedConstants[181] = (constants[1] > constants[2])?constants[1]:(constants[6] > constants[18])?constants[6]:(constants[179] > constants[180])?constants[179]:constants[182]; - computedConstants[183] = 123.0+((constants[1] > constants[2])?constants[1]:NAN); - computedConstants[188] = constants[1]; - computedConstants[195] = (constants[1] && constants[2])+((constants[6] > constants[18])?constants[2]:NAN)+constants[179]+(constants[180] && constants[182]); - computedConstants[196] = (constants[1] && constants[2])-(((constants[6] > constants[18])?constants[2]:NAN)-(constants[179]-((constants[6] > constants[18])?constants[2]:NAN)))-(constants[180] && constants[182]); - computedConstants[197] = (constants[1] && constants[2])*((constants[6] > constants[18])?constants[2]:NAN)*constants[179]*((constants[6] > constants[18])?constants[2]:NAN)*(constants[180] && constants[182]); - computedConstants[198] = (constants[1] && constants[2])/(((constants[6] > constants[18])?constants[2]:NAN)/(constants[179]/((constants[6] > constants[18])?constants[2]:NAN))); - computedConstants[199] = (constants[1] || constants[2]) && xor(constants[1], constants[2]) && ((constants[6] > constants[18])?constants[2]:NAN) && constants[179] && ((constants[6] > constants[18])?constants[2]:NAN) && xor(constants[1], constants[2]) && (constants[1] || constants[2]); - computedConstants[200] = (constants[1] && constants[2]) || xor(constants[1], constants[2]) || ((constants[6] > constants[18])?constants[2]:NAN) || constants[179] || ((constants[6] > constants[18])?constants[2]:NAN) || xor(constants[1], constants[2]) || (constants[1] && constants[2]); - computedConstants[201] = xor(constants[1] && constants[2], xor(constants[1] || constants[2], xor((constants[6] > constants[18])?constants[2]:NAN, xor(xor(xor(constants[179], (constants[6] > constants[18])?constants[2]:NAN), constants[1] || constants[2]), constants[1] && constants[2])))); - computedConstants[202] = pow(constants[1] && constants[2], pow((constants[6] > constants[18])?constants[2]:NAN, pow(pow(constants[179], (constants[6] > constants[18])?constants[2]:NAN), constants[1] && constants[2]))); - computedConstants[203] = pow(pow(pow(constants[1] && constants[2], 1.0/pow((constants[6] > constants[18])?constants[2]:NAN, 1.0/constants[179])), 1.0/((constants[6] > constants[18])?constants[2]:NAN)), 1.0/(constants[1] && constants[2])); - computedConstants[204] = -(constants[1] && constants[2])+-((constants[6] > constants[18])?constants[2]:NAN); + computedConstants[0] = constants[0] == constants[1]; + computedConstants[1] = constants[0]/(constants[1] == constants[1]); + computedConstants[2] = constants[0] != constants[1]; + computedConstants[3] = constants[0]/(constants[1] != constants[2]); + computedConstants[4] = constants[0] < constants[1]; + computedConstants[5] = constants[0]/(constants[1] < constants[2]); + computedConstants[6] = constants[0] <= constants[1]; + computedConstants[7] = constants[0]/(constants[1] <= constants[2]); + computedConstants[8] = constants[0] > constants[1]; + computedConstants[9] = constants[0]/(constants[1] > constants[2]); + computedConstants[10] = constants[0] >= constants[1]; + computedConstants[11] = constants[0]/(constants[1] >= constants[2]); + computedConstants[12] = constants[0] && constants[1]; + computedConstants[13] = constants[0] && constants[1] && constants[2]; + computedConstants[14] = (constants[0] < constants[1]) && (constants[2] > constants[3]); + computedConstants[15] = (constants[0]+constants[1]) && (constants[2] > constants[3]); + computedConstants[16] = constants[0] && (constants[1] > constants[2]); + computedConstants[17] = (constants[0]-constants[1]) && (constants[2] > constants[3]); + computedConstants[18] = -constants[0] && (constants[1] > constants[2]); + computedConstants[19] = pow(constants[0], constants[1]) && (constants[2] > constants[3]); + computedConstants[20] = pow(constants[0], 1.0/constants[1]) && (constants[2] > constants[3]); + computedConstants[21] = (constants[0] < constants[1]) && (constants[2]+constants[3]); + computedConstants[22] = (constants[0] < constants[1]) && constants[2]; + computedConstants[23] = (constants[0] < constants[1]) && (constants[2]-constants[3]); + computedConstants[24] = (constants[0] < constants[1]) && -constants[2]; + computedConstants[25] = (constants[0] < constants[1]) && pow(constants[2], constants[3]); + computedConstants[26] = (constants[0] < constants[1]) && pow(constants[2], 1.0/constants[3]); + computedConstants[27] = constants[0]/(constants[1] && constants[2]); + computedConstants[28] = constants[0] || constants[1]; + computedConstants[29] = constants[0] || constants[1] || constants[2]; + computedConstants[30] = (constants[0] < constants[1]) || (constants[2] > constants[3]); + computedConstants[31] = (constants[0]+constants[1]) || (constants[2] > constants[3]); + computedConstants[32] = constants[0] || (constants[1] > constants[2]); + computedConstants[33] = (constants[0]-constants[1]) || (constants[2] > constants[3]); + computedConstants[34] = -constants[0] || (constants[1] > constants[2]); + computedConstants[35] = pow(constants[0], constants[1]) || (constants[2] > constants[3]); + computedConstants[36] = pow(constants[0], 1.0/constants[1]) || (constants[2] > constants[3]); + computedConstants[37] = (constants[0] < constants[1]) || (constants[2]+constants[3]); + computedConstants[38] = (constants[0] < constants[1]) || constants[2]; + computedConstants[39] = (constants[0] < constants[1]) || (constants[2]-constants[3]); + computedConstants[40] = (constants[0] < constants[1]) || -constants[2]; + computedConstants[41] = (constants[0] < constants[1]) || pow(constants[2], constants[3]); + computedConstants[42] = (constants[0] < constants[1]) || pow(constants[2], 1.0/constants[3]); + computedConstants[43] = constants[0]/(constants[1] || constants[2]); + computedConstants[44] = xor(constants[0], constants[1]); + computedConstants[45] = xor(constants[0], xor(constants[1], constants[2])); + computedConstants[46] = xor(constants[0] < constants[1], constants[2] > constants[3]); + computedConstants[47] = xor(constants[0]+constants[1], constants[2] > constants[3]); + computedConstants[48] = xor(constants[0], constants[1] > constants[2]); + computedConstants[49] = xor(constants[0]-constants[1], constants[2] > constants[3]); + computedConstants[50] = xor(-constants[0], constants[1] > constants[2]); + computedConstants[51] = xor(pow(constants[0], constants[1]), constants[2] > constants[3]); + computedConstants[52] = xor(pow(constants[0], 1.0/constants[1]), constants[2] > constants[3]); + computedConstants[53] = xor(constants[0] < constants[1], constants[2]+constants[3]); + computedConstants[54] = xor(constants[0] < constants[1], constants[2]); + computedConstants[55] = xor(constants[0] < constants[1], constants[2]-constants[3]); + computedConstants[56] = xor(constants[0] < constants[1], -constants[2]); + computedConstants[57] = xor(constants[0] < constants[1], pow(constants[2], constants[3])); + computedConstants[58] = xor(constants[0] < constants[1], pow(constants[2], 1.0/constants[3])); + computedConstants[59] = constants[0]/xor(constants[1], constants[2]); + computedConstants[60] = !constants[0]; + computedConstants[61] = constants[0]+constants[1]; + computedConstants[62] = constants[0]+constants[1]+constants[2]; + computedConstants[63] = (constants[0] < constants[1])+(constants[2] > constants[3]); + computedConstants[64] = constants[0]; + computedConstants[65] = constants[0]-constants[1]; + computedConstants[66] = (constants[0] < constants[1])-(constants[2] > constants[3]); + computedConstants[67] = (constants[0] < constants[1])-(constants[2]+constants[3]); + computedConstants[68] = (constants[0] < constants[1])-constants[2]; + computedConstants[69] = constants[0]-(-constants[1]); + computedConstants[70] = constants[0]-(-constants[1]*constants[2]); + computedConstants[71] = -constants[0]; + computedConstants[72] = -(constants[0] < constants[1]); + computedConstants[73] = constants[0]*constants[1]; + computedConstants[74] = constants[0]*constants[1]*constants[2]; + computedConstants[75] = (constants[0] < constants[1])*(constants[2] > constants[3]); + computedConstants[76] = (constants[0]+constants[1])*(constants[2] > constants[3]); + computedConstants[77] = constants[0]*(constants[1] > constants[2]); + computedConstants[78] = (constants[0]-constants[1])*(constants[2] > constants[3]); + computedConstants[79] = -constants[0]*(constants[1] > constants[2]); + computedConstants[80] = (constants[0] < constants[1])*(constants[2]+constants[3]); + computedConstants[81] = (constants[0] < constants[1])*constants[2]; + computedConstants[82] = (constants[0] < constants[1])*(constants[2]-constants[3]); + computedConstants[83] = (constants[0] < constants[1])*-constants[2]; + computedConstants[84] = constants[0]/constants[1]; + computedConstants[85] = (constants[0] < constants[1])/(constants[3] > constants[2]); + computedConstants[86] = (constants[0]+constants[1])/(constants[3] > constants[2]); + computedConstants[87] = constants[0]/(constants[2] > constants[1]); + computedConstants[88] = (constants[0]-constants[1])/(constants[3] > constants[2]); + computedConstants[89] = -constants[0]/(constants[2] > constants[1]); + computedConstants[90] = (constants[0] < constants[1])/(constants[2]+constants[3]); + computedConstants[91] = (constants[0] < constants[1])/constants[2]; + computedConstants[92] = (constants[0] < constants[1])/(constants[2]-constants[3]); + computedConstants[93] = (constants[0] < constants[1])/-constants[2]; + computedConstants[94] = (constants[0] < constants[1])/(constants[2]*constants[3]); + computedConstants[95] = (constants[0] < constants[1])/(constants[2]/constants[3]); + computedConstants[96] = sqrt(constants[0]); + computedConstants[97] = pow(constants[0], 2.0); + computedConstants[98] = pow(constants[0], 3.0); + computedConstants[99] = pow(constants[0], constants[1]); + computedConstants[100] = pow(constants[0] <= constants[1], constants[2] >= constants[3]); + computedConstants[101] = pow(constants[0]+constants[1], constants[2] >= constants[3]); + computedConstants[102] = pow(constants[0], constants[1] >= constants[2]); + computedConstants[103] = pow(constants[0]-constants[1], constants[2] >= constants[3]); + computedConstants[104] = pow(-constants[0], constants[1] >= constants[2]); + computedConstants[105] = pow(constants[0]*constants[1], constants[2] >= constants[3]); + computedConstants[106] = pow(constants[0]/constants[1], constants[2] >= constants[3]); + computedConstants[107] = pow(constants[0] <= constants[1], constants[2]+constants[3]); + computedConstants[108] = pow(constants[0] <= constants[1], constants[2]); + computedConstants[109] = pow(constants[0] <= constants[1], constants[2]-constants[3]); + computedConstants[110] = pow(constants[0] <= constants[1], -constants[2]); + computedConstants[111] = pow(constants[0] <= constants[1], constants[2]*constants[3]); + computedConstants[112] = pow(constants[0] <= constants[1], constants[2]/constants[3]); + computedConstants[113] = pow(constants[0] <= constants[1], pow(constants[2], constants[3])); + computedConstants[114] = pow(constants[0] <= constants[1], pow(constants[2], 1.0/constants[3])); + computedConstants[115] = sqrt(constants[0]); + computedConstants[116] = sqrt(constants[0]); + computedConstants[117] = pow(constants[0], 1.0/3.0); + computedConstants[118] = pow(constants[0], 1.0/constants[1]); + computedConstants[119] = pow(constants[0] < constants[1], 1.0/(constants[3] > constants[2])); + computedConstants[120] = pow(constants[0]+constants[1], 1.0/(constants[3] > constants[2])); + computedConstants[121] = pow(constants[0], 1.0/(constants[2] > constants[1])); + computedConstants[122] = pow(constants[0]-constants[1], 1.0/(constants[3] > constants[2])); + computedConstants[123] = pow(-constants[0], 1.0/(constants[2] > constants[1])); + computedConstants[124] = pow(constants[0]*constants[1], 1.0/(constants[3] > constants[2])); + computedConstants[125] = pow(constants[0]/constants[1], 1.0/(constants[3] > constants[2])); + computedConstants[126] = pow(constants[0] < constants[1], 1.0/(constants[2]+constants[3])); + computedConstants[127] = pow(constants[0] < constants[1], 1.0/constants[2]); + computedConstants[128] = pow(constants[0] < constants[1], 1.0/(constants[2]-constants[3])); + computedConstants[129] = pow(constants[0] < constants[1], 1.0/-constants[2]); + computedConstants[130] = pow(constants[0] < constants[1], 1.0/(constants[2]*constants[3])); + computedConstants[131] = pow(constants[0] < constants[1], 1.0/(constants[2]/constants[3])); + computedConstants[132] = pow(constants[0] < constants[1], 1.0/pow(constants[2], constants[3])); + computedConstants[133] = pow(constants[0] < constants[1], 1.0/pow(constants[2], 1.0/constants[3])); + computedConstants[134] = fabs(constants[0]); + computedConstants[135] = exp(constants[0]); + computedConstants[136] = log(constants[0]); + computedConstants[137] = log10(constants[0]); + computedConstants[138] = log(constants[0])/log(2.0); + computedConstants[139] = log10(constants[0]); + computedConstants[140] = log(constants[0])/log(constants[1]); + computedConstants[141] = ceil(constants[0]); + computedConstants[142] = floor(constants[0]); + computedConstants[143] = min(constants[0], constants[1]); + computedConstants[144] = min(constants[0], min(constants[1], constants[2])); + computedConstants[145] = max(constants[0], constants[1]); + computedConstants[146] = max(constants[0], max(constants[1], constants[2])); + computedConstants[147] = fmod(constants[0], constants[1]); + computedConstants[148] = sin(constants[0]); + computedConstants[149] = cos(constants[0]); + computedConstants[150] = tan(constants[0]); + computedConstants[151] = sec(constants[0]); + computedConstants[152] = csc(constants[0]); + computedConstants[153] = cot(constants[0]); + computedConstants[154] = sinh(constants[0]); + computedConstants[155] = cosh(constants[0]); + computedConstants[156] = tanh(constants[0]); + computedConstants[157] = sech(constants[0]); + computedConstants[158] = csch(constants[0]); + computedConstants[159] = coth(constants[0]); + computedConstants[160] = asin(constants[0]); + computedConstants[161] = acos(constants[0]); + computedConstants[162] = atan(constants[0]); + computedConstants[163] = asec(constants[0]); + computedConstants[164] = acsc(constants[0]); + computedConstants[165] = acot(constants[0]); + computedConstants[166] = asinh(constants[0]); + computedConstants[167] = acosh(constants[0]); + computedConstants[168] = atanh(constants[0]/2.0); + computedConstants[169] = asech(constants[0]); + computedConstants[170] = acsch(constants[0]); + computedConstants[171] = acoth(2.0*constants[0]); + computedConstants[172] = (constants[0] > constants[1])?constants[0]:NAN; + computedConstants[173] = (constants[0] > constants[1])?constants[0]:constants[2]; + computedConstants[174] = (constants[0] > constants[1])?constants[0]:(constants[2] > constants[3])?constants[2]:(constants[4] > constants[5])?constants[4]:NAN; + computedConstants[175] = (constants[0] > constants[1])?constants[0]:(constants[2] > constants[3])?constants[2]:(constants[4] > constants[5])?constants[4]:constants[6]; + computedConstants[176] = 123.0+((constants[0] > constants[1])?constants[0]:NAN); + computedConstants[181] = constants[0]; + computedConstants[188] = (constants[0] && constants[1])+((constants[2] > constants[3])?constants[1]:NAN)+constants[4]+(constants[5] && constants[6]); + computedConstants[189] = (constants[0] && constants[1])-(((constants[2] > constants[3])?constants[1]:NAN)-(constants[4]-((constants[2] > constants[3])?constants[1]:NAN)))-(constants[5] && constants[6]); + computedConstants[190] = (constants[0] && constants[1])*((constants[2] > constants[3])?constants[1]:NAN)*constants[4]*((constants[2] > constants[3])?constants[1]:NAN)*(constants[5] && constants[6]); + computedConstants[191] = (constants[0] && constants[1])/(((constants[2] > constants[3])?constants[1]:NAN)/(constants[4]/((constants[2] > constants[3])?constants[1]:NAN))); + computedConstants[192] = (constants[0] || constants[1]) && xor(constants[0], constants[1]) && ((constants[2] > constants[3])?constants[1]:NAN) && constants[4] && ((constants[2] > constants[3])?constants[1]:NAN) && xor(constants[0], constants[1]) && (constants[0] || constants[1]); + computedConstants[193] = (constants[0] && constants[1]) || xor(constants[0], constants[1]) || ((constants[2] > constants[3])?constants[1]:NAN) || constants[4] || ((constants[2] > constants[3])?constants[1]:NAN) || xor(constants[0], constants[1]) || (constants[0] && constants[1]); + computedConstants[194] = xor(constants[0] && constants[1], xor(constants[0] || constants[1], xor((constants[2] > constants[3])?constants[1]:NAN, xor(xor(xor(constants[4], (constants[2] > constants[3])?constants[1]:NAN), constants[0] || constants[1]), constants[0] && constants[1])))); + computedConstants[195] = pow(constants[0] && constants[1], pow((constants[2] > constants[3])?constants[1]:NAN, pow(pow(constants[4], (constants[2] > constants[3])?constants[1]:NAN), constants[0] && constants[1]))); + computedConstants[196] = pow(pow(pow(constants[0] && constants[1], 1.0/pow((constants[2] > constants[3])?constants[1]:NAN, 1.0/constants[4])), 1.0/((constants[2] > constants[3])?constants[1]:NAN)), 1.0/(constants[0] && constants[1])); + computedConstants[197] = -(constants[0] && constants[1])+-((constants[2] > constants[3])?constants[1]:NAN); } void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic) diff --git a/tests/resources/coverage/generator/model.modified.profile.py b/tests/resources/coverage/generator/model.modified.profile.py index 4eeb5c9faa..4f4499cf7e 100644 --- a/tests/resources/coverage/generator/model.modified.profile.py +++ b/tests/resources/coverage/generator/model.modified.profile.py @@ -359,239 +359,239 @@ def objective_function_0(u, f, data): rates = data[2] variables = data[3] - algebraic[205] = u[0] - algebraic[206] = u[1] + algebraic[0] = u[0] + algebraic[1] = u[1] - f[0] = algebraic[205]+algebraic[206]+states[0]-0.0 - f[1] = algebraic[205]-algebraic[206]-(computed_constants[207]+computed_constants[208]) + f[0] = algebraic[0]+algebraic[1]+states[0]-0.0 + f[1] = algebraic[0]-algebraic[1]-(computed_constants[198]+computed_constants[199]) def find_root_0(voi, states, rates, variables): u = [nan]*2 - u[0] = algebraic[205] - u[1] = algebraic[206] + u[0] = algebraic[0] + u[1] = algebraic[1] u = nla_solve(objective_function_0, u, 2, [voi, states, rates, variables]) - algebraic[205] = u[0] - algebraic[206] = u[1] + algebraic[0] = u[0] + algebraic[1] = u[1] def initialise_variables(states, rates, constants): - constants[1] = 1.0 - constants[2] = 2.0 - constants[6] = 3.0 - constants[18] = 4.0 - constants[179] = 5.0 - constants[180] = 6.0 - constants[182] = 7.0 - algebraic[205] = 1.0 - algebraic[206] = 2.0 - computed_constants[184] = 123.0 - computed_constants[185] = 123.456789 - computed_constants[186] = 123.0e99 - computed_constants[187] = 123.456789e99 - computed_constants[189] = 1.0 - computed_constants[190] = 0.0 - computed_constants[191] = 2.71828182845905 - computed_constants[192] = 3.14159265358979 - computed_constants[193] = inf - computed_constants[194] = nan - computed_constants[207] = 1.0 - computed_constants[208] = 3.0 + constants[0] = 1.0 + constants[1] = 2.0 + constants[2] = 3.0 + constants[3] = 4.0 + constants[4] = 5.0 + constants[5] = 6.0 + constants[6] = 7.0 + algebraic[0] = 1.0 + algebraic[1] = 2.0 + computed_constants[177] = 123.0 + computed_constants[178] = 123.456789 + computed_constants[179] = 123.0e99 + computed_constants[180] = 123.456789e99 + computed_constants[182] = 1.0 + computed_constants[183] = 0.0 + computed_constants[184] = 2.71828182845905 + computed_constants[185] = 3.14159265358979 + computed_constants[186] = inf + computed_constants[187] = nan + computed_constants[198] = 1.0 + computed_constants[199] = 3.0 states[0] = 0.0 def compute_computed_constants(constants, computed_constants): - computed_constants[0] = eq_func(constants[1], constants[2]) - computed_constants[3] = constants[1]/eq_func(constants[2], constants[2]) - computed_constants[4] = neq_func(constants[1], constants[2]) - computed_constants[5] = constants[1]/neq_func(constants[2], constants[6]) - computed_constants[7] = lt_func(constants[1], constants[2]) - computed_constants[8] = constants[1]/lt_func(constants[2], constants[6]) - computed_constants[9] = leq_func(constants[1], constants[2]) - computed_constants[10] = constants[1]/leq_func(constants[2], constants[6]) - computed_constants[11] = gt_func(constants[1], constants[2]) - computed_constants[12] = constants[1]/gt_func(constants[2], constants[6]) - computed_constants[13] = geq_func(constants[1], constants[2]) - computed_constants[14] = constants[1]/geq_func(constants[2], constants[6]) - computed_constants[15] = and_func(constants[1], constants[2]) - computed_constants[16] = and_func(constants[1], and_func(constants[2], constants[6])) - computed_constants[17] = and_func(lt_func(constants[1], constants[2]), gt_func(constants[6], constants[18])) - computed_constants[19] = and_func(constants[1]+constants[2], gt_func(constants[6], constants[18])) - computed_constants[20] = and_func(constants[1], gt_func(constants[2], constants[6])) - computed_constants[21] = and_func(constants[1]-constants[2], gt_func(constants[6], constants[18])) - computed_constants[22] = and_func(-constants[1], gt_func(constants[2], constants[6])) - computed_constants[23] = and_func(pow(constants[1], constants[2]), gt_func(constants[6], constants[18])) - computed_constants[24] = and_func(pow(constants[1], 1.0/constants[2]), gt_func(constants[6], constants[18])) - computed_constants[25] = and_func(lt_func(constants[1], constants[2]), constants[6]+constants[18]) - computed_constants[26] = and_func(lt_func(constants[1], constants[2]), constants[6]) - computed_constants[27] = and_func(lt_func(constants[1], constants[2]), constants[6]-constants[18]) - computed_constants[28] = and_func(lt_func(constants[1], constants[2]), -constants[6]) - computed_constants[29] = and_func(lt_func(constants[1], constants[2]), pow(constants[6], constants[18])) - computed_constants[30] = and_func(lt_func(constants[1], constants[2]), pow(constants[6], 1.0/constants[18])) - computed_constants[31] = constants[1]/and_func(constants[2], constants[6]) - computed_constants[32] = or_func(constants[1], constants[2]) - computed_constants[33] = or_func(constants[1], or_func(constants[2], constants[6])) - computed_constants[34] = or_func(lt_func(constants[1], constants[2]), gt_func(constants[6], constants[18])) - computed_constants[35] = or_func(constants[1]+constants[2], gt_func(constants[6], constants[18])) - computed_constants[36] = or_func(constants[1], gt_func(constants[2], constants[6])) - computed_constants[37] = or_func(constants[1]-constants[2], gt_func(constants[6], constants[18])) - computed_constants[38] = or_func(-constants[1], gt_func(constants[2], constants[6])) - computed_constants[39] = or_func(pow(constants[1], constants[2]), gt_func(constants[6], constants[18])) - computed_constants[40] = or_func(pow(constants[1], 1.0/constants[2]), gt_func(constants[6], constants[18])) - computed_constants[41] = or_func(lt_func(constants[1], constants[2]), constants[6]+constants[18]) - computed_constants[42] = or_func(lt_func(constants[1], constants[2]), constants[6]) - computed_constants[43] = or_func(lt_func(constants[1], constants[2]), constants[6]-constants[18]) - computed_constants[44] = or_func(lt_func(constants[1], constants[2]), -constants[6]) - computed_constants[45] = or_func(lt_func(constants[1], constants[2]), pow(constants[6], constants[18])) - computed_constants[46] = or_func(lt_func(constants[1], constants[2]), pow(constants[6], 1.0/constants[18])) - computed_constants[47] = constants[1]/or_func(constants[2], constants[6]) - computed_constants[48] = xor_func(constants[1], constants[2]) - computed_constants[49] = xor_func(constants[1], xor_func(constants[2], constants[6])) - computed_constants[50] = xor_func(lt_func(constants[1], constants[2]), gt_func(constants[6], constants[18])) - computed_constants[51] = xor_func(constants[1]+constants[2], gt_func(constants[6], constants[18])) - computed_constants[52] = xor_func(constants[1], gt_func(constants[2], constants[6])) - computed_constants[53] = xor_func(constants[1]-constants[2], gt_func(constants[6], constants[18])) - computed_constants[54] = xor_func(-constants[1], gt_func(constants[2], constants[6])) - computed_constants[55] = xor_func(pow(constants[1], constants[2]), gt_func(constants[6], constants[18])) - computed_constants[56] = xor_func(pow(constants[1], 1.0/constants[2]), gt_func(constants[6], constants[18])) - computed_constants[57] = xor_func(lt_func(constants[1], constants[2]), constants[6]+constants[18]) - computed_constants[58] = xor_func(lt_func(constants[1], constants[2]), constants[6]) - computed_constants[59] = xor_func(lt_func(constants[1], constants[2]), constants[6]-constants[18]) - computed_constants[60] = xor_func(lt_func(constants[1], constants[2]), -constants[6]) - computed_constants[61] = xor_func(lt_func(constants[1], constants[2]), pow(constants[6], constants[18])) - computed_constants[62] = xor_func(lt_func(constants[1], constants[2]), pow(constants[6], 1.0/constants[18])) - computed_constants[63] = constants[1]/xor_func(constants[2], constants[6]) - computed_constants[64] = not_func(constants[1]) - computed_constants[65] = constants[1]+constants[2] - computed_constants[66] = constants[1]+constants[2]+constants[6] - computed_constants[67] = lt_func(constants[1], constants[2])+gt_func(constants[6], constants[18]) - computed_constants[68] = constants[1] - computed_constants[69] = constants[1]-constants[2] - computed_constants[70] = lt_func(constants[1], constants[2])-gt_func(constants[6], constants[18]) - computed_constants[71] = lt_func(constants[1], constants[2])-(constants[6]+constants[18]) - computed_constants[72] = lt_func(constants[1], constants[2])-constants[6] - computed_constants[73] = constants[1]-(-constants[2]) - computed_constants[74] = constants[1]-(-constants[2]*constants[6]) - computed_constants[75] = -constants[1] - computed_constants[76] = -lt_func(constants[1], constants[2]) - computed_constants[77] = constants[1]*constants[2] - computed_constants[78] = constants[1]*constants[2]*constants[6] - computed_constants[79] = lt_func(constants[1], constants[2])*gt_func(constants[6], constants[18]) - computed_constants[80] = (constants[1]+constants[2])*gt_func(constants[6], constants[18]) - computed_constants[81] = constants[1]*gt_func(constants[2], constants[6]) - computed_constants[82] = (constants[1]-constants[2])*gt_func(constants[6], constants[18]) - computed_constants[83] = -constants[1]*gt_func(constants[2], constants[6]) - computed_constants[84] = lt_func(constants[1], constants[2])*(constants[6]+constants[18]) - computed_constants[85] = lt_func(constants[1], constants[2])*constants[6] - computed_constants[86] = lt_func(constants[1], constants[2])*(constants[6]-constants[18]) - computed_constants[87] = lt_func(constants[1], constants[2])*-constants[6] - computed_constants[88] = constants[1]/constants[2] - computed_constants[89] = lt_func(constants[1], constants[2])/gt_func(constants[18], constants[6]) - computed_constants[90] = (constants[1]+constants[2])/gt_func(constants[18], constants[6]) - computed_constants[91] = constants[1]/gt_func(constants[6], constants[2]) - computed_constants[92] = (constants[1]-constants[2])/gt_func(constants[18], constants[6]) - computed_constants[93] = -constants[1]/gt_func(constants[6], constants[2]) - computed_constants[94] = lt_func(constants[1], constants[2])/(constants[6]+constants[18]) - computed_constants[95] = lt_func(constants[1], constants[2])/constants[6] - computed_constants[96] = lt_func(constants[1], constants[2])/(constants[6]-constants[18]) - computed_constants[97] = lt_func(constants[1], constants[2])/-constants[6] - computed_constants[98] = lt_func(constants[1], constants[2])/(constants[6]*constants[18]) - computed_constants[99] = lt_func(constants[1], constants[2])/(constants[6]/constants[18]) - computed_constants[100] = sqrt(constants[1]) - computed_constants[101] = pow(constants[1], 2.0) - computed_constants[102] = pow(constants[1], 3.0) - computed_constants[103] = pow(constants[1], constants[2]) - computed_constants[104] = pow(leq_func(constants[1], constants[2]), geq_func(constants[6], constants[18])) - computed_constants[105] = pow(constants[1]+constants[2], geq_func(constants[6], constants[18])) - computed_constants[106] = pow(constants[1], geq_func(constants[2], constants[6])) - computed_constants[107] = pow(constants[1]-constants[2], geq_func(constants[6], constants[18])) - computed_constants[108] = pow(-constants[1], geq_func(constants[2], constants[6])) - computed_constants[109] = pow(constants[1]*constants[2], geq_func(constants[6], constants[18])) - computed_constants[110] = pow(constants[1]/constants[2], geq_func(constants[6], constants[18])) - computed_constants[111] = pow(leq_func(constants[1], constants[2]), constants[6]+constants[18]) - computed_constants[112] = pow(leq_func(constants[1], constants[2]), constants[6]) - computed_constants[113] = pow(leq_func(constants[1], constants[2]), constants[6]-constants[18]) - computed_constants[114] = pow(leq_func(constants[1], constants[2]), -constants[6]) - computed_constants[115] = pow(leq_func(constants[1], constants[2]), constants[6]*constants[18]) - computed_constants[116] = pow(leq_func(constants[1], constants[2]), constants[6]/constants[18]) - computed_constants[117] = pow(leq_func(constants[1], constants[2]), pow(constants[6], constants[18])) - computed_constants[118] = pow(leq_func(constants[1], constants[2]), pow(constants[6], 1.0/constants[18])) - computed_constants[119] = sqrt(constants[1]) - computed_constants[120] = sqrt(constants[1]) - computed_constants[121] = pow(constants[1], 1.0/3.0) - computed_constants[122] = pow(constants[1], 1.0/constants[2]) - computed_constants[123] = pow(lt_func(constants[1], constants[2]), 1.0/gt_func(constants[18], constants[6])) - computed_constants[124] = pow(constants[1]+constants[2], 1.0/gt_func(constants[18], constants[6])) - computed_constants[125] = pow(constants[1], 1.0/gt_func(constants[6], constants[2])) - computed_constants[126] = pow(constants[1]-constants[2], 1.0/gt_func(constants[18], constants[6])) - computed_constants[127] = pow(-constants[1], 1.0/gt_func(constants[6], constants[2])) - computed_constants[128] = pow(constants[1]*constants[2], 1.0/gt_func(constants[18], constants[6])) - computed_constants[129] = pow(constants[1]/constants[2], 1.0/gt_func(constants[18], constants[6])) - computed_constants[130] = pow(lt_func(constants[1], constants[2]), 1.0/(constants[6]+constants[18])) - computed_constants[131] = pow(lt_func(constants[1], constants[2]), 1.0/constants[6]) - computed_constants[132] = pow(lt_func(constants[1], constants[2]), 1.0/(constants[6]-constants[18])) - computed_constants[133] = pow(lt_func(constants[1], constants[2]), 1.0/-constants[6]) - computed_constants[134] = pow(lt_func(constants[1], constants[2]), 1.0/(constants[6]*constants[18])) - computed_constants[135] = pow(lt_func(constants[1], constants[2]), 1.0/(constants[6]/constants[18])) - computed_constants[136] = pow(lt_func(constants[1], constants[2]), 1.0/pow(constants[6], constants[18])) - computed_constants[137] = pow(lt_func(constants[1], constants[2]), 1.0/pow(constants[6], 1.0/constants[18])) - computed_constants[138] = fabs(constants[1]) - computed_constants[139] = exp(constants[1]) - computed_constants[140] = log(constants[1]) - computed_constants[141] = log10(constants[1]) - computed_constants[142] = log(constants[1])/log(2.0) - computed_constants[143] = log10(constants[1]) - computed_constants[144] = log(constants[1])/log(constants[2]) - computed_constants[145] = ceil(constants[1]) - computed_constants[146] = floor(constants[1]) - computed_constants[147] = min(constants[1], constants[2]) - computed_constants[148] = min(constants[1], min(constants[2], constants[6])) - computed_constants[149] = max(constants[1], constants[2]) - computed_constants[150] = max(constants[1], max(constants[2], constants[6])) - computed_constants[151] = fmod(constants[1], constants[2]) - computed_constants[152] = sin(constants[1]) - computed_constants[153] = cos(constants[1]) - computed_constants[154] = tan(constants[1]) - computed_constants[155] = sec(constants[1]) - computed_constants[156] = csc(constants[1]) - computed_constants[157] = cot(constants[1]) - computed_constants[158] = sinh(constants[1]) - computed_constants[159] = cosh(constants[1]) - computed_constants[160] = tanh(constants[1]) - computed_constants[161] = sech(constants[1]) - computed_constants[162] = csch(constants[1]) - computed_constants[163] = coth(constants[1]) - computed_constants[164] = asin(constants[1]) - computed_constants[165] = acos(constants[1]) - computed_constants[166] = atan(constants[1]) - computed_constants[167] = asec(constants[1]) - computed_constants[168] = acsc(constants[1]) - computed_constants[169] = acot(constants[1]) - computed_constants[170] = asinh(constants[1]) - computed_constants[171] = acosh(constants[1]) - computed_constants[172] = atanh(constants[1]/2.0) - computed_constants[173] = asech(constants[1]) - computed_constants[174] = acsch(constants[1]) - computed_constants[175] = acoth(2.0*constants[1]) - computed_constants[176] = constants[1] if gt_func(constants[1], constants[2]) else nan - computed_constants[177] = constants[1] if gt_func(constants[1], constants[2]) else constants[6] - computed_constants[178] = constants[1] if gt_func(constants[1], constants[2]) else constants[6] if gt_func(constants[6], constants[18]) else constants[179] if gt_func(constants[179], constants[180]) else nan - computed_constants[181] = constants[1] if gt_func(constants[1], constants[2]) else constants[6] if gt_func(constants[6], constants[18]) else constants[179] if gt_func(constants[179], constants[180]) else constants[182] - computed_constants[183] = 123.0+(constants[1] if gt_func(constants[1], constants[2]) else nan) - computed_constants[188] = constants[1] - computed_constants[195] = and_func(constants[1], constants[2])+(constants[2] if gt_func(constants[6], constants[18]) else nan)+constants[179]+and_func(constants[180], constants[182]) - computed_constants[196] = and_func(constants[1], constants[2])-((constants[2] if gt_func(constants[6], constants[18]) else nan)-(constants[179]-(constants[2] if gt_func(constants[6], constants[18]) else nan)))-and_func(constants[180], constants[182]) - computed_constants[197] = and_func(constants[1], constants[2])*(constants[2] if gt_func(constants[6], constants[18]) else nan)*constants[179]*(constants[2] if gt_func(constants[6], constants[18]) else nan)*and_func(constants[180], constants[182]) - computed_constants[198] = and_func(constants[1], constants[2])/((constants[2] if gt_func(constants[6], constants[18]) else nan)/(constants[179]/(constants[2] if gt_func(constants[6], constants[18]) else nan))) - computed_constants[199] = and_func(or_func(constants[1], constants[2]), and_func(xor_func(constants[1], constants[2]), and_func(constants[2] if gt_func(constants[6], constants[18]) else nan, and_func(and_func(and_func(constants[179], constants[2] if gt_func(constants[6], constants[18]) else nan), xor_func(constants[1], constants[2])), or_func(constants[1], constants[2]))))) - computed_constants[200] = or_func(and_func(constants[1], constants[2]), or_func(xor_func(constants[1], constants[2]), or_func(constants[2] if gt_func(constants[6], constants[18]) else nan, or_func(or_func(or_func(constants[179], constants[2] if gt_func(constants[6], constants[18]) else nan), xor_func(constants[1], constants[2])), and_func(constants[1], constants[2]))))) - computed_constants[201] = xor_func(and_func(constants[1], constants[2]), xor_func(or_func(constants[1], constants[2]), xor_func(constants[2] if gt_func(constants[6], constants[18]) else nan, xor_func(xor_func(xor_func(constants[179], constants[2] if gt_func(constants[6], constants[18]) else nan), or_func(constants[1], constants[2])), and_func(constants[1], constants[2]))))) - computed_constants[202] = pow(and_func(constants[1], constants[2]), pow(constants[2] if gt_func(constants[6], constants[18]) else nan, pow(pow(constants[179], constants[2] if gt_func(constants[6], constants[18]) else nan), and_func(constants[1], constants[2])))) - computed_constants[203] = pow(pow(pow(and_func(constants[1], constants[2]), 1.0/pow(constants[2] if gt_func(constants[6], constants[18]) else nan, 1.0/constants[179])), 1.0/(constants[2] if gt_func(constants[6], constants[18]) else nan)), 1.0/and_func(constants[1], constants[2])) - computed_constants[204] = -and_func(constants[1], constants[2])+-(constants[2] if gt_func(constants[6], constants[18]) else nan) + computed_constants[0] = eq_func(constants[0], constants[1]) + computed_constants[1] = constants[0]/eq_func(constants[1], constants[1]) + computed_constants[2] = neq_func(constants[0], constants[1]) + computed_constants[3] = constants[0]/neq_func(constants[1], constants[2]) + computed_constants[4] = lt_func(constants[0], constants[1]) + computed_constants[5] = constants[0]/lt_func(constants[1], constants[2]) + computed_constants[6] = leq_func(constants[0], constants[1]) + computed_constants[7] = constants[0]/leq_func(constants[1], constants[2]) + computed_constants[8] = gt_func(constants[0], constants[1]) + computed_constants[9] = constants[0]/gt_func(constants[1], constants[2]) + computed_constants[10] = geq_func(constants[0], constants[1]) + computed_constants[11] = constants[0]/geq_func(constants[1], constants[2]) + computed_constants[12] = and_func(constants[0], constants[1]) + computed_constants[13] = and_func(constants[0], and_func(constants[1], constants[2])) + computed_constants[14] = and_func(lt_func(constants[0], constants[1]), gt_func(constants[2], constants[3])) + computed_constants[15] = and_func(constants[0]+constants[1], gt_func(constants[2], constants[3])) + computed_constants[16] = and_func(constants[0], gt_func(constants[1], constants[2])) + computed_constants[17] = and_func(constants[0]-constants[1], gt_func(constants[2], constants[3])) + computed_constants[18] = and_func(-constants[0], gt_func(constants[1], constants[2])) + computed_constants[19] = and_func(pow(constants[0], constants[1]), gt_func(constants[2], constants[3])) + computed_constants[20] = and_func(pow(constants[0], 1.0/constants[1]), gt_func(constants[2], constants[3])) + computed_constants[21] = and_func(lt_func(constants[0], constants[1]), constants[2]+constants[3]) + computed_constants[22] = and_func(lt_func(constants[0], constants[1]), constants[2]) + computed_constants[23] = and_func(lt_func(constants[0], constants[1]), constants[2]-constants[3]) + computed_constants[24] = and_func(lt_func(constants[0], constants[1]), -constants[2]) + computed_constants[25] = and_func(lt_func(constants[0], constants[1]), pow(constants[2], constants[3])) + computed_constants[26] = and_func(lt_func(constants[0], constants[1]), pow(constants[2], 1.0/constants[3])) + computed_constants[27] = constants[0]/and_func(constants[1], constants[2]) + computed_constants[28] = or_func(constants[0], constants[1]) + computed_constants[29] = or_func(constants[0], or_func(constants[1], constants[2])) + computed_constants[30] = or_func(lt_func(constants[0], constants[1]), gt_func(constants[2], constants[3])) + computed_constants[31] = or_func(constants[0]+constants[1], gt_func(constants[2], constants[3])) + computed_constants[32] = or_func(constants[0], gt_func(constants[1], constants[2])) + computed_constants[33] = or_func(constants[0]-constants[1], gt_func(constants[2], constants[3])) + computed_constants[34] = or_func(-constants[0], gt_func(constants[1], constants[2])) + computed_constants[35] = or_func(pow(constants[0], constants[1]), gt_func(constants[2], constants[3])) + computed_constants[36] = or_func(pow(constants[0], 1.0/constants[1]), gt_func(constants[2], constants[3])) + computed_constants[37] = or_func(lt_func(constants[0], constants[1]), constants[2]+constants[3]) + computed_constants[38] = or_func(lt_func(constants[0], constants[1]), constants[2]) + computed_constants[39] = or_func(lt_func(constants[0], constants[1]), constants[2]-constants[3]) + computed_constants[40] = or_func(lt_func(constants[0], constants[1]), -constants[2]) + computed_constants[41] = or_func(lt_func(constants[0], constants[1]), pow(constants[2], constants[3])) + computed_constants[42] = or_func(lt_func(constants[0], constants[1]), pow(constants[2], 1.0/constants[3])) + computed_constants[43] = constants[0]/or_func(constants[1], constants[2]) + computed_constants[44] = xor_func(constants[0], constants[1]) + computed_constants[45] = xor_func(constants[0], xor_func(constants[1], constants[2])) + computed_constants[46] = xor_func(lt_func(constants[0], constants[1]), gt_func(constants[2], constants[3])) + computed_constants[47] = xor_func(constants[0]+constants[1], gt_func(constants[2], constants[3])) + computed_constants[48] = xor_func(constants[0], gt_func(constants[1], constants[2])) + computed_constants[49] = xor_func(constants[0]-constants[1], gt_func(constants[2], constants[3])) + computed_constants[50] = xor_func(-constants[0], gt_func(constants[1], constants[2])) + computed_constants[51] = xor_func(pow(constants[0], constants[1]), gt_func(constants[2], constants[3])) + computed_constants[52] = xor_func(pow(constants[0], 1.0/constants[1]), gt_func(constants[2], constants[3])) + computed_constants[53] = xor_func(lt_func(constants[0], constants[1]), constants[2]+constants[3]) + computed_constants[54] = xor_func(lt_func(constants[0], constants[1]), constants[2]) + computed_constants[55] = xor_func(lt_func(constants[0], constants[1]), constants[2]-constants[3]) + computed_constants[56] = xor_func(lt_func(constants[0], constants[1]), -constants[2]) + computed_constants[57] = xor_func(lt_func(constants[0], constants[1]), pow(constants[2], constants[3])) + computed_constants[58] = xor_func(lt_func(constants[0], constants[1]), pow(constants[2], 1.0/constants[3])) + computed_constants[59] = constants[0]/xor_func(constants[1], constants[2]) + computed_constants[60] = not_func(constants[0]) + computed_constants[61] = constants[0]+constants[1] + computed_constants[62] = constants[0]+constants[1]+constants[2] + computed_constants[63] = lt_func(constants[0], constants[1])+gt_func(constants[2], constants[3]) + computed_constants[64] = constants[0] + computed_constants[65] = constants[0]-constants[1] + computed_constants[66] = lt_func(constants[0], constants[1])-gt_func(constants[2], constants[3]) + computed_constants[67] = lt_func(constants[0], constants[1])-(constants[2]+constants[3]) + computed_constants[68] = lt_func(constants[0], constants[1])-constants[2] + computed_constants[69] = constants[0]-(-constants[1]) + computed_constants[70] = constants[0]-(-constants[1]*constants[2]) + computed_constants[71] = -constants[0] + computed_constants[72] = -lt_func(constants[0], constants[1]) + computed_constants[73] = constants[0]*constants[1] + computed_constants[74] = constants[0]*constants[1]*constants[2] + computed_constants[75] = lt_func(constants[0], constants[1])*gt_func(constants[2], constants[3]) + computed_constants[76] = (constants[0]+constants[1])*gt_func(constants[2], constants[3]) + computed_constants[77] = constants[0]*gt_func(constants[1], constants[2]) + computed_constants[78] = (constants[0]-constants[1])*gt_func(constants[2], constants[3]) + computed_constants[79] = -constants[0]*gt_func(constants[1], constants[2]) + computed_constants[80] = lt_func(constants[0], constants[1])*(constants[2]+constants[3]) + computed_constants[81] = lt_func(constants[0], constants[1])*constants[2] + computed_constants[82] = lt_func(constants[0], constants[1])*(constants[2]-constants[3]) + computed_constants[83] = lt_func(constants[0], constants[1])*-constants[2] + computed_constants[84] = constants[0]/constants[1] + computed_constants[85] = lt_func(constants[0], constants[1])/gt_func(constants[3], constants[2]) + computed_constants[86] = (constants[0]+constants[1])/gt_func(constants[3], constants[2]) + computed_constants[87] = constants[0]/gt_func(constants[2], constants[1]) + computed_constants[88] = (constants[0]-constants[1])/gt_func(constants[3], constants[2]) + computed_constants[89] = -constants[0]/gt_func(constants[2], constants[1]) + computed_constants[90] = lt_func(constants[0], constants[1])/(constants[2]+constants[3]) + computed_constants[91] = lt_func(constants[0], constants[1])/constants[2] + computed_constants[92] = lt_func(constants[0], constants[1])/(constants[2]-constants[3]) + computed_constants[93] = lt_func(constants[0], constants[1])/-constants[2] + computed_constants[94] = lt_func(constants[0], constants[1])/(constants[2]*constants[3]) + computed_constants[95] = lt_func(constants[0], constants[1])/(constants[2]/constants[3]) + computed_constants[96] = sqrt(constants[0]) + computed_constants[97] = pow(constants[0], 2.0) + computed_constants[98] = pow(constants[0], 3.0) + computed_constants[99] = pow(constants[0], constants[1]) + computed_constants[100] = pow(leq_func(constants[0], constants[1]), geq_func(constants[2], constants[3])) + computed_constants[101] = pow(constants[0]+constants[1], geq_func(constants[2], constants[3])) + computed_constants[102] = pow(constants[0], geq_func(constants[1], constants[2])) + computed_constants[103] = pow(constants[0]-constants[1], geq_func(constants[2], constants[3])) + computed_constants[104] = pow(-constants[0], geq_func(constants[1], constants[2])) + computed_constants[105] = pow(constants[0]*constants[1], geq_func(constants[2], constants[3])) + computed_constants[106] = pow(constants[0]/constants[1], geq_func(constants[2], constants[3])) + computed_constants[107] = pow(leq_func(constants[0], constants[1]), constants[2]+constants[3]) + computed_constants[108] = pow(leq_func(constants[0], constants[1]), constants[2]) + computed_constants[109] = pow(leq_func(constants[0], constants[1]), constants[2]-constants[3]) + computed_constants[110] = pow(leq_func(constants[0], constants[1]), -constants[2]) + computed_constants[111] = pow(leq_func(constants[0], constants[1]), constants[2]*constants[3]) + computed_constants[112] = pow(leq_func(constants[0], constants[1]), constants[2]/constants[3]) + computed_constants[113] = pow(leq_func(constants[0], constants[1]), pow(constants[2], constants[3])) + computed_constants[114] = pow(leq_func(constants[0], constants[1]), pow(constants[2], 1.0/constants[3])) + computed_constants[115] = sqrt(constants[0]) + computed_constants[116] = sqrt(constants[0]) + computed_constants[117] = pow(constants[0], 1.0/3.0) + computed_constants[118] = pow(constants[0], 1.0/constants[1]) + computed_constants[119] = pow(lt_func(constants[0], constants[1]), 1.0/gt_func(constants[3], constants[2])) + computed_constants[120] = pow(constants[0]+constants[1], 1.0/gt_func(constants[3], constants[2])) + computed_constants[121] = pow(constants[0], 1.0/gt_func(constants[2], constants[1])) + computed_constants[122] = pow(constants[0]-constants[1], 1.0/gt_func(constants[3], constants[2])) + computed_constants[123] = pow(-constants[0], 1.0/gt_func(constants[2], constants[1])) + computed_constants[124] = pow(constants[0]*constants[1], 1.0/gt_func(constants[3], constants[2])) + computed_constants[125] = pow(constants[0]/constants[1], 1.0/gt_func(constants[3], constants[2])) + computed_constants[126] = pow(lt_func(constants[0], constants[1]), 1.0/(constants[2]+constants[3])) + computed_constants[127] = pow(lt_func(constants[0], constants[1]), 1.0/constants[2]) + computed_constants[128] = pow(lt_func(constants[0], constants[1]), 1.0/(constants[2]-constants[3])) + computed_constants[129] = pow(lt_func(constants[0], constants[1]), 1.0/-constants[2]) + computed_constants[130] = pow(lt_func(constants[0], constants[1]), 1.0/(constants[2]*constants[3])) + computed_constants[131] = pow(lt_func(constants[0], constants[1]), 1.0/(constants[2]/constants[3])) + computed_constants[132] = pow(lt_func(constants[0], constants[1]), 1.0/pow(constants[2], constants[3])) + computed_constants[133] = pow(lt_func(constants[0], constants[1]), 1.0/pow(constants[2], 1.0/constants[3])) + computed_constants[134] = fabs(constants[0]) + computed_constants[135] = exp(constants[0]) + computed_constants[136] = log(constants[0]) + computed_constants[137] = log10(constants[0]) + computed_constants[138] = log(constants[0])/log(2.0) + computed_constants[139] = log10(constants[0]) + computed_constants[140] = log(constants[0])/log(constants[1]) + computed_constants[141] = ceil(constants[0]) + computed_constants[142] = floor(constants[0]) + computed_constants[143] = min(constants[0], constants[1]) + computed_constants[144] = min(constants[0], min(constants[1], constants[2])) + computed_constants[145] = max(constants[0], constants[1]) + computed_constants[146] = max(constants[0], max(constants[1], constants[2])) + computed_constants[147] = fmod(constants[0], constants[1]) + computed_constants[148] = sin(constants[0]) + computed_constants[149] = cos(constants[0]) + computed_constants[150] = tan(constants[0]) + computed_constants[151] = sec(constants[0]) + computed_constants[152] = csc(constants[0]) + computed_constants[153] = cot(constants[0]) + computed_constants[154] = sinh(constants[0]) + computed_constants[155] = cosh(constants[0]) + computed_constants[156] = tanh(constants[0]) + computed_constants[157] = sech(constants[0]) + computed_constants[158] = csch(constants[0]) + computed_constants[159] = coth(constants[0]) + computed_constants[160] = asin(constants[0]) + computed_constants[161] = acos(constants[0]) + computed_constants[162] = atan(constants[0]) + computed_constants[163] = asec(constants[0]) + computed_constants[164] = acsc(constants[0]) + computed_constants[165] = acot(constants[0]) + computed_constants[166] = asinh(constants[0]) + computed_constants[167] = acosh(constants[0]) + computed_constants[168] = atanh(constants[0]/2.0) + computed_constants[169] = asech(constants[0]) + computed_constants[170] = acsch(constants[0]) + computed_constants[171] = acoth(2.0*constants[0]) + computed_constants[172] = constants[0] if gt_func(constants[0], constants[1]) else nan + computed_constants[173] = constants[0] if gt_func(constants[0], constants[1]) else constants[2] + computed_constants[174] = constants[0] if gt_func(constants[0], constants[1]) else constants[2] if gt_func(constants[2], constants[3]) else constants[4] if gt_func(constants[4], constants[5]) else nan + computed_constants[175] = constants[0] if gt_func(constants[0], constants[1]) else constants[2] if gt_func(constants[2], constants[3]) else constants[4] if gt_func(constants[4], constants[5]) else constants[6] + computed_constants[176] = 123.0+(constants[0] if gt_func(constants[0], constants[1]) else nan) + computed_constants[181] = constants[0] + computed_constants[188] = and_func(constants[0], constants[1])+(constants[1] if gt_func(constants[2], constants[3]) else nan)+constants[4]+and_func(constants[5], constants[6]) + computed_constants[189] = and_func(constants[0], constants[1])-((constants[1] if gt_func(constants[2], constants[3]) else nan)-(constants[4]-(constants[1] if gt_func(constants[2], constants[3]) else nan)))-and_func(constants[5], constants[6]) + computed_constants[190] = and_func(constants[0], constants[1])*(constants[1] if gt_func(constants[2], constants[3]) else nan)*constants[4]*(constants[1] if gt_func(constants[2], constants[3]) else nan)*and_func(constants[5], constants[6]) + computed_constants[191] = and_func(constants[0], constants[1])/((constants[1] if gt_func(constants[2], constants[3]) else nan)/(constants[4]/(constants[1] if gt_func(constants[2], constants[3]) else nan))) + computed_constants[192] = and_func(or_func(constants[0], constants[1]), and_func(xor_func(constants[0], constants[1]), and_func(constants[1] if gt_func(constants[2], constants[3]) else nan, and_func(and_func(and_func(constants[4], constants[1] if gt_func(constants[2], constants[3]) else nan), xor_func(constants[0], constants[1])), or_func(constants[0], constants[1]))))) + computed_constants[193] = or_func(and_func(constants[0], constants[1]), or_func(xor_func(constants[0], constants[1]), or_func(constants[1] if gt_func(constants[2], constants[3]) else nan, or_func(or_func(or_func(constants[4], constants[1] if gt_func(constants[2], constants[3]) else nan), xor_func(constants[0], constants[1])), and_func(constants[0], constants[1]))))) + computed_constants[194] = xor_func(and_func(constants[0], constants[1]), xor_func(or_func(constants[0], constants[1]), xor_func(constants[1] if gt_func(constants[2], constants[3]) else nan, xor_func(xor_func(xor_func(constants[4], constants[1] if gt_func(constants[2], constants[3]) else nan), or_func(constants[0], constants[1])), and_func(constants[0], constants[1]))))) + computed_constants[195] = pow(and_func(constants[0], constants[1]), pow(constants[1] if gt_func(constants[2], constants[3]) else nan, pow(pow(constants[4], constants[1] if gt_func(constants[2], constants[3]) else nan), and_func(constants[0], constants[1])))) + computed_constants[196] = pow(pow(pow(and_func(constants[0], constants[1]), 1.0/pow(constants[1] if gt_func(constants[2], constants[3]) else nan, 1.0/constants[4])), 1.0/(constants[1] if gt_func(constants[2], constants[3]) else nan)), 1.0/and_func(constants[0], constants[1])) + computed_constants[197] = -and_func(constants[0], constants[1])+-(constants[1] if gt_func(constants[2], constants[3]) else nan) def compute_rates(voi, states, rates, constants, computed_constants, algebraic): diff --git a/tests/resources/coverage/generator/model.out b/tests/resources/coverage/generator/model.out index f35ae16224..97c8f00378 100644 --- a/tests/resources/coverage/generator/model.out +++ b/tests/resources/coverage/generator/model.out @@ -95,11 +95,11 @@ void objectiveFunction0(double *u, double *f, void *data) double *rates = ((RootFindingInfo *) data)->rates; double *variables = ((RootFindingInfo *) data)->variables; - algebraic[205] = u[0]; - algebraic[206] = u[1]; + algebraic[0] = u[0]; + algebraic[1] = u[1]; - f[0] = algebraic[205]+algebraic[206]+states[0]-0.0; - f[1] = algebraic[205]-algebraic[206]-(computedConstants[207]+computedConstants[208]); + f[0] = algebraic[0]+algebraic[1]+states[0]-0.0; + f[1] = algebraic[0]-algebraic[1]-(computedConstants[198]+computedConstants[199]); } void findRoot0(double voi, double *states, double *rates, double *variables) @@ -107,231 +107,231 @@ void findRoot0(double voi, double *states, double *rates, double *variables) RootFindingInfo rfi = { voi, states, rates, variables }; double u[2]; - u[0] = algebraic[205]; - u[1] = algebraic[206]; + u[0] = algebraic[0]; + u[1] = algebraic[1]; nlaSolve(objectiveFunction0, u, 2, &rfi); - algebraic[205] = u[0]; - algebraic[206] = u[1]; + algebraic[0] = u[0]; + algebraic[1] = u[1]; } void initialiseVariables(double *states, double *rates, double *constants) { - constants[1] = 1.0; - constants[2] = 2.0; - constants[6] = 3.0; - constants[18] = 4.0; - constants[179] = 5.0; - constants[180] = 6.0; - constants[182] = 7.0; - algebraic[205] = 1.0; - algebraic[206] = 2.0; - computedConstants[184] = 123.0; - computedConstants[185] = 123.456789; - computedConstants[186] = 123.0e99; - computedConstants[187] = 123.456789e99; - computedConstants[189] = 1.0; - computedConstants[190] = 0.0; - computedConstants[191] = 2.71828182845905; - computedConstants[192] = 3.14159265358979; - computedConstants[193] = INFINITY; - computedConstants[194] = NAN; - computedConstants[207] = 1.0; - computedConstants[208] = 3.0; + constants[0] = 1.0; + constants[1] = 2.0; + constants[2] = 3.0; + constants[3] = 4.0; + constants[4] = 5.0; + constants[5] = 6.0; + constants[6] = 7.0; + algebraic[0] = 1.0; + algebraic[1] = 2.0; + computedConstants[177] = 123.0; + computedConstants[178] = 123.456789; + computedConstants[179] = 123.0e99; + computedConstants[180] = 123.456789e99; + computedConstants[182] = 1.0; + computedConstants[183] = 0.0; + computedConstants[184] = 2.71828182845905; + computedConstants[185] = 3.14159265358979; + computedConstants[186] = INFINITY; + computedConstants[187] = NAN; + computedConstants[198] = 1.0; + computedConstants[199] = 3.0; states[0] = 0.0; } void computeComputedConstants(double *constants, double *computedConstants) { - computedConstants[0] = constants[1] == constants[2]; - computedConstants[3] = constants[1]/(constants[2] == constants[2]); - computedConstants[4] = constants[1] != constants[2]; - computedConstants[5] = constants[1]/(constants[2] != constants[6]); - computedConstants[7] = constants[1] < constants[2]; - computedConstants[8] = constants[1]/(constants[2] < constants[6]); - computedConstants[9] = constants[1] <= constants[2]; - computedConstants[10] = constants[1]/(constants[2] <= constants[6]); - computedConstants[11] = constants[1] > constants[2]; - computedConstants[12] = constants[1]/(constants[2] > constants[6]); - computedConstants[13] = constants[1] >= constants[2]; - computedConstants[14] = constants[1]/(constants[2] >= constants[6]); - computedConstants[15] = constants[1] && constants[2]; - computedConstants[16] = constants[1] && constants[2] && constants[6]; - computedConstants[17] = (constants[1] < constants[2]) && (constants[6] > constants[18]); - computedConstants[19] = (constants[1]+constants[2]) && (constants[6] > constants[18]); - computedConstants[20] = constants[1] && (constants[2] > constants[6]); - computedConstants[21] = (constants[1]-constants[2]) && (constants[6] > constants[18]); - computedConstants[22] = -constants[1] && (constants[2] > constants[6]); - computedConstants[23] = (constants[1]^^constants[2]) && (constants[6] > constants[18]); - computedConstants[24] = (constants[1]^^(1.0/constants[2])) && (constants[6] > constants[18]); - computedConstants[25] = (constants[1] < constants[2]) && (constants[6]+constants[18]); - computedConstants[26] = (constants[1] < constants[2]) && constants[6]; - computedConstants[27] = (constants[1] < constants[2]) && (constants[6]-constants[18]); - computedConstants[28] = (constants[1] < constants[2]) && -constants[6]; - computedConstants[29] = (constants[1] < constants[2]) && (constants[6]^^constants[18]); - computedConstants[30] = (constants[1] < constants[2]) && (constants[6]^^(1.0/constants[18])); - computedConstants[31] = constants[1]/(constants[2] && constants[6]); - computedConstants[32] = constants[1] || constants[2]; - computedConstants[33] = constants[1] || constants[2] || constants[6]; - computedConstants[34] = (constants[1] < constants[2]) || (constants[6] > constants[18]); - computedConstants[35] = (constants[1]+constants[2]) || (constants[6] > constants[18]); - computedConstants[36] = constants[1] || (constants[2] > constants[6]); - computedConstants[37] = (constants[1]-constants[2]) || (constants[6] > constants[18]); - computedConstants[38] = -constants[1] || (constants[2] > constants[6]); - computedConstants[39] = (constants[1]^^constants[2]) || (constants[6] > constants[18]); - computedConstants[40] = (constants[1]^^(1.0/constants[2])) || (constants[6] > constants[18]); - computedConstants[41] = (constants[1] < constants[2]) || (constants[6]+constants[18]); - computedConstants[42] = (constants[1] < constants[2]) || constants[6]; - computedConstants[43] = (constants[1] < constants[2]) || (constants[6]-constants[18]); - computedConstants[44] = (constants[1] < constants[2]) || -constants[6]; - computedConstants[45] = (constants[1] < constants[2]) || (constants[6]^^constants[18]); - computedConstants[46] = (constants[1] < constants[2]) || (constants[6]^^(1.0/constants[18])); - computedConstants[47] = constants[1]/(constants[2] || constants[6]); - computedConstants[48] = constants[1]^constants[2]; - computedConstants[49] = constants[1]^constants[2]^constants[6]; - computedConstants[50] = (constants[1] < constants[2])^(constants[6] > constants[18]); - computedConstants[51] = (constants[1]+constants[2])^(constants[6] > constants[18]); - computedConstants[52] = constants[1]^(constants[2] > constants[6]); - computedConstants[53] = (constants[1]-constants[2])^(constants[6] > constants[18]); - computedConstants[54] = -constants[1]^(constants[2] > constants[6]); - computedConstants[55] = (constants[1]^^constants[2])^(constants[6] > constants[18]); - computedConstants[56] = (constants[1]^^(1.0/constants[2]))^(constants[6] > constants[18]); - computedConstants[57] = (constants[1] < constants[2])^(constants[6]+constants[18]); - computedConstants[58] = (constants[1] < constants[2])^constants[6]; - computedConstants[59] = (constants[1] < constants[2])^(constants[6]-constants[18]); - computedConstants[60] = (constants[1] < constants[2])^-constants[6]; - computedConstants[61] = (constants[1] < constants[2])^(constants[6]^^constants[18]); - computedConstants[62] = (constants[1] < constants[2])^(constants[6]^^(1.0/constants[18])); - computedConstants[63] = constants[1]/(constants[2]^constants[6]); - computedConstants[64] = !constants[1]; - computedConstants[65] = constants[1]+constants[2]; - computedConstants[66] = constants[1]+constants[2]+constants[6]; - computedConstants[67] = (constants[1] < constants[2])+(constants[6] > constants[18]); - computedConstants[68] = constants[1]; - computedConstants[69] = constants[1]-constants[2]; - computedConstants[70] = (constants[1] < constants[2])-(constants[6] > constants[18]); - computedConstants[71] = (constants[1] < constants[2])-(constants[6]+constants[18]); - computedConstants[72] = (constants[1] < constants[2])-constants[6]; - computedConstants[73] = constants[1]-(-constants[2]); - computedConstants[74] = constants[1]-(-constants[2]*constants[6]); - computedConstants[75] = -constants[1]; - computedConstants[76] = -(constants[1] < constants[2]); - computedConstants[77] = constants[1]*constants[2]; - computedConstants[78] = constants[1]*constants[2]*constants[6]; - computedConstants[79] = (constants[1] < constants[2])*(constants[6] > constants[18]); - computedConstants[80] = (constants[1]+constants[2])*(constants[6] > constants[18]); - computedConstants[81] = constants[1]*(constants[2] > constants[6]); - computedConstants[82] = (constants[1]-constants[2])*(constants[6] > constants[18]); - computedConstants[83] = -constants[1]*(constants[2] > constants[6]); - computedConstants[84] = (constants[1] < constants[2])*(constants[6]+constants[18]); - computedConstants[85] = (constants[1] < constants[2])*constants[6]; - computedConstants[86] = (constants[1] < constants[2])*(constants[6]-constants[18]); - computedConstants[87] = (constants[1] < constants[2])*-constants[6]; - computedConstants[88] = constants[1]/constants[2]; - computedConstants[89] = (constants[1] < constants[2])/(constants[18] > constants[6]); - computedConstants[90] = (constants[1]+constants[2])/(constants[18] > constants[6]); - computedConstants[91] = constants[1]/(constants[6] > constants[2]); - computedConstants[92] = (constants[1]-constants[2])/(constants[18] > constants[6]); - computedConstants[93] = -constants[1]/(constants[6] > constants[2]); - computedConstants[94] = (constants[1] < constants[2])/(constants[6]+constants[18]); - computedConstants[95] = (constants[1] < constants[2])/constants[6]; - computedConstants[96] = (constants[1] < constants[2])/(constants[6]-constants[18]); - computedConstants[97] = (constants[1] < constants[2])/-constants[6]; - computedConstants[98] = (constants[1] < constants[2])/(constants[6]*constants[18]); - computedConstants[99] = (constants[1] < constants[2])/(constants[6]/constants[18]); - computedConstants[100] = sqrt(constants[1]); - computedConstants[101] = sqr(constants[1]); - computedConstants[102] = constants[1]^^3.0; - computedConstants[103] = constants[1]^^constants[2]; - computedConstants[104] = (constants[1] <= constants[2])^^(constants[6] >= constants[18]); - computedConstants[105] = (constants[1]+constants[2])^^(constants[6] >= constants[18]); - computedConstants[106] = constants[1]^^(constants[2] >= constants[6]); - computedConstants[107] = (constants[1]-constants[2])^^(constants[6] >= constants[18]); - computedConstants[108] = (-constants[1])^^(constants[2] >= constants[6]); - computedConstants[109] = (constants[1]*constants[2])^^(constants[6] >= constants[18]); - computedConstants[110] = (constants[1]/constants[2])^^(constants[6] >= constants[18]); - computedConstants[111] = (constants[1] <= constants[2])^^(constants[6]+constants[18]); - computedConstants[112] = (constants[1] <= constants[2])^^constants[6]; - computedConstants[113] = (constants[1] <= constants[2])^^constants[6]-constants[18]; - computedConstants[114] = (constants[1] <= constants[2])^^-constants[6]; - computedConstants[115] = (constants[1] <= constants[2])^^(constants[6]*constants[18]); - computedConstants[116] = (constants[1] <= constants[2])^^(constants[6]/constants[18]); - computedConstants[117] = (constants[1] <= constants[2])^^(constants[6]^^constants[18]); - computedConstants[118] = (constants[1] <= constants[2])^^(constants[6]^^(1.0/constants[18])); - computedConstants[119] = sqrt(constants[1]); - computedConstants[120] = sqrt(constants[1]); - computedConstants[121] = constants[1]^^(1.0/3.0); - computedConstants[122] = constants[1]^^(1.0/constants[2]); - computedConstants[123] = (constants[1] < constants[2])^^(1.0/(constants[18] > constants[6])); - computedConstants[124] = (constants[1]+constants[2])^^(1.0/(constants[18] > constants[6])); - computedConstants[125] = constants[1]^^(1.0/(constants[6] > constants[2])); - computedConstants[126] = (constants[1]-constants[2])^^(1.0/(constants[18] > constants[6])); - computedConstants[127] = (-constants[1])^^(1.0/(constants[6] > constants[2])); - computedConstants[128] = (constants[1]*constants[2])^^(1.0/(constants[18] > constants[6])); - computedConstants[129] = (constants[1]/constants[2])^^(1.0/(constants[18] > constants[6])); - computedConstants[130] = (constants[1] < constants[2])^^(1.0/(constants[6]+constants[18])); - computedConstants[131] = (constants[1] < constants[2])^^(1.0/constants[6]); - computedConstants[132] = (constants[1] < constants[2])^^(1.0/(constants[6]-constants[18])); - computedConstants[133] = (constants[1] < constants[2])^^(1.0/(-constants[6])); - computedConstants[134] = (constants[1] < constants[2])^^(1.0/(constants[6]*constants[18])); - computedConstants[135] = (constants[1] < constants[2])^^(1.0/(constants[6]/constants[18])); - computedConstants[136] = (constants[1] < constants[2])^^(1.0/(constants[6]^^constants[18])); - computedConstants[137] = (constants[1] < constants[2])^^(1.0/(constants[6]^^(1.0/constants[18]))); - computedConstants[138] = fabs(constants[1]); - computedConstants[139] = exp(constants[1]); - computedConstants[140] = log(constants[1]); - computedConstants[141] = log10(constants[1]); - computedConstants[142] = log(constants[1])/log(2.0); - computedConstants[143] = log10(constants[1]); - computedConstants[144] = log(constants[1])/log(constants[2]); - computedConstants[145] = ceil(constants[1]); - computedConstants[146] = floor(constants[1]); - computedConstants[147] = min(constants[1], constants[2]); - computedConstants[148] = min(constants[1], min(constants[2], constants[6])); - computedConstants[149] = max(constants[1], constants[2]); - computedConstants[150] = max(constants[1], max(constants[2], constants[6])); - computedConstants[151] = fmod(constants[1], constants[2]); - computedConstants[152] = sin(constants[1]); - computedConstants[153] = cos(constants[1]); - computedConstants[154] = tan(constants[1]); - computedConstants[155] = sec(constants[1]); - computedConstants[156] = csc(constants[1]); - computedConstants[157] = cot(constants[1]); - computedConstants[158] = sinh(constants[1]); - computedConstants[159] = cosh(constants[1]); - computedConstants[160] = tanh(constants[1]); - computedConstants[161] = sech(constants[1]); - computedConstants[162] = csch(constants[1]); - computedConstants[163] = coth(constants[1]); - computedConstants[164] = asin(constants[1]); - computedConstants[165] = acos(constants[1]); - computedConstants[166] = atan(constants[1]); - computedConstants[167] = asec(constants[1]); - computedConstants[168] = acsc(constants[1]); - computedConstants[169] = acot(constants[1]); - computedConstants[170] = asinh(constants[1]); - computedConstants[171] = acosh(constants[1]); - computedConstants[172] = atanh(constants[1]/2.0); - computedConstants[173] = asech(constants[1]); - computedConstants[174] = acsch(constants[1]); - computedConstants[175] = acoth(2.0*constants[1]); - computedConstants[176] = piecewise(constants[1] > constants[2], constants[1], NAN); - computedConstants[177] = piecewise(constants[1] > constants[2], constants[1], constants[6]); - computedConstants[178] = piecewise(constants[1] > constants[2], constants[1], piecewise(constants[6] > constants[18], constants[6], piecewise(constants[179] > constants[180], constants[179], NAN))); - computedConstants[181] = piecewise(constants[1] > constants[2], constants[1], piecewise(constants[6] > constants[18], constants[6], piecewise(constants[179] > constants[180], constants[179], constants[182]))); - computedConstants[183] = 123.0+piecewise(constants[1] > constants[2], constants[1], NAN); - computedConstants[188] = constants[1]; - computedConstants[195] = (constants[1] && constants[2])+piecewise(constants[6] > constants[18], constants[2], NAN)+constants[179]+(constants[180] && constants[182]); - computedConstants[196] = (constants[1] && constants[2])-(piecewise(constants[6] > constants[18], constants[2], NAN)-(constants[179]-piecewise(constants[6] > constants[18], constants[2], NAN)))-(constants[180] && constants[182]); - computedConstants[197] = (constants[1] && constants[2])*piecewise(constants[6] > constants[18], constants[2], NAN)*constants[179]*piecewise(constants[6] > constants[18], constants[2], NAN)*(constants[180] && constants[182]); - computedConstants[198] = (constants[1] && constants[2])/(piecewise(constants[6] > constants[18], constants[2], NAN)/(constants[179]/piecewise(constants[6] > constants[18], constants[2], NAN))); - computedConstants[199] = (constants[1] || constants[2]) && (constants[1]^constants[2]) && piecewise(constants[6] > constants[18], constants[2], NAN) && constants[179] && piecewise(constants[6] > constants[18], constants[2], NAN) && (constants[1]^constants[2]) && (constants[1] || constants[2]); - computedConstants[200] = (constants[1] && constants[2]) || (constants[1]^constants[2]) || piecewise(constants[6] > constants[18], constants[2], NAN) || constants[179] || piecewise(constants[6] > constants[18], constants[2], NAN) || (constants[1]^constants[2]) || (constants[1] && constants[2]); - computedConstants[201] = (constants[1] && constants[2])^(constants[1] || constants[2])^piecewise(constants[6] > constants[18], constants[2], NAN)^constants[179]^piecewise(constants[6] > constants[18], constants[2], NAN)^(constants[1] || constants[2])^(constants[1] && constants[2]); - computedConstants[202] = (constants[1] && constants[2])^^(piecewise(constants[6] > constants[18], constants[2], NAN)^^(constants[179]^^piecewise(constants[6] > constants[18], constants[2], NAN)^^(constants[1] && constants[2]))); - computedConstants[203] = (constants[1] && constants[2])^^(1.0/(piecewise(constants[6] > constants[18], constants[2], NAN)^^(1.0/constants[179])))^^(1.0/piecewise(constants[6] > constants[18], constants[2], NAN))^^(1.0/(constants[1] && constants[2])); - computedConstants[204] = -(constants[1] && constants[2])+-piecewise(constants[6] > constants[18], constants[2], NAN); + computedConstants[0] = constants[0] == constants[1]; + computedConstants[1] = constants[0]/(constants[1] == constants[1]); + computedConstants[2] = constants[0] != constants[1]; + computedConstants[3] = constants[0]/(constants[1] != constants[2]); + computedConstants[4] = constants[0] < constants[1]; + computedConstants[5] = constants[0]/(constants[1] < constants[2]); + computedConstants[6] = constants[0] <= constants[1]; + computedConstants[7] = constants[0]/(constants[1] <= constants[2]); + computedConstants[8] = constants[0] > constants[1]; + computedConstants[9] = constants[0]/(constants[1] > constants[2]); + computedConstants[10] = constants[0] >= constants[1]; + computedConstants[11] = constants[0]/(constants[1] >= constants[2]); + computedConstants[12] = constants[0] && constants[1]; + computedConstants[13] = constants[0] && constants[1] && constants[2]; + computedConstants[14] = (constants[0] < constants[1]) && (constants[2] > constants[3]); + computedConstants[15] = (constants[0]+constants[1]) && (constants[2] > constants[3]); + computedConstants[16] = constants[0] && (constants[1] > constants[2]); + computedConstants[17] = (constants[0]-constants[1]) && (constants[2] > constants[3]); + computedConstants[18] = -constants[0] && (constants[1] > constants[2]); + computedConstants[19] = (constants[0]^^constants[1]) && (constants[2] > constants[3]); + computedConstants[20] = (constants[0]^^(1.0/constants[1])) && (constants[2] > constants[3]); + computedConstants[21] = (constants[0] < constants[1]) && (constants[2]+constants[3]); + computedConstants[22] = (constants[0] < constants[1]) && constants[2]; + computedConstants[23] = (constants[0] < constants[1]) && (constants[2]-constants[3]); + computedConstants[24] = (constants[0] < constants[1]) && -constants[2]; + computedConstants[25] = (constants[0] < constants[1]) && (constants[2]^^constants[3]); + computedConstants[26] = (constants[0] < constants[1]) && (constants[2]^^(1.0/constants[3])); + computedConstants[27] = constants[0]/(constants[1] && constants[2]); + computedConstants[28] = constants[0] || constants[1]; + computedConstants[29] = constants[0] || constants[1] || constants[2]; + computedConstants[30] = (constants[0] < constants[1]) || (constants[2] > constants[3]); + computedConstants[31] = (constants[0]+constants[1]) || (constants[2] > constants[3]); + computedConstants[32] = constants[0] || (constants[1] > constants[2]); + computedConstants[33] = (constants[0]-constants[1]) || (constants[2] > constants[3]); + computedConstants[34] = -constants[0] || (constants[1] > constants[2]); + computedConstants[35] = (constants[0]^^constants[1]) || (constants[2] > constants[3]); + computedConstants[36] = (constants[0]^^(1.0/constants[1])) || (constants[2] > constants[3]); + computedConstants[37] = (constants[0] < constants[1]) || (constants[2]+constants[3]); + computedConstants[38] = (constants[0] < constants[1]) || constants[2]; + computedConstants[39] = (constants[0] < constants[1]) || (constants[2]-constants[3]); + computedConstants[40] = (constants[0] < constants[1]) || -constants[2]; + computedConstants[41] = (constants[0] < constants[1]) || (constants[2]^^constants[3]); + computedConstants[42] = (constants[0] < constants[1]) || (constants[2]^^(1.0/constants[3])); + computedConstants[43] = constants[0]/(constants[1] || constants[2]); + computedConstants[44] = constants[0]^constants[1]; + computedConstants[45] = constants[0]^constants[1]^constants[2]; + computedConstants[46] = (constants[0] < constants[1])^(constants[2] > constants[3]); + computedConstants[47] = (constants[0]+constants[1])^(constants[2] > constants[3]); + computedConstants[48] = constants[0]^(constants[1] > constants[2]); + computedConstants[49] = (constants[0]-constants[1])^(constants[2] > constants[3]); + computedConstants[50] = -constants[0]^(constants[1] > constants[2]); + computedConstants[51] = (constants[0]^^constants[1])^(constants[2] > constants[3]); + computedConstants[52] = (constants[0]^^(1.0/constants[1]))^(constants[2] > constants[3]); + computedConstants[53] = (constants[0] < constants[1])^(constants[2]+constants[3]); + computedConstants[54] = (constants[0] < constants[1])^constants[2]; + computedConstants[55] = (constants[0] < constants[1])^(constants[2]-constants[3]); + computedConstants[56] = (constants[0] < constants[1])^-constants[2]; + computedConstants[57] = (constants[0] < constants[1])^(constants[2]^^constants[3]); + computedConstants[58] = (constants[0] < constants[1])^(constants[2]^^(1.0/constants[3])); + computedConstants[59] = constants[0]/(constants[1]^constants[2]); + computedConstants[60] = !constants[0]; + computedConstants[61] = constants[0]+constants[1]; + computedConstants[62] = constants[0]+constants[1]+constants[2]; + computedConstants[63] = (constants[0] < constants[1])+(constants[2] > constants[3]); + computedConstants[64] = constants[0]; + computedConstants[65] = constants[0]-constants[1]; + computedConstants[66] = (constants[0] < constants[1])-(constants[2] > constants[3]); + computedConstants[67] = (constants[0] < constants[1])-(constants[2]+constants[3]); + computedConstants[68] = (constants[0] < constants[1])-constants[2]; + computedConstants[69] = constants[0]-(-constants[1]); + computedConstants[70] = constants[0]-(-constants[1]*constants[2]); + computedConstants[71] = -constants[0]; + computedConstants[72] = -(constants[0] < constants[1]); + computedConstants[73] = constants[0]*constants[1]; + computedConstants[74] = constants[0]*constants[1]*constants[2]; + computedConstants[75] = (constants[0] < constants[1])*(constants[2] > constants[3]); + computedConstants[76] = (constants[0]+constants[1])*(constants[2] > constants[3]); + computedConstants[77] = constants[0]*(constants[1] > constants[2]); + computedConstants[78] = (constants[0]-constants[1])*(constants[2] > constants[3]); + computedConstants[79] = -constants[0]*(constants[1] > constants[2]); + computedConstants[80] = (constants[0] < constants[1])*(constants[2]+constants[3]); + computedConstants[81] = (constants[0] < constants[1])*constants[2]; + computedConstants[82] = (constants[0] < constants[1])*(constants[2]-constants[3]); + computedConstants[83] = (constants[0] < constants[1])*-constants[2]; + computedConstants[84] = constants[0]/constants[1]; + computedConstants[85] = (constants[0] < constants[1])/(constants[3] > constants[2]); + computedConstants[86] = (constants[0]+constants[1])/(constants[3] > constants[2]); + computedConstants[87] = constants[0]/(constants[2] > constants[1]); + computedConstants[88] = (constants[0]-constants[1])/(constants[3] > constants[2]); + computedConstants[89] = -constants[0]/(constants[2] > constants[1]); + computedConstants[90] = (constants[0] < constants[1])/(constants[2]+constants[3]); + computedConstants[91] = (constants[0] < constants[1])/constants[2]; + computedConstants[92] = (constants[0] < constants[1])/(constants[2]-constants[3]); + computedConstants[93] = (constants[0] < constants[1])/-constants[2]; + computedConstants[94] = (constants[0] < constants[1])/(constants[2]*constants[3]); + computedConstants[95] = (constants[0] < constants[1])/(constants[2]/constants[3]); + computedConstants[96] = sqrt(constants[0]); + computedConstants[97] = sqr(constants[0]); + computedConstants[98] = constants[0]^^3.0; + computedConstants[99] = constants[0]^^constants[1]; + computedConstants[100] = (constants[0] <= constants[1])^^(constants[2] >= constants[3]); + computedConstants[101] = (constants[0]+constants[1])^^(constants[2] >= constants[3]); + computedConstants[102] = constants[0]^^(constants[1] >= constants[2]); + computedConstants[103] = (constants[0]-constants[1])^^(constants[2] >= constants[3]); + computedConstants[104] = (-constants[0])^^(constants[1] >= constants[2]); + computedConstants[105] = (constants[0]*constants[1])^^(constants[2] >= constants[3]); + computedConstants[106] = (constants[0]/constants[1])^^(constants[2] >= constants[3]); + computedConstants[107] = (constants[0] <= constants[1])^^(constants[2]+constants[3]); + computedConstants[108] = (constants[0] <= constants[1])^^constants[2]; + computedConstants[109] = (constants[0] <= constants[1])^^constants[2]-constants[3]; + computedConstants[110] = (constants[0] <= constants[1])^^-constants[2]; + computedConstants[111] = (constants[0] <= constants[1])^^(constants[2]*constants[3]); + computedConstants[112] = (constants[0] <= constants[1])^^(constants[2]/constants[3]); + computedConstants[113] = (constants[0] <= constants[1])^^(constants[2]^^constants[3]); + computedConstants[114] = (constants[0] <= constants[1])^^(constants[2]^^(1.0/constants[3])); + computedConstants[115] = sqrt(constants[0]); + computedConstants[116] = sqrt(constants[0]); + computedConstants[117] = constants[0]^^(1.0/3.0); + computedConstants[118] = constants[0]^^(1.0/constants[1]); + computedConstants[119] = (constants[0] < constants[1])^^(1.0/(constants[3] > constants[2])); + computedConstants[120] = (constants[0]+constants[1])^^(1.0/(constants[3] > constants[2])); + computedConstants[121] = constants[0]^^(1.0/(constants[2] > constants[1])); + computedConstants[122] = (constants[0]-constants[1])^^(1.0/(constants[3] > constants[2])); + computedConstants[123] = (-constants[0])^^(1.0/(constants[2] > constants[1])); + computedConstants[124] = (constants[0]*constants[1])^^(1.0/(constants[3] > constants[2])); + computedConstants[125] = (constants[0]/constants[1])^^(1.0/(constants[3] > constants[2])); + computedConstants[126] = (constants[0] < constants[1])^^(1.0/(constants[2]+constants[3])); + computedConstants[127] = (constants[0] < constants[1])^^(1.0/constants[2]); + computedConstants[128] = (constants[0] < constants[1])^^(1.0/(constants[2]-constants[3])); + computedConstants[129] = (constants[0] < constants[1])^^(1.0/(-constants[2])); + computedConstants[130] = (constants[0] < constants[1])^^(1.0/(constants[2]*constants[3])); + computedConstants[131] = (constants[0] < constants[1])^^(1.0/(constants[2]/constants[3])); + computedConstants[132] = (constants[0] < constants[1])^^(1.0/(constants[2]^^constants[3])); + computedConstants[133] = (constants[0] < constants[1])^^(1.0/(constants[2]^^(1.0/constants[3]))); + computedConstants[134] = fabs(constants[0]); + computedConstants[135] = exp(constants[0]); + computedConstants[136] = log(constants[0]); + computedConstants[137] = log10(constants[0]); + computedConstants[138] = log(constants[0])/log(2.0); + computedConstants[139] = log10(constants[0]); + computedConstants[140] = log(constants[0])/log(constants[1]); + computedConstants[141] = ceil(constants[0]); + computedConstants[142] = floor(constants[0]); + computedConstants[143] = min(constants[0], constants[1]); + computedConstants[144] = min(constants[0], min(constants[1], constants[2])); + computedConstants[145] = max(constants[0], constants[1]); + computedConstants[146] = max(constants[0], max(constants[1], constants[2])); + computedConstants[147] = fmod(constants[0], constants[1]); + computedConstants[148] = sin(constants[0]); + computedConstants[149] = cos(constants[0]); + computedConstants[150] = tan(constants[0]); + computedConstants[151] = sec(constants[0]); + computedConstants[152] = csc(constants[0]); + computedConstants[153] = cot(constants[0]); + computedConstants[154] = sinh(constants[0]); + computedConstants[155] = cosh(constants[0]); + computedConstants[156] = tanh(constants[0]); + computedConstants[157] = sech(constants[0]); + computedConstants[158] = csch(constants[0]); + computedConstants[159] = coth(constants[0]); + computedConstants[160] = asin(constants[0]); + computedConstants[161] = acos(constants[0]); + computedConstants[162] = atan(constants[0]); + computedConstants[163] = asec(constants[0]); + computedConstants[164] = acsc(constants[0]); + computedConstants[165] = acot(constants[0]); + computedConstants[166] = asinh(constants[0]); + computedConstants[167] = acosh(constants[0]); + computedConstants[168] = atanh(constants[0]/2.0); + computedConstants[169] = asech(constants[0]); + computedConstants[170] = acsch(constants[0]); + computedConstants[171] = acoth(2.0*constants[0]); + computedConstants[172] = piecewise(constants[0] > constants[1], constants[0], NAN); + computedConstants[173] = piecewise(constants[0] > constants[1], constants[0], constants[2]); + computedConstants[174] = piecewise(constants[0] > constants[1], constants[0], piecewise(constants[2] > constants[3], constants[2], piecewise(constants[4] > constants[5], constants[4], NAN))); + computedConstants[175] = piecewise(constants[0] > constants[1], constants[0], piecewise(constants[2] > constants[3], constants[2], piecewise(constants[4] > constants[5], constants[4], constants[6]))); + computedConstants[176] = 123.0+piecewise(constants[0] > constants[1], constants[0], NAN); + computedConstants[181] = constants[0]; + computedConstants[188] = (constants[0] && constants[1])+piecewise(constants[2] > constants[3], constants[1], NAN)+constants[4]+(constants[5] && constants[6]); + computedConstants[189] = (constants[0] && constants[1])-(piecewise(constants[2] > constants[3], constants[1], NAN)-(constants[4]-piecewise(constants[2] > constants[3], constants[1], NAN)))-(constants[5] && constants[6]); + computedConstants[190] = (constants[0] && constants[1])*piecewise(constants[2] > constants[3], constants[1], NAN)*constants[4]*piecewise(constants[2] > constants[3], constants[1], NAN)*(constants[5] && constants[6]); + computedConstants[191] = (constants[0] && constants[1])/(piecewise(constants[2] > constants[3], constants[1], NAN)/(constants[4]/piecewise(constants[2] > constants[3], constants[1], NAN))); + computedConstants[192] = (constants[0] || constants[1]) && (constants[0]^constants[1]) && piecewise(constants[2] > constants[3], constants[1], NAN) && constants[4] && piecewise(constants[2] > constants[3], constants[1], NAN) && (constants[0]^constants[1]) && (constants[0] || constants[1]); + computedConstants[193] = (constants[0] && constants[1]) || (constants[0]^constants[1]) || piecewise(constants[2] > constants[3], constants[1], NAN) || constants[4] || piecewise(constants[2] > constants[3], constants[1], NAN) || (constants[0]^constants[1]) || (constants[0] && constants[1]); + computedConstants[194] = (constants[0] && constants[1])^(constants[0] || constants[1])^piecewise(constants[2] > constants[3], constants[1], NAN)^constants[4]^piecewise(constants[2] > constants[3], constants[1], NAN)^(constants[0] || constants[1])^(constants[0] && constants[1]); + computedConstants[195] = (constants[0] && constants[1])^^(piecewise(constants[2] > constants[3], constants[1], NAN)^^(constants[4]^^piecewise(constants[2] > constants[3], constants[1], NAN)^^(constants[0] && constants[1]))); + computedConstants[196] = (constants[0] && constants[1])^^(1.0/(piecewise(constants[2] > constants[3], constants[1], NAN)^^(1.0/constants[4])))^^(1.0/piecewise(constants[2] > constants[3], constants[1], NAN))^^(1.0/(constants[0] && constants[1])); + computedConstants[197] = -(constants[0] && constants[1])+-piecewise(constants[2] > constants[3], constants[1], NAN); } void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic) diff --git a/tests/resources/coverage/generator/model.py b/tests/resources/coverage/generator/model.py index acbe541a58..b945c4eb06 100644 --- a/tests/resources/coverage/generator/model.py +++ b/tests/resources/coverage/generator/model.py @@ -359,239 +359,239 @@ def objective_function_0(u, f, data): rates = data[2] variables = data[3] - algebraic[205] = u[0] - algebraic[206] = u[1] + algebraic[0] = u[0] + algebraic[1] = u[1] - f[0] = algebraic[205]+algebraic[206]+states[0]-0.0 - f[1] = algebraic[205]-algebraic[206]-(computed_constants[207]+computed_constants[208]) + f[0] = algebraic[0]+algebraic[1]+states[0]-0.0 + f[1] = algebraic[0]-algebraic[1]-(computed_constants[198]+computed_constants[199]) def find_root_0(voi, states, rates, variables): u = [nan]*2 - u[0] = algebraic[205] - u[1] = algebraic[206] + u[0] = algebraic[0] + u[1] = algebraic[1] u = nla_solve(objective_function_0, u, 2, [voi, states, rates, variables]) - algebraic[205] = u[0] - algebraic[206] = u[1] + algebraic[0] = u[0] + algebraic[1] = u[1] def initialise_variables(states, rates, constants): - constants[1] = 1.0 - constants[2] = 2.0 - constants[6] = 3.0 - constants[18] = 4.0 - constants[179] = 5.0 - constants[180] = 6.0 - constants[182] = 7.0 - algebraic[205] = 1.0 - algebraic[206] = 2.0 - computed_constants[184] = 123.0 - computed_constants[185] = 123.456789 - computed_constants[186] = 123.0e99 - computed_constants[187] = 123.456789e99 - computed_constants[189] = 1.0 - computed_constants[190] = 0.0 - computed_constants[191] = 2.71828182845905 - computed_constants[192] = 3.14159265358979 - computed_constants[193] = inf - computed_constants[194] = nan - computed_constants[207] = 1.0 - computed_constants[208] = 3.0 + constants[0] = 1.0 + constants[1] = 2.0 + constants[2] = 3.0 + constants[3] = 4.0 + constants[4] = 5.0 + constants[5] = 6.0 + constants[6] = 7.0 + algebraic[0] = 1.0 + algebraic[1] = 2.0 + computed_constants[177] = 123.0 + computed_constants[178] = 123.456789 + computed_constants[179] = 123.0e99 + computed_constants[180] = 123.456789e99 + computed_constants[182] = 1.0 + computed_constants[183] = 0.0 + computed_constants[184] = 2.71828182845905 + computed_constants[185] = 3.14159265358979 + computed_constants[186] = inf + computed_constants[187] = nan + computed_constants[198] = 1.0 + computed_constants[199] = 3.0 states[0] = 0.0 def compute_computed_constants(constants, computed_constants): - computed_constants[0] = eq_func(constants[1], constants[2]) - computed_constants[3] = constants[1]/eq_func(constants[2], constants[2]) - computed_constants[4] = neq_func(constants[1], constants[2]) - computed_constants[5] = constants[1]/neq_func(constants[2], constants[6]) - computed_constants[7] = lt_func(constants[1], constants[2]) - computed_constants[8] = constants[1]/lt_func(constants[2], constants[6]) - computed_constants[9] = leq_func(constants[1], constants[2]) - computed_constants[10] = constants[1]/leq_func(constants[2], constants[6]) - computed_constants[11] = gt_func(constants[1], constants[2]) - computed_constants[12] = constants[1]/gt_func(constants[2], constants[6]) - computed_constants[13] = geq_func(constants[1], constants[2]) - computed_constants[14] = constants[1]/geq_func(constants[2], constants[6]) - computed_constants[15] = and_func(constants[1], constants[2]) - computed_constants[16] = and_func(constants[1], and_func(constants[2], constants[6])) - computed_constants[17] = and_func(lt_func(constants[1], constants[2]), gt_func(constants[6], constants[18])) - computed_constants[19] = and_func(constants[1]+constants[2], gt_func(constants[6], constants[18])) - computed_constants[20] = and_func(constants[1], gt_func(constants[2], constants[6])) - computed_constants[21] = and_func(constants[1]-constants[2], gt_func(constants[6], constants[18])) - computed_constants[22] = and_func(-constants[1], gt_func(constants[2], constants[6])) - computed_constants[23] = and_func(pow(constants[1], constants[2]), gt_func(constants[6], constants[18])) - computed_constants[24] = and_func(pow(constants[1], 1.0/constants[2]), gt_func(constants[6], constants[18])) - computed_constants[25] = and_func(lt_func(constants[1], constants[2]), constants[6]+constants[18]) - computed_constants[26] = and_func(lt_func(constants[1], constants[2]), constants[6]) - computed_constants[27] = and_func(lt_func(constants[1], constants[2]), constants[6]-constants[18]) - computed_constants[28] = and_func(lt_func(constants[1], constants[2]), -constants[6]) - computed_constants[29] = and_func(lt_func(constants[1], constants[2]), pow(constants[6], constants[18])) - computed_constants[30] = and_func(lt_func(constants[1], constants[2]), pow(constants[6], 1.0/constants[18])) - computed_constants[31] = constants[1]/and_func(constants[2], constants[6]) - computed_constants[32] = or_func(constants[1], constants[2]) - computed_constants[33] = or_func(constants[1], or_func(constants[2], constants[6])) - computed_constants[34] = or_func(lt_func(constants[1], constants[2]), gt_func(constants[6], constants[18])) - computed_constants[35] = or_func(constants[1]+constants[2], gt_func(constants[6], constants[18])) - computed_constants[36] = or_func(constants[1], gt_func(constants[2], constants[6])) - computed_constants[37] = or_func(constants[1]-constants[2], gt_func(constants[6], constants[18])) - computed_constants[38] = or_func(-constants[1], gt_func(constants[2], constants[6])) - computed_constants[39] = or_func(pow(constants[1], constants[2]), gt_func(constants[6], constants[18])) - computed_constants[40] = or_func(pow(constants[1], 1.0/constants[2]), gt_func(constants[6], constants[18])) - computed_constants[41] = or_func(lt_func(constants[1], constants[2]), constants[6]+constants[18]) - computed_constants[42] = or_func(lt_func(constants[1], constants[2]), constants[6]) - computed_constants[43] = or_func(lt_func(constants[1], constants[2]), constants[6]-constants[18]) - computed_constants[44] = or_func(lt_func(constants[1], constants[2]), -constants[6]) - computed_constants[45] = or_func(lt_func(constants[1], constants[2]), pow(constants[6], constants[18])) - computed_constants[46] = or_func(lt_func(constants[1], constants[2]), pow(constants[6], 1.0/constants[18])) - computed_constants[47] = constants[1]/or_func(constants[2], constants[6]) - computed_constants[48] = xor_func(constants[1], constants[2]) - computed_constants[49] = xor_func(constants[1], xor_func(constants[2], constants[6])) - computed_constants[50] = xor_func(lt_func(constants[1], constants[2]), gt_func(constants[6], constants[18])) - computed_constants[51] = xor_func(constants[1]+constants[2], gt_func(constants[6], constants[18])) - computed_constants[52] = xor_func(constants[1], gt_func(constants[2], constants[6])) - computed_constants[53] = xor_func(constants[1]-constants[2], gt_func(constants[6], constants[18])) - computed_constants[54] = xor_func(-constants[1], gt_func(constants[2], constants[6])) - computed_constants[55] = xor_func(pow(constants[1], constants[2]), gt_func(constants[6], constants[18])) - computed_constants[56] = xor_func(pow(constants[1], 1.0/constants[2]), gt_func(constants[6], constants[18])) - computed_constants[57] = xor_func(lt_func(constants[1], constants[2]), constants[6]+constants[18]) - computed_constants[58] = xor_func(lt_func(constants[1], constants[2]), constants[6]) - computed_constants[59] = xor_func(lt_func(constants[1], constants[2]), constants[6]-constants[18]) - computed_constants[60] = xor_func(lt_func(constants[1], constants[2]), -constants[6]) - computed_constants[61] = xor_func(lt_func(constants[1], constants[2]), pow(constants[6], constants[18])) - computed_constants[62] = xor_func(lt_func(constants[1], constants[2]), pow(constants[6], 1.0/constants[18])) - computed_constants[63] = constants[1]/xor_func(constants[2], constants[6]) - computed_constants[64] = not_func(constants[1]) - computed_constants[65] = constants[1]+constants[2] - computed_constants[66] = constants[1]+constants[2]+constants[6] - computed_constants[67] = lt_func(constants[1], constants[2])+gt_func(constants[6], constants[18]) - computed_constants[68] = constants[1] - computed_constants[69] = constants[1]-constants[2] - computed_constants[70] = lt_func(constants[1], constants[2])-gt_func(constants[6], constants[18]) - computed_constants[71] = lt_func(constants[1], constants[2])-(constants[6]+constants[18]) - computed_constants[72] = lt_func(constants[1], constants[2])-constants[6] - computed_constants[73] = constants[1]-(-constants[2]) - computed_constants[74] = constants[1]-(-constants[2]*constants[6]) - computed_constants[75] = -constants[1] - computed_constants[76] = -lt_func(constants[1], constants[2]) - computed_constants[77] = constants[1]*constants[2] - computed_constants[78] = constants[1]*constants[2]*constants[6] - computed_constants[79] = lt_func(constants[1], constants[2])*gt_func(constants[6], constants[18]) - computed_constants[80] = (constants[1]+constants[2])*gt_func(constants[6], constants[18]) - computed_constants[81] = constants[1]*gt_func(constants[2], constants[6]) - computed_constants[82] = (constants[1]-constants[2])*gt_func(constants[6], constants[18]) - computed_constants[83] = -constants[1]*gt_func(constants[2], constants[6]) - computed_constants[84] = lt_func(constants[1], constants[2])*(constants[6]+constants[18]) - computed_constants[85] = lt_func(constants[1], constants[2])*constants[6] - computed_constants[86] = lt_func(constants[1], constants[2])*(constants[6]-constants[18]) - computed_constants[87] = lt_func(constants[1], constants[2])*-constants[6] - computed_constants[88] = constants[1]/constants[2] - computed_constants[89] = lt_func(constants[1], constants[2])/gt_func(constants[18], constants[6]) - computed_constants[90] = (constants[1]+constants[2])/gt_func(constants[18], constants[6]) - computed_constants[91] = constants[1]/gt_func(constants[6], constants[2]) - computed_constants[92] = (constants[1]-constants[2])/gt_func(constants[18], constants[6]) - computed_constants[93] = -constants[1]/gt_func(constants[6], constants[2]) - computed_constants[94] = lt_func(constants[1], constants[2])/(constants[6]+constants[18]) - computed_constants[95] = lt_func(constants[1], constants[2])/constants[6] - computed_constants[96] = lt_func(constants[1], constants[2])/(constants[6]-constants[18]) - computed_constants[97] = lt_func(constants[1], constants[2])/-constants[6] - computed_constants[98] = lt_func(constants[1], constants[2])/(constants[6]*constants[18]) - computed_constants[99] = lt_func(constants[1], constants[2])/(constants[6]/constants[18]) - computed_constants[100] = sqrt(constants[1]) - computed_constants[101] = pow(constants[1], 2.0) - computed_constants[102] = pow(constants[1], 3.0) - computed_constants[103] = pow(constants[1], constants[2]) - computed_constants[104] = pow(leq_func(constants[1], constants[2]), geq_func(constants[6], constants[18])) - computed_constants[105] = pow(constants[1]+constants[2], geq_func(constants[6], constants[18])) - computed_constants[106] = pow(constants[1], geq_func(constants[2], constants[6])) - computed_constants[107] = pow(constants[1]-constants[2], geq_func(constants[6], constants[18])) - computed_constants[108] = pow(-constants[1], geq_func(constants[2], constants[6])) - computed_constants[109] = pow(constants[1]*constants[2], geq_func(constants[6], constants[18])) - computed_constants[110] = pow(constants[1]/constants[2], geq_func(constants[6], constants[18])) - computed_constants[111] = pow(leq_func(constants[1], constants[2]), constants[6]+constants[18]) - computed_constants[112] = pow(leq_func(constants[1], constants[2]), constants[6]) - computed_constants[113] = pow(leq_func(constants[1], constants[2]), constants[6]-constants[18]) - computed_constants[114] = pow(leq_func(constants[1], constants[2]), -constants[6]) - computed_constants[115] = pow(leq_func(constants[1], constants[2]), constants[6]*constants[18]) - computed_constants[116] = pow(leq_func(constants[1], constants[2]), constants[6]/constants[18]) - computed_constants[117] = pow(leq_func(constants[1], constants[2]), pow(constants[6], constants[18])) - computed_constants[118] = pow(leq_func(constants[1], constants[2]), pow(constants[6], 1.0/constants[18])) - computed_constants[119] = sqrt(constants[1]) - computed_constants[120] = sqrt(constants[1]) - computed_constants[121] = pow(constants[1], 1.0/3.0) - computed_constants[122] = pow(constants[1], 1.0/constants[2]) - computed_constants[123] = pow(lt_func(constants[1], constants[2]), 1.0/gt_func(constants[18], constants[6])) - computed_constants[124] = pow(constants[1]+constants[2], 1.0/gt_func(constants[18], constants[6])) - computed_constants[125] = pow(constants[1], 1.0/gt_func(constants[6], constants[2])) - computed_constants[126] = pow(constants[1]-constants[2], 1.0/gt_func(constants[18], constants[6])) - computed_constants[127] = pow(-constants[1], 1.0/gt_func(constants[6], constants[2])) - computed_constants[128] = pow(constants[1]*constants[2], 1.0/gt_func(constants[18], constants[6])) - computed_constants[129] = pow(constants[1]/constants[2], 1.0/gt_func(constants[18], constants[6])) - computed_constants[130] = pow(lt_func(constants[1], constants[2]), 1.0/(constants[6]+constants[18])) - computed_constants[131] = pow(lt_func(constants[1], constants[2]), 1.0/constants[6]) - computed_constants[132] = pow(lt_func(constants[1], constants[2]), 1.0/(constants[6]-constants[18])) - computed_constants[133] = pow(lt_func(constants[1], constants[2]), 1.0/-constants[6]) - computed_constants[134] = pow(lt_func(constants[1], constants[2]), 1.0/(constants[6]*constants[18])) - computed_constants[135] = pow(lt_func(constants[1], constants[2]), 1.0/(constants[6]/constants[18])) - computed_constants[136] = pow(lt_func(constants[1], constants[2]), 1.0/pow(constants[6], constants[18])) - computed_constants[137] = pow(lt_func(constants[1], constants[2]), 1.0/pow(constants[6], 1.0/constants[18])) - computed_constants[138] = fabs(constants[1]) - computed_constants[139] = exp(constants[1]) - computed_constants[140] = log(constants[1]) - computed_constants[141] = log10(constants[1]) - computed_constants[142] = log(constants[1])/log(2.0) - computed_constants[143] = log10(constants[1]) - computed_constants[144] = log(constants[1])/log(constants[2]) - computed_constants[145] = ceil(constants[1]) - computed_constants[146] = floor(constants[1]) - computed_constants[147] = min(constants[1], constants[2]) - computed_constants[148] = min(constants[1], min(constants[2], constants[6])) - computed_constants[149] = max(constants[1], constants[2]) - computed_constants[150] = max(constants[1], max(constants[2], constants[6])) - computed_constants[151] = fmod(constants[1], constants[2]) - computed_constants[152] = sin(constants[1]) - computed_constants[153] = cos(constants[1]) - computed_constants[154] = tan(constants[1]) - computed_constants[155] = sec(constants[1]) - computed_constants[156] = csc(constants[1]) - computed_constants[157] = cot(constants[1]) - computed_constants[158] = sinh(constants[1]) - computed_constants[159] = cosh(constants[1]) - computed_constants[160] = tanh(constants[1]) - computed_constants[161] = sech(constants[1]) - computed_constants[162] = csch(constants[1]) - computed_constants[163] = coth(constants[1]) - computed_constants[164] = asin(constants[1]) - computed_constants[165] = acos(constants[1]) - computed_constants[166] = atan(constants[1]) - computed_constants[167] = asec(constants[1]) - computed_constants[168] = acsc(constants[1]) - computed_constants[169] = acot(constants[1]) - computed_constants[170] = asinh(constants[1]) - computed_constants[171] = acosh(constants[1]) - computed_constants[172] = atanh(constants[1]/2.0) - computed_constants[173] = asech(constants[1]) - computed_constants[174] = acsch(constants[1]) - computed_constants[175] = acoth(2.0*constants[1]) - computed_constants[176] = constants[1] if gt_func(constants[1], constants[2]) else nan - computed_constants[177] = constants[1] if gt_func(constants[1], constants[2]) else constants[6] - computed_constants[178] = constants[1] if gt_func(constants[1], constants[2]) else constants[6] if gt_func(constants[6], constants[18]) else constants[179] if gt_func(constants[179], constants[180]) else nan - computed_constants[181] = constants[1] if gt_func(constants[1], constants[2]) else constants[6] if gt_func(constants[6], constants[18]) else constants[179] if gt_func(constants[179], constants[180]) else constants[182] - computed_constants[183] = 123.0+(constants[1] if gt_func(constants[1], constants[2]) else nan) - computed_constants[188] = constants[1] - computed_constants[195] = and_func(constants[1], constants[2])+(constants[2] if gt_func(constants[6], constants[18]) else nan)+constants[179]+and_func(constants[180], constants[182]) - computed_constants[196] = and_func(constants[1], constants[2])-((constants[2] if gt_func(constants[6], constants[18]) else nan)-(constants[179]-(constants[2] if gt_func(constants[6], constants[18]) else nan)))-and_func(constants[180], constants[182]) - computed_constants[197] = and_func(constants[1], constants[2])*(constants[2] if gt_func(constants[6], constants[18]) else nan)*constants[179]*(constants[2] if gt_func(constants[6], constants[18]) else nan)*and_func(constants[180], constants[182]) - computed_constants[198] = and_func(constants[1], constants[2])/((constants[2] if gt_func(constants[6], constants[18]) else nan)/(constants[179]/(constants[2] if gt_func(constants[6], constants[18]) else nan))) - computed_constants[199] = and_func(or_func(constants[1], constants[2]), and_func(xor_func(constants[1], constants[2]), and_func(constants[2] if gt_func(constants[6], constants[18]) else nan, and_func(and_func(and_func(constants[179], constants[2] if gt_func(constants[6], constants[18]) else nan), xor_func(constants[1], constants[2])), or_func(constants[1], constants[2]))))) - computed_constants[200] = or_func(and_func(constants[1], constants[2]), or_func(xor_func(constants[1], constants[2]), or_func(constants[2] if gt_func(constants[6], constants[18]) else nan, or_func(or_func(or_func(constants[179], constants[2] if gt_func(constants[6], constants[18]) else nan), xor_func(constants[1], constants[2])), and_func(constants[1], constants[2]))))) - computed_constants[201] = xor_func(and_func(constants[1], constants[2]), xor_func(or_func(constants[1], constants[2]), xor_func(constants[2] if gt_func(constants[6], constants[18]) else nan, xor_func(xor_func(xor_func(constants[179], constants[2] if gt_func(constants[6], constants[18]) else nan), or_func(constants[1], constants[2])), and_func(constants[1], constants[2]))))) - computed_constants[202] = pow(and_func(constants[1], constants[2]), pow(constants[2] if gt_func(constants[6], constants[18]) else nan, pow(pow(constants[179], constants[2] if gt_func(constants[6], constants[18]) else nan), and_func(constants[1], constants[2])))) - computed_constants[203] = pow(pow(pow(and_func(constants[1], constants[2]), 1.0/pow(constants[2] if gt_func(constants[6], constants[18]) else nan, 1.0/constants[179])), 1.0/(constants[2] if gt_func(constants[6], constants[18]) else nan)), 1.0/and_func(constants[1], constants[2])) - computed_constants[204] = -and_func(constants[1], constants[2])+-(constants[2] if gt_func(constants[6], constants[18]) else nan) + computed_constants[0] = eq_func(constants[0], constants[1]) + computed_constants[1] = constants[0]/eq_func(constants[1], constants[1]) + computed_constants[2] = neq_func(constants[0], constants[1]) + computed_constants[3] = constants[0]/neq_func(constants[1], constants[2]) + computed_constants[4] = lt_func(constants[0], constants[1]) + computed_constants[5] = constants[0]/lt_func(constants[1], constants[2]) + computed_constants[6] = leq_func(constants[0], constants[1]) + computed_constants[7] = constants[0]/leq_func(constants[1], constants[2]) + computed_constants[8] = gt_func(constants[0], constants[1]) + computed_constants[9] = constants[0]/gt_func(constants[1], constants[2]) + computed_constants[10] = geq_func(constants[0], constants[1]) + computed_constants[11] = constants[0]/geq_func(constants[1], constants[2]) + computed_constants[12] = and_func(constants[0], constants[1]) + computed_constants[13] = and_func(constants[0], and_func(constants[1], constants[2])) + computed_constants[14] = and_func(lt_func(constants[0], constants[1]), gt_func(constants[2], constants[3])) + computed_constants[15] = and_func(constants[0]+constants[1], gt_func(constants[2], constants[3])) + computed_constants[16] = and_func(constants[0], gt_func(constants[1], constants[2])) + computed_constants[17] = and_func(constants[0]-constants[1], gt_func(constants[2], constants[3])) + computed_constants[18] = and_func(-constants[0], gt_func(constants[1], constants[2])) + computed_constants[19] = and_func(pow(constants[0], constants[1]), gt_func(constants[2], constants[3])) + computed_constants[20] = and_func(pow(constants[0], 1.0/constants[1]), gt_func(constants[2], constants[3])) + computed_constants[21] = and_func(lt_func(constants[0], constants[1]), constants[2]+constants[3]) + computed_constants[22] = and_func(lt_func(constants[0], constants[1]), constants[2]) + computed_constants[23] = and_func(lt_func(constants[0], constants[1]), constants[2]-constants[3]) + computed_constants[24] = and_func(lt_func(constants[0], constants[1]), -constants[2]) + computed_constants[25] = and_func(lt_func(constants[0], constants[1]), pow(constants[2], constants[3])) + computed_constants[26] = and_func(lt_func(constants[0], constants[1]), pow(constants[2], 1.0/constants[3])) + computed_constants[27] = constants[0]/and_func(constants[1], constants[2]) + computed_constants[28] = or_func(constants[0], constants[1]) + computed_constants[29] = or_func(constants[0], or_func(constants[1], constants[2])) + computed_constants[30] = or_func(lt_func(constants[0], constants[1]), gt_func(constants[2], constants[3])) + computed_constants[31] = or_func(constants[0]+constants[1], gt_func(constants[2], constants[3])) + computed_constants[32] = or_func(constants[0], gt_func(constants[1], constants[2])) + computed_constants[33] = or_func(constants[0]-constants[1], gt_func(constants[2], constants[3])) + computed_constants[34] = or_func(-constants[0], gt_func(constants[1], constants[2])) + computed_constants[35] = or_func(pow(constants[0], constants[1]), gt_func(constants[2], constants[3])) + computed_constants[36] = or_func(pow(constants[0], 1.0/constants[1]), gt_func(constants[2], constants[3])) + computed_constants[37] = or_func(lt_func(constants[0], constants[1]), constants[2]+constants[3]) + computed_constants[38] = or_func(lt_func(constants[0], constants[1]), constants[2]) + computed_constants[39] = or_func(lt_func(constants[0], constants[1]), constants[2]-constants[3]) + computed_constants[40] = or_func(lt_func(constants[0], constants[1]), -constants[2]) + computed_constants[41] = or_func(lt_func(constants[0], constants[1]), pow(constants[2], constants[3])) + computed_constants[42] = or_func(lt_func(constants[0], constants[1]), pow(constants[2], 1.0/constants[3])) + computed_constants[43] = constants[0]/or_func(constants[1], constants[2]) + computed_constants[44] = xor_func(constants[0], constants[1]) + computed_constants[45] = xor_func(constants[0], xor_func(constants[1], constants[2])) + computed_constants[46] = xor_func(lt_func(constants[0], constants[1]), gt_func(constants[2], constants[3])) + computed_constants[47] = xor_func(constants[0]+constants[1], gt_func(constants[2], constants[3])) + computed_constants[48] = xor_func(constants[0], gt_func(constants[1], constants[2])) + computed_constants[49] = xor_func(constants[0]-constants[1], gt_func(constants[2], constants[3])) + computed_constants[50] = xor_func(-constants[0], gt_func(constants[1], constants[2])) + computed_constants[51] = xor_func(pow(constants[0], constants[1]), gt_func(constants[2], constants[3])) + computed_constants[52] = xor_func(pow(constants[0], 1.0/constants[1]), gt_func(constants[2], constants[3])) + computed_constants[53] = xor_func(lt_func(constants[0], constants[1]), constants[2]+constants[3]) + computed_constants[54] = xor_func(lt_func(constants[0], constants[1]), constants[2]) + computed_constants[55] = xor_func(lt_func(constants[0], constants[1]), constants[2]-constants[3]) + computed_constants[56] = xor_func(lt_func(constants[0], constants[1]), -constants[2]) + computed_constants[57] = xor_func(lt_func(constants[0], constants[1]), pow(constants[2], constants[3])) + computed_constants[58] = xor_func(lt_func(constants[0], constants[1]), pow(constants[2], 1.0/constants[3])) + computed_constants[59] = constants[0]/xor_func(constants[1], constants[2]) + computed_constants[60] = not_func(constants[0]) + computed_constants[61] = constants[0]+constants[1] + computed_constants[62] = constants[0]+constants[1]+constants[2] + computed_constants[63] = lt_func(constants[0], constants[1])+gt_func(constants[2], constants[3]) + computed_constants[64] = constants[0] + computed_constants[65] = constants[0]-constants[1] + computed_constants[66] = lt_func(constants[0], constants[1])-gt_func(constants[2], constants[3]) + computed_constants[67] = lt_func(constants[0], constants[1])-(constants[2]+constants[3]) + computed_constants[68] = lt_func(constants[0], constants[1])-constants[2] + computed_constants[69] = constants[0]-(-constants[1]) + computed_constants[70] = constants[0]-(-constants[1]*constants[2]) + computed_constants[71] = -constants[0] + computed_constants[72] = -lt_func(constants[0], constants[1]) + computed_constants[73] = constants[0]*constants[1] + computed_constants[74] = constants[0]*constants[1]*constants[2] + computed_constants[75] = lt_func(constants[0], constants[1])*gt_func(constants[2], constants[3]) + computed_constants[76] = (constants[0]+constants[1])*gt_func(constants[2], constants[3]) + computed_constants[77] = constants[0]*gt_func(constants[1], constants[2]) + computed_constants[78] = (constants[0]-constants[1])*gt_func(constants[2], constants[3]) + computed_constants[79] = -constants[0]*gt_func(constants[1], constants[2]) + computed_constants[80] = lt_func(constants[0], constants[1])*(constants[2]+constants[3]) + computed_constants[81] = lt_func(constants[0], constants[1])*constants[2] + computed_constants[82] = lt_func(constants[0], constants[1])*(constants[2]-constants[3]) + computed_constants[83] = lt_func(constants[0], constants[1])*-constants[2] + computed_constants[84] = constants[0]/constants[1] + computed_constants[85] = lt_func(constants[0], constants[1])/gt_func(constants[3], constants[2]) + computed_constants[86] = (constants[0]+constants[1])/gt_func(constants[3], constants[2]) + computed_constants[87] = constants[0]/gt_func(constants[2], constants[1]) + computed_constants[88] = (constants[0]-constants[1])/gt_func(constants[3], constants[2]) + computed_constants[89] = -constants[0]/gt_func(constants[2], constants[1]) + computed_constants[90] = lt_func(constants[0], constants[1])/(constants[2]+constants[3]) + computed_constants[91] = lt_func(constants[0], constants[1])/constants[2] + computed_constants[92] = lt_func(constants[0], constants[1])/(constants[2]-constants[3]) + computed_constants[93] = lt_func(constants[0], constants[1])/-constants[2] + computed_constants[94] = lt_func(constants[0], constants[1])/(constants[2]*constants[3]) + computed_constants[95] = lt_func(constants[0], constants[1])/(constants[2]/constants[3]) + computed_constants[96] = sqrt(constants[0]) + computed_constants[97] = pow(constants[0], 2.0) + computed_constants[98] = pow(constants[0], 3.0) + computed_constants[99] = pow(constants[0], constants[1]) + computed_constants[100] = pow(leq_func(constants[0], constants[1]), geq_func(constants[2], constants[3])) + computed_constants[101] = pow(constants[0]+constants[1], geq_func(constants[2], constants[3])) + computed_constants[102] = pow(constants[0], geq_func(constants[1], constants[2])) + computed_constants[103] = pow(constants[0]-constants[1], geq_func(constants[2], constants[3])) + computed_constants[104] = pow(-constants[0], geq_func(constants[1], constants[2])) + computed_constants[105] = pow(constants[0]*constants[1], geq_func(constants[2], constants[3])) + computed_constants[106] = pow(constants[0]/constants[1], geq_func(constants[2], constants[3])) + computed_constants[107] = pow(leq_func(constants[0], constants[1]), constants[2]+constants[3]) + computed_constants[108] = pow(leq_func(constants[0], constants[1]), constants[2]) + computed_constants[109] = pow(leq_func(constants[0], constants[1]), constants[2]-constants[3]) + computed_constants[110] = pow(leq_func(constants[0], constants[1]), -constants[2]) + computed_constants[111] = pow(leq_func(constants[0], constants[1]), constants[2]*constants[3]) + computed_constants[112] = pow(leq_func(constants[0], constants[1]), constants[2]/constants[3]) + computed_constants[113] = pow(leq_func(constants[0], constants[1]), pow(constants[2], constants[3])) + computed_constants[114] = pow(leq_func(constants[0], constants[1]), pow(constants[2], 1.0/constants[3])) + computed_constants[115] = sqrt(constants[0]) + computed_constants[116] = sqrt(constants[0]) + computed_constants[117] = pow(constants[0], 1.0/3.0) + computed_constants[118] = pow(constants[0], 1.0/constants[1]) + computed_constants[119] = pow(lt_func(constants[0], constants[1]), 1.0/gt_func(constants[3], constants[2])) + computed_constants[120] = pow(constants[0]+constants[1], 1.0/gt_func(constants[3], constants[2])) + computed_constants[121] = pow(constants[0], 1.0/gt_func(constants[2], constants[1])) + computed_constants[122] = pow(constants[0]-constants[1], 1.0/gt_func(constants[3], constants[2])) + computed_constants[123] = pow(-constants[0], 1.0/gt_func(constants[2], constants[1])) + computed_constants[124] = pow(constants[0]*constants[1], 1.0/gt_func(constants[3], constants[2])) + computed_constants[125] = pow(constants[0]/constants[1], 1.0/gt_func(constants[3], constants[2])) + computed_constants[126] = pow(lt_func(constants[0], constants[1]), 1.0/(constants[2]+constants[3])) + computed_constants[127] = pow(lt_func(constants[0], constants[1]), 1.0/constants[2]) + computed_constants[128] = pow(lt_func(constants[0], constants[1]), 1.0/(constants[2]-constants[3])) + computed_constants[129] = pow(lt_func(constants[0], constants[1]), 1.0/-constants[2]) + computed_constants[130] = pow(lt_func(constants[0], constants[1]), 1.0/(constants[2]*constants[3])) + computed_constants[131] = pow(lt_func(constants[0], constants[1]), 1.0/(constants[2]/constants[3])) + computed_constants[132] = pow(lt_func(constants[0], constants[1]), 1.0/pow(constants[2], constants[3])) + computed_constants[133] = pow(lt_func(constants[0], constants[1]), 1.0/pow(constants[2], 1.0/constants[3])) + computed_constants[134] = fabs(constants[0]) + computed_constants[135] = exp(constants[0]) + computed_constants[136] = log(constants[0]) + computed_constants[137] = log10(constants[0]) + computed_constants[138] = log(constants[0])/log(2.0) + computed_constants[139] = log10(constants[0]) + computed_constants[140] = log(constants[0])/log(constants[1]) + computed_constants[141] = ceil(constants[0]) + computed_constants[142] = floor(constants[0]) + computed_constants[143] = min(constants[0], constants[1]) + computed_constants[144] = min(constants[0], min(constants[1], constants[2])) + computed_constants[145] = max(constants[0], constants[1]) + computed_constants[146] = max(constants[0], max(constants[1], constants[2])) + computed_constants[147] = fmod(constants[0], constants[1]) + computed_constants[148] = sin(constants[0]) + computed_constants[149] = cos(constants[0]) + computed_constants[150] = tan(constants[0]) + computed_constants[151] = sec(constants[0]) + computed_constants[152] = csc(constants[0]) + computed_constants[153] = cot(constants[0]) + computed_constants[154] = sinh(constants[0]) + computed_constants[155] = cosh(constants[0]) + computed_constants[156] = tanh(constants[0]) + computed_constants[157] = sech(constants[0]) + computed_constants[158] = csch(constants[0]) + computed_constants[159] = coth(constants[0]) + computed_constants[160] = asin(constants[0]) + computed_constants[161] = acos(constants[0]) + computed_constants[162] = atan(constants[0]) + computed_constants[163] = asec(constants[0]) + computed_constants[164] = acsc(constants[0]) + computed_constants[165] = acot(constants[0]) + computed_constants[166] = asinh(constants[0]) + computed_constants[167] = acosh(constants[0]) + computed_constants[168] = atanh(constants[0]/2.0) + computed_constants[169] = asech(constants[0]) + computed_constants[170] = acsch(constants[0]) + computed_constants[171] = acoth(2.0*constants[0]) + computed_constants[172] = constants[0] if gt_func(constants[0], constants[1]) else nan + computed_constants[173] = constants[0] if gt_func(constants[0], constants[1]) else constants[2] + computed_constants[174] = constants[0] if gt_func(constants[0], constants[1]) else constants[2] if gt_func(constants[2], constants[3]) else constants[4] if gt_func(constants[4], constants[5]) else nan + computed_constants[175] = constants[0] if gt_func(constants[0], constants[1]) else constants[2] if gt_func(constants[2], constants[3]) else constants[4] if gt_func(constants[4], constants[5]) else constants[6] + computed_constants[176] = 123.0+(constants[0] if gt_func(constants[0], constants[1]) else nan) + computed_constants[181] = constants[0] + computed_constants[188] = and_func(constants[0], constants[1])+(constants[1] if gt_func(constants[2], constants[3]) else nan)+constants[4]+and_func(constants[5], constants[6]) + computed_constants[189] = and_func(constants[0], constants[1])-((constants[1] if gt_func(constants[2], constants[3]) else nan)-(constants[4]-(constants[1] if gt_func(constants[2], constants[3]) else nan)))-and_func(constants[5], constants[6]) + computed_constants[190] = and_func(constants[0], constants[1])*(constants[1] if gt_func(constants[2], constants[3]) else nan)*constants[4]*(constants[1] if gt_func(constants[2], constants[3]) else nan)*and_func(constants[5], constants[6]) + computed_constants[191] = and_func(constants[0], constants[1])/((constants[1] if gt_func(constants[2], constants[3]) else nan)/(constants[4]/(constants[1] if gt_func(constants[2], constants[3]) else nan))) + computed_constants[192] = and_func(or_func(constants[0], constants[1]), and_func(xor_func(constants[0], constants[1]), and_func(constants[1] if gt_func(constants[2], constants[3]) else nan, and_func(and_func(and_func(constants[4], constants[1] if gt_func(constants[2], constants[3]) else nan), xor_func(constants[0], constants[1])), or_func(constants[0], constants[1]))))) + computed_constants[193] = or_func(and_func(constants[0], constants[1]), or_func(xor_func(constants[0], constants[1]), or_func(constants[1] if gt_func(constants[2], constants[3]) else nan, or_func(or_func(or_func(constants[4], constants[1] if gt_func(constants[2], constants[3]) else nan), xor_func(constants[0], constants[1])), and_func(constants[0], constants[1]))))) + computed_constants[194] = xor_func(and_func(constants[0], constants[1]), xor_func(or_func(constants[0], constants[1]), xor_func(constants[1] if gt_func(constants[2], constants[3]) else nan, xor_func(xor_func(xor_func(constants[4], constants[1] if gt_func(constants[2], constants[3]) else nan), or_func(constants[0], constants[1])), and_func(constants[0], constants[1]))))) + computed_constants[195] = pow(and_func(constants[0], constants[1]), pow(constants[1] if gt_func(constants[2], constants[3]) else nan, pow(pow(constants[4], constants[1] if gt_func(constants[2], constants[3]) else nan), and_func(constants[0], constants[1])))) + computed_constants[196] = pow(pow(pow(and_func(constants[0], constants[1]), 1.0/pow(constants[1] if gt_func(constants[2], constants[3]) else nan, 1.0/constants[4])), 1.0/(constants[1] if gt_func(constants[2], constants[3]) else nan)), 1.0/and_func(constants[0], constants[1])) + computed_constants[197] = -and_func(constants[0], constants[1])+-(constants[1] if gt_func(constants[2], constants[3]) else nan) def compute_rates(voi, states, rates, constants, computed_constants, algebraic): diff --git a/tests/resources/generator/algebraic_eqn_const_var_on_rhs/model.c b/tests/resources/generator/algebraic_eqn_const_var_on_rhs/model.c index 6624303897..332ca74062 100644 --- a/tests/resources/generator/algebraic_eqn_const_var_on_rhs/model.c +++ b/tests/resources/generator/algebraic_eqn_const_var_on_rhs/model.c @@ -35,12 +35,12 @@ void deleteArray(double *array) void initialiseVariables(double *constants) { - constants[1] = 1.0; + constants[0] = 1.0; } void computeComputedConstants(double *constants, double *computedConstants) { - computedConstants[0] = constants[1]; + computedConstants[0] = constants[0]; } void computeVariables(double *constants, double *computedConstants, double *algebraic) diff --git a/tests/resources/generator/algebraic_eqn_const_var_on_rhs/model.py b/tests/resources/generator/algebraic_eqn_const_var_on_rhs/model.py index 9b07f95029..491cd5db6c 100644 --- a/tests/resources/generator/algebraic_eqn_const_var_on_rhs/model.py +++ b/tests/resources/generator/algebraic_eqn_const_var_on_rhs/model.py @@ -29,11 +29,11 @@ def create_variables_array(): def initialise_variables(constants): - constants[1] = 1.0 + constants[0] = 1.0 def compute_computed_constants(constants, computed_constants): - computed_constants[0] = constants[1] + computed_constants[0] = constants[0] def compute_variables(constants, computed_constants, algebraic): diff --git a/tests/resources/generator/algebraic_eqn_derivative_on_rhs/model.c b/tests/resources/generator/algebraic_eqn_derivative_on_rhs/model.c index c08dde32e6..3dad3588b0 100644 --- a/tests/resources/generator/algebraic_eqn_derivative_on_rhs/model.c +++ b/tests/resources/generator/algebraic_eqn_derivative_on_rhs/model.c @@ -68,5 +68,5 @@ void computeRates(double voi, double *states, double *rates, double *constants, void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic) { - algebraic[1] = rates[0]; + algebraic[0] = rates[0]; } diff --git a/tests/resources/generator/algebraic_eqn_derivative_on_rhs/model.py b/tests/resources/generator/algebraic_eqn_derivative_on_rhs/model.py index 5e2901ca36..636d498ebc 100644 --- a/tests/resources/generator/algebraic_eqn_derivative_on_rhs/model.py +++ b/tests/resources/generator/algebraic_eqn_derivative_on_rhs/model.py @@ -55,4 +55,4 @@ def compute_rates(voi, states, rates, constants, computed_constants, algebraic): def compute_variables(voi, states, rates, constants, computed_constants, algebraic): - algebraic[1] = rates[0] + algebraic[0] = rates[0] diff --git a/tests/resources/generator/algebraic_eqn_derivative_on_rhs_one_component/model.c b/tests/resources/generator/algebraic_eqn_derivative_on_rhs_one_component/model.c index 5d3967ab00..7c848f4303 100644 --- a/tests/resources/generator/algebraic_eqn_derivative_on_rhs_one_component/model.c +++ b/tests/resources/generator/algebraic_eqn_derivative_on_rhs_one_component/model.c @@ -68,5 +68,5 @@ void computeRates(double voi, double *states, double *rates, double *constants, void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic) { - algebraic[1] = rates[0]; + algebraic[0] = rates[0]; } diff --git a/tests/resources/generator/algebraic_eqn_derivative_on_rhs_one_component/model.py b/tests/resources/generator/algebraic_eqn_derivative_on_rhs_one_component/model.py index 3390600530..1b1a4ab6e7 100644 --- a/tests/resources/generator/algebraic_eqn_derivative_on_rhs_one_component/model.py +++ b/tests/resources/generator/algebraic_eqn_derivative_on_rhs_one_component/model.py @@ -55,4 +55,4 @@ def compute_rates(voi, states, rates, constants, computed_constants, algebraic): def compute_variables(voi, states, rates, constants, computed_constants, algebraic): - algebraic[1] = rates[0] + algebraic[0] = rates[0] diff --git a/tests/resources/generator/algebraic_eqn_state_var_on_rhs/model.c b/tests/resources/generator/algebraic_eqn_state_var_on_rhs/model.c index cd735eda2b..42c4bd5eb7 100644 --- a/tests/resources/generator/algebraic_eqn_state_var_on_rhs/model.c +++ b/tests/resources/generator/algebraic_eqn_state_var_on_rhs/model.c @@ -68,5 +68,5 @@ void computeRates(double voi, double *states, double *rates, double *constants, void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic) { - algebraic[1] = 2.0*states[0]; + algebraic[0] = 2.0*states[0]; } diff --git a/tests/resources/generator/algebraic_eqn_state_var_on_rhs/model.py b/tests/resources/generator/algebraic_eqn_state_var_on_rhs/model.py index bca3f1f415..1515ba7746 100644 --- a/tests/resources/generator/algebraic_eqn_state_var_on_rhs/model.py +++ b/tests/resources/generator/algebraic_eqn_state_var_on_rhs/model.py @@ -55,4 +55,4 @@ def compute_rates(voi, states, rates, constants, computed_constants, algebraic): def compute_variables(voi, states, rates, constants, computed_constants, algebraic): - algebraic[1] = 2.0*states[0] + algebraic[0] = 2.0*states[0] diff --git a/tests/resources/generator/algebraic_eqn_state_var_on_rhs_one_component/model.c b/tests/resources/generator/algebraic_eqn_state_var_on_rhs_one_component/model.c index 8836720f31..02fe6c001b 100644 --- a/tests/resources/generator/algebraic_eqn_state_var_on_rhs_one_component/model.c +++ b/tests/resources/generator/algebraic_eqn_state_var_on_rhs_one_component/model.c @@ -68,5 +68,5 @@ void computeRates(double voi, double *states, double *rates, double *constants, void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic) { - algebraic[1] = 2.0*states[0]; + algebraic[0] = 2.0*states[0]; } diff --git a/tests/resources/generator/algebraic_eqn_state_var_on_rhs_one_component/model.py b/tests/resources/generator/algebraic_eqn_state_var_on_rhs_one_component/model.py index 409f890e5e..25de4def2c 100644 --- a/tests/resources/generator/algebraic_eqn_state_var_on_rhs_one_component/model.py +++ b/tests/resources/generator/algebraic_eqn_state_var_on_rhs_one_component/model.py @@ -55,4 +55,4 @@ def compute_rates(voi, states, rates, constants, computed_constants, algebraic): def compute_variables(voi, states, rates, constants, computed_constants, algebraic): - algebraic[1] = 2.0*states[0] + algebraic[0] = 2.0*states[0] diff --git a/tests/resources/generator/algebraic_eqn_with_one_non_isolated_unknown/model.c b/tests/resources/generator/algebraic_eqn_with_one_non_isolated_unknown/model.c index 8466d70b10..76b2c4760b 100644 --- a/tests/resources/generator/algebraic_eqn_with_one_non_isolated_unknown/model.c +++ b/tests/resources/generator/algebraic_eqn_with_one_non_isolated_unknown/model.c @@ -46,9 +46,9 @@ void objectiveFunction0(double *u, double *f, void *data) { double *variables = ((RootFindingInfo *) data)->variables; - algebraic[3] = u[0]; + algebraic[0] = u[0]; - f[0] = algebraic[3]+computedConstants[0]-(computedConstants[1]+computedConstants[2]); + f[0] = algebraic[0]+computedConstants[0]-(computedConstants[1]+computedConstants[2]); } void findRoot0(double *variables) @@ -56,16 +56,16 @@ void findRoot0(double *variables) RootFindingInfo rfi = { variables }; double u[1]; - u[0] = algebraic[3]; + u[0] = algebraic[0]; nlaSolve(objectiveFunction0, u, 1, &rfi); - algebraic[3] = u[0]; + algebraic[0] = u[0]; } void initialiseVariables(double *constants) { - algebraic[3] = 1.0; + algebraic[0] = 1.0; computedConstants[0] = 3.0; computedConstants[1] = 5.0; computedConstants[2] = 7.0; diff --git a/tests/resources/generator/algebraic_eqn_with_one_non_isolated_unknown/model.external.c b/tests/resources/generator/algebraic_eqn_with_one_non_isolated_unknown/model.external.c index 57c92c1e13..060991c4c8 100644 --- a/tests/resources/generator/algebraic_eqn_with_one_non_isolated_unknown/model.external.c +++ b/tests/resources/generator/algebraic_eqn_with_one_non_isolated_unknown/model.external.c @@ -40,7 +40,7 @@ void initialiseVariables(double *constants, ExternalVariable externalVariable) computedConstants[0] = 3.0; computedConstants[1] = 5.0; computedConstants[2] = 7.0; - algebraic[3] = externalVariable(variables, 3); + algebraic[0] = externalVariable(variables, 0); } void computeComputedConstants(double *constants, double *computedConstants) @@ -49,5 +49,5 @@ void computeComputedConstants(double *constants, double *computedConstants) void computeVariables(double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { - algebraic[3] = externalVariable(variables, 3); + algebraic[0] = externalVariable(variables, 0); } diff --git a/tests/resources/generator/algebraic_eqn_with_one_non_isolated_unknown/model.external.py b/tests/resources/generator/algebraic_eqn_with_one_non_isolated_unknown/model.external.py index de574c9043..136bed0a66 100644 --- a/tests/resources/generator/algebraic_eqn_with_one_non_isolated_unknown/model.external.py +++ b/tests/resources/generator/algebraic_eqn_with_one_non_isolated_unknown/model.external.py @@ -35,7 +35,7 @@ def initialise_variables(constants, external_variable): computed_constants[0] = 3.0 computed_constants[1] = 5.0 computed_constants[2] = 7.0 - algebraic[3] = external_variable(variables, 3) + algebraic[0] = external_variable(variables, 0) def compute_computed_constants(constants, computed_constants): @@ -43,4 +43,4 @@ def compute_computed_constants(constants, computed_constants): def compute_variables(constants, computed_constants, algebraic, external_variable): - algebraic[3] = external_variable(variables, 3) + algebraic[0] = external_variable(variables, 0) diff --git a/tests/resources/generator/algebraic_eqn_with_one_non_isolated_unknown/model.py b/tests/resources/generator/algebraic_eqn_with_one_non_isolated_unknown/model.py index 646d98b2af..c84ffdf6af 100644 --- a/tests/resources/generator/algebraic_eqn_with_one_non_isolated_unknown/model.py +++ b/tests/resources/generator/algebraic_eqn_with_one_non_isolated_unknown/model.py @@ -36,23 +36,23 @@ def create_variables_array(): def objective_function_0(u, f, data): variables = data[0] - algebraic[3] = u[0] + algebraic[0] = u[0] - f[0] = algebraic[3]+computed_constants[0]-(computed_constants[1]+computed_constants[2]) + f[0] = algebraic[0]+computed_constants[0]-(computed_constants[1]+computed_constants[2]) def find_root_0(variables): u = [nan]*1 - u[0] = algebraic[3] + u[0] = algebraic[0] u = nla_solve(objective_function_0, u, 1, [variables]) - algebraic[3] = u[0] + algebraic[0] = u[0] def initialise_variables(constants): - algebraic[3] = 1.0 + algebraic[0] = 1.0 computed_constants[0] = 3.0 computed_constants[1] = 5.0 computed_constants[2] = 7.0 diff --git a/tests/resources/generator/algebraic_system_with_various_dependencies/model.not.ordered.c b/tests/resources/generator/algebraic_system_with_various_dependencies/model.not.ordered.c index 209f9dc7b5..c628b10acd 100644 --- a/tests/resources/generator/algebraic_system_with_various_dependencies/model.not.ordered.c +++ b/tests/resources/generator/algebraic_system_with_various_dependencies/model.not.ordered.c @@ -51,8 +51,8 @@ void objectiveFunction0(double *u, double *f, void *data) algebraic[2] = u[0]; algebraic[1] = u[1]; - f[0] = 3.0*computedConstants[3]+2.0*algebraic[1]+algebraic[2]-57.0; - f[1] = computedConstants[3]+3.0*algebraic[1]-algebraic[2]-19.0; + f[0] = 3.0*computedConstants[0]+2.0*algebraic[1]+algebraic[2]-57.0; + f[1] = computedConstants[0]+3.0*algebraic[1]-algebraic[2]-19.0; } void findRoot0(double *variables) @@ -73,13 +73,13 @@ void initialiseVariables(double *constants) { algebraic[1] = 1.0; algebraic[2] = 1.0; - constants[4] = 3.0; - constants[5] = 5.0; + constants[0] = 3.0; + constants[1] = 5.0; } void computeComputedConstants(double *constants, double *computedConstants) { - computedConstants[3] = 3.0*constants[4]+constants[5]; + computedConstants[0] = 3.0*constants[0]+constants[1]; } void computeVariables(double *constants, double *computedConstants, double *algebraic) diff --git a/tests/resources/generator/algebraic_system_with_various_dependencies/model.not.ordered.py b/tests/resources/generator/algebraic_system_with_various_dependencies/model.not.ordered.py index 2c1c63ab8c..083873c38c 100644 --- a/tests/resources/generator/algebraic_system_with_various_dependencies/model.not.ordered.py +++ b/tests/resources/generator/algebraic_system_with_various_dependencies/model.not.ordered.py @@ -41,8 +41,8 @@ def objective_function_0(u, f, data): algebraic[2] = u[0] algebraic[1] = u[1] - f[0] = 3.0*computed_constants[3]+2.0*algebraic[1]+algebraic[2]-57.0 - f[1] = computed_constants[3]+3.0*algebraic[1]-algebraic[2]-19.0 + f[0] = 3.0*computed_constants[0]+2.0*algebraic[1]+algebraic[2]-57.0 + f[1] = computed_constants[0]+3.0*algebraic[1]-algebraic[2]-19.0 def find_root_0(variables): @@ -60,12 +60,12 @@ def find_root_0(variables): def initialise_variables(constants): algebraic[1] = 1.0 algebraic[2] = 1.0 - constants[4] = 3.0 - constants[5] = 5.0 + constants[0] = 3.0 + constants[1] = 5.0 def compute_computed_constants(constants, computed_constants): - computed_constants[3] = 3.0*constants[4]+constants[5] + computed_constants[0] = 3.0*constants[0]+constants[1] def compute_variables(constants, computed_constants, algebraic): diff --git a/tests/resources/generator/algebraic_system_with_various_dependencies/model.ordered.c b/tests/resources/generator/algebraic_system_with_various_dependencies/model.ordered.c index 2802b5299a..c7e93bd95d 100644 --- a/tests/resources/generator/algebraic_system_with_various_dependencies/model.ordered.c +++ b/tests/resources/generator/algebraic_system_with_various_dependencies/model.ordered.c @@ -48,11 +48,11 @@ void objectiveFunction0(double *u, double *f, void *data) { double *variables = ((RootFindingInfo *) data)->variables; - algebraic[3] = u[0]; - algebraic[4] = u[1]; + algebraic[0] = u[0]; + algebraic[1] = u[1]; - f[0] = 3.0*computedConstants[0]+2.0*algebraic[4]+algebraic[3]-57.0; - f[1] = computedConstants[0]+3.0*algebraic[4]-algebraic[3]-19.0; + f[0] = 3.0*computedConstants[0]+2.0*algebraic[1]+algebraic[0]-57.0; + f[1] = computedConstants[0]+3.0*algebraic[1]-algebraic[0]-19.0; } void findRoot0(double *variables) @@ -60,30 +60,30 @@ void findRoot0(double *variables) RootFindingInfo rfi = { variables }; double u[2]; - u[0] = algebraic[3]; - u[1] = algebraic[4]; + u[0] = algebraic[0]; + u[1] = algebraic[1]; nlaSolve(objectiveFunction0, u, 2, &rfi); - algebraic[3] = u[0]; - algebraic[4] = u[1]; + algebraic[0] = u[0]; + algebraic[1] = u[1]; } void initialiseVariables(double *constants) { - constants[1] = 3.0; - constants[2] = 5.0; - algebraic[3] = 1.0; - algebraic[4] = 1.0; + constants[0] = 3.0; + constants[1] = 5.0; + algebraic[0] = 1.0; + algebraic[1] = 1.0; } void computeComputedConstants(double *constants, double *computedConstants) { - computedConstants[0] = 3.0*constants[1]+constants[2]; + computedConstants[0] = 3.0*constants[0]+constants[1]; } void computeVariables(double *constants, double *computedConstants, double *algebraic) { findRoot0(variables); - algebraic[5] = algebraic[4]+algebraic[3]; + algebraic[2] = algebraic[1]+algebraic[0]; } diff --git a/tests/resources/generator/algebraic_system_with_various_dependencies/model.ordered.py b/tests/resources/generator/algebraic_system_with_various_dependencies/model.ordered.py index d6259b2b98..8b965af0b9 100644 --- a/tests/resources/generator/algebraic_system_with_various_dependencies/model.ordered.py +++ b/tests/resources/generator/algebraic_system_with_various_dependencies/model.ordered.py @@ -38,36 +38,36 @@ def create_variables_array(): def objective_function_0(u, f, data): variables = data[0] - algebraic[3] = u[0] - algebraic[4] = u[1] + algebraic[0] = u[0] + algebraic[1] = u[1] - f[0] = 3.0*computed_constants[0]+2.0*algebraic[4]+algebraic[3]-57.0 - f[1] = computed_constants[0]+3.0*algebraic[4]-algebraic[3]-19.0 + f[0] = 3.0*computed_constants[0]+2.0*algebraic[1]+algebraic[0]-57.0 + f[1] = computed_constants[0]+3.0*algebraic[1]-algebraic[0]-19.0 def find_root_0(variables): u = [nan]*2 - u[0] = algebraic[3] - u[1] = algebraic[4] + u[0] = algebraic[0] + u[1] = algebraic[1] u = nla_solve(objective_function_0, u, 2, [variables]) - algebraic[3] = u[0] - algebraic[4] = u[1] + algebraic[0] = u[0] + algebraic[1] = u[1] def initialise_variables(constants): - constants[1] = 3.0 - constants[2] = 5.0 - algebraic[3] = 1.0 - algebraic[4] = 1.0 + constants[0] = 3.0 + constants[1] = 5.0 + algebraic[0] = 1.0 + algebraic[1] = 1.0 def compute_computed_constants(constants, computed_constants): - computed_constants[0] = 3.0*constants[1]+constants[2] + computed_constants[0] = 3.0*constants[0]+constants[1] def compute_variables(constants, computed_constants, algebraic): find_root_0(variables) - algebraic[5] = algebraic[4]+algebraic[3] + algebraic[2] = algebraic[1]+algebraic[0] diff --git a/tests/resources/generator/cell_geometry_model/model.c b/tests/resources/generator/cell_geometry_model/model.c index 91884cff90..a5db4ad9c7 100644 --- a/tests/resources/generator/cell_geometry_model/model.c +++ b/tests/resources/generator/cell_geometry_model/model.c @@ -37,14 +37,14 @@ void deleteArray(double *array) void initialiseVariables(double *constants) { - constants[1] = 0.01; - constants[2] = 0.0011; + constants[0] = 0.01; + constants[1] = 0.0011; } void computeComputedConstants(double *constants, double *computedConstants) { - computedConstants[0] = 1000.0*3.14*constants[2]*constants[2]*constants[1]; - computedConstants[3] = 0.02*computedConstants[0]; + computedConstants[0] = 1000.0*3.14*constants[1]*constants[1]*constants[0]; + computedConstants[1] = 0.02*computedConstants[0]; } void computeVariables(double *constants, double *computedConstants, double *algebraic) diff --git a/tests/resources/generator/cell_geometry_model/model.py b/tests/resources/generator/cell_geometry_model/model.py index bcbef6f85a..6c941fc867 100644 --- a/tests/resources/generator/cell_geometry_model/model.py +++ b/tests/resources/generator/cell_geometry_model/model.py @@ -31,13 +31,13 @@ def create_variables_array(): def initialise_variables(constants): - constants[1] = 0.01 - constants[2] = 0.0011 + constants[0] = 0.01 + constants[1] = 0.0011 def compute_computed_constants(constants, computed_constants): - computed_constants[0] = 1000.0*3.14*constants[2]*constants[2]*constants[1] - computed_constants[3] = 0.02*computed_constants[0] + computed_constants[0] = 1000.0*3.14*constants[1]*constants[1]*constants[0] + computed_constants[1] = 0.02*computed_constants[0] def compute_variables(constants, computed_constants, algebraic): diff --git a/tests/resources/generator/cellml_slc_example/model.py b/tests/resources/generator/cellml_slc_example/model.py index ea8cac8cf8..f13fcec596 100644 --- a/tests/resources/generator/cellml_slc_example/model.py +++ b/tests/resources/generator/cellml_slc_example/model.py @@ -37,19 +37,19 @@ def create_variables_array(): def initialise_variables(constants): - constants[1] = 1.1 - constants[2] = 21262500.0 - constants[3] = 150.0 - constants[4] = 3402000.0 - constants[5] = 2.0 - constants[6] = 2902500.0 - constants[7] = 810000.0 - constants[8] = 247140.0 - constants[9] = 2902500.0 + constants[0] = 1.1 + constants[1] = 21262500.0 + constants[2] = 150.0 + constants[3] = 3402000.0 + constants[4] = 2.0 + constants[5] = 2902500.0 + constants[6] = 810000.0 + constants[7] = 247140.0 + constants[8] = 2902500.0 def compute_computed_constants(constants, computed_constants): - computed_constants[0] = constants[1]*(constants[2]*constants[3]-constants[4]*constants[5])/(constants[6]*constants[5]+constants[9]*constants[3]+constants[8]*constants[5]*constants[3]+constants[7]) + computed_constants[0] = constants[0]*(constants[1]*constants[2]-constants[3]*constants[4])/(constants[5]*constants[4]+constants[8]*constants[2]+constants[7]*constants[4]*constants[2]+constants[6]) def compute_variables(constants, computed_constants, algebraic): diff --git a/tests/resources/generator/cellml_unit_scaling_constant/model.c b/tests/resources/generator/cellml_unit_scaling_constant/model.c index 79847cd595..dea2a68eaa 100644 --- a/tests/resources/generator/cellml_unit_scaling_constant/model.c +++ b/tests/resources/generator/cellml_unit_scaling_constant/model.c @@ -41,8 +41,8 @@ void initialiseVariables(double *constants) void computeComputedConstants(double *constants, double *computedConstants) { - computedConstants[1] = constants[0]+constants[0]; - computedConstants[2] = 0.001*constants[0]+0.001*constants[0]; + computedConstants[0] = constants[0]+constants[0]; + computedConstants[1] = 0.001*constants[0]+0.001*constants[0]; } void computeVariables(double *constants, double *computedConstants, double *algebraic) diff --git a/tests/resources/generator/cellml_unit_scaling_constant/model.py b/tests/resources/generator/cellml_unit_scaling_constant/model.py index 8d1f0b000f..ec8df9c839 100644 --- a/tests/resources/generator/cellml_unit_scaling_constant/model.py +++ b/tests/resources/generator/cellml_unit_scaling_constant/model.py @@ -34,8 +34,8 @@ def initialise_variables(constants): def compute_computed_constants(constants, computed_constants): - computed_constants[1] = constants[0]+constants[0] - computed_constants[2] = 0.001*constants[0]+0.001*constants[0] + computed_constants[0] = constants[0]+constants[0] + computed_constants[1] = 0.001*constants[0]+0.001*constants[0] def compute_variables(constants, computed_constants, algebraic): diff --git a/tests/resources/generator/dae_cellml_1_1_model/model.c b/tests/resources/generator/dae_cellml_1_1_model/model.c index aff41afb7a..89c29978dd 100644 --- a/tests/resources/generator/dae_cellml_1_1_model/model.c +++ b/tests/resources/generator/dae_cellml_1_1_model/model.c @@ -79,7 +79,7 @@ void objectiveFunction0(double *u, double *f, void *data) algebraic[0] = u[0]; - f[0] = constants[1]-(algebraic[0]+algebraic[2]); + f[0] = constants[0]-(algebraic[0]+algebraic[1]); } void findRoot0(double voi, double *states, double *rates, double *variables) @@ -101,9 +101,9 @@ void objectiveFunction1(double *u, double *f, void *data) double *rates = ((RootFindingInfo *) data)->rates; double *variables = ((RootFindingInfo *) data)->variables; - algebraic[6] = u[0]; + algebraic[4] = u[0]; - f[0] = algebraic[4]-(algebraic[5]+algebraic[6]); + f[0] = algebraic[2]-(algebraic[3]+algebraic[4]); } void findRoot1(double voi, double *states, double *rates, double *variables) @@ -111,22 +111,22 @@ void findRoot1(double voi, double *states, double *rates, double *variables) RootFindingInfo rfi = { voi, states, rates, variables }; double u[1]; - u[0] = algebraic[6]; + u[0] = algebraic[4]; nlaSolve(objectiveFunction1, u, 1, &rfi); - algebraic[6] = u[0]; + algebraic[4] = u[0]; } void initialiseVariables(double *states, double *rates, double *constants) { algebraic[0] = 0.0; + constants[0] = 1.0; constants[1] = 1.0; - constants[3] = 1.0; - algebraic[6] = 0.0; - constants[7] = 20.0; - constants[8] = 2.0; - constants[9] = 10.0; + algebraic[4] = 0.0; + constants[2] = 20.0; + constants[3] = 2.0; + constants[4] = 10.0; states[0] = 1.0; states[1] = 0.0; } @@ -137,20 +137,20 @@ void computeComputedConstants(double *constants, double *computedConstants) void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic) { - algebraic[2] = states[1]+constants[3]; + algebraic[1] = states[1]+constants[1]; findRoot0(voi, states, rates, variables); rates[0] = algebraic[0]; - algebraic[4] = states[0]/constants[7]; - algebraic[5] = constants[8]*algebraic[2]; + algebraic[2] = states[0]/constants[2]; + algebraic[3] = constants[3]*algebraic[1]; findRoot1(voi, states, rates, variables); - rates[1] = algebraic[6]/constants[9]; + rates[1] = algebraic[4]/constants[4]; } void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic) { - algebraic[2] = states[1]+constants[3]; + algebraic[1] = states[1]+constants[1]; findRoot0(voi, states, rates, variables); - algebraic[4] = states[0]/constants[7]; - algebraic[5] = constants[8]*algebraic[2]; + algebraic[2] = states[0]/constants[2]; + algebraic[3] = constants[3]*algebraic[1]; findRoot1(voi, states, rates, variables); } diff --git a/tests/resources/generator/dae_cellml_1_1_model/model.py b/tests/resources/generator/dae_cellml_1_1_model/model.py index 764fb8703d..c1147dd4ff 100644 --- a/tests/resources/generator/dae_cellml_1_1_model/model.py +++ b/tests/resources/generator/dae_cellml_1_1_model/model.py @@ -61,7 +61,7 @@ def objective_function_0(u, f, data): algebraic[0] = u[0] - f[0] = constants[1]-(algebraic[0]+algebraic[2]) + f[0] = constants[0]-(algebraic[0]+algebraic[1]) def find_root_0(voi, states, rates, variables): @@ -80,29 +80,29 @@ def objective_function_1(u, f, data): rates = data[2] variables = data[3] - algebraic[6] = u[0] + algebraic[4] = u[0] - f[0] = algebraic[4]-(algebraic[5]+algebraic[6]) + f[0] = algebraic[2]-(algebraic[3]+algebraic[4]) def find_root_1(voi, states, rates, variables): u = [nan]*1 - u[0] = algebraic[6] + u[0] = algebraic[4] u = nla_solve(objective_function_1, u, 1, [voi, states, rates, variables]) - algebraic[6] = u[0] + algebraic[4] = u[0] def initialise_variables(states, rates, constants): algebraic[0] = 0.0 + constants[0] = 1.0 constants[1] = 1.0 - constants[3] = 1.0 - algebraic[6] = 0.0 - constants[7] = 20.0 - constants[8] = 2.0 - constants[9] = 10.0 + algebraic[4] = 0.0 + constants[2] = 20.0 + constants[3] = 2.0 + constants[4] = 10.0 states[0] = 1.0 states[1] = 0.0 @@ -112,18 +112,18 @@ def compute_computed_constants(constants, computed_constants): def compute_rates(voi, states, rates, constants, computed_constants, algebraic): - algebraic[2] = states[1]+constants[3] + algebraic[1] = states[1]+constants[1] find_root_0(voi, states, rates, variables) rates[0] = algebraic[0] - algebraic[4] = states[0]/constants[7] - algebraic[5] = constants[8]*algebraic[2] + algebraic[2] = states[0]/constants[2] + algebraic[3] = constants[3]*algebraic[1] find_root_1(voi, states, rates, variables) - rates[1] = algebraic[6]/constants[9] + rates[1] = algebraic[4]/constants[4] def compute_variables(voi, states, rates, constants, computed_constants, algebraic): - algebraic[2] = states[1]+constants[3] + algebraic[1] = states[1]+constants[1] find_root_0(voi, states, rates, variables) - algebraic[4] = states[0]/constants[7] - algebraic[5] = constants[8]*algebraic[2] + algebraic[2] = states[0]/constants[2] + algebraic[3] = constants[3]*algebraic[1] find_root_1(voi, states, rates, variables) diff --git a/tests/resources/generator/fabbri_fantini_wilders_severi_human_san_model_2017/model.c b/tests/resources/generator/fabbri_fantini_wilders_severi_human_san_model_2017/model.c index ccb8d7ddf3..bfbc945a46 100644 --- a/tests/resources/generator/fabbri_fantini_wilders_severi_human_san_model_2017/model.c +++ b/tests/resources/generator/fabbri_fantini_wilders_severi_human_san_model_2017/model.c @@ -302,95 +302,95 @@ void initialiseVariables(double *states, double *rates, double *constants) { constants[0] = 0.0; constants[1] = 0.0; + constants[2] = 140.0; + constants[3] = 5.4; constants[4] = 140.0; - constants[7] = 5.4; - constants[8] = 140.0; - constants[10] = 1.8; - constants[11] = 1.0; - constants[17] = 96485.3415; - constants[22] = 14.0; - constants[23] = 1.4; - constants[24] = 0.08105; - constants[25] = 0.0; - constants[30] = 3.343; - constants[39] = 26.44; - constants[40] = 0.0207; - constants[41] = 0.1369; - constants[43] = 395.3; - constants[44] = 2.289; - constants[45] = 0.4315; - constants[46] = 26.44; - constants[47] = 4.663; - constants[48] = 3.663; - constants[49] = 0.0; - constants[51] = 1628.0; - constants[52] = 561.4; - constants[54] = 148041085.1; - constants[57] = 15.0; - constants[58] = 1.0; - constants[59] = 0.45; - constants[60] = 2.5; - constants[62] = 10000.0; - constants[64] = 500.0; - constants[65] = 5.0; - constants[66] = 660.0; - constants[70] = 5.0; - constants[72] = 5.469e-5; - constants[74] = 0.000286113; - constants[75] = 5.0e-5; - constants[77] = 0.04; - constants[79] = 88800.0; - constants[80] = 446.0; - constants[82] = 227700.0; - constants[83] = 7.51; - constants[85] = 2277.0; - constants[86] = 2.5; - constants[87] = 751.0; - constants[89] = 1.642e6; - constants[90] = 542.0; - constants[93] = 175.4; - constants[94] = 445.0; - constants[95] = 0.031; - constants[96] = 0.062; - constants[97] = 0.045; - constants[98] = 10.0; - constants[104] = 67.0; - constants[105] = 3.9; - constants[106] = 0.02; - constants[107] = 0.0012; - constants[108] = 0.46; - constants[109] = 0.0116; - constants[118] = 5.7e-5; - constants[119] = 8314.472; - constants[120] = 310.0; - constants[122] = 0.0; - constants[123] = -35.0; - constants[124] = 0.5; - constants[125] = 0.5; - constants[126] = -45.0; - constants[128] = 0.00427; - constants[129] = 45.0; - constants[131] = 0.5927; - constants[135] = 0.0; - constants[141] = 0.0; - constants[144] = 0.0223; - constants[146] = 0.0; - constants[150] = 1.0e-5; - constants[157] = 0.1539e-3; - constants[163] = 0.4578; - constants[169] = -16.4508; - constants[170] = 4.3371; - constants[177] = 0.0; - constants[178] = 0.0; - constants[181] = 0.000338; - constants[183] = 0.0075; - constants[184] = 0.04132; - constants[189] = 0.0; - constants[190] = 3.5e-3; - constants[195] = 0.00424; - constants[204] = 0.00065; - constants[211] = 1.0; - constants[212] = 0.00345; + constants[5] = 1.8; + constants[6] = 1.0; + constants[7] = 96485.3415; + constants[8] = 14.0; + constants[9] = 1.4; + constants[10] = 0.08105; + constants[11] = 0.0; + constants[12] = 3.343; + constants[13] = 26.44; + constants[14] = 0.0207; + constants[15] = 0.1369; + constants[16] = 395.3; + constants[17] = 2.289; + constants[18] = 0.4315; + constants[19] = 26.44; + constants[20] = 4.663; + constants[21] = 3.663; + constants[22] = 0.0; + constants[23] = 1628.0; + constants[24] = 561.4; + constants[25] = 148041085.1; + constants[26] = 15.0; + constants[27] = 1.0; + constants[28] = 0.45; + constants[29] = 2.5; + constants[30] = 10000.0; + constants[31] = 500.0; + constants[32] = 5.0; + constants[33] = 660.0; + constants[34] = 5.0; + constants[35] = 5.469e-5; + constants[36] = 0.000286113; + constants[37] = 5.0e-5; + constants[38] = 0.04; + constants[39] = 88800.0; + constants[40] = 446.0; + constants[41] = 227700.0; + constants[42] = 7.51; + constants[43] = 2277.0; + constants[44] = 2.5; + constants[45] = 751.0; + constants[46] = 1.642e6; + constants[47] = 542.0; + constants[48] = 175.4; + constants[49] = 445.0; + constants[50] = 0.031; + constants[51] = 0.062; + constants[52] = 0.045; + constants[53] = 10.0; + constants[54] = 67.0; + constants[55] = 3.9; + constants[56] = 0.02; + constants[57] = 0.0012; + constants[58] = 0.46; + constants[59] = 0.0116; + constants[60] = 5.7e-5; + constants[61] = 8314.472; + constants[62] = 310.0; + constants[63] = 0.0; + constants[64] = -35.0; + constants[65] = 0.5; + constants[66] = 0.5; + constants[67] = -45.0; + constants[68] = 0.00427; + constants[69] = 45.0; + constants[70] = 0.5927; + constants[71] = 0.0; + constants[72] = 0.0; + constants[73] = 0.0223; + constants[74] = 0.0; + constants[75] = 1.0e-5; + constants[76] = 0.1539e-3; + constants[77] = 0.4578; + constants[78] = -16.4508; + constants[79] = 4.3371; + constants[80] = 0.0; + constants[81] = 0.0; + constants[82] = 0.000338; + constants[83] = 0.0075; + constants[84] = 0.04132; + constants[85] = 0.0; + constants[86] = 3.5e-3; + constants[87] = 0.00424; + constants[88] = 0.00065; + constants[89] = 1.0; + constants[90] = 0.00345; states[0] = 6.226104e-5; states[1] = 5.0; states[2] = 0.409551; @@ -428,266 +428,266 @@ void initialiseVariables(double *states, double *rates, double *constants) void computeComputedConstants(double *constants, double *computedConstants) { - computedConstants[3] = constants[119]*constants[120]/constants[17]; - computedConstants[6] = computedConstants[3]*log(constants[7]/constants[8]); - computedConstants[20] = (constants[1] > 0.0)?1.2:1.0; - computedConstants[35] = constants[4]/(constants[47]+constants[4]); - computedConstants[68] = (constants[1] > 0.0)?-0.25:(constants[0] > 0.0)?0.7*constants[0]/(0.00009+constants[0]):0.0; - computedConstants[69] = constants[70]*(1.0-computedConstants[68]); - computedConstants[103] = 0.000000001*3.14159265358979*pow(constants[105], 2.0)*constants[104]; - computedConstants[19] = 0.000000001*2.0*3.14159265358979*constants[106]*(constants[105]-constants[106]/2.0)*constants[104]; - computedConstants[100] = constants[107]*computedConstants[103]; - computedConstants[18] = constants[108]*computedConstants[103]-computedConstants[19]; - computedConstants[99] = constants[109]*computedConstants[103]; - computedConstants[127] = constants[128]/(constants[7]/(constants[7]+constants[129])); - computedConstants[130] = computedConstants[127]/(constants[131]+1.0); - computedConstants[132] = constants[131]*computedConstants[130]; - computedConstants[133] = computedConstants[132]*constants[7]/(constants[7]+constants[129]); - computedConstants[134] = computedConstants[130]*constants[7]/(constants[7]+constants[129]); - computedConstants[137] = (constants[0] > 0.0)?-1.0-9.898*pow(1.0*constants[0], 0.618)/(pow(1.0*constants[0], 0.618)+0.00122423):0.0; - computedConstants[138] = (constants[1] > 0.0)?7.5:0.0; - computedConstants[162] = (constants[1] > 0.0)?1.23:1.0; - computedConstants[165] = 0.31*constants[0]/(constants[0]+0.00009); - computedConstants[166] = (constants[1] > 0.0)?-8.0:0.0; - computedConstants[167] = (constants[1] > 0.0)?-27.0:0.0; - computedConstants[203] = (constants[1] > 0.0)?1.2*constants[204]:constants[204]; - computedConstants[206] = (constants[1] > 0.0)?-14.0:0.0; - computedConstants[213] = (3.5988-0.025641)/(1.0+0.0000012155/pow(1.0*constants[0], 1.6951))+0.025641; + computedConstants[0] = constants[61]*constants[62]/constants[7]; + computedConstants[1] = computedConstants[0]*log(constants[3]/constants[4]); + computedConstants[4] = (constants[1] > 0.0)?1.2:1.0; + computedConstants[5] = constants[2]/(constants[20]+constants[2]); + computedConstants[6] = (constants[1] > 0.0)?-0.25:(constants[0] > 0.0)?0.7*constants[0]/(0.00009+constants[0]):0.0; + computedConstants[7] = constants[34]*(1.0-computedConstants[6]); + computedConstants[10] = 0.000000001*3.14159265358979*pow(constants[55], 2.0)*constants[54]; + computedConstants[3] = 0.000000001*2.0*3.14159265358979*constants[56]*(constants[55]-constants[56]/2.0)*constants[54]; + computedConstants[9] = constants[57]*computedConstants[10]; + computedConstants[2] = constants[58]*computedConstants[10]-computedConstants[3]; + computedConstants[8] = constants[59]*computedConstants[10]; + computedConstants[11] = constants[68]/(constants[3]/(constants[3]+constants[69])); + computedConstants[12] = computedConstants[11]/(constants[70]+1.0); + computedConstants[13] = constants[70]*computedConstants[12]; + computedConstants[14] = computedConstants[13]*constants[3]/(constants[3]+constants[69]); + computedConstants[15] = computedConstants[12]*constants[3]/(constants[3]+constants[69]); + computedConstants[16] = (constants[0] > 0.0)?-1.0-9.898*pow(1.0*constants[0], 0.618)/(pow(1.0*constants[0], 0.618)+0.00122423):0.0; + computedConstants[17] = (constants[1] > 0.0)?7.5:0.0; + computedConstants[18] = (constants[1] > 0.0)?1.23:1.0; + computedConstants[19] = 0.31*constants[0]/(constants[0]+0.00009); + computedConstants[20] = (constants[1] > 0.0)?-8.0:0.0; + computedConstants[21] = (constants[1] > 0.0)?-27.0:0.0; + computedConstants[22] = (constants[1] > 0.0)?1.2*constants[88]:constants[88]; + computedConstants[23] = (constants[1] > 0.0)?-14.0:0.0; + computedConstants[24] = (3.5988-0.025641)/(1.0+0.0000012155/pow(1.0*constants[0], 1.6951))+0.025641; } void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic) { - algebraic[5] = states[1]; - algebraic[142] = computedConstants[3]*log((constants[4]+0.12*constants[7])/(algebraic[5]+0.12*constants[8])); - algebraic[121] = ((voi > constants[124]) && (voi < constants[124]+constants[125]))?constants[123]:constants[126]; - algebraic[21] = (constants[122] >= 1.0)?algebraic[121]:states[15]; - algebraic[143] = constants[144]*pow(states[18], 3.0)*states[17]*(algebraic[21]-algebraic[142]); - algebraic[145] = constants[146]*pow(states[18], 3.0)*(algebraic[21]-algebraic[142]); - algebraic[12] = algebraic[143]+algebraic[145]; - algebraic[15] = 0.0000185*constants[163]*(algebraic[21]-0.0)/(computedConstants[3]*(1.0-exp(-1.0*(algebraic[21]-0.0)/computedConstants[3])))*(algebraic[5]-constants[4]*exp(-1.0*(algebraic[21]-0.0)/computedConstants[3]))*states[23]*states[22]*states[21]; - algebraic[2] = computedConstants[3]*log(constants[4]/algebraic[5]); - algebraic[16] = states[16]*computedConstants[133]*(algebraic[21]-algebraic[2])*(1.0-constants[135]); - algebraic[14] = computedConstants[20]*constants[24]*pow(1.0+pow(constants[23]/constants[7], 1.2), -1.0)*pow(1.0+pow(constants[22]/algebraic[5], 1.3), -1.0)*pow(1.0+exp(-(algebraic[21]-algebraic[2]+110.0)/20.0), -1.0); - algebraic[50] = 1.0+constants[10]/constants[48]*(1.0+exp(constants[49]*algebraic[21]/computedConstants[3]))+constants[4]/constants[51]*(1.0+constants[4]/constants[52]*(1.0+constants[4]/constants[47])); - algebraic[27] = constants[10]/constants[48]*exp(constants[49]*algebraic[21]/computedConstants[3])/algebraic[50]; - algebraic[42] = 1.0+states[0]/constants[40]*(1.0+exp(-constants[41]*algebraic[21]/computedConstants[3])+algebraic[5]/constants[46])+algebraic[5]/constants[43]*(1.0+algebraic[5]/constants[44]*(1.0+algebraic[5]/constants[39])); - algebraic[29] = states[0]/constants[40]*exp(-constants[41]*algebraic[21]/computedConstants[3])/algebraic[42]; - algebraic[36] = algebraic[5]/(constants[39]+algebraic[5]); - algebraic[37] = exp(constants[45]*algebraic[21]/(2.0*computedConstants[3])); - algebraic[33] = exp(-constants[45]*algebraic[21]/(2.0*computedConstants[3])); - algebraic[38] = algebraic[5]/constants[43]*algebraic[5]/constants[44]*(1.0+algebraic[5]/constants[39])*exp(constants[45]*algebraic[21]/(2.0*computedConstants[3]))/algebraic[42]; - algebraic[26] = algebraic[37]*algebraic[36]*(algebraic[38]+algebraic[29])+algebraic[33]*algebraic[29]*(computedConstants[35]+algebraic[37]); - algebraic[34] = constants[4]/constants[51]*constants[4]/constants[52]*(1.0+constants[4]/constants[47])*exp(-constants[45]*algebraic[21]/(2.0*computedConstants[3]))/algebraic[50]; - algebraic[28] = algebraic[33]*computedConstants[35]*(algebraic[34]+algebraic[27])+algebraic[27]*algebraic[37]*(algebraic[36]+algebraic[33]); - algebraic[31] = algebraic[34]*computedConstants[35]*(algebraic[38]+algebraic[29])+algebraic[38]*algebraic[27]*(computedConstants[35]+algebraic[37]); - algebraic[32] = algebraic[38]*algebraic[36]*(algebraic[34]+algebraic[27])+algebraic[29]*algebraic[34]*(algebraic[36]+algebraic[33]); - algebraic[13] = (1.0-constants[25])*constants[30]*(algebraic[26]*algebraic[27]-algebraic[28]*algebraic[29])/(algebraic[28]+algebraic[26]+algebraic[32]+algebraic[31]); - rates[1] = (1.0-constants[11])*-1.0*(algebraic[12]+algebraic[16]+algebraic[15]+3.0*algebraic[14]+3.0*algebraic[13])/(1.0*(computedConstants[18]+computedConstants[19])*constants[17]); - algebraic[56] = constants[57]-(constants[57]-constants[58])/(1.0+pow(constants[59]/states[2], constants[60])); - algebraic[63] = constants[64]*algebraic[56]; - algebraic[61] = constants[62]/algebraic[56]; - rates[4] = constants[65]*states[5]-algebraic[63]*states[0]*states[4]-(algebraic[61]*pow(states[0], 2.0)*states[4]-constants[66]*states[3]); - rates[3] = algebraic[61]*pow(states[0], 2.0)*states[4]-constants[66]*states[3]-(algebraic[63]*states[0]*states[3]-constants[65]*states[6]); - rates[6] = algebraic[63]*states[0]*states[3]-constants[65]*states[6]-(constants[66]*states[6]-algebraic[61]*pow(states[0], 2.0)*states[5]); - rates[5] = constants[66]*states[6]-algebraic[61]*pow(states[0], 2.0)*states[5]-(constants[65]*states[5]-algebraic[63]*states[0]*states[4]); - algebraic[78] = constants[79]*states[7]*(1.0-states[9])-constants[80]*states[9]; - rates[9] = algebraic[78]; - algebraic[81] = constants[82]*states[7]*(1.0-(states[10]+states[11]))-constants[83]*states[10]; - rates[10] = algebraic[81]; - algebraic[84] = constants[85]*constants[86]*(1.0-(states[10]+states[11]))-constants[87]*states[11]; - rates[11] = algebraic[84]; - algebraic[88] = constants[89]*states[7]*(1.0-states[12])-constants[90]*states[12]; - rates[12] = algebraic[88]; - algebraic[91] = constants[89]*states[0]*(1.0-states[13])-constants[90]*states[13]; - rates[13] = algebraic[91]; - algebraic[92] = constants[93]*states[2]*(1.0-states[14])-constants[94]*states[14]; - rates[14] = algebraic[92]; - algebraic[71] = (states[0]-states[7])/constants[72]; - algebraic[73] = computedConstants[69]/(1.0+exp((-states[7]+constants[74])/constants[75])); - rates[7] = 1.0*(algebraic[71]*computedConstants[19]-algebraic[73]*computedConstants[99])/computedConstants[18]-(constants[97]*algebraic[88]+constants[95]*algebraic[78]+constants[96]*algebraic[81]); - algebraic[53] = constants[54]*states[3]*(states[2]-states[0]); - algebraic[101] = 2.0*constants[163]*(algebraic[21]-0.0)/(computedConstants[3]*(1.0-exp(-1.0*(algebraic[21]-0.0)*2.0/computedConstants[3])))*(states[0]-constants[10]*exp(-2.0*(algebraic[21]-0.0)/computedConstants[3]))*states[23]*states[22]*states[21]; - algebraic[102] = 2.0*constants[184]*algebraic[21]/(computedConstants[3]*(1.0-exp(-1.0*algebraic[21]*2.0/computedConstants[3])))*(states[0]-constants[10]*exp(-2.0*algebraic[21]/computedConstants[3]))*states[25]*states[24]; - rates[0] = algebraic[53]*computedConstants[100]/computedConstants[19]-((algebraic[101]+algebraic[102]-2.0*algebraic[13])/(2.0*constants[17]*computedConstants[19])+algebraic[71]+constants[97]*algebraic[91]); - algebraic[76] = (states[8]-states[2])/constants[77]; - rates[8] = algebraic[73]-algebraic[76]*computedConstants[100]/computedConstants[99]; - rates[2] = algebraic[76]-(algebraic[53]+constants[98]*algebraic[92]); - algebraic[136] = states[16]*computedConstants[134]*(algebraic[21]-computedConstants[6])*(1.0-constants[135]); - algebraic[111] = algebraic[16]+algebraic[136]; - algebraic[112] = constants[157]*states[20]*states[19]*(algebraic[21]-computedConstants[6]); - algebraic[113] = (constants[0] > 0.0)?constants[211]*constants[212]*(algebraic[21]-computedConstants[6])*(1.0+exp((algebraic[21]+20.0)/20.0))*states[32]:0.0; - algebraic[164] = 0.000365*constants[163]*(algebraic[21]-0.0)/(computedConstants[3]*(1.0-exp(-1.0*(algebraic[21]-0.0)/computedConstants[3])))*(constants[8]-constants[7]*exp(-1.0*(algebraic[21]-0.0)/computedConstants[3]))*states[23]*states[22]*states[21]; - algebraic[114] = (algebraic[101]+algebraic[164]+algebraic[15])*(1.0-computedConstants[165])*1.0*computedConstants[162]; - algebraic[115] = constants[190]*(algebraic[21]-computedConstants[6])*states[27]*states[26]; - algebraic[205] = computedConstants[3]*log((constants[7]+0.12*constants[4])/(constants[8]+0.12*algebraic[5])); - algebraic[116] = computedConstants[203]*(algebraic[21]-algebraic[205])*pow(states[31], 2.0); - algebraic[117] = constants[195]*(algebraic[21]-computedConstants[6])*(0.9*states[29]+0.1*states[30])*states[28]; - algebraic[110] = algebraic[111]+algebraic[117]+algebraic[116]+algebraic[115]+algebraic[14]+algebraic[13]+algebraic[12]+algebraic[114]+algebraic[102]+algebraic[113]+algebraic[112]; - rates[15] = -algebraic[110]/constants[118]; - algebraic[140] = (algebraic[21] < -(80.0-computedConstants[137]-computedConstants[138]-constants[141]))?0.01329+0.99921/(1.0+exp((algebraic[21]+97.134-computedConstants[137]-computedConstants[138]-constants[141])/8.1752)):0.0002501*exp(-(algebraic[21]-computedConstants[137]-computedConstants[138]-constants[141])/12.861); - algebraic[139] = 1.0/(0.36*(algebraic[21]+148.8-computedConstants[137]-computedConstants[138])/(exp(0.066*(algebraic[21]+148.8-computedConstants[137]-computedConstants[138]))-1.0)+0.1*(algebraic[21]+87.3-computedConstants[137]-computedConstants[138])/(1.0-exp(-0.2*(algebraic[21]+87.3-computedConstants[137]-computedConstants[138]))))-0.054; - rates[16] = (algebraic[140]-states[16])/algebraic[139]; - algebraic[147] = 1.0/(1.0+exp(-(algebraic[21]+42.0504)/8.3106)); - algebraic[148] = algebraic[21]+41.0; - algebraic[149] = (fabs(algebraic[148]) < constants[150])?2000.0:200.0*algebraic[148]/(1.0-exp(-0.1*algebraic[148])); - algebraic[151] = 8000.0*exp(-0.056*(algebraic[21]+66.0)); - algebraic[152] = 1.0/(algebraic[149]+algebraic[151]); - rates[18] = (algebraic[147]-states[18])/algebraic[152]; - algebraic[153] = 1.0/(1.0+exp((algebraic[21]+69.804)/4.4565)); - algebraic[154] = 20.0*exp(-0.125*(algebraic[21]+75.0)); - algebraic[155] = 2000.0/(320.0*exp(-0.1*(algebraic[21]+75.0))+1.0); - algebraic[156] = 1.0/(algebraic[154]+algebraic[155]); - rates[17] = (algebraic[153]-states[17])/algebraic[156]; - algebraic[158] = 1.0/(1.0+exp((algebraic[21]+6.0)/-8.6)); - algebraic[159] = 0.009/(1.0+exp((algebraic[21]+5.0)/12.0))+0.0005; - rates[20] = (algebraic[158]-states[20])/algebraic[159]; - algebraic[160] = 1.0/(1.0+exp((algebraic[21]+7.5)/10.0)); - algebraic[161] = 0.59/(1.0+exp((algebraic[21]+60.0)/10.0))+3.05; - rates[19] = (algebraic[160]-states[19])/algebraic[161]; - algebraic[168] = 1.0/(1.0+exp(-(algebraic[21]-constants[169]-computedConstants[166])/(constants[170]*(1.0+computedConstants[167]/100.0)))); - algebraic[174] = (algebraic[21] == -41.8)?-41.80001:(algebraic[21] == 0.0)?0.0:(algebraic[21] == -6.8)?-6.80001:algebraic[21]; - algebraic[172] = -0.02839*(algebraic[174]+41.8)/(exp(-(algebraic[174]+41.8)/2.5)-1.0)-0.0849*(algebraic[174]+6.8)/(exp(-(algebraic[174]+6.8)/4.8)-1.0); - algebraic[175] = (algebraic[21] == -1.8)?-1.80001:algebraic[21]; - algebraic[173] = 0.01143*(algebraic[175]+1.8)/(exp((algebraic[175]+1.8)/2.5)-1.0); - algebraic[171] = 0.001/(algebraic[172]+algebraic[173]); - rates[23] = (algebraic[168]-states[23])/algebraic[171]; - algebraic[176] = 1.0/(1.0+exp((algebraic[21]+37.4+constants[177])/(5.3+constants[178]))); - algebraic[179] = 0.001*(44.3+230.0*exp(-pow((algebraic[21]+36.0)/10.0, 2.0))); - rates[22] = (algebraic[176]-states[22])/algebraic[179]; - algebraic[180] = constants[181]/(constants[181]+states[0]); - algebraic[182] = 0.001*algebraic[180]/constants[183]; - rates[21] = (algebraic[180]-states[21])/algebraic[182]; - algebraic[185] = 1.0/(1.0+exp(-(algebraic[21]+38.3)/5.5)); - algebraic[186] = 0.001/(1.068*exp((algebraic[21]+38.3)/30.0)+1.068*exp(-(algebraic[21]+38.3)/30.0)); - rates[25] = (algebraic[185]-states[25])/algebraic[186]; - algebraic[187] = 1.0/(1.0+exp((algebraic[21]+58.7)/3.8)); - algebraic[188] = 1.0/(16.67*exp(-(algebraic[21]+75.0)/83.3)+16.67*exp((algebraic[21]+75.0)/15.38))+constants[189]; - rates[24] = (algebraic[187]-states[24])/algebraic[188]; - algebraic[191] = 1.0/(1.0+exp((algebraic[21]+49.0)/13.0)); - algebraic[192] = 0.001*0.6*(65.17/(0.57*exp(-0.08*(algebraic[21]+44.0))+0.065*exp(0.1*(algebraic[21]+45.93)))+10.1); - rates[27] = (algebraic[191]-states[27])/algebraic[192]; - algebraic[193] = 1.0/(1.0+exp(-(algebraic[21]-19.3)/15.0)); - algebraic[194] = 0.001*0.66*1.4*(15.59/(1.037*exp(0.09*(algebraic[21]+30.61))+0.369*exp(-0.12*(algebraic[21]+23.84)))+2.98); - rates[26] = (algebraic[193]-states[26])/algebraic[194]; - algebraic[198] = 1.0/(1.0+exp(-(algebraic[21]+10.0144)/7.6607)); - algebraic[199] = 0.84655354/(4.2*exp(algebraic[21]/17.0)+0.15*exp(-algebraic[21]/21.6)); - rates[30] = (algebraic[198]-states[30])/algebraic[199]; - algebraic[200] = 1.0/(30.0*exp(algebraic[21]/10.0)+exp(-algebraic[21]/12.0)); - rates[29] = (algebraic[198]-states[29])/algebraic[200]; - algebraic[202] = 1.0/(1.0+exp((algebraic[21]+28.6)/17.1)); - algebraic[201] = 1.0/(100.0*exp(-algebraic[21]/54.645)+656.0*exp(algebraic[21]/106.157)); - rates[28] = (algebraic[202]-states[28])/algebraic[201]; - algebraic[207] = sqrt(1.0/(1.0+exp(-(algebraic[21]+0.6383-computedConstants[206])/10.7071))); - algebraic[209] = 28.0/(1.0+exp(-(algebraic[21]-40.0-computedConstants[206])/3.0)); - algebraic[210] = 1.0*exp(-(algebraic[21]-computedConstants[206]-5.0)/25.0); - algebraic[208] = 1.0/(algebraic[209]+algebraic[210]); - rates[31] = (algebraic[207]-states[31])/algebraic[208]; - algebraic[214] = 10.0*exp(0.0133*(algebraic[21]+40.0)); - algebraic[215] = computedConstants[213]/(computedConstants[213]+algebraic[214]); - algebraic[216] = 1.0/(computedConstants[213]+algebraic[214]); - rates[32] = (algebraic[215]-states[32])/algebraic[216]; + algebraic[1] = states[1]; + algebraic[51] = computedConstants[0]*log((constants[2]+0.12*constants[3])/(algebraic[1]+0.12*constants[4])); + algebraic[47] = ((voi > constants[65]) && (voi < constants[65]+constants[66]))?constants[64]:constants[67]; + algebraic[8] = (constants[63] >= 1.0)?algebraic[47]:states[15]; + algebraic[52] = constants[73]*pow(states[18], 3.0)*states[17]*(algebraic[8]-algebraic[51]); + algebraic[53] = constants[74]*pow(states[18], 3.0)*(algebraic[8]-algebraic[51]); + algebraic[3] = algebraic[52]+algebraic[53]; + algebraic[6] = 0.0000185*constants[77]*(algebraic[8]-0.0)/(computedConstants[0]*(1.0-exp(-1.0*(algebraic[8]-0.0)/computedConstants[0])))*(algebraic[1]-constants[2]*exp(-1.0*(algebraic[8]-0.0)/computedConstants[0]))*states[23]*states[22]*states[21]; + algebraic[0] = computedConstants[0]*log(constants[2]/algebraic[1]); + algebraic[7] = states[16]*computedConstants[14]*(algebraic[8]-algebraic[0])*(1.0-constants[71]); + algebraic[5] = computedConstants[4]*constants[10]*pow(1.0+pow(constants[9]/constants[3], 1.2), -1.0)*pow(1.0+pow(constants[8]/algebraic[1], 1.3), -1.0)*pow(1.0+exp(-(algebraic[8]-algebraic[0]+110.0)/20.0), -1.0); + algebraic[21] = 1.0+constants[5]/constants[21]*(1.0+exp(constants[22]*algebraic[8]/computedConstants[0]))+constants[2]/constants[23]*(1.0+constants[2]/constants[24]*(1.0+constants[2]/constants[20])); + algebraic[10] = constants[5]/constants[21]*exp(constants[22]*algebraic[8]/computedConstants[0])/algebraic[21]; + algebraic[20] = 1.0+states[0]/constants[14]*(1.0+exp(-constants[15]*algebraic[8]/computedConstants[0])+algebraic[1]/constants[19])+algebraic[1]/constants[16]*(1.0+algebraic[1]/constants[17]*(1.0+algebraic[1]/constants[13])); + algebraic[12] = states[0]/constants[14]*exp(-constants[15]*algebraic[8]/computedConstants[0])/algebraic[20]; + algebraic[17] = algebraic[1]/(constants[13]+algebraic[1]); + algebraic[18] = exp(constants[18]*algebraic[8]/(2.0*computedConstants[0])); + algebraic[15] = exp(-constants[18]*algebraic[8]/(2.0*computedConstants[0])); + algebraic[19] = algebraic[1]/constants[16]*algebraic[1]/constants[17]*(1.0+algebraic[1]/constants[13])*exp(constants[18]*algebraic[8]/(2.0*computedConstants[0]))/algebraic[20]; + algebraic[9] = algebraic[18]*algebraic[17]*(algebraic[19]+algebraic[12])+algebraic[15]*algebraic[12]*(computedConstants[5]+algebraic[18]); + algebraic[16] = constants[2]/constants[23]*constants[2]/constants[24]*(1.0+constants[2]/constants[20])*exp(-constants[18]*algebraic[8]/(2.0*computedConstants[0]))/algebraic[21]; + algebraic[11] = algebraic[15]*computedConstants[5]*(algebraic[16]+algebraic[10])+algebraic[10]*algebraic[18]*(algebraic[17]+algebraic[15]); + algebraic[13] = algebraic[16]*computedConstants[5]*(algebraic[19]+algebraic[12])+algebraic[19]*algebraic[10]*(computedConstants[5]+algebraic[18]); + algebraic[14] = algebraic[19]*algebraic[17]*(algebraic[16]+algebraic[10])+algebraic[12]*algebraic[16]*(algebraic[17]+algebraic[15]); + algebraic[4] = (1.0-constants[11])*constants[12]*(algebraic[9]*algebraic[10]-algebraic[11]*algebraic[12])/(algebraic[11]+algebraic[9]+algebraic[14]+algebraic[13]); + rates[1] = (1.0-constants[6])*-1.0*(algebraic[3]+algebraic[7]+algebraic[6]+3.0*algebraic[5]+3.0*algebraic[4])/(1.0*(computedConstants[2]+computedConstants[3])*constants[7]); + algebraic[24] = constants[26]-(constants[26]-constants[27])/(1.0+pow(constants[28]/states[2], constants[29])); + algebraic[26] = constants[31]*algebraic[24]; + algebraic[25] = constants[30]/algebraic[24]; + rates[4] = constants[32]*states[5]-algebraic[26]*states[0]*states[4]-(algebraic[25]*pow(states[0], 2.0)*states[4]-constants[33]*states[3]); + rates[3] = algebraic[25]*pow(states[0], 2.0)*states[4]-constants[33]*states[3]-(algebraic[26]*states[0]*states[3]-constants[32]*states[6]); + rates[6] = algebraic[26]*states[0]*states[3]-constants[32]*states[6]-(constants[33]*states[6]-algebraic[25]*pow(states[0], 2.0)*states[5]); + rates[5] = constants[33]*states[6]-algebraic[25]*pow(states[0], 2.0)*states[5]-(constants[32]*states[5]-algebraic[26]*states[0]*states[4]); + algebraic[31] = constants[39]*states[7]*(1.0-states[9])-constants[40]*states[9]; + rates[9] = algebraic[31]; + algebraic[32] = constants[41]*states[7]*(1.0-(states[10]+states[11]))-constants[42]*states[10]; + rates[10] = algebraic[32]; + algebraic[33] = constants[43]*constants[44]*(1.0-(states[10]+states[11]))-constants[45]*states[11]; + rates[11] = algebraic[33]; + algebraic[34] = constants[46]*states[7]*(1.0-states[12])-constants[47]*states[12]; + rates[12] = algebraic[34]; + algebraic[35] = constants[46]*states[0]*(1.0-states[13])-constants[47]*states[13]; + rates[13] = algebraic[35]; + algebraic[36] = constants[48]*states[2]*(1.0-states[14])-constants[49]*states[14]; + rates[14] = algebraic[36]; + algebraic[28] = (states[0]-states[7])/constants[35]; + algebraic[29] = computedConstants[7]/(1.0+exp((-states[7]+constants[36])/constants[37])); + rates[7] = 1.0*(algebraic[28]*computedConstants[3]-algebraic[29]*computedConstants[8])/computedConstants[2]-(constants[52]*algebraic[34]+constants[50]*algebraic[31]+constants[51]*algebraic[32]); + algebraic[22] = constants[25]*states[3]*(states[2]-states[0]); + algebraic[37] = 2.0*constants[77]*(algebraic[8]-0.0)/(computedConstants[0]*(1.0-exp(-1.0*(algebraic[8]-0.0)*2.0/computedConstants[0])))*(states[0]-constants[5]*exp(-2.0*(algebraic[8]-0.0)/computedConstants[0]))*states[23]*states[22]*states[21]; + algebraic[38] = 2.0*constants[84]*algebraic[8]/(computedConstants[0]*(1.0-exp(-1.0*algebraic[8]*2.0/computedConstants[0])))*(states[0]-constants[5]*exp(-2.0*algebraic[8]/computedConstants[0]))*states[25]*states[24]; + rates[0] = algebraic[22]*computedConstants[9]/computedConstants[3]-((algebraic[37]+algebraic[38]-2.0*algebraic[4])/(2.0*constants[7]*computedConstants[3])+algebraic[28]+constants[52]*algebraic[35]); + algebraic[30] = (states[8]-states[2])/constants[38]; + rates[8] = algebraic[29]-algebraic[30]*computedConstants[9]/computedConstants[8]; + rates[2] = algebraic[30]-(algebraic[22]+constants[53]*algebraic[36]); + algebraic[48] = states[16]*computedConstants[15]*(algebraic[8]-computedConstants[1])*(1.0-constants[71]); + algebraic[40] = algebraic[7]+algebraic[48]; + algebraic[41] = constants[76]*states[20]*states[19]*(algebraic[8]-computedConstants[1]); + algebraic[42] = (constants[0] > 0.0)?constants[89]*constants[90]*(algebraic[8]-computedConstants[1])*(1.0+exp((algebraic[8]+20.0)/20.0))*states[32]:0.0; + algebraic[67] = 0.000365*constants[77]*(algebraic[8]-0.0)/(computedConstants[0]*(1.0-exp(-1.0*(algebraic[8]-0.0)/computedConstants[0])))*(constants[4]-constants[3]*exp(-1.0*(algebraic[8]-0.0)/computedConstants[0]))*states[23]*states[22]*states[21]; + algebraic[43] = (algebraic[37]+algebraic[67]+algebraic[6])*(1.0-computedConstants[19])*1.0*computedConstants[18]; + algebraic[44] = constants[86]*(algebraic[8]-computedConstants[1])*states[27]*states[26]; + algebraic[93] = computedConstants[0]*log((constants[3]+0.12*constants[2])/(constants[4]+0.12*algebraic[1])); + algebraic[45] = computedConstants[22]*(algebraic[8]-algebraic[93])*pow(states[31], 2.0); + algebraic[46] = constants[87]*(algebraic[8]-computedConstants[1])*(0.9*states[29]+0.1*states[30])*states[28]; + algebraic[39] = algebraic[40]+algebraic[46]+algebraic[45]+algebraic[44]+algebraic[5]+algebraic[4]+algebraic[3]+algebraic[43]+algebraic[38]+algebraic[42]+algebraic[41]; + rates[15] = -algebraic[39]/constants[60]; + algebraic[50] = (algebraic[8] < -(80.0-computedConstants[16]-computedConstants[17]-constants[72]))?0.01329+0.99921/(1.0+exp((algebraic[8]+97.134-computedConstants[16]-computedConstants[17]-constants[72])/8.1752)):0.0002501*exp(-(algebraic[8]-computedConstants[16]-computedConstants[17]-constants[72])/12.861); + algebraic[49] = 1.0/(0.36*(algebraic[8]+148.8-computedConstants[16]-computedConstants[17])/(exp(0.066*(algebraic[8]+148.8-computedConstants[16]-computedConstants[17]))-1.0)+0.1*(algebraic[8]+87.3-computedConstants[16]-computedConstants[17])/(1.0-exp(-0.2*(algebraic[8]+87.3-computedConstants[16]-computedConstants[17]))))-0.054; + rates[16] = (algebraic[50]-states[16])/algebraic[49]; + algebraic[54] = 1.0/(1.0+exp(-(algebraic[8]+42.0504)/8.3106)); + algebraic[55] = algebraic[8]+41.0; + algebraic[56] = (fabs(algebraic[55]) < constants[75])?2000.0:200.0*algebraic[55]/(1.0-exp(-0.1*algebraic[55])); + algebraic[57] = 8000.0*exp(-0.056*(algebraic[8]+66.0)); + algebraic[58] = 1.0/(algebraic[56]+algebraic[57]); + rates[18] = (algebraic[54]-states[18])/algebraic[58]; + algebraic[59] = 1.0/(1.0+exp((algebraic[8]+69.804)/4.4565)); + algebraic[60] = 20.0*exp(-0.125*(algebraic[8]+75.0)); + algebraic[61] = 2000.0/(320.0*exp(-0.1*(algebraic[8]+75.0))+1.0); + algebraic[62] = 1.0/(algebraic[60]+algebraic[61]); + rates[17] = (algebraic[59]-states[17])/algebraic[62]; + algebraic[63] = 1.0/(1.0+exp((algebraic[8]+6.0)/-8.6)); + algebraic[64] = 0.009/(1.0+exp((algebraic[8]+5.0)/12.0))+0.0005; + rates[20] = (algebraic[63]-states[20])/algebraic[64]; + algebraic[65] = 1.0/(1.0+exp((algebraic[8]+7.5)/10.0)); + algebraic[66] = 0.59/(1.0+exp((algebraic[8]+60.0)/10.0))+3.05; + rates[19] = (algebraic[65]-states[19])/algebraic[66]; + algebraic[68] = 1.0/(1.0+exp(-(algebraic[8]-constants[78]-computedConstants[20])/(constants[79]*(1.0+computedConstants[21]/100.0)))); + algebraic[72] = (algebraic[8] == -41.8)?-41.80001:(algebraic[8] == 0.0)?0.0:(algebraic[8] == -6.8)?-6.80001:algebraic[8]; + algebraic[70] = -0.02839*(algebraic[72]+41.8)/(exp(-(algebraic[72]+41.8)/2.5)-1.0)-0.0849*(algebraic[72]+6.8)/(exp(-(algebraic[72]+6.8)/4.8)-1.0); + algebraic[73] = (algebraic[8] == -1.8)?-1.80001:algebraic[8]; + algebraic[71] = 0.01143*(algebraic[73]+1.8)/(exp((algebraic[73]+1.8)/2.5)-1.0); + algebraic[69] = 0.001/(algebraic[70]+algebraic[71]); + rates[23] = (algebraic[68]-states[23])/algebraic[69]; + algebraic[74] = 1.0/(1.0+exp((algebraic[8]+37.4+constants[80])/(5.3+constants[81]))); + algebraic[75] = 0.001*(44.3+230.0*exp(-pow((algebraic[8]+36.0)/10.0, 2.0))); + rates[22] = (algebraic[74]-states[22])/algebraic[75]; + algebraic[76] = constants[82]/(constants[82]+states[0]); + algebraic[77] = 0.001*algebraic[76]/constants[83]; + rates[21] = (algebraic[76]-states[21])/algebraic[77]; + algebraic[78] = 1.0/(1.0+exp(-(algebraic[8]+38.3)/5.5)); + algebraic[79] = 0.001/(1.068*exp((algebraic[8]+38.3)/30.0)+1.068*exp(-(algebraic[8]+38.3)/30.0)); + rates[25] = (algebraic[78]-states[25])/algebraic[79]; + algebraic[80] = 1.0/(1.0+exp((algebraic[8]+58.7)/3.8)); + algebraic[81] = 1.0/(16.67*exp(-(algebraic[8]+75.0)/83.3)+16.67*exp((algebraic[8]+75.0)/15.38))+constants[85]; + rates[24] = (algebraic[80]-states[24])/algebraic[81]; + algebraic[82] = 1.0/(1.0+exp((algebraic[8]+49.0)/13.0)); + algebraic[83] = 0.001*0.6*(65.17/(0.57*exp(-0.08*(algebraic[8]+44.0))+0.065*exp(0.1*(algebraic[8]+45.93)))+10.1); + rates[27] = (algebraic[82]-states[27])/algebraic[83]; + algebraic[84] = 1.0/(1.0+exp(-(algebraic[8]-19.3)/15.0)); + algebraic[85] = 0.001*0.66*1.4*(15.59/(1.037*exp(0.09*(algebraic[8]+30.61))+0.369*exp(-0.12*(algebraic[8]+23.84)))+2.98); + rates[26] = (algebraic[84]-states[26])/algebraic[85]; + algebraic[88] = 1.0/(1.0+exp(-(algebraic[8]+10.0144)/7.6607)); + algebraic[89] = 0.84655354/(4.2*exp(algebraic[8]/17.0)+0.15*exp(-algebraic[8]/21.6)); + rates[30] = (algebraic[88]-states[30])/algebraic[89]; + algebraic[90] = 1.0/(30.0*exp(algebraic[8]/10.0)+exp(-algebraic[8]/12.0)); + rates[29] = (algebraic[88]-states[29])/algebraic[90]; + algebraic[92] = 1.0/(1.0+exp((algebraic[8]+28.6)/17.1)); + algebraic[91] = 1.0/(100.0*exp(-algebraic[8]/54.645)+656.0*exp(algebraic[8]/106.157)); + rates[28] = (algebraic[92]-states[28])/algebraic[91]; + algebraic[94] = sqrt(1.0/(1.0+exp(-(algebraic[8]+0.6383-computedConstants[23])/10.7071))); + algebraic[96] = 28.0/(1.0+exp(-(algebraic[8]-40.0-computedConstants[23])/3.0)); + algebraic[97] = 1.0*exp(-(algebraic[8]-computedConstants[23]-5.0)/25.0); + algebraic[95] = 1.0/(algebraic[96]+algebraic[97]); + rates[31] = (algebraic[94]-states[31])/algebraic[95]; + algebraic[98] = 10.0*exp(0.0133*(algebraic[8]+40.0)); + algebraic[99] = computedConstants[24]/(computedConstants[24]+algebraic[98]); + algebraic[100] = 1.0/(computedConstants[24]+algebraic[98]); + rates[32] = (algebraic[99]-states[32])/algebraic[100]; } void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic) { - algebraic[5] = states[1]; - algebraic[2] = computedConstants[3]*log(constants[4]/algebraic[5]); - algebraic[9] = 0.5*computedConstants[3]*log(constants[10]/states[0]); - algebraic[21] = (constants[122] >= 1.0)?algebraic[121]:states[15]; - algebraic[14] = computedConstants[20]*constants[24]*pow(1.0+pow(constants[23]/constants[7], 1.2), -1.0)*pow(1.0+pow(constants[22]/algebraic[5], 1.3), -1.0)*pow(1.0+exp(-(algebraic[21]-algebraic[2]+110.0)/20.0), -1.0); - algebraic[50] = 1.0+constants[10]/constants[48]*(1.0+exp(constants[49]*algebraic[21]/computedConstants[3]))+constants[4]/constants[51]*(1.0+constants[4]/constants[52]*(1.0+constants[4]/constants[47])); - algebraic[27] = constants[10]/constants[48]*exp(constants[49]*algebraic[21]/computedConstants[3])/algebraic[50]; - algebraic[42] = 1.0+states[0]/constants[40]*(1.0+exp(-constants[41]*algebraic[21]/computedConstants[3])+algebraic[5]/constants[46])+algebraic[5]/constants[43]*(1.0+algebraic[5]/constants[44]*(1.0+algebraic[5]/constants[39])); - algebraic[29] = states[0]/constants[40]*exp(-constants[41]*algebraic[21]/computedConstants[3])/algebraic[42]; - algebraic[36] = algebraic[5]/(constants[39]+algebraic[5]); - algebraic[37] = exp(constants[45]*algebraic[21]/(2.0*computedConstants[3])); - algebraic[33] = exp(-constants[45]*algebraic[21]/(2.0*computedConstants[3])); - algebraic[38] = algebraic[5]/constants[43]*algebraic[5]/constants[44]*(1.0+algebraic[5]/constants[39])*exp(constants[45]*algebraic[21]/(2.0*computedConstants[3]))/algebraic[42]; - algebraic[26] = algebraic[37]*algebraic[36]*(algebraic[38]+algebraic[29])+algebraic[33]*algebraic[29]*(computedConstants[35]+algebraic[37]); - algebraic[34] = constants[4]/constants[51]*constants[4]/constants[52]*(1.0+constants[4]/constants[47])*exp(-constants[45]*algebraic[21]/(2.0*computedConstants[3]))/algebraic[50]; - algebraic[28] = algebraic[33]*computedConstants[35]*(algebraic[34]+algebraic[27])+algebraic[27]*algebraic[37]*(algebraic[36]+algebraic[33]); - algebraic[31] = algebraic[34]*computedConstants[35]*(algebraic[38]+algebraic[29])+algebraic[38]*algebraic[27]*(computedConstants[35]+algebraic[37]); - algebraic[32] = algebraic[38]*algebraic[36]*(algebraic[34]+algebraic[27])+algebraic[29]*algebraic[34]*(algebraic[36]+algebraic[33]); - algebraic[13] = (1.0-constants[25])*constants[30]*(algebraic[26]*algebraic[27]-algebraic[28]*algebraic[29])/(algebraic[28]+algebraic[26]+algebraic[32]+algebraic[31]); - algebraic[53] = constants[54]*states[3]*(states[2]-states[0]); - algebraic[55] = states[2]-states[0]; - algebraic[56] = constants[57]-(constants[57]-constants[58])/(1.0+pow(constants[59]/states[2], constants[60])); - algebraic[61] = constants[62]/algebraic[56]; - algebraic[63] = constants[64]*algebraic[56]; - algebraic[67] = states[4]+states[3]+states[6]+states[5]; - algebraic[71] = (states[0]-states[7])/constants[72]; - algebraic[73] = computedConstants[69]/(1.0+exp((-states[7]+constants[74])/constants[75])); - algebraic[76] = (states[8]-states[2])/constants[77]; - algebraic[78] = constants[79]*states[7]*(1.0-states[9])-constants[80]*states[9]; - algebraic[81] = constants[82]*states[7]*(1.0-(states[10]+states[11]))-constants[83]*states[10]; - algebraic[84] = constants[85]*constants[86]*(1.0-(states[10]+states[11]))-constants[87]*states[11]; - algebraic[88] = constants[89]*states[7]*(1.0-states[12])-constants[90]*states[12]; - algebraic[91] = constants[89]*states[0]*(1.0-states[13])-constants[90]*states[13]; - algebraic[92] = constants[93]*states[2]*(1.0-states[14])-constants[94]*states[14]; - algebraic[16] = states[16]*computedConstants[133]*(algebraic[21]-algebraic[2])*(1.0-constants[135]); - algebraic[136] = states[16]*computedConstants[134]*(algebraic[21]-computedConstants[6])*(1.0-constants[135]); - algebraic[111] = algebraic[16]+algebraic[136]; - algebraic[112] = constants[157]*states[20]*states[19]*(algebraic[21]-computedConstants[6]); - algebraic[113] = (constants[0] > 0.0)?constants[211]*constants[212]*(algebraic[21]-computedConstants[6])*(1.0+exp((algebraic[21]+20.0)/20.0))*states[32]:0.0; - algebraic[102] = 2.0*constants[184]*algebraic[21]/(computedConstants[3]*(1.0-exp(-1.0*algebraic[21]*2.0/computedConstants[3])))*(states[0]-constants[10]*exp(-2.0*algebraic[21]/computedConstants[3]))*states[25]*states[24]; - algebraic[101] = 2.0*constants[163]*(algebraic[21]-0.0)/(computedConstants[3]*(1.0-exp(-1.0*(algebraic[21]-0.0)*2.0/computedConstants[3])))*(states[0]-constants[10]*exp(-2.0*(algebraic[21]-0.0)/computedConstants[3]))*states[23]*states[22]*states[21]; - algebraic[15] = 0.0000185*constants[163]*(algebraic[21]-0.0)/(computedConstants[3]*(1.0-exp(-1.0*(algebraic[21]-0.0)/computedConstants[3])))*(algebraic[5]-constants[4]*exp(-1.0*(algebraic[21]-0.0)/computedConstants[3]))*states[23]*states[22]*states[21]; - algebraic[164] = 0.000365*constants[163]*(algebraic[21]-0.0)/(computedConstants[3]*(1.0-exp(-1.0*(algebraic[21]-0.0)/computedConstants[3])))*(constants[8]-constants[7]*exp(-1.0*(algebraic[21]-0.0)/computedConstants[3]))*states[23]*states[22]*states[21]; - algebraic[114] = (algebraic[101]+algebraic[164]+algebraic[15])*(1.0-computedConstants[165])*1.0*computedConstants[162]; - algebraic[142] = computedConstants[3]*log((constants[4]+0.12*constants[7])/(algebraic[5]+0.12*constants[8])); - algebraic[143] = constants[144]*pow(states[18], 3.0)*states[17]*(algebraic[21]-algebraic[142]); - algebraic[145] = constants[146]*pow(states[18], 3.0)*(algebraic[21]-algebraic[142]); - algebraic[12] = algebraic[143]+algebraic[145]; - algebraic[115] = constants[190]*(algebraic[21]-computedConstants[6])*states[27]*states[26]; - algebraic[205] = computedConstants[3]*log((constants[7]+0.12*constants[4])/(constants[8]+0.12*algebraic[5])); - algebraic[116] = computedConstants[203]*(algebraic[21]-algebraic[205])*pow(states[31], 2.0); - algebraic[117] = constants[195]*(algebraic[21]-computedConstants[6])*(0.9*states[29]+0.1*states[30])*states[28]; - algebraic[110] = algebraic[111]+algebraic[117]+algebraic[116]+algebraic[115]+algebraic[14]+algebraic[13]+algebraic[12]+algebraic[114]+algebraic[102]+algebraic[113]+algebraic[112]; - algebraic[139] = 1.0/(0.36*(algebraic[21]+148.8-computedConstants[137]-computedConstants[138])/(exp(0.066*(algebraic[21]+148.8-computedConstants[137]-computedConstants[138]))-1.0)+0.1*(algebraic[21]+87.3-computedConstants[137]-computedConstants[138])/(1.0-exp(-0.2*(algebraic[21]+87.3-computedConstants[137]-computedConstants[138]))))-0.054; - algebraic[140] = (algebraic[21] < -(80.0-computedConstants[137]-computedConstants[138]-constants[141]))?0.01329+0.99921/(1.0+exp((algebraic[21]+97.134-computedConstants[137]-computedConstants[138]-constants[141])/8.1752)):0.0002501*exp(-(algebraic[21]-computedConstants[137]-computedConstants[138]-constants[141])/12.861); - algebraic[147] = 1.0/(1.0+exp(-(algebraic[21]+42.0504)/8.3106)); - algebraic[148] = algebraic[21]+41.0; - algebraic[149] = (fabs(algebraic[148]) < constants[150])?2000.0:200.0*algebraic[148]/(1.0-exp(-0.1*algebraic[148])); - algebraic[151] = 8000.0*exp(-0.056*(algebraic[21]+66.0)); - algebraic[152] = 1.0/(algebraic[149]+algebraic[151]); - algebraic[153] = 1.0/(1.0+exp((algebraic[21]+69.804)/4.4565)); - algebraic[154] = 20.0*exp(-0.125*(algebraic[21]+75.0)); - algebraic[155] = 2000.0/(320.0*exp(-0.1*(algebraic[21]+75.0))+1.0); - algebraic[156] = 1.0/(algebraic[154]+algebraic[155]); - algebraic[158] = 1.0/(1.0+exp((algebraic[21]+6.0)/-8.6)); - algebraic[159] = 0.009/(1.0+exp((algebraic[21]+5.0)/12.0))+0.0005; - algebraic[160] = 1.0/(1.0+exp((algebraic[21]+7.5)/10.0)); - algebraic[161] = 0.59/(1.0+exp((algebraic[21]+60.0)/10.0))+3.05; - algebraic[168] = 1.0/(1.0+exp(-(algebraic[21]-constants[169]-computedConstants[166])/(constants[170]*(1.0+computedConstants[167]/100.0)))); - algebraic[174] = (algebraic[21] == -41.8)?-41.80001:(algebraic[21] == 0.0)?0.0:(algebraic[21] == -6.8)?-6.80001:algebraic[21]; - algebraic[172] = -0.02839*(algebraic[174]+41.8)/(exp(-(algebraic[174]+41.8)/2.5)-1.0)-0.0849*(algebraic[174]+6.8)/(exp(-(algebraic[174]+6.8)/4.8)-1.0); - algebraic[175] = (algebraic[21] == -1.8)?-1.80001:algebraic[21]; - algebraic[173] = 0.01143*(algebraic[175]+1.8)/(exp((algebraic[175]+1.8)/2.5)-1.0); - algebraic[171] = 0.001/(algebraic[172]+algebraic[173]); - algebraic[176] = 1.0/(1.0+exp((algebraic[21]+37.4+constants[177])/(5.3+constants[178]))); - algebraic[179] = 0.001*(44.3+230.0*exp(-pow((algebraic[21]+36.0)/10.0, 2.0))); - algebraic[180] = constants[181]/(constants[181]+states[0]); - algebraic[182] = 0.001*algebraic[180]/constants[183]; - algebraic[185] = 1.0/(1.0+exp(-(algebraic[21]+38.3)/5.5)); - algebraic[186] = 0.001/(1.068*exp((algebraic[21]+38.3)/30.0)+1.068*exp(-(algebraic[21]+38.3)/30.0)); - algebraic[187] = 1.0/(1.0+exp((algebraic[21]+58.7)/3.8)); - algebraic[188] = 1.0/(16.67*exp(-(algebraic[21]+75.0)/83.3)+16.67*exp((algebraic[21]+75.0)/15.38))+constants[189]; - algebraic[191] = 1.0/(1.0+exp((algebraic[21]+49.0)/13.0)); - algebraic[192] = 0.001*0.6*(65.17/(0.57*exp(-0.08*(algebraic[21]+44.0))+0.065*exp(0.1*(algebraic[21]+45.93)))+10.1); - algebraic[193] = 1.0/(1.0+exp(-(algebraic[21]-19.3)/15.0)); - algebraic[194] = 0.001*0.66*1.4*(15.59/(1.037*exp(0.09*(algebraic[21]+30.61))+0.369*exp(-0.12*(algebraic[21]+23.84)))+2.98); - algebraic[196] = 1.0/(1.0+exp(-(algebraic[21]+23.2)/6.6))/(0.84655354/(37.2*exp(algebraic[21]/11.9)+0.96*exp(-algebraic[21]/18.5))); - algebraic[197] = 4.0*((37.2*exp(algebraic[21]/15.9)+0.96*exp(-algebraic[21]/22.5))/0.84655354-1.0/(1.0+exp(-(algebraic[21]+23.2)/10.6))/(0.84655354/(37.2*exp(algebraic[21]/15.9)+0.96*exp(-algebraic[21]/22.5)))); - algebraic[198] = 1.0/(1.0+exp(-(algebraic[21]+10.0144)/7.6607)); - algebraic[199] = 0.84655354/(4.2*exp(algebraic[21]/17.0)+0.15*exp(-algebraic[21]/21.6)); - algebraic[200] = 1.0/(30.0*exp(algebraic[21]/10.0)+exp(-algebraic[21]/12.0)); - algebraic[201] = 1.0/(100.0*exp(-algebraic[21]/54.645)+656.0*exp(algebraic[21]/106.157)); - algebraic[202] = 1.0/(1.0+exp((algebraic[21]+28.6)/17.1)); - algebraic[207] = sqrt(1.0/(1.0+exp(-(algebraic[21]+0.6383-computedConstants[206])/10.7071))); - algebraic[209] = 28.0/(1.0+exp(-(algebraic[21]-40.0-computedConstants[206])/3.0)); - algebraic[210] = 1.0*exp(-(algebraic[21]-computedConstants[206]-5.0)/25.0); - algebraic[208] = 1.0/(algebraic[209]+algebraic[210]); - algebraic[214] = 10.0*exp(0.0133*(algebraic[21]+40.0)); - algebraic[215] = computedConstants[213]/(computedConstants[213]+algebraic[214]); - algebraic[216] = 1.0/(computedConstants[213]+algebraic[214]); + algebraic[1] = states[1]; + algebraic[0] = computedConstants[0]*log(constants[2]/algebraic[1]); + algebraic[2] = 0.5*computedConstants[0]*log(constants[5]/states[0]); + algebraic[8] = (constants[63] >= 1.0)?algebraic[47]:states[15]; + algebraic[5] = computedConstants[4]*constants[10]*pow(1.0+pow(constants[9]/constants[3], 1.2), -1.0)*pow(1.0+pow(constants[8]/algebraic[1], 1.3), -1.0)*pow(1.0+exp(-(algebraic[8]-algebraic[0]+110.0)/20.0), -1.0); + algebraic[21] = 1.0+constants[5]/constants[21]*(1.0+exp(constants[22]*algebraic[8]/computedConstants[0]))+constants[2]/constants[23]*(1.0+constants[2]/constants[24]*(1.0+constants[2]/constants[20])); + algebraic[10] = constants[5]/constants[21]*exp(constants[22]*algebraic[8]/computedConstants[0])/algebraic[21]; + algebraic[20] = 1.0+states[0]/constants[14]*(1.0+exp(-constants[15]*algebraic[8]/computedConstants[0])+algebraic[1]/constants[19])+algebraic[1]/constants[16]*(1.0+algebraic[1]/constants[17]*(1.0+algebraic[1]/constants[13])); + algebraic[12] = states[0]/constants[14]*exp(-constants[15]*algebraic[8]/computedConstants[0])/algebraic[20]; + algebraic[17] = algebraic[1]/(constants[13]+algebraic[1]); + algebraic[18] = exp(constants[18]*algebraic[8]/(2.0*computedConstants[0])); + algebraic[15] = exp(-constants[18]*algebraic[8]/(2.0*computedConstants[0])); + algebraic[19] = algebraic[1]/constants[16]*algebraic[1]/constants[17]*(1.0+algebraic[1]/constants[13])*exp(constants[18]*algebraic[8]/(2.0*computedConstants[0]))/algebraic[20]; + algebraic[9] = algebraic[18]*algebraic[17]*(algebraic[19]+algebraic[12])+algebraic[15]*algebraic[12]*(computedConstants[5]+algebraic[18]); + algebraic[16] = constants[2]/constants[23]*constants[2]/constants[24]*(1.0+constants[2]/constants[20])*exp(-constants[18]*algebraic[8]/(2.0*computedConstants[0]))/algebraic[21]; + algebraic[11] = algebraic[15]*computedConstants[5]*(algebraic[16]+algebraic[10])+algebraic[10]*algebraic[18]*(algebraic[17]+algebraic[15]); + algebraic[13] = algebraic[16]*computedConstants[5]*(algebraic[19]+algebraic[12])+algebraic[19]*algebraic[10]*(computedConstants[5]+algebraic[18]); + algebraic[14] = algebraic[19]*algebraic[17]*(algebraic[16]+algebraic[10])+algebraic[12]*algebraic[16]*(algebraic[17]+algebraic[15]); + algebraic[4] = (1.0-constants[11])*constants[12]*(algebraic[9]*algebraic[10]-algebraic[11]*algebraic[12])/(algebraic[11]+algebraic[9]+algebraic[14]+algebraic[13]); + algebraic[22] = constants[25]*states[3]*(states[2]-states[0]); + algebraic[23] = states[2]-states[0]; + algebraic[24] = constants[26]-(constants[26]-constants[27])/(1.0+pow(constants[28]/states[2], constants[29])); + algebraic[25] = constants[30]/algebraic[24]; + algebraic[26] = constants[31]*algebraic[24]; + algebraic[27] = states[4]+states[3]+states[6]+states[5]; + algebraic[28] = (states[0]-states[7])/constants[35]; + algebraic[29] = computedConstants[7]/(1.0+exp((-states[7]+constants[36])/constants[37])); + algebraic[30] = (states[8]-states[2])/constants[38]; + algebraic[31] = constants[39]*states[7]*(1.0-states[9])-constants[40]*states[9]; + algebraic[32] = constants[41]*states[7]*(1.0-(states[10]+states[11]))-constants[42]*states[10]; + algebraic[33] = constants[43]*constants[44]*(1.0-(states[10]+states[11]))-constants[45]*states[11]; + algebraic[34] = constants[46]*states[7]*(1.0-states[12])-constants[47]*states[12]; + algebraic[35] = constants[46]*states[0]*(1.0-states[13])-constants[47]*states[13]; + algebraic[36] = constants[48]*states[2]*(1.0-states[14])-constants[49]*states[14]; + algebraic[7] = states[16]*computedConstants[14]*(algebraic[8]-algebraic[0])*(1.0-constants[71]); + algebraic[48] = states[16]*computedConstants[15]*(algebraic[8]-computedConstants[1])*(1.0-constants[71]); + algebraic[40] = algebraic[7]+algebraic[48]; + algebraic[41] = constants[76]*states[20]*states[19]*(algebraic[8]-computedConstants[1]); + algebraic[42] = (constants[0] > 0.0)?constants[89]*constants[90]*(algebraic[8]-computedConstants[1])*(1.0+exp((algebraic[8]+20.0)/20.0))*states[32]:0.0; + algebraic[38] = 2.0*constants[84]*algebraic[8]/(computedConstants[0]*(1.0-exp(-1.0*algebraic[8]*2.0/computedConstants[0])))*(states[0]-constants[5]*exp(-2.0*algebraic[8]/computedConstants[0]))*states[25]*states[24]; + algebraic[37] = 2.0*constants[77]*(algebraic[8]-0.0)/(computedConstants[0]*(1.0-exp(-1.0*(algebraic[8]-0.0)*2.0/computedConstants[0])))*(states[0]-constants[5]*exp(-2.0*(algebraic[8]-0.0)/computedConstants[0]))*states[23]*states[22]*states[21]; + algebraic[6] = 0.0000185*constants[77]*(algebraic[8]-0.0)/(computedConstants[0]*(1.0-exp(-1.0*(algebraic[8]-0.0)/computedConstants[0])))*(algebraic[1]-constants[2]*exp(-1.0*(algebraic[8]-0.0)/computedConstants[0]))*states[23]*states[22]*states[21]; + algebraic[67] = 0.000365*constants[77]*(algebraic[8]-0.0)/(computedConstants[0]*(1.0-exp(-1.0*(algebraic[8]-0.0)/computedConstants[0])))*(constants[4]-constants[3]*exp(-1.0*(algebraic[8]-0.0)/computedConstants[0]))*states[23]*states[22]*states[21]; + algebraic[43] = (algebraic[37]+algebraic[67]+algebraic[6])*(1.0-computedConstants[19])*1.0*computedConstants[18]; + algebraic[51] = computedConstants[0]*log((constants[2]+0.12*constants[3])/(algebraic[1]+0.12*constants[4])); + algebraic[52] = constants[73]*pow(states[18], 3.0)*states[17]*(algebraic[8]-algebraic[51]); + algebraic[53] = constants[74]*pow(states[18], 3.0)*(algebraic[8]-algebraic[51]); + algebraic[3] = algebraic[52]+algebraic[53]; + algebraic[44] = constants[86]*(algebraic[8]-computedConstants[1])*states[27]*states[26]; + algebraic[93] = computedConstants[0]*log((constants[3]+0.12*constants[2])/(constants[4]+0.12*algebraic[1])); + algebraic[45] = computedConstants[22]*(algebraic[8]-algebraic[93])*pow(states[31], 2.0); + algebraic[46] = constants[87]*(algebraic[8]-computedConstants[1])*(0.9*states[29]+0.1*states[30])*states[28]; + algebraic[39] = algebraic[40]+algebraic[46]+algebraic[45]+algebraic[44]+algebraic[5]+algebraic[4]+algebraic[3]+algebraic[43]+algebraic[38]+algebraic[42]+algebraic[41]; + algebraic[49] = 1.0/(0.36*(algebraic[8]+148.8-computedConstants[16]-computedConstants[17])/(exp(0.066*(algebraic[8]+148.8-computedConstants[16]-computedConstants[17]))-1.0)+0.1*(algebraic[8]+87.3-computedConstants[16]-computedConstants[17])/(1.0-exp(-0.2*(algebraic[8]+87.3-computedConstants[16]-computedConstants[17]))))-0.054; + algebraic[50] = (algebraic[8] < -(80.0-computedConstants[16]-computedConstants[17]-constants[72]))?0.01329+0.99921/(1.0+exp((algebraic[8]+97.134-computedConstants[16]-computedConstants[17]-constants[72])/8.1752)):0.0002501*exp(-(algebraic[8]-computedConstants[16]-computedConstants[17]-constants[72])/12.861); + algebraic[54] = 1.0/(1.0+exp(-(algebraic[8]+42.0504)/8.3106)); + algebraic[55] = algebraic[8]+41.0; + algebraic[56] = (fabs(algebraic[55]) < constants[75])?2000.0:200.0*algebraic[55]/(1.0-exp(-0.1*algebraic[55])); + algebraic[57] = 8000.0*exp(-0.056*(algebraic[8]+66.0)); + algebraic[58] = 1.0/(algebraic[56]+algebraic[57]); + algebraic[59] = 1.0/(1.0+exp((algebraic[8]+69.804)/4.4565)); + algebraic[60] = 20.0*exp(-0.125*(algebraic[8]+75.0)); + algebraic[61] = 2000.0/(320.0*exp(-0.1*(algebraic[8]+75.0))+1.0); + algebraic[62] = 1.0/(algebraic[60]+algebraic[61]); + algebraic[63] = 1.0/(1.0+exp((algebraic[8]+6.0)/-8.6)); + algebraic[64] = 0.009/(1.0+exp((algebraic[8]+5.0)/12.0))+0.0005; + algebraic[65] = 1.0/(1.0+exp((algebraic[8]+7.5)/10.0)); + algebraic[66] = 0.59/(1.0+exp((algebraic[8]+60.0)/10.0))+3.05; + algebraic[68] = 1.0/(1.0+exp(-(algebraic[8]-constants[78]-computedConstants[20])/(constants[79]*(1.0+computedConstants[21]/100.0)))); + algebraic[72] = (algebraic[8] == -41.8)?-41.80001:(algebraic[8] == 0.0)?0.0:(algebraic[8] == -6.8)?-6.80001:algebraic[8]; + algebraic[70] = -0.02839*(algebraic[72]+41.8)/(exp(-(algebraic[72]+41.8)/2.5)-1.0)-0.0849*(algebraic[72]+6.8)/(exp(-(algebraic[72]+6.8)/4.8)-1.0); + algebraic[73] = (algebraic[8] == -1.8)?-1.80001:algebraic[8]; + algebraic[71] = 0.01143*(algebraic[73]+1.8)/(exp((algebraic[73]+1.8)/2.5)-1.0); + algebraic[69] = 0.001/(algebraic[70]+algebraic[71]); + algebraic[74] = 1.0/(1.0+exp((algebraic[8]+37.4+constants[80])/(5.3+constants[81]))); + algebraic[75] = 0.001*(44.3+230.0*exp(-pow((algebraic[8]+36.0)/10.0, 2.0))); + algebraic[76] = constants[82]/(constants[82]+states[0]); + algebraic[77] = 0.001*algebraic[76]/constants[83]; + algebraic[78] = 1.0/(1.0+exp(-(algebraic[8]+38.3)/5.5)); + algebraic[79] = 0.001/(1.068*exp((algebraic[8]+38.3)/30.0)+1.068*exp(-(algebraic[8]+38.3)/30.0)); + algebraic[80] = 1.0/(1.0+exp((algebraic[8]+58.7)/3.8)); + algebraic[81] = 1.0/(16.67*exp(-(algebraic[8]+75.0)/83.3)+16.67*exp((algebraic[8]+75.0)/15.38))+constants[85]; + algebraic[82] = 1.0/(1.0+exp((algebraic[8]+49.0)/13.0)); + algebraic[83] = 0.001*0.6*(65.17/(0.57*exp(-0.08*(algebraic[8]+44.0))+0.065*exp(0.1*(algebraic[8]+45.93)))+10.1); + algebraic[84] = 1.0/(1.0+exp(-(algebraic[8]-19.3)/15.0)); + algebraic[85] = 0.001*0.66*1.4*(15.59/(1.037*exp(0.09*(algebraic[8]+30.61))+0.369*exp(-0.12*(algebraic[8]+23.84)))+2.98); + algebraic[86] = 1.0/(1.0+exp(-(algebraic[8]+23.2)/6.6))/(0.84655354/(37.2*exp(algebraic[8]/11.9)+0.96*exp(-algebraic[8]/18.5))); + algebraic[87] = 4.0*((37.2*exp(algebraic[8]/15.9)+0.96*exp(-algebraic[8]/22.5))/0.84655354-1.0/(1.0+exp(-(algebraic[8]+23.2)/10.6))/(0.84655354/(37.2*exp(algebraic[8]/15.9)+0.96*exp(-algebraic[8]/22.5)))); + algebraic[88] = 1.0/(1.0+exp(-(algebraic[8]+10.0144)/7.6607)); + algebraic[89] = 0.84655354/(4.2*exp(algebraic[8]/17.0)+0.15*exp(-algebraic[8]/21.6)); + algebraic[90] = 1.0/(30.0*exp(algebraic[8]/10.0)+exp(-algebraic[8]/12.0)); + algebraic[91] = 1.0/(100.0*exp(-algebraic[8]/54.645)+656.0*exp(algebraic[8]/106.157)); + algebraic[92] = 1.0/(1.0+exp((algebraic[8]+28.6)/17.1)); + algebraic[94] = sqrt(1.0/(1.0+exp(-(algebraic[8]+0.6383-computedConstants[23])/10.7071))); + algebraic[96] = 28.0/(1.0+exp(-(algebraic[8]-40.0-computedConstants[23])/3.0)); + algebraic[97] = 1.0*exp(-(algebraic[8]-computedConstants[23]-5.0)/25.0); + algebraic[95] = 1.0/(algebraic[96]+algebraic[97]); + algebraic[98] = 10.0*exp(0.0133*(algebraic[8]+40.0)); + algebraic[99] = computedConstants[24]/(computedConstants[24]+algebraic[98]); + algebraic[100] = 1.0/(computedConstants[24]+algebraic[98]); } diff --git a/tests/resources/generator/fabbri_fantini_wilders_severi_human_san_model_2017/model.py b/tests/resources/generator/fabbri_fantini_wilders_severi_human_san_model_2017/model.py index 109e8280db..3141afa7a2 100644 --- a/tests/resources/generator/fabbri_fantini_wilders_severi_human_san_model_2017/model.py +++ b/tests/resources/generator/fabbri_fantini_wilders_severi_human_san_model_2017/model.py @@ -311,95 +311,95 @@ def create_variables_array(): def initialise_variables(states, rates, constants): constants[0] = 0.0 constants[1] = 0.0 + constants[2] = 140.0 + constants[3] = 5.4 constants[4] = 140.0 - constants[7] = 5.4 - constants[8] = 140.0 - constants[10] = 1.8 - constants[11] = 1.0 - constants[17] = 96485.3415 - constants[22] = 14.0 - constants[23] = 1.4 - constants[24] = 0.08105 - constants[25] = 0.0 - constants[30] = 3.343 - constants[39] = 26.44 - constants[40] = 0.0207 - constants[41] = 0.1369 - constants[43] = 395.3 - constants[44] = 2.289 - constants[45] = 0.4315 - constants[46] = 26.44 - constants[47] = 4.663 - constants[48] = 3.663 - constants[49] = 0.0 - constants[51] = 1628.0 - constants[52] = 561.4 - constants[54] = 148041085.1 - constants[57] = 15.0 - constants[58] = 1.0 - constants[59] = 0.45 - constants[60] = 2.5 - constants[62] = 10000.0 - constants[64] = 500.0 - constants[65] = 5.0 - constants[66] = 660.0 - constants[70] = 5.0 - constants[72] = 5.469e-5 - constants[74] = 0.000286113 - constants[75] = 5.0e-5 - constants[77] = 0.04 - constants[79] = 88800.0 - constants[80] = 446.0 - constants[82] = 227700.0 - constants[83] = 7.51 - constants[85] = 2277.0 - constants[86] = 2.5 - constants[87] = 751.0 - constants[89] = 1.642e6 - constants[90] = 542.0 - constants[93] = 175.4 - constants[94] = 445.0 - constants[95] = 0.031 - constants[96] = 0.062 - constants[97] = 0.045 - constants[98] = 10.0 - constants[104] = 67.0 - constants[105] = 3.9 - constants[106] = 0.02 - constants[107] = 0.0012 - constants[108] = 0.46 - constants[109] = 0.0116 - constants[118] = 5.7e-5 - constants[119] = 8314.472 - constants[120] = 310.0 - constants[122] = 0.0 - constants[123] = -35.0 - constants[124] = 0.5 - constants[125] = 0.5 - constants[126] = -45.0 - constants[128] = 0.00427 - constants[129] = 45.0 - constants[131] = 0.5927 - constants[135] = 0.0 - constants[141] = 0.0 - constants[144] = 0.0223 - constants[146] = 0.0 - constants[150] = 1.0e-5 - constants[157] = 0.1539e-3 - constants[163] = 0.4578 - constants[169] = -16.4508 - constants[170] = 4.3371 - constants[177] = 0.0 - constants[178] = 0.0 - constants[181] = 0.000338 - constants[183] = 0.0075 - constants[184] = 0.04132 - constants[189] = 0.0 - constants[190] = 3.5e-3 - constants[195] = 0.00424 - constants[204] = 0.00065 - constants[211] = 1.0 - constants[212] = 0.00345 + constants[5] = 1.8 + constants[6] = 1.0 + constants[7] = 96485.3415 + constants[8] = 14.0 + constants[9] = 1.4 + constants[10] = 0.08105 + constants[11] = 0.0 + constants[12] = 3.343 + constants[13] = 26.44 + constants[14] = 0.0207 + constants[15] = 0.1369 + constants[16] = 395.3 + constants[17] = 2.289 + constants[18] = 0.4315 + constants[19] = 26.44 + constants[20] = 4.663 + constants[21] = 3.663 + constants[22] = 0.0 + constants[23] = 1628.0 + constants[24] = 561.4 + constants[25] = 148041085.1 + constants[26] = 15.0 + constants[27] = 1.0 + constants[28] = 0.45 + constants[29] = 2.5 + constants[30] = 10000.0 + constants[31] = 500.0 + constants[32] = 5.0 + constants[33] = 660.0 + constants[34] = 5.0 + constants[35] = 5.469e-5 + constants[36] = 0.000286113 + constants[37] = 5.0e-5 + constants[38] = 0.04 + constants[39] = 88800.0 + constants[40] = 446.0 + constants[41] = 227700.0 + constants[42] = 7.51 + constants[43] = 2277.0 + constants[44] = 2.5 + constants[45] = 751.0 + constants[46] = 1.642e6 + constants[47] = 542.0 + constants[48] = 175.4 + constants[49] = 445.0 + constants[50] = 0.031 + constants[51] = 0.062 + constants[52] = 0.045 + constants[53] = 10.0 + constants[54] = 67.0 + constants[55] = 3.9 + constants[56] = 0.02 + constants[57] = 0.0012 + constants[58] = 0.46 + constants[59] = 0.0116 + constants[60] = 5.7e-5 + constants[61] = 8314.472 + constants[62] = 310.0 + constants[63] = 0.0 + constants[64] = -35.0 + constants[65] = 0.5 + constants[66] = 0.5 + constants[67] = -45.0 + constants[68] = 0.00427 + constants[69] = 45.0 + constants[70] = 0.5927 + constants[71] = 0.0 + constants[72] = 0.0 + constants[73] = 0.0223 + constants[74] = 0.0 + constants[75] = 1.0e-5 + constants[76] = 0.1539e-3 + constants[77] = 0.4578 + constants[78] = -16.4508 + constants[79] = 4.3371 + constants[80] = 0.0 + constants[81] = 0.0 + constants[82] = 0.000338 + constants[83] = 0.0075 + constants[84] = 0.04132 + constants[85] = 0.0 + constants[86] = 3.5e-3 + constants[87] = 0.00424 + constants[88] = 0.00065 + constants[89] = 1.0 + constants[90] = 0.00345 states[0] = 6.226104e-5 states[1] = 5.0 states[2] = 0.409551 @@ -436,263 +436,263 @@ def initialise_variables(states, rates, constants): def compute_computed_constants(constants, computed_constants): - computed_constants[3] = constants[119]*constants[120]/constants[17] - computed_constants[6] = computed_constants[3]*log(constants[7]/constants[8]) - computed_constants[20] = 1.2 if gt_func(constants[1], 0.0) else 1.0 - computed_constants[35] = constants[4]/(constants[47]+constants[4]) - computed_constants[68] = -0.25 if gt_func(constants[1], 0.0) else 0.7*constants[0]/(0.00009+constants[0]) if gt_func(constants[0], 0.0) else 0.0 - computed_constants[69] = constants[70]*(1.0-computed_constants[68]) - computed_constants[103] = 0.000000001*3.14159265358979*pow(constants[105], 2.0)*constants[104] - computed_constants[19] = 0.000000001*2.0*3.14159265358979*constants[106]*(constants[105]-constants[106]/2.0)*constants[104] - computed_constants[100] = constants[107]*computed_constants[103] - computed_constants[18] = constants[108]*computed_constants[103]-computed_constants[19] - computed_constants[99] = constants[109]*computed_constants[103] - computed_constants[127] = constants[128]/(constants[7]/(constants[7]+constants[129])) - computed_constants[130] = computed_constants[127]/(constants[131]+1.0) - computed_constants[132] = constants[131]*computed_constants[130] - computed_constants[133] = computed_constants[132]*constants[7]/(constants[7]+constants[129]) - computed_constants[134] = computed_constants[130]*constants[7]/(constants[7]+constants[129]) - computed_constants[137] = -1.0-9.898*pow(1.0*constants[0], 0.618)/(pow(1.0*constants[0], 0.618)+0.00122423) if gt_func(constants[0], 0.0) else 0.0 - computed_constants[138] = 7.5 if gt_func(constants[1], 0.0) else 0.0 - computed_constants[162] = 1.23 if gt_func(constants[1], 0.0) else 1.0 - computed_constants[165] = 0.31*constants[0]/(constants[0]+0.00009) - computed_constants[166] = -8.0 if gt_func(constants[1], 0.0) else 0.0 - computed_constants[167] = -27.0 if gt_func(constants[1], 0.0) else 0.0 - computed_constants[203] = 1.2*constants[204] if gt_func(constants[1], 0.0) else constants[204] - computed_constants[206] = -14.0 if gt_func(constants[1], 0.0) else 0.0 - computed_constants[213] = (3.5988-0.025641)/(1.0+0.0000012155/pow(1.0*constants[0], 1.6951))+0.025641 + computed_constants[0] = constants[61]*constants[62]/constants[7] + computed_constants[1] = computed_constants[0]*log(constants[3]/constants[4]) + computed_constants[4] = 1.2 if gt_func(constants[1], 0.0) else 1.0 + computed_constants[5] = constants[2]/(constants[20]+constants[2]) + computed_constants[6] = -0.25 if gt_func(constants[1], 0.0) else 0.7*constants[0]/(0.00009+constants[0]) if gt_func(constants[0], 0.0) else 0.0 + computed_constants[7] = constants[34]*(1.0-computed_constants[6]) + computed_constants[10] = 0.000000001*3.14159265358979*pow(constants[55], 2.0)*constants[54] + computed_constants[3] = 0.000000001*2.0*3.14159265358979*constants[56]*(constants[55]-constants[56]/2.0)*constants[54] + computed_constants[9] = constants[57]*computed_constants[10] + computed_constants[2] = constants[58]*computed_constants[10]-computed_constants[3] + computed_constants[8] = constants[59]*computed_constants[10] + computed_constants[11] = constants[68]/(constants[3]/(constants[3]+constants[69])) + computed_constants[12] = computed_constants[11]/(constants[70]+1.0) + computed_constants[13] = constants[70]*computed_constants[12] + computed_constants[14] = computed_constants[13]*constants[3]/(constants[3]+constants[69]) + computed_constants[15] = computed_constants[12]*constants[3]/(constants[3]+constants[69]) + computed_constants[16] = -1.0-9.898*pow(1.0*constants[0], 0.618)/(pow(1.0*constants[0], 0.618)+0.00122423) if gt_func(constants[0], 0.0) else 0.0 + computed_constants[17] = 7.5 if gt_func(constants[1], 0.0) else 0.0 + computed_constants[18] = 1.23 if gt_func(constants[1], 0.0) else 1.0 + computed_constants[19] = 0.31*constants[0]/(constants[0]+0.00009) + computed_constants[20] = -8.0 if gt_func(constants[1], 0.0) else 0.0 + computed_constants[21] = -27.0 if gt_func(constants[1], 0.0) else 0.0 + computed_constants[22] = 1.2*constants[88] if gt_func(constants[1], 0.0) else constants[88] + computed_constants[23] = -14.0 if gt_func(constants[1], 0.0) else 0.0 + computed_constants[24] = (3.5988-0.025641)/(1.0+0.0000012155/pow(1.0*constants[0], 1.6951))+0.025641 def compute_rates(voi, states, rates, constants, computed_constants, algebraic): - algebraic[5] = states[1] - algebraic[142] = computed_constants[3]*log((constants[4]+0.12*constants[7])/(algebraic[5]+0.12*constants[8])) - algebraic[121] = constants[123] if and_func(gt_func(voi, constants[124]), lt_func(voi, constants[124]+constants[125])) else constants[126] - algebraic[21] = algebraic[121] if geq_func(constants[122], 1.0) else states[15] - algebraic[143] = constants[144]*pow(states[18], 3.0)*states[17]*(algebraic[21]-algebraic[142]) - algebraic[145] = constants[146]*pow(states[18], 3.0)*(algebraic[21]-algebraic[142]) - algebraic[12] = algebraic[143]+algebraic[145] - algebraic[15] = 0.0000185*constants[163]*(algebraic[21]-0.0)/(computed_constants[3]*(1.0-exp(-1.0*(algebraic[21]-0.0)/computed_constants[3])))*(algebraic[5]-constants[4]*exp(-1.0*(algebraic[21]-0.0)/computed_constants[3]))*states[23]*states[22]*states[21] - algebraic[2] = computed_constants[3]*log(constants[4]/algebraic[5]) - algebraic[16] = states[16]*computed_constants[133]*(algebraic[21]-algebraic[2])*(1.0-constants[135]) - algebraic[14] = computed_constants[20]*constants[24]*pow(1.0+pow(constants[23]/constants[7], 1.2), -1.0)*pow(1.0+pow(constants[22]/algebraic[5], 1.3), -1.0)*pow(1.0+exp(-(algebraic[21]-algebraic[2]+110.0)/20.0), -1.0) - algebraic[50] = 1.0+constants[10]/constants[48]*(1.0+exp(constants[49]*algebraic[21]/computed_constants[3]))+constants[4]/constants[51]*(1.0+constants[4]/constants[52]*(1.0+constants[4]/constants[47])) - algebraic[27] = constants[10]/constants[48]*exp(constants[49]*algebraic[21]/computed_constants[3])/algebraic[50] - algebraic[42] = 1.0+states[0]/constants[40]*(1.0+exp(-constants[41]*algebraic[21]/computed_constants[3])+algebraic[5]/constants[46])+algebraic[5]/constants[43]*(1.0+algebraic[5]/constants[44]*(1.0+algebraic[5]/constants[39])) - algebraic[29] = states[0]/constants[40]*exp(-constants[41]*algebraic[21]/computed_constants[3])/algebraic[42] - algebraic[36] = algebraic[5]/(constants[39]+algebraic[5]) - algebraic[37] = exp(constants[45]*algebraic[21]/(2.0*computed_constants[3])) - algebraic[33] = exp(-constants[45]*algebraic[21]/(2.0*computed_constants[3])) - algebraic[38] = algebraic[5]/constants[43]*algebraic[5]/constants[44]*(1.0+algebraic[5]/constants[39])*exp(constants[45]*algebraic[21]/(2.0*computed_constants[3]))/algebraic[42] - algebraic[26] = algebraic[37]*algebraic[36]*(algebraic[38]+algebraic[29])+algebraic[33]*algebraic[29]*(computed_constants[35]+algebraic[37]) - algebraic[34] = constants[4]/constants[51]*constants[4]/constants[52]*(1.0+constants[4]/constants[47])*exp(-constants[45]*algebraic[21]/(2.0*computed_constants[3]))/algebraic[50] - algebraic[28] = algebraic[33]*computed_constants[35]*(algebraic[34]+algebraic[27])+algebraic[27]*algebraic[37]*(algebraic[36]+algebraic[33]) - algebraic[31] = algebraic[34]*computed_constants[35]*(algebraic[38]+algebraic[29])+algebraic[38]*algebraic[27]*(computed_constants[35]+algebraic[37]) - algebraic[32] = algebraic[38]*algebraic[36]*(algebraic[34]+algebraic[27])+algebraic[29]*algebraic[34]*(algebraic[36]+algebraic[33]) - algebraic[13] = (1.0-constants[25])*constants[30]*(algebraic[26]*algebraic[27]-algebraic[28]*algebraic[29])/(algebraic[28]+algebraic[26]+algebraic[32]+algebraic[31]) - rates[1] = (1.0-constants[11])*-1.0*(algebraic[12]+algebraic[16]+algebraic[15]+3.0*algebraic[14]+3.0*algebraic[13])/(1.0*(computed_constants[18]+computed_constants[19])*constants[17]) - algebraic[56] = constants[57]-(constants[57]-constants[58])/(1.0+pow(constants[59]/states[2], constants[60])) - algebraic[63] = constants[64]*algebraic[56] - algebraic[61] = constants[62]/algebraic[56] - rates[4] = constants[65]*states[5]-algebraic[63]*states[0]*states[4]-(algebraic[61]*pow(states[0], 2.0)*states[4]-constants[66]*states[3]) - rates[3] = algebraic[61]*pow(states[0], 2.0)*states[4]-constants[66]*states[3]-(algebraic[63]*states[0]*states[3]-constants[65]*states[6]) - rates[6] = algebraic[63]*states[0]*states[3]-constants[65]*states[6]-(constants[66]*states[6]-algebraic[61]*pow(states[0], 2.0)*states[5]) - rates[5] = constants[66]*states[6]-algebraic[61]*pow(states[0], 2.0)*states[5]-(constants[65]*states[5]-algebraic[63]*states[0]*states[4]) - algebraic[78] = constants[79]*states[7]*(1.0-states[9])-constants[80]*states[9] - rates[9] = algebraic[78] - algebraic[81] = constants[82]*states[7]*(1.0-(states[10]+states[11]))-constants[83]*states[10] - rates[10] = algebraic[81] - algebraic[84] = constants[85]*constants[86]*(1.0-(states[10]+states[11]))-constants[87]*states[11] - rates[11] = algebraic[84] - algebraic[88] = constants[89]*states[7]*(1.0-states[12])-constants[90]*states[12] - rates[12] = algebraic[88] - algebraic[91] = constants[89]*states[0]*(1.0-states[13])-constants[90]*states[13] - rates[13] = algebraic[91] - algebraic[92] = constants[93]*states[2]*(1.0-states[14])-constants[94]*states[14] - rates[14] = algebraic[92] - algebraic[71] = (states[0]-states[7])/constants[72] - algebraic[73] = computed_constants[69]/(1.0+exp((-states[7]+constants[74])/constants[75])) - rates[7] = 1.0*(algebraic[71]*computed_constants[19]-algebraic[73]*computed_constants[99])/computed_constants[18]-(constants[97]*algebraic[88]+constants[95]*algebraic[78]+constants[96]*algebraic[81]) - algebraic[53] = constants[54]*states[3]*(states[2]-states[0]) - algebraic[101] = 2.0*constants[163]*(algebraic[21]-0.0)/(computed_constants[3]*(1.0-exp(-1.0*(algebraic[21]-0.0)*2.0/computed_constants[3])))*(states[0]-constants[10]*exp(-2.0*(algebraic[21]-0.0)/computed_constants[3]))*states[23]*states[22]*states[21] - algebraic[102] = 2.0*constants[184]*algebraic[21]/(computed_constants[3]*(1.0-exp(-1.0*algebraic[21]*2.0/computed_constants[3])))*(states[0]-constants[10]*exp(-2.0*algebraic[21]/computed_constants[3]))*states[25]*states[24] - rates[0] = algebraic[53]*computed_constants[100]/computed_constants[19]-((algebraic[101]+algebraic[102]-2.0*algebraic[13])/(2.0*constants[17]*computed_constants[19])+algebraic[71]+constants[97]*algebraic[91]) - algebraic[76] = (states[8]-states[2])/constants[77] - rates[8] = algebraic[73]-algebraic[76]*computed_constants[100]/computed_constants[99] - rates[2] = algebraic[76]-(algebraic[53]+constants[98]*algebraic[92]) - algebraic[136] = states[16]*computed_constants[134]*(algebraic[21]-computed_constants[6])*(1.0-constants[135]) - algebraic[111] = algebraic[16]+algebraic[136] - algebraic[112] = constants[157]*states[20]*states[19]*(algebraic[21]-computed_constants[6]) - algebraic[113] = constants[211]*constants[212]*(algebraic[21]-computed_constants[6])*(1.0+exp((algebraic[21]+20.0)/20.0))*states[32] if gt_func(constants[0], 0.0) else 0.0 - algebraic[164] = 0.000365*constants[163]*(algebraic[21]-0.0)/(computed_constants[3]*(1.0-exp(-1.0*(algebraic[21]-0.0)/computed_constants[3])))*(constants[8]-constants[7]*exp(-1.0*(algebraic[21]-0.0)/computed_constants[3]))*states[23]*states[22]*states[21] - algebraic[114] = (algebraic[101]+algebraic[164]+algebraic[15])*(1.0-computed_constants[165])*1.0*computed_constants[162] - algebraic[115] = constants[190]*(algebraic[21]-computed_constants[6])*states[27]*states[26] - algebraic[205] = computed_constants[3]*log((constants[7]+0.12*constants[4])/(constants[8]+0.12*algebraic[5])) - algebraic[116] = computed_constants[203]*(algebraic[21]-algebraic[205])*pow(states[31], 2.0) - algebraic[117] = constants[195]*(algebraic[21]-computed_constants[6])*(0.9*states[29]+0.1*states[30])*states[28] - algebraic[110] = algebraic[111]+algebraic[117]+algebraic[116]+algebraic[115]+algebraic[14]+algebraic[13]+algebraic[12]+algebraic[114]+algebraic[102]+algebraic[113]+algebraic[112] - rates[15] = -algebraic[110]/constants[118] - algebraic[140] = 0.01329+0.99921/(1.0+exp((algebraic[21]+97.134-computed_constants[137]-computed_constants[138]-constants[141])/8.1752)) if lt_func(algebraic[21], -(80.0-computed_constants[137]-computed_constants[138]-constants[141])) else 0.0002501*exp(-(algebraic[21]-computed_constants[137]-computed_constants[138]-constants[141])/12.861) - algebraic[139] = 1.0/(0.36*(algebraic[21]+148.8-computed_constants[137]-computed_constants[138])/(exp(0.066*(algebraic[21]+148.8-computed_constants[137]-computed_constants[138]))-1.0)+0.1*(algebraic[21]+87.3-computed_constants[137]-computed_constants[138])/(1.0-exp(-0.2*(algebraic[21]+87.3-computed_constants[137]-computed_constants[138]))))-0.054 - rates[16] = (algebraic[140]-states[16])/algebraic[139] - algebraic[147] = 1.0/(1.0+exp(-(algebraic[21]+42.0504)/8.3106)) - algebraic[148] = algebraic[21]+41.0 - algebraic[149] = 2000.0 if lt_func(fabs(algebraic[148]), constants[150]) else 200.0*algebraic[148]/(1.0-exp(-0.1*algebraic[148])) - algebraic[151] = 8000.0*exp(-0.056*(algebraic[21]+66.0)) - algebraic[152] = 1.0/(algebraic[149]+algebraic[151]) - rates[18] = (algebraic[147]-states[18])/algebraic[152] - algebraic[153] = 1.0/(1.0+exp((algebraic[21]+69.804)/4.4565)) - algebraic[154] = 20.0*exp(-0.125*(algebraic[21]+75.0)) - algebraic[155] = 2000.0/(320.0*exp(-0.1*(algebraic[21]+75.0))+1.0) - algebraic[156] = 1.0/(algebraic[154]+algebraic[155]) - rates[17] = (algebraic[153]-states[17])/algebraic[156] - algebraic[158] = 1.0/(1.0+exp((algebraic[21]+6.0)/-8.6)) - algebraic[159] = 0.009/(1.0+exp((algebraic[21]+5.0)/12.0))+0.0005 - rates[20] = (algebraic[158]-states[20])/algebraic[159] - algebraic[160] = 1.0/(1.0+exp((algebraic[21]+7.5)/10.0)) - algebraic[161] = 0.59/(1.0+exp((algebraic[21]+60.0)/10.0))+3.05 - rates[19] = (algebraic[160]-states[19])/algebraic[161] - algebraic[168] = 1.0/(1.0+exp(-(algebraic[21]-constants[169]-computed_constants[166])/(constants[170]*(1.0+computed_constants[167]/100.0)))) - algebraic[174] = -41.80001 if eq_func(algebraic[21], -41.8) else 0.0 if eq_func(algebraic[21], 0.0) else -6.80001 if eq_func(algebraic[21], -6.8) else algebraic[21] - algebraic[172] = -0.02839*(algebraic[174]+41.8)/(exp(-(algebraic[174]+41.8)/2.5)-1.0)-0.0849*(algebraic[174]+6.8)/(exp(-(algebraic[174]+6.8)/4.8)-1.0) - algebraic[175] = -1.80001 if eq_func(algebraic[21], -1.8) else algebraic[21] - algebraic[173] = 0.01143*(algebraic[175]+1.8)/(exp((algebraic[175]+1.8)/2.5)-1.0) - algebraic[171] = 0.001/(algebraic[172]+algebraic[173]) - rates[23] = (algebraic[168]-states[23])/algebraic[171] - algebraic[176] = 1.0/(1.0+exp((algebraic[21]+37.4+constants[177])/(5.3+constants[178]))) - algebraic[179] = 0.001*(44.3+230.0*exp(-pow((algebraic[21]+36.0)/10.0, 2.0))) - rates[22] = (algebraic[176]-states[22])/algebraic[179] - algebraic[180] = constants[181]/(constants[181]+states[0]) - algebraic[182] = 0.001*algebraic[180]/constants[183] - rates[21] = (algebraic[180]-states[21])/algebraic[182] - algebraic[185] = 1.0/(1.0+exp(-(algebraic[21]+38.3)/5.5)) - algebraic[186] = 0.001/(1.068*exp((algebraic[21]+38.3)/30.0)+1.068*exp(-(algebraic[21]+38.3)/30.0)) - rates[25] = (algebraic[185]-states[25])/algebraic[186] - algebraic[187] = 1.0/(1.0+exp((algebraic[21]+58.7)/3.8)) - algebraic[188] = 1.0/(16.67*exp(-(algebraic[21]+75.0)/83.3)+16.67*exp((algebraic[21]+75.0)/15.38))+constants[189] - rates[24] = (algebraic[187]-states[24])/algebraic[188] - algebraic[191] = 1.0/(1.0+exp((algebraic[21]+49.0)/13.0)) - algebraic[192] = 0.001*0.6*(65.17/(0.57*exp(-0.08*(algebraic[21]+44.0))+0.065*exp(0.1*(algebraic[21]+45.93)))+10.1) - rates[27] = (algebraic[191]-states[27])/algebraic[192] - algebraic[193] = 1.0/(1.0+exp(-(algebraic[21]-19.3)/15.0)) - algebraic[194] = 0.001*0.66*1.4*(15.59/(1.037*exp(0.09*(algebraic[21]+30.61))+0.369*exp(-0.12*(algebraic[21]+23.84)))+2.98) - rates[26] = (algebraic[193]-states[26])/algebraic[194] - algebraic[198] = 1.0/(1.0+exp(-(algebraic[21]+10.0144)/7.6607)) - algebraic[199] = 0.84655354/(4.2*exp(algebraic[21]/17.0)+0.15*exp(-algebraic[21]/21.6)) - rates[30] = (algebraic[198]-states[30])/algebraic[199] - algebraic[200] = 1.0/(30.0*exp(algebraic[21]/10.0)+exp(-algebraic[21]/12.0)) - rates[29] = (algebraic[198]-states[29])/algebraic[200] - algebraic[202] = 1.0/(1.0+exp((algebraic[21]+28.6)/17.1)) - algebraic[201] = 1.0/(100.0*exp(-algebraic[21]/54.645)+656.0*exp(algebraic[21]/106.157)) - rates[28] = (algebraic[202]-states[28])/algebraic[201] - algebraic[207] = sqrt(1.0/(1.0+exp(-(algebraic[21]+0.6383-computed_constants[206])/10.7071))) - algebraic[209] = 28.0/(1.0+exp(-(algebraic[21]-40.0-computed_constants[206])/3.0)) - algebraic[210] = 1.0*exp(-(algebraic[21]-computed_constants[206]-5.0)/25.0) - algebraic[208] = 1.0/(algebraic[209]+algebraic[210]) - rates[31] = (algebraic[207]-states[31])/algebraic[208] - algebraic[214] = 10.0*exp(0.0133*(algebraic[21]+40.0)) - algebraic[215] = computed_constants[213]/(computed_constants[213]+algebraic[214]) - algebraic[216] = 1.0/(computed_constants[213]+algebraic[214]) - rates[32] = (algebraic[215]-states[32])/algebraic[216] + algebraic[1] = states[1] + algebraic[51] = computed_constants[0]*log((constants[2]+0.12*constants[3])/(algebraic[1]+0.12*constants[4])) + algebraic[47] = constants[64] if and_func(gt_func(voi, constants[65]), lt_func(voi, constants[65]+constants[66])) else constants[67] + algebraic[8] = algebraic[47] if geq_func(constants[63], 1.0) else states[15] + algebraic[52] = constants[73]*pow(states[18], 3.0)*states[17]*(algebraic[8]-algebraic[51]) + algebraic[53] = constants[74]*pow(states[18], 3.0)*(algebraic[8]-algebraic[51]) + algebraic[3] = algebraic[52]+algebraic[53] + algebraic[6] = 0.0000185*constants[77]*(algebraic[8]-0.0)/(computed_constants[0]*(1.0-exp(-1.0*(algebraic[8]-0.0)/computed_constants[0])))*(algebraic[1]-constants[2]*exp(-1.0*(algebraic[8]-0.0)/computed_constants[0]))*states[23]*states[22]*states[21] + algebraic[0] = computed_constants[0]*log(constants[2]/algebraic[1]) + algebraic[7] = states[16]*computed_constants[14]*(algebraic[8]-algebraic[0])*(1.0-constants[71]) + algebraic[5] = computed_constants[4]*constants[10]*pow(1.0+pow(constants[9]/constants[3], 1.2), -1.0)*pow(1.0+pow(constants[8]/algebraic[1], 1.3), -1.0)*pow(1.0+exp(-(algebraic[8]-algebraic[0]+110.0)/20.0), -1.0) + algebraic[21] = 1.0+constants[5]/constants[21]*(1.0+exp(constants[22]*algebraic[8]/computed_constants[0]))+constants[2]/constants[23]*(1.0+constants[2]/constants[24]*(1.0+constants[2]/constants[20])) + algebraic[10] = constants[5]/constants[21]*exp(constants[22]*algebraic[8]/computed_constants[0])/algebraic[21] + algebraic[20] = 1.0+states[0]/constants[14]*(1.0+exp(-constants[15]*algebraic[8]/computed_constants[0])+algebraic[1]/constants[19])+algebraic[1]/constants[16]*(1.0+algebraic[1]/constants[17]*(1.0+algebraic[1]/constants[13])) + algebraic[12] = states[0]/constants[14]*exp(-constants[15]*algebraic[8]/computed_constants[0])/algebraic[20] + algebraic[17] = algebraic[1]/(constants[13]+algebraic[1]) + algebraic[18] = exp(constants[18]*algebraic[8]/(2.0*computed_constants[0])) + algebraic[15] = exp(-constants[18]*algebraic[8]/(2.0*computed_constants[0])) + algebraic[19] = algebraic[1]/constants[16]*algebraic[1]/constants[17]*(1.0+algebraic[1]/constants[13])*exp(constants[18]*algebraic[8]/(2.0*computed_constants[0]))/algebraic[20] + algebraic[9] = algebraic[18]*algebraic[17]*(algebraic[19]+algebraic[12])+algebraic[15]*algebraic[12]*(computed_constants[5]+algebraic[18]) + algebraic[16] = constants[2]/constants[23]*constants[2]/constants[24]*(1.0+constants[2]/constants[20])*exp(-constants[18]*algebraic[8]/(2.0*computed_constants[0]))/algebraic[21] + algebraic[11] = algebraic[15]*computed_constants[5]*(algebraic[16]+algebraic[10])+algebraic[10]*algebraic[18]*(algebraic[17]+algebraic[15]) + algebraic[13] = algebraic[16]*computed_constants[5]*(algebraic[19]+algebraic[12])+algebraic[19]*algebraic[10]*(computed_constants[5]+algebraic[18]) + algebraic[14] = algebraic[19]*algebraic[17]*(algebraic[16]+algebraic[10])+algebraic[12]*algebraic[16]*(algebraic[17]+algebraic[15]) + algebraic[4] = (1.0-constants[11])*constants[12]*(algebraic[9]*algebraic[10]-algebraic[11]*algebraic[12])/(algebraic[11]+algebraic[9]+algebraic[14]+algebraic[13]) + rates[1] = (1.0-constants[6])*-1.0*(algebraic[3]+algebraic[7]+algebraic[6]+3.0*algebraic[5]+3.0*algebraic[4])/(1.0*(computed_constants[2]+computed_constants[3])*constants[7]) + algebraic[24] = constants[26]-(constants[26]-constants[27])/(1.0+pow(constants[28]/states[2], constants[29])) + algebraic[26] = constants[31]*algebraic[24] + algebraic[25] = constants[30]/algebraic[24] + rates[4] = constants[32]*states[5]-algebraic[26]*states[0]*states[4]-(algebraic[25]*pow(states[0], 2.0)*states[4]-constants[33]*states[3]) + rates[3] = algebraic[25]*pow(states[0], 2.0)*states[4]-constants[33]*states[3]-(algebraic[26]*states[0]*states[3]-constants[32]*states[6]) + rates[6] = algebraic[26]*states[0]*states[3]-constants[32]*states[6]-(constants[33]*states[6]-algebraic[25]*pow(states[0], 2.0)*states[5]) + rates[5] = constants[33]*states[6]-algebraic[25]*pow(states[0], 2.0)*states[5]-(constants[32]*states[5]-algebraic[26]*states[0]*states[4]) + algebraic[31] = constants[39]*states[7]*(1.0-states[9])-constants[40]*states[9] + rates[9] = algebraic[31] + algebraic[32] = constants[41]*states[7]*(1.0-(states[10]+states[11]))-constants[42]*states[10] + rates[10] = algebraic[32] + algebraic[33] = constants[43]*constants[44]*(1.0-(states[10]+states[11]))-constants[45]*states[11] + rates[11] = algebraic[33] + algebraic[34] = constants[46]*states[7]*(1.0-states[12])-constants[47]*states[12] + rates[12] = algebraic[34] + algebraic[35] = constants[46]*states[0]*(1.0-states[13])-constants[47]*states[13] + rates[13] = algebraic[35] + algebraic[36] = constants[48]*states[2]*(1.0-states[14])-constants[49]*states[14] + rates[14] = algebraic[36] + algebraic[28] = (states[0]-states[7])/constants[35] + algebraic[29] = computed_constants[7]/(1.0+exp((-states[7]+constants[36])/constants[37])) + rates[7] = 1.0*(algebraic[28]*computed_constants[3]-algebraic[29]*computed_constants[8])/computed_constants[2]-(constants[52]*algebraic[34]+constants[50]*algebraic[31]+constants[51]*algebraic[32]) + algebraic[22] = constants[25]*states[3]*(states[2]-states[0]) + algebraic[37] = 2.0*constants[77]*(algebraic[8]-0.0)/(computed_constants[0]*(1.0-exp(-1.0*(algebraic[8]-0.0)*2.0/computed_constants[0])))*(states[0]-constants[5]*exp(-2.0*(algebraic[8]-0.0)/computed_constants[0]))*states[23]*states[22]*states[21] + algebraic[38] = 2.0*constants[84]*algebraic[8]/(computed_constants[0]*(1.0-exp(-1.0*algebraic[8]*2.0/computed_constants[0])))*(states[0]-constants[5]*exp(-2.0*algebraic[8]/computed_constants[0]))*states[25]*states[24] + rates[0] = algebraic[22]*computed_constants[9]/computed_constants[3]-((algebraic[37]+algebraic[38]-2.0*algebraic[4])/(2.0*constants[7]*computed_constants[3])+algebraic[28]+constants[52]*algebraic[35]) + algebraic[30] = (states[8]-states[2])/constants[38] + rates[8] = algebraic[29]-algebraic[30]*computed_constants[9]/computed_constants[8] + rates[2] = algebraic[30]-(algebraic[22]+constants[53]*algebraic[36]) + algebraic[48] = states[16]*computed_constants[15]*(algebraic[8]-computed_constants[1])*(1.0-constants[71]) + algebraic[40] = algebraic[7]+algebraic[48] + algebraic[41] = constants[76]*states[20]*states[19]*(algebraic[8]-computed_constants[1]) + algebraic[42] = constants[89]*constants[90]*(algebraic[8]-computed_constants[1])*(1.0+exp((algebraic[8]+20.0)/20.0))*states[32] if gt_func(constants[0], 0.0) else 0.0 + algebraic[67] = 0.000365*constants[77]*(algebraic[8]-0.0)/(computed_constants[0]*(1.0-exp(-1.0*(algebraic[8]-0.0)/computed_constants[0])))*(constants[4]-constants[3]*exp(-1.0*(algebraic[8]-0.0)/computed_constants[0]))*states[23]*states[22]*states[21] + algebraic[43] = (algebraic[37]+algebraic[67]+algebraic[6])*(1.0-computed_constants[19])*1.0*computed_constants[18] + algebraic[44] = constants[86]*(algebraic[8]-computed_constants[1])*states[27]*states[26] + algebraic[93] = computed_constants[0]*log((constants[3]+0.12*constants[2])/(constants[4]+0.12*algebraic[1])) + algebraic[45] = computed_constants[22]*(algebraic[8]-algebraic[93])*pow(states[31], 2.0) + algebraic[46] = constants[87]*(algebraic[8]-computed_constants[1])*(0.9*states[29]+0.1*states[30])*states[28] + algebraic[39] = algebraic[40]+algebraic[46]+algebraic[45]+algebraic[44]+algebraic[5]+algebraic[4]+algebraic[3]+algebraic[43]+algebraic[38]+algebraic[42]+algebraic[41] + rates[15] = -algebraic[39]/constants[60] + algebraic[50] = 0.01329+0.99921/(1.0+exp((algebraic[8]+97.134-computed_constants[16]-computed_constants[17]-constants[72])/8.1752)) if lt_func(algebraic[8], -(80.0-computed_constants[16]-computed_constants[17]-constants[72])) else 0.0002501*exp(-(algebraic[8]-computed_constants[16]-computed_constants[17]-constants[72])/12.861) + algebraic[49] = 1.0/(0.36*(algebraic[8]+148.8-computed_constants[16]-computed_constants[17])/(exp(0.066*(algebraic[8]+148.8-computed_constants[16]-computed_constants[17]))-1.0)+0.1*(algebraic[8]+87.3-computed_constants[16]-computed_constants[17])/(1.0-exp(-0.2*(algebraic[8]+87.3-computed_constants[16]-computed_constants[17]))))-0.054 + rates[16] = (algebraic[50]-states[16])/algebraic[49] + algebraic[54] = 1.0/(1.0+exp(-(algebraic[8]+42.0504)/8.3106)) + algebraic[55] = algebraic[8]+41.0 + algebraic[56] = 2000.0 if lt_func(fabs(algebraic[55]), constants[75]) else 200.0*algebraic[55]/(1.0-exp(-0.1*algebraic[55])) + algebraic[57] = 8000.0*exp(-0.056*(algebraic[8]+66.0)) + algebraic[58] = 1.0/(algebraic[56]+algebraic[57]) + rates[18] = (algebraic[54]-states[18])/algebraic[58] + algebraic[59] = 1.0/(1.0+exp((algebraic[8]+69.804)/4.4565)) + algebraic[60] = 20.0*exp(-0.125*(algebraic[8]+75.0)) + algebraic[61] = 2000.0/(320.0*exp(-0.1*(algebraic[8]+75.0))+1.0) + algebraic[62] = 1.0/(algebraic[60]+algebraic[61]) + rates[17] = (algebraic[59]-states[17])/algebraic[62] + algebraic[63] = 1.0/(1.0+exp((algebraic[8]+6.0)/-8.6)) + algebraic[64] = 0.009/(1.0+exp((algebraic[8]+5.0)/12.0))+0.0005 + rates[20] = (algebraic[63]-states[20])/algebraic[64] + algebraic[65] = 1.0/(1.0+exp((algebraic[8]+7.5)/10.0)) + algebraic[66] = 0.59/(1.0+exp((algebraic[8]+60.0)/10.0))+3.05 + rates[19] = (algebraic[65]-states[19])/algebraic[66] + algebraic[68] = 1.0/(1.0+exp(-(algebraic[8]-constants[78]-computed_constants[20])/(constants[79]*(1.0+computed_constants[21]/100.0)))) + algebraic[72] = -41.80001 if eq_func(algebraic[8], -41.8) else 0.0 if eq_func(algebraic[8], 0.0) else -6.80001 if eq_func(algebraic[8], -6.8) else algebraic[8] + algebraic[70] = -0.02839*(algebraic[72]+41.8)/(exp(-(algebraic[72]+41.8)/2.5)-1.0)-0.0849*(algebraic[72]+6.8)/(exp(-(algebraic[72]+6.8)/4.8)-1.0) + algebraic[73] = -1.80001 if eq_func(algebraic[8], -1.8) else algebraic[8] + algebraic[71] = 0.01143*(algebraic[73]+1.8)/(exp((algebraic[73]+1.8)/2.5)-1.0) + algebraic[69] = 0.001/(algebraic[70]+algebraic[71]) + rates[23] = (algebraic[68]-states[23])/algebraic[69] + algebraic[74] = 1.0/(1.0+exp((algebraic[8]+37.4+constants[80])/(5.3+constants[81]))) + algebraic[75] = 0.001*(44.3+230.0*exp(-pow((algebraic[8]+36.0)/10.0, 2.0))) + rates[22] = (algebraic[74]-states[22])/algebraic[75] + algebraic[76] = constants[82]/(constants[82]+states[0]) + algebraic[77] = 0.001*algebraic[76]/constants[83] + rates[21] = (algebraic[76]-states[21])/algebraic[77] + algebraic[78] = 1.0/(1.0+exp(-(algebraic[8]+38.3)/5.5)) + algebraic[79] = 0.001/(1.068*exp((algebraic[8]+38.3)/30.0)+1.068*exp(-(algebraic[8]+38.3)/30.0)) + rates[25] = (algebraic[78]-states[25])/algebraic[79] + algebraic[80] = 1.0/(1.0+exp((algebraic[8]+58.7)/3.8)) + algebraic[81] = 1.0/(16.67*exp(-(algebraic[8]+75.0)/83.3)+16.67*exp((algebraic[8]+75.0)/15.38))+constants[85] + rates[24] = (algebraic[80]-states[24])/algebraic[81] + algebraic[82] = 1.0/(1.0+exp((algebraic[8]+49.0)/13.0)) + algebraic[83] = 0.001*0.6*(65.17/(0.57*exp(-0.08*(algebraic[8]+44.0))+0.065*exp(0.1*(algebraic[8]+45.93)))+10.1) + rates[27] = (algebraic[82]-states[27])/algebraic[83] + algebraic[84] = 1.0/(1.0+exp(-(algebraic[8]-19.3)/15.0)) + algebraic[85] = 0.001*0.66*1.4*(15.59/(1.037*exp(0.09*(algebraic[8]+30.61))+0.369*exp(-0.12*(algebraic[8]+23.84)))+2.98) + rates[26] = (algebraic[84]-states[26])/algebraic[85] + algebraic[88] = 1.0/(1.0+exp(-(algebraic[8]+10.0144)/7.6607)) + algebraic[89] = 0.84655354/(4.2*exp(algebraic[8]/17.0)+0.15*exp(-algebraic[8]/21.6)) + rates[30] = (algebraic[88]-states[30])/algebraic[89] + algebraic[90] = 1.0/(30.0*exp(algebraic[8]/10.0)+exp(-algebraic[8]/12.0)) + rates[29] = (algebraic[88]-states[29])/algebraic[90] + algebraic[92] = 1.0/(1.0+exp((algebraic[8]+28.6)/17.1)) + algebraic[91] = 1.0/(100.0*exp(-algebraic[8]/54.645)+656.0*exp(algebraic[8]/106.157)) + rates[28] = (algebraic[92]-states[28])/algebraic[91] + algebraic[94] = sqrt(1.0/(1.0+exp(-(algebraic[8]+0.6383-computed_constants[23])/10.7071))) + algebraic[96] = 28.0/(1.0+exp(-(algebraic[8]-40.0-computed_constants[23])/3.0)) + algebraic[97] = 1.0*exp(-(algebraic[8]-computed_constants[23]-5.0)/25.0) + algebraic[95] = 1.0/(algebraic[96]+algebraic[97]) + rates[31] = (algebraic[94]-states[31])/algebraic[95] + algebraic[98] = 10.0*exp(0.0133*(algebraic[8]+40.0)) + algebraic[99] = computed_constants[24]/(computed_constants[24]+algebraic[98]) + algebraic[100] = 1.0/(computed_constants[24]+algebraic[98]) + rates[32] = (algebraic[99]-states[32])/algebraic[100] def compute_variables(voi, states, rates, constants, computed_constants, algebraic): - algebraic[5] = states[1] - algebraic[2] = computed_constants[3]*log(constants[4]/algebraic[5]) - algebraic[9] = 0.5*computed_constants[3]*log(constants[10]/states[0]) - algebraic[21] = algebraic[121] if geq_func(constants[122], 1.0) else states[15] - algebraic[14] = computed_constants[20]*constants[24]*pow(1.0+pow(constants[23]/constants[7], 1.2), -1.0)*pow(1.0+pow(constants[22]/algebraic[5], 1.3), -1.0)*pow(1.0+exp(-(algebraic[21]-algebraic[2]+110.0)/20.0), -1.0) - algebraic[50] = 1.0+constants[10]/constants[48]*(1.0+exp(constants[49]*algebraic[21]/computed_constants[3]))+constants[4]/constants[51]*(1.0+constants[4]/constants[52]*(1.0+constants[4]/constants[47])) - algebraic[27] = constants[10]/constants[48]*exp(constants[49]*algebraic[21]/computed_constants[3])/algebraic[50] - algebraic[42] = 1.0+states[0]/constants[40]*(1.0+exp(-constants[41]*algebraic[21]/computed_constants[3])+algebraic[5]/constants[46])+algebraic[5]/constants[43]*(1.0+algebraic[5]/constants[44]*(1.0+algebraic[5]/constants[39])) - algebraic[29] = states[0]/constants[40]*exp(-constants[41]*algebraic[21]/computed_constants[3])/algebraic[42] - algebraic[36] = algebraic[5]/(constants[39]+algebraic[5]) - algebraic[37] = exp(constants[45]*algebraic[21]/(2.0*computed_constants[3])) - algebraic[33] = exp(-constants[45]*algebraic[21]/(2.0*computed_constants[3])) - algebraic[38] = algebraic[5]/constants[43]*algebraic[5]/constants[44]*(1.0+algebraic[5]/constants[39])*exp(constants[45]*algebraic[21]/(2.0*computed_constants[3]))/algebraic[42] - algebraic[26] = algebraic[37]*algebraic[36]*(algebraic[38]+algebraic[29])+algebraic[33]*algebraic[29]*(computed_constants[35]+algebraic[37]) - algebraic[34] = constants[4]/constants[51]*constants[4]/constants[52]*(1.0+constants[4]/constants[47])*exp(-constants[45]*algebraic[21]/(2.0*computed_constants[3]))/algebraic[50] - algebraic[28] = algebraic[33]*computed_constants[35]*(algebraic[34]+algebraic[27])+algebraic[27]*algebraic[37]*(algebraic[36]+algebraic[33]) - algebraic[31] = algebraic[34]*computed_constants[35]*(algebraic[38]+algebraic[29])+algebraic[38]*algebraic[27]*(computed_constants[35]+algebraic[37]) - algebraic[32] = algebraic[38]*algebraic[36]*(algebraic[34]+algebraic[27])+algebraic[29]*algebraic[34]*(algebraic[36]+algebraic[33]) - algebraic[13] = (1.0-constants[25])*constants[30]*(algebraic[26]*algebraic[27]-algebraic[28]*algebraic[29])/(algebraic[28]+algebraic[26]+algebraic[32]+algebraic[31]) - algebraic[53] = constants[54]*states[3]*(states[2]-states[0]) - algebraic[55] = states[2]-states[0] - algebraic[56] = constants[57]-(constants[57]-constants[58])/(1.0+pow(constants[59]/states[2], constants[60])) - algebraic[61] = constants[62]/algebraic[56] - algebraic[63] = constants[64]*algebraic[56] - algebraic[67] = states[4]+states[3]+states[6]+states[5] - algebraic[71] = (states[0]-states[7])/constants[72] - algebraic[73] = computed_constants[69]/(1.0+exp((-states[7]+constants[74])/constants[75])) - algebraic[76] = (states[8]-states[2])/constants[77] - algebraic[78] = constants[79]*states[7]*(1.0-states[9])-constants[80]*states[9] - algebraic[81] = constants[82]*states[7]*(1.0-(states[10]+states[11]))-constants[83]*states[10] - algebraic[84] = constants[85]*constants[86]*(1.0-(states[10]+states[11]))-constants[87]*states[11] - algebraic[88] = constants[89]*states[7]*(1.0-states[12])-constants[90]*states[12] - algebraic[91] = constants[89]*states[0]*(1.0-states[13])-constants[90]*states[13] - algebraic[92] = constants[93]*states[2]*(1.0-states[14])-constants[94]*states[14] - algebraic[16] = states[16]*computed_constants[133]*(algebraic[21]-algebraic[2])*(1.0-constants[135]) - algebraic[136] = states[16]*computed_constants[134]*(algebraic[21]-computed_constants[6])*(1.0-constants[135]) - algebraic[111] = algebraic[16]+algebraic[136] - algebraic[112] = constants[157]*states[20]*states[19]*(algebraic[21]-computed_constants[6]) - algebraic[113] = constants[211]*constants[212]*(algebraic[21]-computed_constants[6])*(1.0+exp((algebraic[21]+20.0)/20.0))*states[32] if gt_func(constants[0], 0.0) else 0.0 - algebraic[102] = 2.0*constants[184]*algebraic[21]/(computed_constants[3]*(1.0-exp(-1.0*algebraic[21]*2.0/computed_constants[3])))*(states[0]-constants[10]*exp(-2.0*algebraic[21]/computed_constants[3]))*states[25]*states[24] - algebraic[101] = 2.0*constants[163]*(algebraic[21]-0.0)/(computed_constants[3]*(1.0-exp(-1.0*(algebraic[21]-0.0)*2.0/computed_constants[3])))*(states[0]-constants[10]*exp(-2.0*(algebraic[21]-0.0)/computed_constants[3]))*states[23]*states[22]*states[21] - algebraic[15] = 0.0000185*constants[163]*(algebraic[21]-0.0)/(computed_constants[3]*(1.0-exp(-1.0*(algebraic[21]-0.0)/computed_constants[3])))*(algebraic[5]-constants[4]*exp(-1.0*(algebraic[21]-0.0)/computed_constants[3]))*states[23]*states[22]*states[21] - algebraic[164] = 0.000365*constants[163]*(algebraic[21]-0.0)/(computed_constants[3]*(1.0-exp(-1.0*(algebraic[21]-0.0)/computed_constants[3])))*(constants[8]-constants[7]*exp(-1.0*(algebraic[21]-0.0)/computed_constants[3]))*states[23]*states[22]*states[21] - algebraic[114] = (algebraic[101]+algebraic[164]+algebraic[15])*(1.0-computed_constants[165])*1.0*computed_constants[162] - algebraic[142] = computed_constants[3]*log((constants[4]+0.12*constants[7])/(algebraic[5]+0.12*constants[8])) - algebraic[143] = constants[144]*pow(states[18], 3.0)*states[17]*(algebraic[21]-algebraic[142]) - algebraic[145] = constants[146]*pow(states[18], 3.0)*(algebraic[21]-algebraic[142]) - algebraic[12] = algebraic[143]+algebraic[145] - algebraic[115] = constants[190]*(algebraic[21]-computed_constants[6])*states[27]*states[26] - algebraic[205] = computed_constants[3]*log((constants[7]+0.12*constants[4])/(constants[8]+0.12*algebraic[5])) - algebraic[116] = computed_constants[203]*(algebraic[21]-algebraic[205])*pow(states[31], 2.0) - algebraic[117] = constants[195]*(algebraic[21]-computed_constants[6])*(0.9*states[29]+0.1*states[30])*states[28] - algebraic[110] = algebraic[111]+algebraic[117]+algebraic[116]+algebraic[115]+algebraic[14]+algebraic[13]+algebraic[12]+algebraic[114]+algebraic[102]+algebraic[113]+algebraic[112] - algebraic[139] = 1.0/(0.36*(algebraic[21]+148.8-computed_constants[137]-computed_constants[138])/(exp(0.066*(algebraic[21]+148.8-computed_constants[137]-computed_constants[138]))-1.0)+0.1*(algebraic[21]+87.3-computed_constants[137]-computed_constants[138])/(1.0-exp(-0.2*(algebraic[21]+87.3-computed_constants[137]-computed_constants[138]))))-0.054 - algebraic[140] = 0.01329+0.99921/(1.0+exp((algebraic[21]+97.134-computed_constants[137]-computed_constants[138]-constants[141])/8.1752)) if lt_func(algebraic[21], -(80.0-computed_constants[137]-computed_constants[138]-constants[141])) else 0.0002501*exp(-(algebraic[21]-computed_constants[137]-computed_constants[138]-constants[141])/12.861) - algebraic[147] = 1.0/(1.0+exp(-(algebraic[21]+42.0504)/8.3106)) - algebraic[148] = algebraic[21]+41.0 - algebraic[149] = 2000.0 if lt_func(fabs(algebraic[148]), constants[150]) else 200.0*algebraic[148]/(1.0-exp(-0.1*algebraic[148])) - algebraic[151] = 8000.0*exp(-0.056*(algebraic[21]+66.0)) - algebraic[152] = 1.0/(algebraic[149]+algebraic[151]) - algebraic[153] = 1.0/(1.0+exp((algebraic[21]+69.804)/4.4565)) - algebraic[154] = 20.0*exp(-0.125*(algebraic[21]+75.0)) - algebraic[155] = 2000.0/(320.0*exp(-0.1*(algebraic[21]+75.0))+1.0) - algebraic[156] = 1.0/(algebraic[154]+algebraic[155]) - algebraic[158] = 1.0/(1.0+exp((algebraic[21]+6.0)/-8.6)) - algebraic[159] = 0.009/(1.0+exp((algebraic[21]+5.0)/12.0))+0.0005 - algebraic[160] = 1.0/(1.0+exp((algebraic[21]+7.5)/10.0)) - algebraic[161] = 0.59/(1.0+exp((algebraic[21]+60.0)/10.0))+3.05 - algebraic[168] = 1.0/(1.0+exp(-(algebraic[21]-constants[169]-computed_constants[166])/(constants[170]*(1.0+computed_constants[167]/100.0)))) - algebraic[174] = -41.80001 if eq_func(algebraic[21], -41.8) else 0.0 if eq_func(algebraic[21], 0.0) else -6.80001 if eq_func(algebraic[21], -6.8) else algebraic[21] - algebraic[172] = -0.02839*(algebraic[174]+41.8)/(exp(-(algebraic[174]+41.8)/2.5)-1.0)-0.0849*(algebraic[174]+6.8)/(exp(-(algebraic[174]+6.8)/4.8)-1.0) - algebraic[175] = -1.80001 if eq_func(algebraic[21], -1.8) else algebraic[21] - algebraic[173] = 0.01143*(algebraic[175]+1.8)/(exp((algebraic[175]+1.8)/2.5)-1.0) - algebraic[171] = 0.001/(algebraic[172]+algebraic[173]) - algebraic[176] = 1.0/(1.0+exp((algebraic[21]+37.4+constants[177])/(5.3+constants[178]))) - algebraic[179] = 0.001*(44.3+230.0*exp(-pow((algebraic[21]+36.0)/10.0, 2.0))) - algebraic[180] = constants[181]/(constants[181]+states[0]) - algebraic[182] = 0.001*algebraic[180]/constants[183] - algebraic[185] = 1.0/(1.0+exp(-(algebraic[21]+38.3)/5.5)) - algebraic[186] = 0.001/(1.068*exp((algebraic[21]+38.3)/30.0)+1.068*exp(-(algebraic[21]+38.3)/30.0)) - algebraic[187] = 1.0/(1.0+exp((algebraic[21]+58.7)/3.8)) - algebraic[188] = 1.0/(16.67*exp(-(algebraic[21]+75.0)/83.3)+16.67*exp((algebraic[21]+75.0)/15.38))+constants[189] - algebraic[191] = 1.0/(1.0+exp((algebraic[21]+49.0)/13.0)) - algebraic[192] = 0.001*0.6*(65.17/(0.57*exp(-0.08*(algebraic[21]+44.0))+0.065*exp(0.1*(algebraic[21]+45.93)))+10.1) - algebraic[193] = 1.0/(1.0+exp(-(algebraic[21]-19.3)/15.0)) - algebraic[194] = 0.001*0.66*1.4*(15.59/(1.037*exp(0.09*(algebraic[21]+30.61))+0.369*exp(-0.12*(algebraic[21]+23.84)))+2.98) - algebraic[196] = 1.0/(1.0+exp(-(algebraic[21]+23.2)/6.6))/(0.84655354/(37.2*exp(algebraic[21]/11.9)+0.96*exp(-algebraic[21]/18.5))) - algebraic[197] = 4.0*((37.2*exp(algebraic[21]/15.9)+0.96*exp(-algebraic[21]/22.5))/0.84655354-1.0/(1.0+exp(-(algebraic[21]+23.2)/10.6))/(0.84655354/(37.2*exp(algebraic[21]/15.9)+0.96*exp(-algebraic[21]/22.5)))) - algebraic[198] = 1.0/(1.0+exp(-(algebraic[21]+10.0144)/7.6607)) - algebraic[199] = 0.84655354/(4.2*exp(algebraic[21]/17.0)+0.15*exp(-algebraic[21]/21.6)) - algebraic[200] = 1.0/(30.0*exp(algebraic[21]/10.0)+exp(-algebraic[21]/12.0)) - algebraic[201] = 1.0/(100.0*exp(-algebraic[21]/54.645)+656.0*exp(algebraic[21]/106.157)) - algebraic[202] = 1.0/(1.0+exp((algebraic[21]+28.6)/17.1)) - algebraic[207] = sqrt(1.0/(1.0+exp(-(algebraic[21]+0.6383-computed_constants[206])/10.7071))) - algebraic[209] = 28.0/(1.0+exp(-(algebraic[21]-40.0-computed_constants[206])/3.0)) - algebraic[210] = 1.0*exp(-(algebraic[21]-computed_constants[206]-5.0)/25.0) - algebraic[208] = 1.0/(algebraic[209]+algebraic[210]) - algebraic[214] = 10.0*exp(0.0133*(algebraic[21]+40.0)) - algebraic[215] = computed_constants[213]/(computed_constants[213]+algebraic[214]) - algebraic[216] = 1.0/(computed_constants[213]+algebraic[214]) + algebraic[1] = states[1] + algebraic[0] = computed_constants[0]*log(constants[2]/algebraic[1]) + algebraic[2] = 0.5*computed_constants[0]*log(constants[5]/states[0]) + algebraic[8] = algebraic[47] if geq_func(constants[63], 1.0) else states[15] + algebraic[5] = computed_constants[4]*constants[10]*pow(1.0+pow(constants[9]/constants[3], 1.2), -1.0)*pow(1.0+pow(constants[8]/algebraic[1], 1.3), -1.0)*pow(1.0+exp(-(algebraic[8]-algebraic[0]+110.0)/20.0), -1.0) + algebraic[21] = 1.0+constants[5]/constants[21]*(1.0+exp(constants[22]*algebraic[8]/computed_constants[0]))+constants[2]/constants[23]*(1.0+constants[2]/constants[24]*(1.0+constants[2]/constants[20])) + algebraic[10] = constants[5]/constants[21]*exp(constants[22]*algebraic[8]/computed_constants[0])/algebraic[21] + algebraic[20] = 1.0+states[0]/constants[14]*(1.0+exp(-constants[15]*algebraic[8]/computed_constants[0])+algebraic[1]/constants[19])+algebraic[1]/constants[16]*(1.0+algebraic[1]/constants[17]*(1.0+algebraic[1]/constants[13])) + algebraic[12] = states[0]/constants[14]*exp(-constants[15]*algebraic[8]/computed_constants[0])/algebraic[20] + algebraic[17] = algebraic[1]/(constants[13]+algebraic[1]) + algebraic[18] = exp(constants[18]*algebraic[8]/(2.0*computed_constants[0])) + algebraic[15] = exp(-constants[18]*algebraic[8]/(2.0*computed_constants[0])) + algebraic[19] = algebraic[1]/constants[16]*algebraic[1]/constants[17]*(1.0+algebraic[1]/constants[13])*exp(constants[18]*algebraic[8]/(2.0*computed_constants[0]))/algebraic[20] + algebraic[9] = algebraic[18]*algebraic[17]*(algebraic[19]+algebraic[12])+algebraic[15]*algebraic[12]*(computed_constants[5]+algebraic[18]) + algebraic[16] = constants[2]/constants[23]*constants[2]/constants[24]*(1.0+constants[2]/constants[20])*exp(-constants[18]*algebraic[8]/(2.0*computed_constants[0]))/algebraic[21] + algebraic[11] = algebraic[15]*computed_constants[5]*(algebraic[16]+algebraic[10])+algebraic[10]*algebraic[18]*(algebraic[17]+algebraic[15]) + algebraic[13] = algebraic[16]*computed_constants[5]*(algebraic[19]+algebraic[12])+algebraic[19]*algebraic[10]*(computed_constants[5]+algebraic[18]) + algebraic[14] = algebraic[19]*algebraic[17]*(algebraic[16]+algebraic[10])+algebraic[12]*algebraic[16]*(algebraic[17]+algebraic[15]) + algebraic[4] = (1.0-constants[11])*constants[12]*(algebraic[9]*algebraic[10]-algebraic[11]*algebraic[12])/(algebraic[11]+algebraic[9]+algebraic[14]+algebraic[13]) + algebraic[22] = constants[25]*states[3]*(states[2]-states[0]) + algebraic[23] = states[2]-states[0] + algebraic[24] = constants[26]-(constants[26]-constants[27])/(1.0+pow(constants[28]/states[2], constants[29])) + algebraic[25] = constants[30]/algebraic[24] + algebraic[26] = constants[31]*algebraic[24] + algebraic[27] = states[4]+states[3]+states[6]+states[5] + algebraic[28] = (states[0]-states[7])/constants[35] + algebraic[29] = computed_constants[7]/(1.0+exp((-states[7]+constants[36])/constants[37])) + algebraic[30] = (states[8]-states[2])/constants[38] + algebraic[31] = constants[39]*states[7]*(1.0-states[9])-constants[40]*states[9] + algebraic[32] = constants[41]*states[7]*(1.0-(states[10]+states[11]))-constants[42]*states[10] + algebraic[33] = constants[43]*constants[44]*(1.0-(states[10]+states[11]))-constants[45]*states[11] + algebraic[34] = constants[46]*states[7]*(1.0-states[12])-constants[47]*states[12] + algebraic[35] = constants[46]*states[0]*(1.0-states[13])-constants[47]*states[13] + algebraic[36] = constants[48]*states[2]*(1.0-states[14])-constants[49]*states[14] + algebraic[7] = states[16]*computed_constants[14]*(algebraic[8]-algebraic[0])*(1.0-constants[71]) + algebraic[48] = states[16]*computed_constants[15]*(algebraic[8]-computed_constants[1])*(1.0-constants[71]) + algebraic[40] = algebraic[7]+algebraic[48] + algebraic[41] = constants[76]*states[20]*states[19]*(algebraic[8]-computed_constants[1]) + algebraic[42] = constants[89]*constants[90]*(algebraic[8]-computed_constants[1])*(1.0+exp((algebraic[8]+20.0)/20.0))*states[32] if gt_func(constants[0], 0.0) else 0.0 + algebraic[38] = 2.0*constants[84]*algebraic[8]/(computed_constants[0]*(1.0-exp(-1.0*algebraic[8]*2.0/computed_constants[0])))*(states[0]-constants[5]*exp(-2.0*algebraic[8]/computed_constants[0]))*states[25]*states[24] + algebraic[37] = 2.0*constants[77]*(algebraic[8]-0.0)/(computed_constants[0]*(1.0-exp(-1.0*(algebraic[8]-0.0)*2.0/computed_constants[0])))*(states[0]-constants[5]*exp(-2.0*(algebraic[8]-0.0)/computed_constants[0]))*states[23]*states[22]*states[21] + algebraic[6] = 0.0000185*constants[77]*(algebraic[8]-0.0)/(computed_constants[0]*(1.0-exp(-1.0*(algebraic[8]-0.0)/computed_constants[0])))*(algebraic[1]-constants[2]*exp(-1.0*(algebraic[8]-0.0)/computed_constants[0]))*states[23]*states[22]*states[21] + algebraic[67] = 0.000365*constants[77]*(algebraic[8]-0.0)/(computed_constants[0]*(1.0-exp(-1.0*(algebraic[8]-0.0)/computed_constants[0])))*(constants[4]-constants[3]*exp(-1.0*(algebraic[8]-0.0)/computed_constants[0]))*states[23]*states[22]*states[21] + algebraic[43] = (algebraic[37]+algebraic[67]+algebraic[6])*(1.0-computed_constants[19])*1.0*computed_constants[18] + algebraic[51] = computed_constants[0]*log((constants[2]+0.12*constants[3])/(algebraic[1]+0.12*constants[4])) + algebraic[52] = constants[73]*pow(states[18], 3.0)*states[17]*(algebraic[8]-algebraic[51]) + algebraic[53] = constants[74]*pow(states[18], 3.0)*(algebraic[8]-algebraic[51]) + algebraic[3] = algebraic[52]+algebraic[53] + algebraic[44] = constants[86]*(algebraic[8]-computed_constants[1])*states[27]*states[26] + algebraic[93] = computed_constants[0]*log((constants[3]+0.12*constants[2])/(constants[4]+0.12*algebraic[1])) + algebraic[45] = computed_constants[22]*(algebraic[8]-algebraic[93])*pow(states[31], 2.0) + algebraic[46] = constants[87]*(algebraic[8]-computed_constants[1])*(0.9*states[29]+0.1*states[30])*states[28] + algebraic[39] = algebraic[40]+algebraic[46]+algebraic[45]+algebraic[44]+algebraic[5]+algebraic[4]+algebraic[3]+algebraic[43]+algebraic[38]+algebraic[42]+algebraic[41] + algebraic[49] = 1.0/(0.36*(algebraic[8]+148.8-computed_constants[16]-computed_constants[17])/(exp(0.066*(algebraic[8]+148.8-computed_constants[16]-computed_constants[17]))-1.0)+0.1*(algebraic[8]+87.3-computed_constants[16]-computed_constants[17])/(1.0-exp(-0.2*(algebraic[8]+87.3-computed_constants[16]-computed_constants[17]))))-0.054 + algebraic[50] = 0.01329+0.99921/(1.0+exp((algebraic[8]+97.134-computed_constants[16]-computed_constants[17]-constants[72])/8.1752)) if lt_func(algebraic[8], -(80.0-computed_constants[16]-computed_constants[17]-constants[72])) else 0.0002501*exp(-(algebraic[8]-computed_constants[16]-computed_constants[17]-constants[72])/12.861) + algebraic[54] = 1.0/(1.0+exp(-(algebraic[8]+42.0504)/8.3106)) + algebraic[55] = algebraic[8]+41.0 + algebraic[56] = 2000.0 if lt_func(fabs(algebraic[55]), constants[75]) else 200.0*algebraic[55]/(1.0-exp(-0.1*algebraic[55])) + algebraic[57] = 8000.0*exp(-0.056*(algebraic[8]+66.0)) + algebraic[58] = 1.0/(algebraic[56]+algebraic[57]) + algebraic[59] = 1.0/(1.0+exp((algebraic[8]+69.804)/4.4565)) + algebraic[60] = 20.0*exp(-0.125*(algebraic[8]+75.0)) + algebraic[61] = 2000.0/(320.0*exp(-0.1*(algebraic[8]+75.0))+1.0) + algebraic[62] = 1.0/(algebraic[60]+algebraic[61]) + algebraic[63] = 1.0/(1.0+exp((algebraic[8]+6.0)/-8.6)) + algebraic[64] = 0.009/(1.0+exp((algebraic[8]+5.0)/12.0))+0.0005 + algebraic[65] = 1.0/(1.0+exp((algebraic[8]+7.5)/10.0)) + algebraic[66] = 0.59/(1.0+exp((algebraic[8]+60.0)/10.0))+3.05 + algebraic[68] = 1.0/(1.0+exp(-(algebraic[8]-constants[78]-computed_constants[20])/(constants[79]*(1.0+computed_constants[21]/100.0)))) + algebraic[72] = -41.80001 if eq_func(algebraic[8], -41.8) else 0.0 if eq_func(algebraic[8], 0.0) else -6.80001 if eq_func(algebraic[8], -6.8) else algebraic[8] + algebraic[70] = -0.02839*(algebraic[72]+41.8)/(exp(-(algebraic[72]+41.8)/2.5)-1.0)-0.0849*(algebraic[72]+6.8)/(exp(-(algebraic[72]+6.8)/4.8)-1.0) + algebraic[73] = -1.80001 if eq_func(algebraic[8], -1.8) else algebraic[8] + algebraic[71] = 0.01143*(algebraic[73]+1.8)/(exp((algebraic[73]+1.8)/2.5)-1.0) + algebraic[69] = 0.001/(algebraic[70]+algebraic[71]) + algebraic[74] = 1.0/(1.0+exp((algebraic[8]+37.4+constants[80])/(5.3+constants[81]))) + algebraic[75] = 0.001*(44.3+230.0*exp(-pow((algebraic[8]+36.0)/10.0, 2.0))) + algebraic[76] = constants[82]/(constants[82]+states[0]) + algebraic[77] = 0.001*algebraic[76]/constants[83] + algebraic[78] = 1.0/(1.0+exp(-(algebraic[8]+38.3)/5.5)) + algebraic[79] = 0.001/(1.068*exp((algebraic[8]+38.3)/30.0)+1.068*exp(-(algebraic[8]+38.3)/30.0)) + algebraic[80] = 1.0/(1.0+exp((algebraic[8]+58.7)/3.8)) + algebraic[81] = 1.0/(16.67*exp(-(algebraic[8]+75.0)/83.3)+16.67*exp((algebraic[8]+75.0)/15.38))+constants[85] + algebraic[82] = 1.0/(1.0+exp((algebraic[8]+49.0)/13.0)) + algebraic[83] = 0.001*0.6*(65.17/(0.57*exp(-0.08*(algebraic[8]+44.0))+0.065*exp(0.1*(algebraic[8]+45.93)))+10.1) + algebraic[84] = 1.0/(1.0+exp(-(algebraic[8]-19.3)/15.0)) + algebraic[85] = 0.001*0.66*1.4*(15.59/(1.037*exp(0.09*(algebraic[8]+30.61))+0.369*exp(-0.12*(algebraic[8]+23.84)))+2.98) + algebraic[86] = 1.0/(1.0+exp(-(algebraic[8]+23.2)/6.6))/(0.84655354/(37.2*exp(algebraic[8]/11.9)+0.96*exp(-algebraic[8]/18.5))) + algebraic[87] = 4.0*((37.2*exp(algebraic[8]/15.9)+0.96*exp(-algebraic[8]/22.5))/0.84655354-1.0/(1.0+exp(-(algebraic[8]+23.2)/10.6))/(0.84655354/(37.2*exp(algebraic[8]/15.9)+0.96*exp(-algebraic[8]/22.5)))) + algebraic[88] = 1.0/(1.0+exp(-(algebraic[8]+10.0144)/7.6607)) + algebraic[89] = 0.84655354/(4.2*exp(algebraic[8]/17.0)+0.15*exp(-algebraic[8]/21.6)) + algebraic[90] = 1.0/(30.0*exp(algebraic[8]/10.0)+exp(-algebraic[8]/12.0)) + algebraic[91] = 1.0/(100.0*exp(-algebraic[8]/54.645)+656.0*exp(algebraic[8]/106.157)) + algebraic[92] = 1.0/(1.0+exp((algebraic[8]+28.6)/17.1)) + algebraic[94] = sqrt(1.0/(1.0+exp(-(algebraic[8]+0.6383-computed_constants[23])/10.7071))) + algebraic[96] = 28.0/(1.0+exp(-(algebraic[8]-40.0-computed_constants[23])/3.0)) + algebraic[97] = 1.0*exp(-(algebraic[8]-computed_constants[23]-5.0)/25.0) + algebraic[95] = 1.0/(algebraic[96]+algebraic[97]) + algebraic[98] = 10.0*exp(0.0133*(algebraic[8]+40.0)) + algebraic[99] = computed_constants[24]/(computed_constants[24]+algebraic[98]) + algebraic[100] = 1.0/(computed_constants[24]+algebraic[98]) diff --git a/tests/resources/generator/garny_kohl_hunter_boyett_noble_rabbit_san_model_2003/model.c b/tests/resources/generator/garny_kohl_hunter_boyett_noble_rabbit_san_model_2003/model.c index 2290241662..05de7d9e69 100644 --- a/tests/resources/generator/garny_kohl_hunter_boyett_noble_rabbit_san_model_2003/model.c +++ b/tests/resources/generator/garny_kohl_hunter_boyett_noble_rabbit_san_model_2003/model.c @@ -250,116 +250,116 @@ void deleteArray(double *array) void initialiseVariables(double *states, double *rates, double *constants) { - constants[1] = 0.0; - constants[2] = 1.0; - constants[3] = 1.0309347; - constants[5] = 2.0e-5; - constants[6] = 6.5e-5; - constants[22] = 8314.0; - constants[23] = 310.0; - constants[24] = 96845.0; - constants[26] = 5.8e-5; - constants[27] = 0.000189; - constants[28] = 5.8e-5; - constants[29] = 0.000189; - constants[30] = 5.81818e-5; - constants[31] = 0.0001888; - constants[34] = 2.52e-5; - constants[35] = 8.19e-5; - constants[36] = 2.52e-5; - constants[37] = 8.19e-5; - constants[38] = 2.523636e-5; - constants[39] = 8.1892e-5; - constants[42] = 1.32e-5; - constants[43] = 4.3e-5; - constants[44] = 1.323e-5; - constants[45] = 4.29e-5; - constants[46] = 1.3236e-5; - constants[47] = 4.2952e-5; - constants[50] = 2.7e-6; - constants[51] = 8.8e-6; - constants[52] = 2.8e-6; - constants[53] = 8.8e-6; - constants[54] = 2.7229e-6; - constants[55] = 8.83584e-6; - constants[56] = 8.0; - constants[57] = 0.5; - constants[58] = 2.0; - constants[59] = 140.0; - constants[60] = 0.0001; - constants[61] = 0.0001; - constants[63] = 0.0478; - constants[64] = 0.16; - constants[65] = 0.0478; - constants[66] = 0.16; - constants[67] = 0.04782545; - constants[68] = 0.1551936; - constants[69] = 5.4; - constants[70] = 0.621; - constants[71] = 5.64; - constants[73] = 0.0; - constants[74] = 0.0; - constants[75] = 0.0042; - constants[76] = 0.03339; - constants[77] = 0.0; - constants[78] = 0.0; - constants[79] = 140.0; - constants[82] = 0.0; - constants[83] = 1.2e-6; - constants[84] = 0.0; - constants[85] = 3.7e-7; - constants[86] = 0.0; - constants[87] = 1.204e-6; - constants[97] = 0.0058; - constants[98] = 0.0659; - constants[99] = 0.0082; - constants[100] = 0.0659; - constants[101] = 0.0057938; - constants[102] = 0.06588648; - constants[103] = 46.4; - constants[113] = 0.0043; - constants[114] = 0.0139; - constants[115] = 0.0021; - constants[116] = 0.00694; - constants[117] = 0.00427806; - constants[118] = 0.0138823; - constants[119] = 45.0; - constants[129] = 0.00491; - constants[130] = 0.03649; - constants[131] = 0.004905; - constants[132] = 0.0365; - constants[133] = 0.004905; - constants[134] = 0.036495; - constants[136] = 6.65e-5; - constants[137] = 0.0114; - constants[138] = 0.000266; - constants[139] = 0.0114; - constants[140] = 6.645504e-5; - constants[141] = 0.01138376; - constants[147] = 0.000797; - constants[148] = 0.016; - constants[149] = 0.000738; - constants[150] = 0.0208; - constants[151] = 0.00079704; - constants[152] = 0.016; - constants[161] = 0.000518; - constants[162] = 0.0104; - constants[163] = 0.000345; - constants[164] = 0.0104; - constants[165] = 0.0003445; - constants[166] = 0.0104; - constants[170] = 0.000548; - constants[171] = 0.0069; - constants[172] = 0.000437; - constants[173] = 0.0055; - constants[174] = 0.0005465; - constants[175] = 0.006875; - constants[177] = 0.000548; - constants[178] = 0.0069; - constants[179] = 0.000437; - constants[180] = 0.0055; - constants[181] = 0.0005465; - constants[182] = 0.006875; + constants[0] = 0.0; + constants[1] = 1.0; + constants[2] = 1.0309347; + constants[3] = 2.0e-5; + constants[4] = 6.5e-5; + constants[5] = 8314.0; + constants[6] = 310.0; + constants[7] = 96845.0; + constants[8] = 5.8e-5; + constants[9] = 0.000189; + constants[10] = 5.8e-5; + constants[11] = 0.000189; + constants[12] = 5.81818e-5; + constants[13] = 0.0001888; + constants[14] = 2.52e-5; + constants[15] = 8.19e-5; + constants[16] = 2.52e-5; + constants[17] = 8.19e-5; + constants[18] = 2.523636e-5; + constants[19] = 8.1892e-5; + constants[20] = 1.32e-5; + constants[21] = 4.3e-5; + constants[22] = 1.323e-5; + constants[23] = 4.29e-5; + constants[24] = 1.3236e-5; + constants[25] = 4.2952e-5; + constants[26] = 2.7e-6; + constants[27] = 8.8e-6; + constants[28] = 2.8e-6; + constants[29] = 8.8e-6; + constants[30] = 2.7229e-6; + constants[31] = 8.83584e-6; + constants[32] = 8.0; + constants[33] = 0.5; + constants[34] = 2.0; + constants[35] = 140.0; + constants[36] = 0.0001; + constants[37] = 0.0001; + constants[38] = 0.0478; + constants[39] = 0.16; + constants[40] = 0.0478; + constants[41] = 0.16; + constants[42] = 0.04782545; + constants[43] = 0.1551936; + constants[44] = 5.4; + constants[45] = 0.621; + constants[46] = 5.64; + constants[47] = 0.0; + constants[48] = 0.0; + constants[49] = 0.0042; + constants[50] = 0.03339; + constants[51] = 0.0; + constants[52] = 0.0; + constants[53] = 140.0; + constants[54] = 0.0; + constants[55] = 1.2e-6; + constants[56] = 0.0; + constants[57] = 3.7e-7; + constants[58] = 0.0; + constants[59] = 1.204e-6; + constants[60] = 0.0058; + constants[61] = 0.0659; + constants[62] = 0.0082; + constants[63] = 0.0659; + constants[64] = 0.0057938; + constants[65] = 0.06588648; + constants[66] = 46.4; + constants[67] = 0.0043; + constants[68] = 0.0139; + constants[69] = 0.0021; + constants[70] = 0.00694; + constants[71] = 0.00427806; + constants[72] = 0.0138823; + constants[73] = 45.0; + constants[74] = 0.00491; + constants[75] = 0.03649; + constants[76] = 0.004905; + constants[77] = 0.0365; + constants[78] = 0.004905; + constants[79] = 0.036495; + constants[80] = 6.65e-5; + constants[81] = 0.0114; + constants[82] = 0.000266; + constants[83] = 0.0114; + constants[84] = 6.645504e-5; + constants[85] = 0.01138376; + constants[86] = 0.000797; + constants[87] = 0.016; + constants[88] = 0.000738; + constants[89] = 0.0208; + constants[90] = 0.00079704; + constants[91] = 0.016; + constants[92] = 0.000518; + constants[93] = 0.0104; + constants[94] = 0.000345; + constants[95] = 0.0104; + constants[96] = 0.0003445; + constants[97] = 0.0104; + constants[98] = 0.000548; + constants[99] = 0.0069; + constants[100] = 0.000437; + constants[101] = 0.0055; + constants[102] = 0.0005465; + constants[103] = 0.006875; + constants[104] = 0.000548; + constants[105] = 0.0069; + constants[106] = 0.000437; + constants[107] = 0.0055; + constants[108] = 0.0005465; + constants[109] = 0.006875; states[0] = -39.013558536; states[1] = 0.092361701692; states[2] = 0.015905380261; @@ -379,154 +379,154 @@ void initialiseVariables(double *states, double *rates, double *constants) void computeComputedConstants(double *constants, double *computedConstants) { - computedConstants[0] = (constants[2] == 0.0)?1.07*(3.0*constants[1]-0.1)/(3.0*(1.0+0.7745*exp(-(3.0*constants[1]-2.05)/0.295))):(constants[2] == 1.0)?constants[3]*constants[1]/(1.0+0.7745*exp(-(3.0*constants[1]-2.05)/0.295)):1.07*29.0*constants[1]/(30.0*(1.0+0.7745*exp(-(29.0*constants[1]-24.5)/1.95))); - computedConstants[4] = constants[5]+computedConstants[0]*(constants[6]-constants[5]); - computedConstants[25] = (constants[2] == 0.0)?constants[26]+computedConstants[0]*(constants[27]-constants[26]):(constants[2] == 1.0)?constants[30]+computedConstants[0]*(constants[31]-constants[30]):constants[28]+computedConstants[0]*(constants[29]-constants[28]); - computedConstants[33] = (constants[2] == 0.0)?constants[34]+computedConstants[0]*(constants[35]-constants[34]):(constants[2] == 1.0)?constants[38]+computedConstants[0]*(constants[39]-constants[38]):constants[36]+computedConstants[0]*(constants[37]-constants[36]); - computedConstants[41] = (constants[2] == 0.0)?constants[42]+computedConstants[0]*(constants[43]-constants[42]):(constants[2] == 1.0)?constants[46]+computedConstants[0]*(constants[47]-constants[46]):constants[44]+computedConstants[0]*(constants[45]-constants[44]); - computedConstants[49] = (constants[2] == 0.0)?constants[50]+computedConstants[0]*(constants[51]-constants[50]):(constants[2] == 1.0)?constants[54]+computedConstants[0]*(constants[55]-constants[54]):constants[52]+computedConstants[0]*(constants[53]-constants[52]); - computedConstants[62] = (constants[2] == 0.0)?constants[63]+computedConstants[0]*(constants[64]-constants[63]):(constants[2] == 1.0)?constants[67]+computedConstants[0]*(constants[68]-constants[67]):constants[65]+computedConstants[0]*(constants[66]-constants[65]); - computedConstants[72] = (constants[2] == 0.0)?constants[73]+computedConstants[0]*(constants[74]-constants[73]):(constants[2] == 1.0)?constants[77]+computedConstants[0]*(constants[78]-constants[77]):constants[75]+computedConstants[0]*(constants[76]-constants[75]); - computedConstants[8] = computedConstants[72]*constants[60]/(constants[60]+0.0004); - computedConstants[32] = constants[22]*constants[23]/constants[24]*log(constants[59]/constants[56]); - computedConstants[40] = constants[22]*constants[23]/constants[24]*log(constants[69]/constants[79]); - computedConstants[48] = constants[22]*constants[23]/(2.0*constants[24])*log(constants[58]/constants[60]); - computedConstants[80] = (constants[2] == 0.0)?constants[22]*constants[23]/constants[24]*log((constants[69]+0.12*constants[59])/(constants[79]+0.12*constants[56])):constants[22]*constants[23]/constants[24]*log((constants[69]+0.03*constants[59])/(constants[79]+0.03*constants[56])); - computedConstants[81] = (constants[2] == 0.0)?constants[82]+computedConstants[0]*(constants[83]-constants[82]):(constants[2] == 1.0)?constants[86]+computedConstants[0]*(constants[87]-constants[86]):constants[84]+computedConstants[0]*(constants[85]-constants[84]); - computedConstants[96] = (constants[2] == 0.0)?constants[97]+computedConstants[0]*(constants[98]-constants[97]):(constants[2] == 1.0)?constants[101]+computedConstants[0]*(constants[102]-constants[101]):constants[99]+computedConstants[0]*(constants[100]-constants[99]); - computedConstants[112] = (constants[2] == 0.0)?constants[113]+computedConstants[0]*(constants[114]-constants[113]):(constants[2] == 1.0)?constants[117]+computedConstants[0]*(constants[118]-constants[117]):constants[115]+computedConstants[0]*(constants[116]-constants[115]); - computedConstants[128] = (constants[2] == 0.0)?constants[129]+computedConstants[0]*(constants[130]-constants[129]):(constants[2] == 1.0)?constants[133]+computedConstants[0]*(constants[134]-constants[133]):constants[131]+computedConstants[0]*(constants[132]-constants[131]); - computedConstants[135] = (constants[2] == 0.0)?constants[136]+computedConstants[0]*(constants[137]-constants[136]):(constants[2] == 1.0)?constants[140]+computedConstants[0]*(constants[141]-constants[140]):constants[138]+computedConstants[0]*(constants[139]-constants[138]); - computedConstants[146] = (constants[2] == 0.0)?constants[147]+computedConstants[0]*(constants[148]-constants[147]):(constants[2] == 1.0)?constants[151]+computedConstants[0]*(constants[152]-constants[151]):constants[149]+computedConstants[0]*(constants[150]-constants[149]); - computedConstants[158] = (constants[2] == 0.0)?0.002:(constants[2] == 1.0)?0.002:0.006; - computedConstants[160] = (constants[2] == 0.0)?constants[161]+computedConstants[0]*(constants[162]-constants[161]):(constants[2] == 1.0)?constants[165]+computedConstants[0]*(constants[166]-constants[165]):constants[163]+computedConstants[0]*(constants[164]-constants[163]); - computedConstants[169] = (constants[2] == 0.0)?constants[170]+computedConstants[0]*(constants[171]-constants[170]):(constants[2] == 1.0)?constants[174]+computedConstants[0]*(constants[175]-constants[174]):constants[172]+computedConstants[0]*(constants[173]-constants[172]); - computedConstants[176] = (constants[2] == 0.0)?constants[177]+computedConstants[0]*(constants[178]-constants[177]):(constants[2] == 1.0)?constants[181]+computedConstants[0]*(constants[182]-constants[181]):constants[179]+computedConstants[0]*(constants[180]-constants[179]); + computedConstants[0] = (constants[1] == 0.0)?1.07*(3.0*constants[0]-0.1)/(3.0*(1.0+0.7745*exp(-(3.0*constants[0]-2.05)/0.295))):(constants[1] == 1.0)?constants[2]*constants[0]/(1.0+0.7745*exp(-(3.0*constants[0]-2.05)/0.295)):1.07*29.0*constants[0]/(30.0*(1.0+0.7745*exp(-(29.0*constants[0]-24.5)/1.95))); + computedConstants[1] = constants[3]+computedConstants[0]*(constants[4]-constants[3]); + computedConstants[3] = (constants[1] == 0.0)?constants[8]+computedConstants[0]*(constants[9]-constants[8]):(constants[1] == 1.0)?constants[12]+computedConstants[0]*(constants[13]-constants[12]):constants[10]+computedConstants[0]*(constants[11]-constants[10]); + computedConstants[5] = (constants[1] == 0.0)?constants[14]+computedConstants[0]*(constants[15]-constants[14]):(constants[1] == 1.0)?constants[18]+computedConstants[0]*(constants[19]-constants[18]):constants[16]+computedConstants[0]*(constants[17]-constants[16]); + computedConstants[7] = (constants[1] == 0.0)?constants[20]+computedConstants[0]*(constants[21]-constants[20]):(constants[1] == 1.0)?constants[24]+computedConstants[0]*(constants[25]-constants[24]):constants[22]+computedConstants[0]*(constants[23]-constants[22]); + computedConstants[9] = (constants[1] == 0.0)?constants[26]+computedConstants[0]*(constants[27]-constants[26]):(constants[1] == 1.0)?constants[30]+computedConstants[0]*(constants[31]-constants[30]):constants[28]+computedConstants[0]*(constants[29]-constants[28]); + computedConstants[10] = (constants[1] == 0.0)?constants[38]+computedConstants[0]*(constants[39]-constants[38]):(constants[1] == 1.0)?constants[42]+computedConstants[0]*(constants[43]-constants[42]):constants[40]+computedConstants[0]*(constants[41]-constants[40]); + computedConstants[11] = (constants[1] == 0.0)?constants[47]+computedConstants[0]*(constants[48]-constants[47]):(constants[1] == 1.0)?constants[51]+computedConstants[0]*(constants[52]-constants[51]):constants[49]+computedConstants[0]*(constants[50]-constants[49]); + computedConstants[2] = computedConstants[11]*constants[36]/(constants[36]+0.0004); + computedConstants[4] = constants[5]*constants[6]/constants[7]*log(constants[35]/constants[32]); + computedConstants[6] = constants[5]*constants[6]/constants[7]*log(constants[44]/constants[53]); + computedConstants[8] = constants[5]*constants[6]/(2.0*constants[7])*log(constants[34]/constants[36]); + computedConstants[12] = (constants[1] == 0.0)?constants[5]*constants[6]/constants[7]*log((constants[44]+0.12*constants[35])/(constants[53]+0.12*constants[32])):constants[5]*constants[6]/constants[7]*log((constants[44]+0.03*constants[35])/(constants[53]+0.03*constants[32])); + computedConstants[13] = (constants[1] == 0.0)?constants[54]+computedConstants[0]*(constants[55]-constants[54]):(constants[1] == 1.0)?constants[58]+computedConstants[0]*(constants[59]-constants[58]):constants[56]+computedConstants[0]*(constants[57]-constants[56]); + computedConstants[14] = (constants[1] == 0.0)?constants[60]+computedConstants[0]*(constants[61]-constants[60]):(constants[1] == 1.0)?constants[64]+computedConstants[0]*(constants[65]-constants[64]):constants[62]+computedConstants[0]*(constants[63]-constants[62]); + computedConstants[15] = (constants[1] == 0.0)?constants[67]+computedConstants[0]*(constants[68]-constants[67]):(constants[1] == 1.0)?constants[71]+computedConstants[0]*(constants[72]-constants[71]):constants[69]+computedConstants[0]*(constants[70]-constants[69]); + computedConstants[16] = (constants[1] == 0.0)?constants[74]+computedConstants[0]*(constants[75]-constants[74]):(constants[1] == 1.0)?constants[78]+computedConstants[0]*(constants[79]-constants[78]):constants[76]+computedConstants[0]*(constants[77]-constants[76]); + computedConstants[17] = (constants[1] == 0.0)?constants[80]+computedConstants[0]*(constants[81]-constants[80]):(constants[1] == 1.0)?constants[84]+computedConstants[0]*(constants[85]-constants[84]):constants[82]+computedConstants[0]*(constants[83]-constants[82]); + computedConstants[18] = (constants[1] == 0.0)?constants[86]+computedConstants[0]*(constants[87]-constants[86]):(constants[1] == 1.0)?constants[90]+computedConstants[0]*(constants[91]-constants[90]):constants[88]+computedConstants[0]*(constants[89]-constants[88]); + computedConstants[19] = (constants[1] == 0.0)?0.002:(constants[1] == 1.0)?0.002:0.006; + computedConstants[20] = (constants[1] == 0.0)?constants[92]+computedConstants[0]*(constants[93]-constants[92]):(constants[1] == 1.0)?constants[96]+computedConstants[0]*(constants[97]-constants[96]):constants[94]+computedConstants[0]*(constants[95]-constants[94]); + computedConstants[21] = (constants[1] == 0.0)?constants[98]+computedConstants[0]*(constants[99]-constants[98]):(constants[1] == 1.0)?constants[102]+computedConstants[0]*(constants[103]-constants[102]):constants[100]+computedConstants[0]*(constants[101]-constants[100]); + computedConstants[22] = (constants[1] == 0.0)?constants[104]+computedConstants[0]*(constants[105]-constants[104]):(constants[1] == 1.0)?constants[108]+computedConstants[0]*(constants[109]-constants[108]):constants[106]+computedConstants[0]*(constants[107]-constants[106]); } void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic) { - algebraic[9] = computedConstants[62]*pow(constants[56]/(constants[71]+constants[56]), 3.0)*pow(constants[69]/(constants[70]+constants[69]), 2.0)*1.6/(1.5+exp(-(states[0]+60.0)/40.0)); - algebraic[10] = (constants[2] == 0.0)?computedConstants[49]*(pow(constants[56], 3.0)*constants[58]*exp(0.03743*states[0]*constants[57])-pow(constants[59], 3.0)*constants[60]*exp(0.0374*states[0]*(constants[57]-1.0)))/(1.0+constants[61]*(constants[60]*pow(constants[59], 3.0)+constants[58]*pow(constants[56], 3.0))):computedConstants[49]*(pow(constants[56], 3.0)*constants[58]*exp(0.03743*states[0]*constants[57])-pow(constants[59], 3.0)*constants[60]*exp(0.03743*states[0]*(constants[57]-1.0)))/(1.0+constants[61]*(constants[60]*pow(constants[59], 3.0)+constants[58]*pow(constants[56], 3.0))); - algebraic[14] = (constants[2] != 2.0)?computedConstants[176]*states[14]*(states[0]-computedConstants[40]):computedConstants[176]*states[14]*(states[0]+102.0); - algebraic[15] = (constants[2] != 2.0)?computedConstants[169]*states[14]*(states[0]-computedConstants[32]):computedConstants[169]*states[14]*(states[0]-77.6); - algebraic[16] = computedConstants[160]*pow(states[13], 2.0)*(states[0]-computedConstants[80]); - algebraic[18] = computedConstants[135]*states[8]*(states[0]-computedConstants[40]); - algebraic[19] = computedConstants[128]*states[9]*states[8]*(states[0]-computedConstants[40]); - algebraic[20] = computedConstants[112]*states[7]*states[6]*(states[0]-constants[119]); - algebraic[21] = computedConstants[96]*(states[4]*states[5]+0.006/(1.0+exp(-(states[0]+14.1)/6.0)))*(states[0]-constants[103]); - algebraic[91] = (constants[2] == 0.0)?0.0952*exp(-0.063*(states[0]+34.4))/(1.0+1.66*exp(-0.225*(states[0]+63.7)))+0.0869:0.09518*exp(-0.06306*(states[0]+34.4))/(1.0+1.662*exp(-0.2251*(states[0]+63.7)))+0.08693; - algebraic[88] = (1.0-algebraic[91])*states[2]+algebraic[91]*states[3]; - algebraic[7] = computedConstants[81]*pow(states[1], 3.0)*algebraic[88]*constants[59]*pow(constants[24], 2.0)/(constants[22]*constants[23])*(exp((states[0]-computedConstants[32])*constants[24]/(constants[22]*constants[23]))-1.0)/(exp(states[0]*constants[24]/(constants[22]*constants[23]))-1.0)*states[0]; - algebraic[11] = computedConstants[33]*(states[0]-computedConstants[40]); - algebraic[12] = computedConstants[41]*(states[0]-computedConstants[48]); - algebraic[13] = computedConstants[25]*(states[0]-computedConstants[32]); - algebraic[153] = 0.6*states[11]+0.4*states[12]; - algebraic[17] = computedConstants[146]*algebraic[153]*states[10]*(states[0]-computedConstants[40]); - rates[0] = -1.0/computedConstants[4]*(algebraic[7]+algebraic[21]+algebraic[20]+algebraic[19]+algebraic[18]+algebraic[17]+algebraic[16]+algebraic[15]+algebraic[14]+algebraic[13]+algebraic[12]+algebraic[11]+algebraic[10]+algebraic[9]+computedConstants[8]); - algebraic[89] = (constants[2] == 0.0)?pow(1.0/(1.0+exp(-states[0]/5.46)), 1.0/3.0):pow(1.0/(1.0+exp(-(states[0]+30.32)/5.46)), 1.0/3.0); - algebraic[90] = (constants[2] == 0.0)?0.0006247/(0.832*exp(-0.335*(states[0]+56.7))+0.627*exp(0.082*(states[0]+65.01)))+4.0e-5:0.0006247/(0.8322166*exp(-0.33566*(states[0]+56.7062))+0.6274*exp(0.0823*(states[0]+65.0131)))+4.569e-5; - rates[1] = (algebraic[89]-states[1])/algebraic[90]; - algebraic[92] = 1.0/(1.0+exp((states[0]+66.1)/6.4)); - algebraic[93] = 3.717e-6*exp(-0.2815*(states[0]+17.11))/(1.0+0.003732*exp(-0.3426*(states[0]+37.76)))+0.0005977; - rates[2] = (algebraic[92]-states[2])/algebraic[93]; - algebraic[94] = algebraic[92]; - algebraic[95] = 3.186e-8*exp(-0.6219*(states[0]+18.8))/(1.0+7.189e-5*exp(-0.6683*(states[0]+34.07)))+0.003556; - rates[3] = (algebraic[94]-states[3])/algebraic[95]; - algebraic[104] = (constants[2] == 0.0)?1.0/(1.0+exp(-(states[0]+23.1)/6.0)):(constants[2] == 1.0)?1.0/(1.0+exp(-(states[0]+22.3+0.8*computedConstants[0])/6.0)):1.0/(1.0+exp(-(states[0]+22.2)/6.0)); - algebraic[106] = (constants[2] == 0.0)?-28.38*(states[0]+35.0)/(exp(-(states[0]+35.0)/2.5)-1.0)-84.9*states[0]/(exp(-0.208*states[0])-1.0):(constants[2] == 1.0)?-28.39*(states[0]+35.0)/(exp(-(states[0]+35.0)/2.5)-1.0)-84.9*states[0]/(exp(-0.208*states[0])-1.0):-28.4*(states[0]+35.0)/(exp(-(states[0]+35.0)/2.5)-1.0)-84.9*states[0]/(exp(-0.208*states[0])-1.0); - algebraic[107] = (constants[2] == 1.0)?11.43*(states[0]-5.0)/(exp(0.4*(states[0]-5.0))-1.0):11.42*(states[0]-5.0)/(exp(0.4*(states[0]-5.0))-1.0); - algebraic[105] = 2.0/(algebraic[106]+algebraic[107]); - rates[5] = (algebraic[104]-states[5])/algebraic[105]; - algebraic[108] = 1.0/(1.0+exp((states[0]+45.0)/5.0)); - algebraic[110] = (constants[2] == 1.0)?3.75*(states[0]+28.0)/(exp((states[0]+28.0)/4.0)-1.0):3.12*(states[0]+28.0)/(exp((states[0]+28.0)/4.0)-1.0); - algebraic[111] = (constants[2] == 1.0)?30.0/(1.0+exp(-(states[0]+28.0)/4.0)):25.0/(1.0+exp(-(states[0]+28.0)/4.0)); - algebraic[109] = (constants[2] == 1.0)?(1.2-0.2*computedConstants[0])/(algebraic[110]+algebraic[111]):1.0/(algebraic[110]+algebraic[111]); - rates[4] = (algebraic[108]-states[4])/algebraic[109]; - algebraic[120] = 1.0/(1.0+exp(-(states[0]+37.0)/6.8)); - algebraic[122] = 1068.0*exp((states[0]+26.3)/30.0); - algebraic[123] = 1068.0*exp(-(states[0]+26.3)/30.0); - algebraic[121] = 1.0/(algebraic[122]+algebraic[123]); - rates[7] = (algebraic[120]-states[7])/algebraic[121]; - algebraic[124] = 1.0/(1.0+exp((states[0]+71.0)/9.0)); - algebraic[126] = (constants[2] == 1.0)?15.3*exp(-(states[0]+71.0+0.7*computedConstants[0])/83.3):15.3*exp(-(states[0]+71.7)/83.3); - algebraic[127] = (constants[2] == 1.0)?15.0*exp((states[0]+71.0)/15.38):15.0*exp((states[0]+71.7)/15.38); - algebraic[125] = 1.0/(algebraic[126]+algebraic[127]); - rates[6] = (algebraic[124]-states[6])/algebraic[125]; - algebraic[142] = 1.0/(1.0+exp((states[0]+59.37)/13.1)); - algebraic[143] = (constants[2] == 0.0)?0.0101+0.06517/(0.57*exp(-0.08*(states[0]+49.0)))+2.4e-5*exp(0.1*(states[0]+50.93)):(constants[2] == 1.0)?0.001/3.0*(30.31+195.5/(0.5686*exp(-0.08161*(states[0]+39.0+10.0*computedConstants[0]))+0.7174*exp((0.2719-0.1719*computedConstants[0])*1.0*(states[0]+40.93+10.0*computedConstants[0])))):0.0101+0.06517/(0.5686*exp(-0.08161*(states[0]+39.0))+0.7174*exp(0.2719*(states[0]+40.93))); - rates[9] = (algebraic[142]-states[9])/algebraic[143]; - algebraic[144] = 1.0/(1.0+exp(-(states[0]-10.93)/19.7)); - algebraic[145] = (constants[2] == 0.0)?0.001*(2.98+15.59/(1.037*exp(0.09*(states[0]+30.61))+0.369*exp(-0.12*(states[0]+23.84)))):(constants[2] == 1.0)?0.0025*(1.191+7.838/(1.037*exp(0.09012*(states[0]+30.61))+0.369*exp(-0.119*(states[0]+23.84)))):0.001*(2.98+19.59/(1.037*exp(0.09012*(states[0]+30.61))+0.369*exp(-0.119*(states[0]+23.84)))); - rates[8] = (algebraic[144]-states[8])/algebraic[145]; - algebraic[154] = (constants[2] != 2.0)?1.0/(1.0+exp(-(states[0]+14.2)/10.6)):1.0/(1.0+exp(-(states[0]+13.2)/10.6)); - algebraic[155] = (constants[2] != 2.0)?1.0/(37.2*exp((states[0]-9.0)/15.9)+0.96*exp(-(states[0]-9.0)/22.5)):1.0/(37.2*exp((states[0]-10.0)/15.9)+0.96*exp(-(states[0]-10.0)/22.5)); - rates[11] = (algebraic[154]-states[11])/algebraic[155]; - algebraic[156] = algebraic[154]; - algebraic[157] = (constants[2] != 2.0)?1.0/(4.2*exp((states[0]-9.0)/17.0)+0.15*exp(-(states[0]-9.0)/21.6)):1.0/(4.2*exp((states[0]-10.0)/17.0)+0.15*exp(-(states[0]-10.0)/21.6)); - rates[12] = (algebraic[156]-states[12])/algebraic[157]; - algebraic[159] = 1.0/(1.0+exp((states[0]+18.6)/10.1)); - rates[10] = (algebraic[159]-states[10])/computedConstants[158]; - algebraic[167] = 14.0/(1.0+exp(-(states[0]-40.0)/9.0)); - algebraic[168] = 1.0*exp(-states[0]/45.0); - rates[13] = algebraic[167]*(1.0-states[13])-algebraic[168]*states[13]; - algebraic[183] = (constants[2] == 0.0)?1.0*exp(-(states[0]+78.91)/26.62):1.0*exp(-(states[0]+78.91)/26.63); - algebraic[184] = 1.0*exp((states[0]+75.13)/21.25); - rates[14] = algebraic[183]*(1.0-states[14])-algebraic[184]*states[14]; + algebraic[1] = computedConstants[10]*pow(constants[32]/(constants[46]+constants[32]), 3.0)*pow(constants[44]/(constants[45]+constants[44]), 2.0)*1.6/(1.5+exp(-(states[0]+60.0)/40.0)); + algebraic[2] = (constants[1] == 0.0)?computedConstants[9]*(pow(constants[32], 3.0)*constants[34]*exp(0.03743*states[0]*constants[33])-pow(constants[35], 3.0)*constants[36]*exp(0.0374*states[0]*(constants[33]-1.0)))/(1.0+constants[37]*(constants[36]*pow(constants[35], 3.0)+constants[34]*pow(constants[32], 3.0))):computedConstants[9]*(pow(constants[32], 3.0)*constants[34]*exp(0.03743*states[0]*constants[33])-pow(constants[35], 3.0)*constants[36]*exp(0.03743*states[0]*(constants[33]-1.0)))/(1.0+constants[37]*(constants[36]*pow(constants[35], 3.0)+constants[34]*pow(constants[32], 3.0))); + algebraic[6] = (constants[1] != 2.0)?computedConstants[22]*states[14]*(states[0]-computedConstants[6]):computedConstants[22]*states[14]*(states[0]+102.0); + algebraic[7] = (constants[1] != 2.0)?computedConstants[21]*states[14]*(states[0]-computedConstants[4]):computedConstants[21]*states[14]*(states[0]-77.6); + algebraic[8] = computedConstants[20]*pow(states[13], 2.0)*(states[0]-computedConstants[12]); + algebraic[10] = computedConstants[17]*states[8]*(states[0]-computedConstants[6]); + algebraic[11] = computedConstants[16]*states[9]*states[8]*(states[0]-computedConstants[6]); + algebraic[12] = computedConstants[15]*states[7]*states[6]*(states[0]-constants[73]); + algebraic[13] = computedConstants[14]*(states[4]*states[5]+0.006/(1.0+exp(-(states[0]+14.1)/6.0)))*(states[0]-constants[66]); + algebraic[17] = (constants[1] == 0.0)?0.0952*exp(-0.063*(states[0]+34.4))/(1.0+1.66*exp(-0.225*(states[0]+63.7)))+0.0869:0.09518*exp(-0.06306*(states[0]+34.4))/(1.0+1.662*exp(-0.2251*(states[0]+63.7)))+0.08693; + algebraic[14] = (1.0-algebraic[17])*states[2]+algebraic[17]*states[3]; + algebraic[0] = computedConstants[13]*pow(states[1], 3.0)*algebraic[14]*constants[35]*pow(constants[7], 2.0)/(constants[5]*constants[6])*(exp((states[0]-computedConstants[4])*constants[7]/(constants[5]*constants[6]))-1.0)/(exp(states[0]*constants[7]/(constants[5]*constants[6]))-1.0)*states[0]; + algebraic[3] = computedConstants[5]*(states[0]-computedConstants[6]); + algebraic[4] = computedConstants[7]*(states[0]-computedConstants[8]); + algebraic[5] = computedConstants[3]*(states[0]-computedConstants[4]); + algebraic[42] = 0.6*states[11]+0.4*states[12]; + algebraic[9] = computedConstants[18]*algebraic[42]*states[10]*(states[0]-computedConstants[6]); + rates[0] = -1.0/computedConstants[1]*(algebraic[0]+algebraic[13]+algebraic[12]+algebraic[11]+algebraic[10]+algebraic[9]+algebraic[8]+algebraic[7]+algebraic[6]+algebraic[5]+algebraic[4]+algebraic[3]+algebraic[2]+algebraic[1]+computedConstants[2]); + algebraic[15] = (constants[1] == 0.0)?pow(1.0/(1.0+exp(-states[0]/5.46)), 1.0/3.0):pow(1.0/(1.0+exp(-(states[0]+30.32)/5.46)), 1.0/3.0); + algebraic[16] = (constants[1] == 0.0)?0.0006247/(0.832*exp(-0.335*(states[0]+56.7))+0.627*exp(0.082*(states[0]+65.01)))+4.0e-5:0.0006247/(0.8322166*exp(-0.33566*(states[0]+56.7062))+0.6274*exp(0.0823*(states[0]+65.0131)))+4.569e-5; + rates[1] = (algebraic[15]-states[1])/algebraic[16]; + algebraic[18] = 1.0/(1.0+exp((states[0]+66.1)/6.4)); + algebraic[19] = 3.717e-6*exp(-0.2815*(states[0]+17.11))/(1.0+0.003732*exp(-0.3426*(states[0]+37.76)))+0.0005977; + rates[2] = (algebraic[18]-states[2])/algebraic[19]; + algebraic[20] = algebraic[18]; + algebraic[21] = 3.186e-8*exp(-0.6219*(states[0]+18.8))/(1.0+7.189e-5*exp(-0.6683*(states[0]+34.07)))+0.003556; + rates[3] = (algebraic[20]-states[3])/algebraic[21]; + algebraic[22] = (constants[1] == 0.0)?1.0/(1.0+exp(-(states[0]+23.1)/6.0)):(constants[1] == 1.0)?1.0/(1.0+exp(-(states[0]+22.3+0.8*computedConstants[0])/6.0)):1.0/(1.0+exp(-(states[0]+22.2)/6.0)); + algebraic[24] = (constants[1] == 0.0)?-28.38*(states[0]+35.0)/(exp(-(states[0]+35.0)/2.5)-1.0)-84.9*states[0]/(exp(-0.208*states[0])-1.0):(constants[1] == 1.0)?-28.39*(states[0]+35.0)/(exp(-(states[0]+35.0)/2.5)-1.0)-84.9*states[0]/(exp(-0.208*states[0])-1.0):-28.4*(states[0]+35.0)/(exp(-(states[0]+35.0)/2.5)-1.0)-84.9*states[0]/(exp(-0.208*states[0])-1.0); + algebraic[25] = (constants[1] == 1.0)?11.43*(states[0]-5.0)/(exp(0.4*(states[0]-5.0))-1.0):11.42*(states[0]-5.0)/(exp(0.4*(states[0]-5.0))-1.0); + algebraic[23] = 2.0/(algebraic[24]+algebraic[25]); + rates[5] = (algebraic[22]-states[5])/algebraic[23]; + algebraic[26] = 1.0/(1.0+exp((states[0]+45.0)/5.0)); + algebraic[28] = (constants[1] == 1.0)?3.75*(states[0]+28.0)/(exp((states[0]+28.0)/4.0)-1.0):3.12*(states[0]+28.0)/(exp((states[0]+28.0)/4.0)-1.0); + algebraic[29] = (constants[1] == 1.0)?30.0/(1.0+exp(-(states[0]+28.0)/4.0)):25.0/(1.0+exp(-(states[0]+28.0)/4.0)); + algebraic[27] = (constants[1] == 1.0)?(1.2-0.2*computedConstants[0])/(algebraic[28]+algebraic[29]):1.0/(algebraic[28]+algebraic[29]); + rates[4] = (algebraic[26]-states[4])/algebraic[27]; + algebraic[30] = 1.0/(1.0+exp(-(states[0]+37.0)/6.8)); + algebraic[32] = 1068.0*exp((states[0]+26.3)/30.0); + algebraic[33] = 1068.0*exp(-(states[0]+26.3)/30.0); + algebraic[31] = 1.0/(algebraic[32]+algebraic[33]); + rates[7] = (algebraic[30]-states[7])/algebraic[31]; + algebraic[34] = 1.0/(1.0+exp((states[0]+71.0)/9.0)); + algebraic[36] = (constants[1] == 1.0)?15.3*exp(-(states[0]+71.0+0.7*computedConstants[0])/83.3):15.3*exp(-(states[0]+71.7)/83.3); + algebraic[37] = (constants[1] == 1.0)?15.0*exp((states[0]+71.0)/15.38):15.0*exp((states[0]+71.7)/15.38); + algebraic[35] = 1.0/(algebraic[36]+algebraic[37]); + rates[6] = (algebraic[34]-states[6])/algebraic[35]; + algebraic[38] = 1.0/(1.0+exp((states[0]+59.37)/13.1)); + algebraic[39] = (constants[1] == 0.0)?0.0101+0.06517/(0.57*exp(-0.08*(states[0]+49.0)))+2.4e-5*exp(0.1*(states[0]+50.93)):(constants[1] == 1.0)?0.001/3.0*(30.31+195.5/(0.5686*exp(-0.08161*(states[0]+39.0+10.0*computedConstants[0]))+0.7174*exp((0.2719-0.1719*computedConstants[0])*1.0*(states[0]+40.93+10.0*computedConstants[0])))):0.0101+0.06517/(0.5686*exp(-0.08161*(states[0]+39.0))+0.7174*exp(0.2719*(states[0]+40.93))); + rates[9] = (algebraic[38]-states[9])/algebraic[39]; + algebraic[40] = 1.0/(1.0+exp(-(states[0]-10.93)/19.7)); + algebraic[41] = (constants[1] == 0.0)?0.001*(2.98+15.59/(1.037*exp(0.09*(states[0]+30.61))+0.369*exp(-0.12*(states[0]+23.84)))):(constants[1] == 1.0)?0.0025*(1.191+7.838/(1.037*exp(0.09012*(states[0]+30.61))+0.369*exp(-0.119*(states[0]+23.84)))):0.001*(2.98+19.59/(1.037*exp(0.09012*(states[0]+30.61))+0.369*exp(-0.119*(states[0]+23.84)))); + rates[8] = (algebraic[40]-states[8])/algebraic[41]; + algebraic[43] = (constants[1] != 2.0)?1.0/(1.0+exp(-(states[0]+14.2)/10.6)):1.0/(1.0+exp(-(states[0]+13.2)/10.6)); + algebraic[44] = (constants[1] != 2.0)?1.0/(37.2*exp((states[0]-9.0)/15.9)+0.96*exp(-(states[0]-9.0)/22.5)):1.0/(37.2*exp((states[0]-10.0)/15.9)+0.96*exp(-(states[0]-10.0)/22.5)); + rates[11] = (algebraic[43]-states[11])/algebraic[44]; + algebraic[45] = algebraic[43]; + algebraic[46] = (constants[1] != 2.0)?1.0/(4.2*exp((states[0]-9.0)/17.0)+0.15*exp(-(states[0]-9.0)/21.6)):1.0/(4.2*exp((states[0]-10.0)/17.0)+0.15*exp(-(states[0]-10.0)/21.6)); + rates[12] = (algebraic[45]-states[12])/algebraic[46]; + algebraic[47] = 1.0/(1.0+exp((states[0]+18.6)/10.1)); + rates[10] = (algebraic[47]-states[10])/computedConstants[19]; + algebraic[48] = 14.0/(1.0+exp(-(states[0]-40.0)/9.0)); + algebraic[49] = 1.0*exp(-states[0]/45.0); + rates[13] = algebraic[48]*(1.0-states[13])-algebraic[49]*states[13]; + algebraic[50] = (constants[1] == 0.0)?1.0*exp(-(states[0]+78.91)/26.62):1.0*exp(-(states[0]+78.91)/26.63); + algebraic[51] = 1.0*exp((states[0]+75.13)/21.25); + rates[14] = algebraic[50]*(1.0-states[14])-algebraic[51]*states[14]; } void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic) { - algebraic[13] = computedConstants[25]*(states[0]-computedConstants[32]); - algebraic[11] = computedConstants[33]*(states[0]-computedConstants[40]); - algebraic[12] = computedConstants[41]*(states[0]-computedConstants[48]); - algebraic[10] = (constants[2] == 0.0)?computedConstants[49]*(pow(constants[56], 3.0)*constants[58]*exp(0.03743*states[0]*constants[57])-pow(constants[59], 3.0)*constants[60]*exp(0.0374*states[0]*(constants[57]-1.0)))/(1.0+constants[61]*(constants[60]*pow(constants[59], 3.0)+constants[58]*pow(constants[56], 3.0))):computedConstants[49]*(pow(constants[56], 3.0)*constants[58]*exp(0.03743*states[0]*constants[57])-pow(constants[59], 3.0)*constants[60]*exp(0.03743*states[0]*(constants[57]-1.0)))/(1.0+constants[61]*(constants[60]*pow(constants[59], 3.0)+constants[58]*pow(constants[56], 3.0))); - algebraic[9] = computedConstants[62]*pow(constants[56]/(constants[71]+constants[56]), 3.0)*pow(constants[69]/(constants[70]+constants[69]), 2.0)*1.6/(1.5+exp(-(states[0]+60.0)/40.0)); - algebraic[91] = (constants[2] == 0.0)?0.0952*exp(-0.063*(states[0]+34.4))/(1.0+1.66*exp(-0.225*(states[0]+63.7)))+0.0869:0.09518*exp(-0.06306*(states[0]+34.4))/(1.0+1.662*exp(-0.2251*(states[0]+63.7)))+0.08693; - algebraic[88] = (1.0-algebraic[91])*states[2]+algebraic[91]*states[3]; - algebraic[7] = computedConstants[81]*pow(states[1], 3.0)*algebraic[88]*constants[59]*pow(constants[24], 2.0)/(constants[22]*constants[23])*(exp((states[0]-computedConstants[32])*constants[24]/(constants[22]*constants[23]))-1.0)/(exp(states[0]*constants[24]/(constants[22]*constants[23]))-1.0)*states[0]; - algebraic[89] = (constants[2] == 0.0)?pow(1.0/(1.0+exp(-states[0]/5.46)), 1.0/3.0):pow(1.0/(1.0+exp(-(states[0]+30.32)/5.46)), 1.0/3.0); - algebraic[90] = (constants[2] == 0.0)?0.0006247/(0.832*exp(-0.335*(states[0]+56.7))+0.627*exp(0.082*(states[0]+65.01)))+4.0e-5:0.0006247/(0.8322166*exp(-0.33566*(states[0]+56.7062))+0.6274*exp(0.0823*(states[0]+65.0131)))+4.569e-5; - algebraic[92] = 1.0/(1.0+exp((states[0]+66.1)/6.4)); - algebraic[94] = algebraic[92]; - algebraic[93] = 3.717e-6*exp(-0.2815*(states[0]+17.11))/(1.0+0.003732*exp(-0.3426*(states[0]+37.76)))+0.0005977; - algebraic[95] = 3.186e-8*exp(-0.6219*(states[0]+18.8))/(1.0+7.189e-5*exp(-0.6683*(states[0]+34.07)))+0.003556; - algebraic[21] = computedConstants[96]*(states[4]*states[5]+0.006/(1.0+exp(-(states[0]+14.1)/6.0)))*(states[0]-constants[103]); - algebraic[106] = (constants[2] == 0.0)?-28.38*(states[0]+35.0)/(exp(-(states[0]+35.0)/2.5)-1.0)-84.9*states[0]/(exp(-0.208*states[0])-1.0):(constants[2] == 1.0)?-28.39*(states[0]+35.0)/(exp(-(states[0]+35.0)/2.5)-1.0)-84.9*states[0]/(exp(-0.208*states[0])-1.0):-28.4*(states[0]+35.0)/(exp(-(states[0]+35.0)/2.5)-1.0)-84.9*states[0]/(exp(-0.208*states[0])-1.0); - algebraic[107] = (constants[2] == 1.0)?11.43*(states[0]-5.0)/(exp(0.4*(states[0]-5.0))-1.0):11.42*(states[0]-5.0)/(exp(0.4*(states[0]-5.0))-1.0); - algebraic[105] = 2.0/(algebraic[106]+algebraic[107]); - algebraic[104] = (constants[2] == 0.0)?1.0/(1.0+exp(-(states[0]+23.1)/6.0)):(constants[2] == 1.0)?1.0/(1.0+exp(-(states[0]+22.3+0.8*computedConstants[0])/6.0)):1.0/(1.0+exp(-(states[0]+22.2)/6.0)); - algebraic[110] = (constants[2] == 1.0)?3.75*(states[0]+28.0)/(exp((states[0]+28.0)/4.0)-1.0):3.12*(states[0]+28.0)/(exp((states[0]+28.0)/4.0)-1.0); - algebraic[111] = (constants[2] == 1.0)?30.0/(1.0+exp(-(states[0]+28.0)/4.0)):25.0/(1.0+exp(-(states[0]+28.0)/4.0)); - algebraic[109] = (constants[2] == 1.0)?(1.2-0.2*computedConstants[0])/(algebraic[110]+algebraic[111]):1.0/(algebraic[110]+algebraic[111]); - algebraic[108] = 1.0/(1.0+exp((states[0]+45.0)/5.0)); - algebraic[20] = computedConstants[112]*states[7]*states[6]*(states[0]-constants[119]); - algebraic[122] = 1068.0*exp((states[0]+26.3)/30.0); - algebraic[123] = 1068.0*exp(-(states[0]+26.3)/30.0); - algebraic[121] = 1.0/(algebraic[122]+algebraic[123]); - algebraic[120] = 1.0/(1.0+exp(-(states[0]+37.0)/6.8)); - algebraic[126] = (constants[2] == 1.0)?15.3*exp(-(states[0]+71.0+0.7*computedConstants[0])/83.3):15.3*exp(-(states[0]+71.7)/83.3); - algebraic[127] = (constants[2] == 1.0)?15.0*exp((states[0]+71.0)/15.38):15.0*exp((states[0]+71.7)/15.38); - algebraic[125] = 1.0/(algebraic[126]+algebraic[127]); - algebraic[124] = 1.0/(1.0+exp((states[0]+71.0)/9.0)); - algebraic[19] = computedConstants[128]*states[9]*states[8]*(states[0]-computedConstants[40]); - algebraic[18] = computedConstants[135]*states[8]*(states[0]-computedConstants[40]); - algebraic[142] = 1.0/(1.0+exp((states[0]+59.37)/13.1)); - algebraic[143] = (constants[2] == 0.0)?0.0101+0.06517/(0.57*exp(-0.08*(states[0]+49.0)))+2.4e-5*exp(0.1*(states[0]+50.93)):(constants[2] == 1.0)?0.001/3.0*(30.31+195.5/(0.5686*exp(-0.08161*(states[0]+39.0+10.0*computedConstants[0]))+0.7174*exp((0.2719-0.1719*computedConstants[0])*1.0*(states[0]+40.93+10.0*computedConstants[0])))):0.0101+0.06517/(0.5686*exp(-0.08161*(states[0]+39.0))+0.7174*exp(0.2719*(states[0]+40.93))); - algebraic[144] = 1.0/(1.0+exp(-(states[0]-10.93)/19.7)); - algebraic[145] = (constants[2] == 0.0)?0.001*(2.98+15.59/(1.037*exp(0.09*(states[0]+30.61))+0.369*exp(-0.12*(states[0]+23.84)))):(constants[2] == 1.0)?0.0025*(1.191+7.838/(1.037*exp(0.09012*(states[0]+30.61))+0.369*exp(-0.119*(states[0]+23.84)))):0.001*(2.98+19.59/(1.037*exp(0.09012*(states[0]+30.61))+0.369*exp(-0.119*(states[0]+23.84)))); - algebraic[153] = 0.6*states[11]+0.4*states[12]; - algebraic[17] = computedConstants[146]*algebraic[153]*states[10]*(states[0]-computedConstants[40]); - algebraic[154] = (constants[2] != 2.0)?1.0/(1.0+exp(-(states[0]+14.2)/10.6)):1.0/(1.0+exp(-(states[0]+13.2)/10.6)); - algebraic[155] = (constants[2] != 2.0)?1.0/(37.2*exp((states[0]-9.0)/15.9)+0.96*exp(-(states[0]-9.0)/22.5)):1.0/(37.2*exp((states[0]-10.0)/15.9)+0.96*exp(-(states[0]-10.0)/22.5)); - algebraic[156] = algebraic[154]; - algebraic[157] = (constants[2] != 2.0)?1.0/(4.2*exp((states[0]-9.0)/17.0)+0.15*exp(-(states[0]-9.0)/21.6)):1.0/(4.2*exp((states[0]-10.0)/17.0)+0.15*exp(-(states[0]-10.0)/21.6)); - algebraic[159] = 1.0/(1.0+exp((states[0]+18.6)/10.1)); - algebraic[16] = computedConstants[160]*pow(states[13], 2.0)*(states[0]-computedConstants[80]); - algebraic[167] = 14.0/(1.0+exp(-(states[0]-40.0)/9.0)); - algebraic[168] = 1.0*exp(-states[0]/45.0); - algebraic[15] = (constants[2] != 2.0)?computedConstants[169]*states[14]*(states[0]-computedConstants[32]):computedConstants[169]*states[14]*(states[0]-77.6); - algebraic[14] = (constants[2] != 2.0)?computedConstants[176]*states[14]*(states[0]-computedConstants[40]):computedConstants[176]*states[14]*(states[0]+102.0); - algebraic[183] = (constants[2] == 0.0)?1.0*exp(-(states[0]+78.91)/26.62):1.0*exp(-(states[0]+78.91)/26.63); - algebraic[184] = 1.0*exp((states[0]+75.13)/21.25); + algebraic[5] = computedConstants[3]*(states[0]-computedConstants[4]); + algebraic[3] = computedConstants[5]*(states[0]-computedConstants[6]); + algebraic[4] = computedConstants[7]*(states[0]-computedConstants[8]); + algebraic[2] = (constants[1] == 0.0)?computedConstants[9]*(pow(constants[32], 3.0)*constants[34]*exp(0.03743*states[0]*constants[33])-pow(constants[35], 3.0)*constants[36]*exp(0.0374*states[0]*(constants[33]-1.0)))/(1.0+constants[37]*(constants[36]*pow(constants[35], 3.0)+constants[34]*pow(constants[32], 3.0))):computedConstants[9]*(pow(constants[32], 3.0)*constants[34]*exp(0.03743*states[0]*constants[33])-pow(constants[35], 3.0)*constants[36]*exp(0.03743*states[0]*(constants[33]-1.0)))/(1.0+constants[37]*(constants[36]*pow(constants[35], 3.0)+constants[34]*pow(constants[32], 3.0))); + algebraic[1] = computedConstants[10]*pow(constants[32]/(constants[46]+constants[32]), 3.0)*pow(constants[44]/(constants[45]+constants[44]), 2.0)*1.6/(1.5+exp(-(states[0]+60.0)/40.0)); + algebraic[17] = (constants[1] == 0.0)?0.0952*exp(-0.063*(states[0]+34.4))/(1.0+1.66*exp(-0.225*(states[0]+63.7)))+0.0869:0.09518*exp(-0.06306*(states[0]+34.4))/(1.0+1.662*exp(-0.2251*(states[0]+63.7)))+0.08693; + algebraic[14] = (1.0-algebraic[17])*states[2]+algebraic[17]*states[3]; + algebraic[0] = computedConstants[13]*pow(states[1], 3.0)*algebraic[14]*constants[35]*pow(constants[7], 2.0)/(constants[5]*constants[6])*(exp((states[0]-computedConstants[4])*constants[7]/(constants[5]*constants[6]))-1.0)/(exp(states[0]*constants[7]/(constants[5]*constants[6]))-1.0)*states[0]; + algebraic[15] = (constants[1] == 0.0)?pow(1.0/(1.0+exp(-states[0]/5.46)), 1.0/3.0):pow(1.0/(1.0+exp(-(states[0]+30.32)/5.46)), 1.0/3.0); + algebraic[16] = (constants[1] == 0.0)?0.0006247/(0.832*exp(-0.335*(states[0]+56.7))+0.627*exp(0.082*(states[0]+65.01)))+4.0e-5:0.0006247/(0.8322166*exp(-0.33566*(states[0]+56.7062))+0.6274*exp(0.0823*(states[0]+65.0131)))+4.569e-5; + algebraic[18] = 1.0/(1.0+exp((states[0]+66.1)/6.4)); + algebraic[20] = algebraic[18]; + algebraic[19] = 3.717e-6*exp(-0.2815*(states[0]+17.11))/(1.0+0.003732*exp(-0.3426*(states[0]+37.76)))+0.0005977; + algebraic[21] = 3.186e-8*exp(-0.6219*(states[0]+18.8))/(1.0+7.189e-5*exp(-0.6683*(states[0]+34.07)))+0.003556; + algebraic[13] = computedConstants[14]*(states[4]*states[5]+0.006/(1.0+exp(-(states[0]+14.1)/6.0)))*(states[0]-constants[66]); + algebraic[24] = (constants[1] == 0.0)?-28.38*(states[0]+35.0)/(exp(-(states[0]+35.0)/2.5)-1.0)-84.9*states[0]/(exp(-0.208*states[0])-1.0):(constants[1] == 1.0)?-28.39*(states[0]+35.0)/(exp(-(states[0]+35.0)/2.5)-1.0)-84.9*states[0]/(exp(-0.208*states[0])-1.0):-28.4*(states[0]+35.0)/(exp(-(states[0]+35.0)/2.5)-1.0)-84.9*states[0]/(exp(-0.208*states[0])-1.0); + algebraic[25] = (constants[1] == 1.0)?11.43*(states[0]-5.0)/(exp(0.4*(states[0]-5.0))-1.0):11.42*(states[0]-5.0)/(exp(0.4*(states[0]-5.0))-1.0); + algebraic[23] = 2.0/(algebraic[24]+algebraic[25]); + algebraic[22] = (constants[1] == 0.0)?1.0/(1.0+exp(-(states[0]+23.1)/6.0)):(constants[1] == 1.0)?1.0/(1.0+exp(-(states[0]+22.3+0.8*computedConstants[0])/6.0)):1.0/(1.0+exp(-(states[0]+22.2)/6.0)); + algebraic[28] = (constants[1] == 1.0)?3.75*(states[0]+28.0)/(exp((states[0]+28.0)/4.0)-1.0):3.12*(states[0]+28.0)/(exp((states[0]+28.0)/4.0)-1.0); + algebraic[29] = (constants[1] == 1.0)?30.0/(1.0+exp(-(states[0]+28.0)/4.0)):25.0/(1.0+exp(-(states[0]+28.0)/4.0)); + algebraic[27] = (constants[1] == 1.0)?(1.2-0.2*computedConstants[0])/(algebraic[28]+algebraic[29]):1.0/(algebraic[28]+algebraic[29]); + algebraic[26] = 1.0/(1.0+exp((states[0]+45.0)/5.0)); + algebraic[12] = computedConstants[15]*states[7]*states[6]*(states[0]-constants[73]); + algebraic[32] = 1068.0*exp((states[0]+26.3)/30.0); + algebraic[33] = 1068.0*exp(-(states[0]+26.3)/30.0); + algebraic[31] = 1.0/(algebraic[32]+algebraic[33]); + algebraic[30] = 1.0/(1.0+exp(-(states[0]+37.0)/6.8)); + algebraic[36] = (constants[1] == 1.0)?15.3*exp(-(states[0]+71.0+0.7*computedConstants[0])/83.3):15.3*exp(-(states[0]+71.7)/83.3); + algebraic[37] = (constants[1] == 1.0)?15.0*exp((states[0]+71.0)/15.38):15.0*exp((states[0]+71.7)/15.38); + algebraic[35] = 1.0/(algebraic[36]+algebraic[37]); + algebraic[34] = 1.0/(1.0+exp((states[0]+71.0)/9.0)); + algebraic[11] = computedConstants[16]*states[9]*states[8]*(states[0]-computedConstants[6]); + algebraic[10] = computedConstants[17]*states[8]*(states[0]-computedConstants[6]); + algebraic[38] = 1.0/(1.0+exp((states[0]+59.37)/13.1)); + algebraic[39] = (constants[1] == 0.0)?0.0101+0.06517/(0.57*exp(-0.08*(states[0]+49.0)))+2.4e-5*exp(0.1*(states[0]+50.93)):(constants[1] == 1.0)?0.001/3.0*(30.31+195.5/(0.5686*exp(-0.08161*(states[0]+39.0+10.0*computedConstants[0]))+0.7174*exp((0.2719-0.1719*computedConstants[0])*1.0*(states[0]+40.93+10.0*computedConstants[0])))):0.0101+0.06517/(0.5686*exp(-0.08161*(states[0]+39.0))+0.7174*exp(0.2719*(states[0]+40.93))); + algebraic[40] = 1.0/(1.0+exp(-(states[0]-10.93)/19.7)); + algebraic[41] = (constants[1] == 0.0)?0.001*(2.98+15.59/(1.037*exp(0.09*(states[0]+30.61))+0.369*exp(-0.12*(states[0]+23.84)))):(constants[1] == 1.0)?0.0025*(1.191+7.838/(1.037*exp(0.09012*(states[0]+30.61))+0.369*exp(-0.119*(states[0]+23.84)))):0.001*(2.98+19.59/(1.037*exp(0.09012*(states[0]+30.61))+0.369*exp(-0.119*(states[0]+23.84)))); + algebraic[42] = 0.6*states[11]+0.4*states[12]; + algebraic[9] = computedConstants[18]*algebraic[42]*states[10]*(states[0]-computedConstants[6]); + algebraic[43] = (constants[1] != 2.0)?1.0/(1.0+exp(-(states[0]+14.2)/10.6)):1.0/(1.0+exp(-(states[0]+13.2)/10.6)); + algebraic[44] = (constants[1] != 2.0)?1.0/(37.2*exp((states[0]-9.0)/15.9)+0.96*exp(-(states[0]-9.0)/22.5)):1.0/(37.2*exp((states[0]-10.0)/15.9)+0.96*exp(-(states[0]-10.0)/22.5)); + algebraic[45] = algebraic[43]; + algebraic[46] = (constants[1] != 2.0)?1.0/(4.2*exp((states[0]-9.0)/17.0)+0.15*exp(-(states[0]-9.0)/21.6)):1.0/(4.2*exp((states[0]-10.0)/17.0)+0.15*exp(-(states[0]-10.0)/21.6)); + algebraic[47] = 1.0/(1.0+exp((states[0]+18.6)/10.1)); + algebraic[8] = computedConstants[20]*pow(states[13], 2.0)*(states[0]-computedConstants[12]); + algebraic[48] = 14.0/(1.0+exp(-(states[0]-40.0)/9.0)); + algebraic[49] = 1.0*exp(-states[0]/45.0); + algebraic[7] = (constants[1] != 2.0)?computedConstants[21]*states[14]*(states[0]-computedConstants[4]):computedConstants[21]*states[14]*(states[0]-77.6); + algebraic[6] = (constants[1] != 2.0)?computedConstants[22]*states[14]*(states[0]-computedConstants[6]):computedConstants[22]*states[14]*(states[0]+102.0); + algebraic[50] = (constants[1] == 0.0)?1.0*exp(-(states[0]+78.91)/26.62):1.0*exp(-(states[0]+78.91)/26.63); + algebraic[51] = 1.0*exp((states[0]+75.13)/21.25); } diff --git a/tests/resources/generator/garny_kohl_hunter_boyett_noble_rabbit_san_model_2003/model.py b/tests/resources/generator/garny_kohl_hunter_boyett_noble_rabbit_san_model_2003/model.py index 241a885d14..b07aec10ec 100644 --- a/tests/resources/generator/garny_kohl_hunter_boyett_noble_rabbit_san_model_2003/model.py +++ b/tests/resources/generator/garny_kohl_hunter_boyett_noble_rabbit_san_model_2003/model.py @@ -247,116 +247,116 @@ def create_variables_array(): def initialise_variables(states, rates, constants): - constants[1] = 0.0 - constants[2] = 1.0 - constants[3] = 1.0309347 - constants[5] = 2.0e-5 - constants[6] = 6.5e-5 - constants[22] = 8314.0 - constants[23] = 310.0 - constants[24] = 96845.0 - constants[26] = 5.8e-5 - constants[27] = 0.000189 - constants[28] = 5.8e-5 - constants[29] = 0.000189 - constants[30] = 5.81818e-5 - constants[31] = 0.0001888 - constants[34] = 2.52e-5 - constants[35] = 8.19e-5 - constants[36] = 2.52e-5 - constants[37] = 8.19e-5 - constants[38] = 2.523636e-5 - constants[39] = 8.1892e-5 - constants[42] = 1.32e-5 - constants[43] = 4.3e-5 - constants[44] = 1.323e-5 - constants[45] = 4.29e-5 - constants[46] = 1.3236e-5 - constants[47] = 4.2952e-5 - constants[50] = 2.7e-6 - constants[51] = 8.8e-6 - constants[52] = 2.8e-6 - constants[53] = 8.8e-6 - constants[54] = 2.7229e-6 - constants[55] = 8.83584e-6 - constants[56] = 8.0 - constants[57] = 0.5 - constants[58] = 2.0 - constants[59] = 140.0 - constants[60] = 0.0001 - constants[61] = 0.0001 - constants[63] = 0.0478 - constants[64] = 0.16 - constants[65] = 0.0478 - constants[66] = 0.16 - constants[67] = 0.04782545 - constants[68] = 0.1551936 - constants[69] = 5.4 - constants[70] = 0.621 - constants[71] = 5.64 - constants[73] = 0.0 - constants[74] = 0.0 - constants[75] = 0.0042 - constants[76] = 0.03339 - constants[77] = 0.0 - constants[78] = 0.0 - constants[79] = 140.0 - constants[82] = 0.0 - constants[83] = 1.2e-6 - constants[84] = 0.0 - constants[85] = 3.7e-7 - constants[86] = 0.0 - constants[87] = 1.204e-6 - constants[97] = 0.0058 - constants[98] = 0.0659 - constants[99] = 0.0082 - constants[100] = 0.0659 - constants[101] = 0.0057938 - constants[102] = 0.06588648 - constants[103] = 46.4 - constants[113] = 0.0043 - constants[114] = 0.0139 - constants[115] = 0.0021 - constants[116] = 0.00694 - constants[117] = 0.00427806 - constants[118] = 0.0138823 - constants[119] = 45.0 - constants[129] = 0.00491 - constants[130] = 0.03649 - constants[131] = 0.004905 - constants[132] = 0.0365 - constants[133] = 0.004905 - constants[134] = 0.036495 - constants[136] = 6.65e-5 - constants[137] = 0.0114 - constants[138] = 0.000266 - constants[139] = 0.0114 - constants[140] = 6.645504e-5 - constants[141] = 0.01138376 - constants[147] = 0.000797 - constants[148] = 0.016 - constants[149] = 0.000738 - constants[150] = 0.0208 - constants[151] = 0.00079704 - constants[152] = 0.016 - constants[161] = 0.000518 - constants[162] = 0.0104 - constants[163] = 0.000345 - constants[164] = 0.0104 - constants[165] = 0.0003445 - constants[166] = 0.0104 - constants[170] = 0.000548 - constants[171] = 0.0069 - constants[172] = 0.000437 - constants[173] = 0.0055 - constants[174] = 0.0005465 - constants[175] = 0.006875 - constants[177] = 0.000548 - constants[178] = 0.0069 - constants[179] = 0.000437 - constants[180] = 0.0055 - constants[181] = 0.0005465 - constants[182] = 0.006875 + constants[0] = 0.0 + constants[1] = 1.0 + constants[2] = 1.0309347 + constants[3] = 2.0e-5 + constants[4] = 6.5e-5 + constants[5] = 8314.0 + constants[6] = 310.0 + constants[7] = 96845.0 + constants[8] = 5.8e-5 + constants[9] = 0.000189 + constants[10] = 5.8e-5 + constants[11] = 0.000189 + constants[12] = 5.81818e-5 + constants[13] = 0.0001888 + constants[14] = 2.52e-5 + constants[15] = 8.19e-5 + constants[16] = 2.52e-5 + constants[17] = 8.19e-5 + constants[18] = 2.523636e-5 + constants[19] = 8.1892e-5 + constants[20] = 1.32e-5 + constants[21] = 4.3e-5 + constants[22] = 1.323e-5 + constants[23] = 4.29e-5 + constants[24] = 1.3236e-5 + constants[25] = 4.2952e-5 + constants[26] = 2.7e-6 + constants[27] = 8.8e-6 + constants[28] = 2.8e-6 + constants[29] = 8.8e-6 + constants[30] = 2.7229e-6 + constants[31] = 8.83584e-6 + constants[32] = 8.0 + constants[33] = 0.5 + constants[34] = 2.0 + constants[35] = 140.0 + constants[36] = 0.0001 + constants[37] = 0.0001 + constants[38] = 0.0478 + constants[39] = 0.16 + constants[40] = 0.0478 + constants[41] = 0.16 + constants[42] = 0.04782545 + constants[43] = 0.1551936 + constants[44] = 5.4 + constants[45] = 0.621 + constants[46] = 5.64 + constants[47] = 0.0 + constants[48] = 0.0 + constants[49] = 0.0042 + constants[50] = 0.03339 + constants[51] = 0.0 + constants[52] = 0.0 + constants[53] = 140.0 + constants[54] = 0.0 + constants[55] = 1.2e-6 + constants[56] = 0.0 + constants[57] = 3.7e-7 + constants[58] = 0.0 + constants[59] = 1.204e-6 + constants[60] = 0.0058 + constants[61] = 0.0659 + constants[62] = 0.0082 + constants[63] = 0.0659 + constants[64] = 0.0057938 + constants[65] = 0.06588648 + constants[66] = 46.4 + constants[67] = 0.0043 + constants[68] = 0.0139 + constants[69] = 0.0021 + constants[70] = 0.00694 + constants[71] = 0.00427806 + constants[72] = 0.0138823 + constants[73] = 45.0 + constants[74] = 0.00491 + constants[75] = 0.03649 + constants[76] = 0.004905 + constants[77] = 0.0365 + constants[78] = 0.004905 + constants[79] = 0.036495 + constants[80] = 6.65e-5 + constants[81] = 0.0114 + constants[82] = 0.000266 + constants[83] = 0.0114 + constants[84] = 6.645504e-5 + constants[85] = 0.01138376 + constants[86] = 0.000797 + constants[87] = 0.016 + constants[88] = 0.000738 + constants[89] = 0.0208 + constants[90] = 0.00079704 + constants[91] = 0.016 + constants[92] = 0.000518 + constants[93] = 0.0104 + constants[94] = 0.000345 + constants[95] = 0.0104 + constants[96] = 0.0003445 + constants[97] = 0.0104 + constants[98] = 0.000548 + constants[99] = 0.0069 + constants[100] = 0.000437 + constants[101] = 0.0055 + constants[102] = 0.0005465 + constants[103] = 0.006875 + constants[104] = 0.000548 + constants[105] = 0.0069 + constants[106] = 0.000437 + constants[107] = 0.0055 + constants[108] = 0.0005465 + constants[109] = 0.006875 states[0] = -39.013558536 states[1] = 0.092361701692 states[2] = 0.015905380261 @@ -375,151 +375,151 @@ def initialise_variables(states, rates, constants): def compute_computed_constants(constants, computed_constants): - computed_constants[0] = 1.07*(3.0*constants[1]-0.1)/(3.0*(1.0+0.7745*exp(-(3.0*constants[1]-2.05)/0.295))) if eq_func(constants[2], 0.0) else constants[3]*constants[1]/(1.0+0.7745*exp(-(3.0*constants[1]-2.05)/0.295)) if eq_func(constants[2], 1.0) else 1.07*29.0*constants[1]/(30.0*(1.0+0.7745*exp(-(29.0*constants[1]-24.5)/1.95))) - computed_constants[4] = constants[5]+computed_constants[0]*(constants[6]-constants[5]) - computed_constants[25] = constants[26]+computed_constants[0]*(constants[27]-constants[26]) if eq_func(constants[2], 0.0) else constants[30]+computed_constants[0]*(constants[31]-constants[30]) if eq_func(constants[2], 1.0) else constants[28]+computed_constants[0]*(constants[29]-constants[28]) - computed_constants[33] = constants[34]+computed_constants[0]*(constants[35]-constants[34]) if eq_func(constants[2], 0.0) else constants[38]+computed_constants[0]*(constants[39]-constants[38]) if eq_func(constants[2], 1.0) else constants[36]+computed_constants[0]*(constants[37]-constants[36]) - computed_constants[41] = constants[42]+computed_constants[0]*(constants[43]-constants[42]) if eq_func(constants[2], 0.0) else constants[46]+computed_constants[0]*(constants[47]-constants[46]) if eq_func(constants[2], 1.0) else constants[44]+computed_constants[0]*(constants[45]-constants[44]) - computed_constants[49] = constants[50]+computed_constants[0]*(constants[51]-constants[50]) if eq_func(constants[2], 0.0) else constants[54]+computed_constants[0]*(constants[55]-constants[54]) if eq_func(constants[2], 1.0) else constants[52]+computed_constants[0]*(constants[53]-constants[52]) - computed_constants[62] = constants[63]+computed_constants[0]*(constants[64]-constants[63]) if eq_func(constants[2], 0.0) else constants[67]+computed_constants[0]*(constants[68]-constants[67]) if eq_func(constants[2], 1.0) else constants[65]+computed_constants[0]*(constants[66]-constants[65]) - computed_constants[72] = constants[73]+computed_constants[0]*(constants[74]-constants[73]) if eq_func(constants[2], 0.0) else constants[77]+computed_constants[0]*(constants[78]-constants[77]) if eq_func(constants[2], 1.0) else constants[75]+computed_constants[0]*(constants[76]-constants[75]) - computed_constants[8] = computed_constants[72]*constants[60]/(constants[60]+0.0004) - computed_constants[32] = constants[22]*constants[23]/constants[24]*log(constants[59]/constants[56]) - computed_constants[40] = constants[22]*constants[23]/constants[24]*log(constants[69]/constants[79]) - computed_constants[48] = constants[22]*constants[23]/(2.0*constants[24])*log(constants[58]/constants[60]) - computed_constants[80] = constants[22]*constants[23]/constants[24]*log((constants[69]+0.12*constants[59])/(constants[79]+0.12*constants[56])) if eq_func(constants[2], 0.0) else constants[22]*constants[23]/constants[24]*log((constants[69]+0.03*constants[59])/(constants[79]+0.03*constants[56])) - computed_constants[81] = constants[82]+computed_constants[0]*(constants[83]-constants[82]) if eq_func(constants[2], 0.0) else constants[86]+computed_constants[0]*(constants[87]-constants[86]) if eq_func(constants[2], 1.0) else constants[84]+computed_constants[0]*(constants[85]-constants[84]) - computed_constants[96] = constants[97]+computed_constants[0]*(constants[98]-constants[97]) if eq_func(constants[2], 0.0) else constants[101]+computed_constants[0]*(constants[102]-constants[101]) if eq_func(constants[2], 1.0) else constants[99]+computed_constants[0]*(constants[100]-constants[99]) - computed_constants[112] = constants[113]+computed_constants[0]*(constants[114]-constants[113]) if eq_func(constants[2], 0.0) else constants[117]+computed_constants[0]*(constants[118]-constants[117]) if eq_func(constants[2], 1.0) else constants[115]+computed_constants[0]*(constants[116]-constants[115]) - computed_constants[128] = constants[129]+computed_constants[0]*(constants[130]-constants[129]) if eq_func(constants[2], 0.0) else constants[133]+computed_constants[0]*(constants[134]-constants[133]) if eq_func(constants[2], 1.0) else constants[131]+computed_constants[0]*(constants[132]-constants[131]) - computed_constants[135] = constants[136]+computed_constants[0]*(constants[137]-constants[136]) if eq_func(constants[2], 0.0) else constants[140]+computed_constants[0]*(constants[141]-constants[140]) if eq_func(constants[2], 1.0) else constants[138]+computed_constants[0]*(constants[139]-constants[138]) - computed_constants[146] = constants[147]+computed_constants[0]*(constants[148]-constants[147]) if eq_func(constants[2], 0.0) else constants[151]+computed_constants[0]*(constants[152]-constants[151]) if eq_func(constants[2], 1.0) else constants[149]+computed_constants[0]*(constants[150]-constants[149]) - computed_constants[158] = 0.002 if eq_func(constants[2], 0.0) else 0.002 if eq_func(constants[2], 1.0) else 0.006 - computed_constants[160] = constants[161]+computed_constants[0]*(constants[162]-constants[161]) if eq_func(constants[2], 0.0) else constants[165]+computed_constants[0]*(constants[166]-constants[165]) if eq_func(constants[2], 1.0) else constants[163]+computed_constants[0]*(constants[164]-constants[163]) - computed_constants[169] = constants[170]+computed_constants[0]*(constants[171]-constants[170]) if eq_func(constants[2], 0.0) else constants[174]+computed_constants[0]*(constants[175]-constants[174]) if eq_func(constants[2], 1.0) else constants[172]+computed_constants[0]*(constants[173]-constants[172]) - computed_constants[176] = constants[177]+computed_constants[0]*(constants[178]-constants[177]) if eq_func(constants[2], 0.0) else constants[181]+computed_constants[0]*(constants[182]-constants[181]) if eq_func(constants[2], 1.0) else constants[179]+computed_constants[0]*(constants[180]-constants[179]) + computed_constants[0] = 1.07*(3.0*constants[0]-0.1)/(3.0*(1.0+0.7745*exp(-(3.0*constants[0]-2.05)/0.295))) if eq_func(constants[1], 0.0) else constants[2]*constants[0]/(1.0+0.7745*exp(-(3.0*constants[0]-2.05)/0.295)) if eq_func(constants[1], 1.0) else 1.07*29.0*constants[0]/(30.0*(1.0+0.7745*exp(-(29.0*constants[0]-24.5)/1.95))) + computed_constants[1] = constants[3]+computed_constants[0]*(constants[4]-constants[3]) + computed_constants[3] = constants[8]+computed_constants[0]*(constants[9]-constants[8]) if eq_func(constants[1], 0.0) else constants[12]+computed_constants[0]*(constants[13]-constants[12]) if eq_func(constants[1], 1.0) else constants[10]+computed_constants[0]*(constants[11]-constants[10]) + computed_constants[5] = constants[14]+computed_constants[0]*(constants[15]-constants[14]) if eq_func(constants[1], 0.0) else constants[18]+computed_constants[0]*(constants[19]-constants[18]) if eq_func(constants[1], 1.0) else constants[16]+computed_constants[0]*(constants[17]-constants[16]) + computed_constants[7] = constants[20]+computed_constants[0]*(constants[21]-constants[20]) if eq_func(constants[1], 0.0) else constants[24]+computed_constants[0]*(constants[25]-constants[24]) if eq_func(constants[1], 1.0) else constants[22]+computed_constants[0]*(constants[23]-constants[22]) + computed_constants[9] = constants[26]+computed_constants[0]*(constants[27]-constants[26]) if eq_func(constants[1], 0.0) else constants[30]+computed_constants[0]*(constants[31]-constants[30]) if eq_func(constants[1], 1.0) else constants[28]+computed_constants[0]*(constants[29]-constants[28]) + computed_constants[10] = constants[38]+computed_constants[0]*(constants[39]-constants[38]) if eq_func(constants[1], 0.0) else constants[42]+computed_constants[0]*(constants[43]-constants[42]) if eq_func(constants[1], 1.0) else constants[40]+computed_constants[0]*(constants[41]-constants[40]) + computed_constants[11] = constants[47]+computed_constants[0]*(constants[48]-constants[47]) if eq_func(constants[1], 0.0) else constants[51]+computed_constants[0]*(constants[52]-constants[51]) if eq_func(constants[1], 1.0) else constants[49]+computed_constants[0]*(constants[50]-constants[49]) + computed_constants[2] = computed_constants[11]*constants[36]/(constants[36]+0.0004) + computed_constants[4] = constants[5]*constants[6]/constants[7]*log(constants[35]/constants[32]) + computed_constants[6] = constants[5]*constants[6]/constants[7]*log(constants[44]/constants[53]) + computed_constants[8] = constants[5]*constants[6]/(2.0*constants[7])*log(constants[34]/constants[36]) + computed_constants[12] = constants[5]*constants[6]/constants[7]*log((constants[44]+0.12*constants[35])/(constants[53]+0.12*constants[32])) if eq_func(constants[1], 0.0) else constants[5]*constants[6]/constants[7]*log((constants[44]+0.03*constants[35])/(constants[53]+0.03*constants[32])) + computed_constants[13] = constants[54]+computed_constants[0]*(constants[55]-constants[54]) if eq_func(constants[1], 0.0) else constants[58]+computed_constants[0]*(constants[59]-constants[58]) if eq_func(constants[1], 1.0) else constants[56]+computed_constants[0]*(constants[57]-constants[56]) + computed_constants[14] = constants[60]+computed_constants[0]*(constants[61]-constants[60]) if eq_func(constants[1], 0.0) else constants[64]+computed_constants[0]*(constants[65]-constants[64]) if eq_func(constants[1], 1.0) else constants[62]+computed_constants[0]*(constants[63]-constants[62]) + computed_constants[15] = constants[67]+computed_constants[0]*(constants[68]-constants[67]) if eq_func(constants[1], 0.0) else constants[71]+computed_constants[0]*(constants[72]-constants[71]) if eq_func(constants[1], 1.0) else constants[69]+computed_constants[0]*(constants[70]-constants[69]) + computed_constants[16] = constants[74]+computed_constants[0]*(constants[75]-constants[74]) if eq_func(constants[1], 0.0) else constants[78]+computed_constants[0]*(constants[79]-constants[78]) if eq_func(constants[1], 1.0) else constants[76]+computed_constants[0]*(constants[77]-constants[76]) + computed_constants[17] = constants[80]+computed_constants[0]*(constants[81]-constants[80]) if eq_func(constants[1], 0.0) else constants[84]+computed_constants[0]*(constants[85]-constants[84]) if eq_func(constants[1], 1.0) else constants[82]+computed_constants[0]*(constants[83]-constants[82]) + computed_constants[18] = constants[86]+computed_constants[0]*(constants[87]-constants[86]) if eq_func(constants[1], 0.0) else constants[90]+computed_constants[0]*(constants[91]-constants[90]) if eq_func(constants[1], 1.0) else constants[88]+computed_constants[0]*(constants[89]-constants[88]) + computed_constants[19] = 0.002 if eq_func(constants[1], 0.0) else 0.002 if eq_func(constants[1], 1.0) else 0.006 + computed_constants[20] = constants[92]+computed_constants[0]*(constants[93]-constants[92]) if eq_func(constants[1], 0.0) else constants[96]+computed_constants[0]*(constants[97]-constants[96]) if eq_func(constants[1], 1.0) else constants[94]+computed_constants[0]*(constants[95]-constants[94]) + computed_constants[21] = constants[98]+computed_constants[0]*(constants[99]-constants[98]) if eq_func(constants[1], 0.0) else constants[102]+computed_constants[0]*(constants[103]-constants[102]) if eq_func(constants[1], 1.0) else constants[100]+computed_constants[0]*(constants[101]-constants[100]) + computed_constants[22] = constants[104]+computed_constants[0]*(constants[105]-constants[104]) if eq_func(constants[1], 0.0) else constants[108]+computed_constants[0]*(constants[109]-constants[108]) if eq_func(constants[1], 1.0) else constants[106]+computed_constants[0]*(constants[107]-constants[106]) def compute_rates(voi, states, rates, constants, computed_constants, algebraic): - algebraic[9] = computed_constants[62]*pow(constants[56]/(constants[71]+constants[56]), 3.0)*pow(constants[69]/(constants[70]+constants[69]), 2.0)*1.6/(1.5+exp(-(states[0]+60.0)/40.0)) - algebraic[10] = computed_constants[49]*(pow(constants[56], 3.0)*constants[58]*exp(0.03743*states[0]*constants[57])-pow(constants[59], 3.0)*constants[60]*exp(0.0374*states[0]*(constants[57]-1.0)))/(1.0+constants[61]*(constants[60]*pow(constants[59], 3.0)+constants[58]*pow(constants[56], 3.0))) if eq_func(constants[2], 0.0) else computed_constants[49]*(pow(constants[56], 3.0)*constants[58]*exp(0.03743*states[0]*constants[57])-pow(constants[59], 3.0)*constants[60]*exp(0.03743*states[0]*(constants[57]-1.0)))/(1.0+constants[61]*(constants[60]*pow(constants[59], 3.0)+constants[58]*pow(constants[56], 3.0))) - algebraic[14] = computed_constants[176]*states[14]*(states[0]-computed_constants[40]) if neq_func(constants[2], 2.0) else computed_constants[176]*states[14]*(states[0]+102.0) - algebraic[15] = computed_constants[169]*states[14]*(states[0]-computed_constants[32]) if neq_func(constants[2], 2.0) else computed_constants[169]*states[14]*(states[0]-77.6) - algebraic[16] = computed_constants[160]*pow(states[13], 2.0)*(states[0]-computed_constants[80]) - algebraic[18] = computed_constants[135]*states[8]*(states[0]-computed_constants[40]) - algebraic[19] = computed_constants[128]*states[9]*states[8]*(states[0]-computed_constants[40]) - algebraic[20] = computed_constants[112]*states[7]*states[6]*(states[0]-constants[119]) - algebraic[21] = computed_constants[96]*(states[4]*states[5]+0.006/(1.0+exp(-(states[0]+14.1)/6.0)))*(states[0]-constants[103]) - algebraic[91] = 0.0952*exp(-0.063*(states[0]+34.4))/(1.0+1.66*exp(-0.225*(states[0]+63.7)))+0.0869 if eq_func(constants[2], 0.0) else 0.09518*exp(-0.06306*(states[0]+34.4))/(1.0+1.662*exp(-0.2251*(states[0]+63.7)))+0.08693 - algebraic[88] = (1.0-algebraic[91])*states[2]+algebraic[91]*states[3] - algebraic[7] = computed_constants[81]*pow(states[1], 3.0)*algebraic[88]*constants[59]*pow(constants[24], 2.0)/(constants[22]*constants[23])*(exp((states[0]-computed_constants[32])*constants[24]/(constants[22]*constants[23]))-1.0)/(exp(states[0]*constants[24]/(constants[22]*constants[23]))-1.0)*states[0] - algebraic[11] = computed_constants[33]*(states[0]-computed_constants[40]) - algebraic[12] = computed_constants[41]*(states[0]-computed_constants[48]) - algebraic[13] = computed_constants[25]*(states[0]-computed_constants[32]) - algebraic[153] = 0.6*states[11]+0.4*states[12] - algebraic[17] = computed_constants[146]*algebraic[153]*states[10]*(states[0]-computed_constants[40]) - rates[0] = -1.0/computed_constants[4]*(algebraic[7]+algebraic[21]+algebraic[20]+algebraic[19]+algebraic[18]+algebraic[17]+algebraic[16]+algebraic[15]+algebraic[14]+algebraic[13]+algebraic[12]+algebraic[11]+algebraic[10]+algebraic[9]+computed_constants[8]) - algebraic[89] = pow(1.0/(1.0+exp(-states[0]/5.46)), 1.0/3.0) if eq_func(constants[2], 0.0) else pow(1.0/(1.0+exp(-(states[0]+30.32)/5.46)), 1.0/3.0) - algebraic[90] = 0.0006247/(0.832*exp(-0.335*(states[0]+56.7))+0.627*exp(0.082*(states[0]+65.01)))+4.0e-5 if eq_func(constants[2], 0.0) else 0.0006247/(0.8322166*exp(-0.33566*(states[0]+56.7062))+0.6274*exp(0.0823*(states[0]+65.0131)))+4.569e-5 - rates[1] = (algebraic[89]-states[1])/algebraic[90] - algebraic[92] = 1.0/(1.0+exp((states[0]+66.1)/6.4)) - algebraic[93] = 3.717e-6*exp(-0.2815*(states[0]+17.11))/(1.0+0.003732*exp(-0.3426*(states[0]+37.76)))+0.0005977 - rates[2] = (algebraic[92]-states[2])/algebraic[93] - algebraic[94] = algebraic[92] - algebraic[95] = 3.186e-8*exp(-0.6219*(states[0]+18.8))/(1.0+7.189e-5*exp(-0.6683*(states[0]+34.07)))+0.003556 - rates[3] = (algebraic[94]-states[3])/algebraic[95] - algebraic[104] = 1.0/(1.0+exp(-(states[0]+23.1)/6.0)) if eq_func(constants[2], 0.0) else 1.0/(1.0+exp(-(states[0]+22.3+0.8*computed_constants[0])/6.0)) if eq_func(constants[2], 1.0) else 1.0/(1.0+exp(-(states[0]+22.2)/6.0)) - algebraic[106] = -28.38*(states[0]+35.0)/(exp(-(states[0]+35.0)/2.5)-1.0)-84.9*states[0]/(exp(-0.208*states[0])-1.0) if eq_func(constants[2], 0.0) else -28.39*(states[0]+35.0)/(exp(-(states[0]+35.0)/2.5)-1.0)-84.9*states[0]/(exp(-0.208*states[0])-1.0) if eq_func(constants[2], 1.0) else -28.4*(states[0]+35.0)/(exp(-(states[0]+35.0)/2.5)-1.0)-84.9*states[0]/(exp(-0.208*states[0])-1.0) - algebraic[107] = 11.43*(states[0]-5.0)/(exp(0.4*(states[0]-5.0))-1.0) if eq_func(constants[2], 1.0) else 11.42*(states[0]-5.0)/(exp(0.4*(states[0]-5.0))-1.0) - algebraic[105] = 2.0/(algebraic[106]+algebraic[107]) - rates[5] = (algebraic[104]-states[5])/algebraic[105] - algebraic[108] = 1.0/(1.0+exp((states[0]+45.0)/5.0)) - algebraic[110] = 3.75*(states[0]+28.0)/(exp((states[0]+28.0)/4.0)-1.0) if eq_func(constants[2], 1.0) else 3.12*(states[0]+28.0)/(exp((states[0]+28.0)/4.0)-1.0) - algebraic[111] = 30.0/(1.0+exp(-(states[0]+28.0)/4.0)) if eq_func(constants[2], 1.0) else 25.0/(1.0+exp(-(states[0]+28.0)/4.0)) - algebraic[109] = (1.2-0.2*computed_constants[0])/(algebraic[110]+algebraic[111]) if eq_func(constants[2], 1.0) else 1.0/(algebraic[110]+algebraic[111]) - rates[4] = (algebraic[108]-states[4])/algebraic[109] - algebraic[120] = 1.0/(1.0+exp(-(states[0]+37.0)/6.8)) - algebraic[122] = 1068.0*exp((states[0]+26.3)/30.0) - algebraic[123] = 1068.0*exp(-(states[0]+26.3)/30.0) - algebraic[121] = 1.0/(algebraic[122]+algebraic[123]) - rates[7] = (algebraic[120]-states[7])/algebraic[121] - algebraic[124] = 1.0/(1.0+exp((states[0]+71.0)/9.0)) - algebraic[126] = 15.3*exp(-(states[0]+71.0+0.7*computed_constants[0])/83.3) if eq_func(constants[2], 1.0) else 15.3*exp(-(states[0]+71.7)/83.3) - algebraic[127] = 15.0*exp((states[0]+71.0)/15.38) if eq_func(constants[2], 1.0) else 15.0*exp((states[0]+71.7)/15.38) - algebraic[125] = 1.0/(algebraic[126]+algebraic[127]) - rates[6] = (algebraic[124]-states[6])/algebraic[125] - algebraic[142] = 1.0/(1.0+exp((states[0]+59.37)/13.1)) - algebraic[143] = 0.0101+0.06517/(0.57*exp(-0.08*(states[0]+49.0)))+2.4e-5*exp(0.1*(states[0]+50.93)) if eq_func(constants[2], 0.0) else 0.001/3.0*(30.31+195.5/(0.5686*exp(-0.08161*(states[0]+39.0+10.0*computed_constants[0]))+0.7174*exp((0.2719-0.1719*computed_constants[0])*1.0*(states[0]+40.93+10.0*computed_constants[0])))) if eq_func(constants[2], 1.0) else 0.0101+0.06517/(0.5686*exp(-0.08161*(states[0]+39.0))+0.7174*exp(0.2719*(states[0]+40.93))) - rates[9] = (algebraic[142]-states[9])/algebraic[143] - algebraic[144] = 1.0/(1.0+exp(-(states[0]-10.93)/19.7)) - algebraic[145] = 0.001*(2.98+15.59/(1.037*exp(0.09*(states[0]+30.61))+0.369*exp(-0.12*(states[0]+23.84)))) if eq_func(constants[2], 0.0) else 0.0025*(1.191+7.838/(1.037*exp(0.09012*(states[0]+30.61))+0.369*exp(-0.119*(states[0]+23.84)))) if eq_func(constants[2], 1.0) else 0.001*(2.98+19.59/(1.037*exp(0.09012*(states[0]+30.61))+0.369*exp(-0.119*(states[0]+23.84)))) - rates[8] = (algebraic[144]-states[8])/algebraic[145] - algebraic[154] = 1.0/(1.0+exp(-(states[0]+14.2)/10.6)) if neq_func(constants[2], 2.0) else 1.0/(1.0+exp(-(states[0]+13.2)/10.6)) - algebraic[155] = 1.0/(37.2*exp((states[0]-9.0)/15.9)+0.96*exp(-(states[0]-9.0)/22.5)) if neq_func(constants[2], 2.0) else 1.0/(37.2*exp((states[0]-10.0)/15.9)+0.96*exp(-(states[0]-10.0)/22.5)) - rates[11] = (algebraic[154]-states[11])/algebraic[155] - algebraic[156] = algebraic[154] - algebraic[157] = 1.0/(4.2*exp((states[0]-9.0)/17.0)+0.15*exp(-(states[0]-9.0)/21.6)) if neq_func(constants[2], 2.0) else 1.0/(4.2*exp((states[0]-10.0)/17.0)+0.15*exp(-(states[0]-10.0)/21.6)) - rates[12] = (algebraic[156]-states[12])/algebraic[157] - algebraic[159] = 1.0/(1.0+exp((states[0]+18.6)/10.1)) - rates[10] = (algebraic[159]-states[10])/computed_constants[158] - algebraic[167] = 14.0/(1.0+exp(-(states[0]-40.0)/9.0)) - algebraic[168] = 1.0*exp(-states[0]/45.0) - rates[13] = algebraic[167]*(1.0-states[13])-algebraic[168]*states[13] - algebraic[183] = 1.0*exp(-(states[0]+78.91)/26.62) if eq_func(constants[2], 0.0) else 1.0*exp(-(states[0]+78.91)/26.63) - algebraic[184] = 1.0*exp((states[0]+75.13)/21.25) - rates[14] = algebraic[183]*(1.0-states[14])-algebraic[184]*states[14] + algebraic[1] = computed_constants[10]*pow(constants[32]/(constants[46]+constants[32]), 3.0)*pow(constants[44]/(constants[45]+constants[44]), 2.0)*1.6/(1.5+exp(-(states[0]+60.0)/40.0)) + algebraic[2] = computed_constants[9]*(pow(constants[32], 3.0)*constants[34]*exp(0.03743*states[0]*constants[33])-pow(constants[35], 3.0)*constants[36]*exp(0.0374*states[0]*(constants[33]-1.0)))/(1.0+constants[37]*(constants[36]*pow(constants[35], 3.0)+constants[34]*pow(constants[32], 3.0))) if eq_func(constants[1], 0.0) else computed_constants[9]*(pow(constants[32], 3.0)*constants[34]*exp(0.03743*states[0]*constants[33])-pow(constants[35], 3.0)*constants[36]*exp(0.03743*states[0]*(constants[33]-1.0)))/(1.0+constants[37]*(constants[36]*pow(constants[35], 3.0)+constants[34]*pow(constants[32], 3.0))) + algebraic[6] = computed_constants[22]*states[14]*(states[0]-computed_constants[6]) if neq_func(constants[1], 2.0) else computed_constants[22]*states[14]*(states[0]+102.0) + algebraic[7] = computed_constants[21]*states[14]*(states[0]-computed_constants[4]) if neq_func(constants[1], 2.0) else computed_constants[21]*states[14]*(states[0]-77.6) + algebraic[8] = computed_constants[20]*pow(states[13], 2.0)*(states[0]-computed_constants[12]) + algebraic[10] = computed_constants[17]*states[8]*(states[0]-computed_constants[6]) + algebraic[11] = computed_constants[16]*states[9]*states[8]*(states[0]-computed_constants[6]) + algebraic[12] = computed_constants[15]*states[7]*states[6]*(states[0]-constants[73]) + algebraic[13] = computed_constants[14]*(states[4]*states[5]+0.006/(1.0+exp(-(states[0]+14.1)/6.0)))*(states[0]-constants[66]) + algebraic[17] = 0.0952*exp(-0.063*(states[0]+34.4))/(1.0+1.66*exp(-0.225*(states[0]+63.7)))+0.0869 if eq_func(constants[1], 0.0) else 0.09518*exp(-0.06306*(states[0]+34.4))/(1.0+1.662*exp(-0.2251*(states[0]+63.7)))+0.08693 + algebraic[14] = (1.0-algebraic[17])*states[2]+algebraic[17]*states[3] + algebraic[0] = computed_constants[13]*pow(states[1], 3.0)*algebraic[14]*constants[35]*pow(constants[7], 2.0)/(constants[5]*constants[6])*(exp((states[0]-computed_constants[4])*constants[7]/(constants[5]*constants[6]))-1.0)/(exp(states[0]*constants[7]/(constants[5]*constants[6]))-1.0)*states[0] + algebraic[3] = computed_constants[5]*(states[0]-computed_constants[6]) + algebraic[4] = computed_constants[7]*(states[0]-computed_constants[8]) + algebraic[5] = computed_constants[3]*(states[0]-computed_constants[4]) + algebraic[42] = 0.6*states[11]+0.4*states[12] + algebraic[9] = computed_constants[18]*algebraic[42]*states[10]*(states[0]-computed_constants[6]) + rates[0] = -1.0/computed_constants[1]*(algebraic[0]+algebraic[13]+algebraic[12]+algebraic[11]+algebraic[10]+algebraic[9]+algebraic[8]+algebraic[7]+algebraic[6]+algebraic[5]+algebraic[4]+algebraic[3]+algebraic[2]+algebraic[1]+computed_constants[2]) + algebraic[15] = pow(1.0/(1.0+exp(-states[0]/5.46)), 1.0/3.0) if eq_func(constants[1], 0.0) else pow(1.0/(1.0+exp(-(states[0]+30.32)/5.46)), 1.0/3.0) + algebraic[16] = 0.0006247/(0.832*exp(-0.335*(states[0]+56.7))+0.627*exp(0.082*(states[0]+65.01)))+4.0e-5 if eq_func(constants[1], 0.0) else 0.0006247/(0.8322166*exp(-0.33566*(states[0]+56.7062))+0.6274*exp(0.0823*(states[0]+65.0131)))+4.569e-5 + rates[1] = (algebraic[15]-states[1])/algebraic[16] + algebraic[18] = 1.0/(1.0+exp((states[0]+66.1)/6.4)) + algebraic[19] = 3.717e-6*exp(-0.2815*(states[0]+17.11))/(1.0+0.003732*exp(-0.3426*(states[0]+37.76)))+0.0005977 + rates[2] = (algebraic[18]-states[2])/algebraic[19] + algebraic[20] = algebraic[18] + algebraic[21] = 3.186e-8*exp(-0.6219*(states[0]+18.8))/(1.0+7.189e-5*exp(-0.6683*(states[0]+34.07)))+0.003556 + rates[3] = (algebraic[20]-states[3])/algebraic[21] + algebraic[22] = 1.0/(1.0+exp(-(states[0]+23.1)/6.0)) if eq_func(constants[1], 0.0) else 1.0/(1.0+exp(-(states[0]+22.3+0.8*computed_constants[0])/6.0)) if eq_func(constants[1], 1.0) else 1.0/(1.0+exp(-(states[0]+22.2)/6.0)) + algebraic[24] = -28.38*(states[0]+35.0)/(exp(-(states[0]+35.0)/2.5)-1.0)-84.9*states[0]/(exp(-0.208*states[0])-1.0) if eq_func(constants[1], 0.0) else -28.39*(states[0]+35.0)/(exp(-(states[0]+35.0)/2.5)-1.0)-84.9*states[0]/(exp(-0.208*states[0])-1.0) if eq_func(constants[1], 1.0) else -28.4*(states[0]+35.0)/(exp(-(states[0]+35.0)/2.5)-1.0)-84.9*states[0]/(exp(-0.208*states[0])-1.0) + algebraic[25] = 11.43*(states[0]-5.0)/(exp(0.4*(states[0]-5.0))-1.0) if eq_func(constants[1], 1.0) else 11.42*(states[0]-5.0)/(exp(0.4*(states[0]-5.0))-1.0) + algebraic[23] = 2.0/(algebraic[24]+algebraic[25]) + rates[5] = (algebraic[22]-states[5])/algebraic[23] + algebraic[26] = 1.0/(1.0+exp((states[0]+45.0)/5.0)) + algebraic[28] = 3.75*(states[0]+28.0)/(exp((states[0]+28.0)/4.0)-1.0) if eq_func(constants[1], 1.0) else 3.12*(states[0]+28.0)/(exp((states[0]+28.0)/4.0)-1.0) + algebraic[29] = 30.0/(1.0+exp(-(states[0]+28.0)/4.0)) if eq_func(constants[1], 1.0) else 25.0/(1.0+exp(-(states[0]+28.0)/4.0)) + algebraic[27] = (1.2-0.2*computed_constants[0])/(algebraic[28]+algebraic[29]) if eq_func(constants[1], 1.0) else 1.0/(algebraic[28]+algebraic[29]) + rates[4] = (algebraic[26]-states[4])/algebraic[27] + algebraic[30] = 1.0/(1.0+exp(-(states[0]+37.0)/6.8)) + algebraic[32] = 1068.0*exp((states[0]+26.3)/30.0) + algebraic[33] = 1068.0*exp(-(states[0]+26.3)/30.0) + algebraic[31] = 1.0/(algebraic[32]+algebraic[33]) + rates[7] = (algebraic[30]-states[7])/algebraic[31] + algebraic[34] = 1.0/(1.0+exp((states[0]+71.0)/9.0)) + algebraic[36] = 15.3*exp(-(states[0]+71.0+0.7*computed_constants[0])/83.3) if eq_func(constants[1], 1.0) else 15.3*exp(-(states[0]+71.7)/83.3) + algebraic[37] = 15.0*exp((states[0]+71.0)/15.38) if eq_func(constants[1], 1.0) else 15.0*exp((states[0]+71.7)/15.38) + algebraic[35] = 1.0/(algebraic[36]+algebraic[37]) + rates[6] = (algebraic[34]-states[6])/algebraic[35] + algebraic[38] = 1.0/(1.0+exp((states[0]+59.37)/13.1)) + algebraic[39] = 0.0101+0.06517/(0.57*exp(-0.08*(states[0]+49.0)))+2.4e-5*exp(0.1*(states[0]+50.93)) if eq_func(constants[1], 0.0) else 0.001/3.0*(30.31+195.5/(0.5686*exp(-0.08161*(states[0]+39.0+10.0*computed_constants[0]))+0.7174*exp((0.2719-0.1719*computed_constants[0])*1.0*(states[0]+40.93+10.0*computed_constants[0])))) if eq_func(constants[1], 1.0) else 0.0101+0.06517/(0.5686*exp(-0.08161*(states[0]+39.0))+0.7174*exp(0.2719*(states[0]+40.93))) + rates[9] = (algebraic[38]-states[9])/algebraic[39] + algebraic[40] = 1.0/(1.0+exp(-(states[0]-10.93)/19.7)) + algebraic[41] = 0.001*(2.98+15.59/(1.037*exp(0.09*(states[0]+30.61))+0.369*exp(-0.12*(states[0]+23.84)))) if eq_func(constants[1], 0.0) else 0.0025*(1.191+7.838/(1.037*exp(0.09012*(states[0]+30.61))+0.369*exp(-0.119*(states[0]+23.84)))) if eq_func(constants[1], 1.0) else 0.001*(2.98+19.59/(1.037*exp(0.09012*(states[0]+30.61))+0.369*exp(-0.119*(states[0]+23.84)))) + rates[8] = (algebraic[40]-states[8])/algebraic[41] + algebraic[43] = 1.0/(1.0+exp(-(states[0]+14.2)/10.6)) if neq_func(constants[1], 2.0) else 1.0/(1.0+exp(-(states[0]+13.2)/10.6)) + algebraic[44] = 1.0/(37.2*exp((states[0]-9.0)/15.9)+0.96*exp(-(states[0]-9.0)/22.5)) if neq_func(constants[1], 2.0) else 1.0/(37.2*exp((states[0]-10.0)/15.9)+0.96*exp(-(states[0]-10.0)/22.5)) + rates[11] = (algebraic[43]-states[11])/algebraic[44] + algebraic[45] = algebraic[43] + algebraic[46] = 1.0/(4.2*exp((states[0]-9.0)/17.0)+0.15*exp(-(states[0]-9.0)/21.6)) if neq_func(constants[1], 2.0) else 1.0/(4.2*exp((states[0]-10.0)/17.0)+0.15*exp(-(states[0]-10.0)/21.6)) + rates[12] = (algebraic[45]-states[12])/algebraic[46] + algebraic[47] = 1.0/(1.0+exp((states[0]+18.6)/10.1)) + rates[10] = (algebraic[47]-states[10])/computed_constants[19] + algebraic[48] = 14.0/(1.0+exp(-(states[0]-40.0)/9.0)) + algebraic[49] = 1.0*exp(-states[0]/45.0) + rates[13] = algebraic[48]*(1.0-states[13])-algebraic[49]*states[13] + algebraic[50] = 1.0*exp(-(states[0]+78.91)/26.62) if eq_func(constants[1], 0.0) else 1.0*exp(-(states[0]+78.91)/26.63) + algebraic[51] = 1.0*exp((states[0]+75.13)/21.25) + rates[14] = algebraic[50]*(1.0-states[14])-algebraic[51]*states[14] def compute_variables(voi, states, rates, constants, computed_constants, algebraic): - algebraic[13] = computed_constants[25]*(states[0]-computed_constants[32]) - algebraic[11] = computed_constants[33]*(states[0]-computed_constants[40]) - algebraic[12] = computed_constants[41]*(states[0]-computed_constants[48]) - algebraic[10] = computed_constants[49]*(pow(constants[56], 3.0)*constants[58]*exp(0.03743*states[0]*constants[57])-pow(constants[59], 3.0)*constants[60]*exp(0.0374*states[0]*(constants[57]-1.0)))/(1.0+constants[61]*(constants[60]*pow(constants[59], 3.0)+constants[58]*pow(constants[56], 3.0))) if eq_func(constants[2], 0.0) else computed_constants[49]*(pow(constants[56], 3.0)*constants[58]*exp(0.03743*states[0]*constants[57])-pow(constants[59], 3.0)*constants[60]*exp(0.03743*states[0]*(constants[57]-1.0)))/(1.0+constants[61]*(constants[60]*pow(constants[59], 3.0)+constants[58]*pow(constants[56], 3.0))) - algebraic[9] = computed_constants[62]*pow(constants[56]/(constants[71]+constants[56]), 3.0)*pow(constants[69]/(constants[70]+constants[69]), 2.0)*1.6/(1.5+exp(-(states[0]+60.0)/40.0)) - algebraic[91] = 0.0952*exp(-0.063*(states[0]+34.4))/(1.0+1.66*exp(-0.225*(states[0]+63.7)))+0.0869 if eq_func(constants[2], 0.0) else 0.09518*exp(-0.06306*(states[0]+34.4))/(1.0+1.662*exp(-0.2251*(states[0]+63.7)))+0.08693 - algebraic[88] = (1.0-algebraic[91])*states[2]+algebraic[91]*states[3] - algebraic[7] = computed_constants[81]*pow(states[1], 3.0)*algebraic[88]*constants[59]*pow(constants[24], 2.0)/(constants[22]*constants[23])*(exp((states[0]-computed_constants[32])*constants[24]/(constants[22]*constants[23]))-1.0)/(exp(states[0]*constants[24]/(constants[22]*constants[23]))-1.0)*states[0] - algebraic[89] = pow(1.0/(1.0+exp(-states[0]/5.46)), 1.0/3.0) if eq_func(constants[2], 0.0) else pow(1.0/(1.0+exp(-(states[0]+30.32)/5.46)), 1.0/3.0) - algebraic[90] = 0.0006247/(0.832*exp(-0.335*(states[0]+56.7))+0.627*exp(0.082*(states[0]+65.01)))+4.0e-5 if eq_func(constants[2], 0.0) else 0.0006247/(0.8322166*exp(-0.33566*(states[0]+56.7062))+0.6274*exp(0.0823*(states[0]+65.0131)))+4.569e-5 - algebraic[92] = 1.0/(1.0+exp((states[0]+66.1)/6.4)) - algebraic[94] = algebraic[92] - algebraic[93] = 3.717e-6*exp(-0.2815*(states[0]+17.11))/(1.0+0.003732*exp(-0.3426*(states[0]+37.76)))+0.0005977 - algebraic[95] = 3.186e-8*exp(-0.6219*(states[0]+18.8))/(1.0+7.189e-5*exp(-0.6683*(states[0]+34.07)))+0.003556 - algebraic[21] = computed_constants[96]*(states[4]*states[5]+0.006/(1.0+exp(-(states[0]+14.1)/6.0)))*(states[0]-constants[103]) - algebraic[106] = -28.38*(states[0]+35.0)/(exp(-(states[0]+35.0)/2.5)-1.0)-84.9*states[0]/(exp(-0.208*states[0])-1.0) if eq_func(constants[2], 0.0) else -28.39*(states[0]+35.0)/(exp(-(states[0]+35.0)/2.5)-1.0)-84.9*states[0]/(exp(-0.208*states[0])-1.0) if eq_func(constants[2], 1.0) else -28.4*(states[0]+35.0)/(exp(-(states[0]+35.0)/2.5)-1.0)-84.9*states[0]/(exp(-0.208*states[0])-1.0) - algebraic[107] = 11.43*(states[0]-5.0)/(exp(0.4*(states[0]-5.0))-1.0) if eq_func(constants[2], 1.0) else 11.42*(states[0]-5.0)/(exp(0.4*(states[0]-5.0))-1.0) - algebraic[105] = 2.0/(algebraic[106]+algebraic[107]) - algebraic[104] = 1.0/(1.0+exp(-(states[0]+23.1)/6.0)) if eq_func(constants[2], 0.0) else 1.0/(1.0+exp(-(states[0]+22.3+0.8*computed_constants[0])/6.0)) if eq_func(constants[2], 1.0) else 1.0/(1.0+exp(-(states[0]+22.2)/6.0)) - algebraic[110] = 3.75*(states[0]+28.0)/(exp((states[0]+28.0)/4.0)-1.0) if eq_func(constants[2], 1.0) else 3.12*(states[0]+28.0)/(exp((states[0]+28.0)/4.0)-1.0) - algebraic[111] = 30.0/(1.0+exp(-(states[0]+28.0)/4.0)) if eq_func(constants[2], 1.0) else 25.0/(1.0+exp(-(states[0]+28.0)/4.0)) - algebraic[109] = (1.2-0.2*computed_constants[0])/(algebraic[110]+algebraic[111]) if eq_func(constants[2], 1.0) else 1.0/(algebraic[110]+algebraic[111]) - algebraic[108] = 1.0/(1.0+exp((states[0]+45.0)/5.0)) - algebraic[20] = computed_constants[112]*states[7]*states[6]*(states[0]-constants[119]) - algebraic[122] = 1068.0*exp((states[0]+26.3)/30.0) - algebraic[123] = 1068.0*exp(-(states[0]+26.3)/30.0) - algebraic[121] = 1.0/(algebraic[122]+algebraic[123]) - algebraic[120] = 1.0/(1.0+exp(-(states[0]+37.0)/6.8)) - algebraic[126] = 15.3*exp(-(states[0]+71.0+0.7*computed_constants[0])/83.3) if eq_func(constants[2], 1.0) else 15.3*exp(-(states[0]+71.7)/83.3) - algebraic[127] = 15.0*exp((states[0]+71.0)/15.38) if eq_func(constants[2], 1.0) else 15.0*exp((states[0]+71.7)/15.38) - algebraic[125] = 1.0/(algebraic[126]+algebraic[127]) - algebraic[124] = 1.0/(1.0+exp((states[0]+71.0)/9.0)) - algebraic[19] = computed_constants[128]*states[9]*states[8]*(states[0]-computed_constants[40]) - algebraic[18] = computed_constants[135]*states[8]*(states[0]-computed_constants[40]) - algebraic[142] = 1.0/(1.0+exp((states[0]+59.37)/13.1)) - algebraic[143] = 0.0101+0.06517/(0.57*exp(-0.08*(states[0]+49.0)))+2.4e-5*exp(0.1*(states[0]+50.93)) if eq_func(constants[2], 0.0) else 0.001/3.0*(30.31+195.5/(0.5686*exp(-0.08161*(states[0]+39.0+10.0*computed_constants[0]))+0.7174*exp((0.2719-0.1719*computed_constants[0])*1.0*(states[0]+40.93+10.0*computed_constants[0])))) if eq_func(constants[2], 1.0) else 0.0101+0.06517/(0.5686*exp(-0.08161*(states[0]+39.0))+0.7174*exp(0.2719*(states[0]+40.93))) - algebraic[144] = 1.0/(1.0+exp(-(states[0]-10.93)/19.7)) - algebraic[145] = 0.001*(2.98+15.59/(1.037*exp(0.09*(states[0]+30.61))+0.369*exp(-0.12*(states[0]+23.84)))) if eq_func(constants[2], 0.0) else 0.0025*(1.191+7.838/(1.037*exp(0.09012*(states[0]+30.61))+0.369*exp(-0.119*(states[0]+23.84)))) if eq_func(constants[2], 1.0) else 0.001*(2.98+19.59/(1.037*exp(0.09012*(states[0]+30.61))+0.369*exp(-0.119*(states[0]+23.84)))) - algebraic[153] = 0.6*states[11]+0.4*states[12] - algebraic[17] = computed_constants[146]*algebraic[153]*states[10]*(states[0]-computed_constants[40]) - algebraic[154] = 1.0/(1.0+exp(-(states[0]+14.2)/10.6)) if neq_func(constants[2], 2.0) else 1.0/(1.0+exp(-(states[0]+13.2)/10.6)) - algebraic[155] = 1.0/(37.2*exp((states[0]-9.0)/15.9)+0.96*exp(-(states[0]-9.0)/22.5)) if neq_func(constants[2], 2.0) else 1.0/(37.2*exp((states[0]-10.0)/15.9)+0.96*exp(-(states[0]-10.0)/22.5)) - algebraic[156] = algebraic[154] - algebraic[157] = 1.0/(4.2*exp((states[0]-9.0)/17.0)+0.15*exp(-(states[0]-9.0)/21.6)) if neq_func(constants[2], 2.0) else 1.0/(4.2*exp((states[0]-10.0)/17.0)+0.15*exp(-(states[0]-10.0)/21.6)) - algebraic[159] = 1.0/(1.0+exp((states[0]+18.6)/10.1)) - algebraic[16] = computed_constants[160]*pow(states[13], 2.0)*(states[0]-computed_constants[80]) - algebraic[167] = 14.0/(1.0+exp(-(states[0]-40.0)/9.0)) - algebraic[168] = 1.0*exp(-states[0]/45.0) - algebraic[15] = computed_constants[169]*states[14]*(states[0]-computed_constants[32]) if neq_func(constants[2], 2.0) else computed_constants[169]*states[14]*(states[0]-77.6) - algebraic[14] = computed_constants[176]*states[14]*(states[0]-computed_constants[40]) if neq_func(constants[2], 2.0) else computed_constants[176]*states[14]*(states[0]+102.0) - algebraic[183] = 1.0*exp(-(states[0]+78.91)/26.62) if eq_func(constants[2], 0.0) else 1.0*exp(-(states[0]+78.91)/26.63) - algebraic[184] = 1.0*exp((states[0]+75.13)/21.25) + algebraic[5] = computed_constants[3]*(states[0]-computed_constants[4]) + algebraic[3] = computed_constants[5]*(states[0]-computed_constants[6]) + algebraic[4] = computed_constants[7]*(states[0]-computed_constants[8]) + algebraic[2] = computed_constants[9]*(pow(constants[32], 3.0)*constants[34]*exp(0.03743*states[0]*constants[33])-pow(constants[35], 3.0)*constants[36]*exp(0.0374*states[0]*(constants[33]-1.0)))/(1.0+constants[37]*(constants[36]*pow(constants[35], 3.0)+constants[34]*pow(constants[32], 3.0))) if eq_func(constants[1], 0.0) else computed_constants[9]*(pow(constants[32], 3.0)*constants[34]*exp(0.03743*states[0]*constants[33])-pow(constants[35], 3.0)*constants[36]*exp(0.03743*states[0]*(constants[33]-1.0)))/(1.0+constants[37]*(constants[36]*pow(constants[35], 3.0)+constants[34]*pow(constants[32], 3.0))) + algebraic[1] = computed_constants[10]*pow(constants[32]/(constants[46]+constants[32]), 3.0)*pow(constants[44]/(constants[45]+constants[44]), 2.0)*1.6/(1.5+exp(-(states[0]+60.0)/40.0)) + algebraic[17] = 0.0952*exp(-0.063*(states[0]+34.4))/(1.0+1.66*exp(-0.225*(states[0]+63.7)))+0.0869 if eq_func(constants[1], 0.0) else 0.09518*exp(-0.06306*(states[0]+34.4))/(1.0+1.662*exp(-0.2251*(states[0]+63.7)))+0.08693 + algebraic[14] = (1.0-algebraic[17])*states[2]+algebraic[17]*states[3] + algebraic[0] = computed_constants[13]*pow(states[1], 3.0)*algebraic[14]*constants[35]*pow(constants[7], 2.0)/(constants[5]*constants[6])*(exp((states[0]-computed_constants[4])*constants[7]/(constants[5]*constants[6]))-1.0)/(exp(states[0]*constants[7]/(constants[5]*constants[6]))-1.0)*states[0] + algebraic[15] = pow(1.0/(1.0+exp(-states[0]/5.46)), 1.0/3.0) if eq_func(constants[1], 0.0) else pow(1.0/(1.0+exp(-(states[0]+30.32)/5.46)), 1.0/3.0) + algebraic[16] = 0.0006247/(0.832*exp(-0.335*(states[0]+56.7))+0.627*exp(0.082*(states[0]+65.01)))+4.0e-5 if eq_func(constants[1], 0.0) else 0.0006247/(0.8322166*exp(-0.33566*(states[0]+56.7062))+0.6274*exp(0.0823*(states[0]+65.0131)))+4.569e-5 + algebraic[18] = 1.0/(1.0+exp((states[0]+66.1)/6.4)) + algebraic[20] = algebraic[18] + algebraic[19] = 3.717e-6*exp(-0.2815*(states[0]+17.11))/(1.0+0.003732*exp(-0.3426*(states[0]+37.76)))+0.0005977 + algebraic[21] = 3.186e-8*exp(-0.6219*(states[0]+18.8))/(1.0+7.189e-5*exp(-0.6683*(states[0]+34.07)))+0.003556 + algebraic[13] = computed_constants[14]*(states[4]*states[5]+0.006/(1.0+exp(-(states[0]+14.1)/6.0)))*(states[0]-constants[66]) + algebraic[24] = -28.38*(states[0]+35.0)/(exp(-(states[0]+35.0)/2.5)-1.0)-84.9*states[0]/(exp(-0.208*states[0])-1.0) if eq_func(constants[1], 0.0) else -28.39*(states[0]+35.0)/(exp(-(states[0]+35.0)/2.5)-1.0)-84.9*states[0]/(exp(-0.208*states[0])-1.0) if eq_func(constants[1], 1.0) else -28.4*(states[0]+35.0)/(exp(-(states[0]+35.0)/2.5)-1.0)-84.9*states[0]/(exp(-0.208*states[0])-1.0) + algebraic[25] = 11.43*(states[0]-5.0)/(exp(0.4*(states[0]-5.0))-1.0) if eq_func(constants[1], 1.0) else 11.42*(states[0]-5.0)/(exp(0.4*(states[0]-5.0))-1.0) + algebraic[23] = 2.0/(algebraic[24]+algebraic[25]) + algebraic[22] = 1.0/(1.0+exp(-(states[0]+23.1)/6.0)) if eq_func(constants[1], 0.0) else 1.0/(1.0+exp(-(states[0]+22.3+0.8*computed_constants[0])/6.0)) if eq_func(constants[1], 1.0) else 1.0/(1.0+exp(-(states[0]+22.2)/6.0)) + algebraic[28] = 3.75*(states[0]+28.0)/(exp((states[0]+28.0)/4.0)-1.0) if eq_func(constants[1], 1.0) else 3.12*(states[0]+28.0)/(exp((states[0]+28.0)/4.0)-1.0) + algebraic[29] = 30.0/(1.0+exp(-(states[0]+28.0)/4.0)) if eq_func(constants[1], 1.0) else 25.0/(1.0+exp(-(states[0]+28.0)/4.0)) + algebraic[27] = (1.2-0.2*computed_constants[0])/(algebraic[28]+algebraic[29]) if eq_func(constants[1], 1.0) else 1.0/(algebraic[28]+algebraic[29]) + algebraic[26] = 1.0/(1.0+exp((states[0]+45.0)/5.0)) + algebraic[12] = computed_constants[15]*states[7]*states[6]*(states[0]-constants[73]) + algebraic[32] = 1068.0*exp((states[0]+26.3)/30.0) + algebraic[33] = 1068.0*exp(-(states[0]+26.3)/30.0) + algebraic[31] = 1.0/(algebraic[32]+algebraic[33]) + algebraic[30] = 1.0/(1.0+exp(-(states[0]+37.0)/6.8)) + algebraic[36] = 15.3*exp(-(states[0]+71.0+0.7*computed_constants[0])/83.3) if eq_func(constants[1], 1.0) else 15.3*exp(-(states[0]+71.7)/83.3) + algebraic[37] = 15.0*exp((states[0]+71.0)/15.38) if eq_func(constants[1], 1.0) else 15.0*exp((states[0]+71.7)/15.38) + algebraic[35] = 1.0/(algebraic[36]+algebraic[37]) + algebraic[34] = 1.0/(1.0+exp((states[0]+71.0)/9.0)) + algebraic[11] = computed_constants[16]*states[9]*states[8]*(states[0]-computed_constants[6]) + algebraic[10] = computed_constants[17]*states[8]*(states[0]-computed_constants[6]) + algebraic[38] = 1.0/(1.0+exp((states[0]+59.37)/13.1)) + algebraic[39] = 0.0101+0.06517/(0.57*exp(-0.08*(states[0]+49.0)))+2.4e-5*exp(0.1*(states[0]+50.93)) if eq_func(constants[1], 0.0) else 0.001/3.0*(30.31+195.5/(0.5686*exp(-0.08161*(states[0]+39.0+10.0*computed_constants[0]))+0.7174*exp((0.2719-0.1719*computed_constants[0])*1.0*(states[0]+40.93+10.0*computed_constants[0])))) if eq_func(constants[1], 1.0) else 0.0101+0.06517/(0.5686*exp(-0.08161*(states[0]+39.0))+0.7174*exp(0.2719*(states[0]+40.93))) + algebraic[40] = 1.0/(1.0+exp(-(states[0]-10.93)/19.7)) + algebraic[41] = 0.001*(2.98+15.59/(1.037*exp(0.09*(states[0]+30.61))+0.369*exp(-0.12*(states[0]+23.84)))) if eq_func(constants[1], 0.0) else 0.0025*(1.191+7.838/(1.037*exp(0.09012*(states[0]+30.61))+0.369*exp(-0.119*(states[0]+23.84)))) if eq_func(constants[1], 1.0) else 0.001*(2.98+19.59/(1.037*exp(0.09012*(states[0]+30.61))+0.369*exp(-0.119*(states[0]+23.84)))) + algebraic[42] = 0.6*states[11]+0.4*states[12] + algebraic[9] = computed_constants[18]*algebraic[42]*states[10]*(states[0]-computed_constants[6]) + algebraic[43] = 1.0/(1.0+exp(-(states[0]+14.2)/10.6)) if neq_func(constants[1], 2.0) else 1.0/(1.0+exp(-(states[0]+13.2)/10.6)) + algebraic[44] = 1.0/(37.2*exp((states[0]-9.0)/15.9)+0.96*exp(-(states[0]-9.0)/22.5)) if neq_func(constants[1], 2.0) else 1.0/(37.2*exp((states[0]-10.0)/15.9)+0.96*exp(-(states[0]-10.0)/22.5)) + algebraic[45] = algebraic[43] + algebraic[46] = 1.0/(4.2*exp((states[0]-9.0)/17.0)+0.15*exp(-(states[0]-9.0)/21.6)) if neq_func(constants[1], 2.0) else 1.0/(4.2*exp((states[0]-10.0)/17.0)+0.15*exp(-(states[0]-10.0)/21.6)) + algebraic[47] = 1.0/(1.0+exp((states[0]+18.6)/10.1)) + algebraic[8] = computed_constants[20]*pow(states[13], 2.0)*(states[0]-computed_constants[12]) + algebraic[48] = 14.0/(1.0+exp(-(states[0]-40.0)/9.0)) + algebraic[49] = 1.0*exp(-states[0]/45.0) + algebraic[7] = computed_constants[21]*states[14]*(states[0]-computed_constants[4]) if neq_func(constants[1], 2.0) else computed_constants[21]*states[14]*(states[0]-77.6) + algebraic[6] = computed_constants[22]*states[14]*(states[0]-computed_constants[6]) if neq_func(constants[1], 2.0) else computed_constants[22]*states[14]*(states[0]+102.0) + algebraic[50] = 1.0*exp(-(states[0]+78.91)/26.62) if eq_func(constants[1], 0.0) else 1.0*exp(-(states[0]+78.91)/26.63) + algebraic[51] = 1.0*exp((states[0]+75.13)/21.25) diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.algebraic.c b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.algebraic.c index df6f7da7ae..fd4eb1dfc8 100644 --- a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.algebraic.c +++ b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.algebraic.c @@ -72,11 +72,11 @@ void deleteArray(double *array) void initialiseVariables(double voi, double *states, double *rates, double *constants, ExternalVariable externalVariable) { - constants[4] = 1.0; - constants[5] = 0.0; - constants[7] = 0.3; - constants[9] = 120.0; - constants[15] = 36.0; + constants[0] = 1.0; + constants[1] = 0.0; + constants[2] = 0.3; + constants[3] = 120.0; + constants[4] = 36.0; states[0] = 0.0; states[1] = 0.6; states[2] = 0.05; @@ -86,39 +86,39 @@ void initialiseVariables(double voi, double *states, double *rates, double *cons void computeComputedConstants(double *constants, double *computedConstants) { - computedConstants[6] = constants[5]-10.613; - computedConstants[8] = constants[5]-115.0; - computedConstants[14] = constants[5]+12.0; + computedConstants[0] = constants[1]-10.613; + computedConstants[1] = constants[1]-115.0; + computedConstants[2] = constants[1]+12.0; } void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { algebraic[0] = externalVariable(voi, states, rates, variables, 0); - algebraic[1] = constants[7]*(states[0]-computedConstants[6]); - algebraic[2] = constants[15]*pow(states[3], 4.0)*(states[0]-computedConstants[14]); - algebraic[3] = constants[9]*pow(states[2], 3.0)*states[1]*(states[0]-computedConstants[8]); - rates[0] = -(-algebraic[0]+algebraic[3]+algebraic[2]+algebraic[1])/constants[4]; - algebraic[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0); - algebraic[11] = 4.0*exp(states[0]/18.0); - rates[2] = algebraic[10]*(1.0-states[2])-algebraic[11]*states[2]; - algebraic[12] = 0.07*exp(states[0]/20.0); - algebraic[13] = 1.0/(exp((states[0]+30.0)/10.0)+1.0); - rates[1] = algebraic[12]*(1.0-states[1])-algebraic[13]*states[1]; - algebraic[16] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0); - algebraic[17] = 0.125*exp(states[0]/80.0); - rates[3] = algebraic[16]*(1.0-states[3])-algebraic[17]*states[3]; + algebraic[1] = constants[2]*(states[0]-computedConstants[0]); + algebraic[2] = constants[4]*pow(states[3], 4.0)*(states[0]-computedConstants[2]); + algebraic[3] = constants[3]*pow(states[2], 3.0)*states[1]*(states[0]-computedConstants[1]); + rates[0] = -(-algebraic[0]+algebraic[3]+algebraic[2]+algebraic[1])/constants[0]; + algebraic[4] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0); + algebraic[5] = 4.0*exp(states[0]/18.0); + rates[2] = algebraic[4]*(1.0-states[2])-algebraic[5]*states[2]; + algebraic[6] = 0.07*exp(states[0]/20.0); + algebraic[7] = 1.0/(exp((states[0]+30.0)/10.0)+1.0); + rates[1] = algebraic[6]*(1.0-states[1])-algebraic[7]*states[1]; + algebraic[8] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0); + algebraic[9] = 0.125*exp(states[0]/80.0); + rates[3] = algebraic[8]*(1.0-states[3])-algebraic[9]*states[3]; } void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { algebraic[0] = externalVariable(voi, states, rates, variables, 0); - algebraic[1] = constants[7]*(states[0]-computedConstants[6]); - algebraic[3] = constants[9]*pow(states[2], 3.0)*states[1]*(states[0]-computedConstants[8]); - algebraic[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0); - algebraic[11] = 4.0*exp(states[0]/18.0); - algebraic[12] = 0.07*exp(states[0]/20.0); - algebraic[13] = 1.0/(exp((states[0]+30.0)/10.0)+1.0); - algebraic[2] = constants[15]*pow(states[3], 4.0)*(states[0]-computedConstants[14]); - algebraic[16] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0); - algebraic[17] = 0.125*exp(states[0]/80.0); + algebraic[1] = constants[2]*(states[0]-computedConstants[0]); + algebraic[3] = constants[3]*pow(states[2], 3.0)*states[1]*(states[0]-computedConstants[1]); + algebraic[4] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0); + algebraic[5] = 4.0*exp(states[0]/18.0); + algebraic[6] = 0.07*exp(states[0]/20.0); + algebraic[7] = 1.0/(exp((states[0]+30.0)/10.0)+1.0); + algebraic[2] = constants[4]*pow(states[3], 4.0)*(states[0]-computedConstants[2]); + algebraic[8] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0); + algebraic[9] = 0.125*exp(states[0]/80.0); } diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.algebraic.py b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.algebraic.py index e287d4bc52..9b752f340f 100644 --- a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.algebraic.py +++ b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.algebraic.py @@ -74,11 +74,11 @@ def create_variables_array(): def initialise_variables(voi, states, rates, constants, external_variable): - constants[4] = 1.0 - constants[5] = 0.0 - constants[7] = 0.3 - constants[9] = 120.0 - constants[15] = 36.0 + constants[0] = 1.0 + constants[1] = 0.0 + constants[2] = 0.3 + constants[3] = 120.0 + constants[4] = 36.0 states[0] = 0.0 states[1] = 0.6 states[2] = 0.05 @@ -87,36 +87,36 @@ def initialise_variables(voi, states, rates, constants, external_variable): def compute_computed_constants(constants, computed_constants): - computed_constants[6] = constants[5]-10.613 - computed_constants[8] = constants[5]-115.0 - computed_constants[14] = constants[5]+12.0 + computed_constants[0] = constants[1]-10.613 + computed_constants[1] = constants[1]-115.0 + computed_constants[2] = constants[1]+12.0 def compute_rates(voi, states, rates, constants, computed_constants, algebraic, external_variable): algebraic[0] = external_variable(voi, states, rates, variables, 0) - algebraic[1] = constants[7]*(states[0]-computed_constants[6]) - algebraic[2] = constants[15]*pow(states[3], 4.0)*(states[0]-computed_constants[14]) - algebraic[3] = constants[9]*pow(states[2], 3.0)*states[1]*(states[0]-computed_constants[8]) - rates[0] = -(-algebraic[0]+algebraic[3]+algebraic[2]+algebraic[1])/constants[4] - algebraic[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0) - algebraic[11] = 4.0*exp(states[0]/18.0) - rates[2] = algebraic[10]*(1.0-states[2])-algebraic[11]*states[2] - algebraic[12] = 0.07*exp(states[0]/20.0) - algebraic[13] = 1.0/(exp((states[0]+30.0)/10.0)+1.0) - rates[1] = algebraic[12]*(1.0-states[1])-algebraic[13]*states[1] - algebraic[16] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0) - algebraic[17] = 0.125*exp(states[0]/80.0) - rates[3] = algebraic[16]*(1.0-states[3])-algebraic[17]*states[3] + algebraic[1] = constants[2]*(states[0]-computed_constants[0]) + algebraic[2] = constants[4]*pow(states[3], 4.0)*(states[0]-computed_constants[2]) + algebraic[3] = constants[3]*pow(states[2], 3.0)*states[1]*(states[0]-computed_constants[1]) + rates[0] = -(-algebraic[0]+algebraic[3]+algebraic[2]+algebraic[1])/constants[0] + algebraic[4] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0) + algebraic[5] = 4.0*exp(states[0]/18.0) + rates[2] = algebraic[4]*(1.0-states[2])-algebraic[5]*states[2] + algebraic[6] = 0.07*exp(states[0]/20.0) + algebraic[7] = 1.0/(exp((states[0]+30.0)/10.0)+1.0) + rates[1] = algebraic[6]*(1.0-states[1])-algebraic[7]*states[1] + algebraic[8] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0) + algebraic[9] = 0.125*exp(states[0]/80.0) + rates[3] = algebraic[8]*(1.0-states[3])-algebraic[9]*states[3] def compute_variables(voi, states, rates, constants, computed_constants, algebraic, external_variable): algebraic[0] = external_variable(voi, states, rates, variables, 0) - algebraic[1] = constants[7]*(states[0]-computed_constants[6]) - algebraic[3] = constants[9]*pow(states[2], 3.0)*states[1]*(states[0]-computed_constants[8]) - algebraic[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0) - algebraic[11] = 4.0*exp(states[0]/18.0) - algebraic[12] = 0.07*exp(states[0]/20.0) - algebraic[13] = 1.0/(exp((states[0]+30.0)/10.0)+1.0) - algebraic[2] = constants[15]*pow(states[3], 4.0)*(states[0]-computed_constants[14]) - algebraic[16] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0) - algebraic[17] = 0.125*exp(states[0]/80.0) + algebraic[1] = constants[2]*(states[0]-computed_constants[0]) + algebraic[3] = constants[3]*pow(states[2], 3.0)*states[1]*(states[0]-computed_constants[1]) + algebraic[4] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0) + algebraic[5] = 4.0*exp(states[0]/18.0) + algebraic[6] = 0.07*exp(states[0]/20.0) + algebraic[7] = 1.0/(exp((states[0]+30.0)/10.0)+1.0) + algebraic[2] = constants[4]*pow(states[3], 4.0)*(states[0]-computed_constants[2]) + algebraic[8] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0) + algebraic[9] = 0.125*exp(states[0]/80.0) diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.c b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.c index 0c24c18ef4..33d70c70cc 100644 --- a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.c +++ b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.c @@ -72,11 +72,11 @@ void deleteArray(double *array) void initialiseVariables(double *states, double *rates, double *constants) { - constants[4] = 1.0; - constants[5] = 0.0; - constants[7] = 0.3; - constants[9] = 120.0; - constants[15] = 36.0; + constants[0] = 1.0; + constants[1] = 0.0; + constants[2] = 0.3; + constants[3] = 120.0; + constants[4] = 36.0; states[0] = 0.0; states[1] = 0.6; states[2] = 0.05; @@ -85,38 +85,38 @@ void initialiseVariables(double *states, double *rates, double *constants) void computeComputedConstants(double *constants, double *computedConstants) { - computedConstants[6] = constants[5]-10.613; - computedConstants[8] = constants[5]-115.0; - computedConstants[14] = constants[5]+12.0; + computedConstants[0] = constants[1]-10.613; + computedConstants[1] = constants[1]-115.0; + computedConstants[2] = constants[1]+12.0; } void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic) { algebraic[0] = ((voi >= 10.0) && (voi <= 10.5))?-20.0:0.0; - algebraic[1] = constants[7]*(states[0]-computedConstants[6]); - algebraic[2] = constants[15]*pow(states[3], 4.0)*(states[0]-computedConstants[14]); - algebraic[3] = constants[9]*pow(states[2], 3.0)*states[1]*(states[0]-computedConstants[8]); - rates[0] = -(-algebraic[0]+algebraic[3]+algebraic[2]+algebraic[1])/constants[4]; - algebraic[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0); - algebraic[11] = 4.0*exp(states[0]/18.0); - rates[2] = algebraic[10]*(1.0-states[2])-algebraic[11]*states[2]; - algebraic[12] = 0.07*exp(states[0]/20.0); - algebraic[13] = 1.0/(exp((states[0]+30.0)/10.0)+1.0); - rates[1] = algebraic[12]*(1.0-states[1])-algebraic[13]*states[1]; - algebraic[16] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0); - algebraic[17] = 0.125*exp(states[0]/80.0); - rates[3] = algebraic[16]*(1.0-states[3])-algebraic[17]*states[3]; + algebraic[1] = constants[2]*(states[0]-computedConstants[0]); + algebraic[2] = constants[4]*pow(states[3], 4.0)*(states[0]-computedConstants[2]); + algebraic[3] = constants[3]*pow(states[2], 3.0)*states[1]*(states[0]-computedConstants[1]); + rates[0] = -(-algebraic[0]+algebraic[3]+algebraic[2]+algebraic[1])/constants[0]; + algebraic[4] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0); + algebraic[5] = 4.0*exp(states[0]/18.0); + rates[2] = algebraic[4]*(1.0-states[2])-algebraic[5]*states[2]; + algebraic[6] = 0.07*exp(states[0]/20.0); + algebraic[7] = 1.0/(exp((states[0]+30.0)/10.0)+1.0); + rates[1] = algebraic[6]*(1.0-states[1])-algebraic[7]*states[1]; + algebraic[8] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0); + algebraic[9] = 0.125*exp(states[0]/80.0); + rates[3] = algebraic[8]*(1.0-states[3])-algebraic[9]*states[3]; } void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic) { - algebraic[1] = constants[7]*(states[0]-computedConstants[6]); - algebraic[3] = constants[9]*pow(states[2], 3.0)*states[1]*(states[0]-computedConstants[8]); - algebraic[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0); - algebraic[11] = 4.0*exp(states[0]/18.0); - algebraic[12] = 0.07*exp(states[0]/20.0); - algebraic[13] = 1.0/(exp((states[0]+30.0)/10.0)+1.0); - algebraic[2] = constants[15]*pow(states[3], 4.0)*(states[0]-computedConstants[14]); - algebraic[16] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0); - algebraic[17] = 0.125*exp(states[0]/80.0); + algebraic[1] = constants[2]*(states[0]-computedConstants[0]); + algebraic[3] = constants[3]*pow(states[2], 3.0)*states[1]*(states[0]-computedConstants[1]); + algebraic[4] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0); + algebraic[5] = 4.0*exp(states[0]/18.0); + algebraic[6] = 0.07*exp(states[0]/20.0); + algebraic[7] = 1.0/(exp((states[0]+30.0)/10.0)+1.0); + algebraic[2] = constants[4]*pow(states[3], 4.0)*(states[0]-computedConstants[2]); + algebraic[8] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0); + algebraic[9] = 0.125*exp(states[0]/80.0); } diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.computed.constant.c b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.computed.constant.c index bf291e2fb4..4dd1a09a6e 100644 --- a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.computed.constant.c +++ b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.computed.constant.c @@ -72,53 +72,53 @@ void deleteArray(double *array) void initialiseVariables(double voi, double *states, double *rates, double *constants, ExternalVariable externalVariable) { - constants[4] = 1.0; - constants[5] = 0.0; - constants[7] = 0.3; - constants[9] = 120.0; - constants[15] = 36.0; + constants[0] = 1.0; + constants[1] = 0.0; + constants[2] = 0.3; + constants[3] = 120.0; + constants[4] = 36.0; states[0] = 0.0; states[1] = 0.6; states[2] = 0.05; states[3] = 0.325; - algebraic[6] = externalVariable(voi, states, rates, variables, 6); + algebraic[4] = externalVariable(voi, states, rates, variables, 4); } void computeComputedConstants(double *constants, double *computedConstants) { - computedConstants[8] = constants[5]-115.0; - computedConstants[14] = constants[5]+12.0; + computedConstants[0] = constants[1]-115.0; + computedConstants[1] = constants[1]+12.0; } void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { algebraic[0] = ((voi >= 10.0) && (voi <= 10.5))?-20.0:0.0; - algebraic[6] = externalVariable(voi, states, rates, variables, 6); - algebraic[1] = constants[7]*(states[0]-algebraic[6]); - algebraic[2] = constants[15]*pow(states[3], 4.0)*(states[0]-computedConstants[14]); - algebraic[3] = constants[9]*pow(states[2], 3.0)*states[1]*(states[0]-computedConstants[8]); - rates[0] = -(-algebraic[0]+algebraic[3]+algebraic[2]+algebraic[1])/constants[4]; - algebraic[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0); - algebraic[11] = 4.0*exp(states[0]/18.0); - rates[2] = algebraic[10]*(1.0-states[2])-algebraic[11]*states[2]; - algebraic[12] = 0.07*exp(states[0]/20.0); - algebraic[13] = 1.0/(exp((states[0]+30.0)/10.0)+1.0); - rates[1] = algebraic[12]*(1.0-states[1])-algebraic[13]*states[1]; - algebraic[16] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0); - algebraic[17] = 0.125*exp(states[0]/80.0); - rates[3] = algebraic[16]*(1.0-states[3])-algebraic[17]*states[3]; + algebraic[4] = externalVariable(voi, states, rates, variables, 4); + algebraic[1] = constants[2]*(states[0]-algebraic[4]); + algebraic[2] = constants[4]*pow(states[3], 4.0)*(states[0]-computedConstants[1]); + algebraic[3] = constants[3]*pow(states[2], 3.0)*states[1]*(states[0]-computedConstants[0]); + rates[0] = -(-algebraic[0]+algebraic[3]+algebraic[2]+algebraic[1])/constants[0]; + algebraic[5] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0); + algebraic[6] = 4.0*exp(states[0]/18.0); + rates[2] = algebraic[5]*(1.0-states[2])-algebraic[6]*states[2]; + algebraic[7] = 0.07*exp(states[0]/20.0); + algebraic[8] = 1.0/(exp((states[0]+30.0)/10.0)+1.0); + rates[1] = algebraic[7]*(1.0-states[1])-algebraic[8]*states[1]; + algebraic[9] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0); + algebraic[10] = 0.125*exp(states[0]/80.0); + rates[3] = algebraic[9]*(1.0-states[3])-algebraic[10]*states[3]; } void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { - algebraic[6] = externalVariable(voi, states, rates, variables, 6); - algebraic[1] = constants[7]*(states[0]-algebraic[6]); - algebraic[3] = constants[9]*pow(states[2], 3.0)*states[1]*(states[0]-computedConstants[8]); - algebraic[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0); - algebraic[11] = 4.0*exp(states[0]/18.0); - algebraic[12] = 0.07*exp(states[0]/20.0); - algebraic[13] = 1.0/(exp((states[0]+30.0)/10.0)+1.0); - algebraic[2] = constants[15]*pow(states[3], 4.0)*(states[0]-computedConstants[14]); - algebraic[16] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0); - algebraic[17] = 0.125*exp(states[0]/80.0); + algebraic[4] = externalVariable(voi, states, rates, variables, 4); + algebraic[1] = constants[2]*(states[0]-algebraic[4]); + algebraic[3] = constants[3]*pow(states[2], 3.0)*states[1]*(states[0]-computedConstants[0]); + algebraic[5] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0); + algebraic[6] = 4.0*exp(states[0]/18.0); + algebraic[7] = 0.07*exp(states[0]/20.0); + algebraic[8] = 1.0/(exp((states[0]+30.0)/10.0)+1.0); + algebraic[2] = constants[4]*pow(states[3], 4.0)*(states[0]-computedConstants[1]); + algebraic[9] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0); + algebraic[10] = 0.125*exp(states[0]/80.0); } diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.computed.constant.py b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.computed.constant.py index 2a928ef7fa..4d8a09531e 100644 --- a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.computed.constant.py +++ b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.computed.constant.py @@ -74,49 +74,49 @@ def create_variables_array(): def initialise_variables(voi, states, rates, constants, external_variable): - constants[4] = 1.0 - constants[5] = 0.0 - constants[7] = 0.3 - constants[9] = 120.0 - constants[15] = 36.0 + constants[0] = 1.0 + constants[1] = 0.0 + constants[2] = 0.3 + constants[3] = 120.0 + constants[4] = 36.0 states[0] = 0.0 states[1] = 0.6 states[2] = 0.05 states[3] = 0.325 - algebraic[6] = external_variable(voi, states, rates, variables, 6) + algebraic[4] = external_variable(voi, states, rates, variables, 4) def compute_computed_constants(constants, computed_constants): - computed_constants[8] = constants[5]-115.0 - computed_constants[14] = constants[5]+12.0 + computed_constants[0] = constants[1]-115.0 + computed_constants[1] = constants[1]+12.0 def compute_rates(voi, states, rates, constants, computed_constants, algebraic, external_variable): algebraic[0] = -20.0 if and_func(geq_func(voi, 10.0), leq_func(voi, 10.5)) else 0.0 - algebraic[6] = external_variable(voi, states, rates, variables, 6) - algebraic[1] = constants[7]*(states[0]-algebraic[6]) - algebraic[2] = constants[15]*pow(states[3], 4.0)*(states[0]-computed_constants[14]) - algebraic[3] = constants[9]*pow(states[2], 3.0)*states[1]*(states[0]-computed_constants[8]) - rates[0] = -(-algebraic[0]+algebraic[3]+algebraic[2]+algebraic[1])/constants[4] - algebraic[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0) - algebraic[11] = 4.0*exp(states[0]/18.0) - rates[2] = algebraic[10]*(1.0-states[2])-algebraic[11]*states[2] - algebraic[12] = 0.07*exp(states[0]/20.0) - algebraic[13] = 1.0/(exp((states[0]+30.0)/10.0)+1.0) - rates[1] = algebraic[12]*(1.0-states[1])-algebraic[13]*states[1] - algebraic[16] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0) - algebraic[17] = 0.125*exp(states[0]/80.0) - rates[3] = algebraic[16]*(1.0-states[3])-algebraic[17]*states[3] + algebraic[4] = external_variable(voi, states, rates, variables, 4) + algebraic[1] = constants[2]*(states[0]-algebraic[4]) + algebraic[2] = constants[4]*pow(states[3], 4.0)*(states[0]-computed_constants[1]) + algebraic[3] = constants[3]*pow(states[2], 3.0)*states[1]*(states[0]-computed_constants[0]) + rates[0] = -(-algebraic[0]+algebraic[3]+algebraic[2]+algebraic[1])/constants[0] + algebraic[5] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0) + algebraic[6] = 4.0*exp(states[0]/18.0) + rates[2] = algebraic[5]*(1.0-states[2])-algebraic[6]*states[2] + algebraic[7] = 0.07*exp(states[0]/20.0) + algebraic[8] = 1.0/(exp((states[0]+30.0)/10.0)+1.0) + rates[1] = algebraic[7]*(1.0-states[1])-algebraic[8]*states[1] + algebraic[9] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0) + algebraic[10] = 0.125*exp(states[0]/80.0) + rates[3] = algebraic[9]*(1.0-states[3])-algebraic[10]*states[3] def compute_variables(voi, states, rates, constants, computed_constants, algebraic, external_variable): - algebraic[6] = external_variable(voi, states, rates, variables, 6) - algebraic[1] = constants[7]*(states[0]-algebraic[6]) - algebraic[3] = constants[9]*pow(states[2], 3.0)*states[1]*(states[0]-computed_constants[8]) - algebraic[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0) - algebraic[11] = 4.0*exp(states[0]/18.0) - algebraic[12] = 0.07*exp(states[0]/20.0) - algebraic[13] = 1.0/(exp((states[0]+30.0)/10.0)+1.0) - algebraic[2] = constants[15]*pow(states[3], 4.0)*(states[0]-computed_constants[14]) - algebraic[16] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0) - algebraic[17] = 0.125*exp(states[0]/80.0) + algebraic[4] = external_variable(voi, states, rates, variables, 4) + algebraic[1] = constants[2]*(states[0]-algebraic[4]) + algebraic[3] = constants[3]*pow(states[2], 3.0)*states[1]*(states[0]-computed_constants[0]) + algebraic[5] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0) + algebraic[6] = 4.0*exp(states[0]/18.0) + algebraic[7] = 0.07*exp(states[0]/20.0) + algebraic[8] = 1.0/(exp((states[0]+30.0)/10.0)+1.0) + algebraic[2] = constants[4]*pow(states[3], 4.0)*(states[0]-computed_constants[1]) + algebraic[9] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0) + algebraic[10] = 0.125*exp(states[0]/80.0) diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.constant.c b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.constant.c index f3d7255142..b38a8dde50 100644 --- a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.constant.c +++ b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.constant.c @@ -72,10 +72,10 @@ void deleteArray(double *array) void initialiseVariables(double voi, double *states, double *rates, double *constants, ExternalVariable externalVariable) { - constants[5] = 0.0; - constants[7] = 0.3; - constants[9] = 120.0; - constants[15] = 36.0; + constants[0] = 0.0; + constants[1] = 0.3; + constants[2] = 120.0; + constants[3] = 36.0; states[0] = 0.0; states[1] = 0.6; states[2] = 0.05; @@ -85,40 +85,40 @@ void initialiseVariables(double voi, double *states, double *rates, double *cons void computeComputedConstants(double *constants, double *computedConstants) { - computedConstants[6] = constants[5]-10.613; - computedConstants[8] = constants[5]-115.0; - computedConstants[14] = constants[5]+12.0; + computedConstants[0] = constants[0]-10.613; + computedConstants[1] = constants[0]-115.0; + computedConstants[2] = constants[0]+12.0; } void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { algebraic[0] = ((voi >= 10.0) && (voi <= 10.5))?-20.0:0.0; algebraic[4] = externalVariable(voi, states, rates, variables, 4); - algebraic[1] = constants[7]*(states[0]-computedConstants[6]); - algebraic[2] = constants[15]*pow(states[3], 4.0)*(states[0]-computedConstants[14]); - algebraic[3] = constants[9]*pow(states[2], 3.0)*states[1]*(states[0]-computedConstants[8]); + algebraic[1] = constants[1]*(states[0]-computedConstants[0]); + algebraic[2] = constants[3]*pow(states[3], 4.0)*(states[0]-computedConstants[2]); + algebraic[3] = constants[2]*pow(states[2], 3.0)*states[1]*(states[0]-computedConstants[1]); rates[0] = -(-algebraic[0]+algebraic[3]+algebraic[2]+algebraic[1])/algebraic[4]; - algebraic[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0); - algebraic[11] = 4.0*exp(states[0]/18.0); - rates[2] = algebraic[10]*(1.0-states[2])-algebraic[11]*states[2]; - algebraic[12] = 0.07*exp(states[0]/20.0); - algebraic[13] = 1.0/(exp((states[0]+30.0)/10.0)+1.0); - rates[1] = algebraic[12]*(1.0-states[1])-algebraic[13]*states[1]; - algebraic[16] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0); - algebraic[17] = 0.125*exp(states[0]/80.0); - rates[3] = algebraic[16]*(1.0-states[3])-algebraic[17]*states[3]; + algebraic[5] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0); + algebraic[6] = 4.0*exp(states[0]/18.0); + rates[2] = algebraic[5]*(1.0-states[2])-algebraic[6]*states[2]; + algebraic[7] = 0.07*exp(states[0]/20.0); + algebraic[8] = 1.0/(exp((states[0]+30.0)/10.0)+1.0); + rates[1] = algebraic[7]*(1.0-states[1])-algebraic[8]*states[1]; + algebraic[9] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0); + algebraic[10] = 0.125*exp(states[0]/80.0); + rates[3] = algebraic[9]*(1.0-states[3])-algebraic[10]*states[3]; } void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { - algebraic[1] = constants[7]*(states[0]-computedConstants[6]); - algebraic[3] = constants[9]*pow(states[2], 3.0)*states[1]*(states[0]-computedConstants[8]); - algebraic[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0); - algebraic[11] = 4.0*exp(states[0]/18.0); - algebraic[12] = 0.07*exp(states[0]/20.0); - algebraic[13] = 1.0/(exp((states[0]+30.0)/10.0)+1.0); - algebraic[2] = constants[15]*pow(states[3], 4.0)*(states[0]-computedConstants[14]); - algebraic[16] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0); - algebraic[17] = 0.125*exp(states[0]/80.0); + algebraic[1] = constants[1]*(states[0]-computedConstants[0]); + algebraic[3] = constants[2]*pow(states[2], 3.0)*states[1]*(states[0]-computedConstants[1]); + algebraic[5] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0); + algebraic[6] = 4.0*exp(states[0]/18.0); + algebraic[7] = 0.07*exp(states[0]/20.0); + algebraic[8] = 1.0/(exp((states[0]+30.0)/10.0)+1.0); + algebraic[2] = constants[3]*pow(states[3], 4.0)*(states[0]-computedConstants[2]); + algebraic[9] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0); + algebraic[10] = 0.125*exp(states[0]/80.0); algebraic[4] = externalVariable(voi, states, rates, variables, 4); } diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.constant.py b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.constant.py index 99304a266e..9a8335d0d7 100644 --- a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.constant.py +++ b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.constant.py @@ -74,10 +74,10 @@ def create_variables_array(): def initialise_variables(voi, states, rates, constants, external_variable): - constants[5] = 0.0 - constants[7] = 0.3 - constants[9] = 120.0 - constants[15] = 36.0 + constants[0] = 0.0 + constants[1] = 0.3 + constants[2] = 120.0 + constants[3] = 36.0 states[0] = 0.0 states[1] = 0.6 states[2] = 0.05 @@ -86,37 +86,37 @@ def initialise_variables(voi, states, rates, constants, external_variable): def compute_computed_constants(constants, computed_constants): - computed_constants[6] = constants[5]-10.613 - computed_constants[8] = constants[5]-115.0 - computed_constants[14] = constants[5]+12.0 + computed_constants[0] = constants[0]-10.613 + computed_constants[1] = constants[0]-115.0 + computed_constants[2] = constants[0]+12.0 def compute_rates(voi, states, rates, constants, computed_constants, algebraic, external_variable): algebraic[0] = -20.0 if and_func(geq_func(voi, 10.0), leq_func(voi, 10.5)) else 0.0 algebraic[4] = external_variable(voi, states, rates, variables, 4) - algebraic[1] = constants[7]*(states[0]-computed_constants[6]) - algebraic[2] = constants[15]*pow(states[3], 4.0)*(states[0]-computed_constants[14]) - algebraic[3] = constants[9]*pow(states[2], 3.0)*states[1]*(states[0]-computed_constants[8]) + algebraic[1] = constants[1]*(states[0]-computed_constants[0]) + algebraic[2] = constants[3]*pow(states[3], 4.0)*(states[0]-computed_constants[2]) + algebraic[3] = constants[2]*pow(states[2], 3.0)*states[1]*(states[0]-computed_constants[1]) rates[0] = -(-algebraic[0]+algebraic[3]+algebraic[2]+algebraic[1])/algebraic[4] - algebraic[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0) - algebraic[11] = 4.0*exp(states[0]/18.0) - rates[2] = algebraic[10]*(1.0-states[2])-algebraic[11]*states[2] - algebraic[12] = 0.07*exp(states[0]/20.0) - algebraic[13] = 1.0/(exp((states[0]+30.0)/10.0)+1.0) - rates[1] = algebraic[12]*(1.0-states[1])-algebraic[13]*states[1] - algebraic[16] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0) - algebraic[17] = 0.125*exp(states[0]/80.0) - rates[3] = algebraic[16]*(1.0-states[3])-algebraic[17]*states[3] + algebraic[5] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0) + algebraic[6] = 4.0*exp(states[0]/18.0) + rates[2] = algebraic[5]*(1.0-states[2])-algebraic[6]*states[2] + algebraic[7] = 0.07*exp(states[0]/20.0) + algebraic[8] = 1.0/(exp((states[0]+30.0)/10.0)+1.0) + rates[1] = algebraic[7]*(1.0-states[1])-algebraic[8]*states[1] + algebraic[9] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0) + algebraic[10] = 0.125*exp(states[0]/80.0) + rates[3] = algebraic[9]*(1.0-states[3])-algebraic[10]*states[3] def compute_variables(voi, states, rates, constants, computed_constants, algebraic, external_variable): - algebraic[1] = constants[7]*(states[0]-computed_constants[6]) - algebraic[3] = constants[9]*pow(states[2], 3.0)*states[1]*(states[0]-computed_constants[8]) - algebraic[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0) - algebraic[11] = 4.0*exp(states[0]/18.0) - algebraic[12] = 0.07*exp(states[0]/20.0) - algebraic[13] = 1.0/(exp((states[0]+30.0)/10.0)+1.0) - algebraic[2] = constants[15]*pow(states[3], 4.0)*(states[0]-computed_constants[14]) - algebraic[16] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0) - algebraic[17] = 0.125*exp(states[0]/80.0) + algebraic[1] = constants[1]*(states[0]-computed_constants[0]) + algebraic[3] = constants[2]*pow(states[2], 3.0)*states[1]*(states[0]-computed_constants[1]) + algebraic[5] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0) + algebraic[6] = 4.0*exp(states[0]/18.0) + algebraic[7] = 0.07*exp(states[0]/20.0) + algebraic[8] = 1.0/(exp((states[0]+30.0)/10.0)+1.0) + algebraic[2] = constants[3]*pow(states[3], 4.0)*(states[0]-computed_constants[2]) + algebraic[9] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0) + algebraic[10] = 0.125*exp(states[0]/80.0) algebraic[4] = external_variable(voi, states, rates, variables, 4) diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dae.c b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dae.c index 79d7df0822..228073aca6 100644 --- a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dae.c +++ b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dae.c @@ -113,7 +113,7 @@ void objectiveFunction1(double *u, double *f, void *data) rates[0] = u[0]; - f[0] = rates[0]-(-(-algebraic[0]+algebraic[3]+algebraic[2]+algebraic[1])/constants[4])-0.0; + f[0] = rates[0]-(-(-algebraic[0]+algebraic[3]+algebraic[2]+algebraic[1])/constants[0])-0.0; } void findRoot1(double voi, double *states, double *rates, double *variables) @@ -135,9 +135,9 @@ void objectiveFunction2(double *u, double *f, void *data) double *rates = ((RootFindingInfo *) data)->rates; double *variables = ((RootFindingInfo *) data)->variables; - computedConstants[6] = u[0]; + computedConstants[0] = u[0]; - f[0] = computedConstants[6]-(constants[5]-10.613)-0.0; + f[0] = computedConstants[0]-(constants[1]-10.613)-0.0; } void findRoot2(double voi, double *states, double *rates, double *variables) @@ -145,11 +145,11 @@ void findRoot2(double voi, double *states, double *rates, double *variables) RootFindingInfo rfi = { voi, states, rates, variables }; double u[1]; - u[0] = algebraic[6]; + u[0] = algebraic[0]; nlaSolve(objectiveFunction2, u, 1, &rfi); - algebraic[6] = u[0]; + algebraic[0] = u[0]; } void objectiveFunction3(double *u, double *f, void *data) @@ -161,7 +161,7 @@ void objectiveFunction3(double *u, double *f, void *data) algebraic[1] = u[0]; - f[0] = algebraic[1]-constants[7]*(states[0]-computedConstants[6])-0.0; + f[0] = algebraic[1]-constants[2]*(states[0]-computedConstants[0])-0.0; } void findRoot3(double voi, double *states, double *rates, double *variables) @@ -183,9 +183,9 @@ void objectiveFunction4(double *u, double *f, void *data) double *rates = ((RootFindingInfo *) data)->rates; double *variables = ((RootFindingInfo *) data)->variables; - computedConstants[8] = u[0]; + computedConstants[1] = u[0]; - f[0] = computedConstants[8]-(constants[5]-115.0)-0.0; + f[0] = computedConstants[1]-(constants[1]-115.0)-0.0; } void findRoot4(double voi, double *states, double *rates, double *variables) @@ -193,11 +193,11 @@ void findRoot4(double voi, double *states, double *rates, double *variables) RootFindingInfo rfi = { voi, states, rates, variables }; double u[1]; - u[0] = algebraic[8]; + u[0] = algebraic[1]; nlaSolve(objectiveFunction4, u, 1, &rfi); - algebraic[8] = u[0]; + algebraic[1] = u[0]; } void objectiveFunction5(double *u, double *f, void *data) @@ -209,7 +209,7 @@ void objectiveFunction5(double *u, double *f, void *data) algebraic[3] = u[0]; - f[0] = algebraic[3]-constants[9]*pow(states[2], 3.0)*states[1]*(states[0]-computedConstants[8])-0.0; + f[0] = algebraic[3]-constants[3]*pow(states[2], 3.0)*states[1]*(states[0]-computedConstants[1])-0.0; } void findRoot5(double voi, double *states, double *rates, double *variables) @@ -231,9 +231,9 @@ void objectiveFunction6(double *u, double *f, void *data) double *rates = ((RootFindingInfo *) data)->rates; double *variables = ((RootFindingInfo *) data)->variables; - algebraic[10] = u[0]; + algebraic[4] = u[0]; - f[0] = algebraic[10]-0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0)-0.0; + f[0] = algebraic[4]-0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0)-0.0; } void findRoot6(double voi, double *states, double *rates, double *variables) @@ -241,11 +241,11 @@ void findRoot6(double voi, double *states, double *rates, double *variables) RootFindingInfo rfi = { voi, states, rates, variables }; double u[1]; - u[0] = algebraic[10]; + u[0] = algebraic[4]; nlaSolve(objectiveFunction6, u, 1, &rfi); - algebraic[10] = u[0]; + algebraic[4] = u[0]; } void objectiveFunction7(double *u, double *f, void *data) @@ -255,9 +255,9 @@ void objectiveFunction7(double *u, double *f, void *data) double *rates = ((RootFindingInfo *) data)->rates; double *variables = ((RootFindingInfo *) data)->variables; - algebraic[11] = u[0]; + algebraic[5] = u[0]; - f[0] = algebraic[11]-4.0*exp(states[0]/18.0)-0.0; + f[0] = algebraic[5]-4.0*exp(states[0]/18.0)-0.0; } void findRoot7(double voi, double *states, double *rates, double *variables) @@ -265,11 +265,11 @@ void findRoot7(double voi, double *states, double *rates, double *variables) RootFindingInfo rfi = { voi, states, rates, variables }; double u[1]; - u[0] = algebraic[11]; + u[0] = algebraic[5]; nlaSolve(objectiveFunction7, u, 1, &rfi); - algebraic[11] = u[0]; + algebraic[5] = u[0]; } void objectiveFunction8(double *u, double *f, void *data) @@ -281,7 +281,7 @@ void objectiveFunction8(double *u, double *f, void *data) rates[2] = u[0]; - f[0] = rates[2]-(algebraic[10]*(1.0-states[2])-algebraic[11]*states[2])-0.0; + f[0] = rates[2]-(algebraic[4]*(1.0-states[2])-algebraic[5]*states[2])-0.0; } void findRoot8(double voi, double *states, double *rates, double *variables) @@ -303,9 +303,9 @@ void objectiveFunction9(double *u, double *f, void *data) double *rates = ((RootFindingInfo *) data)->rates; double *variables = ((RootFindingInfo *) data)->variables; - algebraic[12] = u[0]; + algebraic[6] = u[0]; - f[0] = algebraic[12]-0.07*exp(states[0]/20.0)-0.0; + f[0] = algebraic[6]-0.07*exp(states[0]/20.0)-0.0; } void findRoot9(double voi, double *states, double *rates, double *variables) @@ -313,11 +313,11 @@ void findRoot9(double voi, double *states, double *rates, double *variables) RootFindingInfo rfi = { voi, states, rates, variables }; double u[1]; - u[0] = algebraic[12]; + u[0] = algebraic[6]; nlaSolve(objectiveFunction9, u, 1, &rfi); - algebraic[12] = u[0]; + algebraic[6] = u[0]; } void objectiveFunction10(double *u, double *f, void *data) @@ -327,9 +327,9 @@ void objectiveFunction10(double *u, double *f, void *data) double *rates = ((RootFindingInfo *) data)->rates; double *variables = ((RootFindingInfo *) data)->variables; - algebraic[13] = u[0]; + algebraic[7] = u[0]; - f[0] = algebraic[13]-1.0/(exp((states[0]+30.0)/10.0)+1.0)-0.0; + f[0] = algebraic[7]-1.0/(exp((states[0]+30.0)/10.0)+1.0)-0.0; } void findRoot10(double voi, double *states, double *rates, double *variables) @@ -337,11 +337,11 @@ void findRoot10(double voi, double *states, double *rates, double *variables) RootFindingInfo rfi = { voi, states, rates, variables }; double u[1]; - u[0] = algebraic[13]; + u[0] = algebraic[7]; nlaSolve(objectiveFunction10, u, 1, &rfi); - algebraic[13] = u[0]; + algebraic[7] = u[0]; } void objectiveFunction11(double *u, double *f, void *data) @@ -353,7 +353,7 @@ void objectiveFunction11(double *u, double *f, void *data) rates[1] = u[0]; - f[0] = rates[1]-(algebraic[12]*(1.0-states[1])-algebraic[13]*states[1])-0.0; + f[0] = rates[1]-(algebraic[6]*(1.0-states[1])-algebraic[7]*states[1])-0.0; } void findRoot11(double voi, double *states, double *rates, double *variables) @@ -375,9 +375,9 @@ void objectiveFunction12(double *u, double *f, void *data) double *rates = ((RootFindingInfo *) data)->rates; double *variables = ((RootFindingInfo *) data)->variables; - computedConstants[14] = u[0]; + computedConstants[2] = u[0]; - f[0] = computedConstants[14]-(constants[5]+12.0)-0.0; + f[0] = computedConstants[2]-(constants[1]+12.0)-0.0; } void findRoot12(double voi, double *states, double *rates, double *variables) @@ -385,11 +385,11 @@ void findRoot12(double voi, double *states, double *rates, double *variables) RootFindingInfo rfi = { voi, states, rates, variables }; double u[1]; - u[0] = algebraic[14]; + u[0] = algebraic[2]; nlaSolve(objectiveFunction12, u, 1, &rfi); - algebraic[14] = u[0]; + algebraic[2] = u[0]; } void objectiveFunction13(double *u, double *f, void *data) @@ -401,7 +401,7 @@ void objectiveFunction13(double *u, double *f, void *data) algebraic[2] = u[0]; - f[0] = algebraic[2]-constants[15]*pow(states[3], 4.0)*(states[0]-computedConstants[14])-0.0; + f[0] = algebraic[2]-constants[4]*pow(states[3], 4.0)*(states[0]-computedConstants[2])-0.0; } void findRoot13(double voi, double *states, double *rates, double *variables) @@ -423,9 +423,9 @@ void objectiveFunction14(double *u, double *f, void *data) double *rates = ((RootFindingInfo *) data)->rates; double *variables = ((RootFindingInfo *) data)->variables; - algebraic[16] = u[0]; + algebraic[8] = u[0]; - f[0] = algebraic[16]-0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0)-0.0; + f[0] = algebraic[8]-0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0)-0.0; } void findRoot14(double voi, double *states, double *rates, double *variables) @@ -433,11 +433,11 @@ void findRoot14(double voi, double *states, double *rates, double *variables) RootFindingInfo rfi = { voi, states, rates, variables }; double u[1]; - u[0] = algebraic[16]; + u[0] = algebraic[8]; nlaSolve(objectiveFunction14, u, 1, &rfi); - algebraic[16] = u[0]; + algebraic[8] = u[0]; } void objectiveFunction15(double *u, double *f, void *data) @@ -447,9 +447,9 @@ void objectiveFunction15(double *u, double *f, void *data) double *rates = ((RootFindingInfo *) data)->rates; double *variables = ((RootFindingInfo *) data)->variables; - algebraic[17] = u[0]; + algebraic[9] = u[0]; - f[0] = algebraic[17]-0.125*exp(states[0]/80.0)-0.0; + f[0] = algebraic[9]-0.125*exp(states[0]/80.0)-0.0; } void findRoot15(double voi, double *states, double *rates, double *variables) @@ -457,11 +457,11 @@ void findRoot15(double voi, double *states, double *rates, double *variables) RootFindingInfo rfi = { voi, states, rates, variables }; double u[1]; - u[0] = algebraic[17]; + u[0] = algebraic[9]; nlaSolve(objectiveFunction15, u, 1, &rfi); - algebraic[17] = u[0]; + algebraic[9] = u[0]; } void objectiveFunction16(double *u, double *f, void *data) @@ -473,7 +473,7 @@ void objectiveFunction16(double *u, double *f, void *data) rates[3] = u[0]; - f[0] = rates[3]-(algebraic[16]*(1.0-states[3])-algebraic[17]*states[3])-0.0; + f[0] = rates[3]-(algebraic[8]*(1.0-states[3])-algebraic[9]*states[3])-0.0; } void findRoot16(double voi, double *states, double *rates, double *variables) @@ -494,20 +494,20 @@ void initialiseVariables(double *states, double *rates, double *constants) algebraic[1] = 0.0; algebraic[2] = 0.0; algebraic[3] = 0.0; - constants[4] = 1.0; - constants[5] = 0.0; - computedConstants[6] = 0.0; - constants[7] = 0.3; - computedConstants[8] = 0.0; - constants[9] = 120.0; - algebraic[10] = 0.0; - algebraic[11] = 0.0; - algebraic[12] = 0.0; - algebraic[13] = 0.0; - computedConstants[14] = 0.0; - constants[15] = 36.0; - algebraic[16] = 0.0; - algebraic[17] = 0.0; + constants[0] = 1.0; + constants[1] = 0.0; + computedConstants[0] = 0.0; + constants[2] = 0.3; + computedConstants[1] = 0.0; + constants[3] = 120.0; + algebraic[4] = 0.0; + algebraic[5] = 0.0; + algebraic[6] = 0.0; + algebraic[7] = 0.0; + computedConstants[2] = 0.0; + constants[4] = 36.0; + algebraic[8] = 0.0; + algebraic[9] = 0.0; states[0] = 0.0; states[1] = 0.6; states[2] = 0.05; diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dae.py b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dae.py index 068073cbd5..e9fe6851dd 100644 --- a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dae.py +++ b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dae.py @@ -104,7 +104,7 @@ def objective_function_1(u, f, data): rates[0] = u[0] - f[0] = rates[0]-(-(-algebraic[0]+algebraic[3]+algebraic[2]+algebraic[1])/constants[4])-0.0 + f[0] = rates[0]-(-(-algebraic[0]+algebraic[3]+algebraic[2]+algebraic[1])/constants[0])-0.0 def find_root_1(voi, states, rates, variables): @@ -123,19 +123,19 @@ def objective_function_2(u, f, data): rates = data[2] variables = data[3] - computed_constants[6] = u[0] + computed_constants[0] = u[0] - f[0] = computed_constants[6]-(constants[5]-10.613)-0.0 + f[0] = computed_constants[0]-(constants[1]-10.613)-0.0 def find_root_2(voi, states, rates, variables): u = [nan]*1 - u[0] = algebraic[6] + u[0] = algebraic[0] u = nla_solve(objective_function_2, u, 1, [voi, states, rates, variables]) - algebraic[6] = u[0] + algebraic[0] = u[0] def objective_function_3(u, f, data): @@ -146,7 +146,7 @@ def objective_function_3(u, f, data): algebraic[1] = u[0] - f[0] = algebraic[1]-constants[7]*(states[0]-computed_constants[6])-0.0 + f[0] = algebraic[1]-constants[2]*(states[0]-computed_constants[0])-0.0 def find_root_3(voi, states, rates, variables): @@ -165,19 +165,19 @@ def objective_function_4(u, f, data): rates = data[2] variables = data[3] - computed_constants[8] = u[0] + computed_constants[1] = u[0] - f[0] = computed_constants[8]-(constants[5]-115.0)-0.0 + f[0] = computed_constants[1]-(constants[1]-115.0)-0.0 def find_root_4(voi, states, rates, variables): u = [nan]*1 - u[0] = algebraic[8] + u[0] = algebraic[1] u = nla_solve(objective_function_4, u, 1, [voi, states, rates, variables]) - algebraic[8] = u[0] + algebraic[1] = u[0] def objective_function_5(u, f, data): @@ -188,7 +188,7 @@ def objective_function_5(u, f, data): algebraic[3] = u[0] - f[0] = algebraic[3]-constants[9]*pow(states[2], 3.0)*states[1]*(states[0]-computed_constants[8])-0.0 + f[0] = algebraic[3]-constants[3]*pow(states[2], 3.0)*states[1]*(states[0]-computed_constants[1])-0.0 def find_root_5(voi, states, rates, variables): @@ -207,19 +207,19 @@ def objective_function_6(u, f, data): rates = data[2] variables = data[3] - algebraic[10] = u[0] + algebraic[4] = u[0] - f[0] = algebraic[10]-0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0)-0.0 + f[0] = algebraic[4]-0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0)-0.0 def find_root_6(voi, states, rates, variables): u = [nan]*1 - u[0] = algebraic[10] + u[0] = algebraic[4] u = nla_solve(objective_function_6, u, 1, [voi, states, rates, variables]) - algebraic[10] = u[0] + algebraic[4] = u[0] def objective_function_7(u, f, data): @@ -228,19 +228,19 @@ def objective_function_7(u, f, data): rates = data[2] variables = data[3] - algebraic[11] = u[0] + algebraic[5] = u[0] - f[0] = algebraic[11]-4.0*exp(states[0]/18.0)-0.0 + f[0] = algebraic[5]-4.0*exp(states[0]/18.0)-0.0 def find_root_7(voi, states, rates, variables): u = [nan]*1 - u[0] = algebraic[11] + u[0] = algebraic[5] u = nla_solve(objective_function_7, u, 1, [voi, states, rates, variables]) - algebraic[11] = u[0] + algebraic[5] = u[0] def objective_function_8(u, f, data): @@ -251,7 +251,7 @@ def objective_function_8(u, f, data): rates[2] = u[0] - f[0] = rates[2]-(algebraic[10]*(1.0-states[2])-algebraic[11]*states[2])-0.0 + f[0] = rates[2]-(algebraic[4]*(1.0-states[2])-algebraic[5]*states[2])-0.0 def find_root_8(voi, states, rates, variables): @@ -270,19 +270,19 @@ def objective_function_9(u, f, data): rates = data[2] variables = data[3] - algebraic[12] = u[0] + algebraic[6] = u[0] - f[0] = algebraic[12]-0.07*exp(states[0]/20.0)-0.0 + f[0] = algebraic[6]-0.07*exp(states[0]/20.0)-0.0 def find_root_9(voi, states, rates, variables): u = [nan]*1 - u[0] = algebraic[12] + u[0] = algebraic[6] u = nla_solve(objective_function_9, u, 1, [voi, states, rates, variables]) - algebraic[12] = u[0] + algebraic[6] = u[0] def objective_function_10(u, f, data): @@ -291,19 +291,19 @@ def objective_function_10(u, f, data): rates = data[2] variables = data[3] - algebraic[13] = u[0] + algebraic[7] = u[0] - f[0] = algebraic[13]-1.0/(exp((states[0]+30.0)/10.0)+1.0)-0.0 + f[0] = algebraic[7]-1.0/(exp((states[0]+30.0)/10.0)+1.0)-0.0 def find_root_10(voi, states, rates, variables): u = [nan]*1 - u[0] = algebraic[13] + u[0] = algebraic[7] u = nla_solve(objective_function_10, u, 1, [voi, states, rates, variables]) - algebraic[13] = u[0] + algebraic[7] = u[0] def objective_function_11(u, f, data): @@ -314,7 +314,7 @@ def objective_function_11(u, f, data): rates[1] = u[0] - f[0] = rates[1]-(algebraic[12]*(1.0-states[1])-algebraic[13]*states[1])-0.0 + f[0] = rates[1]-(algebraic[6]*(1.0-states[1])-algebraic[7]*states[1])-0.0 def find_root_11(voi, states, rates, variables): @@ -333,19 +333,19 @@ def objective_function_12(u, f, data): rates = data[2] variables = data[3] - computed_constants[14] = u[0] + computed_constants[2] = u[0] - f[0] = computed_constants[14]-(constants[5]+12.0)-0.0 + f[0] = computed_constants[2]-(constants[1]+12.0)-0.0 def find_root_12(voi, states, rates, variables): u = [nan]*1 - u[0] = algebraic[14] + u[0] = algebraic[2] u = nla_solve(objective_function_12, u, 1, [voi, states, rates, variables]) - algebraic[14] = u[0] + algebraic[2] = u[0] def objective_function_13(u, f, data): @@ -356,7 +356,7 @@ def objective_function_13(u, f, data): algebraic[2] = u[0] - f[0] = algebraic[2]-constants[15]*pow(states[3], 4.0)*(states[0]-computed_constants[14])-0.0 + f[0] = algebraic[2]-constants[4]*pow(states[3], 4.0)*(states[0]-computed_constants[2])-0.0 def find_root_13(voi, states, rates, variables): @@ -375,19 +375,19 @@ def objective_function_14(u, f, data): rates = data[2] variables = data[3] - algebraic[16] = u[0] + algebraic[8] = u[0] - f[0] = algebraic[16]-0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0)-0.0 + f[0] = algebraic[8]-0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0)-0.0 def find_root_14(voi, states, rates, variables): u = [nan]*1 - u[0] = algebraic[16] + u[0] = algebraic[8] u = nla_solve(objective_function_14, u, 1, [voi, states, rates, variables]) - algebraic[16] = u[0] + algebraic[8] = u[0] def objective_function_15(u, f, data): @@ -396,19 +396,19 @@ def objective_function_15(u, f, data): rates = data[2] variables = data[3] - algebraic[17] = u[0] + algebraic[9] = u[0] - f[0] = algebraic[17]-0.125*exp(states[0]/80.0)-0.0 + f[0] = algebraic[9]-0.125*exp(states[0]/80.0)-0.0 def find_root_15(voi, states, rates, variables): u = [nan]*1 - u[0] = algebraic[17] + u[0] = algebraic[9] u = nla_solve(objective_function_15, u, 1, [voi, states, rates, variables]) - algebraic[17] = u[0] + algebraic[9] = u[0] def objective_function_16(u, f, data): @@ -419,7 +419,7 @@ def objective_function_16(u, f, data): rates[3] = u[0] - f[0] = rates[3]-(algebraic[16]*(1.0-states[3])-algebraic[17]*states[3])-0.0 + f[0] = rates[3]-(algebraic[8]*(1.0-states[3])-algebraic[9]*states[3])-0.0 def find_root_16(voi, states, rates, variables): @@ -437,20 +437,20 @@ def initialise_variables(states, rates, constants): algebraic[1] = 0.0 algebraic[2] = 0.0 algebraic[3] = 0.0 - constants[4] = 1.0 - constants[5] = 0.0 - computed_constants[6] = 0.0 - constants[7] = 0.3 - computed_constants[8] = 0.0 - constants[9] = 120.0 - algebraic[10] = 0.0 - algebraic[11] = 0.0 - algebraic[12] = 0.0 - algebraic[13] = 0.0 - computed_constants[14] = 0.0 - constants[15] = 36.0 - algebraic[16] = 0.0 - algebraic[17] = 0.0 + constants[0] = 1.0 + constants[1] = 0.0 + computed_constants[0] = 0.0 + constants[2] = 0.3 + computed_constants[1] = 0.0 + constants[3] = 120.0 + algebraic[4] = 0.0 + algebraic[5] = 0.0 + algebraic[6] = 0.0 + algebraic[7] = 0.0 + computed_constants[2] = 0.0 + constants[4] = 36.0 + algebraic[8] = 0.0 + algebraic[9] = 0.0 states[0] = 0.0 states[1] = 0.6 states[2] = 0.05 diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.algebraic.c b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.algebraic.c index 9533f72f59..1967097424 100644 --- a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.algebraic.c +++ b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.algebraic.c @@ -72,54 +72,54 @@ void deleteArray(double *array) void initialiseVariables(double voi, double *states, double *rates, double *constants, ExternalVariable externalVariable) { - constants[4] = 1.0; - constants[5] = 0.0; - constants[7] = 0.3; - constants[9] = 120.0; - constants[15] = 36.0; + constants[0] = 1.0; + constants[1] = 0.0; + constants[2] = 0.3; + constants[3] = 120.0; + constants[4] = 36.0; states[0] = 0.0; states[1] = 0.6; states[2] = 0.05; states[3] = 0.325; - algebraic[17] = externalVariable(voi, states, rates, variables, 17); + algebraic[9] = externalVariable(voi, states, rates, variables, 9); algebraic[0] = externalVariable(voi, states, rates, variables, 0); } void computeComputedConstants(double *constants, double *computedConstants) { - computedConstants[6] = constants[5]-10.613; - computedConstants[8] = constants[5]-115.0; - computedConstants[14] = constants[5]+12.0; + computedConstants[0] = constants[1]-10.613; + computedConstants[1] = constants[1]-115.0; + computedConstants[2] = constants[1]+12.0; } void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { - algebraic[17] = externalVariable(voi, states, rates, variables, 17); + algebraic[9] = externalVariable(voi, states, rates, variables, 9); algebraic[0] = externalVariable(voi, states, rates, variables, 0); - algebraic[1] = constants[7]*(states[0]-computedConstants[6]); - algebraic[2] = constants[15]*pow(states[3], 4.0)*(states[0]-computedConstants[14]); - algebraic[3] = constants[9]*pow(states[2], 3.0)*states[1]*(states[0]-computedConstants[8]); - rates[0] = -(-algebraic[0]+algebraic[3]+algebraic[2]+algebraic[1])/constants[4]; - algebraic[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0); - algebraic[11] = 4.0*exp(states[0]/18.0); - rates[2] = algebraic[10]*(1.0-states[2])-algebraic[11]*states[2]; - algebraic[12] = 0.07*exp(states[0]/20.0); - algebraic[13] = 1.0/(exp((states[0]+30.0)/10.0)+1.0); - rates[1] = algebraic[12]*(1.0-states[1])-algebraic[13]*states[1]; - algebraic[16] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0); - rates[3] = algebraic[16]*(1.0-states[3])-algebraic[17]*states[3]; + algebraic[1] = constants[2]*(states[0]-computedConstants[0]); + algebraic[2] = constants[4]*pow(states[3], 4.0)*(states[0]-computedConstants[2]); + algebraic[3] = constants[3]*pow(states[2], 3.0)*states[1]*(states[0]-computedConstants[1]); + rates[0] = -(-algebraic[0]+algebraic[3]+algebraic[2]+algebraic[1])/constants[0]; + algebraic[4] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0); + algebraic[5] = 4.0*exp(states[0]/18.0); + rates[2] = algebraic[4]*(1.0-states[2])-algebraic[5]*states[2]; + algebraic[6] = 0.07*exp(states[0]/20.0); + algebraic[7] = 1.0/(exp((states[0]+30.0)/10.0)+1.0); + rates[1] = algebraic[6]*(1.0-states[1])-algebraic[7]*states[1]; + algebraic[8] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0); + rates[3] = algebraic[8]*(1.0-states[3])-algebraic[9]*states[3]; } void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { - algebraic[17] = externalVariable(voi, states, rates, variables, 17); + algebraic[9] = externalVariable(voi, states, rates, variables, 9); algebraic[0] = externalVariable(voi, states, rates, variables, 0); - algebraic[1] = constants[7]*(states[0]-computedConstants[6]); - algebraic[3] = constants[9]*pow(states[2], 3.0)*states[1]*(states[0]-computedConstants[8]); - algebraic[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0); - algebraic[11] = 4.0*exp(states[0]/18.0); - algebraic[12] = 0.07*exp(states[0]/20.0); - algebraic[13] = 1.0/(exp((states[0]+30.0)/10.0)+1.0); - algebraic[2] = constants[15]*pow(states[3], 4.0)*(states[0]-computedConstants[14]); - algebraic[16] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0); + algebraic[1] = constants[2]*(states[0]-computedConstants[0]); + algebraic[3] = constants[3]*pow(states[2], 3.0)*states[1]*(states[0]-computedConstants[1]); + algebraic[4] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0); + algebraic[5] = 4.0*exp(states[0]/18.0); + algebraic[6] = 0.07*exp(states[0]/20.0); + algebraic[7] = 1.0/(exp((states[0]+30.0)/10.0)+1.0); + algebraic[2] = constants[4]*pow(states[3], 4.0)*(states[0]-computedConstants[2]); + algebraic[8] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0); } diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.algebraic.py b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.algebraic.py index 381f0a24f7..006bf3b125 100644 --- a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.algebraic.py +++ b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.algebraic.py @@ -74,50 +74,50 @@ def create_variables_array(): def initialise_variables(voi, states, rates, constants, external_variable): - constants[4] = 1.0 - constants[5] = 0.0 - constants[7] = 0.3 - constants[9] = 120.0 - constants[15] = 36.0 + constants[0] = 1.0 + constants[1] = 0.0 + constants[2] = 0.3 + constants[3] = 120.0 + constants[4] = 36.0 states[0] = 0.0 states[1] = 0.6 states[2] = 0.05 states[3] = 0.325 - algebraic[17] = external_variable(voi, states, rates, variables, 17) + algebraic[9] = external_variable(voi, states, rates, variables, 9) algebraic[0] = external_variable(voi, states, rates, variables, 0) def compute_computed_constants(constants, computed_constants): - computed_constants[6] = constants[5]-10.613 - computed_constants[8] = constants[5]-115.0 - computed_constants[14] = constants[5]+12.0 + computed_constants[0] = constants[1]-10.613 + computed_constants[1] = constants[1]-115.0 + computed_constants[2] = constants[1]+12.0 def compute_rates(voi, states, rates, constants, computed_constants, algebraic, external_variable): - algebraic[17] = external_variable(voi, states, rates, variables, 17) + algebraic[9] = external_variable(voi, states, rates, variables, 9) algebraic[0] = external_variable(voi, states, rates, variables, 0) - algebraic[1] = constants[7]*(states[0]-computed_constants[6]) - algebraic[2] = constants[15]*pow(states[3], 4.0)*(states[0]-computed_constants[14]) - algebraic[3] = constants[9]*pow(states[2], 3.0)*states[1]*(states[0]-computed_constants[8]) - rates[0] = -(-algebraic[0]+algebraic[3]+algebraic[2]+algebraic[1])/constants[4] - algebraic[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0) - algebraic[11] = 4.0*exp(states[0]/18.0) - rates[2] = algebraic[10]*(1.0-states[2])-algebraic[11]*states[2] - algebraic[12] = 0.07*exp(states[0]/20.0) - algebraic[13] = 1.0/(exp((states[0]+30.0)/10.0)+1.0) - rates[1] = algebraic[12]*(1.0-states[1])-algebraic[13]*states[1] - algebraic[16] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0) - rates[3] = algebraic[16]*(1.0-states[3])-algebraic[17]*states[3] + algebraic[1] = constants[2]*(states[0]-computed_constants[0]) + algebraic[2] = constants[4]*pow(states[3], 4.0)*(states[0]-computed_constants[2]) + algebraic[3] = constants[3]*pow(states[2], 3.0)*states[1]*(states[0]-computed_constants[1]) + rates[0] = -(-algebraic[0]+algebraic[3]+algebraic[2]+algebraic[1])/constants[0] + algebraic[4] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0) + algebraic[5] = 4.0*exp(states[0]/18.0) + rates[2] = algebraic[4]*(1.0-states[2])-algebraic[5]*states[2] + algebraic[6] = 0.07*exp(states[0]/20.0) + algebraic[7] = 1.0/(exp((states[0]+30.0)/10.0)+1.0) + rates[1] = algebraic[6]*(1.0-states[1])-algebraic[7]*states[1] + algebraic[8] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0) + rates[3] = algebraic[8]*(1.0-states[3])-algebraic[9]*states[3] def compute_variables(voi, states, rates, constants, computed_constants, algebraic, external_variable): - algebraic[17] = external_variable(voi, states, rates, variables, 17) + algebraic[9] = external_variable(voi, states, rates, variables, 9) algebraic[0] = external_variable(voi, states, rates, variables, 0) - algebraic[1] = constants[7]*(states[0]-computed_constants[6]) - algebraic[3] = constants[9]*pow(states[2], 3.0)*states[1]*(states[0]-computed_constants[8]) - algebraic[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0) - algebraic[11] = 4.0*exp(states[0]/18.0) - algebraic[12] = 0.07*exp(states[0]/20.0) - algebraic[13] = 1.0/(exp((states[0]+30.0)/10.0)+1.0) - algebraic[2] = constants[15]*pow(states[3], 4.0)*(states[0]-computed_constants[14]) - algebraic[16] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0) + algebraic[1] = constants[2]*(states[0]-computed_constants[0]) + algebraic[3] = constants[3]*pow(states[2], 3.0)*states[1]*(states[0]-computed_constants[1]) + algebraic[4] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0) + algebraic[5] = 4.0*exp(states[0]/18.0) + algebraic[6] = 0.07*exp(states[0]/20.0) + algebraic[7] = 1.0/(exp((states[0]+30.0)/10.0)+1.0) + algebraic[2] = constants[4]*pow(states[3], 4.0)*(states[0]-computed_constants[2]) + algebraic[8] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0) diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.computed.constant.c b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.computed.constant.c index 4a61f2b747..96ead04c70 100644 --- a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.computed.constant.c +++ b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.computed.constant.c @@ -72,16 +72,16 @@ void deleteArray(double *array) void initialiseVariables(double voi, double *states, double *rates, double *constants, ExternalVariable externalVariable) { - constants[4] = 1.0; - constants[7] = 0.3; - constants[9] = 120.0; - constants[15] = 36.0; + constants[0] = 1.0; + constants[1] = 0.3; + constants[2] = 120.0; + constants[3] = 36.0; states[0] = 0.0; states[1] = 0.6; states[2] = 0.05; states[3] = 0.325; - algebraic[14] = externalVariable(voi, states, rates, variables, 14); - algebraic[5] = externalVariable(voi, states, rates, variables, 5); + algebraic[11] = externalVariable(voi, states, rates, variables, 11); + algebraic[4] = externalVariable(voi, states, rates, variables, 4); } void computeComputedConstants(double *constants, double *computedConstants) @@ -91,38 +91,38 @@ void computeComputedConstants(double *constants, double *computedConstants) void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { algebraic[0] = ((voi >= 10.0) && (voi <= 10.5))?-20.0:0.0; - algebraic[14] = externalVariable(voi, states, rates, variables, 14); - algebraic[5] = externalVariable(voi, states, rates, variables, 5); - algebraic[6] = algebraic[5]-10.613; - algebraic[1] = constants[7]*(states[0]-algebraic[6]); - algebraic[2] = constants[15]*pow(states[3], 4.0)*(states[0]-algebraic[14]); - algebraic[8] = algebraic[5]-115.0; - algebraic[3] = constants[9]*pow(states[2], 3.0)*states[1]*(states[0]-algebraic[8]); - rates[0] = -(-algebraic[0]+algebraic[3]+algebraic[2]+algebraic[1])/constants[4]; - algebraic[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0); - algebraic[11] = 4.0*exp(states[0]/18.0); - rates[2] = algebraic[10]*(1.0-states[2])-algebraic[11]*states[2]; - algebraic[12] = 0.07*exp(states[0]/20.0); - algebraic[13] = 1.0/(exp((states[0]+30.0)/10.0)+1.0); - rates[1] = algebraic[12]*(1.0-states[1])-algebraic[13]*states[1]; - algebraic[16] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0); - algebraic[17] = 0.125*exp(states[0]/80.0); - rates[3] = algebraic[16]*(1.0-states[3])-algebraic[17]*states[3]; + algebraic[11] = externalVariable(voi, states, rates, variables, 11); + algebraic[4] = externalVariable(voi, states, rates, variables, 4); + algebraic[5] = algebraic[4]-10.613; + algebraic[1] = constants[1]*(states[0]-algebraic[5]); + algebraic[2] = constants[3]*pow(states[3], 4.0)*(states[0]-algebraic[11]); + algebraic[6] = algebraic[4]-115.0; + algebraic[3] = constants[2]*pow(states[2], 3.0)*states[1]*(states[0]-algebraic[6]); + rates[0] = -(-algebraic[0]+algebraic[3]+algebraic[2]+algebraic[1])/constants[0]; + algebraic[7] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0); + algebraic[8] = 4.0*exp(states[0]/18.0); + rates[2] = algebraic[7]*(1.0-states[2])-algebraic[8]*states[2]; + algebraic[9] = 0.07*exp(states[0]/20.0); + algebraic[10] = 1.0/(exp((states[0]+30.0)/10.0)+1.0); + rates[1] = algebraic[9]*(1.0-states[1])-algebraic[10]*states[1]; + algebraic[12] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0); + algebraic[13] = 0.125*exp(states[0]/80.0); + rates[3] = algebraic[12]*(1.0-states[3])-algebraic[13]*states[3]; } void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { - algebraic[14] = externalVariable(voi, states, rates, variables, 14); - algebraic[5] = externalVariable(voi, states, rates, variables, 5); - algebraic[6] = algebraic[5]-10.613; - algebraic[1] = constants[7]*(states[0]-algebraic[6]); - algebraic[8] = algebraic[5]-115.0; - algebraic[3] = constants[9]*pow(states[2], 3.0)*states[1]*(states[0]-algebraic[8]); - algebraic[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0); - algebraic[11] = 4.0*exp(states[0]/18.0); - algebraic[12] = 0.07*exp(states[0]/20.0); - algebraic[13] = 1.0/(exp((states[0]+30.0)/10.0)+1.0); - algebraic[2] = constants[15]*pow(states[3], 4.0)*(states[0]-algebraic[14]); - algebraic[16] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0); - algebraic[17] = 0.125*exp(states[0]/80.0); + algebraic[11] = externalVariable(voi, states, rates, variables, 11); + algebraic[4] = externalVariable(voi, states, rates, variables, 4); + algebraic[5] = algebraic[4]-10.613; + algebraic[1] = constants[1]*(states[0]-algebraic[5]); + algebraic[6] = algebraic[4]-115.0; + algebraic[3] = constants[2]*pow(states[2], 3.0)*states[1]*(states[0]-algebraic[6]); + algebraic[7] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0); + algebraic[8] = 4.0*exp(states[0]/18.0); + algebraic[9] = 0.07*exp(states[0]/20.0); + algebraic[10] = 1.0/(exp((states[0]+30.0)/10.0)+1.0); + algebraic[2] = constants[3]*pow(states[3], 4.0)*(states[0]-algebraic[11]); + algebraic[12] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0); + algebraic[13] = 0.125*exp(states[0]/80.0); } diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.computed.constant.py b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.computed.constant.py index 53027ad4cb..c3a219727a 100644 --- a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.computed.constant.py +++ b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.computed.constant.py @@ -74,16 +74,16 @@ def create_variables_array(): def initialise_variables(voi, states, rates, constants, external_variable): - constants[4] = 1.0 - constants[7] = 0.3 - constants[9] = 120.0 - constants[15] = 36.0 + constants[0] = 1.0 + constants[1] = 0.3 + constants[2] = 120.0 + constants[3] = 36.0 states[0] = 0.0 states[1] = 0.6 states[2] = 0.05 states[3] = 0.325 - algebraic[14] = external_variable(voi, states, rates, variables, 14) - algebraic[5] = external_variable(voi, states, rates, variables, 5) + algebraic[11] = external_variable(voi, states, rates, variables, 11) + algebraic[4] = external_variable(voi, states, rates, variables, 4) def compute_computed_constants(constants, computed_constants): @@ -92,36 +92,36 @@ def compute_computed_constants(constants, computed_constants): def compute_rates(voi, states, rates, constants, computed_constants, algebraic, external_variable): algebraic[0] = -20.0 if and_func(geq_func(voi, 10.0), leq_func(voi, 10.5)) else 0.0 - algebraic[14] = external_variable(voi, states, rates, variables, 14) - algebraic[5] = external_variable(voi, states, rates, variables, 5) - algebraic[6] = algebraic[5]-10.613 - algebraic[1] = constants[7]*(states[0]-algebraic[6]) - algebraic[2] = constants[15]*pow(states[3], 4.0)*(states[0]-algebraic[14]) - algebraic[8] = algebraic[5]-115.0 - algebraic[3] = constants[9]*pow(states[2], 3.0)*states[1]*(states[0]-algebraic[8]) - rates[0] = -(-algebraic[0]+algebraic[3]+algebraic[2]+algebraic[1])/constants[4] - algebraic[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0) - algebraic[11] = 4.0*exp(states[0]/18.0) - rates[2] = algebraic[10]*(1.0-states[2])-algebraic[11]*states[2] - algebraic[12] = 0.07*exp(states[0]/20.0) - algebraic[13] = 1.0/(exp((states[0]+30.0)/10.0)+1.0) - rates[1] = algebraic[12]*(1.0-states[1])-algebraic[13]*states[1] - algebraic[16] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0) - algebraic[17] = 0.125*exp(states[0]/80.0) - rates[3] = algebraic[16]*(1.0-states[3])-algebraic[17]*states[3] + algebraic[11] = external_variable(voi, states, rates, variables, 11) + algebraic[4] = external_variable(voi, states, rates, variables, 4) + algebraic[5] = algebraic[4]-10.613 + algebraic[1] = constants[1]*(states[0]-algebraic[5]) + algebraic[2] = constants[3]*pow(states[3], 4.0)*(states[0]-algebraic[11]) + algebraic[6] = algebraic[4]-115.0 + algebraic[3] = constants[2]*pow(states[2], 3.0)*states[1]*(states[0]-algebraic[6]) + rates[0] = -(-algebraic[0]+algebraic[3]+algebraic[2]+algebraic[1])/constants[0] + algebraic[7] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0) + algebraic[8] = 4.0*exp(states[0]/18.0) + rates[2] = algebraic[7]*(1.0-states[2])-algebraic[8]*states[2] + algebraic[9] = 0.07*exp(states[0]/20.0) + algebraic[10] = 1.0/(exp((states[0]+30.0)/10.0)+1.0) + rates[1] = algebraic[9]*(1.0-states[1])-algebraic[10]*states[1] + algebraic[12] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0) + algebraic[13] = 0.125*exp(states[0]/80.0) + rates[3] = algebraic[12]*(1.0-states[3])-algebraic[13]*states[3] def compute_variables(voi, states, rates, constants, computed_constants, algebraic, external_variable): - algebraic[14] = external_variable(voi, states, rates, variables, 14) - algebraic[5] = external_variable(voi, states, rates, variables, 5) - algebraic[6] = algebraic[5]-10.613 - algebraic[1] = constants[7]*(states[0]-algebraic[6]) - algebraic[8] = algebraic[5]-115.0 - algebraic[3] = constants[9]*pow(states[2], 3.0)*states[1]*(states[0]-algebraic[8]) - algebraic[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0) - algebraic[11] = 4.0*exp(states[0]/18.0) - algebraic[12] = 0.07*exp(states[0]/20.0) - algebraic[13] = 1.0/(exp((states[0]+30.0)/10.0)+1.0) - algebraic[2] = constants[15]*pow(states[3], 4.0)*(states[0]-algebraic[14]) - algebraic[16] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0) - algebraic[17] = 0.125*exp(states[0]/80.0) + algebraic[11] = external_variable(voi, states, rates, variables, 11) + algebraic[4] = external_variable(voi, states, rates, variables, 4) + algebraic[5] = algebraic[4]-10.613 + algebraic[1] = constants[1]*(states[0]-algebraic[5]) + algebraic[6] = algebraic[4]-115.0 + algebraic[3] = constants[2]*pow(states[2], 3.0)*states[1]*(states[0]-algebraic[6]) + algebraic[7] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0) + algebraic[8] = 4.0*exp(states[0]/18.0) + algebraic[9] = 0.07*exp(states[0]/20.0) + algebraic[10] = 1.0/(exp((states[0]+30.0)/10.0)+1.0) + algebraic[2] = constants[3]*pow(states[3], 4.0)*(states[0]-algebraic[11]) + algebraic[12] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0) + algebraic[13] = 0.125*exp(states[0]/80.0) diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.constant.c b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.constant.c index be516f51bd..e78468a05c 100644 --- a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.constant.c +++ b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.constant.c @@ -72,55 +72,55 @@ void deleteArray(double *array) void initialiseVariables(double voi, double *states, double *rates, double *constants, ExternalVariable externalVariable) { - constants[5] = 0.0; - constants[7] = 0.3; - constants[15] = 36.0; + constants[0] = 0.0; + constants[1] = 0.3; + constants[2] = 36.0; states[0] = 0.0; states[1] = 0.6; states[2] = 0.05; states[3] = 0.325; - algebraic[9] = externalVariable(voi, states, rates, variables, 9); + algebraic[5] = externalVariable(voi, states, rates, variables, 5); algebraic[4] = externalVariable(voi, states, rates, variables, 4); } void computeComputedConstants(double *constants, double *computedConstants) { - computedConstants[6] = constants[5]-10.613; - computedConstants[8] = constants[5]-115.0; - computedConstants[14] = constants[5]+12.0; + computedConstants[0] = constants[0]-10.613; + computedConstants[1] = constants[0]-115.0; + computedConstants[2] = constants[0]+12.0; } void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { algebraic[0] = ((voi >= 10.0) && (voi <= 10.5))?-20.0:0.0; - algebraic[9] = externalVariable(voi, states, rates, variables, 9); + algebraic[5] = externalVariable(voi, states, rates, variables, 5); algebraic[4] = externalVariable(voi, states, rates, variables, 4); - algebraic[1] = constants[7]*(states[0]-computedConstants[6]); - algebraic[2] = constants[15]*pow(states[3], 4.0)*(states[0]-computedConstants[14]); - algebraic[3] = algebraic[9]*pow(states[2], 3.0)*states[1]*(states[0]-computedConstants[8]); + algebraic[1] = constants[1]*(states[0]-computedConstants[0]); + algebraic[2] = constants[2]*pow(states[3], 4.0)*(states[0]-computedConstants[2]); + algebraic[3] = algebraic[5]*pow(states[2], 3.0)*states[1]*(states[0]-computedConstants[1]); rates[0] = -(-algebraic[0]+algebraic[3]+algebraic[2]+algebraic[1])/algebraic[4]; - algebraic[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0); - algebraic[11] = 4.0*exp(states[0]/18.0); - rates[2] = algebraic[10]*(1.0-states[2])-algebraic[11]*states[2]; - algebraic[12] = 0.07*exp(states[0]/20.0); - algebraic[13] = 1.0/(exp((states[0]+30.0)/10.0)+1.0); - rates[1] = algebraic[12]*(1.0-states[1])-algebraic[13]*states[1]; - algebraic[16] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0); - algebraic[17] = 0.125*exp(states[0]/80.0); - rates[3] = algebraic[16]*(1.0-states[3])-algebraic[17]*states[3]; + algebraic[6] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0); + algebraic[7] = 4.0*exp(states[0]/18.0); + rates[2] = algebraic[6]*(1.0-states[2])-algebraic[7]*states[2]; + algebraic[8] = 0.07*exp(states[0]/20.0); + algebraic[9] = 1.0/(exp((states[0]+30.0)/10.0)+1.0); + rates[1] = algebraic[8]*(1.0-states[1])-algebraic[9]*states[1]; + algebraic[10] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0); + algebraic[11] = 0.125*exp(states[0]/80.0); + rates[3] = algebraic[10]*(1.0-states[3])-algebraic[11]*states[3]; } void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { - algebraic[1] = constants[7]*(states[0]-computedConstants[6]); - algebraic[9] = externalVariable(voi, states, rates, variables, 9); - algebraic[3] = algebraic[9]*pow(states[2], 3.0)*states[1]*(states[0]-computedConstants[8]); - algebraic[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0); - algebraic[11] = 4.0*exp(states[0]/18.0); - algebraic[12] = 0.07*exp(states[0]/20.0); - algebraic[13] = 1.0/(exp((states[0]+30.0)/10.0)+1.0); - algebraic[2] = constants[15]*pow(states[3], 4.0)*(states[0]-computedConstants[14]); - algebraic[16] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0); - algebraic[17] = 0.125*exp(states[0]/80.0); + algebraic[1] = constants[1]*(states[0]-computedConstants[0]); + algebraic[5] = externalVariable(voi, states, rates, variables, 5); + algebraic[3] = algebraic[5]*pow(states[2], 3.0)*states[1]*(states[0]-computedConstants[1]); + algebraic[6] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0); + algebraic[7] = 4.0*exp(states[0]/18.0); + algebraic[8] = 0.07*exp(states[0]/20.0); + algebraic[9] = 1.0/(exp((states[0]+30.0)/10.0)+1.0); + algebraic[2] = constants[2]*pow(states[3], 4.0)*(states[0]-computedConstants[2]); + algebraic[10] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0); + algebraic[11] = 0.125*exp(states[0]/80.0); algebraic[4] = externalVariable(voi, states, rates, variables, 4); } diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.constant.py b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.constant.py index e518a203f6..fb7c5c7ffc 100644 --- a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.constant.py +++ b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.constant.py @@ -74,51 +74,51 @@ def create_variables_array(): def initialise_variables(voi, states, rates, constants, external_variable): - constants[5] = 0.0 - constants[7] = 0.3 - constants[15] = 36.0 + constants[0] = 0.0 + constants[1] = 0.3 + constants[2] = 36.0 states[0] = 0.0 states[1] = 0.6 states[2] = 0.05 states[3] = 0.325 - algebraic[9] = external_variable(voi, states, rates, variables, 9) + algebraic[5] = external_variable(voi, states, rates, variables, 5) algebraic[4] = external_variable(voi, states, rates, variables, 4) def compute_computed_constants(constants, computed_constants): - computed_constants[6] = constants[5]-10.613 - computed_constants[8] = constants[5]-115.0 - computed_constants[14] = constants[5]+12.0 + computed_constants[0] = constants[0]-10.613 + computed_constants[1] = constants[0]-115.0 + computed_constants[2] = constants[0]+12.0 def compute_rates(voi, states, rates, constants, computed_constants, algebraic, external_variable): algebraic[0] = -20.0 if and_func(geq_func(voi, 10.0), leq_func(voi, 10.5)) else 0.0 - algebraic[9] = external_variable(voi, states, rates, variables, 9) + algebraic[5] = external_variable(voi, states, rates, variables, 5) algebraic[4] = external_variable(voi, states, rates, variables, 4) - algebraic[1] = constants[7]*(states[0]-computed_constants[6]) - algebraic[2] = constants[15]*pow(states[3], 4.0)*(states[0]-computed_constants[14]) - algebraic[3] = algebraic[9]*pow(states[2], 3.0)*states[1]*(states[0]-computed_constants[8]) + algebraic[1] = constants[1]*(states[0]-computed_constants[0]) + algebraic[2] = constants[2]*pow(states[3], 4.0)*(states[0]-computed_constants[2]) + algebraic[3] = algebraic[5]*pow(states[2], 3.0)*states[1]*(states[0]-computed_constants[1]) rates[0] = -(-algebraic[0]+algebraic[3]+algebraic[2]+algebraic[1])/algebraic[4] - algebraic[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0) - algebraic[11] = 4.0*exp(states[0]/18.0) - rates[2] = algebraic[10]*(1.0-states[2])-algebraic[11]*states[2] - algebraic[12] = 0.07*exp(states[0]/20.0) - algebraic[13] = 1.0/(exp((states[0]+30.0)/10.0)+1.0) - rates[1] = algebraic[12]*(1.0-states[1])-algebraic[13]*states[1] - algebraic[16] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0) - algebraic[17] = 0.125*exp(states[0]/80.0) - rates[3] = algebraic[16]*(1.0-states[3])-algebraic[17]*states[3] + algebraic[6] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0) + algebraic[7] = 4.0*exp(states[0]/18.0) + rates[2] = algebraic[6]*(1.0-states[2])-algebraic[7]*states[2] + algebraic[8] = 0.07*exp(states[0]/20.0) + algebraic[9] = 1.0/(exp((states[0]+30.0)/10.0)+1.0) + rates[1] = algebraic[8]*(1.0-states[1])-algebraic[9]*states[1] + algebraic[10] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0) + algebraic[11] = 0.125*exp(states[0]/80.0) + rates[3] = algebraic[10]*(1.0-states[3])-algebraic[11]*states[3] def compute_variables(voi, states, rates, constants, computed_constants, algebraic, external_variable): - algebraic[1] = constants[7]*(states[0]-computed_constants[6]) - algebraic[9] = external_variable(voi, states, rates, variables, 9) - algebraic[3] = algebraic[9]*pow(states[2], 3.0)*states[1]*(states[0]-computed_constants[8]) - algebraic[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0) - algebraic[11] = 4.0*exp(states[0]/18.0) - algebraic[12] = 0.07*exp(states[0]/20.0) - algebraic[13] = 1.0/(exp((states[0]+30.0)/10.0)+1.0) - algebraic[2] = constants[15]*pow(states[3], 4.0)*(states[0]-computed_constants[14]) - algebraic[16] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0) - algebraic[17] = 0.125*exp(states[0]/80.0) + algebraic[1] = constants[1]*(states[0]-computed_constants[0]) + algebraic[5] = external_variable(voi, states, rates, variables, 5) + algebraic[3] = algebraic[5]*pow(states[2], 3.0)*states[1]*(states[0]-computed_constants[1]) + algebraic[6] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0) + algebraic[7] = 4.0*exp(states[0]/18.0) + algebraic[8] = 0.07*exp(states[0]/20.0) + algebraic[9] = 1.0/(exp((states[0]+30.0)/10.0)+1.0) + algebraic[2] = constants[2]*pow(states[3], 4.0)*(states[0]-computed_constants[2]) + algebraic[10] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0) + algebraic[11] = 0.125*exp(states[0]/80.0) algebraic[4] = external_variable(voi, states, rates, variables, 4) diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.state.c b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.state.c index a8baed030d..daca5bba88 100644 --- a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.state.c +++ b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.state.c @@ -72,43 +72,43 @@ void deleteArray(double *array) void initialiseVariables(double voi, double *states, double *rates, double *constants, ExternalVariable externalVariable) { - constants[5] = 1.0; - constants[6] = 0.0; - constants[8] = 0.3; - constants[10] = 120.0; - constants[17] = 36.0; + constants[0] = 1.0; + constants[1] = 0.0; + constants[2] = 0.3; + constants[3] = 120.0; + constants[4] = 36.0; states[0] = 0.6; states[1] = 0.325; algebraic[1] = externalVariable(voi, states, rates, variables, 1); - algebraic[11] = externalVariable(voi, states, rates, variables, 11); + algebraic[5] = externalVariable(voi, states, rates, variables, 5); } void computeComputedConstants(double *constants, double *computedConstants) { - computedConstants[7] = constants[6]-10.613; - computedConstants[9] = constants[6]-115.0; - computedConstants[16] = constants[6]+12.0; + computedConstants[0] = constants[1]-10.613; + computedConstants[1] = constants[1]-115.0; + computedConstants[2] = constants[1]+12.0; } void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { algebraic[1] = externalVariable(voi, states, rates, variables, 1); - algebraic[14] = 0.07*exp(algebraic[1]/20.0); - algebraic[15] = 1.0/(exp((algebraic[1]+30.0)/10.0)+1.0); - rates[0] = algebraic[14]*(1.0-states[0])-algebraic[15]*states[0]; - algebraic[18] = 0.01*(algebraic[1]+10.0)/(exp((algebraic[1]+10.0)/10.0)-1.0); - algebraic[19] = 0.125*exp(algebraic[1]/80.0); - rates[1] = algebraic[18]*(1.0-states[1])-algebraic[19]*states[1]; + algebraic[8] = 0.07*exp(algebraic[1]/20.0); + algebraic[9] = 1.0/(exp((algebraic[1]+30.0)/10.0)+1.0); + rates[0] = algebraic[8]*(1.0-states[0])-algebraic[9]*states[0]; + algebraic[10] = 0.01*(algebraic[1]+10.0)/(exp((algebraic[1]+10.0)/10.0)-1.0); + algebraic[11] = 0.125*exp(algebraic[1]/80.0); + rates[1] = algebraic[10]*(1.0-states[1])-algebraic[11]*states[1]; } void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { algebraic[0] = ((voi >= 10.0) && (voi <= 10.5))?-20.0:0.0; algebraic[1] = externalVariable(voi, states, rates, variables, 1); - algebraic[2] = constants[8]*(algebraic[1]-computedConstants[7]); - algebraic[11] = externalVariable(voi, states, rates, variables, 11); - algebraic[4] = constants[10]*pow(algebraic[11], 3.0)*states[0]*(algebraic[1]-computedConstants[9]); - algebraic[12] = 0.1*(algebraic[1]+25.0)/(exp((algebraic[1]+25.0)/10.0)-1.0); - algebraic[13] = 4.0*exp(algebraic[1]/18.0); - algebraic[3] = constants[17]*pow(states[1], 4.0)*(algebraic[1]-computedConstants[16]); + algebraic[2] = constants[2]*(algebraic[1]-computedConstants[0]); + algebraic[5] = externalVariable(voi, states, rates, variables, 5); + algebraic[4] = constants[3]*pow(algebraic[5], 3.0)*states[0]*(algebraic[1]-computedConstants[1]); + algebraic[6] = 0.1*(algebraic[1]+25.0)/(exp((algebraic[1]+25.0)/10.0)-1.0); + algebraic[7] = 4.0*exp(algebraic[1]/18.0); + algebraic[3] = constants[4]*pow(states[1], 4.0)*(algebraic[1]-computedConstants[2]); } diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.state.py b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.state.py index 914194e7fb..02be0961dc 100644 --- a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.state.py +++ b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.state.py @@ -74,39 +74,39 @@ def create_variables_array(): def initialise_variables(voi, states, rates, constants, external_variable): - constants[5] = 1.0 - constants[6] = 0.0 - constants[8] = 0.3 - constants[10] = 120.0 - constants[17] = 36.0 + constants[0] = 1.0 + constants[1] = 0.0 + constants[2] = 0.3 + constants[3] = 120.0 + constants[4] = 36.0 states[0] = 0.6 states[1] = 0.325 algebraic[1] = external_variable(voi, states, rates, variables, 1) - algebraic[11] = external_variable(voi, states, rates, variables, 11) + algebraic[5] = external_variable(voi, states, rates, variables, 5) def compute_computed_constants(constants, computed_constants): - computed_constants[7] = constants[6]-10.613 - computed_constants[9] = constants[6]-115.0 - computed_constants[16] = constants[6]+12.0 + computed_constants[0] = constants[1]-10.613 + computed_constants[1] = constants[1]-115.0 + computed_constants[2] = constants[1]+12.0 def compute_rates(voi, states, rates, constants, computed_constants, algebraic, external_variable): algebraic[1] = external_variable(voi, states, rates, variables, 1) - algebraic[14] = 0.07*exp(algebraic[1]/20.0) - algebraic[15] = 1.0/(exp((algebraic[1]+30.0)/10.0)+1.0) - rates[0] = algebraic[14]*(1.0-states[0])-algebraic[15]*states[0] - algebraic[18] = 0.01*(algebraic[1]+10.0)/(exp((algebraic[1]+10.0)/10.0)-1.0) - algebraic[19] = 0.125*exp(algebraic[1]/80.0) - rates[1] = algebraic[18]*(1.0-states[1])-algebraic[19]*states[1] + algebraic[8] = 0.07*exp(algebraic[1]/20.0) + algebraic[9] = 1.0/(exp((algebraic[1]+30.0)/10.0)+1.0) + rates[0] = algebraic[8]*(1.0-states[0])-algebraic[9]*states[0] + algebraic[10] = 0.01*(algebraic[1]+10.0)/(exp((algebraic[1]+10.0)/10.0)-1.0) + algebraic[11] = 0.125*exp(algebraic[1]/80.0) + rates[1] = algebraic[10]*(1.0-states[1])-algebraic[11]*states[1] def compute_variables(voi, states, rates, constants, computed_constants, algebraic, external_variable): algebraic[0] = -20.0 if and_func(geq_func(voi, 10.0), leq_func(voi, 10.5)) else 0.0 algebraic[1] = external_variable(voi, states, rates, variables, 1) - algebraic[2] = constants[8]*(algebraic[1]-computed_constants[7]) - algebraic[11] = external_variable(voi, states, rates, variables, 11) - algebraic[4] = constants[10]*pow(algebraic[11], 3.0)*states[0]*(algebraic[1]-computed_constants[9]) - algebraic[12] = 0.1*(algebraic[1]+25.0)/(exp((algebraic[1]+25.0)/10.0)-1.0) - algebraic[13] = 4.0*exp(algebraic[1]/18.0) - algebraic[3] = constants[17]*pow(states[1], 4.0)*(algebraic[1]-computed_constants[16]) + algebraic[2] = constants[2]*(algebraic[1]-computed_constants[0]) + algebraic[5] = external_variable(voi, states, rates, variables, 5) + algebraic[4] = constants[3]*pow(algebraic[5], 3.0)*states[0]*(algebraic[1]-computed_constants[1]) + algebraic[6] = 0.1*(algebraic[1]+25.0)/(exp((algebraic[1]+25.0)/10.0)-1.0) + algebraic[7] = 4.0*exp(algebraic[1]/18.0) + algebraic[3] = constants[4]*pow(states[1], 4.0)*(algebraic[1]-computed_constants[2]) diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.external.c b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.external.c index b21ab1d041..6daaf81cff 100644 --- a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.external.c +++ b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.external.c @@ -72,46 +72,46 @@ void deleteArray(double *array) void initialiseVariables(double voi, double *states, double *rates, double *constants, ExternalVariable externalVariable) { - constants[5] = 1.0; - constants[6] = 0.0; - constants[8] = 0.3; - constants[10] = 120.0; - constants[16] = 36.0; + constants[0] = 1.0; + constants[1] = 0.0; + constants[2] = 0.3; + constants[3] = 120.0; + constants[4] = 36.0; states[0] = 0.6; states[1] = 0.05; states[2] = 0.325; algebraic[1] = externalVariable(voi, states, rates, variables, 1); - algebraic[17] = externalVariable(voi, states, rates, variables, 17); + algebraic[9] = externalVariable(voi, states, rates, variables, 9); algebraic[4] = externalVariable(voi, states, rates, variables, 4); } void computeComputedConstants(double *constants, double *computedConstants) { - computedConstants[7] = constants[6]-10.613; - computedConstants[9] = constants[6]-115.0; - computedConstants[15] = constants[6]+12.0; + computedConstants[0] = constants[1]-10.613; + computedConstants[1] = constants[1]-115.0; + computedConstants[2] = constants[1]+12.0; } void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { algebraic[1] = externalVariable(voi, states, rates, variables, 1); - algebraic[11] = 0.1*(algebraic[1]+25.0)/(exp((algebraic[1]+25.0)/10.0)-1.0); - algebraic[12] = 4.0*exp(algebraic[1]/18.0); - rates[1] = algebraic[11]*(1.0-states[1])-algebraic[12]*states[1]; - algebraic[13] = 0.07*exp(algebraic[1]/20.0); - algebraic[14] = 1.0/(exp((algebraic[1]+30.0)/10.0)+1.0); - rates[0] = algebraic[13]*(1.0-states[0])-algebraic[14]*states[0]; - algebraic[17] = externalVariable(voi, states, rates, variables, 17); - algebraic[18] = 0.125*exp(algebraic[1]/80.0); - rates[2] = algebraic[17]*(1.0-states[2])-algebraic[18]*states[2]; + algebraic[5] = 0.1*(algebraic[1]+25.0)/(exp((algebraic[1]+25.0)/10.0)-1.0); + algebraic[6] = 4.0*exp(algebraic[1]/18.0); + rates[1] = algebraic[5]*(1.0-states[1])-algebraic[6]*states[1]; + algebraic[7] = 0.07*exp(algebraic[1]/20.0); + algebraic[8] = 1.0/(exp((algebraic[1]+30.0)/10.0)+1.0); + rates[0] = algebraic[7]*(1.0-states[0])-algebraic[8]*states[0]; + algebraic[9] = externalVariable(voi, states, rates, variables, 9); + algebraic[10] = 0.125*exp(algebraic[1]/80.0); + rates[2] = algebraic[9]*(1.0-states[2])-algebraic[10]*states[2]; } void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { algebraic[0] = ((voi >= 10.0) && (voi <= 10.5))?-20.0:0.0; algebraic[1] = externalVariable(voi, states, rates, variables, 1); - algebraic[2] = constants[8]*(algebraic[1]-computedConstants[7]); - algebraic[17] = externalVariable(voi, states, rates, variables, 17); + algebraic[2] = constants[2]*(algebraic[1]-computedConstants[0]); + algebraic[9] = externalVariable(voi, states, rates, variables, 9); algebraic[4] = externalVariable(voi, states, rates, variables, 4); - algebraic[3] = constants[16]*pow(states[2], 4.0)*(algebraic[1]-computedConstants[15]); + algebraic[3] = constants[4]*pow(states[2], 4.0)*(algebraic[1]-computedConstants[2]); } diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.external.py b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.external.py index d64291b4a8..0cbe773e17 100644 --- a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.external.py +++ b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.external.py @@ -74,42 +74,42 @@ def create_variables_array(): def initialise_variables(voi, states, rates, constants, external_variable): - constants[5] = 1.0 - constants[6] = 0.0 - constants[8] = 0.3 - constants[10] = 120.0 - constants[16] = 36.0 + constants[0] = 1.0 + constants[1] = 0.0 + constants[2] = 0.3 + constants[3] = 120.0 + constants[4] = 36.0 states[0] = 0.6 states[1] = 0.05 states[2] = 0.325 algebraic[1] = external_variable(voi, states, rates, variables, 1) - algebraic[17] = external_variable(voi, states, rates, variables, 17) + algebraic[9] = external_variable(voi, states, rates, variables, 9) algebraic[4] = external_variable(voi, states, rates, variables, 4) def compute_computed_constants(constants, computed_constants): - computed_constants[7] = constants[6]-10.613 - computed_constants[9] = constants[6]-115.0 - computed_constants[15] = constants[6]+12.0 + computed_constants[0] = constants[1]-10.613 + computed_constants[1] = constants[1]-115.0 + computed_constants[2] = constants[1]+12.0 def compute_rates(voi, states, rates, constants, computed_constants, algebraic, external_variable): algebraic[1] = external_variable(voi, states, rates, variables, 1) - algebraic[11] = 0.1*(algebraic[1]+25.0)/(exp((algebraic[1]+25.0)/10.0)-1.0) - algebraic[12] = 4.0*exp(algebraic[1]/18.0) - rates[1] = algebraic[11]*(1.0-states[1])-algebraic[12]*states[1] - algebraic[13] = 0.07*exp(algebraic[1]/20.0) - algebraic[14] = 1.0/(exp((algebraic[1]+30.0)/10.0)+1.0) - rates[0] = algebraic[13]*(1.0-states[0])-algebraic[14]*states[0] - algebraic[17] = external_variable(voi, states, rates, variables, 17) - algebraic[18] = 0.125*exp(algebraic[1]/80.0) - rates[2] = algebraic[17]*(1.0-states[2])-algebraic[18]*states[2] + algebraic[5] = 0.1*(algebraic[1]+25.0)/(exp((algebraic[1]+25.0)/10.0)-1.0) + algebraic[6] = 4.0*exp(algebraic[1]/18.0) + rates[1] = algebraic[5]*(1.0-states[1])-algebraic[6]*states[1] + algebraic[7] = 0.07*exp(algebraic[1]/20.0) + algebraic[8] = 1.0/(exp((algebraic[1]+30.0)/10.0)+1.0) + rates[0] = algebraic[7]*(1.0-states[0])-algebraic[8]*states[0] + algebraic[9] = external_variable(voi, states, rates, variables, 9) + algebraic[10] = 0.125*exp(algebraic[1]/80.0) + rates[2] = algebraic[9]*(1.0-states[2])-algebraic[10]*states[2] def compute_variables(voi, states, rates, constants, computed_constants, algebraic, external_variable): algebraic[0] = -20.0 if and_func(geq_func(voi, 10.0), leq_func(voi, 10.5)) else 0.0 algebraic[1] = external_variable(voi, states, rates, variables, 1) - algebraic[2] = constants[8]*(algebraic[1]-computed_constants[7]) - algebraic[17] = external_variable(voi, states, rates, variables, 17) + algebraic[2] = constants[2]*(algebraic[1]-computed_constants[0]) + algebraic[9] = external_variable(voi, states, rates, variables, 9) algebraic[4] = external_variable(voi, states, rates, variables, 4) - algebraic[3] = constants[16]*pow(states[2], 4.0)*(algebraic[1]-computed_constants[15]) + algebraic[3] = constants[4]*pow(states[2], 4.0)*(algebraic[1]-computed_constants[2]) diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.py b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.py index 87eb31f08e..68e90fdd0d 100644 --- a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.py +++ b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.py @@ -73,11 +73,11 @@ def create_variables_array(): def initialise_variables(states, rates, constants): - constants[4] = 1.0 - constants[5] = 0.0 - constants[7] = 0.3 - constants[9] = 120.0 - constants[15] = 36.0 + constants[0] = 1.0 + constants[1] = 0.0 + constants[2] = 0.3 + constants[3] = 120.0 + constants[4] = 36.0 states[0] = 0.0 states[1] = 0.6 states[2] = 0.05 @@ -85,35 +85,35 @@ def initialise_variables(states, rates, constants): def compute_computed_constants(constants, computed_constants): - computed_constants[6] = constants[5]-10.613 - computed_constants[8] = constants[5]-115.0 - computed_constants[14] = constants[5]+12.0 + computed_constants[0] = constants[1]-10.613 + computed_constants[1] = constants[1]-115.0 + computed_constants[2] = constants[1]+12.0 def compute_rates(voi, states, rates, constants, computed_constants, algebraic): algebraic[0] = -20.0 if and_func(geq_func(voi, 10.0), leq_func(voi, 10.5)) else 0.0 - algebraic[1] = constants[7]*(states[0]-computed_constants[6]) - algebraic[2] = constants[15]*pow(states[3], 4.0)*(states[0]-computed_constants[14]) - algebraic[3] = constants[9]*pow(states[2], 3.0)*states[1]*(states[0]-computed_constants[8]) - rates[0] = -(-algebraic[0]+algebraic[3]+algebraic[2]+algebraic[1])/constants[4] - algebraic[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0) - algebraic[11] = 4.0*exp(states[0]/18.0) - rates[2] = algebraic[10]*(1.0-states[2])-algebraic[11]*states[2] - algebraic[12] = 0.07*exp(states[0]/20.0) - algebraic[13] = 1.0/(exp((states[0]+30.0)/10.0)+1.0) - rates[1] = algebraic[12]*(1.0-states[1])-algebraic[13]*states[1] - algebraic[16] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0) - algebraic[17] = 0.125*exp(states[0]/80.0) - rates[3] = algebraic[16]*(1.0-states[3])-algebraic[17]*states[3] + algebraic[1] = constants[2]*(states[0]-computed_constants[0]) + algebraic[2] = constants[4]*pow(states[3], 4.0)*(states[0]-computed_constants[2]) + algebraic[3] = constants[3]*pow(states[2], 3.0)*states[1]*(states[0]-computed_constants[1]) + rates[0] = -(-algebraic[0]+algebraic[3]+algebraic[2]+algebraic[1])/constants[0] + algebraic[4] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0) + algebraic[5] = 4.0*exp(states[0]/18.0) + rates[2] = algebraic[4]*(1.0-states[2])-algebraic[5]*states[2] + algebraic[6] = 0.07*exp(states[0]/20.0) + algebraic[7] = 1.0/(exp((states[0]+30.0)/10.0)+1.0) + rates[1] = algebraic[6]*(1.0-states[1])-algebraic[7]*states[1] + algebraic[8] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0) + algebraic[9] = 0.125*exp(states[0]/80.0) + rates[3] = algebraic[8]*(1.0-states[3])-algebraic[9]*states[3] def compute_variables(voi, states, rates, constants, computed_constants, algebraic): - algebraic[1] = constants[7]*(states[0]-computed_constants[6]) - algebraic[3] = constants[9]*pow(states[2], 3.0)*states[1]*(states[0]-computed_constants[8]) - algebraic[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0) - algebraic[11] = 4.0*exp(states[0]/18.0) - algebraic[12] = 0.07*exp(states[0]/20.0) - algebraic[13] = 1.0/(exp((states[0]+30.0)/10.0)+1.0) - algebraic[2] = constants[15]*pow(states[3], 4.0)*(states[0]-computed_constants[14]) - algebraic[16] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0) - algebraic[17] = 0.125*exp(states[0]/80.0) + algebraic[1] = constants[2]*(states[0]-computed_constants[0]) + algebraic[3] = constants[3]*pow(states[2], 3.0)*states[1]*(states[0]-computed_constants[1]) + algebraic[4] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0) + algebraic[5] = 4.0*exp(states[0]/18.0) + algebraic[6] = 0.07*exp(states[0]/20.0) + algebraic[7] = 1.0/(exp((states[0]+30.0)/10.0)+1.0) + algebraic[2] = constants[4]*pow(states[3], 4.0)*(states[0]-computed_constants[2]) + algebraic[8] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0) + algebraic[9] = 0.125*exp(states[0]/80.0) diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.state.c b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.state.c index 083b39125e..fa7028471e 100644 --- a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.state.c +++ b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.state.c @@ -72,50 +72,50 @@ void deleteArray(double *array) void initialiseVariables(double voi, double *states, double *rates, double *constants, ExternalVariable externalVariable) { - constants[4] = 1.0; - constants[5] = 0.0; - constants[7] = 0.3; - constants[9] = 120.0; - constants[16] = 36.0; + constants[0] = 1.0; + constants[1] = 0.0; + constants[2] = 0.3; + constants[3] = 120.0; + constants[4] = 36.0; states[0] = 0.0; states[1] = 0.6; states[2] = 0.325; - algebraic[10] = externalVariable(voi, states, rates, variables, 10); + algebraic[4] = externalVariable(voi, states, rates, variables, 4); } void computeComputedConstants(double *constants, double *computedConstants) { - computedConstants[6] = constants[5]-10.613; - computedConstants[8] = constants[5]-115.0; - computedConstants[15] = constants[5]+12.0; + computedConstants[0] = constants[1]-10.613; + computedConstants[1] = constants[1]-115.0; + computedConstants[2] = constants[1]+12.0; } void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { algebraic[0] = ((voi >= 10.0) && (voi <= 10.5))?-20.0:0.0; - algebraic[1] = constants[7]*(states[0]-computedConstants[6]); - algebraic[2] = constants[16]*pow(states[2], 4.0)*(states[0]-computedConstants[15]); - algebraic[10] = externalVariable(voi, states, rates, variables, 10); - algebraic[3] = constants[9]*pow(algebraic[10], 3.0)*states[1]*(states[0]-computedConstants[8]); - rates[0] = -(-algebraic[0]+algebraic[3]+algebraic[2]+algebraic[1])/constants[4]; - algebraic[13] = 0.07*exp(states[0]/20.0); - algebraic[14] = 1.0/(exp((states[0]+30.0)/10.0)+1.0); - rates[1] = algebraic[13]*(1.0-states[1])-algebraic[14]*states[1]; - algebraic[17] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0); - algebraic[18] = 0.125*exp(states[0]/80.0); - rates[2] = algebraic[17]*(1.0-states[2])-algebraic[18]*states[2]; + algebraic[1] = constants[2]*(states[0]-computedConstants[0]); + algebraic[2] = constants[4]*pow(states[2], 4.0)*(states[0]-computedConstants[2]); + algebraic[4] = externalVariable(voi, states, rates, variables, 4); + algebraic[3] = constants[3]*pow(algebraic[4], 3.0)*states[1]*(states[0]-computedConstants[1]); + rates[0] = -(-algebraic[0]+algebraic[3]+algebraic[2]+algebraic[1])/constants[0]; + algebraic[7] = 0.07*exp(states[0]/20.0); + algebraic[8] = 1.0/(exp((states[0]+30.0)/10.0)+1.0); + rates[1] = algebraic[7]*(1.0-states[1])-algebraic[8]*states[1]; + algebraic[9] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0); + algebraic[10] = 0.125*exp(states[0]/80.0); + rates[2] = algebraic[9]*(1.0-states[2])-algebraic[10]*states[2]; } void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { - algebraic[1] = constants[7]*(states[0]-computedConstants[6]); - algebraic[10] = externalVariable(voi, states, rates, variables, 10); - algebraic[3] = constants[9]*pow(algebraic[10], 3.0)*states[1]*(states[0]-computedConstants[8]); - algebraic[11] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0); - algebraic[12] = 4.0*exp(states[0]/18.0); - algebraic[13] = 0.07*exp(states[0]/20.0); - algebraic[14] = 1.0/(exp((states[0]+30.0)/10.0)+1.0); - algebraic[2] = constants[16]*pow(states[2], 4.0)*(states[0]-computedConstants[15]); - algebraic[17] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0); - algebraic[18] = 0.125*exp(states[0]/80.0); + algebraic[1] = constants[2]*(states[0]-computedConstants[0]); + algebraic[4] = externalVariable(voi, states, rates, variables, 4); + algebraic[3] = constants[3]*pow(algebraic[4], 3.0)*states[1]*(states[0]-computedConstants[1]); + algebraic[5] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0); + algebraic[6] = 4.0*exp(states[0]/18.0); + algebraic[7] = 0.07*exp(states[0]/20.0); + algebraic[8] = 1.0/(exp((states[0]+30.0)/10.0)+1.0); + algebraic[2] = constants[4]*pow(states[2], 4.0)*(states[0]-computedConstants[2]); + algebraic[9] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0); + algebraic[10] = 0.125*exp(states[0]/80.0); } diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.state.py b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.state.py index bee8d59e4f..d1748c002e 100644 --- a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.state.py +++ b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.state.py @@ -74,46 +74,46 @@ def create_variables_array(): def initialise_variables(voi, states, rates, constants, external_variable): - constants[4] = 1.0 - constants[5] = 0.0 - constants[7] = 0.3 - constants[9] = 120.0 - constants[16] = 36.0 + constants[0] = 1.0 + constants[1] = 0.0 + constants[2] = 0.3 + constants[3] = 120.0 + constants[4] = 36.0 states[0] = 0.0 states[1] = 0.6 states[2] = 0.325 - algebraic[10] = external_variable(voi, states, rates, variables, 10) + algebraic[4] = external_variable(voi, states, rates, variables, 4) def compute_computed_constants(constants, computed_constants): - computed_constants[6] = constants[5]-10.613 - computed_constants[8] = constants[5]-115.0 - computed_constants[15] = constants[5]+12.0 + computed_constants[0] = constants[1]-10.613 + computed_constants[1] = constants[1]-115.0 + computed_constants[2] = constants[1]+12.0 def compute_rates(voi, states, rates, constants, computed_constants, algebraic, external_variable): algebraic[0] = -20.0 if and_func(geq_func(voi, 10.0), leq_func(voi, 10.5)) else 0.0 - algebraic[1] = constants[7]*(states[0]-computed_constants[6]) - algebraic[2] = constants[16]*pow(states[2], 4.0)*(states[0]-computed_constants[15]) - algebraic[10] = external_variable(voi, states, rates, variables, 10) - algebraic[3] = constants[9]*pow(algebraic[10], 3.0)*states[1]*(states[0]-computed_constants[8]) - rates[0] = -(-algebraic[0]+algebraic[3]+algebraic[2]+algebraic[1])/constants[4] - algebraic[13] = 0.07*exp(states[0]/20.0) - algebraic[14] = 1.0/(exp((states[0]+30.0)/10.0)+1.0) - rates[1] = algebraic[13]*(1.0-states[1])-algebraic[14]*states[1] - algebraic[17] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0) - algebraic[18] = 0.125*exp(states[0]/80.0) - rates[2] = algebraic[17]*(1.0-states[2])-algebraic[18]*states[2] + algebraic[1] = constants[2]*(states[0]-computed_constants[0]) + algebraic[2] = constants[4]*pow(states[2], 4.0)*(states[0]-computed_constants[2]) + algebraic[4] = external_variable(voi, states, rates, variables, 4) + algebraic[3] = constants[3]*pow(algebraic[4], 3.0)*states[1]*(states[0]-computed_constants[1]) + rates[0] = -(-algebraic[0]+algebraic[3]+algebraic[2]+algebraic[1])/constants[0] + algebraic[7] = 0.07*exp(states[0]/20.0) + algebraic[8] = 1.0/(exp((states[0]+30.0)/10.0)+1.0) + rates[1] = algebraic[7]*(1.0-states[1])-algebraic[8]*states[1] + algebraic[9] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0) + algebraic[10] = 0.125*exp(states[0]/80.0) + rates[2] = algebraic[9]*(1.0-states[2])-algebraic[10]*states[2] def compute_variables(voi, states, rates, constants, computed_constants, algebraic, external_variable): - algebraic[1] = constants[7]*(states[0]-computed_constants[6]) - algebraic[10] = external_variable(voi, states, rates, variables, 10) - algebraic[3] = constants[9]*pow(algebraic[10], 3.0)*states[1]*(states[0]-computed_constants[8]) - algebraic[11] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0) - algebraic[12] = 4.0*exp(states[0]/18.0) - algebraic[13] = 0.07*exp(states[0]/20.0) - algebraic[14] = 1.0/(exp((states[0]+30.0)/10.0)+1.0) - algebraic[2] = constants[16]*pow(states[2], 4.0)*(states[0]-computed_constants[15]) - algebraic[17] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0) - algebraic[18] = 0.125*exp(states[0]/80.0) + algebraic[1] = constants[2]*(states[0]-computed_constants[0]) + algebraic[4] = external_variable(voi, states, rates, variables, 4) + algebraic[3] = constants[3]*pow(algebraic[4], 3.0)*states[1]*(states[0]-computed_constants[1]) + algebraic[5] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0) + algebraic[6] = 4.0*exp(states[0]/18.0) + algebraic[7] = 0.07*exp(states[0]/20.0) + algebraic[8] = 1.0/(exp((states[0]+30.0)/10.0)+1.0) + algebraic[2] = constants[4]*pow(states[2], 4.0)*(states[0]-computed_constants[2]) + algebraic[9] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0) + algebraic[10] = 0.125*exp(states[0]/80.0) diff --git a/tests/resources/generator/noble_model_1962/model.c b/tests/resources/generator/noble_model_1962/model.c index e8a1804744..d0434bbc61 100644 --- a/tests/resources/generator/noble_model_1962/model.c +++ b/tests/resources/generator/noble_model_1962/model.c @@ -71,11 +71,11 @@ void deleteArray(double *array) void initialiseVariables(double *states, double *rates, double *constants) { - constants[3] = 12.0; - constants[4] = 0.075; - constants[5] = -60.0; - constants[7] = 400.0; - constants[8] = 40.0; + constants[0] = 12.0; + constants[1] = 0.075; + constants[2] = -60.0; + constants[3] = 400.0; + constants[4] = 40.0; states[0] = -87.0; states[1] = 0.01; states[2] = 0.8; @@ -88,36 +88,36 @@ void computeComputedConstants(double *constants, double *computedConstants) void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic) { - algebraic[6] = pow(states[1], 3.0)*states[2]*constants[7]; - algebraic[0] = (algebraic[6]+0.14)*(states[0]-constants[8]); - algebraic[1] = constants[4]*(states[0]-constants[5]); - algebraic[13] = 1.2*exp((-states[0]-90.0)/50.0)+0.015*exp((states[0]+90.0)/60.0); - algebraic[14] = 1.2*pow(states[3], 4.0); - algebraic[2] = (algebraic[13]+algebraic[14])*(states[0]+100.0); - rates[0] = -(algebraic[0]+algebraic[2]+algebraic[1])/constants[3]; - algebraic[9] = 0.1*(-states[0]-48.0)/(exp((-states[0]-48.0)/15.0)-1.0); - algebraic[10] = 0.12*(states[0]+8.0)/(exp((states[0]+8.0)/5.0)-1.0); - rates[1] = algebraic[9]*(1.0-states[1])-algebraic[10]*states[1]; - algebraic[11] = 0.17*exp((-states[0]-90.0)/20.0); - algebraic[12] = 1.0/(1.0+exp((-states[0]-42.0)/10.0)); - rates[2] = algebraic[11]*(1.0-states[2])-algebraic[12]*states[2]; - algebraic[15] = 0.0001*(-states[0]-50.0)/(exp((-states[0]-50.0)/10.0)-1.0); - algebraic[16] = 0.002*exp((-states[0]-90.0)/80.0); - rates[3] = algebraic[15]*(1.0-states[3])-algebraic[16]*states[3]; + algebraic[3] = pow(states[1], 3.0)*states[2]*constants[3]; + algebraic[0] = (algebraic[3]+0.14)*(states[0]-constants[4]); + algebraic[1] = constants[1]*(states[0]-constants[2]); + algebraic[8] = 1.2*exp((-states[0]-90.0)/50.0)+0.015*exp((states[0]+90.0)/60.0); + algebraic[9] = 1.2*pow(states[3], 4.0); + algebraic[2] = (algebraic[8]+algebraic[9])*(states[0]+100.0); + rates[0] = -(algebraic[0]+algebraic[2]+algebraic[1])/constants[0]; + algebraic[4] = 0.1*(-states[0]-48.0)/(exp((-states[0]-48.0)/15.0)-1.0); + algebraic[5] = 0.12*(states[0]+8.0)/(exp((states[0]+8.0)/5.0)-1.0); + rates[1] = algebraic[4]*(1.0-states[1])-algebraic[5]*states[1]; + algebraic[6] = 0.17*exp((-states[0]-90.0)/20.0); + algebraic[7] = 1.0/(1.0+exp((-states[0]-42.0)/10.0)); + rates[2] = algebraic[6]*(1.0-states[2])-algebraic[7]*states[2]; + algebraic[10] = 0.0001*(-states[0]-50.0)/(exp((-states[0]-50.0)/10.0)-1.0); + algebraic[11] = 0.002*exp((-states[0]-90.0)/80.0); + rates[3] = algebraic[10]*(1.0-states[3])-algebraic[11]*states[3]; } void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic) { - algebraic[1] = constants[4]*(states[0]-constants[5]); - algebraic[6] = pow(states[1], 3.0)*states[2]*constants[7]; - algebraic[0] = (algebraic[6]+0.14)*(states[0]-constants[8]); - algebraic[9] = 0.1*(-states[0]-48.0)/(exp((-states[0]-48.0)/15.0)-1.0); - algebraic[10] = 0.12*(states[0]+8.0)/(exp((states[0]+8.0)/5.0)-1.0); - algebraic[11] = 0.17*exp((-states[0]-90.0)/20.0); - algebraic[12] = 1.0/(1.0+exp((-states[0]-42.0)/10.0)); - algebraic[13] = 1.2*exp((-states[0]-90.0)/50.0)+0.015*exp((states[0]+90.0)/60.0); - algebraic[14] = 1.2*pow(states[3], 4.0); - algebraic[2] = (algebraic[13]+algebraic[14])*(states[0]+100.0); - algebraic[15] = 0.0001*(-states[0]-50.0)/(exp((-states[0]-50.0)/10.0)-1.0); - algebraic[16] = 0.002*exp((-states[0]-90.0)/80.0); + algebraic[1] = constants[1]*(states[0]-constants[2]); + algebraic[3] = pow(states[1], 3.0)*states[2]*constants[3]; + algebraic[0] = (algebraic[3]+0.14)*(states[0]-constants[4]); + algebraic[4] = 0.1*(-states[0]-48.0)/(exp((-states[0]-48.0)/15.0)-1.0); + algebraic[5] = 0.12*(states[0]+8.0)/(exp((states[0]+8.0)/5.0)-1.0); + algebraic[6] = 0.17*exp((-states[0]-90.0)/20.0); + algebraic[7] = 1.0/(1.0+exp((-states[0]-42.0)/10.0)); + algebraic[8] = 1.2*exp((-states[0]-90.0)/50.0)+0.015*exp((states[0]+90.0)/60.0); + algebraic[9] = 1.2*pow(states[3], 4.0); + algebraic[2] = (algebraic[8]+algebraic[9])*(states[0]+100.0); + algebraic[10] = 0.0001*(-states[0]-50.0)/(exp((-states[0]-50.0)/10.0)-1.0); + algebraic[11] = 0.002*exp((-states[0]-90.0)/80.0); } diff --git a/tests/resources/generator/noble_model_1962/model.py b/tests/resources/generator/noble_model_1962/model.py index d9672b95f4..04b3307a0c 100644 --- a/tests/resources/generator/noble_model_1962/model.py +++ b/tests/resources/generator/noble_model_1962/model.py @@ -60,11 +60,11 @@ def create_variables_array(): def initialise_variables(states, rates, constants): - constants[3] = 12.0 - constants[4] = 0.075 - constants[5] = -60.0 - constants[7] = 400.0 - constants[8] = 40.0 + constants[0] = 12.0 + constants[1] = 0.075 + constants[2] = -60.0 + constants[3] = 400.0 + constants[4] = 40.0 states[0] = -87.0 states[1] = 0.01 states[2] = 0.8 @@ -76,34 +76,34 @@ def compute_computed_constants(constants, computed_constants): def compute_rates(voi, states, rates, constants, computed_constants, algebraic): - algebraic[6] = pow(states[1], 3.0)*states[2]*constants[7] - algebraic[0] = (algebraic[6]+0.14)*(states[0]-constants[8]) - algebraic[1] = constants[4]*(states[0]-constants[5]) - algebraic[13] = 1.2*exp((-states[0]-90.0)/50.0)+0.015*exp((states[0]+90.0)/60.0) - algebraic[14] = 1.2*pow(states[3], 4.0) - algebraic[2] = (algebraic[13]+algebraic[14])*(states[0]+100.0) - rates[0] = -(algebraic[0]+algebraic[2]+algebraic[1])/constants[3] - algebraic[9] = 0.1*(-states[0]-48.0)/(exp((-states[0]-48.0)/15.0)-1.0) - algebraic[10] = 0.12*(states[0]+8.0)/(exp((states[0]+8.0)/5.0)-1.0) - rates[1] = algebraic[9]*(1.0-states[1])-algebraic[10]*states[1] - algebraic[11] = 0.17*exp((-states[0]-90.0)/20.0) - algebraic[12] = 1.0/(1.0+exp((-states[0]-42.0)/10.0)) - rates[2] = algebraic[11]*(1.0-states[2])-algebraic[12]*states[2] - algebraic[15] = 0.0001*(-states[0]-50.0)/(exp((-states[0]-50.0)/10.0)-1.0) - algebraic[16] = 0.002*exp((-states[0]-90.0)/80.0) - rates[3] = algebraic[15]*(1.0-states[3])-algebraic[16]*states[3] + algebraic[3] = pow(states[1], 3.0)*states[2]*constants[3] + algebraic[0] = (algebraic[3]+0.14)*(states[0]-constants[4]) + algebraic[1] = constants[1]*(states[0]-constants[2]) + algebraic[8] = 1.2*exp((-states[0]-90.0)/50.0)+0.015*exp((states[0]+90.0)/60.0) + algebraic[9] = 1.2*pow(states[3], 4.0) + algebraic[2] = (algebraic[8]+algebraic[9])*(states[0]+100.0) + rates[0] = -(algebraic[0]+algebraic[2]+algebraic[1])/constants[0] + algebraic[4] = 0.1*(-states[0]-48.0)/(exp((-states[0]-48.0)/15.0)-1.0) + algebraic[5] = 0.12*(states[0]+8.0)/(exp((states[0]+8.0)/5.0)-1.0) + rates[1] = algebraic[4]*(1.0-states[1])-algebraic[5]*states[1] + algebraic[6] = 0.17*exp((-states[0]-90.0)/20.0) + algebraic[7] = 1.0/(1.0+exp((-states[0]-42.0)/10.0)) + rates[2] = algebraic[6]*(1.0-states[2])-algebraic[7]*states[2] + algebraic[10] = 0.0001*(-states[0]-50.0)/(exp((-states[0]-50.0)/10.0)-1.0) + algebraic[11] = 0.002*exp((-states[0]-90.0)/80.0) + rates[3] = algebraic[10]*(1.0-states[3])-algebraic[11]*states[3] def compute_variables(voi, states, rates, constants, computed_constants, algebraic): - algebraic[1] = constants[4]*(states[0]-constants[5]) - algebraic[6] = pow(states[1], 3.0)*states[2]*constants[7] - algebraic[0] = (algebraic[6]+0.14)*(states[0]-constants[8]) - algebraic[9] = 0.1*(-states[0]-48.0)/(exp((-states[0]-48.0)/15.0)-1.0) - algebraic[10] = 0.12*(states[0]+8.0)/(exp((states[0]+8.0)/5.0)-1.0) - algebraic[11] = 0.17*exp((-states[0]-90.0)/20.0) - algebraic[12] = 1.0/(1.0+exp((-states[0]-42.0)/10.0)) - algebraic[13] = 1.2*exp((-states[0]-90.0)/50.0)+0.015*exp((states[0]+90.0)/60.0) - algebraic[14] = 1.2*pow(states[3], 4.0) - algebraic[2] = (algebraic[13]+algebraic[14])*(states[0]+100.0) - algebraic[15] = 0.0001*(-states[0]-50.0)/(exp((-states[0]-50.0)/10.0)-1.0) - algebraic[16] = 0.002*exp((-states[0]-90.0)/80.0) + algebraic[1] = constants[1]*(states[0]-constants[2]) + algebraic[3] = pow(states[1], 3.0)*states[2]*constants[3] + algebraic[0] = (algebraic[3]+0.14)*(states[0]-constants[4]) + algebraic[4] = 0.1*(-states[0]-48.0)/(exp((-states[0]-48.0)/15.0)-1.0) + algebraic[5] = 0.12*(states[0]+8.0)/(exp((states[0]+8.0)/5.0)-1.0) + algebraic[6] = 0.17*exp((-states[0]-90.0)/20.0) + algebraic[7] = 1.0/(1.0+exp((-states[0]-42.0)/10.0)) + algebraic[8] = 1.2*exp((-states[0]-90.0)/50.0)+0.015*exp((states[0]+90.0)/60.0) + algebraic[9] = 1.2*pow(states[3], 4.0) + algebraic[2] = (algebraic[8]+algebraic[9])*(states[0]+100.0) + algebraic[10] = 0.0001*(-states[0]-50.0)/(exp((-states[0]-50.0)/10.0)-1.0) + algebraic[11] = 0.002*exp((-states[0]-90.0)/80.0) diff --git a/tests/resources/generator/robertson_model_1966/model.dae.c b/tests/resources/generator/robertson_model_1966/model.dae.c index d25ae1df36..90bfcb5131 100644 --- a/tests/resources/generator/robertson_model_1966/model.dae.c +++ b/tests/resources/generator/robertson_model_1966/model.dae.c @@ -72,9 +72,9 @@ void objectiveFunction0(double *u, double *f, void *data) double *rates = ((RootFindingInfo *) data)->rates; double *variables = ((RootFindingInfo *) data)->variables; - algebraic[2] = u[0]; + algebraic[0] = u[0]; - f[0] = 1.0-(states[0]+states[1]+algebraic[2]); + f[0] = 1.0-(states[0]+states[1]+algebraic[0]); } void findRoot0(double voi, double *states, double *rates, double *variables) @@ -82,19 +82,19 @@ void findRoot0(double voi, double *states, double *rates, double *variables) RootFindingInfo rfi = { voi, states, rates, variables }; double u[1]; - u[0] = algebraic[2]; + u[0] = algebraic[0]; nlaSolve(objectiveFunction0, u, 1, &rfi); - algebraic[2] = u[0]; + algebraic[0] = u[0]; } void initialiseVariables(double *states, double *rates, double *constants) { constants[0] = 0.04; constants[1] = 1.0e4; - algebraic[2] = 0.0; - constants[3] = 3.0e7; + algebraic[0] = 0.0; + constants[2] = 3.0e7; states[0] = 1.0; states[1] = 0.0; } @@ -106,12 +106,12 @@ void computeComputedConstants(double *constants, double *computedConstants) void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic) { findRoot0(voi, states, rates, variables); - rates[0] = -constants[0]*states[0]+constants[1]*states[1]*algebraic[2]; - rates[1] = constants[0]*states[0]-constants[3]*pow(states[1], 2.0)-constants[1]*states[1]*algebraic[2]; + rates[0] = -constants[0]*states[0]+constants[1]*states[1]*algebraic[0]; + rates[1] = constants[0]*states[0]-constants[2]*pow(states[1], 2.0)-constants[1]*states[1]*algebraic[0]; } void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic) { findRoot0(voi, states, rates, variables); - algebraic[4] = 10000.0*states[1]; + algebraic[1] = 10000.0*states[1]; } diff --git a/tests/resources/generator/robertson_model_1966/model.dae.py b/tests/resources/generator/robertson_model_1966/model.dae.py index a01a61531f..034f6a13c4 100644 --- a/tests/resources/generator/robertson_model_1966/model.dae.py +++ b/tests/resources/generator/robertson_model_1966/model.dae.py @@ -54,26 +54,26 @@ def objective_function_0(u, f, data): rates = data[2] variables = data[3] - algebraic[2] = u[0] + algebraic[0] = u[0] - f[0] = 1.0-(states[0]+states[1]+algebraic[2]) + f[0] = 1.0-(states[0]+states[1]+algebraic[0]) def find_root_0(voi, states, rates, variables): u = [nan]*1 - u[0] = algebraic[2] + u[0] = algebraic[0] u = nla_solve(objective_function_0, u, 1, [voi, states, rates, variables]) - algebraic[2] = u[0] + algebraic[0] = u[0] def initialise_variables(states, rates, constants): constants[0] = 0.04 constants[1] = 1.0e4 - algebraic[2] = 0.0 - constants[3] = 3.0e7 + algebraic[0] = 0.0 + constants[2] = 3.0e7 states[0] = 1.0 states[1] = 0.0 @@ -84,10 +84,10 @@ def compute_computed_constants(constants, computed_constants): def compute_rates(voi, states, rates, constants, computed_constants, algebraic): find_root_0(voi, states, rates, variables) - rates[0] = -constants[0]*states[0]+constants[1]*states[1]*algebraic[2] - rates[1] = constants[0]*states[0]-constants[3]*pow(states[1], 2.0)-constants[1]*states[1]*algebraic[2] + rates[0] = -constants[0]*states[0]+constants[1]*states[1]*algebraic[0] + rates[1] = constants[0]*states[0]-constants[2]*pow(states[1], 2.0)-constants[1]*states[1]*algebraic[0] def compute_variables(voi, states, rates, constants, computed_constants, algebraic): find_root_0(voi, states, rates, variables) - algebraic[4] = 10000.0*states[1] + algebraic[1] = 10000.0*states[1] diff --git a/tests/resources/generator/robertson_model_1966/model.ode.c b/tests/resources/generator/robertson_model_1966/model.ode.c index c513ea1bd3..51c94697bc 100644 --- a/tests/resources/generator/robertson_model_1966/model.ode.c +++ b/tests/resources/generator/robertson_model_1966/model.ode.c @@ -78,5 +78,5 @@ void computeRates(double voi, double *states, double *rates, double *constants, void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic) { - algebraic[3] = 10000.0*states[2]; + algebraic[0] = 10000.0*states[2]; } diff --git a/tests/resources/generator/robertson_model_1966/model.ode.py b/tests/resources/generator/robertson_model_1966/model.ode.py index 5724071fcd..f702e804d8 100644 --- a/tests/resources/generator/robertson_model_1966/model.ode.py +++ b/tests/resources/generator/robertson_model_1966/model.ode.py @@ -65,4 +65,4 @@ def compute_rates(voi, states, rates, constants, computed_constants, algebraic): def compute_variables(voi, states, rates, constants, computed_constants, algebraic): - algebraic[3] = 10000.0*states[2] + algebraic[0] = 10000.0*states[2] diff --git a/tests/resources/generator/sine_model_imports/model.c b/tests/resources/generator/sine_model_imports/model.c index 6dfb92f02b..0f52edcd58 100644 --- a/tests/resources/generator/sine_model_imports/model.c +++ b/tests/resources/generator/sine_model_imports/model.c @@ -61,14 +61,14 @@ void deleteArray(double *array) void initialiseVariables(double *states, double *rates, double *constants) { - constants[1] = 0.0; - constants[3] = 0.75; - computedConstants[4] = 2.0/3.14159265358979; - computedConstants[5] = 2.0*3.14159265358979; - computedConstants[6] = 3.14159265358979/2.0; - computedConstants[7] = 3.14159265358979; - computedConstants[8] = 3.0*3.14159265358979/2.0; - states[0] = constants[1]; + constants[0] = 0.0; + constants[1] = 0.75; + computedConstants[0] = 2.0/3.14159265358979; + computedConstants[1] = 2.0*3.14159265358979; + computedConstants[2] = 3.14159265358979/2.0; + computedConstants[3] = 3.14159265358979; + computedConstants[4] = 3.0*3.14159265358979/2.0; + states[0] = constants[0]; } void computeComputedConstants(double *constants, double *computedConstants) @@ -83,6 +83,6 @@ void computeRates(double voi, double *states, double *rates, double *constants, void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic) { algebraic[0] = sin(voi); - algebraic[9] = (voi < computedConstants[6])?voi*computedConstants[4]-0.5:(voi < computedConstants[7])?(3.14159265358979-voi)*computedConstants[4]-0.5:(voi < computedConstants[8])?(voi-3.14159265358979)*computedConstants[4]-0.5:(computedConstants[5]-voi)*computedConstants[4]-0.5; - algebraic[2] = (voi < computedConstants[6])?-algebraic[9]*algebraic[9]+constants[3]+algebraic[9]:(voi < computedConstants[7])?-algebraic[9]*algebraic[9]+constants[3]+algebraic[9]:(voi < computedConstants[8])?algebraic[9]*algebraic[9]-constants[3]-algebraic[9]:algebraic[9]*algebraic[9]-constants[3]-algebraic[9]; + algebraic[2] = (voi < computedConstants[2])?voi*computedConstants[0]-0.5:(voi < computedConstants[3])?(3.14159265358979-voi)*computedConstants[0]-0.5:(voi < computedConstants[4])?(voi-3.14159265358979)*computedConstants[0]-0.5:(computedConstants[1]-voi)*computedConstants[0]-0.5; + algebraic[1] = (voi < computedConstants[2])?-algebraic[2]*algebraic[2]+constants[1]+algebraic[2]:(voi < computedConstants[3])?-algebraic[2]*algebraic[2]+constants[1]+algebraic[2]:(voi < computedConstants[4])?algebraic[2]*algebraic[2]-constants[1]-algebraic[2]:algebraic[2]*algebraic[2]-constants[1]-algebraic[2]; } diff --git a/tests/resources/generator/sine_model_imports/model.py b/tests/resources/generator/sine_model_imports/model.py index 2c2c463977..065f85ab7c 100644 --- a/tests/resources/generator/sine_model_imports/model.py +++ b/tests/resources/generator/sine_model_imports/model.py @@ -54,14 +54,14 @@ def create_variables_array(): def initialise_variables(states, rates, constants): - constants[1] = 0.0 - constants[3] = 0.75 - computed_constants[4] = 2.0/3.14159265358979 - computed_constants[5] = 2.0*3.14159265358979 - computed_constants[6] = 3.14159265358979/2.0 - computed_constants[7] = 3.14159265358979 - computed_constants[8] = 3.0*3.14159265358979/2.0 - states[0] = constants[1] + constants[0] = 0.0 + constants[1] = 0.75 + computed_constants[0] = 2.0/3.14159265358979 + computed_constants[1] = 2.0*3.14159265358979 + computed_constants[2] = 3.14159265358979/2.0 + computed_constants[3] = 3.14159265358979 + computed_constants[4] = 3.0*3.14159265358979/2.0 + states[0] = constants[0] def compute_computed_constants(constants, computed_constants): @@ -74,5 +74,5 @@ def compute_rates(voi, states, rates, constants, computed_constants, algebraic): def compute_variables(voi, states, rates, constants, computed_constants, algebraic): algebraic[0] = sin(voi) - algebraic[9] = voi*computed_constants[4]-0.5 if lt_func(voi, computed_constants[6]) else (3.14159265358979-voi)*computed_constants[4]-0.5 if lt_func(voi, computed_constants[7]) else (voi-3.14159265358979)*computed_constants[4]-0.5 if lt_func(voi, computed_constants[8]) else (computed_constants[5]-voi)*computed_constants[4]-0.5 - algebraic[2] = -algebraic[9]*algebraic[9]+constants[3]+algebraic[9] if lt_func(voi, computed_constants[6]) else -algebraic[9]*algebraic[9]+constants[3]+algebraic[9] if lt_func(voi, computed_constants[7]) else algebraic[9]*algebraic[9]-constants[3]-algebraic[9] if lt_func(voi, computed_constants[8]) else algebraic[9]*algebraic[9]-constants[3]-algebraic[9] + algebraic[2] = voi*computed_constants[0]-0.5 if lt_func(voi, computed_constants[2]) else (3.14159265358979-voi)*computed_constants[0]-0.5 if lt_func(voi, computed_constants[3]) else (voi-3.14159265358979)*computed_constants[0]-0.5 if lt_func(voi, computed_constants[4]) else (computed_constants[1]-voi)*computed_constants[0]-0.5 + algebraic[1] = -algebraic[2]*algebraic[2]+constants[1]+algebraic[2] if lt_func(voi, computed_constants[2]) else -algebraic[2]*algebraic[2]+constants[1]+algebraic[2] if lt_func(voi, computed_constants[3]) else algebraic[2]*algebraic[2]-constants[1]-algebraic[2] if lt_func(voi, computed_constants[4]) else algebraic[2]*algebraic[2]-constants[1]-algebraic[2] diff --git a/tests/resources/generator/unknown_variable_as_external_variable/model.c b/tests/resources/generator/unknown_variable_as_external_variable/model.c index 8167206cd0..db7744dbb3 100644 --- a/tests/resources/generator/unknown_variable_as_external_variable/model.c +++ b/tests/resources/generator/unknown_variable_as_external_variable/model.c @@ -43,15 +43,15 @@ void deleteArray(double *array) void initialiseVariables(double *constants, ExternalVariable externalVariable) { - constants[1] = 1.1; - constants[2] = 21262500.0; - constants[3] = 150.0; - constants[4] = 3402000.0; - constants[5] = 2.0; - constants[6] = 2902500.0; - constants[7] = 810000.0; - constants[8] = 247140.0; - algebraic[9] = externalVariable(variables, 9); + constants[0] = 1.1; + constants[1] = 21262500.0; + constants[2] = 150.0; + constants[3] = 3402000.0; + constants[4] = 2.0; + constants[5] = 2902500.0; + constants[6] = 810000.0; + constants[7] = 247140.0; + algebraic[1] = externalVariable(variables, 1); } void computeComputedConstants(double *constants, double *computedConstants) @@ -60,6 +60,6 @@ void computeComputedConstants(double *constants, double *computedConstants) void computeVariables(double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { - algebraic[9] = externalVariable(variables, 9); - algebraic[0] = constants[1]*(constants[2]*constants[3]-constants[4]*constants[5])/(constants[6]*constants[5]+algebraic[9]*constants[3]+constants[8]*constants[5]*constants[3]+constants[7]); + algebraic[1] = externalVariable(variables, 1); + algebraic[0] = constants[0]*(constants[1]*constants[2]-constants[3]*constants[4])/(constants[5]*constants[4]+algebraic[1]*constants[2]+constants[7]*constants[4]*constants[2]+constants[6]); } diff --git a/tests/resources/generator/unknown_variable_as_external_variable/model.py b/tests/resources/generator/unknown_variable_as_external_variable/model.py index 3c5f0470c2..f07ad2cca3 100644 --- a/tests/resources/generator/unknown_variable_as_external_variable/model.py +++ b/tests/resources/generator/unknown_variable_as_external_variable/model.py @@ -38,15 +38,15 @@ def create_variables_array(): def initialise_variables(constants, external_variable): - constants[1] = 1.1 - constants[2] = 21262500.0 - constants[3] = 150.0 - constants[4] = 3402000.0 - constants[5] = 2.0 - constants[6] = 2902500.0 - constants[7] = 810000.0 - constants[8] = 247140.0 - algebraic[9] = external_variable(variables, 9) + constants[0] = 1.1 + constants[1] = 21262500.0 + constants[2] = 150.0 + constants[3] = 3402000.0 + constants[4] = 2.0 + constants[5] = 2902500.0 + constants[6] = 810000.0 + constants[7] = 247140.0 + algebraic[1] = external_variable(variables, 1) def compute_computed_constants(constants, computed_constants): @@ -54,5 +54,5 @@ def compute_computed_constants(constants, computed_constants): def compute_variables(constants, computed_constants, algebraic, external_variable): - algebraic[9] = external_variable(variables, 9) - algebraic[0] = constants[1]*(constants[2]*constants[3]-constants[4]*constants[5])/(constants[6]*constants[5]+algebraic[9]*constants[3]+constants[8]*constants[5]*constants[3]+constants[7]) + algebraic[1] = external_variable(variables, 1) + algebraic[0] = constants[0]*(constants[1]*constants[2]-constants[3]*constants[4])/(constants[5]*constants[4]+algebraic[1]*constants[2]+constants[7]*constants[4]*constants[2]+constants[6])