From b32d169a7d08b41959e00927e23c1a31f27ea1d0 Mon Sep 17 00:00:00 2001 From: Alan Garny Date: Mon, 19 Aug 2024 11:13:44 +0200 Subject: [PATCH] Generator: renamed the "external" array to "externals". Oversight on my part! --- src/generatorprofile.cpp | 4 +-- src/generatorprofilesha1values.h | 4 +-- .../bindings/python/test_generator_profile.py | 2 +- tests/generator/generatorprofile.cpp | 2 +- .../model.external.c | 4 +-- .../model.external.py | 4 +-- .../model.external.c | 2 +- .../model.external.py | 2 +- .../model.three.externals.c | 6 ++--- .../model.three.externals.py | 6 ++--- .../cell_geometry_model/model.external.c | 6 ++--- .../cell_geometry_model/model.external.py | 6 ++--- .../model.algebraic.c | 6 ++--- .../model.algebraic.py | 6 ++--- .../model.computed.constant.c | 8 +++--- .../model.computed.constant.py | 8 +++--- .../model.constant.c | 6 ++--- .../model.constant.py | 6 ++--- .../model.dependent.algebraic.c | 12 ++++----- .../model.dependent.algebraic.py | 12 ++++----- .../model.dependent.computed.constant.c | 20 +++++++------- .../model.dependent.computed.constant.py | 20 +++++++------- .../model.dependent.constant.c | 14 +++++----- .../model.dependent.constant.py | 14 +++++----- .../model.dependent.state.c | 24 ++++++++--------- .../model.dependent.state.py | 24 ++++++++--------- .../model.external.c | 26 +++++++++---------- .../model.external.py | 26 +++++++++---------- .../model.state.c | 8 +++--- .../model.state.py | 8 +++--- .../model.c | 4 +-- .../model.py | 4 +-- 32 files changed, 152 insertions(+), 152 deletions(-) diff --git a/src/generatorprofile.cpp b/src/generatorprofile.cpp index 8de812817c..08d9b9a825 100644 --- a/src/generatorprofile.cpp +++ b/src/generatorprofile.cpp @@ -288,7 +288,7 @@ void GeneratorProfile::GeneratorProfileImpl::loadProfile(GeneratorProfile::Profi mConstantsArrayString = "constants"; mComputedConstantsArrayString = "computedConstants"; mAlgebraicArrayString = "algebraic"; - mExternalArrayString = "external"; + mExternalArrayString = "externals"; 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"; @@ -729,7 +729,7 @@ void GeneratorProfile::GeneratorProfileImpl::loadProfile(GeneratorProfile::Profi mConstantsArrayString = "constants"; mComputedConstantsArrayString = "computed_constants"; mAlgebraicArrayString = "algebraic"; - mExternalArrayString = "external"; + mExternalArrayString = "externals"; mExternalVariableMethodTypeDefinitionFamString = ""; mExternalVariableMethodTypeDefinitionFdmString = ""; diff --git a/src/generatorprofilesha1values.h b/src/generatorprofilesha1values.h index dacc0b264f..6d03642adf 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[] = "323f0e5824d5c794c28f34dda5e7410efc836e62"; -static const char PYTHON_GENERATOR_PROFILE_SHA1[] = "3f6672212636b5179b23b9664cead525f54f665f"; +static const char C_GENERATOR_PROFILE_SHA1[] = "ad23abd7fbd49d6b76113c14b0d2ec4c7df09d41"; +static const char PYTHON_GENERATOR_PROFILE_SHA1[] = "cced8fe15a79248bc3902c9f45637b053243fc98"; } // namespace libcellml diff --git a/tests/bindings/python/test_generator_profile.py b/tests/bindings/python/test_generator_profile.py index c030ba9c8b..d4d8703e51 100644 --- a/tests/bindings/python/test_generator_profile.py +++ b/tests/bindings/python/test_generator_profile.py @@ -1667,7 +1667,7 @@ def test_external_array_string(self): g = GeneratorProfile() - self.assertEqual('external', g.externalArrayString()) + self.assertEqual('externals', g.externalArrayString()) g.setExternalArrayString(GeneratorProfileTestCase.VALUE) self.assertEqual(GeneratorProfileTestCase.VALUE, g.externalArrayString()) diff --git a/tests/generator/generatorprofile.cpp b/tests/generator/generatorprofile.cpp index 155af5a07e..62bdb259fd 100644 --- a/tests/generator/generatorprofile.cpp +++ b/tests/generator/generatorprofile.cpp @@ -340,7 +340,7 @@ TEST(GeneratorProfile, defaultMiscellaneousValues) EXPECT_EQ("constants", generatorProfile->constantsArrayString()); EXPECT_EQ("computedConstants", generatorProfile->computedConstantsArrayString()); EXPECT_EQ("algebraic", generatorProfile->algebraicArrayString()); - EXPECT_EQ("external", generatorProfile->externalArrayString()); + EXPECT_EQ("externals", generatorProfile->externalArrayString()); 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)); 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 5cea89727f..670484b6a5 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 @@ -86,6 +86,6 @@ void computeComputedConstants(double *constants, double *computedConstants) void computeVariables(double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { - external[0] = externalVariable(variables, 0); - algebraic[0] = external[0]; + externals[0] = externalVariable(variables, 0); + algebraic[0] = externals[0]; } 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 8ce48759d5..08357f1eed 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 @@ -52,5 +52,5 @@ def compute_computed_constants(constants, computed_constants): def compute_variables(constants, computed_constants, algebraic, external_variable): - external[0] = external_variable(variables, 0) - algebraic[0] = external[0] + externals[0] = external_variable(variables, 0) + algebraic[0] = externals[0] diff --git a/tests/resources/generator/algebraic_eqn_with_one_non_isolated_unknown/model.external.c b/tests/resources/generator/algebraic_eqn_with_one_non_isolated_unknown/model.external.c index 2d502bbe6e..ba2a7e9056 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 @@ -91,5 +91,5 @@ void computeComputedConstants(double *constants, double *computedConstants) void computeVariables(double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { - external[0] = externalVariable(variables, 0); + externals[0] = externalVariable(variables, 0); } diff --git a/tests/resources/generator/algebraic_eqn_with_one_non_isolated_unknown/model.external.py b/tests/resources/generator/algebraic_eqn_with_one_non_isolated_unknown/model.external.py index 67217abb1b..1253e4dad2 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 @@ -56,4 +56,4 @@ def compute_computed_constants(constants, computed_constants): def compute_variables(constants, computed_constants, algebraic, external_variable): - external[0] = external_variable(variables, 0) + externals[0] = external_variable(variables, 0) 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 620fc55239..25af29adaa 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 @@ -87,7 +87,7 @@ void computeComputedConstants(double *constants, double *computedConstants) void computeVariables(double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { - external[0] = externalVariable(variables, 0); - external[1] = externalVariable(variables, 1); - external[2] = externalVariable(variables, 2); + externals[0] = externalVariable(variables, 0); + externals[1] = externalVariable(variables, 1); + externals[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 1b2b68c5fa..fbc56b7156 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 @@ -53,6 +53,6 @@ def compute_computed_constants(constants, computed_constants): def compute_variables(constants, computed_constants, algebraic, external_variable): - external[0] = external_variable(variables, 0) - external[1] = external_variable(variables, 1) - external[2] = external_variable(variables, 2) + externals[0] = external_variable(variables, 0) + externals[1] = external_variable(variables, 1) + externals[2] = external_variable(variables, 2) diff --git a/tests/resources/generator/cell_geometry_model/model.external.c b/tests/resources/generator/cell_geometry_model/model.external.c index c4c33c7c07..a57c6692c0 100644 --- a/tests/resources/generator/cell_geometry_model/model.external.c +++ b/tests/resources/generator/cell_geometry_model/model.external.c @@ -88,8 +88,8 @@ void computeComputedConstants(double *constants, double *computedConstants) void computeVariables(double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { - external[0] = externalVariable(variables, 0); - external[1] = externalVariable(variables, 1); - algebraic[0] = 1000.0*3.14*external[1]*external[1]*external[0]; + externals[0] = externalVariable(variables, 0); + externals[1] = externalVariable(variables, 1); + algebraic[0] = 1000.0*3.14*externals[1]*externals[1]*externals[0]; algebraic[1] = 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 8f9555d5cb..e220d2e73d 100644 --- a/tests/resources/generator/cell_geometry_model/model.external.py +++ b/tests/resources/generator/cell_geometry_model/model.external.py @@ -54,7 +54,7 @@ def compute_computed_constants(constants, computed_constants): def compute_variables(constants, computed_constants, algebraic, external_variable): - external[0] = external_variable(variables, 0) - external[1] = external_variable(variables, 1) - algebraic[0] = 1000.0*3.14*external[1]*external[1]*external[0] + externals[0] = external_variable(variables, 0) + externals[1] = external_variable(variables, 1) + algebraic[0] = 1000.0*3.14*externals[1]*externals[1]*externals[0] algebraic[1] = 0.02*algebraic[0] 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 3ca0c5371b..cdeae6291f 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 @@ -135,11 +135,11 @@ void computeComputedConstants(double *constants, double *computedConstants) void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { - external[0] = externalVariable(voi, states, rates, variables, 0); + externals[0] = externalVariable(voi, states, rates, variables, 0); algebraic[0] = constants[2]*(states[0]-computedConstants[0]); algebraic[1] = constants[4]*pow(states[3], 4.0)*(states[0]-computedConstants[2]); algebraic[2] = constants[3]*pow(states[2], 3.0)*states[1]*(states[0]-computedConstants[1]); - rates[0] = -(-external[0]+algebraic[2]+algebraic[1]+algebraic[0])/constants[0]; + rates[0] = -(-externals[0]+algebraic[2]+algebraic[1]+algebraic[0])/constants[0]; algebraic[3] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0); algebraic[4] = 4.0*exp(states[0]/18.0); rates[2] = algebraic[3]*(1.0-states[2])-algebraic[4]*states[2]; @@ -153,7 +153,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, ExternalVariable externalVariable) { - external[0] = externalVariable(voi, states, rates, variables, 0); + externals[0] = externalVariable(voi, states, rates, variables, 0); algebraic[0] = constants[2]*(states[0]-computedConstants[0]); algebraic[2] = constants[3]*pow(states[2], 3.0)*states[1]*(states[0]-computedConstants[1]); algebraic[3] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.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 bbc403eae2..efe508ad16 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 @@ -104,11 +104,11 @@ def compute_computed_constants(constants, computed_constants): def compute_rates(voi, states, rates, constants, computed_constants, algebraic, external_variable): - external[0] = external_variable(voi, states, rates, variables, 0) + externals[0] = external_variable(voi, states, rates, variables, 0) algebraic[0] = constants[2]*(states[0]-computed_constants[0]) algebraic[1] = constants[4]*pow(states[3], 4.0)*(states[0]-computed_constants[2]) algebraic[2] = constants[3]*pow(states[2], 3.0)*states[1]*(states[0]-computed_constants[1]) - rates[0] = -(-external[0]+algebraic[2]+algebraic[1]+algebraic[0])/constants[0] + rates[0] = -(-externals[0]+algebraic[2]+algebraic[1]+algebraic[0])/constants[0] algebraic[3] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0) algebraic[4] = 4.0*exp(states[0]/18.0) rates[2] = algebraic[3]*(1.0-states[2])-algebraic[4]*states[2] @@ -121,7 +121,7 @@ def compute_rates(voi, states, rates, constants, computed_constants, algebraic, def compute_variables(voi, states, rates, constants, computed_constants, algebraic, external_variable): - external[0] = external_variable(voi, states, rates, variables, 0) + externals[0] = external_variable(voi, states, rates, variables, 0) algebraic[0] = constants[2]*(states[0]-computed_constants[0]) algebraic[2] = constants[3]*pow(states[2], 3.0)*states[1]*(states[0]-computed_constants[1]) algebraic[3] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.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 9de4002c1f..2e6435a24e 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 @@ -135,8 +135,8 @@ void computeComputedConstants(double *constants, double *computedConstants) void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { algebraic[0] = ((voi >= 10.0) && (voi <= 10.5))?-20.0:0.0; - external[0] = externalVariable(voi, states, rates, variables, 0); - algebraic[1] = constants[2]*(states[0]-external[0]); + externals[0] = externalVariable(voi, states, rates, variables, 0); + algebraic[1] = constants[2]*(states[0]-externals[0]); algebraic[2] = constants[4]*pow(states[3], 4.0)*(states[0]-computedConstants[1]); algebraic[3] = constants[3]*pow(states[2], 3.0)*states[1]*(states[0]-computedConstants[0]); rates[0] = -(-algebraic[0]+algebraic[3]+algebraic[2]+algebraic[1])/constants[0]; @@ -153,8 +153,8 @@ void computeRates(double voi, double *states, double *rates, double *constants, void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { - external[0] = externalVariable(voi, states, rates, variables, 0); - algebraic[1] = constants[2]*(states[0]-external[0]); + externals[0] = externalVariable(voi, states, rates, variables, 0); + algebraic[1] = constants[2]*(states[0]-externals[0]); algebraic[3] = constants[3]*pow(states[2], 3.0)*states[1]*(states[0]-computedConstants[0]); algebraic[4] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0); algebraic[5] = 4.0*exp(states[0]/18.0); 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 a9fd749a9f..a1324eb79a 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 @@ -104,8 +104,8 @@ def compute_computed_constants(constants, computed_constants): def compute_rates(voi, states, rates, constants, computed_constants, algebraic, external_variable): algebraic[0] = -20.0 if and_func(geq_func(voi, 10.0), leq_func(voi, 10.5)) else 0.0 - external[0] = external_variable(voi, states, rates, variables, 0) - algebraic[1] = constants[2]*(states[0]-external[0]) + externals[0] = external_variable(voi, states, rates, variables, 0) + algebraic[1] = constants[2]*(states[0]-externals[0]) algebraic[2] = constants[4]*pow(states[3], 4.0)*(states[0]-computed_constants[1]) algebraic[3] = constants[3]*pow(states[2], 3.0)*states[1]*(states[0]-computed_constants[0]) rates[0] = -(-algebraic[0]+algebraic[3]+algebraic[2]+algebraic[1])/constants[0] @@ -121,8 +121,8 @@ def compute_rates(voi, states, rates, constants, computed_constants, algebraic, def compute_variables(voi, states, rates, constants, computed_constants, algebraic, external_variable): - external[0] = external_variable(voi, states, rates, variables, 0) - algebraic[1] = constants[2]*(states[0]-external[0]) + externals[0] = external_variable(voi, states, rates, variables, 0) + algebraic[1] = constants[2]*(states[0]-externals[0]) algebraic[3] = constants[3]*pow(states[2], 3.0)*states[1]*(states[0]-computed_constants[0]) algebraic[4] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0) algebraic[5] = 4.0*exp(states[0]/18.0) 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 83398ea28e..6d271f592c 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 @@ -135,11 +135,11 @@ void computeComputedConstants(double *constants, double *computedConstants) void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { algebraic[0] = ((voi >= 10.0) && (voi <= 10.5))?-20.0:0.0; - external[0] = externalVariable(voi, states, rates, variables, 0); + externals[0] = externalVariable(voi, states, rates, variables, 0); algebraic[1] = constants[1]*(states[0]-computedConstants[0]); algebraic[2] = constants[3]*pow(states[3], 4.0)*(states[0]-computedConstants[2]); algebraic[3] = constants[2]*pow(states[2], 3.0)*states[1]*(states[0]-computedConstants[1]); - rates[0] = -(-algebraic[0]+algebraic[3]+algebraic[2]+algebraic[1])/external[0]; + rates[0] = -(-algebraic[0]+algebraic[3]+algebraic[2]+algebraic[1])/externals[0]; algebraic[4] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0); algebraic[5] = 4.0*exp(states[0]/18.0); rates[2] = algebraic[4]*(1.0-states[2])-algebraic[5]*states[2]; @@ -162,5 +162,5 @@ void computeVariables(double voi, double *states, double *rates, double *constan algebraic[2] = constants[3]*pow(states[3], 4.0)*(states[0]-computedConstants[2]); algebraic[8] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0); algebraic[9] = 0.125*exp(states[0]/80.0); - external[0] = externalVariable(voi, states, rates, variables, 0); + externals[0] = externalVariable(voi, states, rates, variables, 0); } 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 e5b7943357..b3951a5dd8 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 @@ -104,11 +104,11 @@ def compute_computed_constants(constants, computed_constants): def compute_rates(voi, states, rates, constants, computed_constants, algebraic, external_variable): algebraic[0] = -20.0 if and_func(geq_func(voi, 10.0), leq_func(voi, 10.5)) else 0.0 - external[0] = external_variable(voi, states, rates, variables, 0) + externals[0] = external_variable(voi, states, rates, variables, 0) algebraic[1] = constants[1]*(states[0]-computed_constants[0]) algebraic[2] = constants[3]*pow(states[3], 4.0)*(states[0]-computed_constants[2]) algebraic[3] = constants[2]*pow(states[2], 3.0)*states[1]*(states[0]-computed_constants[1]) - rates[0] = -(-algebraic[0]+algebraic[3]+algebraic[2]+algebraic[1])/external[0] + rates[0] = -(-algebraic[0]+algebraic[3]+algebraic[2]+algebraic[1])/externals[0] algebraic[4] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0) algebraic[5] = 4.0*exp(states[0]/18.0) rates[2] = algebraic[4]*(1.0-states[2])-algebraic[5]*states[2] @@ -130,4 +130,4 @@ def compute_variables(voi, states, rates, constants, computed_constants, algebra algebraic[2] = constants[3]*pow(states[3], 4.0)*(states[0]-computed_constants[2]) algebraic[8] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0) algebraic[9] = 0.125*exp(states[0]/80.0) - external[0] = external_variable(voi, states, rates, variables, 0) + externals[0] = external_variable(voi, states, rates, variables, 0) 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 63f4f05721..f10c3958b8 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 @@ -135,12 +135,12 @@ void computeComputedConstants(double *constants, double *computedConstants) void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { - external[1] = externalVariable(voi, states, rates, variables, 1); - external[0] = externalVariable(voi, states, rates, variables, 0); + externals[1] = externalVariable(voi, states, rates, variables, 1); + externals[0] = externalVariable(voi, states, rates, variables, 0); algebraic[0] = constants[2]*(states[0]-computedConstants[0]); algebraic[1] = constants[4]*pow(states[3], 4.0)*(states[0]-computedConstants[2]); algebraic[2] = constants[3]*pow(states[2], 3.0)*states[1]*(states[0]-computedConstants[1]); - rates[0] = -(-external[0]+algebraic[2]+algebraic[1]+algebraic[0])/constants[0]; + rates[0] = -(-externals[0]+algebraic[2]+algebraic[1]+algebraic[0])/constants[0]; algebraic[3] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0); algebraic[4] = 4.0*exp(states[0]/18.0); rates[2] = algebraic[3]*(1.0-states[2])-algebraic[4]*states[2]; @@ -148,13 +148,13 @@ void computeRates(double voi, double *states, double *rates, double *constants, algebraic[6] = 1.0/(exp((states[0]+30.0)/10.0)+1.0); rates[1] = algebraic[5]*(1.0-states[1])-algebraic[6]*states[1]; algebraic[7] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0); - rates[3] = algebraic[7]*(1.0-states[3])-external[1]*states[3]; + rates[3] = algebraic[7]*(1.0-states[3])-externals[1]*states[3]; } void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { - external[1] = externalVariable(voi, states, rates, variables, 1); - external[0] = externalVariable(voi, states, rates, variables, 0); + externals[1] = externalVariable(voi, states, rates, variables, 1); + externals[0] = externalVariable(voi, states, rates, variables, 0); algebraic[0] = constants[2]*(states[0]-computedConstants[0]); algebraic[2] = constants[3]*pow(states[2], 3.0)*states[1]*(states[0]-computedConstants[1]); algebraic[3] = 0.1*(states[0]+25.0)/(exp((states[0]+25.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 e78d84cca9..716cafe93f 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 @@ -104,12 +104,12 @@ def compute_computed_constants(constants, computed_constants): def compute_rates(voi, states, rates, constants, computed_constants, algebraic, external_variable): - external[1] = external_variable(voi, states, rates, variables, 1) - external[0] = external_variable(voi, states, rates, variables, 0) + externals[1] = external_variable(voi, states, rates, variables, 1) + externals[0] = external_variable(voi, states, rates, variables, 0) algebraic[0] = constants[2]*(states[0]-computed_constants[0]) algebraic[1] = constants[4]*pow(states[3], 4.0)*(states[0]-computed_constants[2]) algebraic[2] = constants[3]*pow(states[2], 3.0)*states[1]*(states[0]-computed_constants[1]) - rates[0] = -(-external[0]+algebraic[2]+algebraic[1]+algebraic[0])/constants[0] + rates[0] = -(-externals[0]+algebraic[2]+algebraic[1]+algebraic[0])/constants[0] algebraic[3] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0) algebraic[4] = 4.0*exp(states[0]/18.0) rates[2] = algebraic[3]*(1.0-states[2])-algebraic[4]*states[2] @@ -117,12 +117,12 @@ def compute_rates(voi, states, rates, constants, computed_constants, algebraic, algebraic[6] = 1.0/(exp((states[0]+30.0)/10.0)+1.0) rates[1] = algebraic[5]*(1.0-states[1])-algebraic[6]*states[1] algebraic[7] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0) - rates[3] = algebraic[7]*(1.0-states[3])-external[1]*states[3] + rates[3] = algebraic[7]*(1.0-states[3])-externals[1]*states[3] def compute_variables(voi, states, rates, constants, computed_constants, algebraic, external_variable): - external[1] = external_variable(voi, states, rates, variables, 1) - external[0] = external_variable(voi, states, rates, variables, 0) + externals[1] = external_variable(voi, states, rates, variables, 1) + externals[0] = external_variable(voi, states, rates, variables, 0) algebraic[0] = constants[2]*(states[0]-computed_constants[0]) algebraic[2] = constants[3]*pow(states[2], 3.0)*states[1]*(states[0]-computed_constants[1]) algebraic[3] = 0.1*(states[0]+25.0)/(exp((states[0]+25.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 1763e10c00..08b086b89a 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 @@ -132,12 +132,12 @@ void computeComputedConstants(double *constants, double *computedConstants) void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { algebraic[0] = ((voi >= 10.0) && (voi <= 10.5))?-20.0:0.0; - external[1] = externalVariable(voi, states, rates, variables, 1); - external[0] = externalVariable(voi, states, rates, variables, 0); - algebraic[4] = external[0]-10.613; + externals[1] = externalVariable(voi, states, rates, variables, 1); + externals[0] = externalVariable(voi, states, rates, variables, 0); + algebraic[4] = externals[0]-10.613; algebraic[1] = constants[1]*(states[0]-algebraic[4]); - algebraic[2] = constants[3]*pow(states[3], 4.0)*(states[0]-external[1]); - algebraic[5] = external[0]-115.0; + algebraic[2] = constants[3]*pow(states[3], 4.0)*(states[0]-externals[1]); + algebraic[5] = externals[0]-115.0; algebraic[3] = constants[2]*pow(states[2], 3.0)*states[1]*(states[0]-algebraic[5]); rates[0] = -(-algebraic[0]+algebraic[3]+algebraic[2]+algebraic[1])/constants[0]; algebraic[6] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0); @@ -153,17 +153,17 @@ void computeRates(double voi, double *states, double *rates, double *constants, void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { - external[1] = externalVariable(voi, states, rates, variables, 1); - external[0] = externalVariable(voi, states, rates, variables, 0); - algebraic[4] = external[0]-10.613; + externals[1] = externalVariable(voi, states, rates, variables, 1); + externals[0] = externalVariable(voi, states, rates, variables, 0); + algebraic[4] = externals[0]-10.613; algebraic[1] = constants[1]*(states[0]-algebraic[4]); - algebraic[5] = external[0]-115.0; + algebraic[5] = externals[0]-115.0; algebraic[3] = constants[2]*pow(states[2], 3.0)*states[1]*(states[0]-algebraic[5]); algebraic[6] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0); algebraic[7] = 4.0*exp(states[0]/18.0); algebraic[8] = 0.07*exp(states[0]/20.0); algebraic[9] = 1.0/(exp((states[0]+30.0)/10.0)+1.0); - algebraic[2] = constants[3]*pow(states[3], 4.0)*(states[0]-external[1]); + algebraic[2] = constants[3]*pow(states[3], 4.0)*(states[0]-externals[1]); algebraic[10] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0); algebraic[11] = 0.125*exp(states[0]/80.0); } 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 2ff358773d..0a961a48b8 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 @@ -102,12 +102,12 @@ def compute_computed_constants(constants, computed_constants): def compute_rates(voi, states, rates, constants, computed_constants, algebraic, external_variable): algebraic[0] = -20.0 if and_func(geq_func(voi, 10.0), leq_func(voi, 10.5)) else 0.0 - external[1] = external_variable(voi, states, rates, variables, 1) - external[0] = external_variable(voi, states, rates, variables, 0) - algebraic[4] = external[0]-10.613 + externals[1] = external_variable(voi, states, rates, variables, 1) + externals[0] = external_variable(voi, states, rates, variables, 0) + algebraic[4] = externals[0]-10.613 algebraic[1] = constants[1]*(states[0]-algebraic[4]) - algebraic[2] = constants[3]*pow(states[3], 4.0)*(states[0]-external[1]) - algebraic[5] = external[0]-115.0 + algebraic[2] = constants[3]*pow(states[3], 4.0)*(states[0]-externals[1]) + algebraic[5] = externals[0]-115.0 algebraic[3] = constants[2]*pow(states[2], 3.0)*states[1]*(states[0]-algebraic[5]) rates[0] = -(-algebraic[0]+algebraic[3]+algebraic[2]+algebraic[1])/constants[0] algebraic[6] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0) @@ -122,16 +122,16 @@ def compute_rates(voi, states, rates, constants, computed_constants, algebraic, def compute_variables(voi, states, rates, constants, computed_constants, algebraic, external_variable): - external[1] = external_variable(voi, states, rates, variables, 1) - external[0] = external_variable(voi, states, rates, variables, 0) - algebraic[4] = external[0]-10.613 + externals[1] = external_variable(voi, states, rates, variables, 1) + externals[0] = external_variable(voi, states, rates, variables, 0) + algebraic[4] = externals[0]-10.613 algebraic[1] = constants[1]*(states[0]-algebraic[4]) - algebraic[5] = external[0]-115.0 + algebraic[5] = externals[0]-115.0 algebraic[3] = constants[2]*pow(states[2], 3.0)*states[1]*(states[0]-algebraic[5]) algebraic[6] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0) algebraic[7] = 4.0*exp(states[0]/18.0) algebraic[8] = 0.07*exp(states[0]/20.0) algebraic[9] = 1.0/(exp((states[0]+30.0)/10.0)+1.0) - algebraic[2] = constants[3]*pow(states[3], 4.0)*(states[0]-external[1]) + algebraic[2] = constants[3]*pow(states[3], 4.0)*(states[0]-externals[1]) algebraic[10] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0) algebraic[11] = 0.125*exp(states[0]/80.0) 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 bf11e3c35f..45f29d072a 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 @@ -134,12 +134,12 @@ void computeComputedConstants(double *constants, double *computedConstants) void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { algebraic[0] = ((voi >= 10.0) && (voi <= 10.5))?-20.0:0.0; - external[1] = externalVariable(voi, states, rates, variables, 1); - external[0] = externalVariable(voi, states, rates, variables, 0); + externals[1] = externalVariable(voi, states, rates, variables, 1); + externals[0] = externalVariable(voi, states, rates, variables, 0); algebraic[1] = constants[1]*(states[0]-computedConstants[0]); algebraic[2] = constants[2]*pow(states[3], 4.0)*(states[0]-computedConstants[2]); - algebraic[3] = external[1]*pow(states[2], 3.0)*states[1]*(states[0]-computedConstants[1]); - rates[0] = -(-algebraic[0]+algebraic[3]+algebraic[2]+algebraic[1])/external[0]; + algebraic[3] = externals[1]*pow(states[2], 3.0)*states[1]*(states[0]-computedConstants[1]); + rates[0] = -(-algebraic[0]+algebraic[3]+algebraic[2]+algebraic[1])/externals[0]; algebraic[4] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0); algebraic[5] = 4.0*exp(states[0]/18.0); rates[2] = algebraic[4]*(1.0-states[2])-algebraic[5]*states[2]; @@ -154,8 +154,8 @@ void computeRates(double voi, double *states, double *rates, double *constants, void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { algebraic[1] = constants[1]*(states[0]-computedConstants[0]); - external[1] = externalVariable(voi, states, rates, variables, 1); - algebraic[3] = external[1]*pow(states[2], 3.0)*states[1]*(states[0]-computedConstants[1]); + externals[1] = externalVariable(voi, states, rates, variables, 1); + algebraic[3] = externals[1]*pow(states[2], 3.0)*states[1]*(states[0]-computedConstants[1]); algebraic[4] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0); algebraic[5] = 4.0*exp(states[0]/18.0); algebraic[6] = 0.07*exp(states[0]/20.0); @@ -163,5 +163,5 @@ void computeVariables(double voi, double *states, double *rates, double *constan algebraic[2] = constants[2]*pow(states[3], 4.0)*(states[0]-computedConstants[2]); algebraic[8] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0); algebraic[9] = 0.125*exp(states[0]/80.0); - external[0] = externalVariable(voi, states, rates, variables, 0); + externals[0] = externalVariable(voi, states, rates, variables, 0); } 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 523a748540..7fb9fbb6f7 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 @@ -103,12 +103,12 @@ def compute_computed_constants(constants, computed_constants): def compute_rates(voi, states, rates, constants, computed_constants, algebraic, external_variable): algebraic[0] = -20.0 if and_func(geq_func(voi, 10.0), leq_func(voi, 10.5)) else 0.0 - external[1] = external_variable(voi, states, rates, variables, 1) - external[0] = external_variable(voi, states, rates, variables, 0) + externals[1] = external_variable(voi, states, rates, variables, 1) + externals[0] = external_variable(voi, states, rates, variables, 0) algebraic[1] = constants[1]*(states[0]-computed_constants[0]) algebraic[2] = constants[2]*pow(states[3], 4.0)*(states[0]-computed_constants[2]) - algebraic[3] = external[1]*pow(states[2], 3.0)*states[1]*(states[0]-computed_constants[1]) - rates[0] = -(-algebraic[0]+algebraic[3]+algebraic[2]+algebraic[1])/external[0] + algebraic[3] = externals[1]*pow(states[2], 3.0)*states[1]*(states[0]-computed_constants[1]) + rates[0] = -(-algebraic[0]+algebraic[3]+algebraic[2]+algebraic[1])/externals[0] algebraic[4] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0) algebraic[5] = 4.0*exp(states[0]/18.0) rates[2] = algebraic[4]*(1.0-states[2])-algebraic[5]*states[2] @@ -122,8 +122,8 @@ def compute_rates(voi, states, rates, constants, computed_constants, algebraic, def compute_variables(voi, states, rates, constants, computed_constants, algebraic, external_variable): algebraic[1] = constants[1]*(states[0]-computed_constants[0]) - external[1] = external_variable(voi, states, rates, variables, 1) - algebraic[3] = external[1]*pow(states[2], 3.0)*states[1]*(states[0]-computed_constants[1]) + externals[1] = external_variable(voi, states, rates, variables, 1) + algebraic[3] = externals[1]*pow(states[2], 3.0)*states[1]*(states[0]-computed_constants[1]) algebraic[4] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0) algebraic[5] = 4.0*exp(states[0]/18.0) algebraic[6] = 0.07*exp(states[0]/20.0) @@ -131,4 +131,4 @@ def compute_variables(voi, states, rates, constants, computed_constants, algebra algebraic[2] = constants[2]*pow(states[3], 4.0)*(states[0]-computed_constants[2]) algebraic[8] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0) algebraic[9] = 0.125*exp(states[0]/80.0) - external[0] = external_variable(voi, states, rates, variables, 0) + externals[0] = external_variable(voi, states, rates, variables, 0) 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 e9bb071d97..f5f5a253f7 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 @@ -133,23 +133,23 @@ void computeComputedConstants(double *constants, double *computedConstants) void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { - external[0] = externalVariable(voi, states, rates, variables, 0); - algebraic[6] = 0.07*exp(external[0]/20.0); - algebraic[7] = 1.0/(exp((external[0]+30.0)/10.0)+1.0); + externals[0] = externalVariable(voi, states, rates, variables, 0); + algebraic[6] = 0.07*exp(externals[0]/20.0); + algebraic[7] = 1.0/(exp((externals[0]+30.0)/10.0)+1.0); rates[0] = algebraic[6]*(1.0-states[0])-algebraic[7]*states[0]; - algebraic[8] = 0.01*(external[0]+10.0)/(exp((external[0]+10.0)/10.0)-1.0); - algebraic[9] = 0.125*exp(external[0]/80.0); + algebraic[8] = 0.01*(externals[0]+10.0)/(exp((externals[0]+10.0)/10.0)-1.0); + algebraic[9] = 0.125*exp(externals[0]/80.0); rates[1] = algebraic[8]*(1.0-states[1])-algebraic[9]*states[1]; } void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { algebraic[0] = ((voi >= 10.0) && (voi <= 10.5))?-20.0:0.0; - external[0] = externalVariable(voi, states, rates, variables, 0); - algebraic[1] = constants[2]*(external[0]-computedConstants[0]); - external[1] = externalVariable(voi, states, rates, variables, 1); - algebraic[3] = constants[3]*pow(external[1], 3.0)*states[0]*(external[0]-computedConstants[1]); - algebraic[4] = 0.1*(external[0]+25.0)/(exp((external[0]+25.0)/10.0)-1.0); - algebraic[5] = 4.0*exp(external[0]/18.0); - algebraic[2] = constants[4]*pow(states[1], 4.0)*(external[0]-computedConstants[2]); + externals[0] = externalVariable(voi, states, rates, variables, 0); + algebraic[1] = constants[2]*(externals[0]-computedConstants[0]); + externals[1] = externalVariable(voi, states, rates, variables, 1); + algebraic[3] = constants[3]*pow(externals[1], 3.0)*states[0]*(externals[0]-computedConstants[1]); + algebraic[4] = 0.1*(externals[0]+25.0)/(exp((externals[0]+25.0)/10.0)-1.0); + algebraic[5] = 4.0*exp(externals[0]/18.0); + algebraic[2] = constants[4]*pow(states[1], 4.0)*(externals[0]-computedConstants[2]); } diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.state.py b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.dependent.state.py index f4e175bb25..cb704989d0 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 @@ -102,21 +102,21 @@ def compute_computed_constants(constants, computed_constants): def compute_rates(voi, states, rates, constants, computed_constants, algebraic, external_variable): - external[0] = external_variable(voi, states, rates, variables, 0) - algebraic[6] = 0.07*exp(external[0]/20.0) - algebraic[7] = 1.0/(exp((external[0]+30.0)/10.0)+1.0) + externals[0] = external_variable(voi, states, rates, variables, 0) + algebraic[6] = 0.07*exp(externals[0]/20.0) + algebraic[7] = 1.0/(exp((externals[0]+30.0)/10.0)+1.0) rates[0] = algebraic[6]*(1.0-states[0])-algebraic[7]*states[0] - algebraic[8] = 0.01*(external[0]+10.0)/(exp((external[0]+10.0)/10.0)-1.0) - algebraic[9] = 0.125*exp(external[0]/80.0) + algebraic[8] = 0.01*(externals[0]+10.0)/(exp((externals[0]+10.0)/10.0)-1.0) + algebraic[9] = 0.125*exp(externals[0]/80.0) rates[1] = algebraic[8]*(1.0-states[1])-algebraic[9]*states[1] def compute_variables(voi, states, rates, constants, computed_constants, algebraic, external_variable): algebraic[0] = -20.0 if and_func(geq_func(voi, 10.0), leq_func(voi, 10.5)) else 0.0 - external[0] = external_variable(voi, states, rates, variables, 0) - algebraic[1] = constants[2]*(external[0]-computed_constants[0]) - external[1] = external_variable(voi, states, rates, variables, 1) - algebraic[3] = constants[3]*pow(external[1], 3.0)*states[0]*(external[0]-computed_constants[1]) - algebraic[4] = 0.1*(external[0]+25.0)/(exp((external[0]+25.0)/10.0)-1.0) - algebraic[5] = 4.0*exp(external[0]/18.0) - algebraic[2] = constants[4]*pow(states[1], 4.0)*(external[0]-computed_constants[2]) + externals[0] = external_variable(voi, states, rates, variables, 0) + algebraic[1] = constants[2]*(externals[0]-computed_constants[0]) + externals[1] = external_variable(voi, states, rates, variables, 1) + algebraic[3] = constants[3]*pow(externals[1], 3.0)*states[0]*(externals[0]-computed_constants[1]) + algebraic[4] = 0.1*(externals[0]+25.0)/(exp((externals[0]+25.0)/10.0)-1.0) + algebraic[5] = 4.0*exp(externals[0]/18.0) + algebraic[2] = constants[4]*pow(states[1], 4.0)*(externals[0]-computed_constants[2]) diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.external.c b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.external.c index d23067e7ba..4dd3845710 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 @@ -134,24 +134,24 @@ void computeComputedConstants(double *constants, double *computedConstants) void computeRates(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { - external[0] = externalVariable(voi, states, rates, variables, 0); - algebraic[3] = 0.1*(external[0]+25.0)/(exp((external[0]+25.0)/10.0)-1.0); - algebraic[4] = 4.0*exp(external[0]/18.0); + externals[0] = externalVariable(voi, states, rates, variables, 0); + algebraic[3] = 0.1*(externals[0]+25.0)/(exp((externals[0]+25.0)/10.0)-1.0); + algebraic[4] = 4.0*exp(externals[0]/18.0); rates[1] = algebraic[3]*(1.0-states[1])-algebraic[4]*states[1]; - algebraic[5] = 0.07*exp(external[0]/20.0); - algebraic[6] = 1.0/(exp((external[0]+30.0)/10.0)+1.0); + algebraic[5] = 0.07*exp(externals[0]/20.0); + algebraic[6] = 1.0/(exp((externals[0]+30.0)/10.0)+1.0); rates[0] = algebraic[5]*(1.0-states[0])-algebraic[6]*states[0]; - external[2] = externalVariable(voi, states, rates, variables, 2); - algebraic[7] = 0.125*exp(external[0]/80.0); - rates[2] = external[2]*(1.0-states[2])-algebraic[7]*states[2]; + externals[2] = externalVariable(voi, states, rates, variables, 2); + algebraic[7] = 0.125*exp(externals[0]/80.0); + rates[2] = externals[2]*(1.0-states[2])-algebraic[7]*states[2]; } void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { algebraic[0] = ((voi >= 10.0) && (voi <= 10.5))?-20.0:0.0; - external[0] = externalVariable(voi, states, rates, variables, 0); - algebraic[1] = constants[2]*(external[0]-computedConstants[0]); - external[2] = externalVariable(voi, states, rates, variables, 2); - external[1] = externalVariable(voi, states, rates, variables, 1); - algebraic[2] = constants[4]*pow(states[2], 4.0)*(external[0]-computedConstants[2]); + externals[0] = externalVariable(voi, states, rates, variables, 0); + algebraic[1] = constants[2]*(externals[0]-computedConstants[0]); + externals[2] = externalVariable(voi, states, rates, variables, 2); + externals[1] = externalVariable(voi, states, rates, variables, 1); + algebraic[2] = constants[4]*pow(states[2], 4.0)*(externals[0]-computedConstants[2]); } diff --git a/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.external.py b/tests/resources/generator/hodgkin_huxley_squid_axon_model_1952/model.external.py index 7e7ce58041..fd8453ffcf 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 @@ -103,22 +103,22 @@ def compute_computed_constants(constants, computed_constants): def compute_rates(voi, states, rates, constants, computed_constants, algebraic, external_variable): - external[0] = external_variable(voi, states, rates, variables, 0) - algebraic[3] = 0.1*(external[0]+25.0)/(exp((external[0]+25.0)/10.0)-1.0) - algebraic[4] = 4.0*exp(external[0]/18.0) + externals[0] = external_variable(voi, states, rates, variables, 0) + algebraic[3] = 0.1*(externals[0]+25.0)/(exp((externals[0]+25.0)/10.0)-1.0) + algebraic[4] = 4.0*exp(externals[0]/18.0) rates[1] = algebraic[3]*(1.0-states[1])-algebraic[4]*states[1] - algebraic[5] = 0.07*exp(external[0]/20.0) - algebraic[6] = 1.0/(exp((external[0]+30.0)/10.0)+1.0) + algebraic[5] = 0.07*exp(externals[0]/20.0) + algebraic[6] = 1.0/(exp((externals[0]+30.0)/10.0)+1.0) rates[0] = algebraic[5]*(1.0-states[0])-algebraic[6]*states[0] - external[2] = external_variable(voi, states, rates, variables, 2) - algebraic[7] = 0.125*exp(external[0]/80.0) - rates[2] = external[2]*(1.0-states[2])-algebraic[7]*states[2] + externals[2] = external_variable(voi, states, rates, variables, 2) + algebraic[7] = 0.125*exp(externals[0]/80.0) + rates[2] = externals[2]*(1.0-states[2])-algebraic[7]*states[2] def compute_variables(voi, states, rates, constants, computed_constants, algebraic, external_variable): algebraic[0] = -20.0 if and_func(geq_func(voi, 10.0), leq_func(voi, 10.5)) else 0.0 - external[0] = external_variable(voi, states, rates, variables, 0) - algebraic[1] = constants[2]*(external[0]-computed_constants[0]) - external[2] = external_variable(voi, states, rates, variables, 2) - external[1] = external_variable(voi, states, rates, variables, 1) - algebraic[2] = constants[4]*pow(states[2], 4.0)*(external[0]-computed_constants[2]) + externals[0] = external_variable(voi, states, rates, variables, 0) + algebraic[1] = constants[2]*(externals[0]-computed_constants[0]) + externals[2] = external_variable(voi, states, rates, variables, 2) + externals[1] = external_variable(voi, states, rates, variables, 1) + algebraic[2] = constants[4]*pow(states[2], 4.0)*(externals[0]-computed_constants[2]) 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 fb03fdd454..205334d7b1 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 @@ -137,8 +137,8 @@ void computeRates(double voi, double *states, double *rates, double *constants, algebraic[0] = ((voi >= 10.0) && (voi <= 10.5))?-20.0:0.0; algebraic[1] = constants[2]*(states[0]-computedConstants[0]); algebraic[2] = constants[4]*pow(states[2], 4.0)*(states[0]-computedConstants[2]); - external[0] = externalVariable(voi, states, rates, variables, 0); - algebraic[3] = constants[3]*pow(external[0], 3.0)*states[1]*(states[0]-computedConstants[1]); + externals[0] = externalVariable(voi, states, rates, variables, 0); + algebraic[3] = constants[3]*pow(externals[0], 3.0)*states[1]*(states[0]-computedConstants[1]); rates[0] = -(-algebraic[0]+algebraic[3]+algebraic[2]+algebraic[1])/constants[0]; algebraic[6] = 0.07*exp(states[0]/20.0); algebraic[7] = 1.0/(exp((states[0]+30.0)/10.0)+1.0); @@ -151,8 +151,8 @@ void computeRates(double voi, double *states, double *rates, double *constants, void computeVariables(double voi, double *states, double *rates, double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { algebraic[1] = constants[2]*(states[0]-computedConstants[0]); - external[0] = externalVariable(voi, states, rates, variables, 0); - algebraic[3] = constants[3]*pow(external[0], 3.0)*states[1]*(states[0]-computedConstants[1]); + externals[0] = externalVariable(voi, states, rates, variables, 0); + algebraic[3] = constants[3]*pow(externals[0], 3.0)*states[1]*(states[0]-computedConstants[1]); algebraic[4] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0); algebraic[5] = 4.0*exp(states[0]/18.0); algebraic[6] = 0.07*exp(states[0]/20.0); 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 19e213325d..b97e824032 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 @@ -106,8 +106,8 @@ def compute_rates(voi, states, rates, constants, computed_constants, algebraic, algebraic[0] = -20.0 if and_func(geq_func(voi, 10.0), leq_func(voi, 10.5)) else 0.0 algebraic[1] = constants[2]*(states[0]-computed_constants[0]) algebraic[2] = constants[4]*pow(states[2], 4.0)*(states[0]-computed_constants[2]) - external[0] = external_variable(voi, states, rates, variables, 0) - algebraic[3] = constants[3]*pow(external[0], 3.0)*states[1]*(states[0]-computed_constants[1]) + externals[0] = external_variable(voi, states, rates, variables, 0) + algebraic[3] = constants[3]*pow(externals[0], 3.0)*states[1]*(states[0]-computed_constants[1]) rates[0] = -(-algebraic[0]+algebraic[3]+algebraic[2]+algebraic[1])/constants[0] algebraic[6] = 0.07*exp(states[0]/20.0) algebraic[7] = 1.0/(exp((states[0]+30.0)/10.0)+1.0) @@ -119,8 +119,8 @@ def compute_rates(voi, states, rates, constants, computed_constants, algebraic, def compute_variables(voi, states, rates, constants, computed_constants, algebraic, external_variable): algebraic[1] = constants[2]*(states[0]-computed_constants[0]) - external[0] = external_variable(voi, states, rates, variables, 0) - algebraic[3] = constants[3]*pow(external[0], 3.0)*states[1]*(states[0]-computed_constants[1]) + externals[0] = external_variable(voi, states, rates, variables, 0) + algebraic[3] = constants[3]*pow(externals[0], 3.0)*states[1]*(states[0]-computed_constants[1]) algebraic[4] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.0) algebraic[5] = 4.0*exp(states[0]/18.0) algebraic[6] = 0.07*exp(states[0]/20.0) 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 2eecb84e54..8b023706c3 100644 --- a/tests/resources/generator/unknown_variable_as_external_variable/model.c +++ b/tests/resources/generator/unknown_variable_as_external_variable/model.c @@ -102,6 +102,6 @@ void computeComputedConstants(double *constants, double *computedConstants) void computeVariables(double *constants, double *computedConstants, double *algebraic, ExternalVariable externalVariable) { - external[0] = externalVariable(variables, 0); - algebraic[0] = constants[0]*(constants[1]*constants[2]-constants[3]*constants[4])/(constants[5]*constants[4]+external[0]*constants[2]+constants[7]*constants[4]*constants[2]+constants[6]); + externals[0] = externalVariable(variables, 0); + algebraic[0] = constants[0]*(constants[1]*constants[2]-constants[3]*constants[4])/(constants[5]*constants[4]+externals[0]*constants[2]+constants[7]*constants[4]*constants[2]+constants[6]); } diff --git a/tests/resources/generator/unknown_variable_as_external_variable/model.py b/tests/resources/generator/unknown_variable_as_external_variable/model.py index 1d02c1f0b9..4a8e5e1952 100644 --- a/tests/resources/generator/unknown_variable_as_external_variable/model.py +++ b/tests/resources/generator/unknown_variable_as_external_variable/model.py @@ -67,5 +67,5 @@ def compute_computed_constants(constants, computed_constants): def compute_variables(constants, computed_constants, algebraic, external_variable): - external[0] = external_variable(variables, 0) - algebraic[0] = constants[0]*(constants[1]*constants[2]-constants[3]*constants[4])/(constants[5]*constants[4]+external[0]*constants[2]+constants[7]*constants[4]*constants[2]+constants[6]) + externals[0] = external_variable(variables, 0) + algebraic[0] = constants[0]*(constants[1]*constants[2]-constants[3]*constants[4])/(constants[5]*constants[4]+externals[0]*constants[2]+constants[7]*constants[4]*constants[2]+constants[6])