diff --git a/src/api/libcellml/generatorprofile.h b/src/api/libcellml/generatorprofile.h index cb85018fbe..cbbb42f1a2 100644 --- a/src/api/libcellml/generatorprofile.h +++ b/src/api/libcellml/generatorprofile.h @@ -3034,23 +3034,61 @@ class LIBCELLML_EXPORT GeneratorProfile void setRatesArrayString(const std::string &ratesArrayString); /** - * @brief Get the @c std::string for the name of the variables array. + * @brief Get the @c std::string for the name of the constants array. * - * Return the @c std::string for the name of the variables array. + * Return the @c std::string for the name of the constants array. * - * @return The @c std::string for the name of the variables array. + * @return The @c std::string for the name of the constants array. */ - std::string variablesArrayString() const; + std::string constantsArrayString() const; /** - * @brief Set the @c std::string for the name of the variables array. + * @brief Set the @c std::string for the name of the constants array. * - * Set the @c std::string for the name of the variables array. + * Set the @c std::string for the name of the constants array. * - * @param variablesArrayString The @c std::string to use for the name of the - * variables array. + * @param constantsArrayString The @c std::string to use for the name of the + * constants array. + */ + void setConstantsArrayString(const std::string &constantsArrayString); + + /** + * @brief Get the @c std::string for the name of the computed constants array. + * + * Return the @c std::string for the name of the computed constants array. + * + * @return The @c std::string for the name of the computed constants array. + */ + std::string computedConstantsArrayString() const; + + /** + * @brief Set the @c std::string for the name of the computed constants array. + * + * Set the @c std::string for the name of the computed constants array. + * + * @param computedConstantsArrayString The @c std::string to use for the name of the + * computed constants array. + */ + void setComputedConstantsArrayString(const std::string &computedConstantsArrayString); + + /** + * @brief Get the @c std::string for the name of the algebraic array. + * + * Return the @c std::string for the name of the algebraic array. + * + * @return The @c std::string for the name of the algebraic array. + */ + std::string algebraicArrayString() const; + + /** + * @brief Set the @c std::string for the name of the algebraic array. + * + * Set the @c std::string for the name of the algebraic array. + * + * @param algebraicArrayString The @c std::string to use for the name of the + * algebraic array. */ - void setVariablesArrayString(const std::string &variablesArrayString); + void setAlgebraicArrayString(const std::string &algebraicArrayString); /** * @brief Get the @c std::string for the type definition of an external diff --git a/src/bindings/interface/generatorprofile.i b/src/bindings/interface/generatorprofile.i index e8da17ba39..8c694e9f5f 100644 --- a/src/bindings/interface/generatorprofile.i +++ b/src/bindings/interface/generatorprofile.i @@ -833,11 +833,23 @@ and units of a variable respectively."; %feature("docstring") libcellml::GeneratorProfile::setRatesArrayString "Sets the string for the name of the rates array."; -%feature("docstring") libcellml::GeneratorProfile::variablesArrayString -"Returns the string for the name of the variables array."; +%feature("docstring") libcellml::GeneratorProfile::constantsArrayString +"Returns the string for the name of the constants array."; -%feature("docstring") libcellml::GeneratorProfile::setVariablesArrayString -"Sets the string for the name of the variables array."; +%feature("docstring") libcellml::GeneratorProfile::setConstantsArrayString +"Sets the string for the name of the constants array."; + +%feature("docstring") libcellml::GeneratorProfile::computedConstantsArrayString +"Returns the string for the name of the computed constants array."; + +%feature("docstring") libcellml::GeneratorProfile::setComputedConstantsArrayString +"Sets the string for the name of the computed constants array."; + +%feature("docstring") libcellml::GeneratorProfile::algebraicArrayString +"Returns the string for the name of the algebraic array."; + +%feature("docstring") libcellml::GeneratorProfile::setAlgebraicArrayString +"Sets the string for the name of the algebraic array."; %feature("docstring") libcellml::GeneratorProfile::externalVariableMethodTypeDefinitionString "Returns the string for the type definition of an external variable method."; diff --git a/src/bindings/javascript/generatorprofile.cpp b/src/bindings/javascript/generatorprofile.cpp index 97a6ee651d..e9fc6b420b 100644 --- a/src/bindings/javascript/generatorprofile.cpp +++ b/src/bindings/javascript/generatorprofile.cpp @@ -299,8 +299,12 @@ EMSCRIPTEN_BINDINGS(libcellml_generatorprofile) .function("setStatesArrayString", &libcellml::GeneratorProfile::setStatesArrayString) .function("ratesArrayString", &libcellml::GeneratorProfile::ratesArrayString) .function("setRatesArrayString", &libcellml::GeneratorProfile::setRatesArrayString) - .function("variablesArrayString", &libcellml::GeneratorProfile::variablesArrayString) - .function("setVariablesArrayString", &libcellml::GeneratorProfile::setVariablesArrayString) + .function("constantsArrayString", &libcellml::GeneratorProfile::constantsArrayString) + .function("setConstantsArrayString", &libcellml::GeneratorProfile::setConstantsArrayString) + .function("computedConstantsArrayString", &libcellml::GeneratorProfile::computedConstantsArrayString) + .function("setComputedConstantsArrayString", &libcellml::GeneratorProfile::setComputedConstantsArrayString) + .function("algebraicArrayString", &libcellml::GeneratorProfile::algebraicArrayString) + .function("setAlgebraicArrayString", &libcellml::GeneratorProfile::setAlgebraicArrayString) .function("externalVariableMethodTypeDefinitionString", &libcellml::GeneratorProfile::externalVariableMethodTypeDefinitionString) .function("setExternalVariableMethodTypeDefinitionString", &libcellml::GeneratorProfile::setExternalVariableMethodTypeDefinitionString) .function("externalVariableMethodCallString", &libcellml::GeneratorProfile::externalVariableMethodCallString) diff --git a/src/generator.cpp b/src/generator.cpp index 51a4e51b4b..5532344305 100644 --- a/src/generator.cpp +++ b/src/generator.cpp @@ -810,7 +810,11 @@ void Generator::GeneratorImpl::addNlaSystemsCode() for (i = 0; i < variablesCount; ++i) { auto arrayString = (variables[i]->type() == AnalyserVariable::Type::STATE) ? mProfile->ratesArrayString() : - mProfile->variablesArrayString(); + (variables[i]->type() == AnalyserVariable::Type::CONSTANT) ? + mProfile->constantsArrayString() : + (variables[i]->type() == AnalyserVariable::Type::COMPUTED_CONSTANT) ? + mProfile->computedConstantsArrayString() : + mProfile->algebraicArrayString(); methodBody += mProfile->indentString() + arrayString + mProfile->openArrayString() + convertToString(variables[i]->index()) + mProfile->closeArrayString() @@ -851,7 +855,7 @@ void Generator::GeneratorImpl::addNlaSystemsCode() for (i = 0; i < variablesCount; ++i) { auto arrayString = (variables[i]->type() == AnalyserVariable::Type::STATE) ? mProfile->ratesArrayString() : - mProfile->variablesArrayString(); + mProfile->algebraicArrayString(); methodBody += mProfile->indentString() + mProfile->uArrayString() + mProfile->openArrayString() + convertToString(i) + mProfile->closeArrayString() @@ -871,7 +875,7 @@ void Generator::GeneratorImpl::addNlaSystemsCode() for (i = 0; i < variablesCount; ++i) { auto arrayString = (variables[i]->type() == AnalyserVariable::Type::STATE) ? mProfile->ratesArrayString() : - mProfile->variablesArrayString(); + mProfile->algebraicArrayString(); methodBody += mProfile->indentString() + arrayString + mProfile->openArrayString() + convertToString(variables[i]->index()) + mProfile->closeArrayString() @@ -923,7 +927,7 @@ std::string Generator::GeneratorImpl::generateDoubleOrConstantVariableNameCode(c auto initValueVariable = owningComponent(variable)->variable(variable->initialValue()); auto analyserInitialValueVariable = analyserVariable(initValueVariable); - return mProfile->variablesArrayString() + mProfile->openArrayString() + convertToString(analyserInitialValueVariable->index()) + mProfile->closeArrayString(); + return mProfile->constantsArrayString() + mProfile->openArrayString() + convertToString(analyserInitialValueVariable->index()) + mProfile->closeArrayString(); } std::string Generator::GeneratorImpl::generateVariableNameCode(const VariablePtr &variable, @@ -950,8 +954,12 @@ std::string Generator::GeneratorImpl::generateVariableNameCode(const VariablePtr arrayName = state ? mProfile->statesArrayString() : mProfile->ratesArrayString(); + } else if (analyserVariable->type() == AnalyserVariable::Type::CONSTANT) { + arrayName = mProfile->constantsArrayString(); + } else if (analyserVariable->type() == AnalyserVariable::Type::COMPUTED_CONSTANT) { + arrayName = mProfile->computedConstantsArrayString(); } else { - arrayName = mProfile->variablesArrayString(); + arrayName = mProfile->algebraicArrayString(); } return arrayName + mProfile->openArrayString() + convertToString(analyserVariable->index()) + mProfile->closeArrayString(); diff --git a/src/generatorprofile.cpp b/src/generatorprofile.cpp index 3dd23d9808..67dd5160d9 100644 --- a/src/generatorprofile.cpp +++ b/src/generatorprofile.cpp @@ -222,7 +222,9 @@ struct GeneratorProfile::GeneratorProfileImpl std::string mStatesArrayString; std::string mRatesArrayString; - std::string mVariablesArrayString; + std::string mConstantsArrayString; + std::string mComputedConstantsArrayString; + std::string mAlgebraicArrayString; std::string mExternalVariableMethodTypeDefinitionFamString; std::string mExternalVariableMethodTypeDefinitionFdmString; @@ -580,7 +582,9 @@ void GeneratorProfile::GeneratorProfileImpl::loadProfile(GeneratorProfile::Profi mStatesArrayString = "states"; mRatesArrayString = "rates"; - mVariablesArrayString = "variables"; + mConstantsArrayString = "constants"; + mComputedConstantsArrayString = "computedConstants"; + mAlgebraicArrayString = "algebraic"; mExternalVariableMethodTypeDefinitionFamString = "typedef double (* ExternalVariable)(double *variables, size_t index);\n"; mExternalVariableMethodTypeDefinitionFdmString = "typedef double (* ExternalVariable)(double voi, double *states, double *rates, double *variables, size_t index);\n"; @@ -1014,7 +1018,9 @@ void GeneratorProfile::GeneratorProfileImpl::loadProfile(GeneratorProfile::Profi mStatesArrayString = "states"; mRatesArrayString = "rates"; - mVariablesArrayString = "variables"; + mConstantsArrayString = "constants"; + mComputedConstantsArrayString = "computed_constants"; + mAlgebraicArrayString = "algebraic"; mExternalVariableMethodTypeDefinitionFamString = ""; mExternalVariableMethodTypeDefinitionFdmString = ""; @@ -2535,14 +2541,34 @@ void GeneratorProfile::setRatesArrayString(const std::string &ratesArrayString) mPimpl->mRatesArrayString = ratesArrayString; } -std::string GeneratorProfile::variablesArrayString() const +std::string GeneratorProfile::constantsArrayString() const { - return mPimpl->mVariablesArrayString; + return mPimpl->mConstantsArrayString; } -void GeneratorProfile::setVariablesArrayString(const std::string &variablesArrayString) +void GeneratorProfile::setConstantsArrayString(const std::string &constantsArrayString) { - mPimpl->mVariablesArrayString = variablesArrayString; + mPimpl->mConstantsArrayString = constantsArrayString; +} + +std::string GeneratorProfile::computedConstantsArrayString() const +{ + return mPimpl->mComputedConstantsArrayString; +} + +void GeneratorProfile::setComputedConstantsArrayString(const std::string &computedConstantsArrayString) +{ + mPimpl->mComputedConstantsArrayString = computedConstantsArrayString; +} + +std::string GeneratorProfile::algebraicArrayString() const +{ + return mPimpl->mAlgebraicArrayString; +} + +void GeneratorProfile::setAlgebraicArrayString(const std::string &algebraicArrayString) +{ + mPimpl->mAlgebraicArrayString = algebraicArrayString; } std::string GeneratorProfile::externalVariableMethodTypeDefinitionString(bool forDifferentialModel) const diff --git a/src/generatorprofilesha1values.h b/src/generatorprofilesha1values.h index 0bae464fbe..69f2ae4d93 100644 --- a/src/generatorprofilesha1values.h +++ b/src/generatorprofilesha1values.h @@ -24,7 +24,7 @@ namespace libcellml { * The content of this file is generated, do not edit this file directly. * See docs/dev_utilities.rst for further information. */ -static const char C_GENERATOR_PROFILE_SHA1[] = "060945ab10d8ce4ce063e4b64199f684ec0150a5"; -static const char PYTHON_GENERATOR_PROFILE_SHA1[] = "859d7920e76c1a12345a2d642940163d41d27112"; +static const char C_GENERATOR_PROFILE_SHA1[] = "f36d3c679b030a09095376711d4dc9a638a5c7b3"; +static const char PYTHON_GENERATOR_PROFILE_SHA1[] = "bb03c147d17a9741667957068ef629058846d2e4"; } // namespace libcellml diff --git a/src/generatorprofiletools.cpp b/src/generatorprofiletools.cpp index 4a1613b8da..6293fd1201 100644 --- a/src/generatorprofiletools.cpp +++ b/src/generatorprofiletools.cpp @@ -480,7 +480,9 @@ std::string generatorProfileAsString(const GeneratorProfilePtr &generatorProfile profileContents += generatorProfile->statesArrayString() + generatorProfile->ratesArrayString() - + generatorProfile->variablesArrayString(); + + generatorProfile->constantsArrayString() + + generatorProfile->computedConstantsArrayString() + + generatorProfile->algebraicArrayString(); profileContents += generatorProfile->externalVariableMethodTypeDefinitionString(false) + generatorProfile->externalVariableMethodTypeDefinitionString(true); diff --git a/tests/bindings/javascript/generatorprofile.test.js b/tests/bindings/javascript/generatorprofile.test.js index 7c5bd368e6..92fe3b5868 100644 --- a/tests/bindings/javascript/generatorprofile.test.js +++ b/tests/bindings/javascript/generatorprofile.test.js @@ -897,11 +897,23 @@ describe("GeneratorProfile tests", () => { x.setRatesArrayString("something") expect(x.ratesArrayString()).toBe("something") }); - test("Checking GeneratorProfile.variablesArrayString.", () => { + test("Checking GeneratorProfile.constantsArrayString.", () => { const x = new libcellml.GeneratorProfile(libcellml.GeneratorProfile.Profile.C) - x.setVariablesArrayString("something") - expect(x.variablesArrayString()).toBe("something") + x.setConstantsArrayString("something") + expect(x.constantsArrayString()).toBe("something") + }); + test("Checking GeneratorProfile.computedConstantsArrayString.", () => { + const x = new libcellml.GeneratorProfile(libcellml.GeneratorProfile.Profile.C) + + x.setComputedConstantsArrayString("something") + expect(x.computedConstantsArrayString()).toBe("something") + }); + test("Checking GeneratorProfile.algebraicArrayString.", () => { + const x = new libcellml.GeneratorProfile(libcellml.GeneratorProfile.Profile.C) + + x.setAlgebraicArrayString("something") + expect(x.algebraicArrayString()).toBe("something") }); test("Checking GeneratorProfile.externalVariableMethodTypeDefinitionString.", () => { const x = new libcellml.GeneratorProfile(libcellml.GeneratorProfile.Profile.C) diff --git a/tests/bindings/python/test_generator_profile.py b/tests/bindings/python/test_generator_profile.py index 4eb8a46fad..aaa7e3271d 100644 --- a/tests/bindings/python/test_generator_profile.py +++ b/tests/bindings/python/test_generator_profile.py @@ -1607,14 +1607,32 @@ def test_variable_type_object_string(self): g.setVariableTypeObjectString(True, True, GeneratorProfileTestCase.VALUE) self.assertEqual(GeneratorProfileTestCase.VALUE, g.variableTypeObjectString(True, True)) - def test_variables_array_string(self): + def test_constants_array_string(self): from libcellml import GeneratorProfile g = GeneratorProfile() - self.assertEqual('variables', g.variablesArrayString()) - g.setVariablesArrayString(GeneratorProfileTestCase.VALUE) - self.assertEqual(GeneratorProfileTestCase.VALUE, g.variablesArrayString()) + self.assertEqual('constants', g.constantsArrayString()) + g.setConstantsArrayString(GeneratorProfileTestCase.VALUE) + self.assertEqual(GeneratorProfileTestCase.VALUE, g.constantsArrayString()) + + def test_computed_constants_array_string(self): + from libcellml import GeneratorProfile + + g = GeneratorProfile() + + self.assertEqual('computedConstants', g.computedConstantsArrayString()) + g.setComputedConstantsArrayString(GeneratorProfileTestCase.VALUE) + self.assertEqual(GeneratorProfileTestCase.VALUE, g.computedConstantsArrayString()) + + def test_algebraic_array_string(self): + from libcellml import GeneratorProfile + + g = GeneratorProfile() + + self.assertEqual('algebraic', g.algebraicArrayString()) + g.setAlgebraicArrayString(GeneratorProfileTestCase.VALUE) + self.assertEqual(GeneratorProfileTestCase.VALUE, g.algebraicArrayString()) def test_external_variable_method_type_definition_string(self): from libcellml import GeneratorProfile diff --git a/tests/generator/generatorprofile.cpp b/tests/generator/generatorprofile.cpp index f690252bc9..539e28a063 100644 --- a/tests/generator/generatorprofile.cpp +++ b/tests/generator/generatorprofile.cpp @@ -355,7 +355,9 @@ TEST(GeneratorProfile, defaultMiscellaneousValues) EXPECT_EQ("states", generatorProfile->statesArrayString()); EXPECT_EQ("rates", generatorProfile->ratesArrayString()); - EXPECT_EQ("variables", generatorProfile->variablesArrayString()); + EXPECT_EQ("constants", generatorProfile->constantsArrayString()); + EXPECT_EQ("computedConstants", generatorProfile->computedConstantsArrayString()); + EXPECT_EQ("algebraic", generatorProfile->algebraicArrayString()); EXPECT_EQ("typedef double (* ExternalVariable)(double *variables, size_t index);\n", generatorProfile->externalVariableMethodTypeDefinitionString(false)); EXPECT_EQ("typedef double (* ExternalVariable)(double voi, double *states, double *rates, double *variables, size_t index);\n", generatorProfile->externalVariableMethodTypeDefinitionString(true)); @@ -909,7 +911,9 @@ TEST(GeneratorProfile, miscellaneous) generatorProfile->setStatesArrayString(value); generatorProfile->setRatesArrayString(value); - generatorProfile->setVariablesArrayString(value); + generatorProfile->setConstantsArrayString(value); + generatorProfile->setComputedConstantsArrayString(value); + generatorProfile->setAlgebraicArrayString(value); generatorProfile->setExternalVariableMethodTypeDefinitionString(false, value); generatorProfile->setExternalVariableMethodTypeDefinitionString(true, value); @@ -1044,7 +1048,9 @@ TEST(GeneratorProfile, miscellaneous) EXPECT_EQ(value, generatorProfile->statesArrayString()); EXPECT_EQ(value, generatorProfile->ratesArrayString()); - EXPECT_EQ(value, generatorProfile->variablesArrayString()); + EXPECT_EQ(value, generatorProfile->constantsArrayString()); + EXPECT_EQ(value, generatorProfile->computedConstantsArrayString()); + EXPECT_EQ(value, generatorProfile->algebraicArrayString()); EXPECT_EQ(value, generatorProfile->externalVariableMethodTypeDefinitionString(false)); EXPECT_EQ(value, generatorProfile->externalVariableMethodTypeDefinitionString(true)); diff --git a/tests/resources/coverage/generator/model.c b/tests/resources/coverage/generator/model.c index e5bf4ccdf2..872419de42 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; - variables[205] = u[0]; - variables[206] = u[1]; + algebraic[205] = u[0]; + algebraic[206] = u[1]; - f[0] = variables[205]+variables[206]+states[0]-0.0; - f[1] = variables[205]-variables[206]-(variables[207]+variables[208]); + f[0] = algebraic[205]+algebraic[206]+states[0]-0.0; + f[1] = algebraic[205]-algebraic[206]-(computedConstants[207]+computedConstants[208]); } 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] = variables[205]; - u[1] = variables[206]; + u[0] = algebraic[205]; + u[1] = algebraic[206]; nlaSolve(objectiveFunction0, u, 2, &rfi); - variables[205] = u[0]; - variables[206] = u[1]; + algebraic[205] = u[0]; + algebraic[206] = u[1]; } void initialiseVariables(double *states, double *rates, double *constants) { - variables[1] = 1.0; - variables[2] = 2.0; - variables[6] = 3.0; - variables[18] = 4.0; - variables[179] = 5.0; - variables[180] = 6.0; - variables[182] = 7.0; - variables[205] = 1.0; - variables[206] = 2.0; - variables[184] = 123.0; - variables[185] = 123.456789; - variables[186] = 123.0e99; - variables[187] = 123.456789e99; - variables[189] = 1.0; - variables[190] = 0.0; - variables[191] = 2.71828182845905; - variables[192] = 3.14159265358979; - variables[193] = INFINITY; - variables[194] = NAN; - variables[207] = 1.0; - variables[208] = 3.0; + 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; states[0] = 0.0; } void computeComputedConstants(double *constants, double *computedConstants) { - variables[0] = variables[1] == variables[2]; - variables[3] = variables[1]/(variables[2] == variables[2]); - variables[4] = variables[1] != variables[2]; - variables[5] = variables[1]/(variables[2] != variables[6]); - variables[7] = variables[1] < variables[2]; - variables[8] = variables[1]/(variables[2] < variables[6]); - variables[9] = variables[1] <= variables[2]; - variables[10] = variables[1]/(variables[2] <= variables[6]); - variables[11] = variables[1] > variables[2]; - variables[12] = variables[1]/(variables[2] > variables[6]); - variables[13] = variables[1] >= variables[2]; - variables[14] = variables[1]/(variables[2] >= variables[6]); - variables[15] = variables[1] && variables[2]; - variables[16] = variables[1] && variables[2] && variables[6]; - variables[17] = (variables[1] < variables[2]) && (variables[6] > variables[18]); - variables[19] = (variables[1]+variables[2]) && (variables[6] > variables[18]); - variables[20] = variables[1] && (variables[2] > variables[6]); - variables[21] = (variables[1]-variables[2]) && (variables[6] > variables[18]); - variables[22] = -variables[1] && (variables[2] > variables[6]); - variables[23] = pow(variables[1], variables[2]) && (variables[6] > variables[18]); - variables[24] = pow(variables[1], 1.0/variables[2]) && (variables[6] > variables[18]); - variables[25] = (variables[1] < variables[2]) && (variables[6]+variables[18]); - variables[26] = (variables[1] < variables[2]) && variables[6]; - variables[27] = (variables[1] < variables[2]) && (variables[6]-variables[18]); - variables[28] = (variables[1] < variables[2]) && -variables[6]; - variables[29] = (variables[1] < variables[2]) && pow(variables[6], variables[18]); - variables[30] = (variables[1] < variables[2]) && pow(variables[6], 1.0/variables[18]); - variables[31] = variables[1]/(variables[2] && variables[6]); - variables[32] = variables[1] || variables[2]; - variables[33] = variables[1] || variables[2] || variables[6]; - variables[34] = (variables[1] < variables[2]) || (variables[6] > variables[18]); - variables[35] = (variables[1]+variables[2]) || (variables[6] > variables[18]); - variables[36] = variables[1] || (variables[2] > variables[6]); - variables[37] = (variables[1]-variables[2]) || (variables[6] > variables[18]); - variables[38] = -variables[1] || (variables[2] > variables[6]); - variables[39] = pow(variables[1], variables[2]) || (variables[6] > variables[18]); - variables[40] = pow(variables[1], 1.0/variables[2]) || (variables[6] > variables[18]); - variables[41] = (variables[1] < variables[2]) || (variables[6]+variables[18]); - variables[42] = (variables[1] < variables[2]) || variables[6]; - variables[43] = (variables[1] < variables[2]) || (variables[6]-variables[18]); - variables[44] = (variables[1] < variables[2]) || -variables[6]; - variables[45] = (variables[1] < variables[2]) || pow(variables[6], variables[18]); - variables[46] = (variables[1] < variables[2]) || pow(variables[6], 1.0/variables[18]); - variables[47] = variables[1]/(variables[2] || variables[6]); - variables[48] = xor(variables[1], variables[2]); - variables[49] = xor(variables[1], xor(variables[2], variables[6])); - variables[50] = xor(variables[1] < variables[2], variables[6] > variables[18]); - variables[51] = xor(variables[1]+variables[2], variables[6] > variables[18]); - variables[52] = xor(variables[1], variables[2] > variables[6]); - variables[53] = xor(variables[1]-variables[2], variables[6] > variables[18]); - variables[54] = xor(-variables[1], variables[2] > variables[6]); - variables[55] = xor(pow(variables[1], variables[2]), variables[6] > variables[18]); - variables[56] = xor(pow(variables[1], 1.0/variables[2]), variables[6] > variables[18]); - variables[57] = xor(variables[1] < variables[2], variables[6]+variables[18]); - variables[58] = xor(variables[1] < variables[2], variables[6]); - variables[59] = xor(variables[1] < variables[2], variables[6]-variables[18]); - variables[60] = xor(variables[1] < variables[2], -variables[6]); - variables[61] = xor(variables[1] < variables[2], pow(variables[6], variables[18])); - variables[62] = xor(variables[1] < variables[2], pow(variables[6], 1.0/variables[18])); - variables[63] = variables[1]/xor(variables[2], variables[6]); - variables[64] = !variables[1]; - variables[65] = variables[1]+variables[2]; - variables[66] = variables[1]+variables[2]+variables[6]; - variables[67] = (variables[1] < variables[2])+(variables[6] > variables[18]); - variables[68] = variables[1]; - variables[69] = variables[1]-variables[2]; - variables[70] = (variables[1] < variables[2])-(variables[6] > variables[18]); - variables[71] = (variables[1] < variables[2])-(variables[6]+variables[18]); - variables[72] = (variables[1] < variables[2])-variables[6]; - variables[73] = variables[1]-(-variables[2]); - variables[74] = variables[1]-(-variables[2]*variables[6]); - variables[75] = -variables[1]; - variables[76] = -(variables[1] < variables[2]); - variables[77] = variables[1]*variables[2]; - variables[78] = variables[1]*variables[2]*variables[6]; - variables[79] = (variables[1] < variables[2])*(variables[6] > variables[18]); - variables[80] = (variables[1]+variables[2])*(variables[6] > variables[18]); - variables[81] = variables[1]*(variables[2] > variables[6]); - variables[82] = (variables[1]-variables[2])*(variables[6] > variables[18]); - variables[83] = -variables[1]*(variables[2] > variables[6]); - variables[84] = (variables[1] < variables[2])*(variables[6]+variables[18]); - variables[85] = (variables[1] < variables[2])*variables[6]; - variables[86] = (variables[1] < variables[2])*(variables[6]-variables[18]); - variables[87] = (variables[1] < variables[2])*-variables[6]; - variables[88] = variables[1]/variables[2]; - variables[89] = (variables[1] < variables[2])/(variables[18] > variables[6]); - variables[90] = (variables[1]+variables[2])/(variables[18] > variables[6]); - variables[91] = variables[1]/(variables[6] > variables[2]); - variables[92] = (variables[1]-variables[2])/(variables[18] > variables[6]); - variables[93] = -variables[1]/(variables[6] > variables[2]); - variables[94] = (variables[1] < variables[2])/(variables[6]+variables[18]); - variables[95] = (variables[1] < variables[2])/variables[6]; - variables[96] = (variables[1] < variables[2])/(variables[6]-variables[18]); - variables[97] = (variables[1] < variables[2])/-variables[6]; - variables[98] = (variables[1] < variables[2])/(variables[6]*variables[18]); - variables[99] = (variables[1] < variables[2])/(variables[6]/variables[18]); - variables[100] = sqrt(variables[1]); - variables[101] = pow(variables[1], 2.0); - variables[102] = pow(variables[1], 3.0); - variables[103] = pow(variables[1], variables[2]); - variables[104] = pow(variables[1] <= variables[2], variables[6] >= variables[18]); - variables[105] = pow(variables[1]+variables[2], variables[6] >= variables[18]); - variables[106] = pow(variables[1], variables[2] >= variables[6]); - variables[107] = pow(variables[1]-variables[2], variables[6] >= variables[18]); - variables[108] = pow(-variables[1], variables[2] >= variables[6]); - variables[109] = pow(variables[1]*variables[2], variables[6] >= variables[18]); - variables[110] = pow(variables[1]/variables[2], variables[6] >= variables[18]); - variables[111] = pow(variables[1] <= variables[2], variables[6]+variables[18]); - variables[112] = pow(variables[1] <= variables[2], variables[6]); - variables[113] = pow(variables[1] <= variables[2], variables[6]-variables[18]); - variables[114] = pow(variables[1] <= variables[2], -variables[6]); - variables[115] = pow(variables[1] <= variables[2], variables[6]*variables[18]); - variables[116] = pow(variables[1] <= variables[2], variables[6]/variables[18]); - variables[117] = pow(variables[1] <= variables[2], pow(variables[6], variables[18])); - variables[118] = pow(variables[1] <= variables[2], pow(variables[6], 1.0/variables[18])); - variables[119] = sqrt(variables[1]); - variables[120] = sqrt(variables[1]); - variables[121] = pow(variables[1], 1.0/3.0); - variables[122] = pow(variables[1], 1.0/variables[2]); - variables[123] = pow(variables[1] < variables[2], 1.0/(variables[18] > variables[6])); - variables[124] = pow(variables[1]+variables[2], 1.0/(variables[18] > variables[6])); - variables[125] = pow(variables[1], 1.0/(variables[6] > variables[2])); - variables[126] = pow(variables[1]-variables[2], 1.0/(variables[18] > variables[6])); - variables[127] = pow(-variables[1], 1.0/(variables[6] > variables[2])); - variables[128] = pow(variables[1]*variables[2], 1.0/(variables[18] > variables[6])); - variables[129] = pow(variables[1]/variables[2], 1.0/(variables[18] > variables[6])); - variables[130] = pow(variables[1] < variables[2], 1.0/(variables[6]+variables[18])); - variables[131] = pow(variables[1] < variables[2], 1.0/variables[6]); - variables[132] = pow(variables[1] < variables[2], 1.0/(variables[6]-variables[18])); - variables[133] = pow(variables[1] < variables[2], 1.0/-variables[6]); - variables[134] = pow(variables[1] < variables[2], 1.0/(variables[6]*variables[18])); - variables[135] = pow(variables[1] < variables[2], 1.0/(variables[6]/variables[18])); - variables[136] = pow(variables[1] < variables[2], 1.0/pow(variables[6], variables[18])); - variables[137] = pow(variables[1] < variables[2], 1.0/pow(variables[6], 1.0/variables[18])); - variables[138] = fabs(variables[1]); - variables[139] = exp(variables[1]); - variables[140] = log(variables[1]); - variables[141] = log10(variables[1]); - variables[142] = log(variables[1])/log(2.0); - variables[143] = log10(variables[1]); - variables[144] = log(variables[1])/log(variables[2]); - variables[145] = ceil(variables[1]); - variables[146] = floor(variables[1]); - variables[147] = min(variables[1], variables[2]); - variables[148] = min(variables[1], min(variables[2], variables[6])); - variables[149] = max(variables[1], variables[2]); - variables[150] = max(variables[1], max(variables[2], variables[6])); - variables[151] = fmod(variables[1], variables[2]); - variables[152] = sin(variables[1]); - variables[153] = cos(variables[1]); - variables[154] = tan(variables[1]); - variables[155] = sec(variables[1]); - variables[156] = csc(variables[1]); - variables[157] = cot(variables[1]); - variables[158] = sinh(variables[1]); - variables[159] = cosh(variables[1]); - variables[160] = tanh(variables[1]); - variables[161] = sech(variables[1]); - variables[162] = csch(variables[1]); - variables[163] = coth(variables[1]); - variables[164] = asin(variables[1]); - variables[165] = acos(variables[1]); - variables[166] = atan(variables[1]); - variables[167] = asec(variables[1]); - variables[168] = acsc(variables[1]); - variables[169] = acot(variables[1]); - variables[170] = asinh(variables[1]); - variables[171] = acosh(variables[1]); - variables[172] = atanh(variables[1]/2.0); - variables[173] = asech(variables[1]); - variables[174] = acsch(variables[1]); - variables[175] = acoth(2.0*variables[1]); - variables[176] = (variables[1] > variables[2])?variables[1]:NAN; - variables[177] = (variables[1] > variables[2])?variables[1]:variables[6]; - variables[178] = (variables[1] > variables[2])?variables[1]:(variables[6] > variables[18])?variables[6]:(variables[179] > variables[180])?variables[179]:NAN; - variables[181] = (variables[1] > variables[2])?variables[1]:(variables[6] > variables[18])?variables[6]:(variables[179] > variables[180])?variables[179]:variables[182]; - variables[183] = 123.0+((variables[1] > variables[2])?variables[1]:NAN); - variables[188] = variables[1]; - variables[195] = (variables[1] && variables[2])+((variables[6] > variables[18])?variables[2]:NAN)+variables[179]+(variables[180] && variables[182]); - variables[196] = (variables[1] && variables[2])-(((variables[6] > variables[18])?variables[2]:NAN)-(variables[179]-((variables[6] > variables[18])?variables[2]:NAN)))-(variables[180] && variables[182]); - variables[197] = (variables[1] && variables[2])*((variables[6] > variables[18])?variables[2]:NAN)*variables[179]*((variables[6] > variables[18])?variables[2]:NAN)*(variables[180] && variables[182]); - variables[198] = (variables[1] && variables[2])/(((variables[6] > variables[18])?variables[2]:NAN)/(variables[179]/((variables[6] > variables[18])?variables[2]:NAN))); - variables[199] = (variables[1] || variables[2]) && xor(variables[1], variables[2]) && ((variables[6] > variables[18])?variables[2]:NAN) && variables[179] && ((variables[6] > variables[18])?variables[2]:NAN) && xor(variables[1], variables[2]) && (variables[1] || variables[2]); - variables[200] = (variables[1] && variables[2]) || xor(variables[1], variables[2]) || ((variables[6] > variables[18])?variables[2]:NAN) || variables[179] || ((variables[6] > variables[18])?variables[2]:NAN) || xor(variables[1], variables[2]) || (variables[1] && variables[2]); - variables[201] = xor(variables[1] && variables[2], xor(variables[1] || variables[2], xor((variables[6] > variables[18])?variables[2]:NAN, xor(xor(xor(variables[179], (variables[6] > variables[18])?variables[2]:NAN), variables[1] || variables[2]), variables[1] && variables[2])))); - variables[202] = pow(variables[1] && variables[2], pow((variables[6] > variables[18])?variables[2]:NAN, pow(pow(variables[179], (variables[6] > variables[18])?variables[2]:NAN), variables[1] && variables[2]))); - variables[203] = pow(pow(pow(variables[1] && variables[2], 1.0/pow((variables[6] > variables[18])?variables[2]:NAN, 1.0/variables[179])), 1.0/((variables[6] > variables[18])?variables[2]:NAN)), 1.0/(variables[1] && variables[2])); - variables[204] = -(variables[1] && variables[2])+-((variables[6] > variables[18])?variables[2]:NAN); + 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); } 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 35809a2b2e..9656a17964 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; - variables[205] = u[0]; - variables[206] = u[1]; + algebraic[205] = u[0]; + algebraic[206] = u[1]; - f[0] = variables[205]+variables[206]+states[0]-0.0; - f[1] = variables[205]-variables[206]-(variables[207]+variables[208]); + f[0] = algebraic[205]+algebraic[206]+states[0]-0.0; + f[1] = algebraic[205]-algebraic[206]-(computedConstants[207]+computedConstants[208]); } 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] = variables[205]; - u[1] = variables[206]; + u[0] = algebraic[205]; + u[1] = algebraic[206]; nlaSolve(objectiveFunction0, u, 2, &rfi); - variables[205] = u[0]; - variables[206] = u[1]; + algebraic[205] = u[0]; + algebraic[206] = u[1]; } void initialiseVariables(double *states, double *rates, double *constants) { - variables[1] = 1.0; - variables[2] = 2.0; - variables[6] = 3.0; - variables[18] = 4.0; - variables[179] = 5.0; - variables[180] = 6.0; - variables[182] = 7.0; - variables[205] = 1.0; - variables[206] = 2.0; - variables[184] = 123.0; - variables[185] = 123.456789; - variables[186] = 123.0e99; - variables[187] = 123.456789e99; - variables[189] = 1.0; - variables[190] = 0.0; - variables[191] = 2.71828182845905; - variables[192] = 3.14159265358979; - variables[193] = INFINITY; - variables[194] = NAN; - variables[207] = 1.0; - variables[208] = 3.0; + 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; states[0] = 0.0; } void computeComputedConstants(double *constants, double *computedConstants) { - variables[0] = eq(variables[1], variables[2]); - variables[3] = variables[1]/eq(variables[2], variables[2]); - variables[4] = neq(variables[1], variables[2]); - variables[5] = variables[1]/neq(variables[2], variables[6]); - variables[7] = lt(variables[1], variables[2]); - variables[8] = variables[1]/lt(variables[2], variables[6]); - variables[9] = leq(variables[1], variables[2]); - variables[10] = variables[1]/leq(variables[2], variables[6]); - variables[11] = gt(variables[1], variables[2]); - variables[12] = variables[1]/gt(variables[2], variables[6]); - variables[13] = geq(variables[1], variables[2]); - variables[14] = variables[1]/geq(variables[2], variables[6]); - variables[15] = and(variables[1], variables[2]); - variables[16] = and(variables[1], and(variables[2], variables[6])); - variables[17] = and(lt(variables[1], variables[2]), gt(variables[6], variables[18])); - variables[19] = and(variables[1]+variables[2], gt(variables[6], variables[18])); - variables[20] = and(variables[1], gt(variables[2], variables[6])); - variables[21] = and(variables[1]-variables[2], gt(variables[6], variables[18])); - variables[22] = and(-variables[1], gt(variables[2], variables[6])); - variables[23] = and(pow(variables[1], variables[2]), gt(variables[6], variables[18])); - variables[24] = and(pow(variables[1], 1.0/variables[2]), gt(variables[6], variables[18])); - variables[25] = and(lt(variables[1], variables[2]), variables[6]+variables[18]); - variables[26] = and(lt(variables[1], variables[2]), variables[6]); - variables[27] = and(lt(variables[1], variables[2]), variables[6]-variables[18]); - variables[28] = and(lt(variables[1], variables[2]), -variables[6]); - variables[29] = and(lt(variables[1], variables[2]), pow(variables[6], variables[18])); - variables[30] = and(lt(variables[1], variables[2]), pow(variables[6], 1.0/variables[18])); - variables[31] = variables[1]/and(variables[2], variables[6]); - variables[32] = or(variables[1], variables[2]); - variables[33] = or(variables[1], or(variables[2], variables[6])); - variables[34] = or(lt(variables[1], variables[2]), gt(variables[6], variables[18])); - variables[35] = or(variables[1]+variables[2], gt(variables[6], variables[18])); - variables[36] = or(variables[1], gt(variables[2], variables[6])); - variables[37] = or(variables[1]-variables[2], gt(variables[6], variables[18])); - variables[38] = or(-variables[1], gt(variables[2], variables[6])); - variables[39] = or(pow(variables[1], variables[2]), gt(variables[6], variables[18])); - variables[40] = or(pow(variables[1], 1.0/variables[2]), gt(variables[6], variables[18])); - variables[41] = or(lt(variables[1], variables[2]), variables[6]+variables[18]); - variables[42] = or(lt(variables[1], variables[2]), variables[6]); - variables[43] = or(lt(variables[1], variables[2]), variables[6]-variables[18]); - variables[44] = or(lt(variables[1], variables[2]), -variables[6]); - variables[45] = or(lt(variables[1], variables[2]), pow(variables[6], variables[18])); - variables[46] = or(lt(variables[1], variables[2]), pow(variables[6], 1.0/variables[18])); - variables[47] = variables[1]/or(variables[2], variables[6]); - variables[48] = xor(variables[1], variables[2]); - variables[49] = xor(variables[1], xor(variables[2], variables[6])); - variables[50] = xor(lt(variables[1], variables[2]), gt(variables[6], variables[18])); - variables[51] = xor(variables[1]+variables[2], gt(variables[6], variables[18])); - variables[52] = xor(variables[1], gt(variables[2], variables[6])); - variables[53] = xor(variables[1]-variables[2], gt(variables[6], variables[18])); - variables[54] = xor(-variables[1], gt(variables[2], variables[6])); - variables[55] = xor(pow(variables[1], variables[2]), gt(variables[6], variables[18])); - variables[56] = xor(pow(variables[1], 1.0/variables[2]), gt(variables[6], variables[18])); - variables[57] = xor(lt(variables[1], variables[2]), variables[6]+variables[18]); - variables[58] = xor(lt(variables[1], variables[2]), variables[6]); - variables[59] = xor(lt(variables[1], variables[2]), variables[6]-variables[18]); - variables[60] = xor(lt(variables[1], variables[2]), -variables[6]); - variables[61] = xor(lt(variables[1], variables[2]), pow(variables[6], variables[18])); - variables[62] = xor(lt(variables[1], variables[2]), pow(variables[6], 1.0/variables[18])); - variables[63] = variables[1]/xor(variables[2], variables[6]); - variables[64] = not(variables[1]); - variables[65] = variables[1]+variables[2]; - variables[66] = variables[1]+variables[2]+variables[6]; - variables[67] = lt(variables[1], variables[2])+gt(variables[6], variables[18]); - variables[68] = variables[1]; - variables[69] = variables[1]-variables[2]; - variables[70] = lt(variables[1], variables[2])-gt(variables[6], variables[18]); - variables[71] = lt(variables[1], variables[2])-(variables[6]+variables[18]); - variables[72] = lt(variables[1], variables[2])-variables[6]; - variables[73] = variables[1]-(-variables[2]); - variables[74] = variables[1]-(-variables[2]*variables[6]); - variables[75] = -variables[1]; - variables[76] = -lt(variables[1], variables[2]); - variables[77] = variables[1]*variables[2]; - variables[78] = variables[1]*variables[2]*variables[6]; - variables[79] = lt(variables[1], variables[2])*gt(variables[6], variables[18]); - variables[80] = (variables[1]+variables[2])*gt(variables[6], variables[18]); - variables[81] = variables[1]*gt(variables[2], variables[6]); - variables[82] = (variables[1]-variables[2])*gt(variables[6], variables[18]); - variables[83] = -variables[1]*gt(variables[2], variables[6]); - variables[84] = lt(variables[1], variables[2])*(variables[6]+variables[18]); - variables[85] = lt(variables[1], variables[2])*variables[6]; - variables[86] = lt(variables[1], variables[2])*(variables[6]-variables[18]); - variables[87] = lt(variables[1], variables[2])*-variables[6]; - variables[88] = variables[1]/variables[2]; - variables[89] = lt(variables[1], variables[2])/gt(variables[18], variables[6]); - variables[90] = (variables[1]+variables[2])/gt(variables[18], variables[6]); - variables[91] = variables[1]/gt(variables[6], variables[2]); - variables[92] = (variables[1]-variables[2])/gt(variables[18], variables[6]); - variables[93] = -variables[1]/gt(variables[6], variables[2]); - variables[94] = lt(variables[1], variables[2])/(variables[6]+variables[18]); - variables[95] = lt(variables[1], variables[2])/variables[6]; - variables[96] = lt(variables[1], variables[2])/(variables[6]-variables[18]); - variables[97] = lt(variables[1], variables[2])/-variables[6]; - variables[98] = lt(variables[1], variables[2])/(variables[6]*variables[18]); - variables[99] = lt(variables[1], variables[2])/(variables[6]/variables[18]); - variables[100] = sqrt(variables[1]); - variables[101] = pow(variables[1], 2.0); - variables[102] = pow(variables[1], 3.0); - variables[103] = pow(variables[1], variables[2]); - variables[104] = pow(leq(variables[1], variables[2]), geq(variables[6], variables[18])); - variables[105] = pow(variables[1]+variables[2], geq(variables[6], variables[18])); - variables[106] = pow(variables[1], geq(variables[2], variables[6])); - variables[107] = pow(variables[1]-variables[2], geq(variables[6], variables[18])); - variables[108] = pow(-variables[1], geq(variables[2], variables[6])); - variables[109] = pow(variables[1]*variables[2], geq(variables[6], variables[18])); - variables[110] = pow(variables[1]/variables[2], geq(variables[6], variables[18])); - variables[111] = pow(leq(variables[1], variables[2]), variables[6]+variables[18]); - variables[112] = pow(leq(variables[1], variables[2]), variables[6]); - variables[113] = pow(leq(variables[1], variables[2]), variables[6]-variables[18]); - variables[114] = pow(leq(variables[1], variables[2]), -variables[6]); - variables[115] = pow(leq(variables[1], variables[2]), variables[6]*variables[18]); - variables[116] = pow(leq(variables[1], variables[2]), variables[6]/variables[18]); - variables[117] = pow(leq(variables[1], variables[2]), pow(variables[6], variables[18])); - variables[118] = pow(leq(variables[1], variables[2]), pow(variables[6], 1.0/variables[18])); - variables[119] = sqrt(variables[1]); - variables[120] = sqrt(variables[1]); - variables[121] = pow(variables[1], 1.0/3.0); - variables[122] = pow(variables[1], 1.0/variables[2]); - variables[123] = pow(lt(variables[1], variables[2]), 1.0/gt(variables[18], variables[6])); - variables[124] = pow(variables[1]+variables[2], 1.0/gt(variables[18], variables[6])); - variables[125] = pow(variables[1], 1.0/gt(variables[6], variables[2])); - variables[126] = pow(variables[1]-variables[2], 1.0/gt(variables[18], variables[6])); - variables[127] = pow(-variables[1], 1.0/gt(variables[6], variables[2])); - variables[128] = pow(variables[1]*variables[2], 1.0/gt(variables[18], variables[6])); - variables[129] = pow(variables[1]/variables[2], 1.0/gt(variables[18], variables[6])); - variables[130] = pow(lt(variables[1], variables[2]), 1.0/(variables[6]+variables[18])); - variables[131] = pow(lt(variables[1], variables[2]), 1.0/variables[6]); - variables[132] = pow(lt(variables[1], variables[2]), 1.0/(variables[6]-variables[18])); - variables[133] = pow(lt(variables[1], variables[2]), 1.0/-variables[6]); - variables[134] = pow(lt(variables[1], variables[2]), 1.0/(variables[6]*variables[18])); - variables[135] = pow(lt(variables[1], variables[2]), 1.0/(variables[6]/variables[18])); - variables[136] = pow(lt(variables[1], variables[2]), 1.0/pow(variables[6], variables[18])); - variables[137] = pow(lt(variables[1], variables[2]), 1.0/pow(variables[6], 1.0/variables[18])); - variables[138] = fabs(variables[1]); - variables[139] = exp(variables[1]); - variables[140] = log(variables[1]); - variables[141] = log10(variables[1]); - variables[142] = log(variables[1])/log(2.0); - variables[143] = log10(variables[1]); - variables[144] = log(variables[1])/log(variables[2]); - variables[145] = ceil(variables[1]); - variables[146] = floor(variables[1]); - variables[147] = min(variables[1], variables[2]); - variables[148] = min(variables[1], min(variables[2], variables[6])); - variables[149] = max(variables[1], variables[2]); - variables[150] = max(variables[1], max(variables[2], variables[6])); - variables[151] = fmod(variables[1], variables[2]); - variables[152] = sin(variables[1]); - variables[153] = cos(variables[1]); - variables[154] = tan(variables[1]); - variables[155] = sec(variables[1]); - variables[156] = csc(variables[1]); - variables[157] = cot(variables[1]); - variables[158] = sinh(variables[1]); - variables[159] = cosh(variables[1]); - variables[160] = tanh(variables[1]); - variables[161] = sech(variables[1]); - variables[162] = csch(variables[1]); - variables[163] = coth(variables[1]); - variables[164] = asin(variables[1]); - variables[165] = acos(variables[1]); - variables[166] = atan(variables[1]); - variables[167] = asec(variables[1]); - variables[168] = acsc(variables[1]); - variables[169] = acot(variables[1]); - variables[170] = asinh(variables[1]); - variables[171] = acosh(variables[1]); - variables[172] = atanh(variables[1]/2.0); - variables[173] = asech(variables[1]); - variables[174] = acsch(variables[1]); - variables[175] = acoth(2.0*variables[1]); - variables[176] = (gt(variables[1], variables[2]))?variables[1]:NAN; - variables[177] = (gt(variables[1], variables[2]))?variables[1]:variables[6]; - variables[178] = (gt(variables[1], variables[2]))?variables[1]:(gt(variables[6], variables[18]))?variables[6]:(gt(variables[179], variables[180]))?variables[179]:NAN; - variables[181] = (gt(variables[1], variables[2]))?variables[1]:(gt(variables[6], variables[18]))?variables[6]:(gt(variables[179], variables[180]))?variables[179]:variables[182]; - variables[183] = 123.0+((gt(variables[1], variables[2]))?variables[1]:NAN); - variables[188] = variables[1]; - variables[195] = and(variables[1], variables[2])+((gt(variables[6], variables[18]))?variables[2]:NAN)+variables[179]+and(variables[180], variables[182]); - variables[196] = and(variables[1], variables[2])-(((gt(variables[6], variables[18]))?variables[2]:NAN)-(variables[179]-((gt(variables[6], variables[18]))?variables[2]:NAN)))-and(variables[180], variables[182]); - variables[197] = and(variables[1], variables[2])*((gt(variables[6], variables[18]))?variables[2]:NAN)*variables[179]*((gt(variables[6], variables[18]))?variables[2]:NAN)*and(variables[180], variables[182]); - variables[198] = and(variables[1], variables[2])/(((gt(variables[6], variables[18]))?variables[2]:NAN)/(variables[179]/((gt(variables[6], variables[18]))?variables[2]:NAN))); - variables[199] = and(or(variables[1], variables[2]), and(xor(variables[1], variables[2]), and((gt(variables[6], variables[18]))?variables[2]:NAN, and(and(and(variables[179], (gt(variables[6], variables[18]))?variables[2]:NAN), xor(variables[1], variables[2])), or(variables[1], variables[2]))))); - variables[200] = or(and(variables[1], variables[2]), or(xor(variables[1], variables[2]), or((gt(variables[6], variables[18]))?variables[2]:NAN, or(or(or(variables[179], (gt(variables[6], variables[18]))?variables[2]:NAN), xor(variables[1], variables[2])), and(variables[1], variables[2]))))); - variables[201] = xor(and(variables[1], variables[2]), xor(or(variables[1], variables[2]), xor((gt(variables[6], variables[18]))?variables[2]:NAN, xor(xor(xor(variables[179], (gt(variables[6], variables[18]))?variables[2]:NAN), or(variables[1], variables[2])), and(variables[1], variables[2]))))); - variables[202] = pow(and(variables[1], variables[2]), pow((gt(variables[6], variables[18]))?variables[2]:NAN, pow(pow(variables[179], (gt(variables[6], variables[18]))?variables[2]:NAN), and(variables[1], variables[2])))); - variables[203] = pow(pow(pow(and(variables[1], variables[2]), 1.0/pow((gt(variables[6], variables[18]))?variables[2]:NAN, 1.0/variables[179])), 1.0/((gt(variables[6], variables[18]))?variables[2]:NAN)), 1.0/and(variables[1], variables[2])); - variables[204] = -and(variables[1], variables[2])+-((gt(variables[6], variables[18]))?variables[2]:NAN); + 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); } 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 b86a172b9b..b5bd907469 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; - variables[205] = u[0]; - variables[206] = u[1]; + algebraic[205] = u[0]; + algebraic[206] = u[1]; - f[0] = variables[205]+variables[206]+states[0]-0.0; - f[1] = variables[205]-variables[206]-(variables[207]+variables[208]); + f[0] = algebraic[205]+algebraic[206]+states[0]-0.0; + f[1] = algebraic[205]-algebraic[206]-(computedConstants[207]+computedConstants[208]); } 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] = variables[205]; - u[1] = variables[206]; + u[0] = algebraic[205]; + u[1] = algebraic[206]; nlaSolve(objectiveFunction0, u, 2, &rfi); - variables[205] = u[0]; - variables[206] = u[1]; + algebraic[205] = u[0]; + algebraic[206] = u[1]; } void initialiseVariables(double *states, double *rates, double *constants) { - variables[1] = 1.0; - variables[2] = 2.0; - variables[6] = 3.0; - variables[18] = 4.0; - variables[179] = 5.0; - variables[180] = 6.0; - variables[182] = 7.0; - variables[205] = 1.0; - variables[206] = 2.0; - variables[184] = 123.0; - variables[185] = 123.456789; - variables[186] = 123.0e99; - variables[187] = 123.456789e99; - variables[189] = 1.0; - variables[190] = 0.0; - variables[191] = 2.71828182845905; - variables[192] = 3.14159265358979; - variables[193] = INFINITY; - variables[194] = NAN; - variables[207] = 1.0; - variables[208] = 3.0; + 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; states[0] = 0.0; } void computeComputedConstants(double *constants, double *computedConstants) { - variables[0] = variables[1] == variables[2]; - variables[3] = variables[1]/(variables[2] == variables[2]); - variables[4] = variables[1] != variables[2]; - variables[5] = variables[1]/(variables[2] != variables[6]); - variables[7] = variables[1] < variables[2]; - variables[8] = variables[1]/(variables[2] < variables[6]); - variables[9] = variables[1] <= variables[2]; - variables[10] = variables[1]/(variables[2] <= variables[6]); - variables[11] = variables[1] > variables[2]; - variables[12] = variables[1]/(variables[2] > variables[6]); - variables[13] = variables[1] >= variables[2]; - variables[14] = variables[1]/(variables[2] >= variables[6]); - variables[15] = variables[1] && variables[2]; - variables[16] = variables[1] && variables[2] && variables[6]; - variables[17] = (variables[1] < variables[2]) && (variables[6] > variables[18]); - variables[19] = (variables[1]+variables[2]) && (variables[6] > variables[18]); - variables[20] = variables[1] && (variables[2] > variables[6]); - variables[21] = (variables[1]-variables[2]) && (variables[6] > variables[18]); - variables[22] = -variables[1] && (variables[2] > variables[6]); - variables[23] = pow(variables[1], variables[2]) && (variables[6] > variables[18]); - variables[24] = pow(variables[1], 1.0/variables[2]) && (variables[6] > variables[18]); - variables[25] = (variables[1] < variables[2]) && (variables[6]+variables[18]); - variables[26] = (variables[1] < variables[2]) && variables[6]; - variables[27] = (variables[1] < variables[2]) && (variables[6]-variables[18]); - variables[28] = (variables[1] < variables[2]) && -variables[6]; - variables[29] = (variables[1] < variables[2]) && pow(variables[6], variables[18]); - variables[30] = (variables[1] < variables[2]) && pow(variables[6], 1.0/variables[18]); - variables[31] = variables[1]/(variables[2] && variables[6]); - variables[32] = variables[1] || variables[2]; - variables[33] = variables[1] || variables[2] || variables[6]; - variables[34] = (variables[1] < variables[2]) || (variables[6] > variables[18]); - variables[35] = (variables[1]+variables[2]) || (variables[6] > variables[18]); - variables[36] = variables[1] || (variables[2] > variables[6]); - variables[37] = (variables[1]-variables[2]) || (variables[6] > variables[18]); - variables[38] = -variables[1] || (variables[2] > variables[6]); - variables[39] = pow(variables[1], variables[2]) || (variables[6] > variables[18]); - variables[40] = pow(variables[1], 1.0/variables[2]) || (variables[6] > variables[18]); - variables[41] = (variables[1] < variables[2]) || (variables[6]+variables[18]); - variables[42] = (variables[1] < variables[2]) || variables[6]; - variables[43] = (variables[1] < variables[2]) || (variables[6]-variables[18]); - variables[44] = (variables[1] < variables[2]) || -variables[6]; - variables[45] = (variables[1] < variables[2]) || pow(variables[6], variables[18]); - variables[46] = (variables[1] < variables[2]) || pow(variables[6], 1.0/variables[18]); - variables[47] = variables[1]/(variables[2] || variables[6]); - variables[48] = xor(variables[1], variables[2]); - variables[49] = xor(variables[1], xor(variables[2], variables[6])); - variables[50] = xor(variables[1] < variables[2], variables[6] > variables[18]); - variables[51] = xor(variables[1]+variables[2], variables[6] > variables[18]); - variables[52] = xor(variables[1], variables[2] > variables[6]); - variables[53] = xor(variables[1]-variables[2], variables[6] > variables[18]); - variables[54] = xor(-variables[1], variables[2] > variables[6]); - variables[55] = xor(pow(variables[1], variables[2]), variables[6] > variables[18]); - variables[56] = xor(pow(variables[1], 1.0/variables[2]), variables[6] > variables[18]); - variables[57] = xor(variables[1] < variables[2], variables[6]+variables[18]); - variables[58] = xor(variables[1] < variables[2], variables[6]); - variables[59] = xor(variables[1] < variables[2], variables[6]-variables[18]); - variables[60] = xor(variables[1] < variables[2], -variables[6]); - variables[61] = xor(variables[1] < variables[2], pow(variables[6], variables[18])); - variables[62] = xor(variables[1] < variables[2], pow(variables[6], 1.0/variables[18])); - variables[63] = variables[1]/xor(variables[2], variables[6]); - variables[64] = !variables[1]; - variables[65] = variables[1]+variables[2]; - variables[66] = variables[1]+variables[2]+variables[6]; - variables[67] = (variables[1] < variables[2])+(variables[6] > variables[18]); - variables[68] = variables[1]; - variables[69] = variables[1]-variables[2]; - variables[70] = (variables[1] < variables[2])-(variables[6] > variables[18]); - variables[71] = (variables[1] < variables[2])-(variables[6]+variables[18]); - variables[72] = (variables[1] < variables[2])-variables[6]; - variables[73] = variables[1]-(-variables[2]); - variables[74] = variables[1]-(-variables[2]*variables[6]); - variables[75] = -variables[1]; - variables[76] = -(variables[1] < variables[2]); - variables[77] = variables[1]*variables[2]; - variables[78] = variables[1]*variables[2]*variables[6]; - variables[79] = (variables[1] < variables[2])*(variables[6] > variables[18]); - variables[80] = (variables[1]+variables[2])*(variables[6] > variables[18]); - variables[81] = variables[1]*(variables[2] > variables[6]); - variables[82] = (variables[1]-variables[2])*(variables[6] > variables[18]); - variables[83] = -variables[1]*(variables[2] > variables[6]); - variables[84] = (variables[1] < variables[2])*(variables[6]+variables[18]); - variables[85] = (variables[1] < variables[2])*variables[6]; - variables[86] = (variables[1] < variables[2])*(variables[6]-variables[18]); - variables[87] = (variables[1] < variables[2])*-variables[6]; - variables[88] = variables[1]/variables[2]; - variables[89] = (variables[1] < variables[2])/(variables[18] > variables[6]); - variables[90] = (variables[1]+variables[2])/(variables[18] > variables[6]); - variables[91] = variables[1]/(variables[6] > variables[2]); - variables[92] = (variables[1]-variables[2])/(variables[18] > variables[6]); - variables[93] = -variables[1]/(variables[6] > variables[2]); - variables[94] = (variables[1] < variables[2])/(variables[6]+variables[18]); - variables[95] = (variables[1] < variables[2])/variables[6]; - variables[96] = (variables[1] < variables[2])/(variables[6]-variables[18]); - variables[97] = (variables[1] < variables[2])/-variables[6]; - variables[98] = (variables[1] < variables[2])/(variables[6]*variables[18]); - variables[99] = (variables[1] < variables[2])/(variables[6]/variables[18]); - variables[100] = sqrt(variables[1]); - variables[101] = pow(variables[1], 2.0); - variables[102] = pow(variables[1], 3.0); - variables[103] = pow(variables[1], variables[2]); - variables[104] = pow(variables[1] <= variables[2], variables[6] >= variables[18]); - variables[105] = pow(variables[1]+variables[2], variables[6] >= variables[18]); - variables[106] = pow(variables[1], variables[2] >= variables[6]); - variables[107] = pow(variables[1]-variables[2], variables[6] >= variables[18]); - variables[108] = pow(-variables[1], variables[2] >= variables[6]); - variables[109] = pow(variables[1]*variables[2], variables[6] >= variables[18]); - variables[110] = pow(variables[1]/variables[2], variables[6] >= variables[18]); - variables[111] = pow(variables[1] <= variables[2], variables[6]+variables[18]); - variables[112] = pow(variables[1] <= variables[2], variables[6]); - variables[113] = pow(variables[1] <= variables[2], variables[6]-variables[18]); - variables[114] = pow(variables[1] <= variables[2], -variables[6]); - variables[115] = pow(variables[1] <= variables[2], variables[6]*variables[18]); - variables[116] = pow(variables[1] <= variables[2], variables[6]/variables[18]); - variables[117] = pow(variables[1] <= variables[2], pow(variables[6], variables[18])); - variables[118] = pow(variables[1] <= variables[2], pow(variables[6], 1.0/variables[18])); - variables[119] = sqrt(variables[1]); - variables[120] = sqrt(variables[1]); - variables[121] = pow(variables[1], 1.0/3.0); - variables[122] = pow(variables[1], 1.0/variables[2]); - variables[123] = pow(variables[1] < variables[2], 1.0/(variables[18] > variables[6])); - variables[124] = pow(variables[1]+variables[2], 1.0/(variables[18] > variables[6])); - variables[125] = pow(variables[1], 1.0/(variables[6] > variables[2])); - variables[126] = pow(variables[1]-variables[2], 1.0/(variables[18] > variables[6])); - variables[127] = pow(-variables[1], 1.0/(variables[6] > variables[2])); - variables[128] = pow(variables[1]*variables[2], 1.0/(variables[18] > variables[6])); - variables[129] = pow(variables[1]/variables[2], 1.0/(variables[18] > variables[6])); - variables[130] = pow(variables[1] < variables[2], 1.0/(variables[6]+variables[18])); - variables[131] = pow(variables[1] < variables[2], 1.0/variables[6]); - variables[132] = pow(variables[1] < variables[2], 1.0/(variables[6]-variables[18])); - variables[133] = pow(variables[1] < variables[2], 1.0/-variables[6]); - variables[134] = pow(variables[1] < variables[2], 1.0/(variables[6]*variables[18])); - variables[135] = pow(variables[1] < variables[2], 1.0/(variables[6]/variables[18])); - variables[136] = pow(variables[1] < variables[2], 1.0/pow(variables[6], variables[18])); - variables[137] = pow(variables[1] < variables[2], 1.0/pow(variables[6], 1.0/variables[18])); - variables[138] = fabs(variables[1]); - variables[139] = exp(variables[1]); - variables[140] = log(variables[1]); - variables[141] = log10(variables[1]); - variables[142] = log(variables[1])/log(2.0); - variables[143] = log10(variables[1]); - variables[144] = log(variables[1])/log(variables[2]); - variables[145] = ceil(variables[1]); - variables[146] = floor(variables[1]); - variables[147] = min(variables[1], variables[2]); - variables[148] = min(variables[1], min(variables[2], variables[6])); - variables[149] = max(variables[1], variables[2]); - variables[150] = max(variables[1], max(variables[2], variables[6])); - variables[151] = fmod(variables[1], variables[2]); - variables[152] = sin(variables[1]); - variables[153] = cos(variables[1]); - variables[154] = tan(variables[1]); - variables[155] = sec(variables[1]); - variables[156] = csc(variables[1]); - variables[157] = cot(variables[1]); - variables[158] = sinh(variables[1]); - variables[159] = cosh(variables[1]); - variables[160] = tanh(variables[1]); - variables[161] = sech(variables[1]); - variables[162] = csch(variables[1]); - variables[163] = coth(variables[1]); - variables[164] = asin(variables[1]); - variables[165] = acos(variables[1]); - variables[166] = atan(variables[1]); - variables[167] = asec(variables[1]); - variables[168] = acsc(variables[1]); - variables[169] = acot(variables[1]); - variables[170] = asinh(variables[1]); - variables[171] = acosh(variables[1]); - variables[172] = atanh(variables[1]/2.0); - variables[173] = asech(variables[1]); - variables[174] = acsch(variables[1]); - variables[175] = acoth(2.0*variables[1]); - variables[176] = (variables[1] > variables[2])?variables[1]:NAN; - variables[177] = (variables[1] > variables[2])?variables[1]:variables[6]; - variables[178] = (variables[1] > variables[2])?variables[1]:(variables[6] > variables[18])?variables[6]:(variables[179] > variables[180])?variables[179]:NAN; - variables[181] = (variables[1] > variables[2])?variables[1]:(variables[6] > variables[18])?variables[6]:(variables[179] > variables[180])?variables[179]:variables[182]; - variables[183] = 123.0+((variables[1] > variables[2])?variables[1]:NAN); - variables[188] = variables[1]; - variables[195] = (variables[1] && variables[2])+((variables[6] > variables[18])?variables[2]:NAN)+variables[179]+(variables[180] && variables[182]); - variables[196] = (variables[1] && variables[2])-(((variables[6] > variables[18])?variables[2]:NAN)-(variables[179]-((variables[6] > variables[18])?variables[2]:NAN)))-(variables[180] && variables[182]); - variables[197] = (variables[1] && variables[2])*((variables[6] > variables[18])?variables[2]:NAN)*variables[179]*((variables[6] > variables[18])?variables[2]:NAN)*(variables[180] && variables[182]); - variables[198] = (variables[1] && variables[2])/(((variables[6] > variables[18])?variables[2]:NAN)/(variables[179]/((variables[6] > variables[18])?variables[2]:NAN))); - variables[199] = (variables[1] || variables[2]) && xor(variables[1], variables[2]) && ((variables[6] > variables[18])?variables[2]:NAN) && variables[179] && ((variables[6] > variables[18])?variables[2]:NAN) && xor(variables[1], variables[2]) && (variables[1] || variables[2]); - variables[200] = (variables[1] && variables[2]) || xor(variables[1], variables[2]) || ((variables[6] > variables[18])?variables[2]:NAN) || variables[179] || ((variables[6] > variables[18])?variables[2]:NAN) || xor(variables[1], variables[2]) || (variables[1] && variables[2]); - variables[201] = xor(variables[1] && variables[2], xor(variables[1] || variables[2], xor((variables[6] > variables[18])?variables[2]:NAN, xor(xor(xor(variables[179], (variables[6] > variables[18])?variables[2]:NAN), variables[1] || variables[2]), variables[1] && variables[2])))); - variables[202] = pow(variables[1] && variables[2], pow((variables[6] > variables[18])?variables[2]:NAN, pow(pow(variables[179], (variables[6] > variables[18])?variables[2]:NAN), variables[1] && variables[2]))); - variables[203] = pow(pow(pow(variables[1] && variables[2], 1.0/pow((variables[6] > variables[18])?variables[2]:NAN, 1.0/variables[179])), 1.0/((variables[6] > variables[18])?variables[2]:NAN)), 1.0/(variables[1] && variables[2])); - variables[204] = -(variables[1] && variables[2])+-((variables[6] > variables[18])?variables[2]:NAN); + 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); } 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 a6c7be6c6b..4eeb5c9faa 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] - variables[205] = u[0] - variables[206] = u[1] + algebraic[205] = u[0] + algebraic[206] = u[1] - f[0] = variables[205]+variables[206]+states[0]-0.0 - f[1] = variables[205]-variables[206]-(variables[207]+variables[208]) + f[0] = algebraic[205]+algebraic[206]+states[0]-0.0 + f[1] = algebraic[205]-algebraic[206]-(computed_constants[207]+computed_constants[208]) def find_root_0(voi, states, rates, variables): u = [nan]*2 - u[0] = variables[205] - u[1] = variables[206] + u[0] = algebraic[205] + u[1] = algebraic[206] u = nla_solve(objective_function_0, u, 2, [voi, states, rates, variables]) - variables[205] = u[0] - variables[206] = u[1] + algebraic[205] = u[0] + algebraic[206] = u[1] def initialise_variables(states, rates, constants): - variables[1] = 1.0 - variables[2] = 2.0 - variables[6] = 3.0 - variables[18] = 4.0 - variables[179] = 5.0 - variables[180] = 6.0 - variables[182] = 7.0 - variables[205] = 1.0 - variables[206] = 2.0 - variables[184] = 123.0 - variables[185] = 123.456789 - variables[186] = 123.0e99 - variables[187] = 123.456789e99 - variables[189] = 1.0 - variables[190] = 0.0 - variables[191] = 2.71828182845905 - variables[192] = 3.14159265358979 - variables[193] = inf - variables[194] = nan - variables[207] = 1.0 - variables[208] = 3.0 + 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 states[0] = 0.0 def compute_computed_constants(constants, computed_constants): - variables[0] = eq_func(variables[1], variables[2]) - variables[3] = variables[1]/eq_func(variables[2], variables[2]) - variables[4] = neq_func(variables[1], variables[2]) - variables[5] = variables[1]/neq_func(variables[2], variables[6]) - variables[7] = lt_func(variables[1], variables[2]) - variables[8] = variables[1]/lt_func(variables[2], variables[6]) - variables[9] = leq_func(variables[1], variables[2]) - variables[10] = variables[1]/leq_func(variables[2], variables[6]) - variables[11] = gt_func(variables[1], variables[2]) - variables[12] = variables[1]/gt_func(variables[2], variables[6]) - variables[13] = geq_func(variables[1], variables[2]) - variables[14] = variables[1]/geq_func(variables[2], variables[6]) - variables[15] = and_func(variables[1], variables[2]) - variables[16] = and_func(variables[1], and_func(variables[2], variables[6])) - variables[17] = and_func(lt_func(variables[1], variables[2]), gt_func(variables[6], variables[18])) - variables[19] = and_func(variables[1]+variables[2], gt_func(variables[6], variables[18])) - variables[20] = and_func(variables[1], gt_func(variables[2], variables[6])) - variables[21] = and_func(variables[1]-variables[2], gt_func(variables[6], variables[18])) - variables[22] = and_func(-variables[1], gt_func(variables[2], variables[6])) - variables[23] = and_func(pow(variables[1], variables[2]), gt_func(variables[6], variables[18])) - variables[24] = and_func(pow(variables[1], 1.0/variables[2]), gt_func(variables[6], variables[18])) - variables[25] = and_func(lt_func(variables[1], variables[2]), variables[6]+variables[18]) - variables[26] = and_func(lt_func(variables[1], variables[2]), variables[6]) - variables[27] = and_func(lt_func(variables[1], variables[2]), variables[6]-variables[18]) - variables[28] = and_func(lt_func(variables[1], variables[2]), -variables[6]) - variables[29] = and_func(lt_func(variables[1], variables[2]), pow(variables[6], variables[18])) - variables[30] = and_func(lt_func(variables[1], variables[2]), pow(variables[6], 1.0/variables[18])) - variables[31] = variables[1]/and_func(variables[2], variables[6]) - variables[32] = or_func(variables[1], variables[2]) - variables[33] = or_func(variables[1], or_func(variables[2], variables[6])) - variables[34] = or_func(lt_func(variables[1], variables[2]), gt_func(variables[6], variables[18])) - variables[35] = or_func(variables[1]+variables[2], gt_func(variables[6], variables[18])) - variables[36] = or_func(variables[1], gt_func(variables[2], variables[6])) - variables[37] = or_func(variables[1]-variables[2], gt_func(variables[6], variables[18])) - variables[38] = or_func(-variables[1], gt_func(variables[2], variables[6])) - variables[39] = or_func(pow(variables[1], variables[2]), gt_func(variables[6], variables[18])) - variables[40] = or_func(pow(variables[1], 1.0/variables[2]), gt_func(variables[6], variables[18])) - variables[41] = or_func(lt_func(variables[1], variables[2]), variables[6]+variables[18]) - variables[42] = or_func(lt_func(variables[1], variables[2]), variables[6]) - variables[43] = or_func(lt_func(variables[1], variables[2]), variables[6]-variables[18]) - variables[44] = or_func(lt_func(variables[1], variables[2]), -variables[6]) - variables[45] = or_func(lt_func(variables[1], variables[2]), pow(variables[6], variables[18])) - variables[46] = or_func(lt_func(variables[1], variables[2]), pow(variables[6], 1.0/variables[18])) - variables[47] = variables[1]/or_func(variables[2], variables[6]) - variables[48] = xor_func(variables[1], variables[2]) - variables[49] = xor_func(variables[1], xor_func(variables[2], variables[6])) - variables[50] = xor_func(lt_func(variables[1], variables[2]), gt_func(variables[6], variables[18])) - variables[51] = xor_func(variables[1]+variables[2], gt_func(variables[6], variables[18])) - variables[52] = xor_func(variables[1], gt_func(variables[2], variables[6])) - variables[53] = xor_func(variables[1]-variables[2], gt_func(variables[6], variables[18])) - variables[54] = xor_func(-variables[1], gt_func(variables[2], variables[6])) - variables[55] = xor_func(pow(variables[1], variables[2]), gt_func(variables[6], variables[18])) - variables[56] = xor_func(pow(variables[1], 1.0/variables[2]), gt_func(variables[6], variables[18])) - variables[57] = xor_func(lt_func(variables[1], variables[2]), variables[6]+variables[18]) - variables[58] = xor_func(lt_func(variables[1], variables[2]), variables[6]) - variables[59] = xor_func(lt_func(variables[1], variables[2]), variables[6]-variables[18]) - variables[60] = xor_func(lt_func(variables[1], variables[2]), -variables[6]) - variables[61] = xor_func(lt_func(variables[1], variables[2]), pow(variables[6], variables[18])) - variables[62] = xor_func(lt_func(variables[1], variables[2]), pow(variables[6], 1.0/variables[18])) - variables[63] = variables[1]/xor_func(variables[2], variables[6]) - variables[64] = not_func(variables[1]) - variables[65] = variables[1]+variables[2] - variables[66] = variables[1]+variables[2]+variables[6] - variables[67] = lt_func(variables[1], variables[2])+gt_func(variables[6], variables[18]) - variables[68] = variables[1] - variables[69] = variables[1]-variables[2] - variables[70] = lt_func(variables[1], variables[2])-gt_func(variables[6], variables[18]) - variables[71] = lt_func(variables[1], variables[2])-(variables[6]+variables[18]) - variables[72] = lt_func(variables[1], variables[2])-variables[6] - variables[73] = variables[1]-(-variables[2]) - variables[74] = variables[1]-(-variables[2]*variables[6]) - variables[75] = -variables[1] - variables[76] = -lt_func(variables[1], variables[2]) - variables[77] = variables[1]*variables[2] - variables[78] = variables[1]*variables[2]*variables[6] - variables[79] = lt_func(variables[1], variables[2])*gt_func(variables[6], variables[18]) - variables[80] = (variables[1]+variables[2])*gt_func(variables[6], variables[18]) - variables[81] = variables[1]*gt_func(variables[2], variables[6]) - variables[82] = (variables[1]-variables[2])*gt_func(variables[6], variables[18]) - variables[83] = -variables[1]*gt_func(variables[2], variables[6]) - variables[84] = lt_func(variables[1], variables[2])*(variables[6]+variables[18]) - variables[85] = lt_func(variables[1], variables[2])*variables[6] - variables[86] = lt_func(variables[1], variables[2])*(variables[6]-variables[18]) - variables[87] = lt_func(variables[1], variables[2])*-variables[6] - variables[88] = variables[1]/variables[2] - variables[89] = lt_func(variables[1], variables[2])/gt_func(variables[18], variables[6]) - variables[90] = (variables[1]+variables[2])/gt_func(variables[18], variables[6]) - variables[91] = variables[1]/gt_func(variables[6], variables[2]) - variables[92] = (variables[1]-variables[2])/gt_func(variables[18], variables[6]) - variables[93] = -variables[1]/gt_func(variables[6], variables[2]) - variables[94] = lt_func(variables[1], variables[2])/(variables[6]+variables[18]) - variables[95] = lt_func(variables[1], variables[2])/variables[6] - variables[96] = lt_func(variables[1], variables[2])/(variables[6]-variables[18]) - variables[97] = lt_func(variables[1], variables[2])/-variables[6] - variables[98] = lt_func(variables[1], variables[2])/(variables[6]*variables[18]) - variables[99] = lt_func(variables[1], variables[2])/(variables[6]/variables[18]) - variables[100] = sqrt(variables[1]) - variables[101] = pow(variables[1], 2.0) - variables[102] = pow(variables[1], 3.0) - variables[103] = pow(variables[1], variables[2]) - variables[104] = pow(leq_func(variables[1], variables[2]), geq_func(variables[6], variables[18])) - variables[105] = pow(variables[1]+variables[2], geq_func(variables[6], variables[18])) - variables[106] = pow(variables[1], geq_func(variables[2], variables[6])) - variables[107] = pow(variables[1]-variables[2], geq_func(variables[6], variables[18])) - variables[108] = pow(-variables[1], geq_func(variables[2], variables[6])) - variables[109] = pow(variables[1]*variables[2], geq_func(variables[6], variables[18])) - variables[110] = pow(variables[1]/variables[2], geq_func(variables[6], variables[18])) - variables[111] = pow(leq_func(variables[1], variables[2]), variables[6]+variables[18]) - variables[112] = pow(leq_func(variables[1], variables[2]), variables[6]) - variables[113] = pow(leq_func(variables[1], variables[2]), variables[6]-variables[18]) - variables[114] = pow(leq_func(variables[1], variables[2]), -variables[6]) - variables[115] = pow(leq_func(variables[1], variables[2]), variables[6]*variables[18]) - variables[116] = pow(leq_func(variables[1], variables[2]), variables[6]/variables[18]) - variables[117] = pow(leq_func(variables[1], variables[2]), pow(variables[6], variables[18])) - variables[118] = pow(leq_func(variables[1], variables[2]), pow(variables[6], 1.0/variables[18])) - variables[119] = sqrt(variables[1]) - variables[120] = sqrt(variables[1]) - variables[121] = pow(variables[1], 1.0/3.0) - variables[122] = pow(variables[1], 1.0/variables[2]) - variables[123] = pow(lt_func(variables[1], variables[2]), 1.0/gt_func(variables[18], variables[6])) - variables[124] = pow(variables[1]+variables[2], 1.0/gt_func(variables[18], variables[6])) - variables[125] = pow(variables[1], 1.0/gt_func(variables[6], variables[2])) - variables[126] = pow(variables[1]-variables[2], 1.0/gt_func(variables[18], variables[6])) - variables[127] = pow(-variables[1], 1.0/gt_func(variables[6], variables[2])) - variables[128] = pow(variables[1]*variables[2], 1.0/gt_func(variables[18], variables[6])) - variables[129] = pow(variables[1]/variables[2], 1.0/gt_func(variables[18], variables[6])) - variables[130] = pow(lt_func(variables[1], variables[2]), 1.0/(variables[6]+variables[18])) - variables[131] = pow(lt_func(variables[1], variables[2]), 1.0/variables[6]) - variables[132] = pow(lt_func(variables[1], variables[2]), 1.0/(variables[6]-variables[18])) - variables[133] = pow(lt_func(variables[1], variables[2]), 1.0/-variables[6]) - variables[134] = pow(lt_func(variables[1], variables[2]), 1.0/(variables[6]*variables[18])) - variables[135] = pow(lt_func(variables[1], variables[2]), 1.0/(variables[6]/variables[18])) - variables[136] = pow(lt_func(variables[1], variables[2]), 1.0/pow(variables[6], variables[18])) - variables[137] = pow(lt_func(variables[1], variables[2]), 1.0/pow(variables[6], 1.0/variables[18])) - variables[138] = fabs(variables[1]) - variables[139] = exp(variables[1]) - variables[140] = log(variables[1]) - variables[141] = log10(variables[1]) - variables[142] = log(variables[1])/log(2.0) - variables[143] = log10(variables[1]) - variables[144] = log(variables[1])/log(variables[2]) - variables[145] = ceil(variables[1]) - variables[146] = floor(variables[1]) - variables[147] = min(variables[1], variables[2]) - variables[148] = min(variables[1], min(variables[2], variables[6])) - variables[149] = max(variables[1], variables[2]) - variables[150] = max(variables[1], max(variables[2], variables[6])) - variables[151] = fmod(variables[1], variables[2]) - variables[152] = sin(variables[1]) - variables[153] = cos(variables[1]) - variables[154] = tan(variables[1]) - variables[155] = sec(variables[1]) - variables[156] = csc(variables[1]) - variables[157] = cot(variables[1]) - variables[158] = sinh(variables[1]) - variables[159] = cosh(variables[1]) - variables[160] = tanh(variables[1]) - variables[161] = sech(variables[1]) - variables[162] = csch(variables[1]) - variables[163] = coth(variables[1]) - variables[164] = asin(variables[1]) - variables[165] = acos(variables[1]) - variables[166] = atan(variables[1]) - variables[167] = asec(variables[1]) - variables[168] = acsc(variables[1]) - variables[169] = acot(variables[1]) - variables[170] = asinh(variables[1]) - variables[171] = acosh(variables[1]) - variables[172] = atanh(variables[1]/2.0) - variables[173] = asech(variables[1]) - variables[174] = acsch(variables[1]) - variables[175] = acoth(2.0*variables[1]) - variables[176] = variables[1] if gt_func(variables[1], variables[2]) else nan - variables[177] = variables[1] if gt_func(variables[1], variables[2]) else variables[6] - variables[178] = variables[1] if gt_func(variables[1], variables[2]) else variables[6] if gt_func(variables[6], variables[18]) else variables[179] if gt_func(variables[179], variables[180]) else nan - variables[181] = variables[1] if gt_func(variables[1], variables[2]) else variables[6] if gt_func(variables[6], variables[18]) else variables[179] if gt_func(variables[179], variables[180]) else variables[182] - variables[183] = 123.0+(variables[1] if gt_func(variables[1], variables[2]) else nan) - variables[188] = variables[1] - variables[195] = and_func(variables[1], variables[2])+(variables[2] if gt_func(variables[6], variables[18]) else nan)+variables[179]+and_func(variables[180], variables[182]) - variables[196] = and_func(variables[1], variables[2])-((variables[2] if gt_func(variables[6], variables[18]) else nan)-(variables[179]-(variables[2] if gt_func(variables[6], variables[18]) else nan)))-and_func(variables[180], variables[182]) - variables[197] = and_func(variables[1], variables[2])*(variables[2] if gt_func(variables[6], variables[18]) else nan)*variables[179]*(variables[2] if gt_func(variables[6], variables[18]) else nan)*and_func(variables[180], variables[182]) - variables[198] = and_func(variables[1], variables[2])/((variables[2] if gt_func(variables[6], variables[18]) else nan)/(variables[179]/(variables[2] if gt_func(variables[6], variables[18]) else nan))) - variables[199] = and_func(or_func(variables[1], variables[2]), and_func(xor_func(variables[1], variables[2]), and_func(variables[2] if gt_func(variables[6], variables[18]) else nan, and_func(and_func(and_func(variables[179], variables[2] if gt_func(variables[6], variables[18]) else nan), xor_func(variables[1], variables[2])), or_func(variables[1], variables[2]))))) - variables[200] = or_func(and_func(variables[1], variables[2]), or_func(xor_func(variables[1], variables[2]), or_func(variables[2] if gt_func(variables[6], variables[18]) else nan, or_func(or_func(or_func(variables[179], variables[2] if gt_func(variables[6], variables[18]) else nan), xor_func(variables[1], variables[2])), and_func(variables[1], variables[2]))))) - variables[201] = xor_func(and_func(variables[1], variables[2]), xor_func(or_func(variables[1], variables[2]), xor_func(variables[2] if gt_func(variables[6], variables[18]) else nan, xor_func(xor_func(xor_func(variables[179], variables[2] if gt_func(variables[6], variables[18]) else nan), or_func(variables[1], variables[2])), and_func(variables[1], variables[2]))))) - variables[202] = pow(and_func(variables[1], variables[2]), pow(variables[2] if gt_func(variables[6], variables[18]) else nan, pow(pow(variables[179], variables[2] if gt_func(variables[6], variables[18]) else nan), and_func(variables[1], variables[2])))) - variables[203] = pow(pow(pow(and_func(variables[1], variables[2]), 1.0/pow(variables[2] if gt_func(variables[6], variables[18]) else nan, 1.0/variables[179])), 1.0/(variables[2] if gt_func(variables[6], variables[18]) else nan)), 1.0/and_func(variables[1], variables[2])) - variables[204] = -and_func(variables[1], variables[2])+-(variables[2] if gt_func(variables[6], variables[18]) else nan) + 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) 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 b4c4b8088d..f35ae16224 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; - variables[205] = u[0]; - variables[206] = u[1]; + algebraic[205] = u[0]; + algebraic[206] = u[1]; - f[0] = variables[205]+variables[206]+states[0]-0.0; - f[1] = variables[205]-variables[206]-(variables[207]+variables[208]); + f[0] = algebraic[205]+algebraic[206]+states[0]-0.0; + f[1] = algebraic[205]-algebraic[206]-(computedConstants[207]+computedConstants[208]); } 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] = variables[205]; - u[1] = variables[206]; + u[0] = algebraic[205]; + u[1] = algebraic[206]; nlaSolve(objectiveFunction0, u, 2, &rfi); - variables[205] = u[0]; - variables[206] = u[1]; + algebraic[205] = u[0]; + algebraic[206] = u[1]; } void initialiseVariables(double *states, double *rates, double *constants) { - variables[1] = 1.0; - variables[2] = 2.0; - variables[6] = 3.0; - variables[18] = 4.0; - variables[179] = 5.0; - variables[180] = 6.0; - variables[182] = 7.0; - variables[205] = 1.0; - variables[206] = 2.0; - variables[184] = 123.0; - variables[185] = 123.456789; - variables[186] = 123.0e99; - variables[187] = 123.456789e99; - variables[189] = 1.0; - variables[190] = 0.0; - variables[191] = 2.71828182845905; - variables[192] = 3.14159265358979; - variables[193] = INFINITY; - variables[194] = NAN; - variables[207] = 1.0; - variables[208] = 3.0; + 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; states[0] = 0.0; } void computeComputedConstants(double *constants, double *computedConstants) { - variables[0] = variables[1] == variables[2]; - variables[3] = variables[1]/(variables[2] == variables[2]); - variables[4] = variables[1] != variables[2]; - variables[5] = variables[1]/(variables[2] != variables[6]); - variables[7] = variables[1] < variables[2]; - variables[8] = variables[1]/(variables[2] < variables[6]); - variables[9] = variables[1] <= variables[2]; - variables[10] = variables[1]/(variables[2] <= variables[6]); - variables[11] = variables[1] > variables[2]; - variables[12] = variables[1]/(variables[2] > variables[6]); - variables[13] = variables[1] >= variables[2]; - variables[14] = variables[1]/(variables[2] >= variables[6]); - variables[15] = variables[1] && variables[2]; - variables[16] = variables[1] && variables[2] && variables[6]; - variables[17] = (variables[1] < variables[2]) && (variables[6] > variables[18]); - variables[19] = (variables[1]+variables[2]) && (variables[6] > variables[18]); - variables[20] = variables[1] && (variables[2] > variables[6]); - variables[21] = (variables[1]-variables[2]) && (variables[6] > variables[18]); - variables[22] = -variables[1] && (variables[2] > variables[6]); - variables[23] = (variables[1]^^variables[2]) && (variables[6] > variables[18]); - variables[24] = (variables[1]^^(1.0/variables[2])) && (variables[6] > variables[18]); - variables[25] = (variables[1] < variables[2]) && (variables[6]+variables[18]); - variables[26] = (variables[1] < variables[2]) && variables[6]; - variables[27] = (variables[1] < variables[2]) && (variables[6]-variables[18]); - variables[28] = (variables[1] < variables[2]) && -variables[6]; - variables[29] = (variables[1] < variables[2]) && (variables[6]^^variables[18]); - variables[30] = (variables[1] < variables[2]) && (variables[6]^^(1.0/variables[18])); - variables[31] = variables[1]/(variables[2] && variables[6]); - variables[32] = variables[1] || variables[2]; - variables[33] = variables[1] || variables[2] || variables[6]; - variables[34] = (variables[1] < variables[2]) || (variables[6] > variables[18]); - variables[35] = (variables[1]+variables[2]) || (variables[6] > variables[18]); - variables[36] = variables[1] || (variables[2] > variables[6]); - variables[37] = (variables[1]-variables[2]) || (variables[6] > variables[18]); - variables[38] = -variables[1] || (variables[2] > variables[6]); - variables[39] = (variables[1]^^variables[2]) || (variables[6] > variables[18]); - variables[40] = (variables[1]^^(1.0/variables[2])) || (variables[6] > variables[18]); - variables[41] = (variables[1] < variables[2]) || (variables[6]+variables[18]); - variables[42] = (variables[1] < variables[2]) || variables[6]; - variables[43] = (variables[1] < variables[2]) || (variables[6]-variables[18]); - variables[44] = (variables[1] < variables[2]) || -variables[6]; - variables[45] = (variables[1] < variables[2]) || (variables[6]^^variables[18]); - variables[46] = (variables[1] < variables[2]) || (variables[6]^^(1.0/variables[18])); - variables[47] = variables[1]/(variables[2] || variables[6]); - variables[48] = variables[1]^variables[2]; - variables[49] = variables[1]^variables[2]^variables[6]; - variables[50] = (variables[1] < variables[2])^(variables[6] > variables[18]); - variables[51] = (variables[1]+variables[2])^(variables[6] > variables[18]); - variables[52] = variables[1]^(variables[2] > variables[6]); - variables[53] = (variables[1]-variables[2])^(variables[6] > variables[18]); - variables[54] = -variables[1]^(variables[2] > variables[6]); - variables[55] = (variables[1]^^variables[2])^(variables[6] > variables[18]); - variables[56] = (variables[1]^^(1.0/variables[2]))^(variables[6] > variables[18]); - variables[57] = (variables[1] < variables[2])^(variables[6]+variables[18]); - variables[58] = (variables[1] < variables[2])^variables[6]; - variables[59] = (variables[1] < variables[2])^(variables[6]-variables[18]); - variables[60] = (variables[1] < variables[2])^-variables[6]; - variables[61] = (variables[1] < variables[2])^(variables[6]^^variables[18]); - variables[62] = (variables[1] < variables[2])^(variables[6]^^(1.0/variables[18])); - variables[63] = variables[1]/(variables[2]^variables[6]); - variables[64] = !variables[1]; - variables[65] = variables[1]+variables[2]; - variables[66] = variables[1]+variables[2]+variables[6]; - variables[67] = (variables[1] < variables[2])+(variables[6] > variables[18]); - variables[68] = variables[1]; - variables[69] = variables[1]-variables[2]; - variables[70] = (variables[1] < variables[2])-(variables[6] > variables[18]); - variables[71] = (variables[1] < variables[2])-(variables[6]+variables[18]); - variables[72] = (variables[1] < variables[2])-variables[6]; - variables[73] = variables[1]-(-variables[2]); - variables[74] = variables[1]-(-variables[2]*variables[6]); - variables[75] = -variables[1]; - variables[76] = -(variables[1] < variables[2]); - variables[77] = variables[1]*variables[2]; - variables[78] = variables[1]*variables[2]*variables[6]; - variables[79] = (variables[1] < variables[2])*(variables[6] > variables[18]); - variables[80] = (variables[1]+variables[2])*(variables[6] > variables[18]); - variables[81] = variables[1]*(variables[2] > variables[6]); - variables[82] = (variables[1]-variables[2])*(variables[6] > variables[18]); - variables[83] = -variables[1]*(variables[2] > variables[6]); - variables[84] = (variables[1] < variables[2])*(variables[6]+variables[18]); - variables[85] = (variables[1] < variables[2])*variables[6]; - variables[86] = (variables[1] < variables[2])*(variables[6]-variables[18]); - variables[87] = (variables[1] < variables[2])*-variables[6]; - variables[88] = variables[1]/variables[2]; - variables[89] = (variables[1] < variables[2])/(variables[18] > variables[6]); - variables[90] = (variables[1]+variables[2])/(variables[18] > variables[6]); - variables[91] = variables[1]/(variables[6] > variables[2]); - variables[92] = (variables[1]-variables[2])/(variables[18] > variables[6]); - variables[93] = -variables[1]/(variables[6] > variables[2]); - variables[94] = (variables[1] < variables[2])/(variables[6]+variables[18]); - variables[95] = (variables[1] < variables[2])/variables[6]; - variables[96] = (variables[1] < variables[2])/(variables[6]-variables[18]); - variables[97] = (variables[1] < variables[2])/-variables[6]; - variables[98] = (variables[1] < variables[2])/(variables[6]*variables[18]); - variables[99] = (variables[1] < variables[2])/(variables[6]/variables[18]); - variables[100] = sqrt(variables[1]); - variables[101] = sqr(variables[1]); - variables[102] = variables[1]^^3.0; - variables[103] = variables[1]^^variables[2]; - variables[104] = (variables[1] <= variables[2])^^(variables[6] >= variables[18]); - variables[105] = (variables[1]+variables[2])^^(variables[6] >= variables[18]); - variables[106] = variables[1]^^(variables[2] >= variables[6]); - variables[107] = (variables[1]-variables[2])^^(variables[6] >= variables[18]); - variables[108] = (-variables[1])^^(variables[2] >= variables[6]); - variables[109] = (variables[1]*variables[2])^^(variables[6] >= variables[18]); - variables[110] = (variables[1]/variables[2])^^(variables[6] >= variables[18]); - variables[111] = (variables[1] <= variables[2])^^(variables[6]+variables[18]); - variables[112] = (variables[1] <= variables[2])^^variables[6]; - variables[113] = (variables[1] <= variables[2])^^variables[6]-variables[18]; - variables[114] = (variables[1] <= variables[2])^^-variables[6]; - variables[115] = (variables[1] <= variables[2])^^(variables[6]*variables[18]); - variables[116] = (variables[1] <= variables[2])^^(variables[6]/variables[18]); - variables[117] = (variables[1] <= variables[2])^^(variables[6]^^variables[18]); - variables[118] = (variables[1] <= variables[2])^^(variables[6]^^(1.0/variables[18])); - variables[119] = sqrt(variables[1]); - variables[120] = sqrt(variables[1]); - variables[121] = variables[1]^^(1.0/3.0); - variables[122] = variables[1]^^(1.0/variables[2]); - variables[123] = (variables[1] < variables[2])^^(1.0/(variables[18] > variables[6])); - variables[124] = (variables[1]+variables[2])^^(1.0/(variables[18] > variables[6])); - variables[125] = variables[1]^^(1.0/(variables[6] > variables[2])); - variables[126] = (variables[1]-variables[2])^^(1.0/(variables[18] > variables[6])); - variables[127] = (-variables[1])^^(1.0/(variables[6] > variables[2])); - variables[128] = (variables[1]*variables[2])^^(1.0/(variables[18] > variables[6])); - variables[129] = (variables[1]/variables[2])^^(1.0/(variables[18] > variables[6])); - variables[130] = (variables[1] < variables[2])^^(1.0/(variables[6]+variables[18])); - variables[131] = (variables[1] < variables[2])^^(1.0/variables[6]); - variables[132] = (variables[1] < variables[2])^^(1.0/(variables[6]-variables[18])); - variables[133] = (variables[1] < variables[2])^^(1.0/(-variables[6])); - variables[134] = (variables[1] < variables[2])^^(1.0/(variables[6]*variables[18])); - variables[135] = (variables[1] < variables[2])^^(1.0/(variables[6]/variables[18])); - variables[136] = (variables[1] < variables[2])^^(1.0/(variables[6]^^variables[18])); - variables[137] = (variables[1] < variables[2])^^(1.0/(variables[6]^^(1.0/variables[18]))); - variables[138] = fabs(variables[1]); - variables[139] = exp(variables[1]); - variables[140] = log(variables[1]); - variables[141] = log10(variables[1]); - variables[142] = log(variables[1])/log(2.0); - variables[143] = log10(variables[1]); - variables[144] = log(variables[1])/log(variables[2]); - variables[145] = ceil(variables[1]); - variables[146] = floor(variables[1]); - variables[147] = min(variables[1], variables[2]); - variables[148] = min(variables[1], min(variables[2], variables[6])); - variables[149] = max(variables[1], variables[2]); - variables[150] = max(variables[1], max(variables[2], variables[6])); - variables[151] = fmod(variables[1], variables[2]); - variables[152] = sin(variables[1]); - variables[153] = cos(variables[1]); - variables[154] = tan(variables[1]); - variables[155] = sec(variables[1]); - variables[156] = csc(variables[1]); - variables[157] = cot(variables[1]); - variables[158] = sinh(variables[1]); - variables[159] = cosh(variables[1]); - variables[160] = tanh(variables[1]); - variables[161] = sech(variables[1]); - variables[162] = csch(variables[1]); - variables[163] = coth(variables[1]); - variables[164] = asin(variables[1]); - variables[165] = acos(variables[1]); - variables[166] = atan(variables[1]); - variables[167] = asec(variables[1]); - variables[168] = acsc(variables[1]); - variables[169] = acot(variables[1]); - variables[170] = asinh(variables[1]); - variables[171] = acosh(variables[1]); - variables[172] = atanh(variables[1]/2.0); - variables[173] = asech(variables[1]); - variables[174] = acsch(variables[1]); - variables[175] = acoth(2.0*variables[1]); - variables[176] = piecewise(variables[1] > variables[2], variables[1], NAN); - variables[177] = piecewise(variables[1] > variables[2], variables[1], variables[6]); - variables[178] = piecewise(variables[1] > variables[2], variables[1], piecewise(variables[6] > variables[18], variables[6], piecewise(variables[179] > variables[180], variables[179], NAN))); - variables[181] = piecewise(variables[1] > variables[2], variables[1], piecewise(variables[6] > variables[18], variables[6], piecewise(variables[179] > variables[180], variables[179], variables[182]))); - variables[183] = 123.0+piecewise(variables[1] > variables[2], variables[1], NAN); - variables[188] = variables[1]; - variables[195] = (variables[1] && variables[2])+piecewise(variables[6] > variables[18], variables[2], NAN)+variables[179]+(variables[180] && variables[182]); - variables[196] = (variables[1] && variables[2])-(piecewise(variables[6] > variables[18], variables[2], NAN)-(variables[179]-piecewise(variables[6] > variables[18], variables[2], NAN)))-(variables[180] && variables[182]); - variables[197] = (variables[1] && variables[2])*piecewise(variables[6] > variables[18], variables[2], NAN)*variables[179]*piecewise(variables[6] > variables[18], variables[2], NAN)*(variables[180] && variables[182]); - variables[198] = (variables[1] && variables[2])/(piecewise(variables[6] > variables[18], variables[2], NAN)/(variables[179]/piecewise(variables[6] > variables[18], variables[2], NAN))); - variables[199] = (variables[1] || variables[2]) && (variables[1]^variables[2]) && piecewise(variables[6] > variables[18], variables[2], NAN) && variables[179] && piecewise(variables[6] > variables[18], variables[2], NAN) && (variables[1]^variables[2]) && (variables[1] || variables[2]); - variables[200] = (variables[1] && variables[2]) || (variables[1]^variables[2]) || piecewise(variables[6] > variables[18], variables[2], NAN) || variables[179] || piecewise(variables[6] > variables[18], variables[2], NAN) || (variables[1]^variables[2]) || (variables[1] && variables[2]); - variables[201] = (variables[1] && variables[2])^(variables[1] || variables[2])^piecewise(variables[6] > variables[18], variables[2], NAN)^variables[179]^piecewise(variables[6] > variables[18], variables[2], NAN)^(variables[1] || variables[2])^(variables[1] && variables[2]); - variables[202] = (variables[1] && variables[2])^^(piecewise(variables[6] > variables[18], variables[2], NAN)^^(variables[179]^^piecewise(variables[6] > variables[18], variables[2], NAN)^^(variables[1] && variables[2]))); - variables[203] = (variables[1] && variables[2])^^(1.0/(piecewise(variables[6] > variables[18], variables[2], NAN)^^(1.0/variables[179])))^^(1.0/piecewise(variables[6] > variables[18], variables[2], NAN))^^(1.0/(variables[1] && variables[2])); - variables[204] = -(variables[1] && variables[2])+-piecewise(variables[6] > variables[18], variables[2], NAN); + 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); } 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 1a6049e40a..acbe541a58 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] - variables[205] = u[0] - variables[206] = u[1] + algebraic[205] = u[0] + algebraic[206] = u[1] - f[0] = variables[205]+variables[206]+states[0]-0.0 - f[1] = variables[205]-variables[206]-(variables[207]+variables[208]) + f[0] = algebraic[205]+algebraic[206]+states[0]-0.0 + f[1] = algebraic[205]-algebraic[206]-(computed_constants[207]+computed_constants[208]) def find_root_0(voi, states, rates, variables): u = [nan]*2 - u[0] = variables[205] - u[1] = variables[206] + u[0] = algebraic[205] + u[1] = algebraic[206] u = nla_solve(objective_function_0, u, 2, [voi, states, rates, variables]) - variables[205] = u[0] - variables[206] = u[1] + algebraic[205] = u[0] + algebraic[206] = u[1] def initialise_variables(states, rates, constants): - variables[1] = 1.0 - variables[2] = 2.0 - variables[6] = 3.0 - variables[18] = 4.0 - variables[179] = 5.0 - variables[180] = 6.0 - variables[182] = 7.0 - variables[205] = 1.0 - variables[206] = 2.0 - variables[184] = 123.0 - variables[185] = 123.456789 - variables[186] = 123.0e99 - variables[187] = 123.456789e99 - variables[189] = 1.0 - variables[190] = 0.0 - variables[191] = 2.71828182845905 - variables[192] = 3.14159265358979 - variables[193] = inf - variables[194] = nan - variables[207] = 1.0 - variables[208] = 3.0 + 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 states[0] = 0.0 def compute_computed_constants(constants, computed_constants): - variables[0] = eq_func(variables[1], variables[2]) - variables[3] = variables[1]/eq_func(variables[2], variables[2]) - variables[4] = neq_func(variables[1], variables[2]) - variables[5] = variables[1]/neq_func(variables[2], variables[6]) - variables[7] = lt_func(variables[1], variables[2]) - variables[8] = variables[1]/lt_func(variables[2], variables[6]) - variables[9] = leq_func(variables[1], variables[2]) - variables[10] = variables[1]/leq_func(variables[2], variables[6]) - variables[11] = gt_func(variables[1], variables[2]) - variables[12] = variables[1]/gt_func(variables[2], variables[6]) - variables[13] = geq_func(variables[1], variables[2]) - variables[14] = variables[1]/geq_func(variables[2], variables[6]) - variables[15] = and_func(variables[1], variables[2]) - variables[16] = and_func(variables[1], and_func(variables[2], variables[6])) - variables[17] = and_func(lt_func(variables[1], variables[2]), gt_func(variables[6], variables[18])) - variables[19] = and_func(variables[1]+variables[2], gt_func(variables[6], variables[18])) - variables[20] = and_func(variables[1], gt_func(variables[2], variables[6])) - variables[21] = and_func(variables[1]-variables[2], gt_func(variables[6], variables[18])) - variables[22] = and_func(-variables[1], gt_func(variables[2], variables[6])) - variables[23] = and_func(pow(variables[1], variables[2]), gt_func(variables[6], variables[18])) - variables[24] = and_func(pow(variables[1], 1.0/variables[2]), gt_func(variables[6], variables[18])) - variables[25] = and_func(lt_func(variables[1], variables[2]), variables[6]+variables[18]) - variables[26] = and_func(lt_func(variables[1], variables[2]), variables[6]) - variables[27] = and_func(lt_func(variables[1], variables[2]), variables[6]-variables[18]) - variables[28] = and_func(lt_func(variables[1], variables[2]), -variables[6]) - variables[29] = and_func(lt_func(variables[1], variables[2]), pow(variables[6], variables[18])) - variables[30] = and_func(lt_func(variables[1], variables[2]), pow(variables[6], 1.0/variables[18])) - variables[31] = variables[1]/and_func(variables[2], variables[6]) - variables[32] = or_func(variables[1], variables[2]) - variables[33] = or_func(variables[1], or_func(variables[2], variables[6])) - variables[34] = or_func(lt_func(variables[1], variables[2]), gt_func(variables[6], variables[18])) - variables[35] = or_func(variables[1]+variables[2], gt_func(variables[6], variables[18])) - variables[36] = or_func(variables[1], gt_func(variables[2], variables[6])) - variables[37] = or_func(variables[1]-variables[2], gt_func(variables[6], variables[18])) - variables[38] = or_func(-variables[1], gt_func(variables[2], variables[6])) - variables[39] = or_func(pow(variables[1], variables[2]), gt_func(variables[6], variables[18])) - variables[40] = or_func(pow(variables[1], 1.0/variables[2]), gt_func(variables[6], variables[18])) - variables[41] = or_func(lt_func(variables[1], variables[2]), variables[6]+variables[18]) - variables[42] = or_func(lt_func(variables[1], variables[2]), variables[6]) - variables[43] = or_func(lt_func(variables[1], variables[2]), variables[6]-variables[18]) - variables[44] = or_func(lt_func(variables[1], variables[2]), -variables[6]) - variables[45] = or_func(lt_func(variables[1], variables[2]), pow(variables[6], variables[18])) - variables[46] = or_func(lt_func(variables[1], variables[2]), pow(variables[6], 1.0/variables[18])) - variables[47] = variables[1]/or_func(variables[2], variables[6]) - variables[48] = xor_func(variables[1], variables[2]) - variables[49] = xor_func(variables[1], xor_func(variables[2], variables[6])) - variables[50] = xor_func(lt_func(variables[1], variables[2]), gt_func(variables[6], variables[18])) - variables[51] = xor_func(variables[1]+variables[2], gt_func(variables[6], variables[18])) - variables[52] = xor_func(variables[1], gt_func(variables[2], variables[6])) - variables[53] = xor_func(variables[1]-variables[2], gt_func(variables[6], variables[18])) - variables[54] = xor_func(-variables[1], gt_func(variables[2], variables[6])) - variables[55] = xor_func(pow(variables[1], variables[2]), gt_func(variables[6], variables[18])) - variables[56] = xor_func(pow(variables[1], 1.0/variables[2]), gt_func(variables[6], variables[18])) - variables[57] = xor_func(lt_func(variables[1], variables[2]), variables[6]+variables[18]) - variables[58] = xor_func(lt_func(variables[1], variables[2]), variables[6]) - variables[59] = xor_func(lt_func(variables[1], variables[2]), variables[6]-variables[18]) - variables[60] = xor_func(lt_func(variables[1], variables[2]), -variables[6]) - variables[61] = xor_func(lt_func(variables[1], variables[2]), pow(variables[6], variables[18])) - variables[62] = xor_func(lt_func(variables[1], variables[2]), pow(variables[6], 1.0/variables[18])) - variables[63] = variables[1]/xor_func(variables[2], variables[6]) - variables[64] = not_func(variables[1]) - variables[65] = variables[1]+variables[2] - variables[66] = variables[1]+variables[2]+variables[6] - variables[67] = lt_func(variables[1], variables[2])+gt_func(variables[6], variables[18]) - variables[68] = variables[1] - variables[69] = variables[1]-variables[2] - variables[70] = lt_func(variables[1], variables[2])-gt_func(variables[6], variables[18]) - variables[71] = lt_func(variables[1], variables[2])-(variables[6]+variables[18]) - variables[72] = lt_func(variables[1], variables[2])-variables[6] - variables[73] = variables[1]-(-variables[2]) - variables[74] = variables[1]-(-variables[2]*variables[6]) - variables[75] = -variables[1] - variables[76] = -lt_func(variables[1], variables[2]) - variables[77] = variables[1]*variables[2] - variables[78] = variables[1]*variables[2]*variables[6] - variables[79] = lt_func(variables[1], variables[2])*gt_func(variables[6], variables[18]) - variables[80] = (variables[1]+variables[2])*gt_func(variables[6], variables[18]) - variables[81] = variables[1]*gt_func(variables[2], variables[6]) - variables[82] = (variables[1]-variables[2])*gt_func(variables[6], variables[18]) - variables[83] = -variables[1]*gt_func(variables[2], variables[6]) - variables[84] = lt_func(variables[1], variables[2])*(variables[6]+variables[18]) - variables[85] = lt_func(variables[1], variables[2])*variables[6] - variables[86] = lt_func(variables[1], variables[2])*(variables[6]-variables[18]) - variables[87] = lt_func(variables[1], variables[2])*-variables[6] - variables[88] = variables[1]/variables[2] - variables[89] = lt_func(variables[1], variables[2])/gt_func(variables[18], variables[6]) - variables[90] = (variables[1]+variables[2])/gt_func(variables[18], variables[6]) - variables[91] = variables[1]/gt_func(variables[6], variables[2]) - variables[92] = (variables[1]-variables[2])/gt_func(variables[18], variables[6]) - variables[93] = -variables[1]/gt_func(variables[6], variables[2]) - variables[94] = lt_func(variables[1], variables[2])/(variables[6]+variables[18]) - variables[95] = lt_func(variables[1], variables[2])/variables[6] - variables[96] = lt_func(variables[1], variables[2])/(variables[6]-variables[18]) - variables[97] = lt_func(variables[1], variables[2])/-variables[6] - variables[98] = lt_func(variables[1], variables[2])/(variables[6]*variables[18]) - variables[99] = lt_func(variables[1], variables[2])/(variables[6]/variables[18]) - variables[100] = sqrt(variables[1]) - variables[101] = pow(variables[1], 2.0) - variables[102] = pow(variables[1], 3.0) - variables[103] = pow(variables[1], variables[2]) - variables[104] = pow(leq_func(variables[1], variables[2]), geq_func(variables[6], variables[18])) - variables[105] = pow(variables[1]+variables[2], geq_func(variables[6], variables[18])) - variables[106] = pow(variables[1], geq_func(variables[2], variables[6])) - variables[107] = pow(variables[1]-variables[2], geq_func(variables[6], variables[18])) - variables[108] = pow(-variables[1], geq_func(variables[2], variables[6])) - variables[109] = pow(variables[1]*variables[2], geq_func(variables[6], variables[18])) - variables[110] = pow(variables[1]/variables[2], geq_func(variables[6], variables[18])) - variables[111] = pow(leq_func(variables[1], variables[2]), variables[6]+variables[18]) - variables[112] = pow(leq_func(variables[1], variables[2]), variables[6]) - variables[113] = pow(leq_func(variables[1], variables[2]), variables[6]-variables[18]) - variables[114] = pow(leq_func(variables[1], variables[2]), -variables[6]) - variables[115] = pow(leq_func(variables[1], variables[2]), variables[6]*variables[18]) - variables[116] = pow(leq_func(variables[1], variables[2]), variables[6]/variables[18]) - variables[117] = pow(leq_func(variables[1], variables[2]), pow(variables[6], variables[18])) - variables[118] = pow(leq_func(variables[1], variables[2]), pow(variables[6], 1.0/variables[18])) - variables[119] = sqrt(variables[1]) - variables[120] = sqrt(variables[1]) - variables[121] = pow(variables[1], 1.0/3.0) - variables[122] = pow(variables[1], 1.0/variables[2]) - variables[123] = pow(lt_func(variables[1], variables[2]), 1.0/gt_func(variables[18], variables[6])) - variables[124] = pow(variables[1]+variables[2], 1.0/gt_func(variables[18], variables[6])) - variables[125] = pow(variables[1], 1.0/gt_func(variables[6], variables[2])) - variables[126] = pow(variables[1]-variables[2], 1.0/gt_func(variables[18], variables[6])) - variables[127] = pow(-variables[1], 1.0/gt_func(variables[6], variables[2])) - variables[128] = pow(variables[1]*variables[2], 1.0/gt_func(variables[18], variables[6])) - variables[129] = pow(variables[1]/variables[2], 1.0/gt_func(variables[18], variables[6])) - variables[130] = pow(lt_func(variables[1], variables[2]), 1.0/(variables[6]+variables[18])) - variables[131] = pow(lt_func(variables[1], variables[2]), 1.0/variables[6]) - variables[132] = pow(lt_func(variables[1], variables[2]), 1.0/(variables[6]-variables[18])) - variables[133] = pow(lt_func(variables[1], variables[2]), 1.0/-variables[6]) - variables[134] = pow(lt_func(variables[1], variables[2]), 1.0/(variables[6]*variables[18])) - variables[135] = pow(lt_func(variables[1], variables[2]), 1.0/(variables[6]/variables[18])) - variables[136] = pow(lt_func(variables[1], variables[2]), 1.0/pow(variables[6], variables[18])) - variables[137] = pow(lt_func(variables[1], variables[2]), 1.0/pow(variables[6], 1.0/variables[18])) - variables[138] = fabs(variables[1]) - variables[139] = exp(variables[1]) - variables[140] = log(variables[1]) - variables[141] = log10(variables[1]) - variables[142] = log(variables[1])/log(2.0) - variables[143] = log10(variables[1]) - variables[144] = log(variables[1])/log(variables[2]) - variables[145] = ceil(variables[1]) - variables[146] = floor(variables[1]) - variables[147] = min(variables[1], variables[2]) - variables[148] = min(variables[1], min(variables[2], variables[6])) - variables[149] = max(variables[1], variables[2]) - variables[150] = max(variables[1], max(variables[2], variables[6])) - variables[151] = fmod(variables[1], variables[2]) - variables[152] = sin(variables[1]) - variables[153] = cos(variables[1]) - variables[154] = tan(variables[1]) - variables[155] = sec(variables[1]) - variables[156] = csc(variables[1]) - variables[157] = cot(variables[1]) - variables[158] = sinh(variables[1]) - variables[159] = cosh(variables[1]) - variables[160] = tanh(variables[1]) - variables[161] = sech(variables[1]) - variables[162] = csch(variables[1]) - variables[163] = coth(variables[1]) - variables[164] = asin(variables[1]) - variables[165] = acos(variables[1]) - variables[166] = atan(variables[1]) - variables[167] = asec(variables[1]) - variables[168] = acsc(variables[1]) - variables[169] = acot(variables[1]) - variables[170] = asinh(variables[1]) - variables[171] = acosh(variables[1]) - variables[172] = atanh(variables[1]/2.0) - variables[173] = asech(variables[1]) - variables[174] = acsch(variables[1]) - variables[175] = acoth(2.0*variables[1]) - variables[176] = variables[1] if gt_func(variables[1], variables[2]) else nan - variables[177] = variables[1] if gt_func(variables[1], variables[2]) else variables[6] - variables[178] = variables[1] if gt_func(variables[1], variables[2]) else variables[6] if gt_func(variables[6], variables[18]) else variables[179] if gt_func(variables[179], variables[180]) else nan - variables[181] = variables[1] if gt_func(variables[1], variables[2]) else variables[6] if gt_func(variables[6], variables[18]) else variables[179] if gt_func(variables[179], variables[180]) else variables[182] - variables[183] = 123.0+(variables[1] if gt_func(variables[1], variables[2]) else nan) - variables[188] = variables[1] - variables[195] = and_func(variables[1], variables[2])+(variables[2] if gt_func(variables[6], variables[18]) else nan)+variables[179]+and_func(variables[180], variables[182]) - variables[196] = and_func(variables[1], variables[2])-((variables[2] if gt_func(variables[6], variables[18]) else nan)-(variables[179]-(variables[2] if gt_func(variables[6], variables[18]) else nan)))-and_func(variables[180], variables[182]) - variables[197] = and_func(variables[1], variables[2])*(variables[2] if gt_func(variables[6], variables[18]) else nan)*variables[179]*(variables[2] if gt_func(variables[6], variables[18]) else nan)*and_func(variables[180], variables[182]) - variables[198] = and_func(variables[1], variables[2])/((variables[2] if gt_func(variables[6], variables[18]) else nan)/(variables[179]/(variables[2] if gt_func(variables[6], variables[18]) else nan))) - variables[199] = and_func(or_func(variables[1], variables[2]), and_func(xor_func(variables[1], variables[2]), and_func(variables[2] if gt_func(variables[6], variables[18]) else nan, and_func(and_func(and_func(variables[179], variables[2] if gt_func(variables[6], variables[18]) else nan), xor_func(variables[1], variables[2])), or_func(variables[1], variables[2]))))) - variables[200] = or_func(and_func(variables[1], variables[2]), or_func(xor_func(variables[1], variables[2]), or_func(variables[2] if gt_func(variables[6], variables[18]) else nan, or_func(or_func(or_func(variables[179], variables[2] if gt_func(variables[6], variables[18]) else nan), xor_func(variables[1], variables[2])), and_func(variables[1], variables[2]))))) - variables[201] = xor_func(and_func(variables[1], variables[2]), xor_func(or_func(variables[1], variables[2]), xor_func(variables[2] if gt_func(variables[6], variables[18]) else nan, xor_func(xor_func(xor_func(variables[179], variables[2] if gt_func(variables[6], variables[18]) else nan), or_func(variables[1], variables[2])), and_func(variables[1], variables[2]))))) - variables[202] = pow(and_func(variables[1], variables[2]), pow(variables[2] if gt_func(variables[6], variables[18]) else nan, pow(pow(variables[179], variables[2] if gt_func(variables[6], variables[18]) else nan), and_func(variables[1], variables[2])))) - variables[203] = pow(pow(pow(and_func(variables[1], variables[2]), 1.0/pow(variables[2] if gt_func(variables[6], variables[18]) else nan, 1.0/variables[179])), 1.0/(variables[2] if gt_func(variables[6], variables[18]) else nan)), 1.0/and_func(variables[1], variables[2])) - variables[204] = -and_func(variables[1], variables[2])+-(variables[2] if gt_func(variables[6], variables[18]) else nan) + 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) def compute_rates(voi, states, rates, constants, computed_constants, algebraic): diff --git a/tests/resources/generator/algebraic_eqn_computed_var_on_rhs/model.c b/tests/resources/generator/algebraic_eqn_computed_var_on_rhs/model.c index 42f15c79b8..8eee3cf3ad 100644 --- a/tests/resources/generator/algebraic_eqn_computed_var_on_rhs/model.c +++ b/tests/resources/generator/algebraic_eqn_computed_var_on_rhs/model.c @@ -35,12 +35,12 @@ void deleteArray(double *array) void initialiseVariables(double *constants) { - variables[1] = 1.0; + computedConstants[1] = 1.0; } void computeComputedConstants(double *constants, double *computedConstants) { - variables[0] = variables[1]; + computedConstants[0] = computedConstants[1]; } void computeVariables(double *constants, double *computedConstants, double *algebraic) diff --git a/tests/resources/generator/algebraic_eqn_computed_var_on_rhs/model.external.c b/tests/resources/generator/algebraic_eqn_computed_var_on_rhs/model.external.c index 8cbf6bf057..e3f909a3fd 100644 --- a/tests/resources/generator/algebraic_eqn_computed_var_on_rhs/model.external.c +++ b/tests/resources/generator/algebraic_eqn_computed_var_on_rhs/model.external.c @@ -35,7 +35,7 @@ void deleteArray(double *array) void initialiseVariables(double *constants, ExternalVariable externalVariable) { - variables[1] = externalVariable(variables, 1); + algebraic[1] = externalVariable(variables, 1); } void computeComputedConstants(double *constants, double *computedConstants) @@ -44,6 +44,6 @@ void computeComputedConstants(double *constants, double *computedConstants) void computeVariables(double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { - variables[1] = externalVariable(variables, 1); - variables[0] = variables[1]; + algebraic[1] = externalVariable(variables, 1); + algebraic[0] = algebraic[1]; } diff --git a/tests/resources/generator/algebraic_eqn_computed_var_on_rhs/model.external.py b/tests/resources/generator/algebraic_eqn_computed_var_on_rhs/model.external.py index 2670115d48..830a7dbcc4 100644 --- a/tests/resources/generator/algebraic_eqn_computed_var_on_rhs/model.external.py +++ b/tests/resources/generator/algebraic_eqn_computed_var_on_rhs/model.external.py @@ -30,7 +30,7 @@ def create_variables_array(): def initialise_variables(constants, external_variable): - variables[1] = external_variable(variables, 1) + algebraic[1] = external_variable(variables, 1) def compute_computed_constants(constants, computed_constants): @@ -38,5 +38,5 @@ def compute_computed_constants(constants, computed_constants): def compute_variables(constants, computed_constants, algebraic, external_variable): - variables[1] = external_variable(variables, 1) - variables[0] = variables[1] + algebraic[1] = external_variable(variables, 1) + algebraic[0] = algebraic[1] diff --git a/tests/resources/generator/algebraic_eqn_computed_var_on_rhs/model.py b/tests/resources/generator/algebraic_eqn_computed_var_on_rhs/model.py index 24d09dbb1c..abbf71111a 100644 --- a/tests/resources/generator/algebraic_eqn_computed_var_on_rhs/model.py +++ b/tests/resources/generator/algebraic_eqn_computed_var_on_rhs/model.py @@ -29,11 +29,11 @@ def create_variables_array(): def initialise_variables(constants): - variables[1] = 1.0 + computed_constants[1] = 1.0 def compute_computed_constants(constants, computed_constants): - variables[0] = variables[1] + computed_constants[0] = computed_constants[1] def compute_variables(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 dc50dc17e1..6624303897 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) { - variables[1] = 1.0; + constants[1] = 1.0; } void computeComputedConstants(double *constants, double *computedConstants) { - variables[0] = variables[1]; + computedConstants[0] = constants[1]; } 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 305a6e7fd5..9b07f95029 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): - variables[1] = 1.0 + constants[1] = 1.0 def compute_computed_constants(constants, computed_constants): - variables[0] = variables[1] + computed_constants[0] = constants[1] def compute_variables(constants, computed_constants, algebraic): diff --git a/tests/resources/generator/algebraic_eqn_constant_on_rhs/model.c b/tests/resources/generator/algebraic_eqn_constant_on_rhs/model.c index 5e1791ae73..89a7cc42a4 100644 --- a/tests/resources/generator/algebraic_eqn_constant_on_rhs/model.c +++ b/tests/resources/generator/algebraic_eqn_constant_on_rhs/model.c @@ -34,7 +34,7 @@ void deleteArray(double *array) void initialiseVariables(double *constants) { - variables[0] = 1.0; + computedConstants[0] = 1.0; } void computeComputedConstants(double *constants, double *computedConstants) diff --git a/tests/resources/generator/algebraic_eqn_constant_on_rhs/model.py b/tests/resources/generator/algebraic_eqn_constant_on_rhs/model.py index 461c246474..bbee078792 100644 --- a/tests/resources/generator/algebraic_eqn_constant_on_rhs/model.py +++ b/tests/resources/generator/algebraic_eqn_constant_on_rhs/model.py @@ -28,7 +28,7 @@ def create_variables_array(): def initialise_variables(constants): - variables[0] = 1.0 + computed_constants[0] = 1.0 def compute_computed_constants(constants, computed_constants): 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 c37ec41540..c08dde32e6 100644 --- a/tests/resources/generator/algebraic_eqn_derivative_on_rhs/model.c +++ b/tests/resources/generator/algebraic_eqn_derivative_on_rhs/model.c @@ -53,7 +53,7 @@ void deleteArray(double *array) void initialiseVariables(double *states, double *rates, double *constants) { - variables[0] = 1.0; + computedConstants[0] = 1.0; states[0] = 1.0; } @@ -63,10 +63,10 @@ void computeComputedConstants(double *constants, double *computedConstants) void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic) { - rates[0] = variables[0]; + rates[0] = computedConstants[0]; } void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic) { - variables[1] = rates[0]; + algebraic[1] = 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 dcdeee9d72..5e2901ca36 100644 --- a/tests/resources/generator/algebraic_eqn_derivative_on_rhs/model.py +++ b/tests/resources/generator/algebraic_eqn_derivative_on_rhs/model.py @@ -42,7 +42,7 @@ def create_variables_array(): def initialise_variables(states, rates, constants): - variables[0] = 1.0 + computed_constants[0] = 1.0 states[0] = 1.0 @@ -51,8 +51,8 @@ def compute_computed_constants(constants, computed_constants): def compute_rates(voi, states, rates, constants, computed_constants, algebraic): - rates[0] = variables[0] + rates[0] = computed_constants[0] def compute_variables(voi, states, rates, constants, computed_constants, algebraic): - variables[1] = rates[0] + algebraic[1] = 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 360d5cdaf2..5d3967ab00 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 @@ -53,7 +53,7 @@ void deleteArray(double *array) void initialiseVariables(double *states, double *rates, double *constants) { - variables[0] = 1.0; + computedConstants[0] = 1.0; states[0] = 1.0; } @@ -63,10 +63,10 @@ void computeComputedConstants(double *constants, double *computedConstants) void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic) { - rates[0] = variables[0]; + rates[0] = computedConstants[0]; } void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic) { - variables[1] = rates[0]; + algebraic[1] = 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 b6ba332de9..3390600530 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 @@ -42,7 +42,7 @@ def create_variables_array(): def initialise_variables(states, rates, constants): - variables[0] = 1.0 + computed_constants[0] = 1.0 states[0] = 1.0 @@ -51,8 +51,8 @@ def compute_computed_constants(constants, computed_constants): def compute_rates(voi, states, rates, constants, computed_constants, algebraic): - rates[0] = variables[0] + rates[0] = computed_constants[0] def compute_variables(voi, states, rates, constants, computed_constants, algebraic): - variables[1] = rates[0] + algebraic[1] = 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 3ad5d87628..cd735eda2b 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 @@ -53,7 +53,7 @@ void deleteArray(double *array) void initialiseVariables(double *states, double *rates, double *constants) { - variables[0] = 1.0; + computedConstants[0] = 1.0; states[0] = 1.0; } @@ -63,10 +63,10 @@ void computeComputedConstants(double *constants, double *computedConstants) void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic) { - rates[0] = variables[0]; + rates[0] = computedConstants[0]; } void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic) { - variables[1] = 2.0*states[0]; + algebraic[1] = 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 b8d4bcc52e..bca3f1f415 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 @@ -42,7 +42,7 @@ def create_variables_array(): def initialise_variables(states, rates, constants): - variables[0] = 1.0 + computed_constants[0] = 1.0 states[0] = 1.0 @@ -51,8 +51,8 @@ def compute_computed_constants(constants, computed_constants): def compute_rates(voi, states, rates, constants, computed_constants, algebraic): - rates[0] = variables[0] + rates[0] = computed_constants[0] def compute_variables(voi, states, rates, constants, computed_constants, algebraic): - variables[1] = 2.0*states[0] + algebraic[1] = 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 18593d1313..8836720f31 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 @@ -53,7 +53,7 @@ void deleteArray(double *array) void initialiseVariables(double *states, double *rates, double *constants) { - variables[0] = 1.0; + computedConstants[0] = 1.0; states[0] = 1.0; } @@ -63,10 +63,10 @@ void computeComputedConstants(double *constants, double *computedConstants) void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic) { - rates[0] = variables[0]; + rates[0] = computedConstants[0]; } void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic) { - variables[1] = 2.0*states[0]; + algebraic[1] = 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 6bbd5c64cb..409f890e5e 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 @@ -42,7 +42,7 @@ def create_variables_array(): def initialise_variables(states, rates, constants): - variables[0] = 1.0 + computed_constants[0] = 1.0 states[0] = 1.0 @@ -51,8 +51,8 @@ def compute_computed_constants(constants, computed_constants): def compute_rates(voi, states, rates, constants, computed_constants, algebraic): - rates[0] = variables[0] + rates[0] = computed_constants[0] def compute_variables(voi, states, rates, constants, computed_constants, algebraic): - variables[1] = 2.0*states[0] + algebraic[1] = 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 f8f2240c0a..8466d70b10 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; - variables[3] = u[0]; + algebraic[3] = u[0]; - f[0] = variables[3]+variables[0]-(variables[1]+variables[2]); + f[0] = algebraic[3]+computedConstants[0]-(computedConstants[1]+computedConstants[2]); } void findRoot0(double *variables) @@ -56,19 +56,19 @@ void findRoot0(double *variables) RootFindingInfo rfi = { variables }; double u[1]; - u[0] = variables[3]; + u[0] = algebraic[3]; nlaSolve(objectiveFunction0, u, 1, &rfi); - variables[3] = u[0]; + algebraic[3] = u[0]; } void initialiseVariables(double *constants) { - variables[3] = 1.0; - variables[0] = 3.0; - variables[1] = 5.0; - variables[2] = 7.0; + algebraic[3] = 1.0; + computedConstants[0] = 3.0; + computedConstants[1] = 5.0; + computedConstants[2] = 7.0; } void computeComputedConstants(double *constants, double *computedConstants) 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 3117d0d815..57c92c1e13 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 @@ -37,10 +37,10 @@ void deleteArray(double *array) void initialiseVariables(double *constants, ExternalVariable externalVariable) { - variables[0] = 3.0; - variables[1] = 5.0; - variables[2] = 7.0; - variables[3] = externalVariable(variables, 3); + computedConstants[0] = 3.0; + computedConstants[1] = 5.0; + computedConstants[2] = 7.0; + algebraic[3] = externalVariable(variables, 3); } 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) { - variables[3] = externalVariable(variables, 3); + algebraic[3] = externalVariable(variables, 3); } 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 a2b79b941c..de574c9043 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 @@ -32,10 +32,10 @@ def create_variables_array(): def initialise_variables(constants, external_variable): - variables[0] = 3.0 - variables[1] = 5.0 - variables[2] = 7.0 - variables[3] = external_variable(variables, 3) + computed_constants[0] = 3.0 + computed_constants[1] = 5.0 + computed_constants[2] = 7.0 + algebraic[3] = external_variable(variables, 3) 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): - variables[3] = external_variable(variables, 3) + algebraic[3] = external_variable(variables, 3) 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 f85863b933..646d98b2af 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,26 +36,26 @@ def create_variables_array(): def objective_function_0(u, f, data): variables = data[0] - variables[3] = u[0] + algebraic[3] = u[0] - f[0] = variables[3]+variables[0]-(variables[1]+variables[2]) + f[0] = algebraic[3]+computed_constants[0]-(computed_constants[1]+computed_constants[2]) def find_root_0(variables): u = [nan]*1 - u[0] = variables[3] + u[0] = algebraic[3] u = nla_solve(objective_function_0, u, 1, [variables]) - variables[3] = u[0] + algebraic[3] = u[0] def initialise_variables(constants): - variables[3] = 1.0 - variables[0] = 3.0 - variables[1] = 5.0 - variables[2] = 7.0 + algebraic[3] = 1.0 + computed_constants[0] = 3.0 + computed_constants[1] = 5.0 + computed_constants[2] = 7.0 def compute_computed_constants(constants, computed_constants): diff --git a/tests/resources/generator/algebraic_system_with_three_linked_unknowns/model.c b/tests/resources/generator/algebraic_system_with_three_linked_unknowns/model.c index 535e4e8e68..eb6d409ade 100644 --- a/tests/resources/generator/algebraic_system_with_three_linked_unknowns/model.c +++ b/tests/resources/generator/algebraic_system_with_three_linked_unknowns/model.c @@ -45,13 +45,13 @@ void objectiveFunction0(double *u, double *f, void *data) { double *variables = ((RootFindingInfo *) data)->variables; - variables[0] = u[0]; - variables[1] = u[1]; - variables[2] = u[2]; + algebraic[0] = u[0]; + algebraic[1] = u[1]; + algebraic[2] = u[2]; - f[0] = 2.0*variables[0]+variables[1]-2.0*variables[2]-(-1.0); - f[1] = 3.0*variables[0]-3.0*variables[1]-variables[2]-5.0; - f[2] = variables[0]-2.0*variables[1]+3.0*variables[2]-6.0; + f[0] = 2.0*algebraic[0]+algebraic[1]-2.0*algebraic[2]-(-1.0); + f[1] = 3.0*algebraic[0]-3.0*algebraic[1]-algebraic[2]-5.0; + f[2] = algebraic[0]-2.0*algebraic[1]+3.0*algebraic[2]-6.0; } void findRoot0(double *variables) @@ -59,22 +59,22 @@ void findRoot0(double *variables) RootFindingInfo rfi = { variables }; double u[3]; - u[0] = variables[0]; - u[1] = variables[1]; - u[2] = variables[2]; + u[0] = algebraic[0]; + u[1] = algebraic[1]; + u[2] = algebraic[2]; nlaSolve(objectiveFunction0, u, 3, &rfi); - variables[0] = u[0]; - variables[1] = u[1]; - variables[2] = u[2]; + algebraic[0] = u[0]; + algebraic[1] = u[1]; + algebraic[2] = u[2]; } void initialiseVariables(double *constants) { - variables[0] = 1.0; - variables[1] = 1.0; - variables[2] = 1.0; + algebraic[0] = 1.0; + algebraic[1] = 1.0; + algebraic[2] = 1.0; } void computeComputedConstants(double *constants, double *computedConstants) diff --git a/tests/resources/generator/algebraic_system_with_three_linked_unknowns/model.py b/tests/resources/generator/algebraic_system_with_three_linked_unknowns/model.py index cd3f4d26a8..de50e042ec 100644 --- a/tests/resources/generator/algebraic_system_with_three_linked_unknowns/model.py +++ b/tests/resources/generator/algebraic_system_with_three_linked_unknowns/model.py @@ -35,33 +35,33 @@ def create_variables_array(): def objective_function_0(u, f, data): variables = data[0] - variables[0] = u[0] - variables[1] = u[1] - variables[2] = u[2] + algebraic[0] = u[0] + algebraic[1] = u[1] + algebraic[2] = u[2] - f[0] = 2.0*variables[0]+variables[1]-2.0*variables[2]-(-1.0) - f[1] = 3.0*variables[0]-3.0*variables[1]-variables[2]-5.0 - f[2] = variables[0]-2.0*variables[1]+3.0*variables[2]-6.0 + f[0] = 2.0*algebraic[0]+algebraic[1]-2.0*algebraic[2]-(-1.0) + f[1] = 3.0*algebraic[0]-3.0*algebraic[1]-algebraic[2]-5.0 + f[2] = algebraic[0]-2.0*algebraic[1]+3.0*algebraic[2]-6.0 def find_root_0(variables): u = [nan]*3 - u[0] = variables[0] - u[1] = variables[1] - u[2] = variables[2] + u[0] = algebraic[0] + u[1] = algebraic[1] + u[2] = algebraic[2] u = nla_solve(objective_function_0, u, 3, [variables]) - variables[0] = u[0] - variables[1] = u[1] - variables[2] = u[2] + algebraic[0] = u[0] + algebraic[1] = u[1] + algebraic[2] = u[2] def initialise_variables(constants): - variables[0] = 1.0 - variables[1] = 1.0 - variables[2] = 1.0 + algebraic[0] = 1.0 + algebraic[1] = 1.0 + algebraic[2] = 1.0 def compute_computed_constants(constants, computed_constants): diff --git a/tests/resources/generator/algebraic_system_with_three_linked_unknowns/model.three.externals.c b/tests/resources/generator/algebraic_system_with_three_linked_unknowns/model.three.externals.c index 4f5a987093..db8bace3dd 100644 --- a/tests/resources/generator/algebraic_system_with_three_linked_unknowns/model.three.externals.c +++ b/tests/resources/generator/algebraic_system_with_three_linked_unknowns/model.three.externals.c @@ -36,9 +36,9 @@ void deleteArray(double *array) void initialiseVariables(double *constants, ExternalVariable externalVariable) { - variables[0] = externalVariable(variables, 0); - variables[1] = externalVariable(variables, 1); - variables[2] = externalVariable(variables, 2); + algebraic[0] = externalVariable(variables, 0); + algebraic[1] = externalVariable(variables, 1); + algebraic[2] = externalVariable(variables, 2); } void computeComputedConstants(double *constants, double *computedConstants) @@ -47,7 +47,7 @@ void computeComputedConstants(double *constants, double *computedConstants) void computeVariables(double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { - variables[0] = externalVariable(variables, 0); - variables[1] = externalVariable(variables, 1); - variables[2] = externalVariable(variables, 2); + algebraic[0] = externalVariable(variables, 0); + algebraic[1] = externalVariable(variables, 1); + algebraic[2] = externalVariable(variables, 2); } diff --git a/tests/resources/generator/algebraic_system_with_three_linked_unknowns/model.three.externals.py b/tests/resources/generator/algebraic_system_with_three_linked_unknowns/model.three.externals.py index 83aafcbbc1..0e99da2824 100644 --- a/tests/resources/generator/algebraic_system_with_three_linked_unknowns/model.three.externals.py +++ b/tests/resources/generator/algebraic_system_with_three_linked_unknowns/model.three.externals.py @@ -31,9 +31,9 @@ def create_variables_array(): def initialise_variables(constants, external_variable): - variables[0] = external_variable(variables, 0) - variables[1] = external_variable(variables, 1) - variables[2] = external_variable(variables, 2) + algebraic[0] = external_variable(variables, 0) + algebraic[1] = external_variable(variables, 1) + algebraic[2] = external_variable(variables, 2) def compute_computed_constants(constants, computed_constants): @@ -41,6 +41,6 @@ def compute_computed_constants(constants, computed_constants): def compute_variables(constants, computed_constants, algebraic, external_variable): - variables[0] = external_variable(variables, 0) - variables[1] = external_variable(variables, 1) - variables[2] = external_variable(variables, 2) + algebraic[0] = external_variable(variables, 0) + algebraic[1] = external_variable(variables, 1) + algebraic[2] = external_variable(variables, 2) 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 462c28f737..209f9dc7b5 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 @@ -48,11 +48,11 @@ void objectiveFunction0(double *u, double *f, void *data) { double *variables = ((RootFindingInfo *) data)->variables; - variables[2] = u[0]; - variables[1] = u[1]; + algebraic[2] = u[0]; + algebraic[1] = u[1]; - f[0] = 3.0*variables[3]+2.0*variables[1]+variables[2]-57.0; - f[1] = variables[3]+3.0*variables[1]-variables[2]-19.0; + 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; } void findRoot0(double *variables) @@ -60,30 +60,30 @@ void findRoot0(double *variables) RootFindingInfo rfi = { variables }; double u[2]; - u[0] = variables[2]; - u[1] = variables[1]; + u[0] = algebraic[2]; + u[1] = algebraic[1]; nlaSolve(objectiveFunction0, u, 2, &rfi); - variables[2] = u[0]; - variables[1] = u[1]; + algebraic[2] = u[0]; + algebraic[1] = u[1]; } void initialiseVariables(double *constants) { - variables[1] = 1.0; - variables[2] = 1.0; - variables[4] = 3.0; - variables[5] = 5.0; + algebraic[1] = 1.0; + algebraic[2] = 1.0; + constants[4] = 3.0; + constants[5] = 5.0; } void computeComputedConstants(double *constants, double *computedConstants) { - variables[3] = 3.0*variables[4]+variables[5]; + computedConstants[3] = 3.0*constants[4]+constants[5]; } void computeVariables(double *constants, double *computedConstants, double *algebraic) { findRoot0(variables); - variables[0] = variables[1]+variables[2]; + algebraic[0] = algebraic[1]+algebraic[2]; } 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 723234a885..2c1c63ab8c 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 @@ -38,36 +38,36 @@ def create_variables_array(): def objective_function_0(u, f, data): variables = data[0] - variables[2] = u[0] - variables[1] = u[1] + algebraic[2] = u[0] + algebraic[1] = u[1] - f[0] = 3.0*variables[3]+2.0*variables[1]+variables[2]-57.0 - f[1] = variables[3]+3.0*variables[1]-variables[2]-19.0 + 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 def find_root_0(variables): u = [nan]*2 - u[0] = variables[2] - u[1] = variables[1] + u[0] = algebraic[2] + u[1] = algebraic[1] u = nla_solve(objective_function_0, u, 2, [variables]) - variables[2] = u[0] - variables[1] = u[1] + algebraic[2] = u[0] + algebraic[1] = u[1] def initialise_variables(constants): - variables[1] = 1.0 - variables[2] = 1.0 - variables[4] = 3.0 - variables[5] = 5.0 + algebraic[1] = 1.0 + algebraic[2] = 1.0 + constants[4] = 3.0 + constants[5] = 5.0 def compute_computed_constants(constants, computed_constants): - variables[3] = 3.0*variables[4]+variables[5] + computed_constants[3] = 3.0*constants[4]+constants[5] def compute_variables(constants, computed_constants, algebraic): find_root_0(variables) - variables[0] = variables[1]+variables[2] + algebraic[0] = algebraic[1]+algebraic[2] 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 e8af03001a..2802b5299a 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; - variables[3] = u[0]; - variables[4] = u[1]; + algebraic[3] = u[0]; + algebraic[4] = u[1]; - f[0] = 3.0*variables[0]+2.0*variables[4]+variables[3]-57.0; - f[1] = variables[0]+3.0*variables[4]-variables[3]-19.0; + 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; } void findRoot0(double *variables) @@ -60,30 +60,30 @@ void findRoot0(double *variables) RootFindingInfo rfi = { variables }; double u[2]; - u[0] = variables[3]; - u[1] = variables[4]; + u[0] = algebraic[3]; + u[1] = algebraic[4]; nlaSolve(objectiveFunction0, u, 2, &rfi); - variables[3] = u[0]; - variables[4] = u[1]; + algebraic[3] = u[0]; + algebraic[4] = u[1]; } void initialiseVariables(double *constants) { - variables[1] = 3.0; - variables[2] = 5.0; - variables[3] = 1.0; - variables[4] = 1.0; + constants[1] = 3.0; + constants[2] = 5.0; + algebraic[3] = 1.0; + algebraic[4] = 1.0; } void computeComputedConstants(double *constants, double *computedConstants) { - variables[0] = 3.0*variables[1]+variables[2]; + computedConstants[0] = 3.0*constants[1]+constants[2]; } void computeVariables(double *constants, double *computedConstants, double *algebraic) { findRoot0(variables); - variables[5] = variables[4]+variables[3]; + algebraic[5] = algebraic[4]+algebraic[3]; } 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 20c8f31559..d6259b2b98 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] - variables[3] = u[0] - variables[4] = u[1] + algebraic[3] = u[0] + algebraic[4] = u[1] - f[0] = 3.0*variables[0]+2.0*variables[4]+variables[3]-57.0 - f[1] = variables[0]+3.0*variables[4]-variables[3]-19.0 + 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 def find_root_0(variables): u = [nan]*2 - u[0] = variables[3] - u[1] = variables[4] + u[0] = algebraic[3] + u[1] = algebraic[4] u = nla_solve(objective_function_0, u, 2, [variables]) - variables[3] = u[0] - variables[4] = u[1] + algebraic[3] = u[0] + algebraic[4] = u[1] def initialise_variables(constants): - variables[1] = 3.0 - variables[2] = 5.0 - variables[3] = 1.0 - variables[4] = 1.0 + constants[1] = 3.0 + constants[2] = 5.0 + algebraic[3] = 1.0 + algebraic[4] = 1.0 def compute_computed_constants(constants, computed_constants): - variables[0] = 3.0*variables[1]+variables[2] + computed_constants[0] = 3.0*constants[1]+constants[2] def compute_variables(constants, computed_constants, algebraic): find_root_0(variables) - variables[5] = variables[4]+variables[3] + algebraic[5] = algebraic[4]+algebraic[3] diff --git a/tests/resources/generator/algebraic_unknown_var_on_rhs/model.c b/tests/resources/generator/algebraic_unknown_var_on_rhs/model.c index 5224ee2147..16b90c3882 100644 --- a/tests/resources/generator/algebraic_unknown_var_on_rhs/model.c +++ b/tests/resources/generator/algebraic_unknown_var_on_rhs/model.c @@ -35,12 +35,12 @@ void deleteArray(double *array) void initialiseVariables(double *constants) { - variables[0] = 1.0; + computedConstants[0] = 1.0; } void computeComputedConstants(double *constants, double *computedConstants) { - variables[1] = variables[0]; + computedConstants[1] = computedConstants[0]; } void computeVariables(double *constants, double *computedConstants, double *algebraic) diff --git a/tests/resources/generator/algebraic_unknown_var_on_rhs/model.py b/tests/resources/generator/algebraic_unknown_var_on_rhs/model.py index c4bec2a5c4..3edee3eadc 100644 --- a/tests/resources/generator/algebraic_unknown_var_on_rhs/model.py +++ b/tests/resources/generator/algebraic_unknown_var_on_rhs/model.py @@ -29,11 +29,11 @@ def create_variables_array(): def initialise_variables(constants): - variables[0] = 1.0 + computed_constants[0] = 1.0 def compute_computed_constants(constants, computed_constants): - variables[1] = variables[0] + computed_constants[1] = computed_constants[0] def compute_variables(constants, computed_constants, algebraic): diff --git a/tests/resources/generator/cell_geometry_model/model.c b/tests/resources/generator/cell_geometry_model/model.c index 8087a0ebc1..91884cff90 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) { - variables[1] = 0.01; - variables[2] = 0.0011; + constants[1] = 0.01; + constants[2] = 0.0011; } void computeComputedConstants(double *constants, double *computedConstants) { - variables[0] = 1000.0*3.14*variables[2]*variables[2]*variables[1]; - variables[3] = 0.02*variables[0]; + computedConstants[0] = 1000.0*3.14*constants[2]*constants[2]*constants[1]; + computedConstants[3] = 0.02*computedConstants[0]; } void computeVariables(double *constants, double *computedConstants, double *algebraic) diff --git a/tests/resources/generator/cell_geometry_model/model.external.c b/tests/resources/generator/cell_geometry_model/model.external.c index c9c0f76f82..ed88fb63df 100644 --- a/tests/resources/generator/cell_geometry_model/model.external.c +++ b/tests/resources/generator/cell_geometry_model/model.external.c @@ -37,8 +37,8 @@ void deleteArray(double *array) void initialiseVariables(double *constants, ExternalVariable externalVariable) { - variables[1] = externalVariable(variables, 1); - variables[2] = externalVariable(variables, 2); + algebraic[1] = externalVariable(variables, 1); + algebraic[2] = externalVariable(variables, 2); } void computeComputedConstants(double *constants, double *computedConstants) @@ -47,8 +47,8 @@ void computeComputedConstants(double *constants, double *computedConstants) void computeVariables(double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { - variables[1] = externalVariable(variables, 1); - variables[2] = externalVariable(variables, 2); - variables[0] = 1000.0*3.14*variables[2]*variables[2]*variables[1]; - variables[3] = 0.02*variables[0]; + algebraic[1] = externalVariable(variables, 1); + algebraic[2] = externalVariable(variables, 2); + algebraic[0] = 1000.0*3.14*algebraic[2]*algebraic[2]*algebraic[1]; + algebraic[3] = 0.02*algebraic[0]; } diff --git a/tests/resources/generator/cell_geometry_model/model.external.py b/tests/resources/generator/cell_geometry_model/model.external.py index 2e565edd4d..752da86d55 100644 --- a/tests/resources/generator/cell_geometry_model/model.external.py +++ b/tests/resources/generator/cell_geometry_model/model.external.py @@ -32,8 +32,8 @@ def create_variables_array(): def initialise_variables(constants, external_variable): - variables[1] = external_variable(variables, 1) - variables[2] = external_variable(variables, 2) + algebraic[1] = external_variable(variables, 1) + algebraic[2] = external_variable(variables, 2) def compute_computed_constants(constants, computed_constants): @@ -41,7 +41,7 @@ def compute_computed_constants(constants, computed_constants): def compute_variables(constants, computed_constants, algebraic, external_variable): - variables[1] = external_variable(variables, 1) - variables[2] = external_variable(variables, 2) - variables[0] = 1000.0*3.14*variables[2]*variables[2]*variables[1] - variables[3] = 0.02*variables[0] + algebraic[1] = external_variable(variables, 1) + algebraic[2] = external_variable(variables, 2) + algebraic[0] = 1000.0*3.14*algebraic[2]*algebraic[2]*algebraic[1] + algebraic[3] = 0.02*algebraic[0] diff --git a/tests/resources/generator/cell_geometry_model/model.py b/tests/resources/generator/cell_geometry_model/model.py index dd282fbf35..bcbef6f85a 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): - variables[1] = 0.01 - variables[2] = 0.0011 + constants[1] = 0.01 + constants[2] = 0.0011 def compute_computed_constants(constants, computed_constants): - variables[0] = 1000.0*3.14*variables[2]*variables[2]*variables[1] - variables[3] = 0.02*variables[0] + computed_constants[0] = 1000.0*3.14*constants[2]*constants[2]*constants[1] + computed_constants[3] = 0.02*computed_constants[0] def compute_variables(constants, computed_constants, algebraic): diff --git a/tests/resources/generator/cellml_mappings_and_encapsulations/model.c b/tests/resources/generator/cellml_mappings_and_encapsulations/model.c index af77c8adbe..3f59baaf87 100644 --- a/tests/resources/generator/cellml_mappings_and_encapsulations/model.c +++ b/tests/resources/generator/cellml_mappings_and_encapsulations/model.c @@ -70,6 +70,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) { - variables[0] = states[0]+5.0*states[0]/3.0+1.0*exp(states[0]/2.0); - variables[1] = 2.0*states[1]; + algebraic[0] = states[0]+5.0*states[0]/3.0+1.0*exp(states[0]/2.0); + algebraic[1] = 2.0*states[1]; } diff --git a/tests/resources/generator/cellml_mappings_and_encapsulations/model.py b/tests/resources/generator/cellml_mappings_and_encapsulations/model.py index 48ead204d4..42799d8118 100644 --- a/tests/resources/generator/cellml_mappings_and_encapsulations/model.py +++ b/tests/resources/generator/cellml_mappings_and_encapsulations/model.py @@ -57,5 +57,5 @@ def compute_rates(voi, states, rates, constants, computed_constants, algebraic): def compute_variables(voi, states, rates, constants, computed_constants, algebraic): - variables[0] = states[0]+5.0*states[0]/3.0+1.0*exp(states[0]/2.0) - variables[1] = 2.0*states[1] + algebraic[0] = states[0]+5.0*states[0]/3.0+1.0*exp(states[0]/2.0) + algebraic[1] = 2.0*states[1] diff --git a/tests/resources/generator/cellml_slc_example/model.py b/tests/resources/generator/cellml_slc_example/model.py index e46136ff87..ea8cac8cf8 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): - variables[1] = 1.1 - variables[2] = 21262500.0 - variables[3] = 150.0 - variables[4] = 3402000.0 - variables[5] = 2.0 - variables[6] = 2902500.0 - variables[7] = 810000.0 - variables[8] = 247140.0 - variables[9] = 2902500.0 + 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 def compute_computed_constants(constants, computed_constants): - variables[0] = variables[1]*(variables[2]*variables[3]-variables[4]*variables[5])/(variables[6]*variables[5]+variables[9]*variables[3]+variables[8]*variables[5]*variables[3]+variables[7]) + 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]) def compute_variables(constants, computed_constants, algebraic): diff --git a/tests/resources/generator/cellml_state_initialised_using_variable/model.c b/tests/resources/generator/cellml_state_initialised_using_variable/model.c index fd33a5b300..3bb1425bc5 100644 --- a/tests/resources/generator/cellml_state_initialised_using_variable/model.c +++ b/tests/resources/generator/cellml_state_initialised_using_variable/model.c @@ -52,8 +52,8 @@ void deleteArray(double *array) void initialiseVariables(double *states, double *rates, double *constants) { - variables[0] = 123.0; - states[0] = variables[0]; + constants[0] = 123.0; + states[0] = constants[0]; } void computeComputedConstants(double *constants, double *computedConstants) diff --git a/tests/resources/generator/cellml_state_initialised_using_variable/model.py b/tests/resources/generator/cellml_state_initialised_using_variable/model.py index 246d135ba0..2ae891fe37 100644 --- a/tests/resources/generator/cellml_state_initialised_using_variable/model.py +++ b/tests/resources/generator/cellml_state_initialised_using_variable/model.py @@ -41,8 +41,8 @@ def create_variables_array(): def initialise_variables(states, rates, constants): - variables[0] = 123.0 - states[0] = variables[0] + constants[0] = 123.0 + states[0] = constants[0] def compute_computed_constants(constants, computed_constants): diff --git a/tests/resources/generator/cellml_unit_scaling_constant/model.c b/tests/resources/generator/cellml_unit_scaling_constant/model.c index 5ec839f548..79847cd595 100644 --- a/tests/resources/generator/cellml_unit_scaling_constant/model.c +++ b/tests/resources/generator/cellml_unit_scaling_constant/model.c @@ -36,13 +36,13 @@ void deleteArray(double *array) void initialiseVariables(double *constants) { - variables[0] = 123.0; + constants[0] = 123.0; } void computeComputedConstants(double *constants, double *computedConstants) { - variables[1] = variables[0]+variables[0]; - variables[2] = 0.001*variables[0]+0.001*variables[0]; + computedConstants[1] = constants[0]+constants[0]; + computedConstants[2] = 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 83f5af0c90..8d1f0b000f 100644 --- a/tests/resources/generator/cellml_unit_scaling_constant/model.py +++ b/tests/resources/generator/cellml_unit_scaling_constant/model.py @@ -30,12 +30,12 @@ def create_variables_array(): def initialise_variables(constants): - variables[0] = 123.0 + constants[0] = 123.0 def compute_computed_constants(constants, computed_constants): - variables[1] = variables[0]+variables[0] - variables[2] = 0.001*variables[0]+0.001*variables[0] + computed_constants[1] = constants[0]+constants[0] + computed_constants[2] = 0.001*constants[0]+0.001*constants[0] def compute_variables(constants, computed_constants, algebraic): diff --git a/tests/resources/generator/cellml_unit_scaling_rate/model.c b/tests/resources/generator/cellml_unit_scaling_rate/model.c index 56547ca65a..603a1eab39 100644 --- a/tests/resources/generator/cellml_unit_scaling_rate/model.c +++ b/tests/resources/generator/cellml_unit_scaling_rate/model.c @@ -67,6 +67,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) { - variables[0] = 1000.0*rates[0]+1000.0*rates[0]; - variables[1] = 1000.0*0.001*rates[0]+1000.0*0.001*rates[0]; + algebraic[0] = 1000.0*rates[0]+1000.0*rates[0]; + algebraic[1] = 1000.0*0.001*rates[0]+1000.0*0.001*rates[0]; } diff --git a/tests/resources/generator/cellml_unit_scaling_rate/model.py b/tests/resources/generator/cellml_unit_scaling_rate/model.py index 97589bc349..f74588e123 100644 --- a/tests/resources/generator/cellml_unit_scaling_rate/model.py +++ b/tests/resources/generator/cellml_unit_scaling_rate/model.py @@ -54,5 +54,5 @@ def compute_rates(voi, states, rates, constants, computed_constants, algebraic): def compute_variables(voi, states, rates, constants, computed_constants, algebraic): - variables[0] = 1000.0*rates[0]+1000.0*rates[0] - variables[1] = 1000.0*0.001*rates[0]+1000.0*0.001*rates[0] + algebraic[0] = 1000.0*rates[0]+1000.0*rates[0] + algebraic[1] = 1000.0*0.001*rates[0]+1000.0*0.001*rates[0] diff --git a/tests/resources/generator/cellml_unit_scaling_state/model.c b/tests/resources/generator/cellml_unit_scaling_state/model.c index fc1ab5e93c..34c1bca1f3 100644 --- a/tests/resources/generator/cellml_unit_scaling_state/model.c +++ b/tests/resources/generator/cellml_unit_scaling_state/model.c @@ -67,6 +67,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) { - variables[0] = states[0]+states[0]; - variables[1] = 0.001*states[0]+0.001*states[0]; + algebraic[0] = states[0]+states[0]; + algebraic[1] = 0.001*states[0]+0.001*states[0]; } diff --git a/tests/resources/generator/cellml_unit_scaling_state/model.py b/tests/resources/generator/cellml_unit_scaling_state/model.py index 1c964deb86..ec43146e3c 100644 --- a/tests/resources/generator/cellml_unit_scaling_state/model.py +++ b/tests/resources/generator/cellml_unit_scaling_state/model.py @@ -54,5 +54,5 @@ def compute_rates(voi, states, rates, constants, computed_constants, algebraic): def compute_variables(voi, states, rates, constants, computed_constants, algebraic): - variables[0] = states[0]+states[0] - variables[1] = 0.001*states[0]+0.001*states[0] + algebraic[0] = states[0]+states[0] + algebraic[1] = 0.001*states[0]+0.001*states[0] diff --git a/tests/resources/generator/cellml_unit_scaling_state_initialised_using_variable/model.c b/tests/resources/generator/cellml_unit_scaling_state_initialised_using_variable/model.c index bafc5259f8..ba05a38f2c 100644 --- a/tests/resources/generator/cellml_unit_scaling_state_initialised_using_variable/model.c +++ b/tests/resources/generator/cellml_unit_scaling_state_initialised_using_variable/model.c @@ -54,10 +54,10 @@ void deleteArray(double *array) void initialiseVariables(double *states, double *rates, double *constants) { - variables[0] = 123.0; - variables[1] = 789.0; - states[0] = variables[0]; - states[1] = 0.001*variables[1]; + constants[0] = 123.0; + constants[1] = 789.0; + states[0] = constants[0]; + states[1] = 0.001*constants[1]; } void computeComputedConstants(double *constants, double *computedConstants) diff --git a/tests/resources/generator/cellml_unit_scaling_state_initialised_using_variable/model.py b/tests/resources/generator/cellml_unit_scaling_state_initialised_using_variable/model.py index 029b44f7a4..ce584f1b07 100644 --- a/tests/resources/generator/cellml_unit_scaling_state_initialised_using_variable/model.py +++ b/tests/resources/generator/cellml_unit_scaling_state_initialised_using_variable/model.py @@ -43,10 +43,10 @@ def create_variables_array(): def initialise_variables(states, rates, constants): - variables[0] = 123.0 - variables[1] = 789.0 - states[0] = variables[0] - states[1] = 0.001*variables[1] + constants[0] = 123.0 + constants[1] = 789.0 + states[0] = constants[0] + states[1] = 0.001*constants[1] def compute_computed_constants(constants, computed_constants): 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 c349b48caa..aff41afb7a 100644 --- a/tests/resources/generator/dae_cellml_1_1_model/model.c +++ b/tests/resources/generator/dae_cellml_1_1_model/model.c @@ -77,9 +77,9 @@ void objectiveFunction0(double *u, double *f, void *data) double *rates = ((RootFindingInfo *) data)->rates; double *variables = ((RootFindingInfo *) data)->variables; - variables[0] = u[0]; + algebraic[0] = u[0]; - f[0] = variables[1]-(variables[0]+variables[2]); + f[0] = constants[1]-(algebraic[0]+algebraic[2]); } void findRoot0(double voi, double *states, double *rates, double *variables) @@ -87,11 +87,11 @@ void findRoot0(double voi, double *states, double *rates, double *variables) RootFindingInfo rfi = { voi, states, rates, variables }; double u[1]; - u[0] = variables[0]; + u[0] = algebraic[0]; nlaSolve(objectiveFunction0, u, 1, &rfi); - variables[0] = u[0]; + algebraic[0] = u[0]; } void objectiveFunction1(double *u, double *f, void *data) @@ -101,9 +101,9 @@ void objectiveFunction1(double *u, double *f, void *data) double *rates = ((RootFindingInfo *) data)->rates; double *variables = ((RootFindingInfo *) data)->variables; - variables[6] = u[0]; + algebraic[6] = u[0]; - f[0] = variables[4]-(variables[5]+variables[6]); + f[0] = algebraic[4]-(algebraic[5]+algebraic[6]); } 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] = variables[6]; + u[0] = algebraic[6]; nlaSolve(objectiveFunction1, u, 1, &rfi); - variables[6] = u[0]; + algebraic[6] = u[0]; } void initialiseVariables(double *states, double *rates, double *constants) { - variables[0] = 0.0; - variables[1] = 1.0; - variables[3] = 1.0; - variables[6] = 0.0; - variables[7] = 20.0; - variables[8] = 2.0; - variables[9] = 10.0; + algebraic[0] = 0.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; 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) { - variables[2] = states[1]+variables[3]; + algebraic[2] = states[1]+constants[3]; findRoot0(voi, states, rates, variables); - rates[0] = variables[0]; - variables[4] = states[0]/variables[7]; - variables[5] = variables[8]*variables[2]; + rates[0] = algebraic[0]; + algebraic[4] = states[0]/constants[7]; + algebraic[5] = constants[8]*algebraic[2]; findRoot1(voi, states, rates, variables); - rates[1] = variables[6]/variables[9]; + rates[1] = algebraic[6]/constants[9]; } void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic) { - variables[2] = states[1]+variables[3]; + algebraic[2] = states[1]+constants[3]; findRoot0(voi, states, rates, variables); - variables[4] = states[0]/variables[7]; - variables[5] = variables[8]*variables[2]; + algebraic[4] = states[0]/constants[7]; + algebraic[5] = constants[8]*algebraic[2]; 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 793f148fac..764fb8703d 100644 --- a/tests/resources/generator/dae_cellml_1_1_model/model.py +++ b/tests/resources/generator/dae_cellml_1_1_model/model.py @@ -59,19 +59,19 @@ def objective_function_0(u, f, data): rates = data[2] variables = data[3] - variables[0] = u[0] + algebraic[0] = u[0] - f[0] = variables[1]-(variables[0]+variables[2]) + f[0] = constants[1]-(algebraic[0]+algebraic[2]) def find_root_0(voi, states, rates, variables): u = [nan]*1 - u[0] = variables[0] + u[0] = algebraic[0] u = nla_solve(objective_function_0, u, 1, [voi, states, rates, variables]) - variables[0] = u[0] + algebraic[0] = u[0] def objective_function_1(u, f, data): @@ -80,29 +80,29 @@ def objective_function_1(u, f, data): rates = data[2] variables = data[3] - variables[6] = u[0] + algebraic[6] = u[0] - f[0] = variables[4]-(variables[5]+variables[6]) + f[0] = algebraic[4]-(algebraic[5]+algebraic[6]) def find_root_1(voi, states, rates, variables): u = [nan]*1 - u[0] = variables[6] + u[0] = algebraic[6] u = nla_solve(objective_function_1, u, 1, [voi, states, rates, variables]) - variables[6] = u[0] + algebraic[6] = u[0] def initialise_variables(states, rates, constants): - variables[0] = 0.0 - variables[1] = 1.0 - variables[3] = 1.0 - variables[6] = 0.0 - variables[7] = 20.0 - variables[8] = 2.0 - variables[9] = 10.0 + algebraic[0] = 0.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 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): - variables[2] = states[1]+variables[3] + algebraic[2] = states[1]+constants[3] find_root_0(voi, states, rates, variables) - rates[0] = variables[0] - variables[4] = states[0]/variables[7] - variables[5] = variables[8]*variables[2] + rates[0] = algebraic[0] + algebraic[4] = states[0]/constants[7] + algebraic[5] = constants[8]*algebraic[2] find_root_1(voi, states, rates, variables) - rates[1] = variables[6]/variables[9] + rates[1] = algebraic[6]/constants[9] def compute_variables(voi, states, rates, constants, computed_constants, algebraic): - variables[2] = states[1]+variables[3] + algebraic[2] = states[1]+constants[3] find_root_0(voi, states, rates, variables) - variables[4] = states[0]/variables[7] - variables[5] = variables[8]*variables[2] + algebraic[4] = states[0]/constants[7] + algebraic[5] = constants[8]*algebraic[2] find_root_1(voi, states, rates, variables) diff --git a/tests/resources/generator/dependent_eqns/model.c b/tests/resources/generator/dependent_eqns/model.c index e85abef766..7bbb981447 100644 --- a/tests/resources/generator/dependent_eqns/model.c +++ b/tests/resources/generator/dependent_eqns/model.c @@ -67,6 +67,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) { - variables[1] = 2.0*voi; - variables[0] = 3.0*variables[1]; + algebraic[1] = 2.0*voi; + algebraic[0] = 3.0*algebraic[1]; } diff --git a/tests/resources/generator/dependent_eqns/model.py b/tests/resources/generator/dependent_eqns/model.py index a5a26864cc..5ed89e9102 100644 --- a/tests/resources/generator/dependent_eqns/model.py +++ b/tests/resources/generator/dependent_eqns/model.py @@ -54,5 +54,5 @@ def compute_rates(voi, states, rates, constants, computed_constants, algebraic): def compute_variables(voi, states, rates, constants, computed_constants, algebraic): - variables[1] = 2.0*voi - variables[0] = 3.0*variables[1] + algebraic[1] = 2.0*voi + algebraic[0] = 3.0*algebraic[1] 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 ee620de9a6..ccb8d7ddf3 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 @@ -300,97 +300,97 @@ void deleteArray(double *array) void initialiseVariables(double *states, double *rates, double *constants) { - variables[0] = 0.0; - variables[1] = 0.0; - variables[4] = 140.0; - variables[7] = 5.4; - variables[8] = 140.0; - variables[10] = 1.8; - variables[11] = 1.0; - variables[17] = 96485.3415; - variables[22] = 14.0; - variables[23] = 1.4; - variables[24] = 0.08105; - variables[25] = 0.0; - variables[30] = 3.343; - variables[39] = 26.44; - variables[40] = 0.0207; - variables[41] = 0.1369; - variables[43] = 395.3; - variables[44] = 2.289; - variables[45] = 0.4315; - variables[46] = 26.44; - variables[47] = 4.663; - variables[48] = 3.663; - variables[49] = 0.0; - variables[51] = 1628.0; - variables[52] = 561.4; - variables[54] = 148041085.1; - variables[57] = 15.0; - variables[58] = 1.0; - variables[59] = 0.45; - variables[60] = 2.5; - variables[62] = 10000.0; - variables[64] = 500.0; - variables[65] = 5.0; - variables[66] = 660.0; - variables[70] = 5.0; - variables[72] = 5.469e-5; - variables[74] = 0.000286113; - variables[75] = 5.0e-5; - variables[77] = 0.04; - variables[79] = 88800.0; - variables[80] = 446.0; - variables[82] = 227700.0; - variables[83] = 7.51; - variables[85] = 2277.0; - variables[86] = 2.5; - variables[87] = 751.0; - variables[89] = 1.642e6; - variables[90] = 542.0; - variables[93] = 175.4; - variables[94] = 445.0; - variables[95] = 0.031; - variables[96] = 0.062; - variables[97] = 0.045; - variables[98] = 10.0; - variables[104] = 67.0; - variables[105] = 3.9; - variables[106] = 0.02; - variables[107] = 0.0012; - variables[108] = 0.46; - variables[109] = 0.0116; - variables[118] = 5.7e-5; - variables[119] = 8314.472; - variables[120] = 310.0; - variables[122] = 0.0; - variables[123] = -35.0; - variables[124] = 0.5; - variables[125] = 0.5; - variables[126] = -45.0; - variables[128] = 0.00427; - variables[129] = 45.0; - variables[131] = 0.5927; - variables[135] = 0.0; - variables[141] = 0.0; - variables[144] = 0.0223; - variables[146] = 0.0; - variables[150] = 1.0e-5; - variables[157] = 0.1539e-3; - variables[163] = 0.4578; - variables[169] = -16.4508; - variables[170] = 4.3371; - variables[177] = 0.0; - variables[178] = 0.0; - variables[181] = 0.000338; - variables[183] = 0.0075; - variables[184] = 0.04132; - variables[189] = 0.0; - variables[190] = 3.5e-3; - variables[195] = 0.00424; - variables[204] = 0.00065; - variables[211] = 1.0; - variables[212] = 0.00345; + constants[0] = 0.0; + constants[1] = 0.0; + 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; 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) { - variables[3] = variables[119]*variables[120]/variables[17]; - variables[6] = variables[3]*log(variables[7]/variables[8]); - variables[20] = (variables[1] > 0.0)?1.2:1.0; - variables[35] = variables[4]/(variables[47]+variables[4]); - variables[68] = (variables[1] > 0.0)?-0.25:(variables[0] > 0.0)?0.7*variables[0]/(0.00009+variables[0]):0.0; - variables[69] = variables[70]*(1.0-variables[68]); - variables[103] = 0.000000001*3.14159265358979*pow(variables[105], 2.0)*variables[104]; - variables[19] = 0.000000001*2.0*3.14159265358979*variables[106]*(variables[105]-variables[106]/2.0)*variables[104]; - variables[100] = variables[107]*variables[103]; - variables[18] = variables[108]*variables[103]-variables[19]; - variables[99] = variables[109]*variables[103]; - variables[127] = variables[128]/(variables[7]/(variables[7]+variables[129])); - variables[130] = variables[127]/(variables[131]+1.0); - variables[132] = variables[131]*variables[130]; - variables[133] = variables[132]*variables[7]/(variables[7]+variables[129]); - variables[134] = variables[130]*variables[7]/(variables[7]+variables[129]); - variables[137] = (variables[0] > 0.0)?-1.0-9.898*pow(1.0*variables[0], 0.618)/(pow(1.0*variables[0], 0.618)+0.00122423):0.0; - variables[138] = (variables[1] > 0.0)?7.5:0.0; - variables[162] = (variables[1] > 0.0)?1.23:1.0; - variables[165] = 0.31*variables[0]/(variables[0]+0.00009); - variables[166] = (variables[1] > 0.0)?-8.0:0.0; - variables[167] = (variables[1] > 0.0)?-27.0:0.0; - variables[203] = (variables[1] > 0.0)?1.2*variables[204]:variables[204]; - variables[206] = (variables[1] > 0.0)?-14.0:0.0; - variables[213] = (3.5988-0.025641)/(1.0+0.0000012155/pow(1.0*variables[0], 1.6951))+0.025641; + 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; } void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic) { - variables[5] = states[1]; - variables[142] = variables[3]*log((variables[4]+0.12*variables[7])/(variables[5]+0.12*variables[8])); - variables[121] = ((voi > variables[124]) && (voi < variables[124]+variables[125]))?variables[123]:variables[126]; - variables[21] = (variables[122] >= 1.0)?variables[121]:states[15]; - variables[143] = variables[144]*pow(states[18], 3.0)*states[17]*(variables[21]-variables[142]); - variables[145] = variables[146]*pow(states[18], 3.0)*(variables[21]-variables[142]); - variables[12] = variables[143]+variables[145]; - variables[15] = 0.0000185*variables[163]*(variables[21]-0.0)/(variables[3]*(1.0-exp(-1.0*(variables[21]-0.0)/variables[3])))*(variables[5]-variables[4]*exp(-1.0*(variables[21]-0.0)/variables[3]))*states[23]*states[22]*states[21]; - variables[2] = variables[3]*log(variables[4]/variables[5]); - variables[16] = states[16]*variables[133]*(variables[21]-variables[2])*(1.0-variables[135]); - variables[14] = variables[20]*variables[24]*pow(1.0+pow(variables[23]/variables[7], 1.2), -1.0)*pow(1.0+pow(variables[22]/variables[5], 1.3), -1.0)*pow(1.0+exp(-(variables[21]-variables[2]+110.0)/20.0), -1.0); - variables[50] = 1.0+variables[10]/variables[48]*(1.0+exp(variables[49]*variables[21]/variables[3]))+variables[4]/variables[51]*(1.0+variables[4]/variables[52]*(1.0+variables[4]/variables[47])); - variables[27] = variables[10]/variables[48]*exp(variables[49]*variables[21]/variables[3])/variables[50]; - variables[42] = 1.0+states[0]/variables[40]*(1.0+exp(-variables[41]*variables[21]/variables[3])+variables[5]/variables[46])+variables[5]/variables[43]*(1.0+variables[5]/variables[44]*(1.0+variables[5]/variables[39])); - variables[29] = states[0]/variables[40]*exp(-variables[41]*variables[21]/variables[3])/variables[42]; - variables[36] = variables[5]/(variables[39]+variables[5]); - variables[37] = exp(variables[45]*variables[21]/(2.0*variables[3])); - variables[33] = exp(-variables[45]*variables[21]/(2.0*variables[3])); - variables[38] = variables[5]/variables[43]*variables[5]/variables[44]*(1.0+variables[5]/variables[39])*exp(variables[45]*variables[21]/(2.0*variables[3]))/variables[42]; - variables[26] = variables[37]*variables[36]*(variables[38]+variables[29])+variables[33]*variables[29]*(variables[35]+variables[37]); - variables[34] = variables[4]/variables[51]*variables[4]/variables[52]*(1.0+variables[4]/variables[47])*exp(-variables[45]*variables[21]/(2.0*variables[3]))/variables[50]; - variables[28] = variables[33]*variables[35]*(variables[34]+variables[27])+variables[27]*variables[37]*(variables[36]+variables[33]); - variables[31] = variables[34]*variables[35]*(variables[38]+variables[29])+variables[38]*variables[27]*(variables[35]+variables[37]); - variables[32] = variables[38]*variables[36]*(variables[34]+variables[27])+variables[29]*variables[34]*(variables[36]+variables[33]); - variables[13] = (1.0-variables[25])*variables[30]*(variables[26]*variables[27]-variables[28]*variables[29])/(variables[28]+variables[26]+variables[32]+variables[31]); - rates[1] = (1.0-variables[11])*-1.0*(variables[12]+variables[16]+variables[15]+3.0*variables[14]+3.0*variables[13])/(1.0*(variables[18]+variables[19])*variables[17]); - variables[56] = variables[57]-(variables[57]-variables[58])/(1.0+pow(variables[59]/states[2], variables[60])); - variables[63] = variables[64]*variables[56]; - variables[61] = variables[62]/variables[56]; - rates[4] = variables[65]*states[5]-variables[63]*states[0]*states[4]-(variables[61]*pow(states[0], 2.0)*states[4]-variables[66]*states[3]); - rates[3] = variables[61]*pow(states[0], 2.0)*states[4]-variables[66]*states[3]-(variables[63]*states[0]*states[3]-variables[65]*states[6]); - rates[6] = variables[63]*states[0]*states[3]-variables[65]*states[6]-(variables[66]*states[6]-variables[61]*pow(states[0], 2.0)*states[5]); - rates[5] = variables[66]*states[6]-variables[61]*pow(states[0], 2.0)*states[5]-(variables[65]*states[5]-variables[63]*states[0]*states[4]); - variables[78] = variables[79]*states[7]*(1.0-states[9])-variables[80]*states[9]; - rates[9] = variables[78]; - variables[81] = variables[82]*states[7]*(1.0-(states[10]+states[11]))-variables[83]*states[10]; - rates[10] = variables[81]; - variables[84] = variables[85]*variables[86]*(1.0-(states[10]+states[11]))-variables[87]*states[11]; - rates[11] = variables[84]; - variables[88] = variables[89]*states[7]*(1.0-states[12])-variables[90]*states[12]; - rates[12] = variables[88]; - variables[91] = variables[89]*states[0]*(1.0-states[13])-variables[90]*states[13]; - rates[13] = variables[91]; - variables[92] = variables[93]*states[2]*(1.0-states[14])-variables[94]*states[14]; - rates[14] = variables[92]; - variables[71] = (states[0]-states[7])/variables[72]; - variables[73] = variables[69]/(1.0+exp((-states[7]+variables[74])/variables[75])); - rates[7] = 1.0*(variables[71]*variables[19]-variables[73]*variables[99])/variables[18]-(variables[97]*variables[88]+variables[95]*variables[78]+variables[96]*variables[81]); - variables[53] = variables[54]*states[3]*(states[2]-states[0]); - variables[101] = 2.0*variables[163]*(variables[21]-0.0)/(variables[3]*(1.0-exp(-1.0*(variables[21]-0.0)*2.0/variables[3])))*(states[0]-variables[10]*exp(-2.0*(variables[21]-0.0)/variables[3]))*states[23]*states[22]*states[21]; - variables[102] = 2.0*variables[184]*variables[21]/(variables[3]*(1.0-exp(-1.0*variables[21]*2.0/variables[3])))*(states[0]-variables[10]*exp(-2.0*variables[21]/variables[3]))*states[25]*states[24]; - rates[0] = variables[53]*variables[100]/variables[19]-((variables[101]+variables[102]-2.0*variables[13])/(2.0*variables[17]*variables[19])+variables[71]+variables[97]*variables[91]); - variables[76] = (states[8]-states[2])/variables[77]; - rates[8] = variables[73]-variables[76]*variables[100]/variables[99]; - rates[2] = variables[76]-(variables[53]+variables[98]*variables[92]); - variables[136] = states[16]*variables[134]*(variables[21]-variables[6])*(1.0-variables[135]); - variables[111] = variables[16]+variables[136]; - variables[112] = variables[157]*states[20]*states[19]*(variables[21]-variables[6]); - variables[113] = (variables[0] > 0.0)?variables[211]*variables[212]*(variables[21]-variables[6])*(1.0+exp((variables[21]+20.0)/20.0))*states[32]:0.0; - variables[164] = 0.000365*variables[163]*(variables[21]-0.0)/(variables[3]*(1.0-exp(-1.0*(variables[21]-0.0)/variables[3])))*(variables[8]-variables[7]*exp(-1.0*(variables[21]-0.0)/variables[3]))*states[23]*states[22]*states[21]; - variables[114] = (variables[101]+variables[164]+variables[15])*(1.0-variables[165])*1.0*variables[162]; - variables[115] = variables[190]*(variables[21]-variables[6])*states[27]*states[26]; - variables[205] = variables[3]*log((variables[7]+0.12*variables[4])/(variables[8]+0.12*variables[5])); - variables[116] = variables[203]*(variables[21]-variables[205])*pow(states[31], 2.0); - variables[117] = variables[195]*(variables[21]-variables[6])*(0.9*states[29]+0.1*states[30])*states[28]; - variables[110] = variables[111]+variables[117]+variables[116]+variables[115]+variables[14]+variables[13]+variables[12]+variables[114]+variables[102]+variables[113]+variables[112]; - rates[15] = -variables[110]/variables[118]; - variables[140] = (variables[21] < -(80.0-variables[137]-variables[138]-variables[141]))?0.01329+0.99921/(1.0+exp((variables[21]+97.134-variables[137]-variables[138]-variables[141])/8.1752)):0.0002501*exp(-(variables[21]-variables[137]-variables[138]-variables[141])/12.861); - variables[139] = 1.0/(0.36*(variables[21]+148.8-variables[137]-variables[138])/(exp(0.066*(variables[21]+148.8-variables[137]-variables[138]))-1.0)+0.1*(variables[21]+87.3-variables[137]-variables[138])/(1.0-exp(-0.2*(variables[21]+87.3-variables[137]-variables[138]))))-0.054; - rates[16] = (variables[140]-states[16])/variables[139]; - variables[147] = 1.0/(1.0+exp(-(variables[21]+42.0504)/8.3106)); - variables[148] = variables[21]+41.0; - variables[149] = (fabs(variables[148]) < variables[150])?2000.0:200.0*variables[148]/(1.0-exp(-0.1*variables[148])); - variables[151] = 8000.0*exp(-0.056*(variables[21]+66.0)); - variables[152] = 1.0/(variables[149]+variables[151]); - rates[18] = (variables[147]-states[18])/variables[152]; - variables[153] = 1.0/(1.0+exp((variables[21]+69.804)/4.4565)); - variables[154] = 20.0*exp(-0.125*(variables[21]+75.0)); - variables[155] = 2000.0/(320.0*exp(-0.1*(variables[21]+75.0))+1.0); - variables[156] = 1.0/(variables[154]+variables[155]); - rates[17] = (variables[153]-states[17])/variables[156]; - variables[158] = 1.0/(1.0+exp((variables[21]+6.0)/-8.6)); - variables[159] = 0.009/(1.0+exp((variables[21]+5.0)/12.0))+0.0005; - rates[20] = (variables[158]-states[20])/variables[159]; - variables[160] = 1.0/(1.0+exp((variables[21]+7.5)/10.0)); - variables[161] = 0.59/(1.0+exp((variables[21]+60.0)/10.0))+3.05; - rates[19] = (variables[160]-states[19])/variables[161]; - variables[168] = 1.0/(1.0+exp(-(variables[21]-variables[169]-variables[166])/(variables[170]*(1.0+variables[167]/100.0)))); - variables[174] = (variables[21] == -41.8)?-41.80001:(variables[21] == 0.0)?0.0:(variables[21] == -6.8)?-6.80001:variables[21]; - variables[172] = -0.02839*(variables[174]+41.8)/(exp(-(variables[174]+41.8)/2.5)-1.0)-0.0849*(variables[174]+6.8)/(exp(-(variables[174]+6.8)/4.8)-1.0); - variables[175] = (variables[21] == -1.8)?-1.80001:variables[21]; - variables[173] = 0.01143*(variables[175]+1.8)/(exp((variables[175]+1.8)/2.5)-1.0); - variables[171] = 0.001/(variables[172]+variables[173]); - rates[23] = (variables[168]-states[23])/variables[171]; - variables[176] = 1.0/(1.0+exp((variables[21]+37.4+variables[177])/(5.3+variables[178]))); - variables[179] = 0.001*(44.3+230.0*exp(-pow((variables[21]+36.0)/10.0, 2.0))); - rates[22] = (variables[176]-states[22])/variables[179]; - variables[180] = variables[181]/(variables[181]+states[0]); - variables[182] = 0.001*variables[180]/variables[183]; - rates[21] = (variables[180]-states[21])/variables[182]; - variables[185] = 1.0/(1.0+exp(-(variables[21]+38.3)/5.5)); - variables[186] = 0.001/(1.068*exp((variables[21]+38.3)/30.0)+1.068*exp(-(variables[21]+38.3)/30.0)); - rates[25] = (variables[185]-states[25])/variables[186]; - variables[187] = 1.0/(1.0+exp((variables[21]+58.7)/3.8)); - variables[188] = 1.0/(16.67*exp(-(variables[21]+75.0)/83.3)+16.67*exp((variables[21]+75.0)/15.38))+variables[189]; - rates[24] = (variables[187]-states[24])/variables[188]; - variables[191] = 1.0/(1.0+exp((variables[21]+49.0)/13.0)); - variables[192] = 0.001*0.6*(65.17/(0.57*exp(-0.08*(variables[21]+44.0))+0.065*exp(0.1*(variables[21]+45.93)))+10.1); - rates[27] = (variables[191]-states[27])/variables[192]; - variables[193] = 1.0/(1.0+exp(-(variables[21]-19.3)/15.0)); - variables[194] = 0.001*0.66*1.4*(15.59/(1.037*exp(0.09*(variables[21]+30.61))+0.369*exp(-0.12*(variables[21]+23.84)))+2.98); - rates[26] = (variables[193]-states[26])/variables[194]; - variables[198] = 1.0/(1.0+exp(-(variables[21]+10.0144)/7.6607)); - variables[199] = 0.84655354/(4.2*exp(variables[21]/17.0)+0.15*exp(-variables[21]/21.6)); - rates[30] = (variables[198]-states[30])/variables[199]; - variables[200] = 1.0/(30.0*exp(variables[21]/10.0)+exp(-variables[21]/12.0)); - rates[29] = (variables[198]-states[29])/variables[200]; - variables[202] = 1.0/(1.0+exp((variables[21]+28.6)/17.1)); - variables[201] = 1.0/(100.0*exp(-variables[21]/54.645)+656.0*exp(variables[21]/106.157)); - rates[28] = (variables[202]-states[28])/variables[201]; - variables[207] = sqrt(1.0/(1.0+exp(-(variables[21]+0.6383-variables[206])/10.7071))); - variables[209] = 28.0/(1.0+exp(-(variables[21]-40.0-variables[206])/3.0)); - variables[210] = 1.0*exp(-(variables[21]-variables[206]-5.0)/25.0); - variables[208] = 1.0/(variables[209]+variables[210]); - rates[31] = (variables[207]-states[31])/variables[208]; - variables[214] = 10.0*exp(0.0133*(variables[21]+40.0)); - variables[215] = variables[213]/(variables[213]+variables[214]); - variables[216] = 1.0/(variables[213]+variables[214]); - rates[32] = (variables[215]-states[32])/variables[216]; + 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]; } void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic) { - variables[5] = states[1]; - variables[2] = variables[3]*log(variables[4]/variables[5]); - variables[9] = 0.5*variables[3]*log(variables[10]/states[0]); - variables[21] = (variables[122] >= 1.0)?variables[121]:states[15]; - variables[14] = variables[20]*variables[24]*pow(1.0+pow(variables[23]/variables[7], 1.2), -1.0)*pow(1.0+pow(variables[22]/variables[5], 1.3), -1.0)*pow(1.0+exp(-(variables[21]-variables[2]+110.0)/20.0), -1.0); - variables[50] = 1.0+variables[10]/variables[48]*(1.0+exp(variables[49]*variables[21]/variables[3]))+variables[4]/variables[51]*(1.0+variables[4]/variables[52]*(1.0+variables[4]/variables[47])); - variables[27] = variables[10]/variables[48]*exp(variables[49]*variables[21]/variables[3])/variables[50]; - variables[42] = 1.0+states[0]/variables[40]*(1.0+exp(-variables[41]*variables[21]/variables[3])+variables[5]/variables[46])+variables[5]/variables[43]*(1.0+variables[5]/variables[44]*(1.0+variables[5]/variables[39])); - variables[29] = states[0]/variables[40]*exp(-variables[41]*variables[21]/variables[3])/variables[42]; - variables[36] = variables[5]/(variables[39]+variables[5]); - variables[37] = exp(variables[45]*variables[21]/(2.0*variables[3])); - variables[33] = exp(-variables[45]*variables[21]/(2.0*variables[3])); - variables[38] = variables[5]/variables[43]*variables[5]/variables[44]*(1.0+variables[5]/variables[39])*exp(variables[45]*variables[21]/(2.0*variables[3]))/variables[42]; - variables[26] = variables[37]*variables[36]*(variables[38]+variables[29])+variables[33]*variables[29]*(variables[35]+variables[37]); - variables[34] = variables[4]/variables[51]*variables[4]/variables[52]*(1.0+variables[4]/variables[47])*exp(-variables[45]*variables[21]/(2.0*variables[3]))/variables[50]; - variables[28] = variables[33]*variables[35]*(variables[34]+variables[27])+variables[27]*variables[37]*(variables[36]+variables[33]); - variables[31] = variables[34]*variables[35]*(variables[38]+variables[29])+variables[38]*variables[27]*(variables[35]+variables[37]); - variables[32] = variables[38]*variables[36]*(variables[34]+variables[27])+variables[29]*variables[34]*(variables[36]+variables[33]); - variables[13] = (1.0-variables[25])*variables[30]*(variables[26]*variables[27]-variables[28]*variables[29])/(variables[28]+variables[26]+variables[32]+variables[31]); - variables[53] = variables[54]*states[3]*(states[2]-states[0]); - variables[55] = states[2]-states[0]; - variables[56] = variables[57]-(variables[57]-variables[58])/(1.0+pow(variables[59]/states[2], variables[60])); - variables[61] = variables[62]/variables[56]; - variables[63] = variables[64]*variables[56]; - variables[67] = states[4]+states[3]+states[6]+states[5]; - variables[71] = (states[0]-states[7])/variables[72]; - variables[73] = variables[69]/(1.0+exp((-states[7]+variables[74])/variables[75])); - variables[76] = (states[8]-states[2])/variables[77]; - variables[78] = variables[79]*states[7]*(1.0-states[9])-variables[80]*states[9]; - variables[81] = variables[82]*states[7]*(1.0-(states[10]+states[11]))-variables[83]*states[10]; - variables[84] = variables[85]*variables[86]*(1.0-(states[10]+states[11]))-variables[87]*states[11]; - variables[88] = variables[89]*states[7]*(1.0-states[12])-variables[90]*states[12]; - variables[91] = variables[89]*states[0]*(1.0-states[13])-variables[90]*states[13]; - variables[92] = variables[93]*states[2]*(1.0-states[14])-variables[94]*states[14]; - variables[16] = states[16]*variables[133]*(variables[21]-variables[2])*(1.0-variables[135]); - variables[136] = states[16]*variables[134]*(variables[21]-variables[6])*(1.0-variables[135]); - variables[111] = variables[16]+variables[136]; - variables[112] = variables[157]*states[20]*states[19]*(variables[21]-variables[6]); - variables[113] = (variables[0] > 0.0)?variables[211]*variables[212]*(variables[21]-variables[6])*(1.0+exp((variables[21]+20.0)/20.0))*states[32]:0.0; - variables[102] = 2.0*variables[184]*variables[21]/(variables[3]*(1.0-exp(-1.0*variables[21]*2.0/variables[3])))*(states[0]-variables[10]*exp(-2.0*variables[21]/variables[3]))*states[25]*states[24]; - variables[101] = 2.0*variables[163]*(variables[21]-0.0)/(variables[3]*(1.0-exp(-1.0*(variables[21]-0.0)*2.0/variables[3])))*(states[0]-variables[10]*exp(-2.0*(variables[21]-0.0)/variables[3]))*states[23]*states[22]*states[21]; - variables[15] = 0.0000185*variables[163]*(variables[21]-0.0)/(variables[3]*(1.0-exp(-1.0*(variables[21]-0.0)/variables[3])))*(variables[5]-variables[4]*exp(-1.0*(variables[21]-0.0)/variables[3]))*states[23]*states[22]*states[21]; - variables[164] = 0.000365*variables[163]*(variables[21]-0.0)/(variables[3]*(1.0-exp(-1.0*(variables[21]-0.0)/variables[3])))*(variables[8]-variables[7]*exp(-1.0*(variables[21]-0.0)/variables[3]))*states[23]*states[22]*states[21]; - variables[114] = (variables[101]+variables[164]+variables[15])*(1.0-variables[165])*1.0*variables[162]; - variables[142] = variables[3]*log((variables[4]+0.12*variables[7])/(variables[5]+0.12*variables[8])); - variables[143] = variables[144]*pow(states[18], 3.0)*states[17]*(variables[21]-variables[142]); - variables[145] = variables[146]*pow(states[18], 3.0)*(variables[21]-variables[142]); - variables[12] = variables[143]+variables[145]; - variables[115] = variables[190]*(variables[21]-variables[6])*states[27]*states[26]; - variables[205] = variables[3]*log((variables[7]+0.12*variables[4])/(variables[8]+0.12*variables[5])); - variables[116] = variables[203]*(variables[21]-variables[205])*pow(states[31], 2.0); - variables[117] = variables[195]*(variables[21]-variables[6])*(0.9*states[29]+0.1*states[30])*states[28]; - variables[110] = variables[111]+variables[117]+variables[116]+variables[115]+variables[14]+variables[13]+variables[12]+variables[114]+variables[102]+variables[113]+variables[112]; - variables[139] = 1.0/(0.36*(variables[21]+148.8-variables[137]-variables[138])/(exp(0.066*(variables[21]+148.8-variables[137]-variables[138]))-1.0)+0.1*(variables[21]+87.3-variables[137]-variables[138])/(1.0-exp(-0.2*(variables[21]+87.3-variables[137]-variables[138]))))-0.054; - variables[140] = (variables[21] < -(80.0-variables[137]-variables[138]-variables[141]))?0.01329+0.99921/(1.0+exp((variables[21]+97.134-variables[137]-variables[138]-variables[141])/8.1752)):0.0002501*exp(-(variables[21]-variables[137]-variables[138]-variables[141])/12.861); - variables[147] = 1.0/(1.0+exp(-(variables[21]+42.0504)/8.3106)); - variables[148] = variables[21]+41.0; - variables[149] = (fabs(variables[148]) < variables[150])?2000.0:200.0*variables[148]/(1.0-exp(-0.1*variables[148])); - variables[151] = 8000.0*exp(-0.056*(variables[21]+66.0)); - variables[152] = 1.0/(variables[149]+variables[151]); - variables[153] = 1.0/(1.0+exp((variables[21]+69.804)/4.4565)); - variables[154] = 20.0*exp(-0.125*(variables[21]+75.0)); - variables[155] = 2000.0/(320.0*exp(-0.1*(variables[21]+75.0))+1.0); - variables[156] = 1.0/(variables[154]+variables[155]); - variables[158] = 1.0/(1.0+exp((variables[21]+6.0)/-8.6)); - variables[159] = 0.009/(1.0+exp((variables[21]+5.0)/12.0))+0.0005; - variables[160] = 1.0/(1.0+exp((variables[21]+7.5)/10.0)); - variables[161] = 0.59/(1.0+exp((variables[21]+60.0)/10.0))+3.05; - variables[168] = 1.0/(1.0+exp(-(variables[21]-variables[169]-variables[166])/(variables[170]*(1.0+variables[167]/100.0)))); - variables[174] = (variables[21] == -41.8)?-41.80001:(variables[21] == 0.0)?0.0:(variables[21] == -6.8)?-6.80001:variables[21]; - variables[172] = -0.02839*(variables[174]+41.8)/(exp(-(variables[174]+41.8)/2.5)-1.0)-0.0849*(variables[174]+6.8)/(exp(-(variables[174]+6.8)/4.8)-1.0); - variables[175] = (variables[21] == -1.8)?-1.80001:variables[21]; - variables[173] = 0.01143*(variables[175]+1.8)/(exp((variables[175]+1.8)/2.5)-1.0); - variables[171] = 0.001/(variables[172]+variables[173]); - variables[176] = 1.0/(1.0+exp((variables[21]+37.4+variables[177])/(5.3+variables[178]))); - variables[179] = 0.001*(44.3+230.0*exp(-pow((variables[21]+36.0)/10.0, 2.0))); - variables[180] = variables[181]/(variables[181]+states[0]); - variables[182] = 0.001*variables[180]/variables[183]; - variables[185] = 1.0/(1.0+exp(-(variables[21]+38.3)/5.5)); - variables[186] = 0.001/(1.068*exp((variables[21]+38.3)/30.0)+1.068*exp(-(variables[21]+38.3)/30.0)); - variables[187] = 1.0/(1.0+exp((variables[21]+58.7)/3.8)); - variables[188] = 1.0/(16.67*exp(-(variables[21]+75.0)/83.3)+16.67*exp((variables[21]+75.0)/15.38))+variables[189]; - variables[191] = 1.0/(1.0+exp((variables[21]+49.0)/13.0)); - variables[192] = 0.001*0.6*(65.17/(0.57*exp(-0.08*(variables[21]+44.0))+0.065*exp(0.1*(variables[21]+45.93)))+10.1); - variables[193] = 1.0/(1.0+exp(-(variables[21]-19.3)/15.0)); - variables[194] = 0.001*0.66*1.4*(15.59/(1.037*exp(0.09*(variables[21]+30.61))+0.369*exp(-0.12*(variables[21]+23.84)))+2.98); - variables[196] = 1.0/(1.0+exp(-(variables[21]+23.2)/6.6))/(0.84655354/(37.2*exp(variables[21]/11.9)+0.96*exp(-variables[21]/18.5))); - variables[197] = 4.0*((37.2*exp(variables[21]/15.9)+0.96*exp(-variables[21]/22.5))/0.84655354-1.0/(1.0+exp(-(variables[21]+23.2)/10.6))/(0.84655354/(37.2*exp(variables[21]/15.9)+0.96*exp(-variables[21]/22.5)))); - variables[198] = 1.0/(1.0+exp(-(variables[21]+10.0144)/7.6607)); - variables[199] = 0.84655354/(4.2*exp(variables[21]/17.0)+0.15*exp(-variables[21]/21.6)); - variables[200] = 1.0/(30.0*exp(variables[21]/10.0)+exp(-variables[21]/12.0)); - variables[201] = 1.0/(100.0*exp(-variables[21]/54.645)+656.0*exp(variables[21]/106.157)); - variables[202] = 1.0/(1.0+exp((variables[21]+28.6)/17.1)); - variables[207] = sqrt(1.0/(1.0+exp(-(variables[21]+0.6383-variables[206])/10.7071))); - variables[209] = 28.0/(1.0+exp(-(variables[21]-40.0-variables[206])/3.0)); - variables[210] = 1.0*exp(-(variables[21]-variables[206]-5.0)/25.0); - variables[208] = 1.0/(variables[209]+variables[210]); - variables[214] = 10.0*exp(0.0133*(variables[21]+40.0)); - variables[215] = variables[213]/(variables[213]+variables[214]); - variables[216] = 1.0/(variables[213]+variables[214]); + 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]); } 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 9831f67e58..109e8280db 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 @@ -309,97 +309,97 @@ def create_variables_array(): def initialise_variables(states, rates, constants): - variables[0] = 0.0 - variables[1] = 0.0 - variables[4] = 140.0 - variables[7] = 5.4 - variables[8] = 140.0 - variables[10] = 1.8 - variables[11] = 1.0 - variables[17] = 96485.3415 - variables[22] = 14.0 - variables[23] = 1.4 - variables[24] = 0.08105 - variables[25] = 0.0 - variables[30] = 3.343 - variables[39] = 26.44 - variables[40] = 0.0207 - variables[41] = 0.1369 - variables[43] = 395.3 - variables[44] = 2.289 - variables[45] = 0.4315 - variables[46] = 26.44 - variables[47] = 4.663 - variables[48] = 3.663 - variables[49] = 0.0 - variables[51] = 1628.0 - variables[52] = 561.4 - variables[54] = 148041085.1 - variables[57] = 15.0 - variables[58] = 1.0 - variables[59] = 0.45 - variables[60] = 2.5 - variables[62] = 10000.0 - variables[64] = 500.0 - variables[65] = 5.0 - variables[66] = 660.0 - variables[70] = 5.0 - variables[72] = 5.469e-5 - variables[74] = 0.000286113 - variables[75] = 5.0e-5 - variables[77] = 0.04 - variables[79] = 88800.0 - variables[80] = 446.0 - variables[82] = 227700.0 - variables[83] = 7.51 - variables[85] = 2277.0 - variables[86] = 2.5 - variables[87] = 751.0 - variables[89] = 1.642e6 - variables[90] = 542.0 - variables[93] = 175.4 - variables[94] = 445.0 - variables[95] = 0.031 - variables[96] = 0.062 - variables[97] = 0.045 - variables[98] = 10.0 - variables[104] = 67.0 - variables[105] = 3.9 - variables[106] = 0.02 - variables[107] = 0.0012 - variables[108] = 0.46 - variables[109] = 0.0116 - variables[118] = 5.7e-5 - variables[119] = 8314.472 - variables[120] = 310.0 - variables[122] = 0.0 - variables[123] = -35.0 - variables[124] = 0.5 - variables[125] = 0.5 - variables[126] = -45.0 - variables[128] = 0.00427 - variables[129] = 45.0 - variables[131] = 0.5927 - variables[135] = 0.0 - variables[141] = 0.0 - variables[144] = 0.0223 - variables[146] = 0.0 - variables[150] = 1.0e-5 - variables[157] = 0.1539e-3 - variables[163] = 0.4578 - variables[169] = -16.4508 - variables[170] = 4.3371 - variables[177] = 0.0 - variables[178] = 0.0 - variables[181] = 0.000338 - variables[183] = 0.0075 - variables[184] = 0.04132 - variables[189] = 0.0 - variables[190] = 3.5e-3 - variables[195] = 0.00424 - variables[204] = 0.00065 - variables[211] = 1.0 - variables[212] = 0.00345 + constants[0] = 0.0 + constants[1] = 0.0 + 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 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): - variables[3] = variables[119]*variables[120]/variables[17] - variables[6] = variables[3]*log(variables[7]/variables[8]) - variables[20] = 1.2 if gt_func(variables[1], 0.0) else 1.0 - variables[35] = variables[4]/(variables[47]+variables[4]) - variables[68] = -0.25 if gt_func(variables[1], 0.0) else 0.7*variables[0]/(0.00009+variables[0]) if gt_func(variables[0], 0.0) else 0.0 - variables[69] = variables[70]*(1.0-variables[68]) - variables[103] = 0.000000001*3.14159265358979*pow(variables[105], 2.0)*variables[104] - variables[19] = 0.000000001*2.0*3.14159265358979*variables[106]*(variables[105]-variables[106]/2.0)*variables[104] - variables[100] = variables[107]*variables[103] - variables[18] = variables[108]*variables[103]-variables[19] - variables[99] = variables[109]*variables[103] - variables[127] = variables[128]/(variables[7]/(variables[7]+variables[129])) - variables[130] = variables[127]/(variables[131]+1.0) - variables[132] = variables[131]*variables[130] - variables[133] = variables[132]*variables[7]/(variables[7]+variables[129]) - variables[134] = variables[130]*variables[7]/(variables[7]+variables[129]) - variables[137] = -1.0-9.898*pow(1.0*variables[0], 0.618)/(pow(1.0*variables[0], 0.618)+0.00122423) if gt_func(variables[0], 0.0) else 0.0 - variables[138] = 7.5 if gt_func(variables[1], 0.0) else 0.0 - variables[162] = 1.23 if gt_func(variables[1], 0.0) else 1.0 - variables[165] = 0.31*variables[0]/(variables[0]+0.00009) - variables[166] = -8.0 if gt_func(variables[1], 0.0) else 0.0 - variables[167] = -27.0 if gt_func(variables[1], 0.0) else 0.0 - variables[203] = 1.2*variables[204] if gt_func(variables[1], 0.0) else variables[204] - variables[206] = -14.0 if gt_func(variables[1], 0.0) else 0.0 - variables[213] = (3.5988-0.025641)/(1.0+0.0000012155/pow(1.0*variables[0], 1.6951))+0.025641 + 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 def compute_rates(voi, states, rates, constants, computed_constants, algebraic): - variables[5] = states[1] - variables[142] = variables[3]*log((variables[4]+0.12*variables[7])/(variables[5]+0.12*variables[8])) - variables[121] = variables[123] if and_func(gt_func(voi, variables[124]), lt_func(voi, variables[124]+variables[125])) else variables[126] - variables[21] = variables[121] if geq_func(variables[122], 1.0) else states[15] - variables[143] = variables[144]*pow(states[18], 3.0)*states[17]*(variables[21]-variables[142]) - variables[145] = variables[146]*pow(states[18], 3.0)*(variables[21]-variables[142]) - variables[12] = variables[143]+variables[145] - variables[15] = 0.0000185*variables[163]*(variables[21]-0.0)/(variables[3]*(1.0-exp(-1.0*(variables[21]-0.0)/variables[3])))*(variables[5]-variables[4]*exp(-1.0*(variables[21]-0.0)/variables[3]))*states[23]*states[22]*states[21] - variables[2] = variables[3]*log(variables[4]/variables[5]) - variables[16] = states[16]*variables[133]*(variables[21]-variables[2])*(1.0-variables[135]) - variables[14] = variables[20]*variables[24]*pow(1.0+pow(variables[23]/variables[7], 1.2), -1.0)*pow(1.0+pow(variables[22]/variables[5], 1.3), -1.0)*pow(1.0+exp(-(variables[21]-variables[2]+110.0)/20.0), -1.0) - variables[50] = 1.0+variables[10]/variables[48]*(1.0+exp(variables[49]*variables[21]/variables[3]))+variables[4]/variables[51]*(1.0+variables[4]/variables[52]*(1.0+variables[4]/variables[47])) - variables[27] = variables[10]/variables[48]*exp(variables[49]*variables[21]/variables[3])/variables[50] - variables[42] = 1.0+states[0]/variables[40]*(1.0+exp(-variables[41]*variables[21]/variables[3])+variables[5]/variables[46])+variables[5]/variables[43]*(1.0+variables[5]/variables[44]*(1.0+variables[5]/variables[39])) - variables[29] = states[0]/variables[40]*exp(-variables[41]*variables[21]/variables[3])/variables[42] - variables[36] = variables[5]/(variables[39]+variables[5]) - variables[37] = exp(variables[45]*variables[21]/(2.0*variables[3])) - variables[33] = exp(-variables[45]*variables[21]/(2.0*variables[3])) - variables[38] = variables[5]/variables[43]*variables[5]/variables[44]*(1.0+variables[5]/variables[39])*exp(variables[45]*variables[21]/(2.0*variables[3]))/variables[42] - variables[26] = variables[37]*variables[36]*(variables[38]+variables[29])+variables[33]*variables[29]*(variables[35]+variables[37]) - variables[34] = variables[4]/variables[51]*variables[4]/variables[52]*(1.0+variables[4]/variables[47])*exp(-variables[45]*variables[21]/(2.0*variables[3]))/variables[50] - variables[28] = variables[33]*variables[35]*(variables[34]+variables[27])+variables[27]*variables[37]*(variables[36]+variables[33]) - variables[31] = variables[34]*variables[35]*(variables[38]+variables[29])+variables[38]*variables[27]*(variables[35]+variables[37]) - variables[32] = variables[38]*variables[36]*(variables[34]+variables[27])+variables[29]*variables[34]*(variables[36]+variables[33]) - variables[13] = (1.0-variables[25])*variables[30]*(variables[26]*variables[27]-variables[28]*variables[29])/(variables[28]+variables[26]+variables[32]+variables[31]) - rates[1] = (1.0-variables[11])*-1.0*(variables[12]+variables[16]+variables[15]+3.0*variables[14]+3.0*variables[13])/(1.0*(variables[18]+variables[19])*variables[17]) - variables[56] = variables[57]-(variables[57]-variables[58])/(1.0+pow(variables[59]/states[2], variables[60])) - variables[63] = variables[64]*variables[56] - variables[61] = variables[62]/variables[56] - rates[4] = variables[65]*states[5]-variables[63]*states[0]*states[4]-(variables[61]*pow(states[0], 2.0)*states[4]-variables[66]*states[3]) - rates[3] = variables[61]*pow(states[0], 2.0)*states[4]-variables[66]*states[3]-(variables[63]*states[0]*states[3]-variables[65]*states[6]) - rates[6] = variables[63]*states[0]*states[3]-variables[65]*states[6]-(variables[66]*states[6]-variables[61]*pow(states[0], 2.0)*states[5]) - rates[5] = variables[66]*states[6]-variables[61]*pow(states[0], 2.0)*states[5]-(variables[65]*states[5]-variables[63]*states[0]*states[4]) - variables[78] = variables[79]*states[7]*(1.0-states[9])-variables[80]*states[9] - rates[9] = variables[78] - variables[81] = variables[82]*states[7]*(1.0-(states[10]+states[11]))-variables[83]*states[10] - rates[10] = variables[81] - variables[84] = variables[85]*variables[86]*(1.0-(states[10]+states[11]))-variables[87]*states[11] - rates[11] = variables[84] - variables[88] = variables[89]*states[7]*(1.0-states[12])-variables[90]*states[12] - rates[12] = variables[88] - variables[91] = variables[89]*states[0]*(1.0-states[13])-variables[90]*states[13] - rates[13] = variables[91] - variables[92] = variables[93]*states[2]*(1.0-states[14])-variables[94]*states[14] - rates[14] = variables[92] - variables[71] = (states[0]-states[7])/variables[72] - variables[73] = variables[69]/(1.0+exp((-states[7]+variables[74])/variables[75])) - rates[7] = 1.0*(variables[71]*variables[19]-variables[73]*variables[99])/variables[18]-(variables[97]*variables[88]+variables[95]*variables[78]+variables[96]*variables[81]) - variables[53] = variables[54]*states[3]*(states[2]-states[0]) - variables[101] = 2.0*variables[163]*(variables[21]-0.0)/(variables[3]*(1.0-exp(-1.0*(variables[21]-0.0)*2.0/variables[3])))*(states[0]-variables[10]*exp(-2.0*(variables[21]-0.0)/variables[3]))*states[23]*states[22]*states[21] - variables[102] = 2.0*variables[184]*variables[21]/(variables[3]*(1.0-exp(-1.0*variables[21]*2.0/variables[3])))*(states[0]-variables[10]*exp(-2.0*variables[21]/variables[3]))*states[25]*states[24] - rates[0] = variables[53]*variables[100]/variables[19]-((variables[101]+variables[102]-2.0*variables[13])/(2.0*variables[17]*variables[19])+variables[71]+variables[97]*variables[91]) - variables[76] = (states[8]-states[2])/variables[77] - rates[8] = variables[73]-variables[76]*variables[100]/variables[99] - rates[2] = variables[76]-(variables[53]+variables[98]*variables[92]) - variables[136] = states[16]*variables[134]*(variables[21]-variables[6])*(1.0-variables[135]) - variables[111] = variables[16]+variables[136] - variables[112] = variables[157]*states[20]*states[19]*(variables[21]-variables[6]) - variables[113] = variables[211]*variables[212]*(variables[21]-variables[6])*(1.0+exp((variables[21]+20.0)/20.0))*states[32] if gt_func(variables[0], 0.0) else 0.0 - variables[164] = 0.000365*variables[163]*(variables[21]-0.0)/(variables[3]*(1.0-exp(-1.0*(variables[21]-0.0)/variables[3])))*(variables[8]-variables[7]*exp(-1.0*(variables[21]-0.0)/variables[3]))*states[23]*states[22]*states[21] - variables[114] = (variables[101]+variables[164]+variables[15])*(1.0-variables[165])*1.0*variables[162] - variables[115] = variables[190]*(variables[21]-variables[6])*states[27]*states[26] - variables[205] = variables[3]*log((variables[7]+0.12*variables[4])/(variables[8]+0.12*variables[5])) - variables[116] = variables[203]*(variables[21]-variables[205])*pow(states[31], 2.0) - variables[117] = variables[195]*(variables[21]-variables[6])*(0.9*states[29]+0.1*states[30])*states[28] - variables[110] = variables[111]+variables[117]+variables[116]+variables[115]+variables[14]+variables[13]+variables[12]+variables[114]+variables[102]+variables[113]+variables[112] - rates[15] = -variables[110]/variables[118] - variables[140] = 0.01329+0.99921/(1.0+exp((variables[21]+97.134-variables[137]-variables[138]-variables[141])/8.1752)) if lt_func(variables[21], -(80.0-variables[137]-variables[138]-variables[141])) else 0.0002501*exp(-(variables[21]-variables[137]-variables[138]-variables[141])/12.861) - variables[139] = 1.0/(0.36*(variables[21]+148.8-variables[137]-variables[138])/(exp(0.066*(variables[21]+148.8-variables[137]-variables[138]))-1.0)+0.1*(variables[21]+87.3-variables[137]-variables[138])/(1.0-exp(-0.2*(variables[21]+87.3-variables[137]-variables[138]))))-0.054 - rates[16] = (variables[140]-states[16])/variables[139] - variables[147] = 1.0/(1.0+exp(-(variables[21]+42.0504)/8.3106)) - variables[148] = variables[21]+41.0 - variables[149] = 2000.0 if lt_func(fabs(variables[148]), variables[150]) else 200.0*variables[148]/(1.0-exp(-0.1*variables[148])) - variables[151] = 8000.0*exp(-0.056*(variables[21]+66.0)) - variables[152] = 1.0/(variables[149]+variables[151]) - rates[18] = (variables[147]-states[18])/variables[152] - variables[153] = 1.0/(1.0+exp((variables[21]+69.804)/4.4565)) - variables[154] = 20.0*exp(-0.125*(variables[21]+75.0)) - variables[155] = 2000.0/(320.0*exp(-0.1*(variables[21]+75.0))+1.0) - variables[156] = 1.0/(variables[154]+variables[155]) - rates[17] = (variables[153]-states[17])/variables[156] - variables[158] = 1.0/(1.0+exp((variables[21]+6.0)/-8.6)) - variables[159] = 0.009/(1.0+exp((variables[21]+5.0)/12.0))+0.0005 - rates[20] = (variables[158]-states[20])/variables[159] - variables[160] = 1.0/(1.0+exp((variables[21]+7.5)/10.0)) - variables[161] = 0.59/(1.0+exp((variables[21]+60.0)/10.0))+3.05 - rates[19] = (variables[160]-states[19])/variables[161] - variables[168] = 1.0/(1.0+exp(-(variables[21]-variables[169]-variables[166])/(variables[170]*(1.0+variables[167]/100.0)))) - variables[174] = -41.80001 if eq_func(variables[21], -41.8) else 0.0 if eq_func(variables[21], 0.0) else -6.80001 if eq_func(variables[21], -6.8) else variables[21] - variables[172] = -0.02839*(variables[174]+41.8)/(exp(-(variables[174]+41.8)/2.5)-1.0)-0.0849*(variables[174]+6.8)/(exp(-(variables[174]+6.8)/4.8)-1.0) - variables[175] = -1.80001 if eq_func(variables[21], -1.8) else variables[21] - variables[173] = 0.01143*(variables[175]+1.8)/(exp((variables[175]+1.8)/2.5)-1.0) - variables[171] = 0.001/(variables[172]+variables[173]) - rates[23] = (variables[168]-states[23])/variables[171] - variables[176] = 1.0/(1.0+exp((variables[21]+37.4+variables[177])/(5.3+variables[178]))) - variables[179] = 0.001*(44.3+230.0*exp(-pow((variables[21]+36.0)/10.0, 2.0))) - rates[22] = (variables[176]-states[22])/variables[179] - variables[180] = variables[181]/(variables[181]+states[0]) - variables[182] = 0.001*variables[180]/variables[183] - rates[21] = (variables[180]-states[21])/variables[182] - variables[185] = 1.0/(1.0+exp(-(variables[21]+38.3)/5.5)) - variables[186] = 0.001/(1.068*exp((variables[21]+38.3)/30.0)+1.068*exp(-(variables[21]+38.3)/30.0)) - rates[25] = (variables[185]-states[25])/variables[186] - variables[187] = 1.0/(1.0+exp((variables[21]+58.7)/3.8)) - variables[188] = 1.0/(16.67*exp(-(variables[21]+75.0)/83.3)+16.67*exp((variables[21]+75.0)/15.38))+variables[189] - rates[24] = (variables[187]-states[24])/variables[188] - variables[191] = 1.0/(1.0+exp((variables[21]+49.0)/13.0)) - variables[192] = 0.001*0.6*(65.17/(0.57*exp(-0.08*(variables[21]+44.0))+0.065*exp(0.1*(variables[21]+45.93)))+10.1) - rates[27] = (variables[191]-states[27])/variables[192] - variables[193] = 1.0/(1.0+exp(-(variables[21]-19.3)/15.0)) - variables[194] = 0.001*0.66*1.4*(15.59/(1.037*exp(0.09*(variables[21]+30.61))+0.369*exp(-0.12*(variables[21]+23.84)))+2.98) - rates[26] = (variables[193]-states[26])/variables[194] - variables[198] = 1.0/(1.0+exp(-(variables[21]+10.0144)/7.6607)) - variables[199] = 0.84655354/(4.2*exp(variables[21]/17.0)+0.15*exp(-variables[21]/21.6)) - rates[30] = (variables[198]-states[30])/variables[199] - variables[200] = 1.0/(30.0*exp(variables[21]/10.0)+exp(-variables[21]/12.0)) - rates[29] = (variables[198]-states[29])/variables[200] - variables[202] = 1.0/(1.0+exp((variables[21]+28.6)/17.1)) - variables[201] = 1.0/(100.0*exp(-variables[21]/54.645)+656.0*exp(variables[21]/106.157)) - rates[28] = (variables[202]-states[28])/variables[201] - variables[207] = sqrt(1.0/(1.0+exp(-(variables[21]+0.6383-variables[206])/10.7071))) - variables[209] = 28.0/(1.0+exp(-(variables[21]-40.0-variables[206])/3.0)) - variables[210] = 1.0*exp(-(variables[21]-variables[206]-5.0)/25.0) - variables[208] = 1.0/(variables[209]+variables[210]) - rates[31] = (variables[207]-states[31])/variables[208] - variables[214] = 10.0*exp(0.0133*(variables[21]+40.0)) - variables[215] = variables[213]/(variables[213]+variables[214]) - variables[216] = 1.0/(variables[213]+variables[214]) - rates[32] = (variables[215]-states[32])/variables[216] + 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] def compute_variables(voi, states, rates, constants, computed_constants, algebraic): - variables[5] = states[1] - variables[2] = variables[3]*log(variables[4]/variables[5]) - variables[9] = 0.5*variables[3]*log(variables[10]/states[0]) - variables[21] = variables[121] if geq_func(variables[122], 1.0) else states[15] - variables[14] = variables[20]*variables[24]*pow(1.0+pow(variables[23]/variables[7], 1.2), -1.0)*pow(1.0+pow(variables[22]/variables[5], 1.3), -1.0)*pow(1.0+exp(-(variables[21]-variables[2]+110.0)/20.0), -1.0) - variables[50] = 1.0+variables[10]/variables[48]*(1.0+exp(variables[49]*variables[21]/variables[3]))+variables[4]/variables[51]*(1.0+variables[4]/variables[52]*(1.0+variables[4]/variables[47])) - variables[27] = variables[10]/variables[48]*exp(variables[49]*variables[21]/variables[3])/variables[50] - variables[42] = 1.0+states[0]/variables[40]*(1.0+exp(-variables[41]*variables[21]/variables[3])+variables[5]/variables[46])+variables[5]/variables[43]*(1.0+variables[5]/variables[44]*(1.0+variables[5]/variables[39])) - variables[29] = states[0]/variables[40]*exp(-variables[41]*variables[21]/variables[3])/variables[42] - variables[36] = variables[5]/(variables[39]+variables[5]) - variables[37] = exp(variables[45]*variables[21]/(2.0*variables[3])) - variables[33] = exp(-variables[45]*variables[21]/(2.0*variables[3])) - variables[38] = variables[5]/variables[43]*variables[5]/variables[44]*(1.0+variables[5]/variables[39])*exp(variables[45]*variables[21]/(2.0*variables[3]))/variables[42] - variables[26] = variables[37]*variables[36]*(variables[38]+variables[29])+variables[33]*variables[29]*(variables[35]+variables[37]) - variables[34] = variables[4]/variables[51]*variables[4]/variables[52]*(1.0+variables[4]/variables[47])*exp(-variables[45]*variables[21]/(2.0*variables[3]))/variables[50] - variables[28] = variables[33]*variables[35]*(variables[34]+variables[27])+variables[27]*variables[37]*(variables[36]+variables[33]) - variables[31] = variables[34]*variables[35]*(variables[38]+variables[29])+variables[38]*variables[27]*(variables[35]+variables[37]) - variables[32] = variables[38]*variables[36]*(variables[34]+variables[27])+variables[29]*variables[34]*(variables[36]+variables[33]) - variables[13] = (1.0-variables[25])*variables[30]*(variables[26]*variables[27]-variables[28]*variables[29])/(variables[28]+variables[26]+variables[32]+variables[31]) - variables[53] = variables[54]*states[3]*(states[2]-states[0]) - variables[55] = states[2]-states[0] - variables[56] = variables[57]-(variables[57]-variables[58])/(1.0+pow(variables[59]/states[2], variables[60])) - variables[61] = variables[62]/variables[56] - variables[63] = variables[64]*variables[56] - variables[67] = states[4]+states[3]+states[6]+states[5] - variables[71] = (states[0]-states[7])/variables[72] - variables[73] = variables[69]/(1.0+exp((-states[7]+variables[74])/variables[75])) - variables[76] = (states[8]-states[2])/variables[77] - variables[78] = variables[79]*states[7]*(1.0-states[9])-variables[80]*states[9] - variables[81] = variables[82]*states[7]*(1.0-(states[10]+states[11]))-variables[83]*states[10] - variables[84] = variables[85]*variables[86]*(1.0-(states[10]+states[11]))-variables[87]*states[11] - variables[88] = variables[89]*states[7]*(1.0-states[12])-variables[90]*states[12] - variables[91] = variables[89]*states[0]*(1.0-states[13])-variables[90]*states[13] - variables[92] = variables[93]*states[2]*(1.0-states[14])-variables[94]*states[14] - variables[16] = states[16]*variables[133]*(variables[21]-variables[2])*(1.0-variables[135]) - variables[136] = states[16]*variables[134]*(variables[21]-variables[6])*(1.0-variables[135]) - variables[111] = variables[16]+variables[136] - variables[112] = variables[157]*states[20]*states[19]*(variables[21]-variables[6]) - variables[113] = variables[211]*variables[212]*(variables[21]-variables[6])*(1.0+exp((variables[21]+20.0)/20.0))*states[32] if gt_func(variables[0], 0.0) else 0.0 - variables[102] = 2.0*variables[184]*variables[21]/(variables[3]*(1.0-exp(-1.0*variables[21]*2.0/variables[3])))*(states[0]-variables[10]*exp(-2.0*variables[21]/variables[3]))*states[25]*states[24] - variables[101] = 2.0*variables[163]*(variables[21]-0.0)/(variables[3]*(1.0-exp(-1.0*(variables[21]-0.0)*2.0/variables[3])))*(states[0]-variables[10]*exp(-2.0*(variables[21]-0.0)/variables[3]))*states[23]*states[22]*states[21] - variables[15] = 0.0000185*variables[163]*(variables[21]-0.0)/(variables[3]*(1.0-exp(-1.0*(variables[21]-0.0)/variables[3])))*(variables[5]-variables[4]*exp(-1.0*(variables[21]-0.0)/variables[3]))*states[23]*states[22]*states[21] - variables[164] = 0.000365*variables[163]*(variables[21]-0.0)/(variables[3]*(1.0-exp(-1.0*(variables[21]-0.0)/variables[3])))*(variables[8]-variables[7]*exp(-1.0*(variables[21]-0.0)/variables[3]))*states[23]*states[22]*states[21] - variables[114] = (variables[101]+variables[164]+variables[15])*(1.0-variables[165])*1.0*variables[162] - variables[142] = variables[3]*log((variables[4]+0.12*variables[7])/(variables[5]+0.12*variables[8])) - variables[143] = variables[144]*pow(states[18], 3.0)*states[17]*(variables[21]-variables[142]) - variables[145] = variables[146]*pow(states[18], 3.0)*(variables[21]-variables[142]) - variables[12] = variables[143]+variables[145] - variables[115] = variables[190]*(variables[21]-variables[6])*states[27]*states[26] - variables[205] = variables[3]*log((variables[7]+0.12*variables[4])/(variables[8]+0.12*variables[5])) - variables[116] = variables[203]*(variables[21]-variables[205])*pow(states[31], 2.0) - variables[117] = variables[195]*(variables[21]-variables[6])*(0.9*states[29]+0.1*states[30])*states[28] - variables[110] = variables[111]+variables[117]+variables[116]+variables[115]+variables[14]+variables[13]+variables[12]+variables[114]+variables[102]+variables[113]+variables[112] - variables[139] = 1.0/(0.36*(variables[21]+148.8-variables[137]-variables[138])/(exp(0.066*(variables[21]+148.8-variables[137]-variables[138]))-1.0)+0.1*(variables[21]+87.3-variables[137]-variables[138])/(1.0-exp(-0.2*(variables[21]+87.3-variables[137]-variables[138]))))-0.054 - variables[140] = 0.01329+0.99921/(1.0+exp((variables[21]+97.134-variables[137]-variables[138]-variables[141])/8.1752)) if lt_func(variables[21], -(80.0-variables[137]-variables[138]-variables[141])) else 0.0002501*exp(-(variables[21]-variables[137]-variables[138]-variables[141])/12.861) - variables[147] = 1.0/(1.0+exp(-(variables[21]+42.0504)/8.3106)) - variables[148] = variables[21]+41.0 - variables[149] = 2000.0 if lt_func(fabs(variables[148]), variables[150]) else 200.0*variables[148]/(1.0-exp(-0.1*variables[148])) - variables[151] = 8000.0*exp(-0.056*(variables[21]+66.0)) - variables[152] = 1.0/(variables[149]+variables[151]) - variables[153] = 1.0/(1.0+exp((variables[21]+69.804)/4.4565)) - variables[154] = 20.0*exp(-0.125*(variables[21]+75.0)) - variables[155] = 2000.0/(320.0*exp(-0.1*(variables[21]+75.0))+1.0) - variables[156] = 1.0/(variables[154]+variables[155]) - variables[158] = 1.0/(1.0+exp((variables[21]+6.0)/-8.6)) - variables[159] = 0.009/(1.0+exp((variables[21]+5.0)/12.0))+0.0005 - variables[160] = 1.0/(1.0+exp((variables[21]+7.5)/10.0)) - variables[161] = 0.59/(1.0+exp((variables[21]+60.0)/10.0))+3.05 - variables[168] = 1.0/(1.0+exp(-(variables[21]-variables[169]-variables[166])/(variables[170]*(1.0+variables[167]/100.0)))) - variables[174] = -41.80001 if eq_func(variables[21], -41.8) else 0.0 if eq_func(variables[21], 0.0) else -6.80001 if eq_func(variables[21], -6.8) else variables[21] - variables[172] = -0.02839*(variables[174]+41.8)/(exp(-(variables[174]+41.8)/2.5)-1.0)-0.0849*(variables[174]+6.8)/(exp(-(variables[174]+6.8)/4.8)-1.0) - variables[175] = -1.80001 if eq_func(variables[21], -1.8) else variables[21] - variables[173] = 0.01143*(variables[175]+1.8)/(exp((variables[175]+1.8)/2.5)-1.0) - variables[171] = 0.001/(variables[172]+variables[173]) - variables[176] = 1.0/(1.0+exp((variables[21]+37.4+variables[177])/(5.3+variables[178]))) - variables[179] = 0.001*(44.3+230.0*exp(-pow((variables[21]+36.0)/10.0, 2.0))) - variables[180] = variables[181]/(variables[181]+states[0]) - variables[182] = 0.001*variables[180]/variables[183] - variables[185] = 1.0/(1.0+exp(-(variables[21]+38.3)/5.5)) - variables[186] = 0.001/(1.068*exp((variables[21]+38.3)/30.0)+1.068*exp(-(variables[21]+38.3)/30.0)) - variables[187] = 1.0/(1.0+exp((variables[21]+58.7)/3.8)) - variables[188] = 1.0/(16.67*exp(-(variables[21]+75.0)/83.3)+16.67*exp((variables[21]+75.0)/15.38))+variables[189] - variables[191] = 1.0/(1.0+exp((variables[21]+49.0)/13.0)) - variables[192] = 0.001*0.6*(65.17/(0.57*exp(-0.08*(variables[21]+44.0))+0.065*exp(0.1*(variables[21]+45.93)))+10.1) - variables[193] = 1.0/(1.0+exp(-(variables[21]-19.3)/15.0)) - variables[194] = 0.001*0.66*1.4*(15.59/(1.037*exp(0.09*(variables[21]+30.61))+0.369*exp(-0.12*(variables[21]+23.84)))+2.98) - variables[196] = 1.0/(1.0+exp(-(variables[21]+23.2)/6.6))/(0.84655354/(37.2*exp(variables[21]/11.9)+0.96*exp(-variables[21]/18.5))) - variables[197] = 4.0*((37.2*exp(variables[21]/15.9)+0.96*exp(-variables[21]/22.5))/0.84655354-1.0/(1.0+exp(-(variables[21]+23.2)/10.6))/(0.84655354/(37.2*exp(variables[21]/15.9)+0.96*exp(-variables[21]/22.5)))) - variables[198] = 1.0/(1.0+exp(-(variables[21]+10.0144)/7.6607)) - variables[199] = 0.84655354/(4.2*exp(variables[21]/17.0)+0.15*exp(-variables[21]/21.6)) - variables[200] = 1.0/(30.0*exp(variables[21]/10.0)+exp(-variables[21]/12.0)) - variables[201] = 1.0/(100.0*exp(-variables[21]/54.645)+656.0*exp(variables[21]/106.157)) - variables[202] = 1.0/(1.0+exp((variables[21]+28.6)/17.1)) - variables[207] = sqrt(1.0/(1.0+exp(-(variables[21]+0.6383-variables[206])/10.7071))) - variables[209] = 28.0/(1.0+exp(-(variables[21]-40.0-variables[206])/3.0)) - variables[210] = 1.0*exp(-(variables[21]-variables[206]-5.0)/25.0) - variables[208] = 1.0/(variables[209]+variables[210]) - variables[214] = 10.0*exp(0.0133*(variables[21]+40.0)) - variables[215] = variables[213]/(variables[213]+variables[214]) - variables[216] = 1.0/(variables[213]+variables[214]) + 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]) 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 d2856f1c0d..2290241662 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) { - variables[1] = 0.0; - variables[2] = 1.0; - variables[3] = 1.0309347; - variables[5] = 2.0e-5; - variables[6] = 6.5e-5; - variables[22] = 8314.0; - variables[23] = 310.0; - variables[24] = 96845.0; - variables[26] = 5.8e-5; - variables[27] = 0.000189; - variables[28] = 5.8e-5; - variables[29] = 0.000189; - variables[30] = 5.81818e-5; - variables[31] = 0.0001888; - variables[34] = 2.52e-5; - variables[35] = 8.19e-5; - variables[36] = 2.52e-5; - variables[37] = 8.19e-5; - variables[38] = 2.523636e-5; - variables[39] = 8.1892e-5; - variables[42] = 1.32e-5; - variables[43] = 4.3e-5; - variables[44] = 1.323e-5; - variables[45] = 4.29e-5; - variables[46] = 1.3236e-5; - variables[47] = 4.2952e-5; - variables[50] = 2.7e-6; - variables[51] = 8.8e-6; - variables[52] = 2.8e-6; - variables[53] = 8.8e-6; - variables[54] = 2.7229e-6; - variables[55] = 8.83584e-6; - variables[56] = 8.0; - variables[57] = 0.5; - variables[58] = 2.0; - variables[59] = 140.0; - variables[60] = 0.0001; - variables[61] = 0.0001; - variables[63] = 0.0478; - variables[64] = 0.16; - variables[65] = 0.0478; - variables[66] = 0.16; - variables[67] = 0.04782545; - variables[68] = 0.1551936; - variables[69] = 5.4; - variables[70] = 0.621; - variables[71] = 5.64; - variables[73] = 0.0; - variables[74] = 0.0; - variables[75] = 0.0042; - variables[76] = 0.03339; - variables[77] = 0.0; - variables[78] = 0.0; - variables[79] = 140.0; - variables[82] = 0.0; - variables[83] = 1.2e-6; - variables[84] = 0.0; - variables[85] = 3.7e-7; - variables[86] = 0.0; - variables[87] = 1.204e-6; - variables[97] = 0.0058; - variables[98] = 0.0659; - variables[99] = 0.0082; - variables[100] = 0.0659; - variables[101] = 0.0057938; - variables[102] = 0.06588648; - variables[103] = 46.4; - variables[113] = 0.0043; - variables[114] = 0.0139; - variables[115] = 0.0021; - variables[116] = 0.00694; - variables[117] = 0.00427806; - variables[118] = 0.0138823; - variables[119] = 45.0; - variables[129] = 0.00491; - variables[130] = 0.03649; - variables[131] = 0.004905; - variables[132] = 0.0365; - variables[133] = 0.004905; - variables[134] = 0.036495; - variables[136] = 6.65e-5; - variables[137] = 0.0114; - variables[138] = 0.000266; - variables[139] = 0.0114; - variables[140] = 6.645504e-5; - variables[141] = 0.01138376; - variables[147] = 0.000797; - variables[148] = 0.016; - variables[149] = 0.000738; - variables[150] = 0.0208; - variables[151] = 0.00079704; - variables[152] = 0.016; - variables[161] = 0.000518; - variables[162] = 0.0104; - variables[163] = 0.000345; - variables[164] = 0.0104; - variables[165] = 0.0003445; - variables[166] = 0.0104; - variables[170] = 0.000548; - variables[171] = 0.0069; - variables[172] = 0.000437; - variables[173] = 0.0055; - variables[174] = 0.0005465; - variables[175] = 0.006875; - variables[177] = 0.000548; - variables[178] = 0.0069; - variables[179] = 0.000437; - variables[180] = 0.0055; - variables[181] = 0.0005465; - variables[182] = 0.006875; + 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; 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) { - variables[0] = (variables[2] == 0.0)?1.07*(3.0*variables[1]-0.1)/(3.0*(1.0+0.7745*exp(-(3.0*variables[1]-2.05)/0.295))):(variables[2] == 1.0)?variables[3]*variables[1]/(1.0+0.7745*exp(-(3.0*variables[1]-2.05)/0.295)):1.07*29.0*variables[1]/(30.0*(1.0+0.7745*exp(-(29.0*variables[1]-24.5)/1.95))); - variables[4] = variables[5]+variables[0]*(variables[6]-variables[5]); - variables[25] = (variables[2] == 0.0)?variables[26]+variables[0]*(variables[27]-variables[26]):(variables[2] == 1.0)?variables[30]+variables[0]*(variables[31]-variables[30]):variables[28]+variables[0]*(variables[29]-variables[28]); - variables[33] = (variables[2] == 0.0)?variables[34]+variables[0]*(variables[35]-variables[34]):(variables[2] == 1.0)?variables[38]+variables[0]*(variables[39]-variables[38]):variables[36]+variables[0]*(variables[37]-variables[36]); - variables[41] = (variables[2] == 0.0)?variables[42]+variables[0]*(variables[43]-variables[42]):(variables[2] == 1.0)?variables[46]+variables[0]*(variables[47]-variables[46]):variables[44]+variables[0]*(variables[45]-variables[44]); - variables[49] = (variables[2] == 0.0)?variables[50]+variables[0]*(variables[51]-variables[50]):(variables[2] == 1.0)?variables[54]+variables[0]*(variables[55]-variables[54]):variables[52]+variables[0]*(variables[53]-variables[52]); - variables[62] = (variables[2] == 0.0)?variables[63]+variables[0]*(variables[64]-variables[63]):(variables[2] == 1.0)?variables[67]+variables[0]*(variables[68]-variables[67]):variables[65]+variables[0]*(variables[66]-variables[65]); - variables[72] = (variables[2] == 0.0)?variables[73]+variables[0]*(variables[74]-variables[73]):(variables[2] == 1.0)?variables[77]+variables[0]*(variables[78]-variables[77]):variables[75]+variables[0]*(variables[76]-variables[75]); - variables[8] = variables[72]*variables[60]/(variables[60]+0.0004); - variables[32] = variables[22]*variables[23]/variables[24]*log(variables[59]/variables[56]); - variables[40] = variables[22]*variables[23]/variables[24]*log(variables[69]/variables[79]); - variables[48] = variables[22]*variables[23]/(2.0*variables[24])*log(variables[58]/variables[60]); - variables[80] = (variables[2] == 0.0)?variables[22]*variables[23]/variables[24]*log((variables[69]+0.12*variables[59])/(variables[79]+0.12*variables[56])):variables[22]*variables[23]/variables[24]*log((variables[69]+0.03*variables[59])/(variables[79]+0.03*variables[56])); - variables[81] = (variables[2] == 0.0)?variables[82]+variables[0]*(variables[83]-variables[82]):(variables[2] == 1.0)?variables[86]+variables[0]*(variables[87]-variables[86]):variables[84]+variables[0]*(variables[85]-variables[84]); - variables[96] = (variables[2] == 0.0)?variables[97]+variables[0]*(variables[98]-variables[97]):(variables[2] == 1.0)?variables[101]+variables[0]*(variables[102]-variables[101]):variables[99]+variables[0]*(variables[100]-variables[99]); - variables[112] = (variables[2] == 0.0)?variables[113]+variables[0]*(variables[114]-variables[113]):(variables[2] == 1.0)?variables[117]+variables[0]*(variables[118]-variables[117]):variables[115]+variables[0]*(variables[116]-variables[115]); - variables[128] = (variables[2] == 0.0)?variables[129]+variables[0]*(variables[130]-variables[129]):(variables[2] == 1.0)?variables[133]+variables[0]*(variables[134]-variables[133]):variables[131]+variables[0]*(variables[132]-variables[131]); - variables[135] = (variables[2] == 0.0)?variables[136]+variables[0]*(variables[137]-variables[136]):(variables[2] == 1.0)?variables[140]+variables[0]*(variables[141]-variables[140]):variables[138]+variables[0]*(variables[139]-variables[138]); - variables[146] = (variables[2] == 0.0)?variables[147]+variables[0]*(variables[148]-variables[147]):(variables[2] == 1.0)?variables[151]+variables[0]*(variables[152]-variables[151]):variables[149]+variables[0]*(variables[150]-variables[149]); - variables[158] = (variables[2] == 0.0)?0.002:(variables[2] == 1.0)?0.002:0.006; - variables[160] = (variables[2] == 0.0)?variables[161]+variables[0]*(variables[162]-variables[161]):(variables[2] == 1.0)?variables[165]+variables[0]*(variables[166]-variables[165]):variables[163]+variables[0]*(variables[164]-variables[163]); - variables[169] = (variables[2] == 0.0)?variables[170]+variables[0]*(variables[171]-variables[170]):(variables[2] == 1.0)?variables[174]+variables[0]*(variables[175]-variables[174]):variables[172]+variables[0]*(variables[173]-variables[172]); - variables[176] = (variables[2] == 0.0)?variables[177]+variables[0]*(variables[178]-variables[177]):(variables[2] == 1.0)?variables[181]+variables[0]*(variables[182]-variables[181]):variables[179]+variables[0]*(variables[180]-variables[179]); + 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]); } void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic) { - variables[9] = variables[62]*pow(variables[56]/(variables[71]+variables[56]), 3.0)*pow(variables[69]/(variables[70]+variables[69]), 2.0)*1.6/(1.5+exp(-(states[0]+60.0)/40.0)); - variables[10] = (variables[2] == 0.0)?variables[49]*(pow(variables[56], 3.0)*variables[58]*exp(0.03743*states[0]*variables[57])-pow(variables[59], 3.0)*variables[60]*exp(0.0374*states[0]*(variables[57]-1.0)))/(1.0+variables[61]*(variables[60]*pow(variables[59], 3.0)+variables[58]*pow(variables[56], 3.0))):variables[49]*(pow(variables[56], 3.0)*variables[58]*exp(0.03743*states[0]*variables[57])-pow(variables[59], 3.0)*variables[60]*exp(0.03743*states[0]*(variables[57]-1.0)))/(1.0+variables[61]*(variables[60]*pow(variables[59], 3.0)+variables[58]*pow(variables[56], 3.0))); - variables[14] = (variables[2] != 2.0)?variables[176]*states[14]*(states[0]-variables[40]):variables[176]*states[14]*(states[0]+102.0); - variables[15] = (variables[2] != 2.0)?variables[169]*states[14]*(states[0]-variables[32]):variables[169]*states[14]*(states[0]-77.6); - variables[16] = variables[160]*pow(states[13], 2.0)*(states[0]-variables[80]); - variables[18] = variables[135]*states[8]*(states[0]-variables[40]); - variables[19] = variables[128]*states[9]*states[8]*(states[0]-variables[40]); - variables[20] = variables[112]*states[7]*states[6]*(states[0]-variables[119]); - variables[21] = variables[96]*(states[4]*states[5]+0.006/(1.0+exp(-(states[0]+14.1)/6.0)))*(states[0]-variables[103]); - variables[91] = (variables[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; - variables[88] = (1.0-variables[91])*states[2]+variables[91]*states[3]; - variables[7] = variables[81]*pow(states[1], 3.0)*variables[88]*variables[59]*pow(variables[24], 2.0)/(variables[22]*variables[23])*(exp((states[0]-variables[32])*variables[24]/(variables[22]*variables[23]))-1.0)/(exp(states[0]*variables[24]/(variables[22]*variables[23]))-1.0)*states[0]; - variables[11] = variables[33]*(states[0]-variables[40]); - variables[12] = variables[41]*(states[0]-variables[48]); - variables[13] = variables[25]*(states[0]-variables[32]); - variables[153] = 0.6*states[11]+0.4*states[12]; - variables[17] = variables[146]*variables[153]*states[10]*(states[0]-variables[40]); - rates[0] = -1.0/variables[4]*(variables[7]+variables[21]+variables[20]+variables[19]+variables[18]+variables[17]+variables[16]+variables[15]+variables[14]+variables[13]+variables[12]+variables[11]+variables[10]+variables[9]+variables[8]); - variables[89] = (variables[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); - variables[90] = (variables[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] = (variables[89]-states[1])/variables[90]; - variables[92] = 1.0/(1.0+exp((states[0]+66.1)/6.4)); - variables[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] = (variables[92]-states[2])/variables[93]; - variables[94] = variables[92]; - variables[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] = (variables[94]-states[3])/variables[95]; - variables[104] = (variables[2] == 0.0)?1.0/(1.0+exp(-(states[0]+23.1)/6.0)):(variables[2] == 1.0)?1.0/(1.0+exp(-(states[0]+22.3+0.8*variables[0])/6.0)):1.0/(1.0+exp(-(states[0]+22.2)/6.0)); - variables[106] = (variables[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):(variables[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); - variables[107] = (variables[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); - variables[105] = 2.0/(variables[106]+variables[107]); - rates[5] = (variables[104]-states[5])/variables[105]; - variables[108] = 1.0/(1.0+exp((states[0]+45.0)/5.0)); - variables[110] = (variables[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); - variables[111] = (variables[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)); - variables[109] = (variables[2] == 1.0)?(1.2-0.2*variables[0])/(variables[110]+variables[111]):1.0/(variables[110]+variables[111]); - rates[4] = (variables[108]-states[4])/variables[109]; - variables[120] = 1.0/(1.0+exp(-(states[0]+37.0)/6.8)); - variables[122] = 1068.0*exp((states[0]+26.3)/30.0); - variables[123] = 1068.0*exp(-(states[0]+26.3)/30.0); - variables[121] = 1.0/(variables[122]+variables[123]); - rates[7] = (variables[120]-states[7])/variables[121]; - variables[124] = 1.0/(1.0+exp((states[0]+71.0)/9.0)); - variables[126] = (variables[2] == 1.0)?15.3*exp(-(states[0]+71.0+0.7*variables[0])/83.3):15.3*exp(-(states[0]+71.7)/83.3); - variables[127] = (variables[2] == 1.0)?15.0*exp((states[0]+71.0)/15.38):15.0*exp((states[0]+71.7)/15.38); - variables[125] = 1.0/(variables[126]+variables[127]); - rates[6] = (variables[124]-states[6])/variables[125]; - variables[142] = 1.0/(1.0+exp((states[0]+59.37)/13.1)); - variables[143] = (variables[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)):(variables[2] == 1.0)?0.001/3.0*(30.31+195.5/(0.5686*exp(-0.08161*(states[0]+39.0+10.0*variables[0]))+0.7174*exp((0.2719-0.1719*variables[0])*1.0*(states[0]+40.93+10.0*variables[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] = (variables[142]-states[9])/variables[143]; - variables[144] = 1.0/(1.0+exp(-(states[0]-10.93)/19.7)); - variables[145] = (variables[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)))):(variables[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] = (variables[144]-states[8])/variables[145]; - variables[154] = (variables[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)); - variables[155] = (variables[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] = (variables[154]-states[11])/variables[155]; - variables[156] = variables[154]; - variables[157] = (variables[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] = (variables[156]-states[12])/variables[157]; - variables[159] = 1.0/(1.0+exp((states[0]+18.6)/10.1)); - rates[10] = (variables[159]-states[10])/variables[158]; - variables[167] = 14.0/(1.0+exp(-(states[0]-40.0)/9.0)); - variables[168] = 1.0*exp(-states[0]/45.0); - rates[13] = variables[167]*(1.0-states[13])-variables[168]*states[13]; - variables[183] = (variables[2] == 0.0)?1.0*exp(-(states[0]+78.91)/26.62):1.0*exp(-(states[0]+78.91)/26.63); - variables[184] = 1.0*exp((states[0]+75.13)/21.25); - rates[14] = variables[183]*(1.0-states[14])-variables[184]*states[14]; + 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]; } void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic) { - variables[13] = variables[25]*(states[0]-variables[32]); - variables[11] = variables[33]*(states[0]-variables[40]); - variables[12] = variables[41]*(states[0]-variables[48]); - variables[10] = (variables[2] == 0.0)?variables[49]*(pow(variables[56], 3.0)*variables[58]*exp(0.03743*states[0]*variables[57])-pow(variables[59], 3.0)*variables[60]*exp(0.0374*states[0]*(variables[57]-1.0)))/(1.0+variables[61]*(variables[60]*pow(variables[59], 3.0)+variables[58]*pow(variables[56], 3.0))):variables[49]*(pow(variables[56], 3.0)*variables[58]*exp(0.03743*states[0]*variables[57])-pow(variables[59], 3.0)*variables[60]*exp(0.03743*states[0]*(variables[57]-1.0)))/(1.0+variables[61]*(variables[60]*pow(variables[59], 3.0)+variables[58]*pow(variables[56], 3.0))); - variables[9] = variables[62]*pow(variables[56]/(variables[71]+variables[56]), 3.0)*pow(variables[69]/(variables[70]+variables[69]), 2.0)*1.6/(1.5+exp(-(states[0]+60.0)/40.0)); - variables[91] = (variables[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; - variables[88] = (1.0-variables[91])*states[2]+variables[91]*states[3]; - variables[7] = variables[81]*pow(states[1], 3.0)*variables[88]*variables[59]*pow(variables[24], 2.0)/(variables[22]*variables[23])*(exp((states[0]-variables[32])*variables[24]/(variables[22]*variables[23]))-1.0)/(exp(states[0]*variables[24]/(variables[22]*variables[23]))-1.0)*states[0]; - variables[89] = (variables[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); - variables[90] = (variables[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; - variables[92] = 1.0/(1.0+exp((states[0]+66.1)/6.4)); - variables[94] = variables[92]; - variables[93] = 3.717e-6*exp(-0.2815*(states[0]+17.11))/(1.0+0.003732*exp(-0.3426*(states[0]+37.76)))+0.0005977; - variables[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; - variables[21] = variables[96]*(states[4]*states[5]+0.006/(1.0+exp(-(states[0]+14.1)/6.0)))*(states[0]-variables[103]); - variables[106] = (variables[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):(variables[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); - variables[107] = (variables[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); - variables[105] = 2.0/(variables[106]+variables[107]); - variables[104] = (variables[2] == 0.0)?1.0/(1.0+exp(-(states[0]+23.1)/6.0)):(variables[2] == 1.0)?1.0/(1.0+exp(-(states[0]+22.3+0.8*variables[0])/6.0)):1.0/(1.0+exp(-(states[0]+22.2)/6.0)); - variables[110] = (variables[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); - variables[111] = (variables[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)); - variables[109] = (variables[2] == 1.0)?(1.2-0.2*variables[0])/(variables[110]+variables[111]):1.0/(variables[110]+variables[111]); - variables[108] = 1.0/(1.0+exp((states[0]+45.0)/5.0)); - variables[20] = variables[112]*states[7]*states[6]*(states[0]-variables[119]); - variables[122] = 1068.0*exp((states[0]+26.3)/30.0); - variables[123] = 1068.0*exp(-(states[0]+26.3)/30.0); - variables[121] = 1.0/(variables[122]+variables[123]); - variables[120] = 1.0/(1.0+exp(-(states[0]+37.0)/6.8)); - variables[126] = (variables[2] == 1.0)?15.3*exp(-(states[0]+71.0+0.7*variables[0])/83.3):15.3*exp(-(states[0]+71.7)/83.3); - variables[127] = (variables[2] == 1.0)?15.0*exp((states[0]+71.0)/15.38):15.0*exp((states[0]+71.7)/15.38); - variables[125] = 1.0/(variables[126]+variables[127]); - variables[124] = 1.0/(1.0+exp((states[0]+71.0)/9.0)); - variables[19] = variables[128]*states[9]*states[8]*(states[0]-variables[40]); - variables[18] = variables[135]*states[8]*(states[0]-variables[40]); - variables[142] = 1.0/(1.0+exp((states[0]+59.37)/13.1)); - variables[143] = (variables[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)):(variables[2] == 1.0)?0.001/3.0*(30.31+195.5/(0.5686*exp(-0.08161*(states[0]+39.0+10.0*variables[0]))+0.7174*exp((0.2719-0.1719*variables[0])*1.0*(states[0]+40.93+10.0*variables[0])))):0.0101+0.06517/(0.5686*exp(-0.08161*(states[0]+39.0))+0.7174*exp(0.2719*(states[0]+40.93))); - variables[144] = 1.0/(1.0+exp(-(states[0]-10.93)/19.7)); - variables[145] = (variables[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)))):(variables[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)))); - variables[153] = 0.6*states[11]+0.4*states[12]; - variables[17] = variables[146]*variables[153]*states[10]*(states[0]-variables[40]); - variables[154] = (variables[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)); - variables[155] = (variables[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)); - variables[156] = variables[154]; - variables[157] = (variables[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)); - variables[159] = 1.0/(1.0+exp((states[0]+18.6)/10.1)); - variables[16] = variables[160]*pow(states[13], 2.0)*(states[0]-variables[80]); - variables[167] = 14.0/(1.0+exp(-(states[0]-40.0)/9.0)); - variables[168] = 1.0*exp(-states[0]/45.0); - variables[15] = (variables[2] != 2.0)?variables[169]*states[14]*(states[0]-variables[32]):variables[169]*states[14]*(states[0]-77.6); - variables[14] = (variables[2] != 2.0)?variables[176]*states[14]*(states[0]-variables[40]):variables[176]*states[14]*(states[0]+102.0); - variables[183] = (variables[2] == 0.0)?1.0*exp(-(states[0]+78.91)/26.62):1.0*exp(-(states[0]+78.91)/26.63); - variables[184] = 1.0*exp((states[0]+75.13)/21.25); + 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); } 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 4a43aaffe1..241a885d14 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): - variables[1] = 0.0 - variables[2] = 1.0 - variables[3] = 1.0309347 - variables[5] = 2.0e-5 - variables[6] = 6.5e-5 - variables[22] = 8314.0 - variables[23] = 310.0 - variables[24] = 96845.0 - variables[26] = 5.8e-5 - variables[27] = 0.000189 - variables[28] = 5.8e-5 - variables[29] = 0.000189 - variables[30] = 5.81818e-5 - variables[31] = 0.0001888 - variables[34] = 2.52e-5 - variables[35] = 8.19e-5 - variables[36] = 2.52e-5 - variables[37] = 8.19e-5 - variables[38] = 2.523636e-5 - variables[39] = 8.1892e-5 - variables[42] = 1.32e-5 - variables[43] = 4.3e-5 - variables[44] = 1.323e-5 - variables[45] = 4.29e-5 - variables[46] = 1.3236e-5 - variables[47] = 4.2952e-5 - variables[50] = 2.7e-6 - variables[51] = 8.8e-6 - variables[52] = 2.8e-6 - variables[53] = 8.8e-6 - variables[54] = 2.7229e-6 - variables[55] = 8.83584e-6 - variables[56] = 8.0 - variables[57] = 0.5 - variables[58] = 2.0 - variables[59] = 140.0 - variables[60] = 0.0001 - variables[61] = 0.0001 - variables[63] = 0.0478 - variables[64] = 0.16 - variables[65] = 0.0478 - variables[66] = 0.16 - variables[67] = 0.04782545 - variables[68] = 0.1551936 - variables[69] = 5.4 - variables[70] = 0.621 - variables[71] = 5.64 - variables[73] = 0.0 - variables[74] = 0.0 - variables[75] = 0.0042 - variables[76] = 0.03339 - variables[77] = 0.0 - variables[78] = 0.0 - variables[79] = 140.0 - variables[82] = 0.0 - variables[83] = 1.2e-6 - variables[84] = 0.0 - variables[85] = 3.7e-7 - variables[86] = 0.0 - variables[87] = 1.204e-6 - variables[97] = 0.0058 - variables[98] = 0.0659 - variables[99] = 0.0082 - variables[100] = 0.0659 - variables[101] = 0.0057938 - variables[102] = 0.06588648 - variables[103] = 46.4 - variables[113] = 0.0043 - variables[114] = 0.0139 - variables[115] = 0.0021 - variables[116] = 0.00694 - variables[117] = 0.00427806 - variables[118] = 0.0138823 - variables[119] = 45.0 - variables[129] = 0.00491 - variables[130] = 0.03649 - variables[131] = 0.004905 - variables[132] = 0.0365 - variables[133] = 0.004905 - variables[134] = 0.036495 - variables[136] = 6.65e-5 - variables[137] = 0.0114 - variables[138] = 0.000266 - variables[139] = 0.0114 - variables[140] = 6.645504e-5 - variables[141] = 0.01138376 - variables[147] = 0.000797 - variables[148] = 0.016 - variables[149] = 0.000738 - variables[150] = 0.0208 - variables[151] = 0.00079704 - variables[152] = 0.016 - variables[161] = 0.000518 - variables[162] = 0.0104 - variables[163] = 0.000345 - variables[164] = 0.0104 - variables[165] = 0.0003445 - variables[166] = 0.0104 - variables[170] = 0.000548 - variables[171] = 0.0069 - variables[172] = 0.000437 - variables[173] = 0.0055 - variables[174] = 0.0005465 - variables[175] = 0.006875 - variables[177] = 0.000548 - variables[178] = 0.0069 - variables[179] = 0.000437 - variables[180] = 0.0055 - variables[181] = 0.0005465 - variables[182] = 0.006875 + 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 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): - variables[0] = 1.07*(3.0*variables[1]-0.1)/(3.0*(1.0+0.7745*exp(-(3.0*variables[1]-2.05)/0.295))) if eq_func(variables[2], 0.0) else variables[3]*variables[1]/(1.0+0.7745*exp(-(3.0*variables[1]-2.05)/0.295)) if eq_func(variables[2], 1.0) else 1.07*29.0*variables[1]/(30.0*(1.0+0.7745*exp(-(29.0*variables[1]-24.5)/1.95))) - variables[4] = variables[5]+variables[0]*(variables[6]-variables[5]) - variables[25] = variables[26]+variables[0]*(variables[27]-variables[26]) if eq_func(variables[2], 0.0) else variables[30]+variables[0]*(variables[31]-variables[30]) if eq_func(variables[2], 1.0) else variables[28]+variables[0]*(variables[29]-variables[28]) - variables[33] = variables[34]+variables[0]*(variables[35]-variables[34]) if eq_func(variables[2], 0.0) else variables[38]+variables[0]*(variables[39]-variables[38]) if eq_func(variables[2], 1.0) else variables[36]+variables[0]*(variables[37]-variables[36]) - variables[41] = variables[42]+variables[0]*(variables[43]-variables[42]) if eq_func(variables[2], 0.0) else variables[46]+variables[0]*(variables[47]-variables[46]) if eq_func(variables[2], 1.0) else variables[44]+variables[0]*(variables[45]-variables[44]) - variables[49] = variables[50]+variables[0]*(variables[51]-variables[50]) if eq_func(variables[2], 0.0) else variables[54]+variables[0]*(variables[55]-variables[54]) if eq_func(variables[2], 1.0) else variables[52]+variables[0]*(variables[53]-variables[52]) - variables[62] = variables[63]+variables[0]*(variables[64]-variables[63]) if eq_func(variables[2], 0.0) else variables[67]+variables[0]*(variables[68]-variables[67]) if eq_func(variables[2], 1.0) else variables[65]+variables[0]*(variables[66]-variables[65]) - variables[72] = variables[73]+variables[0]*(variables[74]-variables[73]) if eq_func(variables[2], 0.0) else variables[77]+variables[0]*(variables[78]-variables[77]) if eq_func(variables[2], 1.0) else variables[75]+variables[0]*(variables[76]-variables[75]) - variables[8] = variables[72]*variables[60]/(variables[60]+0.0004) - variables[32] = variables[22]*variables[23]/variables[24]*log(variables[59]/variables[56]) - variables[40] = variables[22]*variables[23]/variables[24]*log(variables[69]/variables[79]) - variables[48] = variables[22]*variables[23]/(2.0*variables[24])*log(variables[58]/variables[60]) - variables[80] = variables[22]*variables[23]/variables[24]*log((variables[69]+0.12*variables[59])/(variables[79]+0.12*variables[56])) if eq_func(variables[2], 0.0) else variables[22]*variables[23]/variables[24]*log((variables[69]+0.03*variables[59])/(variables[79]+0.03*variables[56])) - variables[81] = variables[82]+variables[0]*(variables[83]-variables[82]) if eq_func(variables[2], 0.0) else variables[86]+variables[0]*(variables[87]-variables[86]) if eq_func(variables[2], 1.0) else variables[84]+variables[0]*(variables[85]-variables[84]) - variables[96] = variables[97]+variables[0]*(variables[98]-variables[97]) if eq_func(variables[2], 0.0) else variables[101]+variables[0]*(variables[102]-variables[101]) if eq_func(variables[2], 1.0) else variables[99]+variables[0]*(variables[100]-variables[99]) - variables[112] = variables[113]+variables[0]*(variables[114]-variables[113]) if eq_func(variables[2], 0.0) else variables[117]+variables[0]*(variables[118]-variables[117]) if eq_func(variables[2], 1.0) else variables[115]+variables[0]*(variables[116]-variables[115]) - variables[128] = variables[129]+variables[0]*(variables[130]-variables[129]) if eq_func(variables[2], 0.0) else variables[133]+variables[0]*(variables[134]-variables[133]) if eq_func(variables[2], 1.0) else variables[131]+variables[0]*(variables[132]-variables[131]) - variables[135] = variables[136]+variables[0]*(variables[137]-variables[136]) if eq_func(variables[2], 0.0) else variables[140]+variables[0]*(variables[141]-variables[140]) if eq_func(variables[2], 1.0) else variables[138]+variables[0]*(variables[139]-variables[138]) - variables[146] = variables[147]+variables[0]*(variables[148]-variables[147]) if eq_func(variables[2], 0.0) else variables[151]+variables[0]*(variables[152]-variables[151]) if eq_func(variables[2], 1.0) else variables[149]+variables[0]*(variables[150]-variables[149]) - variables[158] = 0.002 if eq_func(variables[2], 0.0) else 0.002 if eq_func(variables[2], 1.0) else 0.006 - variables[160] = variables[161]+variables[0]*(variables[162]-variables[161]) if eq_func(variables[2], 0.0) else variables[165]+variables[0]*(variables[166]-variables[165]) if eq_func(variables[2], 1.0) else variables[163]+variables[0]*(variables[164]-variables[163]) - variables[169] = variables[170]+variables[0]*(variables[171]-variables[170]) if eq_func(variables[2], 0.0) else variables[174]+variables[0]*(variables[175]-variables[174]) if eq_func(variables[2], 1.0) else variables[172]+variables[0]*(variables[173]-variables[172]) - variables[176] = variables[177]+variables[0]*(variables[178]-variables[177]) if eq_func(variables[2], 0.0) else variables[181]+variables[0]*(variables[182]-variables[181]) if eq_func(variables[2], 1.0) else variables[179]+variables[0]*(variables[180]-variables[179]) + 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]) def compute_rates(voi, states, rates, constants, computed_constants, algebraic): - variables[9] = variables[62]*pow(variables[56]/(variables[71]+variables[56]), 3.0)*pow(variables[69]/(variables[70]+variables[69]), 2.0)*1.6/(1.5+exp(-(states[0]+60.0)/40.0)) - variables[10] = variables[49]*(pow(variables[56], 3.0)*variables[58]*exp(0.03743*states[0]*variables[57])-pow(variables[59], 3.0)*variables[60]*exp(0.0374*states[0]*(variables[57]-1.0)))/(1.0+variables[61]*(variables[60]*pow(variables[59], 3.0)+variables[58]*pow(variables[56], 3.0))) if eq_func(variables[2], 0.0) else variables[49]*(pow(variables[56], 3.0)*variables[58]*exp(0.03743*states[0]*variables[57])-pow(variables[59], 3.0)*variables[60]*exp(0.03743*states[0]*(variables[57]-1.0)))/(1.0+variables[61]*(variables[60]*pow(variables[59], 3.0)+variables[58]*pow(variables[56], 3.0))) - variables[14] = variables[176]*states[14]*(states[0]-variables[40]) if neq_func(variables[2], 2.0) else variables[176]*states[14]*(states[0]+102.0) - variables[15] = variables[169]*states[14]*(states[0]-variables[32]) if neq_func(variables[2], 2.0) else variables[169]*states[14]*(states[0]-77.6) - variables[16] = variables[160]*pow(states[13], 2.0)*(states[0]-variables[80]) - variables[18] = variables[135]*states[8]*(states[0]-variables[40]) - variables[19] = variables[128]*states[9]*states[8]*(states[0]-variables[40]) - variables[20] = variables[112]*states[7]*states[6]*(states[0]-variables[119]) - variables[21] = variables[96]*(states[4]*states[5]+0.006/(1.0+exp(-(states[0]+14.1)/6.0)))*(states[0]-variables[103]) - variables[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(variables[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 - variables[88] = (1.0-variables[91])*states[2]+variables[91]*states[3] - variables[7] = variables[81]*pow(states[1], 3.0)*variables[88]*variables[59]*pow(variables[24], 2.0)/(variables[22]*variables[23])*(exp((states[0]-variables[32])*variables[24]/(variables[22]*variables[23]))-1.0)/(exp(states[0]*variables[24]/(variables[22]*variables[23]))-1.0)*states[0] - variables[11] = variables[33]*(states[0]-variables[40]) - variables[12] = variables[41]*(states[0]-variables[48]) - variables[13] = variables[25]*(states[0]-variables[32]) - variables[153] = 0.6*states[11]+0.4*states[12] - variables[17] = variables[146]*variables[153]*states[10]*(states[0]-variables[40]) - rates[0] = -1.0/variables[4]*(variables[7]+variables[21]+variables[20]+variables[19]+variables[18]+variables[17]+variables[16]+variables[15]+variables[14]+variables[13]+variables[12]+variables[11]+variables[10]+variables[9]+variables[8]) - variables[89] = pow(1.0/(1.0+exp(-states[0]/5.46)), 1.0/3.0) if eq_func(variables[2], 0.0) else pow(1.0/(1.0+exp(-(states[0]+30.32)/5.46)), 1.0/3.0) - variables[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(variables[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] = (variables[89]-states[1])/variables[90] - variables[92] = 1.0/(1.0+exp((states[0]+66.1)/6.4)) - variables[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] = (variables[92]-states[2])/variables[93] - variables[94] = variables[92] - variables[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] = (variables[94]-states[3])/variables[95] - variables[104] = 1.0/(1.0+exp(-(states[0]+23.1)/6.0)) if eq_func(variables[2], 0.0) else 1.0/(1.0+exp(-(states[0]+22.3+0.8*variables[0])/6.0)) if eq_func(variables[2], 1.0) else 1.0/(1.0+exp(-(states[0]+22.2)/6.0)) - variables[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(variables[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(variables[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) - variables[107] = 11.43*(states[0]-5.0)/(exp(0.4*(states[0]-5.0))-1.0) if eq_func(variables[2], 1.0) else 11.42*(states[0]-5.0)/(exp(0.4*(states[0]-5.0))-1.0) - variables[105] = 2.0/(variables[106]+variables[107]) - rates[5] = (variables[104]-states[5])/variables[105] - variables[108] = 1.0/(1.0+exp((states[0]+45.0)/5.0)) - variables[110] = 3.75*(states[0]+28.0)/(exp((states[0]+28.0)/4.0)-1.0) if eq_func(variables[2], 1.0) else 3.12*(states[0]+28.0)/(exp((states[0]+28.0)/4.0)-1.0) - variables[111] = 30.0/(1.0+exp(-(states[0]+28.0)/4.0)) if eq_func(variables[2], 1.0) else 25.0/(1.0+exp(-(states[0]+28.0)/4.0)) - variables[109] = (1.2-0.2*variables[0])/(variables[110]+variables[111]) if eq_func(variables[2], 1.0) else 1.0/(variables[110]+variables[111]) - rates[4] = (variables[108]-states[4])/variables[109] - variables[120] = 1.0/(1.0+exp(-(states[0]+37.0)/6.8)) - variables[122] = 1068.0*exp((states[0]+26.3)/30.0) - variables[123] = 1068.0*exp(-(states[0]+26.3)/30.0) - variables[121] = 1.0/(variables[122]+variables[123]) - rates[7] = (variables[120]-states[7])/variables[121] - variables[124] = 1.0/(1.0+exp((states[0]+71.0)/9.0)) - variables[126] = 15.3*exp(-(states[0]+71.0+0.7*variables[0])/83.3) if eq_func(variables[2], 1.0) else 15.3*exp(-(states[0]+71.7)/83.3) - variables[127] = 15.0*exp((states[0]+71.0)/15.38) if eq_func(variables[2], 1.0) else 15.0*exp((states[0]+71.7)/15.38) - variables[125] = 1.0/(variables[126]+variables[127]) - rates[6] = (variables[124]-states[6])/variables[125] - variables[142] = 1.0/(1.0+exp((states[0]+59.37)/13.1)) - variables[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(variables[2], 0.0) else 0.001/3.0*(30.31+195.5/(0.5686*exp(-0.08161*(states[0]+39.0+10.0*variables[0]))+0.7174*exp((0.2719-0.1719*variables[0])*1.0*(states[0]+40.93+10.0*variables[0])))) if eq_func(variables[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] = (variables[142]-states[9])/variables[143] - variables[144] = 1.0/(1.0+exp(-(states[0]-10.93)/19.7)) - variables[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(variables[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(variables[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] = (variables[144]-states[8])/variables[145] - variables[154] = 1.0/(1.0+exp(-(states[0]+14.2)/10.6)) if neq_func(variables[2], 2.0) else 1.0/(1.0+exp(-(states[0]+13.2)/10.6)) - variables[155] = 1.0/(37.2*exp((states[0]-9.0)/15.9)+0.96*exp(-(states[0]-9.0)/22.5)) if neq_func(variables[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] = (variables[154]-states[11])/variables[155] - variables[156] = variables[154] - variables[157] = 1.0/(4.2*exp((states[0]-9.0)/17.0)+0.15*exp(-(states[0]-9.0)/21.6)) if neq_func(variables[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] = (variables[156]-states[12])/variables[157] - variables[159] = 1.0/(1.0+exp((states[0]+18.6)/10.1)) - rates[10] = (variables[159]-states[10])/variables[158] - variables[167] = 14.0/(1.0+exp(-(states[0]-40.0)/9.0)) - variables[168] = 1.0*exp(-states[0]/45.0) - rates[13] = variables[167]*(1.0-states[13])-variables[168]*states[13] - variables[183] = 1.0*exp(-(states[0]+78.91)/26.62) if eq_func(variables[2], 0.0) else 1.0*exp(-(states[0]+78.91)/26.63) - variables[184] = 1.0*exp((states[0]+75.13)/21.25) - rates[14] = variables[183]*(1.0-states[14])-variables[184]*states[14] + 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] def compute_variables(voi, states, rates, constants, computed_constants, algebraic): - variables[13] = variables[25]*(states[0]-variables[32]) - variables[11] = variables[33]*(states[0]-variables[40]) - variables[12] = variables[41]*(states[0]-variables[48]) - variables[10] = variables[49]*(pow(variables[56], 3.0)*variables[58]*exp(0.03743*states[0]*variables[57])-pow(variables[59], 3.0)*variables[60]*exp(0.0374*states[0]*(variables[57]-1.0)))/(1.0+variables[61]*(variables[60]*pow(variables[59], 3.0)+variables[58]*pow(variables[56], 3.0))) if eq_func(variables[2], 0.0) else variables[49]*(pow(variables[56], 3.0)*variables[58]*exp(0.03743*states[0]*variables[57])-pow(variables[59], 3.0)*variables[60]*exp(0.03743*states[0]*(variables[57]-1.0)))/(1.0+variables[61]*(variables[60]*pow(variables[59], 3.0)+variables[58]*pow(variables[56], 3.0))) - variables[9] = variables[62]*pow(variables[56]/(variables[71]+variables[56]), 3.0)*pow(variables[69]/(variables[70]+variables[69]), 2.0)*1.6/(1.5+exp(-(states[0]+60.0)/40.0)) - variables[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(variables[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 - variables[88] = (1.0-variables[91])*states[2]+variables[91]*states[3] - variables[7] = variables[81]*pow(states[1], 3.0)*variables[88]*variables[59]*pow(variables[24], 2.0)/(variables[22]*variables[23])*(exp((states[0]-variables[32])*variables[24]/(variables[22]*variables[23]))-1.0)/(exp(states[0]*variables[24]/(variables[22]*variables[23]))-1.0)*states[0] - variables[89] = pow(1.0/(1.0+exp(-states[0]/5.46)), 1.0/3.0) if eq_func(variables[2], 0.0) else pow(1.0/(1.0+exp(-(states[0]+30.32)/5.46)), 1.0/3.0) - variables[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(variables[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 - variables[92] = 1.0/(1.0+exp((states[0]+66.1)/6.4)) - variables[94] = variables[92] - variables[93] = 3.717e-6*exp(-0.2815*(states[0]+17.11))/(1.0+0.003732*exp(-0.3426*(states[0]+37.76)))+0.0005977 - variables[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 - variables[21] = variables[96]*(states[4]*states[5]+0.006/(1.0+exp(-(states[0]+14.1)/6.0)))*(states[0]-variables[103]) - variables[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(variables[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(variables[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) - variables[107] = 11.43*(states[0]-5.0)/(exp(0.4*(states[0]-5.0))-1.0) if eq_func(variables[2], 1.0) else 11.42*(states[0]-5.0)/(exp(0.4*(states[0]-5.0))-1.0) - variables[105] = 2.0/(variables[106]+variables[107]) - variables[104] = 1.0/(1.0+exp(-(states[0]+23.1)/6.0)) if eq_func(variables[2], 0.0) else 1.0/(1.0+exp(-(states[0]+22.3+0.8*variables[0])/6.0)) if eq_func(variables[2], 1.0) else 1.0/(1.0+exp(-(states[0]+22.2)/6.0)) - variables[110] = 3.75*(states[0]+28.0)/(exp((states[0]+28.0)/4.0)-1.0) if eq_func(variables[2], 1.0) else 3.12*(states[0]+28.0)/(exp((states[0]+28.0)/4.0)-1.0) - variables[111] = 30.0/(1.0+exp(-(states[0]+28.0)/4.0)) if eq_func(variables[2], 1.0) else 25.0/(1.0+exp(-(states[0]+28.0)/4.0)) - variables[109] = (1.2-0.2*variables[0])/(variables[110]+variables[111]) if eq_func(variables[2], 1.0) else 1.0/(variables[110]+variables[111]) - variables[108] = 1.0/(1.0+exp((states[0]+45.0)/5.0)) - variables[20] = variables[112]*states[7]*states[6]*(states[0]-variables[119]) - variables[122] = 1068.0*exp((states[0]+26.3)/30.0) - variables[123] = 1068.0*exp(-(states[0]+26.3)/30.0) - variables[121] = 1.0/(variables[122]+variables[123]) - variables[120] = 1.0/(1.0+exp(-(states[0]+37.0)/6.8)) - variables[126] = 15.3*exp(-(states[0]+71.0+0.7*variables[0])/83.3) if eq_func(variables[2], 1.0) else 15.3*exp(-(states[0]+71.7)/83.3) - variables[127] = 15.0*exp((states[0]+71.0)/15.38) if eq_func(variables[2], 1.0) else 15.0*exp((states[0]+71.7)/15.38) - variables[125] = 1.0/(variables[126]+variables[127]) - variables[124] = 1.0/(1.0+exp((states[0]+71.0)/9.0)) - variables[19] = variables[128]*states[9]*states[8]*(states[0]-variables[40]) - variables[18] = variables[135]*states[8]*(states[0]-variables[40]) - variables[142] = 1.0/(1.0+exp((states[0]+59.37)/13.1)) - variables[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(variables[2], 0.0) else 0.001/3.0*(30.31+195.5/(0.5686*exp(-0.08161*(states[0]+39.0+10.0*variables[0]))+0.7174*exp((0.2719-0.1719*variables[0])*1.0*(states[0]+40.93+10.0*variables[0])))) if eq_func(variables[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))) - variables[144] = 1.0/(1.0+exp(-(states[0]-10.93)/19.7)) - variables[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(variables[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(variables[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)))) - variables[153] = 0.6*states[11]+0.4*states[12] - variables[17] = variables[146]*variables[153]*states[10]*(states[0]-variables[40]) - variables[154] = 1.0/(1.0+exp(-(states[0]+14.2)/10.6)) if neq_func(variables[2], 2.0) else 1.0/(1.0+exp(-(states[0]+13.2)/10.6)) - variables[155] = 1.0/(37.2*exp((states[0]-9.0)/15.9)+0.96*exp(-(states[0]-9.0)/22.5)) if neq_func(variables[2], 2.0) else 1.0/(37.2*exp((states[0]-10.0)/15.9)+0.96*exp(-(states[0]-10.0)/22.5)) - variables[156] = variables[154] - variables[157] = 1.0/(4.2*exp((states[0]-9.0)/17.0)+0.15*exp(-(states[0]-9.0)/21.6)) if neq_func(variables[2], 2.0) else 1.0/(4.2*exp((states[0]-10.0)/17.0)+0.15*exp(-(states[0]-10.0)/21.6)) - variables[159] = 1.0/(1.0+exp((states[0]+18.6)/10.1)) - variables[16] = variables[160]*pow(states[13], 2.0)*(states[0]-variables[80]) - variables[167] = 14.0/(1.0+exp(-(states[0]-40.0)/9.0)) - variables[168] = 1.0*exp(-states[0]/45.0) - variables[15] = variables[169]*states[14]*(states[0]-variables[32]) if neq_func(variables[2], 2.0) else variables[169]*states[14]*(states[0]-77.6) - variables[14] = variables[176]*states[14]*(states[0]-variables[40]) if neq_func(variables[2], 2.0) else variables[176]*states[14]*(states[0]+102.0) - variables[183] = 1.0*exp(-(states[0]+78.91)/26.62) if eq_func(variables[2], 0.0) else 1.0*exp(-(states[0]+78.91)/26.63) - variables[184] = 1.0*exp((states[0]+75.13)/21.25) + 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) 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 b7a5b4fd4e..df6f7da7ae 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,53 +72,53 @@ void deleteArray(double *array) void initialiseVariables(double voi, double *states, double *rates, double *constants, ExternalVariable externalVariable) { - variables[4] = 1.0; - variables[5] = 0.0; - variables[7] = 0.3; - variables[9] = 120.0; - variables[15] = 36.0; + constants[4] = 1.0; + constants[5] = 0.0; + constants[7] = 0.3; + constants[9] = 120.0; + constants[15] = 36.0; states[0] = 0.0; states[1] = 0.6; states[2] = 0.05; states[3] = 0.325; - variables[0] = externalVariable(voi, states, rates, variables, 0); + algebraic[0] = externalVariable(voi, states, rates, variables, 0); } void computeComputedConstants(double *constants, double *computedConstants) { - variables[6] = variables[5]-10.613; - variables[8] = variables[5]-115.0; - variables[14] = variables[5]+12.0; + computedConstants[6] = constants[5]-10.613; + computedConstants[8] = constants[5]-115.0; + computedConstants[14] = constants[5]+12.0; } void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { - variables[0] = externalVariable(voi, states, rates, variables, 0); - variables[1] = variables[7]*(states[0]-variables[6]); - variables[2] = variables[15]*pow(states[3], 4.0)*(states[0]-variables[14]); - variables[3] = variables[9]*pow(states[2], 3.0)*states[1]*(states[0]-variables[8]); - rates[0] = -(-variables[0]+variables[3]+variables[2]+variables[1])/variables[4]; - variables[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0); - variables[11] = 4.0*exp(states[0]/18.0); - rates[2] = variables[10]*(1.0-states[2])-variables[11]*states[2]; - variables[12] = 0.07*exp(states[0]/20.0); - variables[13] = 1.0/(exp((states[0]+30.0)/10.0)+1.0); - rates[1] = variables[12]*(1.0-states[1])-variables[13]*states[1]; - variables[16] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0); - variables[17] = 0.125*exp(states[0]/80.0); - rates[3] = variables[16]*(1.0-states[3])-variables[17]*states[3]; + 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]; } void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { - variables[0] = externalVariable(voi, states, rates, variables, 0); - variables[1] = variables[7]*(states[0]-variables[6]); - variables[3] = variables[9]*pow(states[2], 3.0)*states[1]*(states[0]-variables[8]); - variables[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0); - variables[11] = 4.0*exp(states[0]/18.0); - variables[12] = 0.07*exp(states[0]/20.0); - variables[13] = 1.0/(exp((states[0]+30.0)/10.0)+1.0); - variables[2] = variables[15]*pow(states[3], 4.0)*(states[0]-variables[14]); - variables[16] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0); - variables[17] = 0.125*exp(states[0]/80.0); + 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); } 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 0b83a47b5b..e287d4bc52 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,49 +74,49 @@ def create_variables_array(): def initialise_variables(voi, states, rates, constants, external_variable): - variables[4] = 1.0 - variables[5] = 0.0 - variables[7] = 0.3 - variables[9] = 120.0 - variables[15] = 36.0 + constants[4] = 1.0 + constants[5] = 0.0 + constants[7] = 0.3 + constants[9] = 120.0 + constants[15] = 36.0 states[0] = 0.0 states[1] = 0.6 states[2] = 0.05 states[3] = 0.325 - variables[0] = external_variable(voi, states, rates, variables, 0) + algebraic[0] = external_variable(voi, states, rates, variables, 0) def compute_computed_constants(constants, computed_constants): - variables[6] = variables[5]-10.613 - variables[8] = variables[5]-115.0 - variables[14] = variables[5]+12.0 + computed_constants[6] = constants[5]-10.613 + computed_constants[8] = constants[5]-115.0 + computed_constants[14] = constants[5]+12.0 def compute_rates(voi, states, rates, constants, computed_constants, algebraic, external_variable): - variables[0] = external_variable(voi, states, rates, variables, 0) - variables[1] = variables[7]*(states[0]-variables[6]) - variables[2] = variables[15]*pow(states[3], 4.0)*(states[0]-variables[14]) - variables[3] = variables[9]*pow(states[2], 3.0)*states[1]*(states[0]-variables[8]) - rates[0] = -(-variables[0]+variables[3]+variables[2]+variables[1])/variables[4] - variables[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0) - variables[11] = 4.0*exp(states[0]/18.0) - rates[2] = variables[10]*(1.0-states[2])-variables[11]*states[2] - variables[12] = 0.07*exp(states[0]/20.0) - variables[13] = 1.0/(exp((states[0]+30.0)/10.0)+1.0) - rates[1] = variables[12]*(1.0-states[1])-variables[13]*states[1] - variables[16] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0) - variables[17] = 0.125*exp(states[0]/80.0) - rates[3] = variables[16]*(1.0-states[3])-variables[17]*states[3] + 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] def compute_variables(voi, states, rates, constants, computed_constants, algebraic, external_variable): - variables[0] = external_variable(voi, states, rates, variables, 0) - variables[1] = variables[7]*(states[0]-variables[6]) - variables[3] = variables[9]*pow(states[2], 3.0)*states[1]*(states[0]-variables[8]) - variables[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0) - variables[11] = 4.0*exp(states[0]/18.0) - variables[12] = 0.07*exp(states[0]/20.0) - variables[13] = 1.0/(exp((states[0]+30.0)/10.0)+1.0) - variables[2] = variables[15]*pow(states[3], 4.0)*(states[0]-variables[14]) - variables[16] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0) - variables[17] = 0.125*exp(states[0]/80.0) + 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) 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 11925369a1..0c24c18ef4 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) { - variables[4] = 1.0; - variables[5] = 0.0; - variables[7] = 0.3; - variables[9] = 120.0; - variables[15] = 36.0; + constants[4] = 1.0; + constants[5] = 0.0; + constants[7] = 0.3; + constants[9] = 120.0; + constants[15] = 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) { - variables[6] = variables[5]-10.613; - variables[8] = variables[5]-115.0; - variables[14] = variables[5]+12.0; + computedConstants[6] = constants[5]-10.613; + computedConstants[8] = constants[5]-115.0; + computedConstants[14] = constants[5]+12.0; } void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic) { - variables[0] = ((voi >= 10.0) && (voi <= 10.5))?-20.0:0.0; - variables[1] = variables[7]*(states[0]-variables[6]); - variables[2] = variables[15]*pow(states[3], 4.0)*(states[0]-variables[14]); - variables[3] = variables[9]*pow(states[2], 3.0)*states[1]*(states[0]-variables[8]); - rates[0] = -(-variables[0]+variables[3]+variables[2]+variables[1])/variables[4]; - variables[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0); - variables[11] = 4.0*exp(states[0]/18.0); - rates[2] = variables[10]*(1.0-states[2])-variables[11]*states[2]; - variables[12] = 0.07*exp(states[0]/20.0); - variables[13] = 1.0/(exp((states[0]+30.0)/10.0)+1.0); - rates[1] = variables[12]*(1.0-states[1])-variables[13]*states[1]; - variables[16] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0); - variables[17] = 0.125*exp(states[0]/80.0); - rates[3] = variables[16]*(1.0-states[3])-variables[17]*states[3]; + 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]; } void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic) { - variables[1] = variables[7]*(states[0]-variables[6]); - variables[3] = variables[9]*pow(states[2], 3.0)*states[1]*(states[0]-variables[8]); - variables[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0); - variables[11] = 4.0*exp(states[0]/18.0); - variables[12] = 0.07*exp(states[0]/20.0); - variables[13] = 1.0/(exp((states[0]+30.0)/10.0)+1.0); - variables[2] = variables[15]*pow(states[3], 4.0)*(states[0]-variables[14]); - variables[16] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0); - variables[17] = 0.125*exp(states[0]/80.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); } 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 122e1223d2..bf291e2fb4 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) { - variables[4] = 1.0; - variables[5] = 0.0; - variables[7] = 0.3; - variables[9] = 120.0; - variables[15] = 36.0; + constants[4] = 1.0; + constants[5] = 0.0; + constants[7] = 0.3; + constants[9] = 120.0; + constants[15] = 36.0; states[0] = 0.0; states[1] = 0.6; states[2] = 0.05; states[3] = 0.325; - variables[6] = externalVariable(voi, states, rates, variables, 6); + algebraic[6] = externalVariable(voi, states, rates, variables, 6); } void computeComputedConstants(double *constants, double *computedConstants) { - variables[8] = variables[5]-115.0; - variables[14] = variables[5]+12.0; + computedConstants[8] = constants[5]-115.0; + computedConstants[14] = constants[5]+12.0; } void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { - variables[0] = ((voi >= 10.0) && (voi <= 10.5))?-20.0:0.0; - variables[6] = externalVariable(voi, states, rates, variables, 6); - variables[1] = variables[7]*(states[0]-variables[6]); - variables[2] = variables[15]*pow(states[3], 4.0)*(states[0]-variables[14]); - variables[3] = variables[9]*pow(states[2], 3.0)*states[1]*(states[0]-variables[8]); - rates[0] = -(-variables[0]+variables[3]+variables[2]+variables[1])/variables[4]; - variables[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0); - variables[11] = 4.0*exp(states[0]/18.0); - rates[2] = variables[10]*(1.0-states[2])-variables[11]*states[2]; - variables[12] = 0.07*exp(states[0]/20.0); - variables[13] = 1.0/(exp((states[0]+30.0)/10.0)+1.0); - rates[1] = variables[12]*(1.0-states[1])-variables[13]*states[1]; - variables[16] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0); - variables[17] = 0.125*exp(states[0]/80.0); - rates[3] = variables[16]*(1.0-states[3])-variables[17]*states[3]; + 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]; } void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { - variables[6] = externalVariable(voi, states, rates, variables, 6); - variables[1] = variables[7]*(states[0]-variables[6]); - variables[3] = variables[9]*pow(states[2], 3.0)*states[1]*(states[0]-variables[8]); - variables[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0); - variables[11] = 4.0*exp(states[0]/18.0); - variables[12] = 0.07*exp(states[0]/20.0); - variables[13] = 1.0/(exp((states[0]+30.0)/10.0)+1.0); - variables[2] = variables[15]*pow(states[3], 4.0)*(states[0]-variables[14]); - variables[16] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0); - variables[17] = 0.125*exp(states[0]/80.0); + 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); } 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 a68331edb9..2a928ef7fa 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): - variables[4] = 1.0 - variables[5] = 0.0 - variables[7] = 0.3 - variables[9] = 120.0 - variables[15] = 36.0 + constants[4] = 1.0 + constants[5] = 0.0 + constants[7] = 0.3 + constants[9] = 120.0 + constants[15] = 36.0 states[0] = 0.0 states[1] = 0.6 states[2] = 0.05 states[3] = 0.325 - variables[6] = external_variable(voi, states, rates, variables, 6) + algebraic[6] = external_variable(voi, states, rates, variables, 6) def compute_computed_constants(constants, computed_constants): - variables[8] = variables[5]-115.0 - variables[14] = variables[5]+12.0 + computed_constants[8] = constants[5]-115.0 + computed_constants[14] = constants[5]+12.0 def compute_rates(voi, states, rates, constants, computed_constants, algebraic, external_variable): - variables[0] = -20.0 if and_func(geq_func(voi, 10.0), leq_func(voi, 10.5)) else 0.0 - variables[6] = external_variable(voi, states, rates, variables, 6) - variables[1] = variables[7]*(states[0]-variables[6]) - variables[2] = variables[15]*pow(states[3], 4.0)*(states[0]-variables[14]) - variables[3] = variables[9]*pow(states[2], 3.0)*states[1]*(states[0]-variables[8]) - rates[0] = -(-variables[0]+variables[3]+variables[2]+variables[1])/variables[4] - variables[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0) - variables[11] = 4.0*exp(states[0]/18.0) - rates[2] = variables[10]*(1.0-states[2])-variables[11]*states[2] - variables[12] = 0.07*exp(states[0]/20.0) - variables[13] = 1.0/(exp((states[0]+30.0)/10.0)+1.0) - rates[1] = variables[12]*(1.0-states[1])-variables[13]*states[1] - variables[16] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0) - variables[17] = 0.125*exp(states[0]/80.0) - rates[3] = variables[16]*(1.0-states[3])-variables[17]*states[3] + 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] def compute_variables(voi, states, rates, constants, computed_constants, algebraic, external_variable): - variables[6] = external_variable(voi, states, rates, variables, 6) - variables[1] = variables[7]*(states[0]-variables[6]) - variables[3] = variables[9]*pow(states[2], 3.0)*states[1]*(states[0]-variables[8]) - variables[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0) - variables[11] = 4.0*exp(states[0]/18.0) - variables[12] = 0.07*exp(states[0]/20.0) - variables[13] = 1.0/(exp((states[0]+30.0)/10.0)+1.0) - variables[2] = variables[15]*pow(states[3], 4.0)*(states[0]-variables[14]) - variables[16] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0) - variables[17] = 0.125*exp(states[0]/80.0) + 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) 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 074683762c..f3d7255142 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,53 +72,53 @@ void deleteArray(double *array) void initialiseVariables(double voi, double *states, double *rates, double *constants, ExternalVariable externalVariable) { - variables[5] = 0.0; - variables[7] = 0.3; - variables[9] = 120.0; - variables[15] = 36.0; + constants[5] = 0.0; + constants[7] = 0.3; + constants[9] = 120.0; + constants[15] = 36.0; states[0] = 0.0; states[1] = 0.6; states[2] = 0.05; states[3] = 0.325; - variables[4] = externalVariable(voi, states, rates, variables, 4); + algebraic[4] = externalVariable(voi, states, rates, variables, 4); } void computeComputedConstants(double *constants, double *computedConstants) { - variables[6] = variables[5]-10.613; - variables[8] = variables[5]-115.0; - variables[14] = variables[5]+12.0; + computedConstants[6] = constants[5]-10.613; + computedConstants[8] = constants[5]-115.0; + computedConstants[14] = constants[5]+12.0; } void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { - variables[0] = ((voi >= 10.0) && (voi <= 10.5))?-20.0:0.0; - variables[4] = externalVariable(voi, states, rates, variables, 4); - variables[1] = variables[7]*(states[0]-variables[6]); - variables[2] = variables[15]*pow(states[3], 4.0)*(states[0]-variables[14]); - variables[3] = variables[9]*pow(states[2], 3.0)*states[1]*(states[0]-variables[8]); - rates[0] = -(-variables[0]+variables[3]+variables[2]+variables[1])/variables[4]; - variables[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0); - variables[11] = 4.0*exp(states[0]/18.0); - rates[2] = variables[10]*(1.0-states[2])-variables[11]*states[2]; - variables[12] = 0.07*exp(states[0]/20.0); - variables[13] = 1.0/(exp((states[0]+30.0)/10.0)+1.0); - rates[1] = variables[12]*(1.0-states[1])-variables[13]*states[1]; - variables[16] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0); - variables[17] = 0.125*exp(states[0]/80.0); - rates[3] = variables[16]*(1.0-states[3])-variables[17]*states[3]; + 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]); + 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]; } void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { - variables[1] = variables[7]*(states[0]-variables[6]); - variables[3] = variables[9]*pow(states[2], 3.0)*states[1]*(states[0]-variables[8]); - variables[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0); - variables[11] = 4.0*exp(states[0]/18.0); - variables[12] = 0.07*exp(states[0]/20.0); - variables[13] = 1.0/(exp((states[0]+30.0)/10.0)+1.0); - variables[2] = variables[15]*pow(states[3], 4.0)*(states[0]-variables[14]); - variables[16] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0); - variables[17] = 0.125*exp(states[0]/80.0); - variables[4] = externalVariable(voi, states, rates, variables, 4); + 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[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 ea8e627d86..99304a266e 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,49 +74,49 @@ def create_variables_array(): def initialise_variables(voi, states, rates, constants, external_variable): - variables[5] = 0.0 - variables[7] = 0.3 - variables[9] = 120.0 - variables[15] = 36.0 + constants[5] = 0.0 + constants[7] = 0.3 + constants[9] = 120.0 + constants[15] = 36.0 states[0] = 0.0 states[1] = 0.6 states[2] = 0.05 states[3] = 0.325 - variables[4] = external_variable(voi, states, rates, variables, 4) + algebraic[4] = external_variable(voi, states, rates, variables, 4) def compute_computed_constants(constants, computed_constants): - variables[6] = variables[5]-10.613 - variables[8] = variables[5]-115.0 - variables[14] = variables[5]+12.0 + computed_constants[6] = constants[5]-10.613 + computed_constants[8] = constants[5]-115.0 + computed_constants[14] = constants[5]+12.0 def compute_rates(voi, states, rates, constants, computed_constants, algebraic, external_variable): - variables[0] = -20.0 if and_func(geq_func(voi, 10.0), leq_func(voi, 10.5)) else 0.0 - variables[4] = external_variable(voi, states, rates, variables, 4) - variables[1] = variables[7]*(states[0]-variables[6]) - variables[2] = variables[15]*pow(states[3], 4.0)*(states[0]-variables[14]) - variables[3] = variables[9]*pow(states[2], 3.0)*states[1]*(states[0]-variables[8]) - rates[0] = -(-variables[0]+variables[3]+variables[2]+variables[1])/variables[4] - variables[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0) - variables[11] = 4.0*exp(states[0]/18.0) - rates[2] = variables[10]*(1.0-states[2])-variables[11]*states[2] - variables[12] = 0.07*exp(states[0]/20.0) - variables[13] = 1.0/(exp((states[0]+30.0)/10.0)+1.0) - rates[1] = variables[12]*(1.0-states[1])-variables[13]*states[1] - variables[16] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0) - variables[17] = 0.125*exp(states[0]/80.0) - rates[3] = variables[16]*(1.0-states[3])-variables[17]*states[3] + 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]) + 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] def compute_variables(voi, states, rates, constants, computed_constants, algebraic, external_variable): - variables[1] = variables[7]*(states[0]-variables[6]) - variables[3] = variables[9]*pow(states[2], 3.0)*states[1]*(states[0]-variables[8]) - variables[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0) - variables[11] = 4.0*exp(states[0]/18.0) - variables[12] = 0.07*exp(states[0]/20.0) - variables[13] = 1.0/(exp((states[0]+30.0)/10.0)+1.0) - variables[2] = variables[15]*pow(states[3], 4.0)*(states[0]-variables[14]) - variables[16] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0) - variables[17] = 0.125*exp(states[0]/80.0) - variables[4] = external_variable(voi, states, rates, variables, 4) + 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[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 3dd59ed73c..79d7df0822 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 @@ -87,9 +87,9 @@ void objectiveFunction0(double *u, double *f, void *data) double *rates = ((RootFindingInfo *) data)->rates; double *variables = ((RootFindingInfo *) data)->variables; - variables[0] = u[0]; + algebraic[0] = u[0]; - f[0] = variables[0]-(((voi >= 10.0) && (voi <= 10.5))?-20.0:0.0)-0.0; + f[0] = algebraic[0]-(((voi >= 10.0) && (voi <= 10.5))?-20.0:0.0)-0.0; } void findRoot0(double voi, double *states, double *rates, double *variables) @@ -97,11 +97,11 @@ void findRoot0(double voi, double *states, double *rates, double *variables) RootFindingInfo rfi = { voi, states, rates, variables }; double u[1]; - u[0] = variables[0]; + u[0] = algebraic[0]; nlaSolve(objectiveFunction0, u, 1, &rfi); - variables[0] = u[0]; + algebraic[0] = u[0]; } void objectiveFunction1(double *u, double *f, void *data) @@ -113,7 +113,7 @@ void objectiveFunction1(double *u, double *f, void *data) rates[0] = u[0]; - f[0] = rates[0]-(-(-variables[0]+variables[3]+variables[2]+variables[1])/variables[4])-0.0; + f[0] = rates[0]-(-(-algebraic[0]+algebraic[3]+algebraic[2]+algebraic[1])/constants[4])-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; - variables[6] = u[0]; + computedConstants[6] = u[0]; - f[0] = variables[6]-(variables[5]-10.613)-0.0; + f[0] = computedConstants[6]-(constants[5]-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] = variables[6]; + u[0] = algebraic[6]; nlaSolve(objectiveFunction2, u, 1, &rfi); - variables[6] = u[0]; + algebraic[6] = u[0]; } void objectiveFunction3(double *u, double *f, void *data) @@ -159,9 +159,9 @@ void objectiveFunction3(double *u, double *f, void *data) double *rates = ((RootFindingInfo *) data)->rates; double *variables = ((RootFindingInfo *) data)->variables; - variables[1] = u[0]; + algebraic[1] = u[0]; - f[0] = variables[1]-variables[7]*(states[0]-variables[6])-0.0; + f[0] = algebraic[1]-constants[7]*(states[0]-computedConstants[6])-0.0; } void findRoot3(double voi, double *states, double *rates, double *variables) @@ -169,11 +169,11 @@ void findRoot3(double voi, double *states, double *rates, double *variables) RootFindingInfo rfi = { voi, states, rates, variables }; double u[1]; - u[0] = variables[1]; + u[0] = algebraic[1]; nlaSolve(objectiveFunction3, u, 1, &rfi); - variables[1] = u[0]; + algebraic[1] = u[0]; } void objectiveFunction4(double *u, double *f, void *data) @@ -183,9 +183,9 @@ void objectiveFunction4(double *u, double *f, void *data) double *rates = ((RootFindingInfo *) data)->rates; double *variables = ((RootFindingInfo *) data)->variables; - variables[8] = u[0]; + computedConstants[8] = u[0]; - f[0] = variables[8]-(variables[5]-115.0)-0.0; + f[0] = computedConstants[8]-(constants[5]-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] = variables[8]; + u[0] = algebraic[8]; nlaSolve(objectiveFunction4, u, 1, &rfi); - variables[8] = u[0]; + algebraic[8] = u[0]; } void objectiveFunction5(double *u, double *f, void *data) @@ -207,9 +207,9 @@ void objectiveFunction5(double *u, double *f, void *data) double *rates = ((RootFindingInfo *) data)->rates; double *variables = ((RootFindingInfo *) data)->variables; - variables[3] = u[0]; + algebraic[3] = u[0]; - f[0] = variables[3]-variables[9]*pow(states[2], 3.0)*states[1]*(states[0]-variables[8])-0.0; + f[0] = algebraic[3]-constants[9]*pow(states[2], 3.0)*states[1]*(states[0]-computedConstants[8])-0.0; } void findRoot5(double voi, double *states, double *rates, double *variables) @@ -217,11 +217,11 @@ void findRoot5(double voi, double *states, double *rates, double *variables) RootFindingInfo rfi = { voi, states, rates, variables }; double u[1]; - u[0] = variables[3]; + u[0] = algebraic[3]; nlaSolve(objectiveFunction5, u, 1, &rfi); - variables[3] = u[0]; + algebraic[3] = u[0]; } void objectiveFunction6(double *u, double *f, void *data) @@ -231,9 +231,9 @@ void objectiveFunction6(double *u, double *f, void *data) double *rates = ((RootFindingInfo *) data)->rates; double *variables = ((RootFindingInfo *) data)->variables; - variables[10] = u[0]; + algebraic[10] = u[0]; - f[0] = variables[10]-0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0)-0.0; + f[0] = algebraic[10]-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] = variables[10]; + u[0] = algebraic[10]; nlaSolve(objectiveFunction6, u, 1, &rfi); - variables[10] = u[0]; + algebraic[10] = 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; - variables[11] = u[0]; + algebraic[11] = u[0]; - f[0] = variables[11]-4.0*exp(states[0]/18.0)-0.0; + f[0] = algebraic[11]-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] = variables[11]; + u[0] = algebraic[11]; nlaSolve(objectiveFunction7, u, 1, &rfi); - variables[11] = u[0]; + algebraic[11] = 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]-(variables[10]*(1.0-states[2])-variables[11]*states[2])-0.0; + f[0] = rates[2]-(algebraic[10]*(1.0-states[2])-algebraic[11]*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; - variables[12] = u[0]; + algebraic[12] = u[0]; - f[0] = variables[12]-0.07*exp(states[0]/20.0)-0.0; + f[0] = algebraic[12]-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] = variables[12]; + u[0] = algebraic[12]; nlaSolve(objectiveFunction9, u, 1, &rfi); - variables[12] = u[0]; + algebraic[12] = 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; - variables[13] = u[0]; + algebraic[13] = u[0]; - f[0] = variables[13]-1.0/(exp((states[0]+30.0)/10.0)+1.0)-0.0; + f[0] = algebraic[13]-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] = variables[13]; + u[0] = algebraic[13]; nlaSolve(objectiveFunction10, u, 1, &rfi); - variables[13] = u[0]; + algebraic[13] = 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]-(variables[12]*(1.0-states[1])-variables[13]*states[1])-0.0; + f[0] = rates[1]-(algebraic[12]*(1.0-states[1])-algebraic[13]*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; - variables[14] = u[0]; + computedConstants[14] = u[0]; - f[0] = variables[14]-(variables[5]+12.0)-0.0; + f[0] = computedConstants[14]-(constants[5]+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] = variables[14]; + u[0] = algebraic[14]; nlaSolve(objectiveFunction12, u, 1, &rfi); - variables[14] = u[0]; + algebraic[14] = u[0]; } void objectiveFunction13(double *u, double *f, void *data) @@ -399,9 +399,9 @@ void objectiveFunction13(double *u, double *f, void *data) double *rates = ((RootFindingInfo *) data)->rates; double *variables = ((RootFindingInfo *) data)->variables; - variables[2] = u[0]; + algebraic[2] = u[0]; - f[0] = variables[2]-variables[15]*pow(states[3], 4.0)*(states[0]-variables[14])-0.0; + f[0] = algebraic[2]-constants[15]*pow(states[3], 4.0)*(states[0]-computedConstants[14])-0.0; } void findRoot13(double voi, double *states, double *rates, double *variables) @@ -409,11 +409,11 @@ void findRoot13(double voi, double *states, double *rates, double *variables) RootFindingInfo rfi = { voi, states, rates, variables }; double u[1]; - u[0] = variables[2]; + u[0] = algebraic[2]; nlaSolve(objectiveFunction13, u, 1, &rfi); - variables[2] = u[0]; + algebraic[2] = u[0]; } void objectiveFunction14(double *u, double *f, void *data) @@ -423,9 +423,9 @@ void objectiveFunction14(double *u, double *f, void *data) double *rates = ((RootFindingInfo *) data)->rates; double *variables = ((RootFindingInfo *) data)->variables; - variables[16] = u[0]; + algebraic[16] = u[0]; - f[0] = variables[16]-0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0)-0.0; + f[0] = algebraic[16]-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] = variables[16]; + u[0] = algebraic[16]; nlaSolve(objectiveFunction14, u, 1, &rfi); - variables[16] = u[0]; + algebraic[16] = 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; - variables[17] = u[0]; + algebraic[17] = u[0]; - f[0] = variables[17]-0.125*exp(states[0]/80.0)-0.0; + f[0] = algebraic[17]-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] = variables[17]; + u[0] = algebraic[17]; nlaSolve(objectiveFunction15, u, 1, &rfi); - variables[17] = u[0]; + algebraic[17] = 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]-(variables[16]*(1.0-states[3])-variables[17]*states[3])-0.0; + f[0] = rates[3]-(algebraic[16]*(1.0-states[3])-algebraic[17]*states[3])-0.0; } void findRoot16(double voi, double *states, double *rates, double *variables) @@ -490,24 +490,24 @@ void findRoot16(double voi, double *states, double *rates, double *variables) void initialiseVariables(double *states, double *rates, double *constants) { - variables[0] = 0.0; - variables[1] = 0.0; - variables[2] = 0.0; - variables[3] = 0.0; - variables[4] = 1.0; - variables[5] = 0.0; - variables[6] = 0.0; - variables[7] = 0.3; - variables[8] = 0.0; - variables[9] = 120.0; - variables[10] = 0.0; - variables[11] = 0.0; - variables[12] = 0.0; - variables[13] = 0.0; - variables[14] = 0.0; - variables[15] = 36.0; - variables[16] = 0.0; - variables[17] = 0.0; + algebraic[0] = 0.0; + 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; 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 b74a9e03c2..068073cbd5 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 @@ -81,19 +81,19 @@ def objective_function_0(u, f, data): rates = data[2] variables = data[3] - variables[0] = u[0] + algebraic[0] = u[0] - f[0] = variables[0]-(-20.0 if and_func(geq_func(voi, 10.0), leq_func(voi, 10.5)) else 0.0)-0.0 + f[0] = algebraic[0]-(-20.0 if and_func(geq_func(voi, 10.0), leq_func(voi, 10.5)) else 0.0)-0.0 def find_root_0(voi, states, rates, variables): u = [nan]*1 - u[0] = variables[0] + u[0] = algebraic[0] u = nla_solve(objective_function_0, u, 1, [voi, states, rates, variables]) - variables[0] = u[0] + algebraic[0] = u[0] def objective_function_1(u, f, data): @@ -104,7 +104,7 @@ def objective_function_1(u, f, data): rates[0] = u[0] - f[0] = rates[0]-(-(-variables[0]+variables[3]+variables[2]+variables[1])/variables[4])-0.0 + f[0] = rates[0]-(-(-algebraic[0]+algebraic[3]+algebraic[2]+algebraic[1])/constants[4])-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] - variables[6] = u[0] + computed_constants[6] = u[0] - f[0] = variables[6]-(variables[5]-10.613)-0.0 + f[0] = computed_constants[6]-(constants[5]-10.613)-0.0 def find_root_2(voi, states, rates, variables): u = [nan]*1 - u[0] = variables[6] + u[0] = algebraic[6] u = nla_solve(objective_function_2, u, 1, [voi, states, rates, variables]) - variables[6] = u[0] + algebraic[6] = u[0] def objective_function_3(u, f, data): @@ -144,19 +144,19 @@ def objective_function_3(u, f, data): rates = data[2] variables = data[3] - variables[1] = u[0] + algebraic[1] = u[0] - f[0] = variables[1]-variables[7]*(states[0]-variables[6])-0.0 + f[0] = algebraic[1]-constants[7]*(states[0]-computed_constants[6])-0.0 def find_root_3(voi, states, rates, variables): u = [nan]*1 - u[0] = variables[1] + u[0] = algebraic[1] u = nla_solve(objective_function_3, u, 1, [voi, states, rates, variables]) - variables[1] = u[0] + algebraic[1] = u[0] def objective_function_4(u, f, data): @@ -165,19 +165,19 @@ def objective_function_4(u, f, data): rates = data[2] variables = data[3] - variables[8] = u[0] + computed_constants[8] = u[0] - f[0] = variables[8]-(variables[5]-115.0)-0.0 + f[0] = computed_constants[8]-(constants[5]-115.0)-0.0 def find_root_4(voi, states, rates, variables): u = [nan]*1 - u[0] = variables[8] + u[0] = algebraic[8] u = nla_solve(objective_function_4, u, 1, [voi, states, rates, variables]) - variables[8] = u[0] + algebraic[8] = u[0] def objective_function_5(u, f, data): @@ -186,19 +186,19 @@ def objective_function_5(u, f, data): rates = data[2] variables = data[3] - variables[3] = u[0] + algebraic[3] = u[0] - f[0] = variables[3]-variables[9]*pow(states[2], 3.0)*states[1]*(states[0]-variables[8])-0.0 + f[0] = algebraic[3]-constants[9]*pow(states[2], 3.0)*states[1]*(states[0]-computed_constants[8])-0.0 def find_root_5(voi, states, rates, variables): u = [nan]*1 - u[0] = variables[3] + u[0] = algebraic[3] u = nla_solve(objective_function_5, u, 1, [voi, states, rates, variables]) - variables[3] = u[0] + algebraic[3] = u[0] def objective_function_6(u, f, data): @@ -207,19 +207,19 @@ def objective_function_6(u, f, data): rates = data[2] variables = data[3] - variables[10] = u[0] + algebraic[10] = u[0] - f[0] = variables[10]-0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0)-0.0 + f[0] = algebraic[10]-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] = variables[10] + u[0] = algebraic[10] u = nla_solve(objective_function_6, u, 1, [voi, states, rates, variables]) - variables[10] = u[0] + algebraic[10] = 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] - variables[11] = u[0] + algebraic[11] = u[0] - f[0] = variables[11]-4.0*exp(states[0]/18.0)-0.0 + f[0] = algebraic[11]-4.0*exp(states[0]/18.0)-0.0 def find_root_7(voi, states, rates, variables): u = [nan]*1 - u[0] = variables[11] + u[0] = algebraic[11] u = nla_solve(objective_function_7, u, 1, [voi, states, rates, variables]) - variables[11] = u[0] + algebraic[11] = 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]-(variables[10]*(1.0-states[2])-variables[11]*states[2])-0.0 + f[0] = rates[2]-(algebraic[10]*(1.0-states[2])-algebraic[11]*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] - variables[12] = u[0] + algebraic[12] = u[0] - f[0] = variables[12]-0.07*exp(states[0]/20.0)-0.0 + f[0] = algebraic[12]-0.07*exp(states[0]/20.0)-0.0 def find_root_9(voi, states, rates, variables): u = [nan]*1 - u[0] = variables[12] + u[0] = algebraic[12] u = nla_solve(objective_function_9, u, 1, [voi, states, rates, variables]) - variables[12] = u[0] + algebraic[12] = 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] - variables[13] = u[0] + algebraic[13] = u[0] - f[0] = variables[13]-1.0/(exp((states[0]+30.0)/10.0)+1.0)-0.0 + f[0] = algebraic[13]-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] = variables[13] + u[0] = algebraic[13] u = nla_solve(objective_function_10, u, 1, [voi, states, rates, variables]) - variables[13] = u[0] + algebraic[13] = 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]-(variables[12]*(1.0-states[1])-variables[13]*states[1])-0.0 + f[0] = rates[1]-(algebraic[12]*(1.0-states[1])-algebraic[13]*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] - variables[14] = u[0] + computed_constants[14] = u[0] - f[0] = variables[14]-(variables[5]+12.0)-0.0 + f[0] = computed_constants[14]-(constants[5]+12.0)-0.0 def find_root_12(voi, states, rates, variables): u = [nan]*1 - u[0] = variables[14] + u[0] = algebraic[14] u = nla_solve(objective_function_12, u, 1, [voi, states, rates, variables]) - variables[14] = u[0] + algebraic[14] = u[0] def objective_function_13(u, f, data): @@ -354,19 +354,19 @@ def objective_function_13(u, f, data): rates = data[2] variables = data[3] - variables[2] = u[0] + algebraic[2] = u[0] - f[0] = variables[2]-variables[15]*pow(states[3], 4.0)*(states[0]-variables[14])-0.0 + f[0] = algebraic[2]-constants[15]*pow(states[3], 4.0)*(states[0]-computed_constants[14])-0.0 def find_root_13(voi, states, rates, variables): u = [nan]*1 - u[0] = variables[2] + u[0] = algebraic[2] u = nla_solve(objective_function_13, u, 1, [voi, states, rates, variables]) - variables[2] = u[0] + algebraic[2] = u[0] def objective_function_14(u, f, data): @@ -375,19 +375,19 @@ def objective_function_14(u, f, data): rates = data[2] variables = data[3] - variables[16] = u[0] + algebraic[16] = u[0] - f[0] = variables[16]-0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0)-0.0 + f[0] = algebraic[16]-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] = variables[16] + u[0] = algebraic[16] u = nla_solve(objective_function_14, u, 1, [voi, states, rates, variables]) - variables[16] = u[0] + algebraic[16] = 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] - variables[17] = u[0] + algebraic[17] = u[0] - f[0] = variables[17]-0.125*exp(states[0]/80.0)-0.0 + f[0] = algebraic[17]-0.125*exp(states[0]/80.0)-0.0 def find_root_15(voi, states, rates, variables): u = [nan]*1 - u[0] = variables[17] + u[0] = algebraic[17] u = nla_solve(objective_function_15, u, 1, [voi, states, rates, variables]) - variables[17] = u[0] + algebraic[17] = 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]-(variables[16]*(1.0-states[3])-variables[17]*states[3])-0.0 + f[0] = rates[3]-(algebraic[16]*(1.0-states[3])-algebraic[17]*states[3])-0.0 def find_root_16(voi, states, rates, variables): @@ -433,24 +433,24 @@ def find_root_16(voi, states, rates, variables): def initialise_variables(states, rates, constants): - variables[0] = 0.0 - variables[1] = 0.0 - variables[2] = 0.0 - variables[3] = 0.0 - variables[4] = 1.0 - variables[5] = 0.0 - variables[6] = 0.0 - variables[7] = 0.3 - variables[8] = 0.0 - variables[9] = 120.0 - variables[10] = 0.0 - variables[11] = 0.0 - variables[12] = 0.0 - variables[13] = 0.0 - variables[14] = 0.0 - variables[15] = 36.0 - variables[16] = 0.0 - variables[17] = 0.0 + algebraic[0] = 0.0 + 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 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 d71fcc4104..9533f72f59 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) { - variables[4] = 1.0; - variables[5] = 0.0; - variables[7] = 0.3; - variables[9] = 120.0; - variables[15] = 36.0; + constants[4] = 1.0; + constants[5] = 0.0; + constants[7] = 0.3; + constants[9] = 120.0; + constants[15] = 36.0; states[0] = 0.0; states[1] = 0.6; states[2] = 0.05; states[3] = 0.325; - variables[17] = externalVariable(voi, states, rates, variables, 17); - variables[0] = externalVariable(voi, states, rates, variables, 0); + algebraic[17] = externalVariable(voi, states, rates, variables, 17); + algebraic[0] = externalVariable(voi, states, rates, variables, 0); } void computeComputedConstants(double *constants, double *computedConstants) { - variables[6] = variables[5]-10.613; - variables[8] = variables[5]-115.0; - variables[14] = variables[5]+12.0; + computedConstants[6] = constants[5]-10.613; + computedConstants[8] = constants[5]-115.0; + computedConstants[14] = constants[5]+12.0; } void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { - variables[17] = externalVariable(voi, states, rates, variables, 17); - variables[0] = externalVariable(voi, states, rates, variables, 0); - variables[1] = variables[7]*(states[0]-variables[6]); - variables[2] = variables[15]*pow(states[3], 4.0)*(states[0]-variables[14]); - variables[3] = variables[9]*pow(states[2], 3.0)*states[1]*(states[0]-variables[8]); - rates[0] = -(-variables[0]+variables[3]+variables[2]+variables[1])/variables[4]; - variables[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0); - variables[11] = 4.0*exp(states[0]/18.0); - rates[2] = variables[10]*(1.0-states[2])-variables[11]*states[2]; - variables[12] = 0.07*exp(states[0]/20.0); - variables[13] = 1.0/(exp((states[0]+30.0)/10.0)+1.0); - rates[1] = variables[12]*(1.0-states[1])-variables[13]*states[1]; - variables[16] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0); - rates[3] = variables[16]*(1.0-states[3])-variables[17]*states[3]; + algebraic[17] = externalVariable(voi, states, rates, variables, 17); + 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]; } void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { - variables[17] = externalVariable(voi, states, rates, variables, 17); - variables[0] = externalVariable(voi, states, rates, variables, 0); - variables[1] = variables[7]*(states[0]-variables[6]); - variables[3] = variables[9]*pow(states[2], 3.0)*states[1]*(states[0]-variables[8]); - variables[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0); - variables[11] = 4.0*exp(states[0]/18.0); - variables[12] = 0.07*exp(states[0]/20.0); - variables[13] = 1.0/(exp((states[0]+30.0)/10.0)+1.0); - variables[2] = variables[15]*pow(states[3], 4.0)*(states[0]-variables[14]); - variables[16] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0); + algebraic[17] = externalVariable(voi, states, rates, variables, 17); + 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); } 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 4f026e071d..381f0a24f7 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): - variables[4] = 1.0 - variables[5] = 0.0 - variables[7] = 0.3 - variables[9] = 120.0 - variables[15] = 36.0 + constants[4] = 1.0 + constants[5] = 0.0 + constants[7] = 0.3 + constants[9] = 120.0 + constants[15] = 36.0 states[0] = 0.0 states[1] = 0.6 states[2] = 0.05 states[3] = 0.325 - variables[17] = external_variable(voi, states, rates, variables, 17) - variables[0] = external_variable(voi, states, rates, variables, 0) + algebraic[17] = external_variable(voi, states, rates, variables, 17) + algebraic[0] = external_variable(voi, states, rates, variables, 0) def compute_computed_constants(constants, computed_constants): - variables[6] = variables[5]-10.613 - variables[8] = variables[5]-115.0 - variables[14] = variables[5]+12.0 + computed_constants[6] = constants[5]-10.613 + computed_constants[8] = constants[5]-115.0 + computed_constants[14] = constants[5]+12.0 def compute_rates(voi, states, rates, constants, computed_constants, algebraic, external_variable): - variables[17] = external_variable(voi, states, rates, variables, 17) - variables[0] = external_variable(voi, states, rates, variables, 0) - variables[1] = variables[7]*(states[0]-variables[6]) - variables[2] = variables[15]*pow(states[3], 4.0)*(states[0]-variables[14]) - variables[3] = variables[9]*pow(states[2], 3.0)*states[1]*(states[0]-variables[8]) - rates[0] = -(-variables[0]+variables[3]+variables[2]+variables[1])/variables[4] - variables[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0) - variables[11] = 4.0*exp(states[0]/18.0) - rates[2] = variables[10]*(1.0-states[2])-variables[11]*states[2] - variables[12] = 0.07*exp(states[0]/20.0) - variables[13] = 1.0/(exp((states[0]+30.0)/10.0)+1.0) - rates[1] = variables[12]*(1.0-states[1])-variables[13]*states[1] - variables[16] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0) - rates[3] = variables[16]*(1.0-states[3])-variables[17]*states[3] + algebraic[17] = external_variable(voi, states, rates, variables, 17) + 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] def compute_variables(voi, states, rates, constants, computed_constants, algebraic, external_variable): - variables[17] = external_variable(voi, states, rates, variables, 17) - variables[0] = external_variable(voi, states, rates, variables, 0) - variables[1] = variables[7]*(states[0]-variables[6]) - variables[3] = variables[9]*pow(states[2], 3.0)*states[1]*(states[0]-variables[8]) - variables[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0) - variables[11] = 4.0*exp(states[0]/18.0) - variables[12] = 0.07*exp(states[0]/20.0) - variables[13] = 1.0/(exp((states[0]+30.0)/10.0)+1.0) - variables[2] = variables[15]*pow(states[3], 4.0)*(states[0]-variables[14]) - variables[16] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0) + algebraic[17] = external_variable(voi, states, rates, variables, 17) + 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) 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 35e65eb5b6..4a61f2b747 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) { - variables[4] = 1.0; - variables[7] = 0.3; - variables[9] = 120.0; - variables[15] = 36.0; + constants[4] = 1.0; + constants[7] = 0.3; + constants[9] = 120.0; + constants[15] = 36.0; states[0] = 0.0; states[1] = 0.6; states[2] = 0.05; states[3] = 0.325; - variables[14] = externalVariable(voi, states, rates, variables, 14); - variables[5] = externalVariable(voi, states, rates, variables, 5); + algebraic[14] = externalVariable(voi, states, rates, variables, 14); + algebraic[5] = externalVariable(voi, states, rates, variables, 5); } void computeComputedConstants(double *constants, double *computedConstants) @@ -90,39 +90,39 @@ void computeComputedConstants(double *constants, double *computedConstants) void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { - variables[0] = ((voi >= 10.0) && (voi <= 10.5))?-20.0:0.0; - variables[14] = externalVariable(voi, states, rates, variables, 14); - variables[5] = externalVariable(voi, states, rates, variables, 5); - variables[6] = variables[5]-10.613; - variables[1] = variables[7]*(states[0]-variables[6]); - variables[2] = variables[15]*pow(states[3], 4.0)*(states[0]-variables[14]); - variables[8] = variables[5]-115.0; - variables[3] = variables[9]*pow(states[2], 3.0)*states[1]*(states[0]-variables[8]); - rates[0] = -(-variables[0]+variables[3]+variables[2]+variables[1])/variables[4]; - variables[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0); - variables[11] = 4.0*exp(states[0]/18.0); - rates[2] = variables[10]*(1.0-states[2])-variables[11]*states[2]; - variables[12] = 0.07*exp(states[0]/20.0); - variables[13] = 1.0/(exp((states[0]+30.0)/10.0)+1.0); - rates[1] = variables[12]*(1.0-states[1])-variables[13]*states[1]; - variables[16] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0); - variables[17] = 0.125*exp(states[0]/80.0); - rates[3] = variables[16]*(1.0-states[3])-variables[17]*states[3]; + 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]; } void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { - variables[14] = externalVariable(voi, states, rates, variables, 14); - variables[5] = externalVariable(voi, states, rates, variables, 5); - variables[6] = variables[5]-10.613; - variables[1] = variables[7]*(states[0]-variables[6]); - variables[8] = variables[5]-115.0; - variables[3] = variables[9]*pow(states[2], 3.0)*states[1]*(states[0]-variables[8]); - variables[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0); - variables[11] = 4.0*exp(states[0]/18.0); - variables[12] = 0.07*exp(states[0]/20.0); - variables[13] = 1.0/(exp((states[0]+30.0)/10.0)+1.0); - variables[2] = variables[15]*pow(states[3], 4.0)*(states[0]-variables[14]); - variables[16] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0); - variables[17] = 0.125*exp(states[0]/80.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[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); } 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 fa91989064..53027ad4cb 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): - variables[4] = 1.0 - variables[7] = 0.3 - variables[9] = 120.0 - variables[15] = 36.0 + constants[4] = 1.0 + constants[7] = 0.3 + constants[9] = 120.0 + constants[15] = 36.0 states[0] = 0.0 states[1] = 0.6 states[2] = 0.05 states[3] = 0.325 - variables[14] = external_variable(voi, states, rates, variables, 14) - variables[5] = external_variable(voi, states, rates, variables, 5) + algebraic[14] = external_variable(voi, states, rates, variables, 14) + algebraic[5] = external_variable(voi, states, rates, variables, 5) def compute_computed_constants(constants, computed_constants): @@ -91,37 +91,37 @@ def compute_computed_constants(constants, computed_constants): def compute_rates(voi, states, rates, constants, computed_constants, algebraic, external_variable): - variables[0] = -20.0 if and_func(geq_func(voi, 10.0), leq_func(voi, 10.5)) else 0.0 - variables[14] = external_variable(voi, states, rates, variables, 14) - variables[5] = external_variable(voi, states, rates, variables, 5) - variables[6] = variables[5]-10.613 - variables[1] = variables[7]*(states[0]-variables[6]) - variables[2] = variables[15]*pow(states[3], 4.0)*(states[0]-variables[14]) - variables[8] = variables[5]-115.0 - variables[3] = variables[9]*pow(states[2], 3.0)*states[1]*(states[0]-variables[8]) - rates[0] = -(-variables[0]+variables[3]+variables[2]+variables[1])/variables[4] - variables[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0) - variables[11] = 4.0*exp(states[0]/18.0) - rates[2] = variables[10]*(1.0-states[2])-variables[11]*states[2] - variables[12] = 0.07*exp(states[0]/20.0) - variables[13] = 1.0/(exp((states[0]+30.0)/10.0)+1.0) - rates[1] = variables[12]*(1.0-states[1])-variables[13]*states[1] - variables[16] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0) - variables[17] = 0.125*exp(states[0]/80.0) - rates[3] = variables[16]*(1.0-states[3])-variables[17]*states[3] + 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] def compute_variables(voi, states, rates, constants, computed_constants, algebraic, external_variable): - variables[14] = external_variable(voi, states, rates, variables, 14) - variables[5] = external_variable(voi, states, rates, variables, 5) - variables[6] = variables[5]-10.613 - variables[1] = variables[7]*(states[0]-variables[6]) - variables[8] = variables[5]-115.0 - variables[3] = variables[9]*pow(states[2], 3.0)*states[1]*(states[0]-variables[8]) - variables[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0) - variables[11] = 4.0*exp(states[0]/18.0) - variables[12] = 0.07*exp(states[0]/20.0) - variables[13] = 1.0/(exp((states[0]+30.0)/10.0)+1.0) - variables[2] = variables[15]*pow(states[3], 4.0)*(states[0]-variables[14]) - variables[16] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0) - variables[17] = 0.125*exp(states[0]/80.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[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) 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 a5180f9026..be516f51bd 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) { - variables[5] = 0.0; - variables[7] = 0.3; - variables[15] = 36.0; + constants[5] = 0.0; + constants[7] = 0.3; + constants[15] = 36.0; states[0] = 0.0; states[1] = 0.6; states[2] = 0.05; states[3] = 0.325; - variables[9] = externalVariable(voi, states, rates, variables, 9); - variables[4] = externalVariable(voi, states, rates, variables, 4); + algebraic[9] = externalVariable(voi, states, rates, variables, 9); + algebraic[4] = externalVariable(voi, states, rates, variables, 4); } void computeComputedConstants(double *constants, double *computedConstants) { - variables[6] = variables[5]-10.613; - variables[8] = variables[5]-115.0; - variables[14] = variables[5]+12.0; + computedConstants[6] = constants[5]-10.613; + computedConstants[8] = constants[5]-115.0; + computedConstants[14] = constants[5]+12.0; } void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { - variables[0] = ((voi >= 10.0) && (voi <= 10.5))?-20.0:0.0; - variables[9] = externalVariable(voi, states, rates, variables, 9); - variables[4] = externalVariable(voi, states, rates, variables, 4); - variables[1] = variables[7]*(states[0]-variables[6]); - variables[2] = variables[15]*pow(states[3], 4.0)*(states[0]-variables[14]); - variables[3] = variables[9]*pow(states[2], 3.0)*states[1]*(states[0]-variables[8]); - rates[0] = -(-variables[0]+variables[3]+variables[2]+variables[1])/variables[4]; - variables[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0); - variables[11] = 4.0*exp(states[0]/18.0); - rates[2] = variables[10]*(1.0-states[2])-variables[11]*states[2]; - variables[12] = 0.07*exp(states[0]/20.0); - variables[13] = 1.0/(exp((states[0]+30.0)/10.0)+1.0); - rates[1] = variables[12]*(1.0-states[1])-variables[13]*states[1]; - variables[16] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0); - variables[17] = 0.125*exp(states[0]/80.0); - rates[3] = variables[16]*(1.0-states[3])-variables[17]*states[3]; + algebraic[0] = ((voi >= 10.0) && (voi <= 10.5))?-20.0:0.0; + algebraic[9] = externalVariable(voi, states, rates, variables, 9); + 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]); + 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]; } void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { - variables[1] = variables[7]*(states[0]-variables[6]); - variables[9] = externalVariable(voi, states, rates, variables, 9); - variables[3] = variables[9]*pow(states[2], 3.0)*states[1]*(states[0]-variables[8]); - variables[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0); - variables[11] = 4.0*exp(states[0]/18.0); - variables[12] = 0.07*exp(states[0]/20.0); - variables[13] = 1.0/(exp((states[0]+30.0)/10.0)+1.0); - variables[2] = variables[15]*pow(states[3], 4.0)*(states[0]-variables[14]); - variables[16] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0); - variables[17] = 0.125*exp(states[0]/80.0); - variables[4] = externalVariable(voi, states, rates, variables, 4); + 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[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 71f9a4827e..e518a203f6 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): - variables[5] = 0.0 - variables[7] = 0.3 - variables[15] = 36.0 + constants[5] = 0.0 + constants[7] = 0.3 + constants[15] = 36.0 states[0] = 0.0 states[1] = 0.6 states[2] = 0.05 states[3] = 0.325 - variables[9] = external_variable(voi, states, rates, variables, 9) - variables[4] = external_variable(voi, states, rates, variables, 4) + 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): - variables[6] = variables[5]-10.613 - variables[8] = variables[5]-115.0 - variables[14] = variables[5]+12.0 + computed_constants[6] = constants[5]-10.613 + computed_constants[8] = constants[5]-115.0 + computed_constants[14] = constants[5]+12.0 def compute_rates(voi, states, rates, constants, computed_constants, algebraic, external_variable): - variables[0] = -20.0 if and_func(geq_func(voi, 10.0), leq_func(voi, 10.5)) else 0.0 - variables[9] = external_variable(voi, states, rates, variables, 9) - variables[4] = external_variable(voi, states, rates, variables, 4) - variables[1] = variables[7]*(states[0]-variables[6]) - variables[2] = variables[15]*pow(states[3], 4.0)*(states[0]-variables[14]) - variables[3] = variables[9]*pow(states[2], 3.0)*states[1]*(states[0]-variables[8]) - rates[0] = -(-variables[0]+variables[3]+variables[2]+variables[1])/variables[4] - variables[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0) - variables[11] = 4.0*exp(states[0]/18.0) - rates[2] = variables[10]*(1.0-states[2])-variables[11]*states[2] - variables[12] = 0.07*exp(states[0]/20.0) - variables[13] = 1.0/(exp((states[0]+30.0)/10.0)+1.0) - rates[1] = variables[12]*(1.0-states[1])-variables[13]*states[1] - variables[16] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0) - variables[17] = 0.125*exp(states[0]/80.0) - rates[3] = variables[16]*(1.0-states[3])-variables[17]*states[3] + 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[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]) + 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] def compute_variables(voi, states, rates, constants, computed_constants, algebraic, external_variable): - variables[1] = variables[7]*(states[0]-variables[6]) - variables[9] = external_variable(voi, states, rates, variables, 9) - variables[3] = variables[9]*pow(states[2], 3.0)*states[1]*(states[0]-variables[8]) - variables[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0) - variables[11] = 4.0*exp(states[0]/18.0) - variables[12] = 0.07*exp(states[0]/20.0) - variables[13] = 1.0/(exp((states[0]+30.0)/10.0)+1.0) - variables[2] = variables[15]*pow(states[3], 4.0)*(states[0]-variables[14]) - variables[16] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0) - variables[17] = 0.125*exp(states[0]/80.0) - variables[4] = external_variable(voi, states, rates, variables, 4) + 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[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 0f7cdf5056..a8baed030d 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) { - variables[5] = 1.0; - variables[6] = 0.0; - variables[8] = 0.3; - variables[10] = 120.0; - variables[17] = 36.0; + constants[5] = 1.0; + constants[6] = 0.0; + constants[8] = 0.3; + constants[10] = 120.0; + constants[17] = 36.0; states[0] = 0.6; states[1] = 0.325; - variables[1] = externalVariable(voi, states, rates, variables, 1); - variables[11] = externalVariable(voi, states, rates, variables, 11); + algebraic[1] = externalVariable(voi, states, rates, variables, 1); + algebraic[11] = externalVariable(voi, states, rates, variables, 11); } void computeComputedConstants(double *constants, double *computedConstants) { - variables[7] = variables[6]-10.613; - variables[9] = variables[6]-115.0; - variables[16] = variables[6]+12.0; + computedConstants[7] = constants[6]-10.613; + computedConstants[9] = constants[6]-115.0; + computedConstants[16] = constants[6]+12.0; } void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { - variables[1] = externalVariable(voi, states, rates, variables, 1); - variables[14] = 0.07*exp(variables[1]/20.0); - variables[15] = 1.0/(exp((variables[1]+30.0)/10.0)+1.0); - rates[0] = variables[14]*(1.0-states[0])-variables[15]*states[0]; - variables[18] = 0.01*(variables[1]+10.0)/(exp((variables[1]+10.0)/10.0)-1.0); - variables[19] = 0.125*exp(variables[1]/80.0); - rates[1] = variables[18]*(1.0-states[1])-variables[19]*states[1]; + 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]; } void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { - variables[0] = ((voi >= 10.0) && (voi <= 10.5))?-20.0:0.0; - variables[1] = externalVariable(voi, states, rates, variables, 1); - variables[2] = variables[8]*(variables[1]-variables[7]); - variables[11] = externalVariable(voi, states, rates, variables, 11); - variables[4] = variables[10]*pow(variables[11], 3.0)*states[0]*(variables[1]-variables[9]); - variables[12] = 0.1*(variables[1]+25.0)/(exp((variables[1]+25.0)/10.0)-1.0); - variables[13] = 4.0*exp(variables[1]/18.0); - variables[3] = variables[17]*pow(states[1], 4.0)*(variables[1]-variables[16]); + 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]); } 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 16326c27d3..914194e7fb 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): - variables[5] = 1.0 - variables[6] = 0.0 - variables[8] = 0.3 - variables[10] = 120.0 - variables[17] = 36.0 + constants[5] = 1.0 + constants[6] = 0.0 + constants[8] = 0.3 + constants[10] = 120.0 + constants[17] = 36.0 states[0] = 0.6 states[1] = 0.325 - variables[1] = external_variable(voi, states, rates, variables, 1) - variables[11] = external_variable(voi, states, rates, variables, 11) + algebraic[1] = external_variable(voi, states, rates, variables, 1) + algebraic[11] = external_variable(voi, states, rates, variables, 11) def compute_computed_constants(constants, computed_constants): - variables[7] = variables[6]-10.613 - variables[9] = variables[6]-115.0 - variables[16] = variables[6]+12.0 + computed_constants[7] = constants[6]-10.613 + computed_constants[9] = constants[6]-115.0 + computed_constants[16] = constants[6]+12.0 def compute_rates(voi, states, rates, constants, computed_constants, algebraic, external_variable): - variables[1] = external_variable(voi, states, rates, variables, 1) - variables[14] = 0.07*exp(variables[1]/20.0) - variables[15] = 1.0/(exp((variables[1]+30.0)/10.0)+1.0) - rates[0] = variables[14]*(1.0-states[0])-variables[15]*states[0] - variables[18] = 0.01*(variables[1]+10.0)/(exp((variables[1]+10.0)/10.0)-1.0) - variables[19] = 0.125*exp(variables[1]/80.0) - rates[1] = variables[18]*(1.0-states[1])-variables[19]*states[1] + 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] def compute_variables(voi, states, rates, constants, computed_constants, algebraic, external_variable): - variables[0] = -20.0 if and_func(geq_func(voi, 10.0), leq_func(voi, 10.5)) else 0.0 - variables[1] = external_variable(voi, states, rates, variables, 1) - variables[2] = variables[8]*(variables[1]-variables[7]) - variables[11] = external_variable(voi, states, rates, variables, 11) - variables[4] = variables[10]*pow(variables[11], 3.0)*states[0]*(variables[1]-variables[9]) - variables[12] = 0.1*(variables[1]+25.0)/(exp((variables[1]+25.0)/10.0)-1.0) - variables[13] = 4.0*exp(variables[1]/18.0) - variables[3] = variables[17]*pow(states[1], 4.0)*(variables[1]-variables[16]) + 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]) 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 4deb76e688..b21ab1d041 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) { - variables[5] = 1.0; - variables[6] = 0.0; - variables[8] = 0.3; - variables[10] = 120.0; - variables[16] = 36.0; + constants[5] = 1.0; + constants[6] = 0.0; + constants[8] = 0.3; + constants[10] = 120.0; + constants[16] = 36.0; states[0] = 0.6; states[1] = 0.05; states[2] = 0.325; - variables[1] = externalVariable(voi, states, rates, variables, 1); - variables[17] = externalVariable(voi, states, rates, variables, 17); - variables[4] = externalVariable(voi, states, rates, variables, 4); + algebraic[1] = externalVariable(voi, states, rates, variables, 1); + algebraic[17] = externalVariable(voi, states, rates, variables, 17); + algebraic[4] = externalVariable(voi, states, rates, variables, 4); } void computeComputedConstants(double *constants, double *computedConstants) { - variables[7] = variables[6]-10.613; - variables[9] = variables[6]-115.0; - variables[15] = variables[6]+12.0; + computedConstants[7] = constants[6]-10.613; + computedConstants[9] = constants[6]-115.0; + computedConstants[15] = constants[6]+12.0; } void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { - variables[1] = externalVariable(voi, states, rates, variables, 1); - variables[11] = 0.1*(variables[1]+25.0)/(exp((variables[1]+25.0)/10.0)-1.0); - variables[12] = 4.0*exp(variables[1]/18.0); - rates[1] = variables[11]*(1.0-states[1])-variables[12]*states[1]; - variables[13] = 0.07*exp(variables[1]/20.0); - variables[14] = 1.0/(exp((variables[1]+30.0)/10.0)+1.0); - rates[0] = variables[13]*(1.0-states[0])-variables[14]*states[0]; - variables[17] = externalVariable(voi, states, rates, variables, 17); - variables[18] = 0.125*exp(variables[1]/80.0); - rates[2] = variables[17]*(1.0-states[2])-variables[18]*states[2]; + 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]; } void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { - variables[0] = ((voi >= 10.0) && (voi <= 10.5))?-20.0:0.0; - variables[1] = externalVariable(voi, states, rates, variables, 1); - variables[2] = variables[8]*(variables[1]-variables[7]); - variables[17] = externalVariable(voi, states, rates, variables, 17); - variables[4] = externalVariable(voi, states, rates, variables, 4); - variables[3] = variables[16]*pow(states[2], 4.0)*(variables[1]-variables[15]); + 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[4] = externalVariable(voi, states, rates, variables, 4); + algebraic[3] = constants[16]*pow(states[2], 4.0)*(algebraic[1]-computedConstants[15]); } 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 89c02e24c7..d64291b4a8 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): - variables[5] = 1.0 - variables[6] = 0.0 - variables[8] = 0.3 - variables[10] = 120.0 - variables[16] = 36.0 + constants[5] = 1.0 + constants[6] = 0.0 + constants[8] = 0.3 + constants[10] = 120.0 + constants[16] = 36.0 states[0] = 0.6 states[1] = 0.05 states[2] = 0.325 - variables[1] = external_variable(voi, states, rates, variables, 1) - variables[17] = external_variable(voi, states, rates, variables, 17) - variables[4] = external_variable(voi, states, rates, variables, 4) + algebraic[1] = external_variable(voi, states, rates, variables, 1) + algebraic[17] = external_variable(voi, states, rates, variables, 17) + algebraic[4] = external_variable(voi, states, rates, variables, 4) def compute_computed_constants(constants, computed_constants): - variables[7] = variables[6]-10.613 - variables[9] = variables[6]-115.0 - variables[15] = variables[6]+12.0 + computed_constants[7] = constants[6]-10.613 + computed_constants[9] = constants[6]-115.0 + computed_constants[15] = constants[6]+12.0 def compute_rates(voi, states, rates, constants, computed_constants, algebraic, external_variable): - variables[1] = external_variable(voi, states, rates, variables, 1) - variables[11] = 0.1*(variables[1]+25.0)/(exp((variables[1]+25.0)/10.0)-1.0) - variables[12] = 4.0*exp(variables[1]/18.0) - rates[1] = variables[11]*(1.0-states[1])-variables[12]*states[1] - variables[13] = 0.07*exp(variables[1]/20.0) - variables[14] = 1.0/(exp((variables[1]+30.0)/10.0)+1.0) - rates[0] = variables[13]*(1.0-states[0])-variables[14]*states[0] - variables[17] = external_variable(voi, states, rates, variables, 17) - variables[18] = 0.125*exp(variables[1]/80.0) - rates[2] = variables[17]*(1.0-states[2])-variables[18]*states[2] + 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] def compute_variables(voi, states, rates, constants, computed_constants, algebraic, external_variable): - variables[0] = -20.0 if and_func(geq_func(voi, 10.0), leq_func(voi, 10.5)) else 0.0 - variables[1] = external_variable(voi, states, rates, variables, 1) - variables[2] = variables[8]*(variables[1]-variables[7]) - variables[17] = external_variable(voi, states, rates, variables, 17) - variables[4] = external_variable(voi, states, rates, variables, 4) - variables[3] = variables[16]*pow(states[2], 4.0)*(variables[1]-variables[15]) + 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[4] = external_variable(voi, states, rates, variables, 4) + algebraic[3] = constants[16]*pow(states[2], 4.0)*(algebraic[1]-computed_constants[15]) 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 a1d5201a66..87eb31f08e 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): - variables[4] = 1.0 - variables[5] = 0.0 - variables[7] = 0.3 - variables[9] = 120.0 - variables[15] = 36.0 + constants[4] = 1.0 + constants[5] = 0.0 + constants[7] = 0.3 + constants[9] = 120.0 + constants[15] = 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): - variables[6] = variables[5]-10.613 - variables[8] = variables[5]-115.0 - variables[14] = variables[5]+12.0 + computed_constants[6] = constants[5]-10.613 + computed_constants[8] = constants[5]-115.0 + computed_constants[14] = constants[5]+12.0 def compute_rates(voi, states, rates, constants, computed_constants, algebraic): - variables[0] = -20.0 if and_func(geq_func(voi, 10.0), leq_func(voi, 10.5)) else 0.0 - variables[1] = variables[7]*(states[0]-variables[6]) - variables[2] = variables[15]*pow(states[3], 4.0)*(states[0]-variables[14]) - variables[3] = variables[9]*pow(states[2], 3.0)*states[1]*(states[0]-variables[8]) - rates[0] = -(-variables[0]+variables[3]+variables[2]+variables[1])/variables[4] - variables[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0) - variables[11] = 4.0*exp(states[0]/18.0) - rates[2] = variables[10]*(1.0-states[2])-variables[11]*states[2] - variables[12] = 0.07*exp(states[0]/20.0) - variables[13] = 1.0/(exp((states[0]+30.0)/10.0)+1.0) - rates[1] = variables[12]*(1.0-states[1])-variables[13]*states[1] - variables[16] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0) - variables[17] = 0.125*exp(states[0]/80.0) - rates[3] = variables[16]*(1.0-states[3])-variables[17]*states[3] + 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] def compute_variables(voi, states, rates, constants, computed_constants, algebraic): - variables[1] = variables[7]*(states[0]-variables[6]) - variables[3] = variables[9]*pow(states[2], 3.0)*states[1]*(states[0]-variables[8]) - variables[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0) - variables[11] = 4.0*exp(states[0]/18.0) - variables[12] = 0.07*exp(states[0]/20.0) - variables[13] = 1.0/(exp((states[0]+30.0)/10.0)+1.0) - variables[2] = variables[15]*pow(states[3], 4.0)*(states[0]-variables[14]) - variables[16] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0) - variables[17] = 0.125*exp(states[0]/80.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) 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 b042ee21e7..083b39125e 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) { - variables[4] = 1.0; - variables[5] = 0.0; - variables[7] = 0.3; - variables[9] = 120.0; - variables[16] = 36.0; + constants[4] = 1.0; + constants[5] = 0.0; + constants[7] = 0.3; + constants[9] = 120.0; + constants[16] = 36.0; states[0] = 0.0; states[1] = 0.6; states[2] = 0.325; - variables[10] = externalVariable(voi, states, rates, variables, 10); + algebraic[10] = externalVariable(voi, states, rates, variables, 10); } void computeComputedConstants(double *constants, double *computedConstants) { - variables[6] = variables[5]-10.613; - variables[8] = variables[5]-115.0; - variables[15] = variables[5]+12.0; + computedConstants[6] = constants[5]-10.613; + computedConstants[8] = constants[5]-115.0; + computedConstants[15] = constants[5]+12.0; } void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { - variables[0] = ((voi >= 10.0) && (voi <= 10.5))?-20.0:0.0; - variables[1] = variables[7]*(states[0]-variables[6]); - variables[2] = variables[16]*pow(states[2], 4.0)*(states[0]-variables[15]); - variables[10] = externalVariable(voi, states, rates, variables, 10); - variables[3] = variables[9]*pow(variables[10], 3.0)*states[1]*(states[0]-variables[8]); - rates[0] = -(-variables[0]+variables[3]+variables[2]+variables[1])/variables[4]; - variables[13] = 0.07*exp(states[0]/20.0); - variables[14] = 1.0/(exp((states[0]+30.0)/10.0)+1.0); - rates[1] = variables[13]*(1.0-states[1])-variables[14]*states[1]; - variables[17] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0); - variables[18] = 0.125*exp(states[0]/80.0); - rates[2] = variables[17]*(1.0-states[2])-variables[18]*states[2]; + 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]; } void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { - variables[1] = variables[7]*(states[0]-variables[6]); - variables[10] = externalVariable(voi, states, rates, variables, 10); - variables[3] = variables[9]*pow(variables[10], 3.0)*states[1]*(states[0]-variables[8]); - variables[11] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0); - variables[12] = 4.0*exp(states[0]/18.0); - variables[13] = 0.07*exp(states[0]/20.0); - variables[14] = 1.0/(exp((states[0]+30.0)/10.0)+1.0); - variables[2] = variables[16]*pow(states[2], 4.0)*(states[0]-variables[15]); - variables[17] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0); - variables[18] = 0.125*exp(states[0]/80.0); + 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); } 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 39debf9ca9..bee8d59e4f 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): - variables[4] = 1.0 - variables[5] = 0.0 - variables[7] = 0.3 - variables[9] = 120.0 - variables[16] = 36.0 + constants[4] = 1.0 + constants[5] = 0.0 + constants[7] = 0.3 + constants[9] = 120.0 + constants[16] = 36.0 states[0] = 0.0 states[1] = 0.6 states[2] = 0.325 - variables[10] = external_variable(voi, states, rates, variables, 10) + algebraic[10] = external_variable(voi, states, rates, variables, 10) def compute_computed_constants(constants, computed_constants): - variables[6] = variables[5]-10.613 - variables[8] = variables[5]-115.0 - variables[15] = variables[5]+12.0 + computed_constants[6] = constants[5]-10.613 + computed_constants[8] = constants[5]-115.0 + computed_constants[15] = constants[5]+12.0 def compute_rates(voi, states, rates, constants, computed_constants, algebraic, external_variable): - variables[0] = -20.0 if and_func(geq_func(voi, 10.0), leq_func(voi, 10.5)) else 0.0 - variables[1] = variables[7]*(states[0]-variables[6]) - variables[2] = variables[16]*pow(states[2], 4.0)*(states[0]-variables[15]) - variables[10] = external_variable(voi, states, rates, variables, 10) - variables[3] = variables[9]*pow(variables[10], 3.0)*states[1]*(states[0]-variables[8]) - rates[0] = -(-variables[0]+variables[3]+variables[2]+variables[1])/variables[4] - variables[13] = 0.07*exp(states[0]/20.0) - variables[14] = 1.0/(exp((states[0]+30.0)/10.0)+1.0) - rates[1] = variables[13]*(1.0-states[1])-variables[14]*states[1] - variables[17] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0) - variables[18] = 0.125*exp(states[0]/80.0) - rates[2] = variables[17]*(1.0-states[2])-variables[18]*states[2] + 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] def compute_variables(voi, states, rates, constants, computed_constants, algebraic, external_variable): - variables[1] = variables[7]*(states[0]-variables[6]) - variables[10] = external_variable(voi, states, rates, variables, 10) - variables[3] = variables[9]*pow(variables[10], 3.0)*states[1]*(states[0]-variables[8]) - variables[11] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0) - variables[12] = 4.0*exp(states[0]/18.0) - variables[13] = 0.07*exp(states[0]/20.0) - variables[14] = 1.0/(exp((states[0]+30.0)/10.0)+1.0) - variables[2] = variables[16]*pow(states[2], 4.0)*(states[0]-variables[15]) - variables[17] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0) - variables[18] = 0.125*exp(states[0]/80.0) + 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) diff --git a/tests/resources/generator/noble_model_1962/model.c b/tests/resources/generator/noble_model_1962/model.c index 8edc882e14..e8a1804744 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) { - variables[3] = 12.0; - variables[4] = 0.075; - variables[5] = -60.0; - variables[7] = 400.0; - variables[8] = 40.0; + constants[3] = 12.0; + constants[4] = 0.075; + constants[5] = -60.0; + constants[7] = 400.0; + constants[8] = 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) { - variables[6] = pow(states[1], 3.0)*states[2]*variables[7]; - variables[0] = (variables[6]+0.14)*(states[0]-variables[8]); - variables[1] = variables[4]*(states[0]-variables[5]); - variables[13] = 1.2*exp((-states[0]-90.0)/50.0)+0.015*exp((states[0]+90.0)/60.0); - variables[14] = 1.2*pow(states[3], 4.0); - variables[2] = (variables[13]+variables[14])*(states[0]+100.0); - rates[0] = -(variables[0]+variables[2]+variables[1])/variables[3]; - variables[9] = 0.1*(-states[0]-48.0)/(exp((-states[0]-48.0)/15.0)-1.0); - variables[10] = 0.12*(states[0]+8.0)/(exp((states[0]+8.0)/5.0)-1.0); - rates[1] = variables[9]*(1.0-states[1])-variables[10]*states[1]; - variables[11] = 0.17*exp((-states[0]-90.0)/20.0); - variables[12] = 1.0/(1.0+exp((-states[0]-42.0)/10.0)); - rates[2] = variables[11]*(1.0-states[2])-variables[12]*states[2]; - variables[15] = 0.0001*(-states[0]-50.0)/(exp((-states[0]-50.0)/10.0)-1.0); - variables[16] = 0.002*exp((-states[0]-90.0)/80.0); - rates[3] = variables[15]*(1.0-states[3])-variables[16]*states[3]; + 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]; } void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic) { - variables[1] = variables[4]*(states[0]-variables[5]); - variables[6] = pow(states[1], 3.0)*states[2]*variables[7]; - variables[0] = (variables[6]+0.14)*(states[0]-variables[8]); - variables[9] = 0.1*(-states[0]-48.0)/(exp((-states[0]-48.0)/15.0)-1.0); - variables[10] = 0.12*(states[0]+8.0)/(exp((states[0]+8.0)/5.0)-1.0); - variables[11] = 0.17*exp((-states[0]-90.0)/20.0); - variables[12] = 1.0/(1.0+exp((-states[0]-42.0)/10.0)); - variables[13] = 1.2*exp((-states[0]-90.0)/50.0)+0.015*exp((states[0]+90.0)/60.0); - variables[14] = 1.2*pow(states[3], 4.0); - variables[2] = (variables[13]+variables[14])*(states[0]+100.0); - variables[15] = 0.0001*(-states[0]-50.0)/(exp((-states[0]-50.0)/10.0)-1.0); - variables[16] = 0.002*exp((-states[0]-90.0)/80.0); + 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); } diff --git a/tests/resources/generator/noble_model_1962/model.py b/tests/resources/generator/noble_model_1962/model.py index 878cc89603..d9672b95f4 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): - variables[3] = 12.0 - variables[4] = 0.075 - variables[5] = -60.0 - variables[7] = 400.0 - variables[8] = 40.0 + constants[3] = 12.0 + constants[4] = 0.075 + constants[5] = -60.0 + constants[7] = 400.0 + constants[8] = 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): - variables[6] = pow(states[1], 3.0)*states[2]*variables[7] - variables[0] = (variables[6]+0.14)*(states[0]-variables[8]) - variables[1] = variables[4]*(states[0]-variables[5]) - variables[13] = 1.2*exp((-states[0]-90.0)/50.0)+0.015*exp((states[0]+90.0)/60.0) - variables[14] = 1.2*pow(states[3], 4.0) - variables[2] = (variables[13]+variables[14])*(states[0]+100.0) - rates[0] = -(variables[0]+variables[2]+variables[1])/variables[3] - variables[9] = 0.1*(-states[0]-48.0)/(exp((-states[0]-48.0)/15.0)-1.0) - variables[10] = 0.12*(states[0]+8.0)/(exp((states[0]+8.0)/5.0)-1.0) - rates[1] = variables[9]*(1.0-states[1])-variables[10]*states[1] - variables[11] = 0.17*exp((-states[0]-90.0)/20.0) - variables[12] = 1.0/(1.0+exp((-states[0]-42.0)/10.0)) - rates[2] = variables[11]*(1.0-states[2])-variables[12]*states[2] - variables[15] = 0.0001*(-states[0]-50.0)/(exp((-states[0]-50.0)/10.0)-1.0) - variables[16] = 0.002*exp((-states[0]-90.0)/80.0) - rates[3] = variables[15]*(1.0-states[3])-variables[16]*states[3] + 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] def compute_variables(voi, states, rates, constants, computed_constants, algebraic): - variables[1] = variables[4]*(states[0]-variables[5]) - variables[6] = pow(states[1], 3.0)*states[2]*variables[7] - variables[0] = (variables[6]+0.14)*(states[0]-variables[8]) - variables[9] = 0.1*(-states[0]-48.0)/(exp((-states[0]-48.0)/15.0)-1.0) - variables[10] = 0.12*(states[0]+8.0)/(exp((states[0]+8.0)/5.0)-1.0) - variables[11] = 0.17*exp((-states[0]-90.0)/20.0) - variables[12] = 1.0/(1.0+exp((-states[0]-42.0)/10.0)) - variables[13] = 1.2*exp((-states[0]-90.0)/50.0)+0.015*exp((states[0]+90.0)/60.0) - variables[14] = 1.2*pow(states[3], 4.0) - variables[2] = (variables[13]+variables[14])*(states[0]+100.0) - variables[15] = 0.0001*(-states[0]-50.0)/(exp((-states[0]-50.0)/10.0)-1.0) - variables[16] = 0.002*exp((-states[0]-90.0)/80.0) + 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) diff --git a/tests/resources/generator/ode_computed_var_on_rhs/model.c b/tests/resources/generator/ode_computed_var_on_rhs/model.c index 741fc1a1ed..1bf89a3b88 100644 --- a/tests/resources/generator/ode_computed_var_on_rhs/model.c +++ b/tests/resources/generator/ode_computed_var_on_rhs/model.c @@ -52,7 +52,7 @@ void deleteArray(double *array) void initialiseVariables(double *states, double *rates, double *constants) { - variables[0] = 1.0; + computedConstants[0] = 1.0; states[0] = 1.0; } @@ -62,7 +62,7 @@ void computeComputedConstants(double *constants, double *computedConstants) void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic) { - rates[0] = variables[0]; + rates[0] = computedConstants[0]; } void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic) diff --git a/tests/resources/generator/ode_computed_var_on_rhs/model.py b/tests/resources/generator/ode_computed_var_on_rhs/model.py index 865bb0a917..e60d2476d8 100644 --- a/tests/resources/generator/ode_computed_var_on_rhs/model.py +++ b/tests/resources/generator/ode_computed_var_on_rhs/model.py @@ -41,7 +41,7 @@ def create_variables_array(): def initialise_variables(states, rates, constants): - variables[0] = 1.0 + computed_constants[0] = 1.0 states[0] = 1.0 @@ -50,7 +50,7 @@ def compute_computed_constants(constants, computed_constants): def compute_rates(voi, states, rates, constants, computed_constants, algebraic): - rates[0] = variables[0] + rates[0] = computed_constants[0] def compute_variables(voi, states, rates, constants, computed_constants, algebraic): diff --git a/tests/resources/generator/ode_computed_var_on_rhs_one_component/model.c b/tests/resources/generator/ode_computed_var_on_rhs_one_component/model.c index 2bc00c84fa..cf371f670a 100644 --- a/tests/resources/generator/ode_computed_var_on_rhs_one_component/model.c +++ b/tests/resources/generator/ode_computed_var_on_rhs_one_component/model.c @@ -52,7 +52,7 @@ void deleteArray(double *array) void initialiseVariables(double *states, double *rates, double *constants) { - variables[0] = 1.0; + computedConstants[0] = 1.0; states[0] = 1.0; } @@ -62,7 +62,7 @@ void computeComputedConstants(double *constants, double *computedConstants) void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic) { - rates[0] = variables[0]; + rates[0] = computedConstants[0]; } void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic) diff --git a/tests/resources/generator/ode_computed_var_on_rhs_one_component/model.py b/tests/resources/generator/ode_computed_var_on_rhs_one_component/model.py index 34f7dfbc53..847ad0446a 100644 --- a/tests/resources/generator/ode_computed_var_on_rhs_one_component/model.py +++ b/tests/resources/generator/ode_computed_var_on_rhs_one_component/model.py @@ -41,7 +41,7 @@ def create_variables_array(): def initialise_variables(states, rates, constants): - variables[0] = 1.0 + computed_constants[0] = 1.0 states[0] = 1.0 @@ -50,7 +50,7 @@ def compute_computed_constants(constants, computed_constants): def compute_rates(voi, states, rates, constants, computed_constants, algebraic): - rates[0] = variables[0] + rates[0] = computed_constants[0] def compute_variables(voi, states, rates, constants, computed_constants, algebraic): diff --git a/tests/resources/generator/ode_const_var_on_rhs/model.c b/tests/resources/generator/ode_const_var_on_rhs/model.c index 65d922d8b1..da29f52f60 100644 --- a/tests/resources/generator/ode_const_var_on_rhs/model.c +++ b/tests/resources/generator/ode_const_var_on_rhs/model.c @@ -52,7 +52,7 @@ void deleteArray(double *array) void initialiseVariables(double *states, double *rates, double *constants) { - variables[0] = 1.0; + constants[0] = 1.0; states[0] = 1.0; } @@ -62,7 +62,7 @@ void computeComputedConstants(double *constants, double *computedConstants) void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic) { - rates[0] = variables[0]; + rates[0] = constants[0]; } void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic) diff --git a/tests/resources/generator/ode_const_var_on_rhs/model.py b/tests/resources/generator/ode_const_var_on_rhs/model.py index e2df2355f5..351e628e47 100644 --- a/tests/resources/generator/ode_const_var_on_rhs/model.py +++ b/tests/resources/generator/ode_const_var_on_rhs/model.py @@ -41,7 +41,7 @@ def create_variables_array(): def initialise_variables(states, rates, constants): - variables[0] = 1.0 + constants[0] = 1.0 states[0] = 1.0 @@ -50,7 +50,7 @@ def compute_computed_constants(constants, computed_constants): def compute_rates(voi, states, rates, constants, computed_constants, algebraic): - rates[0] = variables[0] + rates[0] = constants[0] def compute_variables(voi, states, rates, constants, computed_constants, algebraic): diff --git a/tests/resources/generator/ode_const_var_on_rhs_one_component/model.c b/tests/resources/generator/ode_const_var_on_rhs_one_component/model.c index 8ea505b7f0..9f18d3d5e9 100644 --- a/tests/resources/generator/ode_const_var_on_rhs_one_component/model.c +++ b/tests/resources/generator/ode_const_var_on_rhs_one_component/model.c @@ -52,7 +52,7 @@ void deleteArray(double *array) void initialiseVariables(double *states, double *rates, double *constants) { - variables[0] = 1.0; + constants[0] = 1.0; states[0] = 1.0; } @@ -62,7 +62,7 @@ void computeComputedConstants(double *constants, double *computedConstants) void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic) { - rates[0] = variables[0]; + rates[0] = constants[0]; } void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic) diff --git a/tests/resources/generator/ode_const_var_on_rhs_one_component/model.py b/tests/resources/generator/ode_const_var_on_rhs_one_component/model.py index 939cc09a0c..0ed240fa53 100644 --- a/tests/resources/generator/ode_const_var_on_rhs_one_component/model.py +++ b/tests/resources/generator/ode_const_var_on_rhs_one_component/model.py @@ -41,7 +41,7 @@ def create_variables_array(): def initialise_variables(states, rates, constants): - variables[0] = 1.0 + constants[0] = 1.0 states[0] = 1.0 @@ -50,7 +50,7 @@ def compute_computed_constants(constants, computed_constants): def compute_rates(voi, states, rates, constants, computed_constants, algebraic): - rates[0] = variables[0] + rates[0] = constants[0] def compute_variables(voi, states, rates, constants, computed_constants, algebraic): diff --git a/tests/resources/generator/ode_multiple_dependent_odes/model.c b/tests/resources/generator/ode_multiple_dependent_odes/model.c index bab99e785c..89cfc22b72 100644 --- a/tests/resources/generator/ode_multiple_dependent_odes/model.c +++ b/tests/resources/generator/ode_multiple_dependent_odes/model.c @@ -53,7 +53,7 @@ void deleteArray(double *array) void initialiseVariables(double *states, double *rates, double *constants) { - variables[0] = 1.0; + constants[0] = 1.0; states[0] = -2.0; states[1] = 0.0; } @@ -65,7 +65,7 @@ void computeComputedConstants(double *constants, double *computedConstants) void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic) { rates[0] = states[1]*1.0; - rates[1] = (variables[0]*(1.0-pow(states[0], 2.0))*states[1]-states[0])*1.0; + rates[1] = (constants[0]*(1.0-pow(states[0], 2.0))*states[1]-states[0])*1.0; } void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic) diff --git a/tests/resources/generator/ode_multiple_dependent_odes/model.py b/tests/resources/generator/ode_multiple_dependent_odes/model.py index 50498a2bad..34b35116b6 100644 --- a/tests/resources/generator/ode_multiple_dependent_odes/model.py +++ b/tests/resources/generator/ode_multiple_dependent_odes/model.py @@ -42,7 +42,7 @@ def create_variables_array(): def initialise_variables(states, rates, constants): - variables[0] = 1.0 + constants[0] = 1.0 states[0] = -2.0 states[1] = 0.0 @@ -53,7 +53,7 @@ def compute_computed_constants(constants, computed_constants): def compute_rates(voi, states, rates, constants, computed_constants, algebraic): rates[0] = states[1]*1.0 - rates[1] = (variables[0]*(1.0-pow(states[0], 2.0))*states[1]-states[0])*1.0 + rates[1] = (constants[0]*(1.0-pow(states[0], 2.0))*states[1]-states[0])*1.0 def compute_variables(voi, states, rates, constants, computed_constants, algebraic): diff --git a/tests/resources/generator/ode_multiple_dependent_odes_one_component/model.c b/tests/resources/generator/ode_multiple_dependent_odes_one_component/model.c index c5e7e02a6a..00d0e6e7a7 100644 --- a/tests/resources/generator/ode_multiple_dependent_odes_one_component/model.c +++ b/tests/resources/generator/ode_multiple_dependent_odes_one_component/model.c @@ -53,7 +53,7 @@ void deleteArray(double *array) void initialiseVariables(double *states, double *rates, double *constants) { - variables[0] = 1.0; + constants[0] = 1.0; states[0] = -2.0; states[1] = 0.0; } @@ -65,7 +65,7 @@ void computeComputedConstants(double *constants, double *computedConstants) void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic) { rates[0] = states[1]*1.0; - rates[1] = (variables[0]*(1.0-pow(states[0], 2.0))*states[1]-states[0])*1.0; + rates[1] = (constants[0]*(1.0-pow(states[0], 2.0))*states[1]-states[0])*1.0; } void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic) diff --git a/tests/resources/generator/ode_multiple_dependent_odes_one_component/model.py b/tests/resources/generator/ode_multiple_dependent_odes_one_component/model.py index d5b1bf1b9a..59377dde9e 100644 --- a/tests/resources/generator/ode_multiple_dependent_odes_one_component/model.py +++ b/tests/resources/generator/ode_multiple_dependent_odes_one_component/model.py @@ -42,7 +42,7 @@ def create_variables_array(): def initialise_variables(states, rates, constants): - variables[0] = 1.0 + constants[0] = 1.0 states[0] = -2.0 states[1] = 0.0 @@ -53,7 +53,7 @@ def compute_computed_constants(constants, computed_constants): def compute_rates(voi, states, rates, constants, computed_constants, algebraic): rates[0] = states[1]*1.0 - rates[1] = (variables[0]*(1.0-pow(states[0], 2.0))*states[1]-states[0])*1.0 + rates[1] = (constants[0]*(1.0-pow(states[0], 2.0))*states[1]-states[0])*1.0 def compute_variables(voi, states, rates, constants, computed_constants, algebraic): diff --git a/tests/resources/generator/ode_multiple_odes_with_same_name/model.c b/tests/resources/generator/ode_multiple_odes_with_same_name/model.c index 967c844565..b3c86f5bbf 100644 --- a/tests/resources/generator/ode_multiple_odes_with_same_name/model.c +++ b/tests/resources/generator/ode_multiple_odes_with_same_name/model.c @@ -53,7 +53,7 @@ void deleteArray(double *array) void initialiseVariables(double *states, double *rates, double *constants) { - variables[0] = 1.0; + constants[0] = 1.0; states[0] = 1.0; states[1] = 1.0; } @@ -65,7 +65,7 @@ void computeComputedConstants(double *constants, double *computedConstants) void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic) { rates[0] = 1.0; - rates[1] = variables[0]; + rates[1] = constants[0]; } void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic) diff --git a/tests/resources/generator/ode_multiple_odes_with_same_name/model.py b/tests/resources/generator/ode_multiple_odes_with_same_name/model.py index 8ac8235fc0..93bd5d2fd4 100644 --- a/tests/resources/generator/ode_multiple_odes_with_same_name/model.py +++ b/tests/resources/generator/ode_multiple_odes_with_same_name/model.py @@ -42,7 +42,7 @@ def create_variables_array(): def initialise_variables(states, rates, constants): - variables[0] = 1.0 + constants[0] = 1.0 states[0] = 1.0 states[1] = 1.0 @@ -53,7 +53,7 @@ def compute_computed_constants(constants, computed_constants): def compute_rates(voi, states, rates, constants, computed_constants, algebraic): rates[0] = 1.0 - rates[1] = variables[0] + rates[1] = constants[0] def compute_variables(voi, states, rates, constants, computed_constants, algebraic): diff --git a/tests/resources/generator/robertson_model_1966/model.dae.c b/tests/resources/generator/robertson_model_1966/model.dae.c index 1f99605fa1..d25ae1df36 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; - variables[2] = u[0]; + algebraic[2] = u[0]; - f[0] = 1.0-(states[0]+states[1]+variables[2]); + f[0] = 1.0-(states[0]+states[1]+algebraic[2]); } 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] = variables[2]; + u[0] = algebraic[2]; nlaSolve(objectiveFunction0, u, 1, &rfi); - variables[2] = u[0]; + algebraic[2] = u[0]; } void initialiseVariables(double *states, double *rates, double *constants) { - variables[0] = 0.04; - variables[1] = 1.0e4; - variables[2] = 0.0; - variables[3] = 3.0e7; + constants[0] = 0.04; + constants[1] = 1.0e4; + algebraic[2] = 0.0; + constants[3] = 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] = -variables[0]*states[0]+variables[1]*states[1]*variables[2]; - rates[1] = variables[0]*states[0]-variables[3]*pow(states[1], 2.0)-variables[1]*states[1]*variables[2]; + 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]; } void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic) { findRoot0(voi, states, rates, variables); - variables[4] = 10000.0*states[1]; + algebraic[4] = 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 02d98e3c79..a01a61531f 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] - variables[2] = u[0] + algebraic[2] = u[0] - f[0] = 1.0-(states[0]+states[1]+variables[2]) + f[0] = 1.0-(states[0]+states[1]+algebraic[2]) def find_root_0(voi, states, rates, variables): u = [nan]*1 - u[0] = variables[2] + u[0] = algebraic[2] u = nla_solve(objective_function_0, u, 1, [voi, states, rates, variables]) - variables[2] = u[0] + algebraic[2] = u[0] def initialise_variables(states, rates, constants): - variables[0] = 0.04 - variables[1] = 1.0e4 - variables[2] = 0.0 - variables[3] = 3.0e7 + constants[0] = 0.04 + constants[1] = 1.0e4 + algebraic[2] = 0.0 + constants[3] = 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] = -variables[0]*states[0]+variables[1]*states[1]*variables[2] - rates[1] = variables[0]*states[0]-variables[3]*pow(states[1], 2.0)-variables[1]*states[1]*variables[2] + 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] def compute_variables(voi, states, rates, constants, computed_constants, algebraic): find_root_0(voi, states, rates, variables) - variables[4] = 10000.0*states[1] + algebraic[4] = 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 755412f68b..c513ea1bd3 100644 --- a/tests/resources/generator/robertson_model_1966/model.ode.c +++ b/tests/resources/generator/robertson_model_1966/model.ode.c @@ -57,9 +57,9 @@ void deleteArray(double *array) void initialiseVariables(double *states, double *rates, double *constants) { - variables[0] = 0.04; - variables[1] = 1.0e4; - variables[2] = 3.0e7; + constants[0] = 0.04; + constants[1] = 1.0e4; + constants[2] = 3.0e7; states[0] = 1.0; states[1] = 0.0; states[2] = 0.0; @@ -71,12 +71,12 @@ void computeComputedConstants(double *constants, double *computedConstants) void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic) { - rates[0] = -variables[0]*states[0]+variables[1]*states[2]*states[1]; - rates[2] = variables[0]*states[0]-variables[2]*pow(states[2], 2.0)-variables[1]*states[2]*states[1]; - rates[1] = variables[2]*pow(states[2], 2.0); + rates[0] = -constants[0]*states[0]+constants[1]*states[2]*states[1]; + rates[2] = constants[0]*states[0]-constants[2]*pow(states[2], 2.0)-constants[1]*states[2]*states[1]; + rates[1] = constants[2]*pow(states[2], 2.0); } void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic) { - variables[3] = 10000.0*states[2]; + algebraic[3] = 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 5fba7eba4d..5724071fcd 100644 --- a/tests/resources/generator/robertson_model_1966/model.ode.py +++ b/tests/resources/generator/robertson_model_1966/model.ode.py @@ -46,9 +46,9 @@ def create_variables_array(): def initialise_variables(states, rates, constants): - variables[0] = 0.04 - variables[1] = 1.0e4 - variables[2] = 3.0e7 + constants[0] = 0.04 + constants[1] = 1.0e4 + constants[2] = 3.0e7 states[0] = 1.0 states[1] = 0.0 states[2] = 0.0 @@ -59,10 +59,10 @@ def compute_computed_constants(constants, computed_constants): def compute_rates(voi, states, rates, constants, computed_constants, algebraic): - rates[0] = -variables[0]*states[0]+variables[1]*states[2]*states[1] - rates[2] = variables[0]*states[0]-variables[2]*pow(states[2], 2.0)-variables[1]*states[2]*states[1] - rates[1] = variables[2]*pow(states[2], 2.0) + rates[0] = -constants[0]*states[0]+constants[1]*states[2]*states[1] + rates[2] = constants[0]*states[0]-constants[2]*pow(states[2], 2.0)-constants[1]*states[2]*states[1] + rates[1] = constants[2]*pow(states[2], 2.0) def compute_variables(voi, states, rates, constants, computed_constants, algebraic): - variables[3] = 10000.0*states[2] + algebraic[3] = 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 29f467ca1f..6dfb92f02b 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) { - variables[1] = 0.0; - variables[3] = 0.75; - variables[4] = 2.0/3.14159265358979; - variables[5] = 2.0*3.14159265358979; - variables[6] = 3.14159265358979/2.0; - variables[7] = 3.14159265358979; - variables[8] = 3.0*3.14159265358979/2.0; - states[0] = variables[1]; + 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]; } void computeComputedConstants(double *constants, double *computedConstants) @@ -82,7 +82,7 @@ void computeRates(double voi, double *states, double *rates, double *constants, void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic) { - variables[0] = sin(voi); - variables[9] = (voi < variables[6])?voi*variables[4]-0.5:(voi < variables[7])?(3.14159265358979-voi)*variables[4]-0.5:(voi < variables[8])?(voi-3.14159265358979)*variables[4]-0.5:(variables[5]-voi)*variables[4]-0.5; - variables[2] = (voi < variables[6])?-variables[9]*variables[9]+variables[3]+variables[9]:(voi < variables[7])?-variables[9]*variables[9]+variables[3]+variables[9]:(voi < variables[8])?variables[9]*variables[9]-variables[3]-variables[9]:variables[9]*variables[9]-variables[3]-variables[9]; + 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]; } diff --git a/tests/resources/generator/sine_model_imports/model.py b/tests/resources/generator/sine_model_imports/model.py index 3319297ff1..2c2c463977 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): - variables[1] = 0.0 - variables[3] = 0.75 - variables[4] = 2.0/3.14159265358979 - variables[5] = 2.0*3.14159265358979 - variables[6] = 3.14159265358979/2.0 - variables[7] = 3.14159265358979 - variables[8] = 3.0*3.14159265358979/2.0 - states[0] = variables[1] + 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] def compute_computed_constants(constants, computed_constants): @@ -73,6 +73,6 @@ def compute_rates(voi, states, rates, constants, computed_constants, algebraic): def compute_variables(voi, states, rates, constants, computed_constants, algebraic): - variables[0] = sin(voi) - variables[9] = voi*variables[4]-0.5 if lt_func(voi, variables[6]) else (3.14159265358979-voi)*variables[4]-0.5 if lt_func(voi, variables[7]) else (voi-3.14159265358979)*variables[4]-0.5 if lt_func(voi, variables[8]) else (variables[5]-voi)*variables[4]-0.5 - variables[2] = -variables[9]*variables[9]+variables[3]+variables[9] if lt_func(voi, variables[6]) else -variables[9]*variables[9]+variables[3]+variables[9] if lt_func(voi, variables[7]) else variables[9]*variables[9]-variables[3]-variables[9] if lt_func(voi, variables[8]) else variables[9]*variables[9]-variables[3]-variables[9] + 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] 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 1d5fac7e88..8167206cd0 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) { - variables[1] = 1.1; - variables[2] = 21262500.0; - variables[3] = 150.0; - variables[4] = 3402000.0; - variables[5] = 2.0; - variables[6] = 2902500.0; - variables[7] = 810000.0; - variables[8] = 247140.0; - variables[9] = externalVariable(variables, 9); + 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); } 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) { - variables[9] = externalVariable(variables, 9); - variables[0] = variables[1]*(variables[2]*variables[3]-variables[4]*variables[5])/(variables[6]*variables[5]+variables[9]*variables[3]+variables[8]*variables[5]*variables[3]+variables[7]); + 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]); } 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 8f2c23fba0..3c5f0470c2 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): - variables[1] = 1.1 - variables[2] = 21262500.0 - variables[3] = 150.0 - variables[4] = 3402000.0 - variables[5] = 2.0 - variables[6] = 2902500.0 - variables[7] = 810000.0 - variables[8] = 247140.0 - variables[9] = external_variable(variables, 9) + 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) 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): - variables[9] = external_variable(variables, 9) - variables[0] = variables[1]*(variables[2]*variables[3]-variables[4]*variables[5])/(variables[6]*variables[5]+variables[9]*variables[3]+variables[8]*variables[5]*variables[3]+variables[7]) + 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]) diff --git a/tests/resources/generator/variable_initialised_using_a_constant/model.c b/tests/resources/generator/variable_initialised_using_a_constant/model.c index bbd31e50ca..79800b918a 100644 --- a/tests/resources/generator/variable_initialised_using_a_constant/model.c +++ b/tests/resources/generator/variable_initialised_using_a_constant/model.c @@ -52,8 +52,8 @@ void deleteArray(double *array) void initialiseVariables(double *states, double *rates, double *constants) { - variables[0] = 7.0; - states[0] = variables[0]; + constants[0] = 7.0; + states[0] = constants[0]; } void computeComputedConstants(double *constants, double *computedConstants) diff --git a/tests/resources/generator/variable_initialised_using_a_constant/model.py b/tests/resources/generator/variable_initialised_using_a_constant/model.py index e6b607b12b..54a1159391 100644 --- a/tests/resources/generator/variable_initialised_using_a_constant/model.py +++ b/tests/resources/generator/variable_initialised_using_a_constant/model.py @@ -41,8 +41,8 @@ def create_variables_array(): def initialise_variables(states, rates, constants): - variables[0] = 7.0 - states[0] = variables[0] + constants[0] = 7.0 + states[0] = constants[0] def compute_computed_constants(constants, computed_constants):