From 3c93c03992eb2fc1c741e282b1b283167bc278e2 Mon Sep 17 00:00:00 2001 From: Hugh Sorby Date: Fri, 8 Nov 2024 14:44:36 +1300 Subject: [PATCH 01/10] Re-configure algorithm for analysing the apply MathML element. --- src/analyser.cpp | 39 +++++++++++++------------------- tests/analyser/analyser.cpp | 4 ++-- tests/analyser/analyserunits.cpp | 2 +- 3 files changed, 19 insertions(+), 26 deletions(-) diff --git a/src/analyser.cpp b/src/analyser.cpp index 969e1230ad..df07564ef7 100644 --- a/src/analyser.cpp +++ b/src/analyser.cpp @@ -743,34 +743,27 @@ void Analyser::AnalyserImpl::analyseNode(const XmlNodePtr &node, auto childCount = mathmlChildCount(node); - analyseNode(mathmlChildNode(node, 0), ast, astParent, component, equation); - - if (childCount >= 2) { - analyseNode(mathmlChildNode(node, 1), ast->mPimpl->mOwnedLeftChild, ast, component, equation); - - if (childCount >= 3) { - AnalyserEquationAstPtr astRightChild; - AnalyserEquationAstPtr tempAst; - - analyseNode(mathmlChildNode(node, childCount - 1), astRightChild, nullptr, component, equation); - - for (auto i = childCount - 2; i > 1; --i) { - tempAst = AnalyserEquationAst::create(); - - analyseNode(mathmlChildNode(node, 0), tempAst, nullptr, component, equation); - analyseNode(mathmlChildNode(node, i), tempAst->mPimpl->mOwnedLeftChild, tempAst, component, equation); - + AnalyserEquationAstPtr tempAst; + AnalyserEquationAstPtr astRightChild; + for (size_t i = childCount - 1; i > 0; --i) { + astRightChild = tempAst; + tempAst = AnalyserEquationAst::create(); + if (astRightChild) { + if (i == childCount - 2) { + astRightChild->swapLeftAndRightChildren(); + tempAst = astRightChild; + } else { astRightChild->mPimpl->mParent = tempAst; - tempAst->mPimpl->mOwnedRightChild = astRightChild; - astRightChild = tempAst; } - - astRightChild->mPimpl->mParent = ast; - - ast->mPimpl->mOwnedRightChild = astRightChild; } + if (i != childCount - 2) { + analyseNode(mathmlChildNode(node, 0), tempAst, nullptr, component, equation); + } + analyseNode(mathmlChildNode(node, i), tempAst->mPimpl->mOwnedLeftChild, tempAst, component, equation); } + analyseNode(mathmlChildNode(node, 0), tempAst, astParent, component, equation); + ast = tempAst; // Relational and logical operators. diff --git a/tests/analyser/analyser.cpp b/tests/analyser/analyser.cpp index c7e1678b95..b51b87693a 100644 --- a/tests/analyser/analyser.cpp +++ b/tests/analyser/analyser.cpp @@ -898,8 +898,8 @@ TEST(Analyser, algebraicSystemWithThreeLinkedUnknownsWithOneExternalVariable) EXPECT_EQ(size_t(0), parser->issueCount()); const std::vector expectedIssues = { - "Variable 'y' in component 'my_algebraic_system' is computed more than once.", "Variable 'z' in component 'my_algebraic_system' is computed more than once.", + "Variable 'y' in component 'my_algebraic_system' is computed more than once.", }; auto analyser = libcellml::Analyser::create(); @@ -954,8 +954,8 @@ TEST(Analyser, overconstrainedNlaSystem) EXPECT_EQ(size_t(0), parser->issueCount()); const std::vector expectedIssues = { - "Variable 'x' in component 'my_algebraic_system' is computed more than once.", "Variable 'y' in component 'my_algebraic_system' is computed more than once.", + "Variable 'x' in component 'my_algebraic_system' is computed more than once.", }; auto analyser = libcellml::Analyser::create(); diff --git a/tests/analyser/analyserunits.cpp b/tests/analyser/analyserunits.cpp index cfa856d8d0..0c8cc48b9d 100644 --- a/tests/analyser/analyserunits.cpp +++ b/tests/analyser/analyserunits.cpp @@ -883,8 +883,8 @@ TEST(AnalyserUnits, powerValues) "The units in 'eqnPi = pow(x, pi)' in component 'my_component' are not equivalent. 'eqnPi' is in 'second' while 'pow(x, pi)' is in 'second^3.14159'.", "The units in 'eqnInfinity = pow(x, infinity)' in component 'my_component' are not equivalent. 'eqnInfinity' is in 'second' while 'pow(x, infinity)' is in 'second^inf' (i.e. '10^nan x second^inf').", "The units in 'eqnNotanumber = pow(x, notanumber)' in component 'my_component' are not equivalent. 'eqnNotanumber' is in 'second' while 'pow(x, notanumber)' is in 'second^nan' (i.e. '10^nan x second^nan').", - "The type of variable 'eqnCoverage' in component 'my_component' is unknown.", "The type of variable 'u' in component 'my_component' is unknown.", + "The type of variable 'eqnCoverage' in component 'my_component' is unknown.", "The type of variable 'eqnCoverage2' in component 'my_component' is unknown.", "The type of variable 'eqnCoverage3' in component 'my_component' is unknown.", }; From a7947917fbd105bf4763a08f3d1b839c96363671 Mon Sep 17 00:00:00 2001 From: Hugh Sorby Date: Sat, 9 Nov 2024 08:15:32 +1300 Subject: [PATCH 02/10] Update test expected output for generateFromClonedModel. --- .../model.c | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) 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 9fcba3127f..28fff0d51c 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 @@ -22,10 +22,10 @@ const VariableInfo STATE_INFO[] = { const VariableInfo VARIABLE_INFO[] = { {"i_Stim", "microA_per_cm2", "membrane", ALGEBRAIC}, + {"Cm", "microF_per_cm2", "membrane", CONSTANT}, {"i_L", "microA_per_cm2", "leakage_current", ALGEBRAIC}, {"i_K", "microA_per_cm2", "potassium_channel", ALGEBRAIC}, {"i_Na", "microA_per_cm2", "sodium_channel", ALGEBRAIC}, - {"Cm", "microF_per_cm2", "membrane", CONSTANT}, {"E_R", "millivolt", "membrane", CONSTANT}, {"E_L", "millivolt", "leakage_current", COMPUTED_CONSTANT}, {"g_L", "milliS_per_cm2", "leakage_current", CONSTANT}, @@ -70,7 +70,7 @@ void deleteArray(double *array) void initialiseVariables(double *states, double *rates, double *variables) { - variables[4] = 1.0; + variables[1] = 1.0; variables[5] = 0.0; variables[7] = 0.3; variables[9] = 120.0; @@ -91,30 +91,30 @@ void computeComputedConstants(double *variables) void computeRates(double voi, double *states, double *rates, double *variables) { 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[2] = variables[7]*(states[0]-variables[6]); + variables[3] = variables[15]*pow(states[3], 4.0)*(states[0]-variables[14]); + variables[4] = variables[9]*pow(states[2], 3.0)*states[1]*(states[0]-variables[8]); + rates[0] = -(-variables[0]+variables[4]+variables[3]+variables[2])/variables[1]; variables[11] = 4.0*exp(states[0]/18.0); + variables[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.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); + variables[12] = 0.07*exp(states[0]/20.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); + 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]; } void computeVariables(double voi, double *states, double *rates, double *variables) { - variables[1] = variables[7]*(states[0]-variables[6]); - variables[3] = variables[9]*pow(states[2], 3.0)*states[1]*(states[0]-variables[8]); + variables[2] = variables[7]*(states[0]-variables[6]); + variables[4] = 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[3] = 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); } From e8e79a9912420d69ff4334b36899f5c9ff1efb3c Mon Sep 17 00:00:00 2001 From: Hugh Sorby Date: Sat, 9 Nov 2024 08:37:49 +1300 Subject: [PATCH 03/10] Update coverage.generator expected output. --- tests/coverage/coverage.cpp | 3 +- tests/resources/coverage/generator/model.c | 334 +++++++++--------- .../generator/model.implementation.out | 316 ++++++++--------- .../generator/model.modified.profile.c | 334 +++++++++--------- .../generator/model.modified.profile.py | 334 +++++++++--------- tests/resources/coverage/generator/model.out | 316 ++++++++--------- tests/resources/coverage/generator/model.py | 334 +++++++++--------- 7 files changed, 986 insertions(+), 985 deletions(-) diff --git a/tests/coverage/coverage.cpp b/tests/coverage/coverage.cpp index 0b1b24495f..a85fe28c5b 100644 --- a/tests/coverage/coverage.cpp +++ b/tests/coverage/coverage.cpp @@ -623,8 +623,9 @@ TEST(Coverage, generator) EXPECT_NE(nullptr, analyserModel->state(i)->initialisingVariable()); } + std::vector nonNull = {0, 1, 5, 17, 178, 179, 181, 205, 206}; for (size_t i = 0; i < analyserModel->variableCount(); ++i) { - if ((i == 1) || (i == 2) || (i == 6) || (i == 18) || (i == 179) || (i == 180) || (i == 182) || (i == 205) || (i == 206)) { + if (std::find(nonNull.begin(), nonNull.end(), i) != nonNull.end()) { EXPECT_TRUE(analyserModel->variable(i)->initialisingVariable() != nullptr); } } diff --git a/tests/resources/coverage/generator/model.c b/tests/resources/coverage/generator/model.c index 072849b3c7..45c1b6746e 100644 --- a/tests/resources/coverage/generator/model.c +++ b/tests/resources/coverage/generator/model.c @@ -18,13 +18,13 @@ const VariableInfo STATE_INFO[] = { }; const VariableInfo VARIABLE_INFO[] = { - {"eqnEq", "dimensionless", "my_component", COMPUTED_CONSTANT}, - {"m", "dimensionless", "my_component", CONSTANT}, {"n", "dimensionless", "my_component", CONSTANT}, + {"m", "dimensionless", "my_component", CONSTANT}, + {"eqnEq", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnEqCoverageParentheses", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnNeq", "dimensionless", "my_component", COMPUTED_CONSTANT}, - {"eqnNeqCoverageParentheses", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"o", "dimensionless", "my_component", CONSTANT}, + {"eqnNeqCoverageParentheses", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnLt", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnLtCoverageParentheses", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnLeq", "dimensionless", "my_component", COMPUTED_CONSTANT}, @@ -35,8 +35,8 @@ const VariableInfo VARIABLE_INFO[] = { {"eqnGeqCoverageParentheses", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnAnd", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnAndMultiple", "dimensionless", "my_component", COMPUTED_CONSTANT}, - {"eqnAndParentheses", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"p", "dimensionless", "my_component", CONSTANT}, + {"eqnAndParentheses", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnAndParenthesesLeftPlusWith", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnAndParenthesesLeftPlusWithout", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnAndParenthesesLeftMinusWith", "dimensionless", "my_component", COMPUTED_CONSTANT}, @@ -196,11 +196,11 @@ const VariableInfo VARIABLE_INFO[] = { {"eqnArccoth", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnPiecewisePiece", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnPiecewisePieceOtherwise", "dimensionless", "my_component", COMPUTED_CONSTANT}, - {"eqnPiecewisePiecePiecePiece", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"q", "dimensionless", "my_component", CONSTANT}, {"r", "dimensionless", "my_component", CONSTANT}, - {"eqnPiecewisePiecePiecePieceOtherwise", "dimensionless", "my_component", COMPUTED_CONSTANT}, + {"eqnPiecewisePiecePiecePiece", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"s", "dimensionless", "my_component", CONSTANT}, + {"eqnPiecewisePiecePiecePieceOtherwise", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnWithPiecewise", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnCnInteger", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnCnDouble", "dimensionless", "my_component", COMPUTED_CONSTANT}, @@ -223,10 +223,10 @@ const VariableInfo VARIABLE_INFO[] = { {"eqnCoverageForPowerOperator", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnCoverageForRootOperator", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnCoverageForMinusUnary", "dimensionless", "my_component", COMPUTED_CONSTANT}, - {"eqnNlaVariable1", "dimensionless", "my_component", ALGEBRAIC}, {"eqnNlaVariable2", "dimensionless", "my_component", ALGEBRAIC}, - {"eqnComputedConstant1", "dimensionless", "my_component", COMPUTED_CONSTANT}, - {"eqnComputedConstant2", "dimensionless", "my_component", COMPUTED_CONSTANT} + {"eqnNlaVariable1", "dimensionless", "my_component", ALGEBRAIC}, + {"eqnComputedConstant2", "dimensionless", "my_component", COMPUTED_CONSTANT}, + {"eqnComputedConstant1", "dimensionless", "my_component", COMPUTED_CONSTANT} }; double xor(double x, double y) @@ -357,8 +357,8 @@ void objectiveFunction0(double *u, double *f, void *data) variables[205] = u[0]; variables[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] = variables[206]+variables[205]+states[0]-0.0; + f[1] = variables[206]-variables[205]-(variables[208]+variables[207]); } void findRoot0(double voi, double *states, double *rates, double *variables) @@ -377,15 +377,15 @@ void findRoot0(double voi, double *states, double *rates, double *variables) void initialiseVariables(double *states, double *rates, double *variables) { + variables[0] = 2.0; 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[5] = 3.0; + variables[17] = 4.0; + variables[178] = 5.0; + variables[179] = 6.0; + variables[181] = 7.0; + variables[205] = 2.0; + variables[206] = 1.0; variables[184] = 123.0; variables[185] = 123.456789; variables[186] = 123.0e99; @@ -396,161 +396,161 @@ void initialiseVariables(double *states, double *rates, double *variables) variables[192] = 3.14159265358979; variables[193] = INFINITY; variables[194] = NAN; - variables[207] = 1.0; - variables[208] = 3.0; + variables[208] = 1.0; + variables[207] = 3.0; states[0] = 0.0; } void computeComputedConstants(double *variables) { - 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[2] = variables[1] == variables[0]; + variables[3] = variables[1]/(variables[0] == variables[0]); + variables[4] = variables[1] != variables[0]; + variables[6] = variables[1]/(variables[0] != variables[5]); + variables[7] = variables[1] < variables[0]; + variables[8] = variables[1]/(variables[0] < variables[5]); + variables[9] = variables[1] <= variables[0]; + variables[10] = variables[1]/(variables[0] <= variables[5]); + variables[11] = variables[1] > variables[0]; + variables[12] = variables[1]/(variables[0] > variables[5]); + variables[13] = variables[1] >= variables[0]; + variables[14] = variables[1]/(variables[0] >= variables[5]); + variables[15] = variables[1] && variables[0]; + variables[16] = variables[1] && variables[0] && variables[5]; + variables[18] = (variables[1] < variables[0]) && (variables[5] > variables[17]); + variables[19] = (variables[1]+variables[0]) && (variables[5] > variables[17]); + variables[20] = variables[1] && (variables[0] > variables[5]); + variables[21] = (variables[1]-variables[0]) && (variables[5] > variables[17]); + variables[22] = -variables[1] && (variables[0] > variables[5]); + variables[23] = pow(variables[1], variables[0]) && (variables[5] > variables[17]); + variables[24] = pow(variables[1], 1.0/variables[0]) && (variables[5] > variables[17]); + variables[25] = (variables[1] < variables[0]) && (variables[5]+variables[17]); + variables[26] = (variables[1] < variables[0]) && variables[5]; + variables[27] = (variables[1] < variables[0]) && (variables[5]-variables[17]); + variables[28] = (variables[1] < variables[0]) && -variables[5]; + variables[29] = (variables[1] < variables[0]) && pow(variables[5], variables[17]); + variables[30] = (variables[1] < variables[0]) && pow(variables[5], 1.0/variables[17]); + variables[31] = variables[1]/(variables[0] && variables[5]); + variables[32] = variables[1] || variables[0]; + variables[33] = variables[1] || variables[0] || variables[5]; + variables[34] = (variables[1] < variables[0]) || (variables[5] > variables[17]); + variables[35] = (variables[1]+variables[0]) || (variables[5] > variables[17]); + variables[36] = variables[1] || (variables[0] > variables[5]); + variables[37] = (variables[1]-variables[0]) || (variables[5] > variables[17]); + variables[38] = -variables[1] || (variables[0] > variables[5]); + variables[39] = pow(variables[1], variables[0]) || (variables[5] > variables[17]); + variables[40] = pow(variables[1], 1.0/variables[0]) || (variables[5] > variables[17]); + variables[41] = (variables[1] < variables[0]) || (variables[5]+variables[17]); + variables[42] = (variables[1] < variables[0]) || variables[5]; + variables[43] = (variables[1] < variables[0]) || (variables[5]-variables[17]); + variables[44] = (variables[1] < variables[0]) || -variables[5]; + variables[45] = (variables[1] < variables[0]) || pow(variables[5], variables[17]); + variables[46] = (variables[1] < variables[0]) || pow(variables[5], 1.0/variables[17]); + variables[47] = variables[1]/(variables[0] || variables[5]); + variables[48] = xor(variables[1], variables[0]); + variables[49] = xor(variables[1], xor(variables[0], variables[5])); + variables[50] = xor(variables[1] < variables[0], variables[5] > variables[17]); + variables[51] = xor(variables[1]+variables[0], variables[5] > variables[17]); + variables[52] = xor(variables[1], variables[0] > variables[5]); + variables[53] = xor(variables[1]-variables[0], variables[5] > variables[17]); + variables[54] = xor(-variables[1], variables[0] > variables[5]); + variables[55] = xor(pow(variables[1], variables[0]), variables[5] > variables[17]); + variables[56] = xor(pow(variables[1], 1.0/variables[0]), variables[5] > variables[17]); + variables[57] = xor(variables[1] < variables[0], variables[5]+variables[17]); + variables[58] = xor(variables[1] < variables[0], variables[5]); + variables[59] = xor(variables[1] < variables[0], variables[5]-variables[17]); + variables[60] = xor(variables[1] < variables[0], -variables[5]); + variables[61] = xor(variables[1] < variables[0], pow(variables[5], variables[17])); + variables[62] = xor(variables[1] < variables[0], pow(variables[5], 1.0/variables[17])); + variables[63] = variables[1]/xor(variables[0], variables[5]); 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[65] = variables[1]+variables[0]; + variables[66] = variables[1]+variables[0]+variables[5]; + variables[67] = (variables[1] < variables[0])+(variables[5] > variables[17]); 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[69] = variables[1]-variables[0]; + variables[70] = (variables[1] < variables[0])-(variables[5] > variables[17]); + variables[71] = (variables[1] < variables[0])-(variables[5]+variables[17]); + variables[72] = (variables[1] < variables[0])-variables[5]; + variables[73] = variables[1]-(-variables[0]); + variables[74] = variables[1]-(-variables[0]*variables[5]); 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[76] = -(variables[1] < variables[0]); + variables[77] = variables[1]*variables[0]; + variables[78] = variables[1]*variables[0]*variables[5]; + variables[79] = (variables[1] < variables[0])*(variables[5] > variables[17]); + variables[80] = (variables[1]+variables[0])*(variables[5] > variables[17]); + variables[81] = variables[1]*(variables[0] > variables[5]); + variables[82] = (variables[1]-variables[0])*(variables[5] > variables[17]); + variables[83] = -variables[1]*(variables[0] > variables[5]); + variables[84] = (variables[1] < variables[0])*(variables[5]+variables[17]); + variables[85] = (variables[1] < variables[0])*variables[5]; + variables[86] = (variables[1] < variables[0])*(variables[5]-variables[17]); + variables[87] = (variables[1] < variables[0])*-variables[5]; + variables[88] = variables[1]/variables[0]; + variables[89] = (variables[1] < variables[0])/(variables[17] > variables[5]); + variables[90] = (variables[1]+variables[0])/(variables[17] > variables[5]); + variables[91] = variables[1]/(variables[5] > variables[0]); + variables[92] = (variables[1]-variables[0])/(variables[17] > variables[5]); + variables[93] = -variables[1]/(variables[5] > variables[0]); + variables[94] = (variables[1] < variables[0])/(variables[5]+variables[17]); + variables[95] = (variables[1] < variables[0])/variables[5]; + variables[96] = (variables[1] < variables[0])/(variables[5]-variables[17]); + variables[97] = (variables[1] < variables[0])/-variables[5]; + variables[98] = (variables[1] < variables[0])/(variables[5]*variables[17]); + variables[99] = (variables[1] < variables[0])/(variables[5]/variables[17]); 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[103] = pow(variables[1], variables[0]); + variables[104] = pow(variables[1] <= variables[0], variables[5] >= variables[17]); + variables[105] = pow(variables[1]+variables[0], variables[5] >= variables[17]); + variables[106] = pow(variables[1], variables[0] >= variables[5]); + variables[107] = pow(variables[1]-variables[0], variables[5] >= variables[17]); + variables[108] = pow(-variables[1], variables[0] >= variables[5]); + variables[109] = pow(variables[1]*variables[0], variables[5] >= variables[17]); + variables[110] = pow(variables[1]/variables[0], variables[5] >= variables[17]); + variables[111] = pow(variables[1] <= variables[0], variables[5]+variables[17]); + variables[112] = pow(variables[1] <= variables[0], variables[5]); + variables[113] = pow(variables[1] <= variables[0], variables[5]-variables[17]); + variables[114] = pow(variables[1] <= variables[0], -variables[5]); + variables[115] = pow(variables[1] <= variables[0], variables[5]*variables[17]); + variables[116] = pow(variables[1] <= variables[0], variables[5]/variables[17]); + variables[117] = pow(variables[1] <= variables[0], pow(variables[5], variables[17])); + variables[118] = pow(variables[1] <= variables[0], pow(variables[5], 1.0/variables[17])); 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[122] = pow(variables[1], 1.0/variables[0]); + variables[123] = pow(variables[1] < variables[0], 1.0/(variables[17] > variables[5])); + variables[124] = pow(variables[1]+variables[0], 1.0/(variables[17] > variables[5])); + variables[125] = pow(variables[1], 1.0/(variables[5] > variables[0])); + variables[126] = pow(variables[1]-variables[0], 1.0/(variables[17] > variables[5])); + variables[127] = pow(-variables[1], 1.0/(variables[5] > variables[0])); + variables[128] = pow(variables[1]*variables[0], 1.0/(variables[17] > variables[5])); + variables[129] = pow(variables[1]/variables[0], 1.0/(variables[17] > variables[5])); + variables[130] = pow(variables[1] < variables[0], 1.0/(variables[5]+variables[17])); + variables[131] = pow(variables[1] < variables[0], 1.0/variables[5]); + variables[132] = pow(variables[1] < variables[0], 1.0/(variables[5]-variables[17])); + variables[133] = pow(variables[1] < variables[0], 1.0/-variables[5]); + variables[134] = pow(variables[1] < variables[0], 1.0/(variables[5]*variables[17])); + variables[135] = pow(variables[1] < variables[0], 1.0/(variables[5]/variables[17])); + variables[136] = pow(variables[1] < variables[0], 1.0/pow(variables[5], variables[17])); + variables[137] = pow(variables[1] < variables[0], 1.0/pow(variables[5], 1.0/variables[17])); 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[144] = log(variables[1])/log(variables[0]); 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[147] = min(variables[1], variables[0]); + variables[148] = min(variables[1], min(variables[0], variables[5])); + variables[149] = max(variables[1], variables[0]); + variables[150] = max(variables[1], max(variables[0], variables[5])); + variables[151] = fmod(variables[1], variables[0]); variables[152] = sin(variables[1]); variables[153] = cos(variables[1]); variables[154] = tan(variables[1]); @@ -575,22 +575,22 @@ void computeComputedConstants(double *variables) 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[176] = (variables[1] > variables[0])?variables[1]:NAN; + variables[177] = (variables[1] > variables[0])?variables[1]:variables[5]; + variables[180] = (variables[1] > variables[0])?variables[1]:(variables[5] > variables[17])?variables[5]:(variables[178] > variables[179])?variables[178]:NAN; + variables[182] = (variables[1] > variables[0])?variables[1]:(variables[5] > variables[17])?variables[5]:(variables[178] > variables[179])?variables[178]:variables[181]; + variables[183] = 123.0+((variables[1] > variables[0])?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); + variables[195] = (variables[1] && variables[0])+((variables[5] > variables[17])?variables[0]:NAN)+variables[178]+(variables[179] && variables[181]); + variables[196] = (variables[1] && variables[0])-(((variables[5] > variables[17])?variables[0]:NAN)-(variables[178]-((variables[5] > variables[17])?variables[0]:NAN)))-(variables[179] && variables[181]); + variables[197] = (variables[1] && variables[0])*((variables[5] > variables[17])?variables[0]:NAN)*variables[178]*((variables[5] > variables[17])?variables[0]:NAN)*(variables[179] && variables[181]); + variables[198] = (variables[1] && variables[0])/(((variables[5] > variables[17])?variables[0]:NAN)/(variables[178]/((variables[5] > variables[17])?variables[0]:NAN))); + variables[199] = (variables[1] || variables[0]) && xor(variables[1], variables[0]) && ((variables[5] > variables[17])?variables[0]:NAN) && variables[178] && ((variables[5] > variables[17])?variables[0]:NAN) && xor(variables[1], variables[0]) && (variables[1] || variables[0]); + variables[200] = (variables[1] && variables[0]) || xor(variables[1], variables[0]) || ((variables[5] > variables[17])?variables[0]:NAN) || variables[178] || ((variables[5] > variables[17])?variables[0]:NAN) || xor(variables[1], variables[0]) || (variables[1] && variables[0]); + variables[201] = xor(variables[1] && variables[0], xor(variables[1] || variables[0], xor((variables[5] > variables[17])?variables[0]:NAN, xor(xor(xor(variables[178], (variables[5] > variables[17])?variables[0]:NAN), variables[1] || variables[0]), variables[1] && variables[0])))); + variables[202] = pow(variables[1] && variables[0], pow((variables[5] > variables[17])?variables[0]:NAN, pow(pow(variables[178], (variables[5] > variables[17])?variables[0]:NAN), variables[1] && variables[0]))); + variables[203] = pow(pow(pow(variables[1] && variables[0], 1.0/pow((variables[5] > variables[17])?variables[0]:NAN, 1.0/variables[178])), 1.0/((variables[5] > variables[17])?variables[0]:NAN)), 1.0/(variables[1] && variables[0])); + variables[204] = -(variables[1] && variables[0])+-((variables[5] > variables[17])?variables[0]:NAN); } void computeRates(double voi, double *states, double *rates, double *variables) diff --git a/tests/resources/coverage/generator/model.implementation.out b/tests/resources/coverage/generator/model.implementation.out index 8046594e5d..a801815cf6 100644 --- a/tests/resources/coverage/generator/model.implementation.out +++ b/tests/resources/coverage/generator/model.implementation.out @@ -128,8 +128,8 @@ void objectiveFunction0(double *u, double *f, void *data) variables[205] = u[0]; variables[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] = variables[206]+variables[205]+states[0]-0.0; + f[1] = variables[206]-variables[205]-(variables[208]+variables[207]); } void findRoot0(double voi, double *states, double *rates, double *variables) @@ -148,15 +148,15 @@ void findRoot0(double voi, double *states, double *rates, double *variables) void initialiseVariables(double *states, double *rates, double *variables) { + variables[0] = 2.0; 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[5] = 3.0; + variables[17] = 4.0; + variables[178] = 5.0; + variables[179] = 6.0; + variables[181] = 7.0; + variables[205] = 2.0; + variables[206] = 1.0; variables[184] = 123.0; variables[185] = 123.456789; variables[186] = 123.0e99; @@ -167,161 +167,161 @@ void initialiseVariables(double *states, double *rates, double *variables) variables[192] = 3.14159265358979; variables[193] = INFINITY; variables[194] = NAN; - variables[207] = 1.0; - variables[208] = 3.0; + variables[208] = 1.0; + variables[207] = 3.0; states[0] = 0.0; } void computeComputedConstants(double *variables) { - 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[2] = eq(variables[1], variables[0]); + variables[3] = variables[1]/eq(variables[0], variables[0]); + variables[4] = neq(variables[1], variables[0]); + variables[6] = variables[1]/neq(variables[0], variables[5]); + variables[7] = lt(variables[1], variables[0]); + variables[8] = variables[1]/lt(variables[0], variables[5]); + variables[9] = leq(variables[1], variables[0]); + variables[10] = variables[1]/leq(variables[0], variables[5]); + variables[11] = gt(variables[1], variables[0]); + variables[12] = variables[1]/gt(variables[0], variables[5]); + variables[13] = geq(variables[1], variables[0]); + variables[14] = variables[1]/geq(variables[0], variables[5]); + variables[15] = and(variables[1], variables[0]); + variables[16] = and(variables[1], and(variables[0], variables[5])); + variables[18] = and(lt(variables[1], variables[0]), gt(variables[5], variables[17])); + variables[19] = and(variables[1]+variables[0], gt(variables[5], variables[17])); + variables[20] = and(variables[1], gt(variables[0], variables[5])); + variables[21] = and(variables[1]-variables[0], gt(variables[5], variables[17])); + variables[22] = and(-variables[1], gt(variables[0], variables[5])); + variables[23] = and(pow(variables[1], variables[0]), gt(variables[5], variables[17])); + variables[24] = and(pow(variables[1], 1.0/variables[0]), gt(variables[5], variables[17])); + variables[25] = and(lt(variables[1], variables[0]), variables[5]+variables[17]); + variables[26] = and(lt(variables[1], variables[0]), variables[5]); + variables[27] = and(lt(variables[1], variables[0]), variables[5]-variables[17]); + variables[28] = and(lt(variables[1], variables[0]), -variables[5]); + variables[29] = and(lt(variables[1], variables[0]), pow(variables[5], variables[17])); + variables[30] = and(lt(variables[1], variables[0]), pow(variables[5], 1.0/variables[17])); + variables[31] = variables[1]/and(variables[0], variables[5]); + variables[32] = or(variables[1], variables[0]); + variables[33] = or(variables[1], or(variables[0], variables[5])); + variables[34] = or(lt(variables[1], variables[0]), gt(variables[5], variables[17])); + variables[35] = or(variables[1]+variables[0], gt(variables[5], variables[17])); + variables[36] = or(variables[1], gt(variables[0], variables[5])); + variables[37] = or(variables[1]-variables[0], gt(variables[5], variables[17])); + variables[38] = or(-variables[1], gt(variables[0], variables[5])); + variables[39] = or(pow(variables[1], variables[0]), gt(variables[5], variables[17])); + variables[40] = or(pow(variables[1], 1.0/variables[0]), gt(variables[5], variables[17])); + variables[41] = or(lt(variables[1], variables[0]), variables[5]+variables[17]); + variables[42] = or(lt(variables[1], variables[0]), variables[5]); + variables[43] = or(lt(variables[1], variables[0]), variables[5]-variables[17]); + variables[44] = or(lt(variables[1], variables[0]), -variables[5]); + variables[45] = or(lt(variables[1], variables[0]), pow(variables[5], variables[17])); + variables[46] = or(lt(variables[1], variables[0]), pow(variables[5], 1.0/variables[17])); + variables[47] = variables[1]/or(variables[0], variables[5]); + variables[48] = xor(variables[1], variables[0]); + variables[49] = xor(variables[1], xor(variables[0], variables[5])); + variables[50] = xor(lt(variables[1], variables[0]), gt(variables[5], variables[17])); + variables[51] = xor(variables[1]+variables[0], gt(variables[5], variables[17])); + variables[52] = xor(variables[1], gt(variables[0], variables[5])); + variables[53] = xor(variables[1]-variables[0], gt(variables[5], variables[17])); + variables[54] = xor(-variables[1], gt(variables[0], variables[5])); + variables[55] = xor(pow(variables[1], variables[0]), gt(variables[5], variables[17])); + variables[56] = xor(pow(variables[1], 1.0/variables[0]), gt(variables[5], variables[17])); + variables[57] = xor(lt(variables[1], variables[0]), variables[5]+variables[17]); + variables[58] = xor(lt(variables[1], variables[0]), variables[5]); + variables[59] = xor(lt(variables[1], variables[0]), variables[5]-variables[17]); + variables[60] = xor(lt(variables[1], variables[0]), -variables[5]); + variables[61] = xor(lt(variables[1], variables[0]), pow(variables[5], variables[17])); + variables[62] = xor(lt(variables[1], variables[0]), pow(variables[5], 1.0/variables[17])); + variables[63] = variables[1]/xor(variables[0], variables[5]); 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[65] = variables[1]+variables[0]; + variables[66] = variables[1]+variables[0]+variables[5]; + variables[67] = lt(variables[1], variables[0])+gt(variables[5], variables[17]); 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[69] = variables[1]-variables[0]; + variables[70] = lt(variables[1], variables[0])-gt(variables[5], variables[17]); + variables[71] = lt(variables[1], variables[0])-(variables[5]+variables[17]); + variables[72] = lt(variables[1], variables[0])-variables[5]; + variables[73] = variables[1]-(-variables[0]); + variables[74] = variables[1]-(-variables[0]*variables[5]); 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[76] = -lt(variables[1], variables[0]); + variables[77] = variables[1]*variables[0]; + variables[78] = variables[1]*variables[0]*variables[5]; + variables[79] = lt(variables[1], variables[0])*gt(variables[5], variables[17]); + variables[80] = (variables[1]+variables[0])*gt(variables[5], variables[17]); + variables[81] = variables[1]*gt(variables[0], variables[5]); + variables[82] = (variables[1]-variables[0])*gt(variables[5], variables[17]); + variables[83] = -variables[1]*gt(variables[0], variables[5]); + variables[84] = lt(variables[1], variables[0])*(variables[5]+variables[17]); + variables[85] = lt(variables[1], variables[0])*variables[5]; + variables[86] = lt(variables[1], variables[0])*(variables[5]-variables[17]); + variables[87] = lt(variables[1], variables[0])*-variables[5]; + variables[88] = variables[1]/variables[0]; + variables[89] = lt(variables[1], variables[0])/gt(variables[17], variables[5]); + variables[90] = (variables[1]+variables[0])/gt(variables[17], variables[5]); + variables[91] = variables[1]/gt(variables[5], variables[0]); + variables[92] = (variables[1]-variables[0])/gt(variables[17], variables[5]); + variables[93] = -variables[1]/gt(variables[5], variables[0]); + variables[94] = lt(variables[1], variables[0])/(variables[5]+variables[17]); + variables[95] = lt(variables[1], variables[0])/variables[5]; + variables[96] = lt(variables[1], variables[0])/(variables[5]-variables[17]); + variables[97] = lt(variables[1], variables[0])/-variables[5]; + variables[98] = lt(variables[1], variables[0])/(variables[5]*variables[17]); + variables[99] = lt(variables[1], variables[0])/(variables[5]/variables[17]); 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[103] = pow(variables[1], variables[0]); + variables[104] = pow(leq(variables[1], variables[0]), geq(variables[5], variables[17])); + variables[105] = pow(variables[1]+variables[0], geq(variables[5], variables[17])); + variables[106] = pow(variables[1], geq(variables[0], variables[5])); + variables[107] = pow(variables[1]-variables[0], geq(variables[5], variables[17])); + variables[108] = pow(-variables[1], geq(variables[0], variables[5])); + variables[109] = pow(variables[1]*variables[0], geq(variables[5], variables[17])); + variables[110] = pow(variables[1]/variables[0], geq(variables[5], variables[17])); + variables[111] = pow(leq(variables[1], variables[0]), variables[5]+variables[17]); + variables[112] = pow(leq(variables[1], variables[0]), variables[5]); + variables[113] = pow(leq(variables[1], variables[0]), variables[5]-variables[17]); + variables[114] = pow(leq(variables[1], variables[0]), -variables[5]); + variables[115] = pow(leq(variables[1], variables[0]), variables[5]*variables[17]); + variables[116] = pow(leq(variables[1], variables[0]), variables[5]/variables[17]); + variables[117] = pow(leq(variables[1], variables[0]), pow(variables[5], variables[17])); + variables[118] = pow(leq(variables[1], variables[0]), pow(variables[5], 1.0/variables[17])); 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[122] = pow(variables[1], 1.0/variables[0]); + variables[123] = pow(lt(variables[1], variables[0]), 1.0/gt(variables[17], variables[5])); + variables[124] = pow(variables[1]+variables[0], 1.0/gt(variables[17], variables[5])); + variables[125] = pow(variables[1], 1.0/gt(variables[5], variables[0])); + variables[126] = pow(variables[1]-variables[0], 1.0/gt(variables[17], variables[5])); + variables[127] = pow(-variables[1], 1.0/gt(variables[5], variables[0])); + variables[128] = pow(variables[1]*variables[0], 1.0/gt(variables[17], variables[5])); + variables[129] = pow(variables[1]/variables[0], 1.0/gt(variables[17], variables[5])); + variables[130] = pow(lt(variables[1], variables[0]), 1.0/(variables[5]+variables[17])); + variables[131] = pow(lt(variables[1], variables[0]), 1.0/variables[5]); + variables[132] = pow(lt(variables[1], variables[0]), 1.0/(variables[5]-variables[17])); + variables[133] = pow(lt(variables[1], variables[0]), 1.0/-variables[5]); + variables[134] = pow(lt(variables[1], variables[0]), 1.0/(variables[5]*variables[17])); + variables[135] = pow(lt(variables[1], variables[0]), 1.0/(variables[5]/variables[17])); + variables[136] = pow(lt(variables[1], variables[0]), 1.0/pow(variables[5], variables[17])); + variables[137] = pow(lt(variables[1], variables[0]), 1.0/pow(variables[5], 1.0/variables[17])); 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[144] = log(variables[1])/log(variables[0]); 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[147] = min(variables[1], variables[0]); + variables[148] = min(variables[1], min(variables[0], variables[5])); + variables[149] = max(variables[1], variables[0]); + variables[150] = max(variables[1], max(variables[0], variables[5])); + variables[151] = fmod(variables[1], variables[0]); variables[152] = sin(variables[1]); variables[153] = cos(variables[1]); variables[154] = tan(variables[1]); @@ -346,22 +346,22 @@ void computeComputedConstants(double *variables) 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[176] = (gt(variables[1], variables[0]))?variables[1]:NAN; + variables[177] = (gt(variables[1], variables[0]))?variables[1]:variables[5]; + variables[180] = (gt(variables[1], variables[0]))?variables[1]:(gt(variables[5], variables[17]))?variables[5]:(gt(variables[178], variables[179]))?variables[178]:NAN; + variables[182] = (gt(variables[1], variables[0]))?variables[1]:(gt(variables[5], variables[17]))?variables[5]:(gt(variables[178], variables[179]))?variables[178]:variables[181]; + variables[183] = 123.0+((gt(variables[1], variables[0]))?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); + variables[195] = and(variables[1], variables[0])+((gt(variables[5], variables[17]))?variables[0]:NAN)+variables[178]+and(variables[179], variables[181]); + variables[196] = and(variables[1], variables[0])-(((gt(variables[5], variables[17]))?variables[0]:NAN)-(variables[178]-((gt(variables[5], variables[17]))?variables[0]:NAN)))-and(variables[179], variables[181]); + variables[197] = and(variables[1], variables[0])*((gt(variables[5], variables[17]))?variables[0]:NAN)*variables[178]*((gt(variables[5], variables[17]))?variables[0]:NAN)*and(variables[179], variables[181]); + variables[198] = and(variables[1], variables[0])/(((gt(variables[5], variables[17]))?variables[0]:NAN)/(variables[178]/((gt(variables[5], variables[17]))?variables[0]:NAN))); + variables[199] = and(or(variables[1], variables[0]), and(xor(variables[1], variables[0]), and((gt(variables[5], variables[17]))?variables[0]:NAN, and(and(and(variables[178], (gt(variables[5], variables[17]))?variables[0]:NAN), xor(variables[1], variables[0])), or(variables[1], variables[0]))))); + variables[200] = or(and(variables[1], variables[0]), or(xor(variables[1], variables[0]), or((gt(variables[5], variables[17]))?variables[0]:NAN, or(or(or(variables[178], (gt(variables[5], variables[17]))?variables[0]:NAN), xor(variables[1], variables[0])), and(variables[1], variables[0]))))); + variables[201] = xor(and(variables[1], variables[0]), xor(or(variables[1], variables[0]), xor((gt(variables[5], variables[17]))?variables[0]:NAN, xor(xor(xor(variables[178], (gt(variables[5], variables[17]))?variables[0]:NAN), or(variables[1], variables[0])), and(variables[1], variables[0]))))); + variables[202] = pow(and(variables[1], variables[0]), pow((gt(variables[5], variables[17]))?variables[0]:NAN, pow(pow(variables[178], (gt(variables[5], variables[17]))?variables[0]:NAN), and(variables[1], variables[0])))); + variables[203] = pow(pow(pow(and(variables[1], variables[0]), 1.0/pow((gt(variables[5], variables[17]))?variables[0]:NAN, 1.0/variables[178])), 1.0/((gt(variables[5], variables[17]))?variables[0]:NAN)), 1.0/and(variables[1], variables[0])); + variables[204] = -and(variables[1], variables[0])+-((gt(variables[5], variables[17]))?variables[0]:NAN); } void computeRates(double voi, double *states, double *rates, double *variables) diff --git a/tests/resources/coverage/generator/model.modified.profile.c b/tests/resources/coverage/generator/model.modified.profile.c index b01250ff2b..fd3ed7a897 100644 --- a/tests/resources/coverage/generator/model.modified.profile.c +++ b/tests/resources/coverage/generator/model.modified.profile.c @@ -18,13 +18,13 @@ const VariableInfo STATE_INFO[] = { }; const VariableInfo VARIABLE_INFO[] = { - {"eqnEq", "dimensionless", "my_component", COMPUTED_CONSTANT}, - {"m", "dimensionless", "my_component", CONSTANT}, {"n", "dimensionless", "my_component", CONSTANT}, + {"m", "dimensionless", "my_component", CONSTANT}, + {"eqnEq", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnEqCoverageParentheses", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnNeq", "dimensionless", "my_component", COMPUTED_CONSTANT}, - {"eqnNeqCoverageParentheses", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"o", "dimensionless", "my_component", CONSTANT}, + {"eqnNeqCoverageParentheses", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnLt", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnLtCoverageParentheses", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnLeq", "dimensionless", "my_component", COMPUTED_CONSTANT}, @@ -35,8 +35,8 @@ const VariableInfo VARIABLE_INFO[] = { {"eqnGeqCoverageParentheses", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnAnd", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnAndMultiple", "dimensionless", "my_component", COMPUTED_CONSTANT}, - {"eqnAndParentheses", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"p", "dimensionless", "my_component", CONSTANT}, + {"eqnAndParentheses", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnAndParenthesesLeftPlusWith", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnAndParenthesesLeftPlusWithout", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnAndParenthesesLeftMinusWith", "dimensionless", "my_component", COMPUTED_CONSTANT}, @@ -196,11 +196,11 @@ const VariableInfo VARIABLE_INFO[] = { {"eqnArccoth", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnPiecewisePiece", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnPiecewisePieceOtherwise", "dimensionless", "my_component", COMPUTED_CONSTANT}, - {"eqnPiecewisePiecePiecePiece", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"q", "dimensionless", "my_component", CONSTANT}, {"r", "dimensionless", "my_component", CONSTANT}, - {"eqnPiecewisePiecePiecePieceOtherwise", "dimensionless", "my_component", COMPUTED_CONSTANT}, + {"eqnPiecewisePiecePiecePiece", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"s", "dimensionless", "my_component", CONSTANT}, + {"eqnPiecewisePiecePiecePieceOtherwise", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnWithPiecewise", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnCnInteger", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnCnDouble", "dimensionless", "my_component", COMPUTED_CONSTANT}, @@ -223,10 +223,10 @@ const VariableInfo VARIABLE_INFO[] = { {"eqnCoverageForPowerOperator", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnCoverageForRootOperator", "dimensionless", "my_component", COMPUTED_CONSTANT}, {"eqnCoverageForMinusUnary", "dimensionless", "my_component", COMPUTED_CONSTANT}, - {"eqnNlaVariable1", "dimensionless", "my_component", ALGEBRAIC}, {"eqnNlaVariable2", "dimensionless", "my_component", ALGEBRAIC}, - {"eqnComputedConstant1", "dimensionless", "my_component", COMPUTED_CONSTANT}, - {"eqnComputedConstant2", "dimensionless", "my_component", COMPUTED_CONSTANT} + {"eqnNlaVariable1", "dimensionless", "my_component", ALGEBRAIC}, + {"eqnComputedConstant2", "dimensionless", "my_component", COMPUTED_CONSTANT}, + {"eqnComputedConstant1", "dimensionless", "my_component", COMPUTED_CONSTANT} }; double xor(double x, double y) @@ -357,8 +357,8 @@ void objectiveFunction0(double *u, double *f, void *data) variables[205] = u[0]; variables[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] = variables[206]+variables[205]+states[0]-0.0; + f[1] = variables[206]-variables[205]-(variables[208]+variables[207]); } void findRoot0(double voi, double *states, double *rates, double *variables) @@ -377,15 +377,15 @@ void findRoot0(double voi, double *states, double *rates, double *variables) void initialiseVariables(double *states, double *rates, double *variables) { + variables[0] = 2.0; 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[5] = 3.0; + variables[17] = 4.0; + variables[178] = 5.0; + variables[179] = 6.0; + variables[181] = 7.0; + variables[205] = 2.0; + variables[206] = 1.0; variables[184] = 123.0; variables[185] = 123.456789; variables[186] = 123.0e99; @@ -396,161 +396,161 @@ void initialiseVariables(double *states, double *rates, double *variables) variables[192] = 3.14159265358979; variables[193] = INFINITY; variables[194] = NAN; - variables[207] = 1.0; - variables[208] = 3.0; + variables[208] = 1.0; + variables[207] = 3.0; states[0] = 0.0; } void computeComputedConstants(double *variables) { - 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[2] = variables[1] == variables[0]; + variables[3] = variables[1]/(variables[0] == variables[0]); + variables[4] = variables[1] != variables[0]; + variables[6] = variables[1]/(variables[0] != variables[5]); + variables[7] = variables[1] < variables[0]; + variables[8] = variables[1]/(variables[0] < variables[5]); + variables[9] = variables[1] <= variables[0]; + variables[10] = variables[1]/(variables[0] <= variables[5]); + variables[11] = variables[1] > variables[0]; + variables[12] = variables[1]/(variables[0] > variables[5]); + variables[13] = variables[1] >= variables[0]; + variables[14] = variables[1]/(variables[0] >= variables[5]); + variables[15] = variables[1] && variables[0]; + variables[16] = variables[1] && variables[0] && variables[5]; + variables[18] = (variables[1] < variables[0]) && (variables[5] > variables[17]); + variables[19] = (variables[1]+variables[0]) && (variables[5] > variables[17]); + variables[20] = variables[1] && (variables[0] > variables[5]); + variables[21] = (variables[1]-variables[0]) && (variables[5] > variables[17]); + variables[22] = -variables[1] && (variables[0] > variables[5]); + variables[23] = pow(variables[1], variables[0]) && (variables[5] > variables[17]); + variables[24] = pow(variables[1], 1.0/variables[0]) && (variables[5] > variables[17]); + variables[25] = (variables[1] < variables[0]) && (variables[5]+variables[17]); + variables[26] = (variables[1] < variables[0]) && variables[5]; + variables[27] = (variables[1] < variables[0]) && (variables[5]-variables[17]); + variables[28] = (variables[1] < variables[0]) && -variables[5]; + variables[29] = (variables[1] < variables[0]) && pow(variables[5], variables[17]); + variables[30] = (variables[1] < variables[0]) && pow(variables[5], 1.0/variables[17]); + variables[31] = variables[1]/(variables[0] && variables[5]); + variables[32] = variables[1] || variables[0]; + variables[33] = variables[1] || variables[0] || variables[5]; + variables[34] = (variables[1] < variables[0]) || (variables[5] > variables[17]); + variables[35] = (variables[1]+variables[0]) || (variables[5] > variables[17]); + variables[36] = variables[1] || (variables[0] > variables[5]); + variables[37] = (variables[1]-variables[0]) || (variables[5] > variables[17]); + variables[38] = -variables[1] || (variables[0] > variables[5]); + variables[39] = pow(variables[1], variables[0]) || (variables[5] > variables[17]); + variables[40] = pow(variables[1], 1.0/variables[0]) || (variables[5] > variables[17]); + variables[41] = (variables[1] < variables[0]) || (variables[5]+variables[17]); + variables[42] = (variables[1] < variables[0]) || variables[5]; + variables[43] = (variables[1] < variables[0]) || (variables[5]-variables[17]); + variables[44] = (variables[1] < variables[0]) || -variables[5]; + variables[45] = (variables[1] < variables[0]) || pow(variables[5], variables[17]); + variables[46] = (variables[1] < variables[0]) || pow(variables[5], 1.0/variables[17]); + variables[47] = variables[1]/(variables[0] || variables[5]); + variables[48] = xor(variables[1], variables[0]); + variables[49] = xor(variables[1], xor(variables[0], variables[5])); + variables[50] = xor(variables[1] < variables[0], variables[5] > variables[17]); + variables[51] = xor(variables[1]+variables[0], variables[5] > variables[17]); + variables[52] = xor(variables[1], variables[0] > variables[5]); + variables[53] = xor(variables[1]-variables[0], variables[5] > variables[17]); + variables[54] = xor(-variables[1], variables[0] > variables[5]); + variables[55] = xor(pow(variables[1], variables[0]), variables[5] > variables[17]); + variables[56] = xor(pow(variables[1], 1.0/variables[0]), variables[5] > variables[17]); + variables[57] = xor(variables[1] < variables[0], variables[5]+variables[17]); + variables[58] = xor(variables[1] < variables[0], variables[5]); + variables[59] = xor(variables[1] < variables[0], variables[5]-variables[17]); + variables[60] = xor(variables[1] < variables[0], -variables[5]); + variables[61] = xor(variables[1] < variables[0], pow(variables[5], variables[17])); + variables[62] = xor(variables[1] < variables[0], pow(variables[5], 1.0/variables[17])); + variables[63] = variables[1]/xor(variables[0], variables[5]); 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[65] = variables[1]+variables[0]; + variables[66] = variables[1]+variables[0]+variables[5]; + variables[67] = (variables[1] < variables[0])+(variables[5] > variables[17]); 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[69] = variables[1]-variables[0]; + variables[70] = (variables[1] < variables[0])-(variables[5] > variables[17]); + variables[71] = (variables[1] < variables[0])-(variables[5]+variables[17]); + variables[72] = (variables[1] < variables[0])-variables[5]; + variables[73] = variables[1]-(-variables[0]); + variables[74] = variables[1]-(-variables[0]*variables[5]); 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[76] = -(variables[1] < variables[0]); + variables[77] = variables[1]*variables[0]; + variables[78] = variables[1]*variables[0]*variables[5]; + variables[79] = (variables[1] < variables[0])*(variables[5] > variables[17]); + variables[80] = (variables[1]+variables[0])*(variables[5] > variables[17]); + variables[81] = variables[1]*(variables[0] > variables[5]); + variables[82] = (variables[1]-variables[0])*(variables[5] > variables[17]); + variables[83] = -variables[1]*(variables[0] > variables[5]); + variables[84] = (variables[1] < variables[0])*(variables[5]+variables[17]); + variables[85] = (variables[1] < variables[0])*variables[5]; + variables[86] = (variables[1] < variables[0])*(variables[5]-variables[17]); + variables[87] = (variables[1] < variables[0])*-variables[5]; + variables[88] = variables[1]/variables[0]; + variables[89] = (variables[1] < variables[0])/(variables[17] > variables[5]); + variables[90] = (variables[1]+variables[0])/(variables[17] > variables[5]); + variables[91] = variables[1]/(variables[5] > variables[0]); + variables[92] = (variables[1]-variables[0])/(variables[17] > variables[5]); + variables[93] = -variables[1]/(variables[5] > variables[0]); + variables[94] = (variables[1] < variables[0])/(variables[5]+variables[17]); + variables[95] = (variables[1] < variables[0])/variables[5]; + variables[96] = (variables[1] < variables[0])/(variables[5]-variables[17]); + variables[97] = (variables[1] < variables[0])/-variables[5]; + variables[98] = (variables[1] < variables[0])/(variables[5]*variables[17]); + variables[99] = (variables[1] < variables[0])/(variables[5]/variables[17]); 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[103] = pow(variables[1], variables[0]); + variables[104] = pow(variables[1] <= variables[0], variables[5] >= variables[17]); + variables[105] = pow(variables[1]+variables[0], variables[5] >= variables[17]); + variables[106] = pow(variables[1], variables[0] >= variables[5]); + variables[107] = pow(variables[1]-variables[0], variables[5] >= variables[17]); + variables[108] = pow(-variables[1], variables[0] >= variables[5]); + variables[109] = pow(variables[1]*variables[0], variables[5] >= variables[17]); + variables[110] = pow(variables[1]/variables[0], variables[5] >= variables[17]); + variables[111] = pow(variables[1] <= variables[0], variables[5]+variables[17]); + variables[112] = pow(variables[1] <= variables[0], variables[5]); + variables[113] = pow(variables[1] <= variables[0], variables[5]-variables[17]); + variables[114] = pow(variables[1] <= variables[0], -variables[5]); + variables[115] = pow(variables[1] <= variables[0], variables[5]*variables[17]); + variables[116] = pow(variables[1] <= variables[0], variables[5]/variables[17]); + variables[117] = pow(variables[1] <= variables[0], pow(variables[5], variables[17])); + variables[118] = pow(variables[1] <= variables[0], pow(variables[5], 1.0/variables[17])); 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[122] = pow(variables[1], 1.0/variables[0]); + variables[123] = pow(variables[1] < variables[0], 1.0/(variables[17] > variables[5])); + variables[124] = pow(variables[1]+variables[0], 1.0/(variables[17] > variables[5])); + variables[125] = pow(variables[1], 1.0/(variables[5] > variables[0])); + variables[126] = pow(variables[1]-variables[0], 1.0/(variables[17] > variables[5])); + variables[127] = pow(-variables[1], 1.0/(variables[5] > variables[0])); + variables[128] = pow(variables[1]*variables[0], 1.0/(variables[17] > variables[5])); + variables[129] = pow(variables[1]/variables[0], 1.0/(variables[17] > variables[5])); + variables[130] = pow(variables[1] < variables[0], 1.0/(variables[5]+variables[17])); + variables[131] = pow(variables[1] < variables[0], 1.0/variables[5]); + variables[132] = pow(variables[1] < variables[0], 1.0/(variables[5]-variables[17])); + variables[133] = pow(variables[1] < variables[0], 1.0/-variables[5]); + variables[134] = pow(variables[1] < variables[0], 1.0/(variables[5]*variables[17])); + variables[135] = pow(variables[1] < variables[0], 1.0/(variables[5]/variables[17])); + variables[136] = pow(variables[1] < variables[0], 1.0/pow(variables[5], variables[17])); + variables[137] = pow(variables[1] < variables[0], 1.0/pow(variables[5], 1.0/variables[17])); 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[144] = log(variables[1])/log(variables[0]); 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[147] = min(variables[1], variables[0]); + variables[148] = min(variables[1], min(variables[0], variables[5])); + variables[149] = max(variables[1], variables[0]); + variables[150] = max(variables[1], max(variables[0], variables[5])); + variables[151] = fmod(variables[1], variables[0]); variables[152] = sin(variables[1]); variables[153] = cos(variables[1]); variables[154] = tan(variables[1]); @@ -575,22 +575,22 @@ void computeComputedConstants(double *variables) 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[176] = (variables[1] > variables[0])?variables[1]:NAN; + variables[177] = (variables[1] > variables[0])?variables[1]:variables[5]; + variables[180] = (variables[1] > variables[0])?variables[1]:(variables[5] > variables[17])?variables[5]:(variables[178] > variables[179])?variables[178]:NAN; + variables[182] = (variables[1] > variables[0])?variables[1]:(variables[5] > variables[17])?variables[5]:(variables[178] > variables[179])?variables[178]:variables[181]; + variables[183] = 123.0+((variables[1] > variables[0])?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); + variables[195] = (variables[1] && variables[0])+((variables[5] > variables[17])?variables[0]:NAN)+variables[178]+(variables[179] && variables[181]); + variables[196] = (variables[1] && variables[0])-(((variables[5] > variables[17])?variables[0]:NAN)-(variables[178]-((variables[5] > variables[17])?variables[0]:NAN)))-(variables[179] && variables[181]); + variables[197] = (variables[1] && variables[0])*((variables[5] > variables[17])?variables[0]:NAN)*variables[178]*((variables[5] > variables[17])?variables[0]:NAN)*(variables[179] && variables[181]); + variables[198] = (variables[1] && variables[0])/(((variables[5] > variables[17])?variables[0]:NAN)/(variables[178]/((variables[5] > variables[17])?variables[0]:NAN))); + variables[199] = (variables[1] || variables[0]) && xor(variables[1], variables[0]) && ((variables[5] > variables[17])?variables[0]:NAN) && variables[178] && ((variables[5] > variables[17])?variables[0]:NAN) && xor(variables[1], variables[0]) && (variables[1] || variables[0]); + variables[200] = (variables[1] && variables[0]) || xor(variables[1], variables[0]) || ((variables[5] > variables[17])?variables[0]:NAN) || variables[178] || ((variables[5] > variables[17])?variables[0]:NAN) || xor(variables[1], variables[0]) || (variables[1] && variables[0]); + variables[201] = xor(variables[1] && variables[0], xor(variables[1] || variables[0], xor((variables[5] > variables[17])?variables[0]:NAN, xor(xor(xor(variables[178], (variables[5] > variables[17])?variables[0]:NAN), variables[1] || variables[0]), variables[1] && variables[0])))); + variables[202] = pow(variables[1] && variables[0], pow((variables[5] > variables[17])?variables[0]:NAN, pow(pow(variables[178], (variables[5] > variables[17])?variables[0]:NAN), variables[1] && variables[0]))); + variables[203] = pow(pow(pow(variables[1] && variables[0], 1.0/pow((variables[5] > variables[17])?variables[0]:NAN, 1.0/variables[178])), 1.0/((variables[5] > variables[17])?variables[0]:NAN)), 1.0/(variables[1] && variables[0])); + variables[204] = -(variables[1] && variables[0])+-((variables[5] > variables[17])?variables[0]:NAN); } void computeRates(double voi, double *states, double *rates, double *variables) diff --git a/tests/resources/coverage/generator/model.modified.profile.py b/tests/resources/coverage/generator/model.modified.profile.py index 41a10415e4..66ce047977 100644 --- a/tests/resources/coverage/generator/model.modified.profile.py +++ b/tests/resources/coverage/generator/model.modified.profile.py @@ -26,13 +26,13 @@ class VariableType(Enum): ] VARIABLE_INFO = [ - {"name": "eqnEq", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "m", "units": "dimensionless", "component": "my_component", "type": VariableType.CONSTANT}, {"name": "n", "units": "dimensionless", "component": "my_component", "type": VariableType.CONSTANT}, + {"name": "m", "units": "dimensionless", "component": "my_component", "type": VariableType.CONSTANT}, + {"name": "eqnEq", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnEqCoverageParentheses", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnNeq", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "eqnNeqCoverageParentheses", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "o", "units": "dimensionless", "component": "my_component", "type": VariableType.CONSTANT}, + {"name": "eqnNeqCoverageParentheses", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnLt", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnLtCoverageParentheses", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnLeq", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, @@ -43,8 +43,8 @@ class VariableType(Enum): {"name": "eqnGeqCoverageParentheses", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnAnd", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnAndMultiple", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "eqnAndParentheses", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "p", "units": "dimensionless", "component": "my_component", "type": VariableType.CONSTANT}, + {"name": "eqnAndParentheses", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnAndParenthesesLeftPlusWith", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnAndParenthesesLeftPlusWithout", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnAndParenthesesLeftMinusWith", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, @@ -204,11 +204,11 @@ class VariableType(Enum): {"name": "eqnArccoth", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnPiecewisePiece", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnPiecewisePieceOtherwise", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "eqnPiecewisePiecePiecePiece", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "q", "units": "dimensionless", "component": "my_component", "type": VariableType.CONSTANT}, {"name": "r", "units": "dimensionless", "component": "my_component", "type": VariableType.CONSTANT}, - {"name": "eqnPiecewisePiecePiecePieceOtherwise", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "eqnPiecewisePiecePiecePiece", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "s", "units": "dimensionless", "component": "my_component", "type": VariableType.CONSTANT}, + {"name": "eqnPiecewisePiecePiecePieceOtherwise", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnWithPiecewise", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnCnInteger", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnCnDouble", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, @@ -231,10 +231,10 @@ class VariableType(Enum): {"name": "eqnCoverageForPowerOperator", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnCoverageForRootOperator", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnCoverageForMinusUnary", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "eqnNlaVariable1", "units": "dimensionless", "component": "my_component", "type": VariableType.ALGEBRAIC}, {"name": "eqnNlaVariable2", "units": "dimensionless", "component": "my_component", "type": VariableType.ALGEBRAIC}, - {"name": "eqnComputedConstant1", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "eqnComputedConstant2", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT} + {"name": "eqnNlaVariable1", "units": "dimensionless", "component": "my_component", "type": VariableType.ALGEBRAIC}, + {"name": "eqnComputedConstant2", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "eqnComputedConstant1", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT} ] @@ -360,8 +360,8 @@ def objective_function_0(u, f, data): variables[205] = u[0] variables[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] = variables[206]+variables[205]+states[0]-0.0 + f[1] = variables[206]-variables[205]-(variables[208]+variables[207]) def find_root_0(voi, states, rates, variables): @@ -377,15 +377,15 @@ def find_root_0(voi, states, rates, variables): def initialise_variables(states, rates, variables): + variables[0] = 2.0 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[5] = 3.0 + variables[17] = 4.0 + variables[178] = 5.0 + variables[179] = 6.0 + variables[181] = 7.0 + variables[205] = 2.0 + variables[206] = 1.0 variables[184] = 123.0 variables[185] = 123.456789 variables[186] = 123.0e99 @@ -396,160 +396,160 @@ def initialise_variables(states, rates, variables): variables[192] = 3.14159265358979 variables[193] = inf variables[194] = nan - variables[207] = 1.0 - variables[208] = 3.0 + variables[208] = 1.0 + variables[207] = 3.0 states[0] = 0.0 def compute_computed_constants(variables): - 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[2] = eq_func(variables[1], variables[0]) + variables[3] = variables[1]/eq_func(variables[0], variables[0]) + variables[4] = neq_func(variables[1], variables[0]) + variables[6] = variables[1]/neq_func(variables[0], variables[5]) + variables[7] = lt_func(variables[1], variables[0]) + variables[8] = variables[1]/lt_func(variables[0], variables[5]) + variables[9] = leq_func(variables[1], variables[0]) + variables[10] = variables[1]/leq_func(variables[0], variables[5]) + variables[11] = gt_func(variables[1], variables[0]) + variables[12] = variables[1]/gt_func(variables[0], variables[5]) + variables[13] = geq_func(variables[1], variables[0]) + variables[14] = variables[1]/geq_func(variables[0], variables[5]) + variables[15] = and_func(variables[1], variables[0]) + variables[16] = and_func(variables[1], and_func(variables[0], variables[5])) + variables[18] = and_func(lt_func(variables[1], variables[0]), gt_func(variables[5], variables[17])) + variables[19] = and_func(variables[1]+variables[0], gt_func(variables[5], variables[17])) + variables[20] = and_func(variables[1], gt_func(variables[0], variables[5])) + variables[21] = and_func(variables[1]-variables[0], gt_func(variables[5], variables[17])) + variables[22] = and_func(-variables[1], gt_func(variables[0], variables[5])) + variables[23] = and_func(pow(variables[1], variables[0]), gt_func(variables[5], variables[17])) + variables[24] = and_func(pow(variables[1], 1.0/variables[0]), gt_func(variables[5], variables[17])) + variables[25] = and_func(lt_func(variables[1], variables[0]), variables[5]+variables[17]) + variables[26] = and_func(lt_func(variables[1], variables[0]), variables[5]) + variables[27] = and_func(lt_func(variables[1], variables[0]), variables[5]-variables[17]) + variables[28] = and_func(lt_func(variables[1], variables[0]), -variables[5]) + variables[29] = and_func(lt_func(variables[1], variables[0]), pow(variables[5], variables[17])) + variables[30] = and_func(lt_func(variables[1], variables[0]), pow(variables[5], 1.0/variables[17])) + variables[31] = variables[1]/and_func(variables[0], variables[5]) + variables[32] = or_func(variables[1], variables[0]) + variables[33] = or_func(variables[1], or_func(variables[0], variables[5])) + variables[34] = or_func(lt_func(variables[1], variables[0]), gt_func(variables[5], variables[17])) + variables[35] = or_func(variables[1]+variables[0], gt_func(variables[5], variables[17])) + variables[36] = or_func(variables[1], gt_func(variables[0], variables[5])) + variables[37] = or_func(variables[1]-variables[0], gt_func(variables[5], variables[17])) + variables[38] = or_func(-variables[1], gt_func(variables[0], variables[5])) + variables[39] = or_func(pow(variables[1], variables[0]), gt_func(variables[5], variables[17])) + variables[40] = or_func(pow(variables[1], 1.0/variables[0]), gt_func(variables[5], variables[17])) + variables[41] = or_func(lt_func(variables[1], variables[0]), variables[5]+variables[17]) + variables[42] = or_func(lt_func(variables[1], variables[0]), variables[5]) + variables[43] = or_func(lt_func(variables[1], variables[0]), variables[5]-variables[17]) + variables[44] = or_func(lt_func(variables[1], variables[0]), -variables[5]) + variables[45] = or_func(lt_func(variables[1], variables[0]), pow(variables[5], variables[17])) + variables[46] = or_func(lt_func(variables[1], variables[0]), pow(variables[5], 1.0/variables[17])) + variables[47] = variables[1]/or_func(variables[0], variables[5]) + variables[48] = xor_func(variables[1], variables[0]) + variables[49] = xor_func(variables[1], xor_func(variables[0], variables[5])) + variables[50] = xor_func(lt_func(variables[1], variables[0]), gt_func(variables[5], variables[17])) + variables[51] = xor_func(variables[1]+variables[0], gt_func(variables[5], variables[17])) + variables[52] = xor_func(variables[1], gt_func(variables[0], variables[5])) + variables[53] = xor_func(variables[1]-variables[0], gt_func(variables[5], variables[17])) + variables[54] = xor_func(-variables[1], gt_func(variables[0], variables[5])) + variables[55] = xor_func(pow(variables[1], variables[0]), gt_func(variables[5], variables[17])) + variables[56] = xor_func(pow(variables[1], 1.0/variables[0]), gt_func(variables[5], variables[17])) + variables[57] = xor_func(lt_func(variables[1], variables[0]), variables[5]+variables[17]) + variables[58] = xor_func(lt_func(variables[1], variables[0]), variables[5]) + variables[59] = xor_func(lt_func(variables[1], variables[0]), variables[5]-variables[17]) + variables[60] = xor_func(lt_func(variables[1], variables[0]), -variables[5]) + variables[61] = xor_func(lt_func(variables[1], variables[0]), pow(variables[5], variables[17])) + variables[62] = xor_func(lt_func(variables[1], variables[0]), pow(variables[5], 1.0/variables[17])) + variables[63] = variables[1]/xor_func(variables[0], variables[5]) 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[65] = variables[1]+variables[0] + variables[66] = variables[1]+variables[0]+variables[5] + variables[67] = lt_func(variables[1], variables[0])+gt_func(variables[5], variables[17]) 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[69] = variables[1]-variables[0] + variables[70] = lt_func(variables[1], variables[0])-gt_func(variables[5], variables[17]) + variables[71] = lt_func(variables[1], variables[0])-(variables[5]+variables[17]) + variables[72] = lt_func(variables[1], variables[0])-variables[5] + variables[73] = variables[1]-(-variables[0]) + variables[74] = variables[1]-(-variables[0]*variables[5]) 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[76] = -lt_func(variables[1], variables[0]) + variables[77] = variables[1]*variables[0] + variables[78] = variables[1]*variables[0]*variables[5] + variables[79] = lt_func(variables[1], variables[0])*gt_func(variables[5], variables[17]) + variables[80] = (variables[1]+variables[0])*gt_func(variables[5], variables[17]) + variables[81] = variables[1]*gt_func(variables[0], variables[5]) + variables[82] = (variables[1]-variables[0])*gt_func(variables[5], variables[17]) + variables[83] = -variables[1]*gt_func(variables[0], variables[5]) + variables[84] = lt_func(variables[1], variables[0])*(variables[5]+variables[17]) + variables[85] = lt_func(variables[1], variables[0])*variables[5] + variables[86] = lt_func(variables[1], variables[0])*(variables[5]-variables[17]) + variables[87] = lt_func(variables[1], variables[0])*-variables[5] + variables[88] = variables[1]/variables[0] + variables[89] = lt_func(variables[1], variables[0])/gt_func(variables[17], variables[5]) + variables[90] = (variables[1]+variables[0])/gt_func(variables[17], variables[5]) + variables[91] = variables[1]/gt_func(variables[5], variables[0]) + variables[92] = (variables[1]-variables[0])/gt_func(variables[17], variables[5]) + variables[93] = -variables[1]/gt_func(variables[5], variables[0]) + variables[94] = lt_func(variables[1], variables[0])/(variables[5]+variables[17]) + variables[95] = lt_func(variables[1], variables[0])/variables[5] + variables[96] = lt_func(variables[1], variables[0])/(variables[5]-variables[17]) + variables[97] = lt_func(variables[1], variables[0])/-variables[5] + variables[98] = lt_func(variables[1], variables[0])/(variables[5]*variables[17]) + variables[99] = lt_func(variables[1], variables[0])/(variables[5]/variables[17]) 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[103] = pow(variables[1], variables[0]) + variables[104] = pow(leq_func(variables[1], variables[0]), geq_func(variables[5], variables[17])) + variables[105] = pow(variables[1]+variables[0], geq_func(variables[5], variables[17])) + variables[106] = pow(variables[1], geq_func(variables[0], variables[5])) + variables[107] = pow(variables[1]-variables[0], geq_func(variables[5], variables[17])) + variables[108] = pow(-variables[1], geq_func(variables[0], variables[5])) + variables[109] = pow(variables[1]*variables[0], geq_func(variables[5], variables[17])) + variables[110] = pow(variables[1]/variables[0], geq_func(variables[5], variables[17])) + variables[111] = pow(leq_func(variables[1], variables[0]), variables[5]+variables[17]) + variables[112] = pow(leq_func(variables[1], variables[0]), variables[5]) + variables[113] = pow(leq_func(variables[1], variables[0]), variables[5]-variables[17]) + variables[114] = pow(leq_func(variables[1], variables[0]), -variables[5]) + variables[115] = pow(leq_func(variables[1], variables[0]), variables[5]*variables[17]) + variables[116] = pow(leq_func(variables[1], variables[0]), variables[5]/variables[17]) + variables[117] = pow(leq_func(variables[1], variables[0]), pow(variables[5], variables[17])) + variables[118] = pow(leq_func(variables[1], variables[0]), pow(variables[5], 1.0/variables[17])) 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[122] = pow(variables[1], 1.0/variables[0]) + variables[123] = pow(lt_func(variables[1], variables[0]), 1.0/gt_func(variables[17], variables[5])) + variables[124] = pow(variables[1]+variables[0], 1.0/gt_func(variables[17], variables[5])) + variables[125] = pow(variables[1], 1.0/gt_func(variables[5], variables[0])) + variables[126] = pow(variables[1]-variables[0], 1.0/gt_func(variables[17], variables[5])) + variables[127] = pow(-variables[1], 1.0/gt_func(variables[5], variables[0])) + variables[128] = pow(variables[1]*variables[0], 1.0/gt_func(variables[17], variables[5])) + variables[129] = pow(variables[1]/variables[0], 1.0/gt_func(variables[17], variables[5])) + variables[130] = pow(lt_func(variables[1], variables[0]), 1.0/(variables[5]+variables[17])) + variables[131] = pow(lt_func(variables[1], variables[0]), 1.0/variables[5]) + variables[132] = pow(lt_func(variables[1], variables[0]), 1.0/(variables[5]-variables[17])) + variables[133] = pow(lt_func(variables[1], variables[0]), 1.0/-variables[5]) + variables[134] = pow(lt_func(variables[1], variables[0]), 1.0/(variables[5]*variables[17])) + variables[135] = pow(lt_func(variables[1], variables[0]), 1.0/(variables[5]/variables[17])) + variables[136] = pow(lt_func(variables[1], variables[0]), 1.0/pow(variables[5], variables[17])) + variables[137] = pow(lt_func(variables[1], variables[0]), 1.0/pow(variables[5], 1.0/variables[17])) 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[144] = log(variables[1])/log(variables[0]) 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[147] = min(variables[1], variables[0]) + variables[148] = min(variables[1], min(variables[0], variables[5])) + variables[149] = max(variables[1], variables[0]) + variables[150] = max(variables[1], max(variables[0], variables[5])) + variables[151] = fmod(variables[1], variables[0]) variables[152] = sin(variables[1]) variables[153] = cos(variables[1]) variables[154] = tan(variables[1]) @@ -574,22 +574,22 @@ def compute_computed_constants(variables): 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[176] = variables[1] if gt_func(variables[1], variables[0]) else nan + variables[177] = variables[1] if gt_func(variables[1], variables[0]) else variables[5] + variables[180] = variables[1] if gt_func(variables[1], variables[0]) else variables[5] if gt_func(variables[5], variables[17]) else variables[178] if gt_func(variables[178], variables[179]) else nan + variables[182] = variables[1] if gt_func(variables[1], variables[0]) else variables[5] if gt_func(variables[5], variables[17]) else variables[178] if gt_func(variables[178], variables[179]) else variables[181] + variables[183] = 123.0+(variables[1] if gt_func(variables[1], variables[0]) 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) + variables[195] = and_func(variables[1], variables[0])+(variables[0] if gt_func(variables[5], variables[17]) else nan)+variables[178]+and_func(variables[179], variables[181]) + variables[196] = and_func(variables[1], variables[0])-((variables[0] if gt_func(variables[5], variables[17]) else nan)-(variables[178]-(variables[0] if gt_func(variables[5], variables[17]) else nan)))-and_func(variables[179], variables[181]) + variables[197] = and_func(variables[1], variables[0])*(variables[0] if gt_func(variables[5], variables[17]) else nan)*variables[178]*(variables[0] if gt_func(variables[5], variables[17]) else nan)*and_func(variables[179], variables[181]) + variables[198] = and_func(variables[1], variables[0])/((variables[0] if gt_func(variables[5], variables[17]) else nan)/(variables[178]/(variables[0] if gt_func(variables[5], variables[17]) else nan))) + variables[199] = and_func(or_func(variables[1], variables[0]), and_func(xor_func(variables[1], variables[0]), and_func(variables[0] if gt_func(variables[5], variables[17]) else nan, and_func(and_func(and_func(variables[178], variables[0] if gt_func(variables[5], variables[17]) else nan), xor_func(variables[1], variables[0])), or_func(variables[1], variables[0]))))) + variables[200] = or_func(and_func(variables[1], variables[0]), or_func(xor_func(variables[1], variables[0]), or_func(variables[0] if gt_func(variables[5], variables[17]) else nan, or_func(or_func(or_func(variables[178], variables[0] if gt_func(variables[5], variables[17]) else nan), xor_func(variables[1], variables[0])), and_func(variables[1], variables[0]))))) + variables[201] = xor_func(and_func(variables[1], variables[0]), xor_func(or_func(variables[1], variables[0]), xor_func(variables[0] if gt_func(variables[5], variables[17]) else nan, xor_func(xor_func(xor_func(variables[178], variables[0] if gt_func(variables[5], variables[17]) else nan), or_func(variables[1], variables[0])), and_func(variables[1], variables[0]))))) + variables[202] = pow(and_func(variables[1], variables[0]), pow(variables[0] if gt_func(variables[5], variables[17]) else nan, pow(pow(variables[178], variables[0] if gt_func(variables[5], variables[17]) else nan), and_func(variables[1], variables[0])))) + variables[203] = pow(pow(pow(and_func(variables[1], variables[0]), 1.0/pow(variables[0] if gt_func(variables[5], variables[17]) else nan, 1.0/variables[178])), 1.0/(variables[0] if gt_func(variables[5], variables[17]) else nan)), 1.0/and_func(variables[1], variables[0])) + variables[204] = -and_func(variables[1], variables[0])+-(variables[0] if gt_func(variables[5], variables[17]) else nan) def compute_rates(voi, states, rates, variables): diff --git a/tests/resources/coverage/generator/model.out b/tests/resources/coverage/generator/model.out index 8378ff13bf..89fb54c1e4 100644 --- a/tests/resources/coverage/generator/model.out +++ b/tests/resources/coverage/generator/model.out @@ -98,8 +98,8 @@ void objectiveFunction0(double *u, double *f, void *data) variables[205] = u[0]; variables[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] = variables[206]+variables[205]+states[0]-0.0; + f[1] = variables[206]-variables[205]-(variables[208]+variables[207]); } void findRoot0(double voi, double *states, double *rates, double *variables) @@ -118,15 +118,15 @@ void findRoot0(double voi, double *states, double *rates, double *variables) void initialiseVariables(double *states, double *rates, double *variables) { + variables[0] = 2.0; 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[5] = 3.0; + variables[17] = 4.0; + variables[178] = 5.0; + variables[179] = 6.0; + variables[181] = 7.0; + variables[205] = 2.0; + variables[206] = 1.0; variables[184] = 123.0; variables[185] = 123.456789; variables[186] = 123.0e99; @@ -137,161 +137,161 @@ void initialiseVariables(double *states, double *rates, double *variables) variables[192] = 3.14159265358979; variables[193] = INFINITY; variables[194] = NAN; - variables[207] = 1.0; - variables[208] = 3.0; + variables[208] = 1.0; + variables[207] = 3.0; states[0] = 0.0; } void computeComputedConstants(double *variables) { - 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[2] = variables[1] == variables[0]; + variables[3] = variables[1]/(variables[0] == variables[0]); + variables[4] = variables[1] != variables[0]; + variables[6] = variables[1]/(variables[0] != variables[5]); + variables[7] = variables[1] < variables[0]; + variables[8] = variables[1]/(variables[0] < variables[5]); + variables[9] = variables[1] <= variables[0]; + variables[10] = variables[1]/(variables[0] <= variables[5]); + variables[11] = variables[1] > variables[0]; + variables[12] = variables[1]/(variables[0] > variables[5]); + variables[13] = variables[1] >= variables[0]; + variables[14] = variables[1]/(variables[0] >= variables[5]); + variables[15] = variables[1] && variables[0]; + variables[16] = variables[1] && variables[0] && variables[5]; + variables[18] = (variables[1] < variables[0]) && (variables[5] > variables[17]); + variables[19] = (variables[1]+variables[0]) && (variables[5] > variables[17]); + variables[20] = variables[1] && (variables[0] > variables[5]); + variables[21] = (variables[1]-variables[0]) && (variables[5] > variables[17]); + variables[22] = -variables[1] && (variables[0] > variables[5]); + variables[23] = (variables[1]^^variables[0]) && (variables[5] > variables[17]); + variables[24] = (variables[1]^^(1.0/variables[0])) && (variables[5] > variables[17]); + variables[25] = (variables[1] < variables[0]) && (variables[5]+variables[17]); + variables[26] = (variables[1] < variables[0]) && variables[5]; + variables[27] = (variables[1] < variables[0]) && (variables[5]-variables[17]); + variables[28] = (variables[1] < variables[0]) && -variables[5]; + variables[29] = (variables[1] < variables[0]) && (variables[5]^^variables[17]); + variables[30] = (variables[1] < variables[0]) && (variables[5]^^(1.0/variables[17])); + variables[31] = variables[1]/(variables[0] && variables[5]); + variables[32] = variables[1] || variables[0]; + variables[33] = variables[1] || variables[0] || variables[5]; + variables[34] = (variables[1] < variables[0]) || (variables[5] > variables[17]); + variables[35] = (variables[1]+variables[0]) || (variables[5] > variables[17]); + variables[36] = variables[1] || (variables[0] > variables[5]); + variables[37] = (variables[1]-variables[0]) || (variables[5] > variables[17]); + variables[38] = -variables[1] || (variables[0] > variables[5]); + variables[39] = (variables[1]^^variables[0]) || (variables[5] > variables[17]); + variables[40] = (variables[1]^^(1.0/variables[0])) || (variables[5] > variables[17]); + variables[41] = (variables[1] < variables[0]) || (variables[5]+variables[17]); + variables[42] = (variables[1] < variables[0]) || variables[5]; + variables[43] = (variables[1] < variables[0]) || (variables[5]-variables[17]); + variables[44] = (variables[1] < variables[0]) || -variables[5]; + variables[45] = (variables[1] < variables[0]) || (variables[5]^^variables[17]); + variables[46] = (variables[1] < variables[0]) || (variables[5]^^(1.0/variables[17])); + variables[47] = variables[1]/(variables[0] || variables[5]); + variables[48] = variables[1]^variables[0]; + variables[49] = variables[1]^variables[0]^variables[5]; + variables[50] = (variables[1] < variables[0])^(variables[5] > variables[17]); + variables[51] = (variables[1]+variables[0])^(variables[5] > variables[17]); + variables[52] = variables[1]^(variables[0] > variables[5]); + variables[53] = (variables[1]-variables[0])^(variables[5] > variables[17]); + variables[54] = -variables[1]^(variables[0] > variables[5]); + variables[55] = (variables[1]^^variables[0])^(variables[5] > variables[17]); + variables[56] = (variables[1]^^(1.0/variables[0]))^(variables[5] > variables[17]); + variables[57] = (variables[1] < variables[0])^(variables[5]+variables[17]); + variables[58] = (variables[1] < variables[0])^variables[5]; + variables[59] = (variables[1] < variables[0])^(variables[5]-variables[17]); + variables[60] = (variables[1] < variables[0])^-variables[5]; + variables[61] = (variables[1] < variables[0])^(variables[5]^^variables[17]); + variables[62] = (variables[1] < variables[0])^(variables[5]^^(1.0/variables[17])); + variables[63] = variables[1]/(variables[0]^variables[5]); 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[65] = variables[1]+variables[0]; + variables[66] = variables[1]+variables[0]+variables[5]; + variables[67] = (variables[1] < variables[0])+(variables[5] > variables[17]); 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[69] = variables[1]-variables[0]; + variables[70] = (variables[1] < variables[0])-(variables[5] > variables[17]); + variables[71] = (variables[1] < variables[0])-(variables[5]+variables[17]); + variables[72] = (variables[1] < variables[0])-variables[5]; + variables[73] = variables[1]-(-variables[0]); + variables[74] = variables[1]-(-variables[0]*variables[5]); 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[76] = -(variables[1] < variables[0]); + variables[77] = variables[1]*variables[0]; + variables[78] = variables[1]*variables[0]*variables[5]; + variables[79] = (variables[1] < variables[0])*(variables[5] > variables[17]); + variables[80] = (variables[1]+variables[0])*(variables[5] > variables[17]); + variables[81] = variables[1]*(variables[0] > variables[5]); + variables[82] = (variables[1]-variables[0])*(variables[5] > variables[17]); + variables[83] = -variables[1]*(variables[0] > variables[5]); + variables[84] = (variables[1] < variables[0])*(variables[5]+variables[17]); + variables[85] = (variables[1] < variables[0])*variables[5]; + variables[86] = (variables[1] < variables[0])*(variables[5]-variables[17]); + variables[87] = (variables[1] < variables[0])*-variables[5]; + variables[88] = variables[1]/variables[0]; + variables[89] = (variables[1] < variables[0])/(variables[17] > variables[5]); + variables[90] = (variables[1]+variables[0])/(variables[17] > variables[5]); + variables[91] = variables[1]/(variables[5] > variables[0]); + variables[92] = (variables[1]-variables[0])/(variables[17] > variables[5]); + variables[93] = -variables[1]/(variables[5] > variables[0]); + variables[94] = (variables[1] < variables[0])/(variables[5]+variables[17]); + variables[95] = (variables[1] < variables[0])/variables[5]; + variables[96] = (variables[1] < variables[0])/(variables[5]-variables[17]); + variables[97] = (variables[1] < variables[0])/-variables[5]; + variables[98] = (variables[1] < variables[0])/(variables[5]*variables[17]); + variables[99] = (variables[1] < variables[0])/(variables[5]/variables[17]); 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[103] = variables[1]^^variables[0]; + variables[104] = (variables[1] <= variables[0])^^(variables[5] >= variables[17]); + variables[105] = (variables[1]+variables[0])^^(variables[5] >= variables[17]); + variables[106] = variables[1]^^(variables[0] >= variables[5]); + variables[107] = (variables[1]-variables[0])^^(variables[5] >= variables[17]); + variables[108] = (-variables[1])^^(variables[0] >= variables[5]); + variables[109] = (variables[1]*variables[0])^^(variables[5] >= variables[17]); + variables[110] = (variables[1]/variables[0])^^(variables[5] >= variables[17]); + variables[111] = (variables[1] <= variables[0])^^(variables[5]+variables[17]); + variables[112] = (variables[1] <= variables[0])^^variables[5]; + variables[113] = (variables[1] <= variables[0])^^variables[5]-variables[17]; + variables[114] = (variables[1] <= variables[0])^^-variables[5]; + variables[115] = (variables[1] <= variables[0])^^(variables[5]*variables[17]); + variables[116] = (variables[1] <= variables[0])^^(variables[5]/variables[17]); + variables[117] = (variables[1] <= variables[0])^^(variables[5]^^variables[17]); + variables[118] = (variables[1] <= variables[0])^^(variables[5]^^(1.0/variables[17])); 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[122] = variables[1]^^(1.0/variables[0]); + variables[123] = (variables[1] < variables[0])^^(1.0/(variables[17] > variables[5])); + variables[124] = (variables[1]+variables[0])^^(1.0/(variables[17] > variables[5])); + variables[125] = variables[1]^^(1.0/(variables[5] > variables[0])); + variables[126] = (variables[1]-variables[0])^^(1.0/(variables[17] > variables[5])); + variables[127] = (-variables[1])^^(1.0/(variables[5] > variables[0])); + variables[128] = (variables[1]*variables[0])^^(1.0/(variables[17] > variables[5])); + variables[129] = (variables[1]/variables[0])^^(1.0/(variables[17] > variables[5])); + variables[130] = (variables[1] < variables[0])^^(1.0/(variables[5]+variables[17])); + variables[131] = (variables[1] < variables[0])^^(1.0/variables[5]); + variables[132] = (variables[1] < variables[0])^^(1.0/(variables[5]-variables[17])); + variables[133] = (variables[1] < variables[0])^^(1.0/(-variables[5])); + variables[134] = (variables[1] < variables[0])^^(1.0/(variables[5]*variables[17])); + variables[135] = (variables[1] < variables[0])^^(1.0/(variables[5]/variables[17])); + variables[136] = (variables[1] < variables[0])^^(1.0/(variables[5]^^variables[17])); + variables[137] = (variables[1] < variables[0])^^(1.0/(variables[5]^^(1.0/variables[17]))); 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[144] = log(variables[1])/log(variables[0]); 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[147] = min(variables[1], variables[0]); + variables[148] = min(variables[1], min(variables[0], variables[5])); + variables[149] = max(variables[1], variables[0]); + variables[150] = max(variables[1], max(variables[0], variables[5])); + variables[151] = fmod(variables[1], variables[0]); variables[152] = sin(variables[1]); variables[153] = cos(variables[1]); variables[154] = tan(variables[1]); @@ -316,22 +316,22 @@ void computeComputedConstants(double *variables) 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[176] = piecewise(variables[1] > variables[0], variables[1], NAN); + variables[177] = piecewise(variables[1] > variables[0], variables[1], variables[5]); + variables[180] = piecewise(variables[1] > variables[0], variables[1], piecewise(variables[5] > variables[17], variables[5], piecewise(variables[178] > variables[179], variables[178], NAN))); + variables[182] = piecewise(variables[1] > variables[0], variables[1], piecewise(variables[5] > variables[17], variables[5], piecewise(variables[178] > variables[179], variables[178], variables[181]))); + variables[183] = 123.0+piecewise(variables[1] > variables[0], 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); + variables[195] = (variables[1] && variables[0])+piecewise(variables[5] > variables[17], variables[0], NAN)+variables[178]+(variables[179] && variables[181]); + variables[196] = (variables[1] && variables[0])-(piecewise(variables[5] > variables[17], variables[0], NAN)-(variables[178]-piecewise(variables[5] > variables[17], variables[0], NAN)))-(variables[179] && variables[181]); + variables[197] = (variables[1] && variables[0])*piecewise(variables[5] > variables[17], variables[0], NAN)*variables[178]*piecewise(variables[5] > variables[17], variables[0], NAN)*(variables[179] && variables[181]); + variables[198] = (variables[1] && variables[0])/(piecewise(variables[5] > variables[17], variables[0], NAN)/(variables[178]/piecewise(variables[5] > variables[17], variables[0], NAN))); + variables[199] = (variables[1] || variables[0]) && (variables[1]^variables[0]) && piecewise(variables[5] > variables[17], variables[0], NAN) && variables[178] && piecewise(variables[5] > variables[17], variables[0], NAN) && (variables[1]^variables[0]) && (variables[1] || variables[0]); + variables[200] = (variables[1] && variables[0]) || (variables[1]^variables[0]) || piecewise(variables[5] > variables[17], variables[0], NAN) || variables[178] || piecewise(variables[5] > variables[17], variables[0], NAN) || (variables[1]^variables[0]) || (variables[1] && variables[0]); + variables[201] = (variables[1] && variables[0])^(variables[1] || variables[0])^piecewise(variables[5] > variables[17], variables[0], NAN)^variables[178]^piecewise(variables[5] > variables[17], variables[0], NAN)^(variables[1] || variables[0])^(variables[1] && variables[0]); + variables[202] = (variables[1] && variables[0])^^(piecewise(variables[5] > variables[17], variables[0], NAN)^^(variables[178]^^piecewise(variables[5] > variables[17], variables[0], NAN)^^(variables[1] && variables[0]))); + variables[203] = (variables[1] && variables[0])^^(1.0/(piecewise(variables[5] > variables[17], variables[0], NAN)^^(1.0/variables[178])))^^(1.0/piecewise(variables[5] > variables[17], variables[0], NAN))^^(1.0/(variables[1] && variables[0])); + variables[204] = -(variables[1] && variables[0])+-piecewise(variables[5] > variables[17], variables[0], NAN); } void computeRates(double voi, double *states, double *rates, double *variables) diff --git a/tests/resources/coverage/generator/model.py b/tests/resources/coverage/generator/model.py index 4a40de573f..b238ee713f 100644 --- a/tests/resources/coverage/generator/model.py +++ b/tests/resources/coverage/generator/model.py @@ -26,13 +26,13 @@ class VariableType(Enum): ] VARIABLE_INFO = [ - {"name": "eqnEq", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "m", "units": "dimensionless", "component": "my_component", "type": VariableType.CONSTANT}, {"name": "n", "units": "dimensionless", "component": "my_component", "type": VariableType.CONSTANT}, + {"name": "m", "units": "dimensionless", "component": "my_component", "type": VariableType.CONSTANT}, + {"name": "eqnEq", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnEqCoverageParentheses", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnNeq", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "eqnNeqCoverageParentheses", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "o", "units": "dimensionless", "component": "my_component", "type": VariableType.CONSTANT}, + {"name": "eqnNeqCoverageParentheses", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnLt", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnLtCoverageParentheses", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnLeq", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, @@ -43,8 +43,8 @@ class VariableType(Enum): {"name": "eqnGeqCoverageParentheses", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnAnd", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnAndMultiple", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "eqnAndParentheses", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "p", "units": "dimensionless", "component": "my_component", "type": VariableType.CONSTANT}, + {"name": "eqnAndParentheses", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnAndParenthesesLeftPlusWith", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnAndParenthesesLeftPlusWithout", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnAndParenthesesLeftMinusWith", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, @@ -204,11 +204,11 @@ class VariableType(Enum): {"name": "eqnArccoth", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnPiecewisePiece", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnPiecewisePieceOtherwise", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "eqnPiecewisePiecePiecePiece", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "q", "units": "dimensionless", "component": "my_component", "type": VariableType.CONSTANT}, {"name": "r", "units": "dimensionless", "component": "my_component", "type": VariableType.CONSTANT}, - {"name": "eqnPiecewisePiecePiecePieceOtherwise", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "eqnPiecewisePiecePiecePiece", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "s", "units": "dimensionless", "component": "my_component", "type": VariableType.CONSTANT}, + {"name": "eqnPiecewisePiecePiecePieceOtherwise", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnWithPiecewise", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnCnInteger", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnCnDouble", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, @@ -231,10 +231,10 @@ class VariableType(Enum): {"name": "eqnCoverageForPowerOperator", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnCoverageForRootOperator", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, {"name": "eqnCoverageForMinusUnary", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "eqnNlaVariable1", "units": "dimensionless", "component": "my_component", "type": VariableType.ALGEBRAIC}, {"name": "eqnNlaVariable2", "units": "dimensionless", "component": "my_component", "type": VariableType.ALGEBRAIC}, - {"name": "eqnComputedConstant1", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "eqnComputedConstant2", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT} + {"name": "eqnNlaVariable1", "units": "dimensionless", "component": "my_component", "type": VariableType.ALGEBRAIC}, + {"name": "eqnComputedConstant2", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "eqnComputedConstant1", "units": "dimensionless", "component": "my_component", "type": VariableType.COMPUTED_CONSTANT} ] @@ -360,8 +360,8 @@ def objective_function_0(u, f, data): variables[205] = u[0] variables[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] = variables[206]+variables[205]+states[0]-0.0 + f[1] = variables[206]-variables[205]-(variables[208]+variables[207]) def find_root_0(voi, states, rates, variables): @@ -377,15 +377,15 @@ def find_root_0(voi, states, rates, variables): def initialise_variables(states, rates, variables): + variables[0] = 2.0 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[5] = 3.0 + variables[17] = 4.0 + variables[178] = 5.0 + variables[179] = 6.0 + variables[181] = 7.0 + variables[205] = 2.0 + variables[206] = 1.0 variables[184] = 123.0 variables[185] = 123.456789 variables[186] = 123.0e99 @@ -396,160 +396,160 @@ def initialise_variables(states, rates, variables): variables[192] = 3.14159265358979 variables[193] = inf variables[194] = nan - variables[207] = 1.0 - variables[208] = 3.0 + variables[208] = 1.0 + variables[207] = 3.0 states[0] = 0.0 def compute_computed_constants(variables): - 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[2] = eq_func(variables[1], variables[0]) + variables[3] = variables[1]/eq_func(variables[0], variables[0]) + variables[4] = neq_func(variables[1], variables[0]) + variables[6] = variables[1]/neq_func(variables[0], variables[5]) + variables[7] = lt_func(variables[1], variables[0]) + variables[8] = variables[1]/lt_func(variables[0], variables[5]) + variables[9] = leq_func(variables[1], variables[0]) + variables[10] = variables[1]/leq_func(variables[0], variables[5]) + variables[11] = gt_func(variables[1], variables[0]) + variables[12] = variables[1]/gt_func(variables[0], variables[5]) + variables[13] = geq_func(variables[1], variables[0]) + variables[14] = variables[1]/geq_func(variables[0], variables[5]) + variables[15] = and_func(variables[1], variables[0]) + variables[16] = and_func(variables[1], and_func(variables[0], variables[5])) + variables[18] = and_func(lt_func(variables[1], variables[0]), gt_func(variables[5], variables[17])) + variables[19] = and_func(variables[1]+variables[0], gt_func(variables[5], variables[17])) + variables[20] = and_func(variables[1], gt_func(variables[0], variables[5])) + variables[21] = and_func(variables[1]-variables[0], gt_func(variables[5], variables[17])) + variables[22] = and_func(-variables[1], gt_func(variables[0], variables[5])) + variables[23] = and_func(pow(variables[1], variables[0]), gt_func(variables[5], variables[17])) + variables[24] = and_func(pow(variables[1], 1.0/variables[0]), gt_func(variables[5], variables[17])) + variables[25] = and_func(lt_func(variables[1], variables[0]), variables[5]+variables[17]) + variables[26] = and_func(lt_func(variables[1], variables[0]), variables[5]) + variables[27] = and_func(lt_func(variables[1], variables[0]), variables[5]-variables[17]) + variables[28] = and_func(lt_func(variables[1], variables[0]), -variables[5]) + variables[29] = and_func(lt_func(variables[1], variables[0]), pow(variables[5], variables[17])) + variables[30] = and_func(lt_func(variables[1], variables[0]), pow(variables[5], 1.0/variables[17])) + variables[31] = variables[1]/and_func(variables[0], variables[5]) + variables[32] = or_func(variables[1], variables[0]) + variables[33] = or_func(variables[1], or_func(variables[0], variables[5])) + variables[34] = or_func(lt_func(variables[1], variables[0]), gt_func(variables[5], variables[17])) + variables[35] = or_func(variables[1]+variables[0], gt_func(variables[5], variables[17])) + variables[36] = or_func(variables[1], gt_func(variables[0], variables[5])) + variables[37] = or_func(variables[1]-variables[0], gt_func(variables[5], variables[17])) + variables[38] = or_func(-variables[1], gt_func(variables[0], variables[5])) + variables[39] = or_func(pow(variables[1], variables[0]), gt_func(variables[5], variables[17])) + variables[40] = or_func(pow(variables[1], 1.0/variables[0]), gt_func(variables[5], variables[17])) + variables[41] = or_func(lt_func(variables[1], variables[0]), variables[5]+variables[17]) + variables[42] = or_func(lt_func(variables[1], variables[0]), variables[5]) + variables[43] = or_func(lt_func(variables[1], variables[0]), variables[5]-variables[17]) + variables[44] = or_func(lt_func(variables[1], variables[0]), -variables[5]) + variables[45] = or_func(lt_func(variables[1], variables[0]), pow(variables[5], variables[17])) + variables[46] = or_func(lt_func(variables[1], variables[0]), pow(variables[5], 1.0/variables[17])) + variables[47] = variables[1]/or_func(variables[0], variables[5]) + variables[48] = xor_func(variables[1], variables[0]) + variables[49] = xor_func(variables[1], xor_func(variables[0], variables[5])) + variables[50] = xor_func(lt_func(variables[1], variables[0]), gt_func(variables[5], variables[17])) + variables[51] = xor_func(variables[1]+variables[0], gt_func(variables[5], variables[17])) + variables[52] = xor_func(variables[1], gt_func(variables[0], variables[5])) + variables[53] = xor_func(variables[1]-variables[0], gt_func(variables[5], variables[17])) + variables[54] = xor_func(-variables[1], gt_func(variables[0], variables[5])) + variables[55] = xor_func(pow(variables[1], variables[0]), gt_func(variables[5], variables[17])) + variables[56] = xor_func(pow(variables[1], 1.0/variables[0]), gt_func(variables[5], variables[17])) + variables[57] = xor_func(lt_func(variables[1], variables[0]), variables[5]+variables[17]) + variables[58] = xor_func(lt_func(variables[1], variables[0]), variables[5]) + variables[59] = xor_func(lt_func(variables[1], variables[0]), variables[5]-variables[17]) + variables[60] = xor_func(lt_func(variables[1], variables[0]), -variables[5]) + variables[61] = xor_func(lt_func(variables[1], variables[0]), pow(variables[5], variables[17])) + variables[62] = xor_func(lt_func(variables[1], variables[0]), pow(variables[5], 1.0/variables[17])) + variables[63] = variables[1]/xor_func(variables[0], variables[5]) 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[65] = variables[1]+variables[0] + variables[66] = variables[1]+variables[0]+variables[5] + variables[67] = lt_func(variables[1], variables[0])+gt_func(variables[5], variables[17]) 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[69] = variables[1]-variables[0] + variables[70] = lt_func(variables[1], variables[0])-gt_func(variables[5], variables[17]) + variables[71] = lt_func(variables[1], variables[0])-(variables[5]+variables[17]) + variables[72] = lt_func(variables[1], variables[0])-variables[5] + variables[73] = variables[1]-(-variables[0]) + variables[74] = variables[1]-(-variables[0]*variables[5]) 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[76] = -lt_func(variables[1], variables[0]) + variables[77] = variables[1]*variables[0] + variables[78] = variables[1]*variables[0]*variables[5] + variables[79] = lt_func(variables[1], variables[0])*gt_func(variables[5], variables[17]) + variables[80] = (variables[1]+variables[0])*gt_func(variables[5], variables[17]) + variables[81] = variables[1]*gt_func(variables[0], variables[5]) + variables[82] = (variables[1]-variables[0])*gt_func(variables[5], variables[17]) + variables[83] = -variables[1]*gt_func(variables[0], variables[5]) + variables[84] = lt_func(variables[1], variables[0])*(variables[5]+variables[17]) + variables[85] = lt_func(variables[1], variables[0])*variables[5] + variables[86] = lt_func(variables[1], variables[0])*(variables[5]-variables[17]) + variables[87] = lt_func(variables[1], variables[0])*-variables[5] + variables[88] = variables[1]/variables[0] + variables[89] = lt_func(variables[1], variables[0])/gt_func(variables[17], variables[5]) + variables[90] = (variables[1]+variables[0])/gt_func(variables[17], variables[5]) + variables[91] = variables[1]/gt_func(variables[5], variables[0]) + variables[92] = (variables[1]-variables[0])/gt_func(variables[17], variables[5]) + variables[93] = -variables[1]/gt_func(variables[5], variables[0]) + variables[94] = lt_func(variables[1], variables[0])/(variables[5]+variables[17]) + variables[95] = lt_func(variables[1], variables[0])/variables[5] + variables[96] = lt_func(variables[1], variables[0])/(variables[5]-variables[17]) + variables[97] = lt_func(variables[1], variables[0])/-variables[5] + variables[98] = lt_func(variables[1], variables[0])/(variables[5]*variables[17]) + variables[99] = lt_func(variables[1], variables[0])/(variables[5]/variables[17]) 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[103] = pow(variables[1], variables[0]) + variables[104] = pow(leq_func(variables[1], variables[0]), geq_func(variables[5], variables[17])) + variables[105] = pow(variables[1]+variables[0], geq_func(variables[5], variables[17])) + variables[106] = pow(variables[1], geq_func(variables[0], variables[5])) + variables[107] = pow(variables[1]-variables[0], geq_func(variables[5], variables[17])) + variables[108] = pow(-variables[1], geq_func(variables[0], variables[5])) + variables[109] = pow(variables[1]*variables[0], geq_func(variables[5], variables[17])) + variables[110] = pow(variables[1]/variables[0], geq_func(variables[5], variables[17])) + variables[111] = pow(leq_func(variables[1], variables[0]), variables[5]+variables[17]) + variables[112] = pow(leq_func(variables[1], variables[0]), variables[5]) + variables[113] = pow(leq_func(variables[1], variables[0]), variables[5]-variables[17]) + variables[114] = pow(leq_func(variables[1], variables[0]), -variables[5]) + variables[115] = pow(leq_func(variables[1], variables[0]), variables[5]*variables[17]) + variables[116] = pow(leq_func(variables[1], variables[0]), variables[5]/variables[17]) + variables[117] = pow(leq_func(variables[1], variables[0]), pow(variables[5], variables[17])) + variables[118] = pow(leq_func(variables[1], variables[0]), pow(variables[5], 1.0/variables[17])) 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[122] = pow(variables[1], 1.0/variables[0]) + variables[123] = pow(lt_func(variables[1], variables[0]), 1.0/gt_func(variables[17], variables[5])) + variables[124] = pow(variables[1]+variables[0], 1.0/gt_func(variables[17], variables[5])) + variables[125] = pow(variables[1], 1.0/gt_func(variables[5], variables[0])) + variables[126] = pow(variables[1]-variables[0], 1.0/gt_func(variables[17], variables[5])) + variables[127] = pow(-variables[1], 1.0/gt_func(variables[5], variables[0])) + variables[128] = pow(variables[1]*variables[0], 1.0/gt_func(variables[17], variables[5])) + variables[129] = pow(variables[1]/variables[0], 1.0/gt_func(variables[17], variables[5])) + variables[130] = pow(lt_func(variables[1], variables[0]), 1.0/(variables[5]+variables[17])) + variables[131] = pow(lt_func(variables[1], variables[0]), 1.0/variables[5]) + variables[132] = pow(lt_func(variables[1], variables[0]), 1.0/(variables[5]-variables[17])) + variables[133] = pow(lt_func(variables[1], variables[0]), 1.0/-variables[5]) + variables[134] = pow(lt_func(variables[1], variables[0]), 1.0/(variables[5]*variables[17])) + variables[135] = pow(lt_func(variables[1], variables[0]), 1.0/(variables[5]/variables[17])) + variables[136] = pow(lt_func(variables[1], variables[0]), 1.0/pow(variables[5], variables[17])) + variables[137] = pow(lt_func(variables[1], variables[0]), 1.0/pow(variables[5], 1.0/variables[17])) 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[144] = log(variables[1])/log(variables[0]) 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[147] = min(variables[1], variables[0]) + variables[148] = min(variables[1], min(variables[0], variables[5])) + variables[149] = max(variables[1], variables[0]) + variables[150] = max(variables[1], max(variables[0], variables[5])) + variables[151] = fmod(variables[1], variables[0]) variables[152] = sin(variables[1]) variables[153] = cos(variables[1]) variables[154] = tan(variables[1]) @@ -574,22 +574,22 @@ def compute_computed_constants(variables): 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[176] = variables[1] if gt_func(variables[1], variables[0]) else nan + variables[177] = variables[1] if gt_func(variables[1], variables[0]) else variables[5] + variables[180] = variables[1] if gt_func(variables[1], variables[0]) else variables[5] if gt_func(variables[5], variables[17]) else variables[178] if gt_func(variables[178], variables[179]) else nan + variables[182] = variables[1] if gt_func(variables[1], variables[0]) else variables[5] if gt_func(variables[5], variables[17]) else variables[178] if gt_func(variables[178], variables[179]) else variables[181] + variables[183] = 123.0+(variables[1] if gt_func(variables[1], variables[0]) 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) + variables[195] = and_func(variables[1], variables[0])+(variables[0] if gt_func(variables[5], variables[17]) else nan)+variables[178]+and_func(variables[179], variables[181]) + variables[196] = and_func(variables[1], variables[0])-((variables[0] if gt_func(variables[5], variables[17]) else nan)-(variables[178]-(variables[0] if gt_func(variables[5], variables[17]) else nan)))-and_func(variables[179], variables[181]) + variables[197] = and_func(variables[1], variables[0])*(variables[0] if gt_func(variables[5], variables[17]) else nan)*variables[178]*(variables[0] if gt_func(variables[5], variables[17]) else nan)*and_func(variables[179], variables[181]) + variables[198] = and_func(variables[1], variables[0])/((variables[0] if gt_func(variables[5], variables[17]) else nan)/(variables[178]/(variables[0] if gt_func(variables[5], variables[17]) else nan))) + variables[199] = and_func(or_func(variables[1], variables[0]), and_func(xor_func(variables[1], variables[0]), and_func(variables[0] if gt_func(variables[5], variables[17]) else nan, and_func(and_func(and_func(variables[178], variables[0] if gt_func(variables[5], variables[17]) else nan), xor_func(variables[1], variables[0])), or_func(variables[1], variables[0]))))) + variables[200] = or_func(and_func(variables[1], variables[0]), or_func(xor_func(variables[1], variables[0]), or_func(variables[0] if gt_func(variables[5], variables[17]) else nan, or_func(or_func(or_func(variables[178], variables[0] if gt_func(variables[5], variables[17]) else nan), xor_func(variables[1], variables[0])), and_func(variables[1], variables[0]))))) + variables[201] = xor_func(and_func(variables[1], variables[0]), xor_func(or_func(variables[1], variables[0]), xor_func(variables[0] if gt_func(variables[5], variables[17]) else nan, xor_func(xor_func(xor_func(variables[178], variables[0] if gt_func(variables[5], variables[17]) else nan), or_func(variables[1], variables[0])), and_func(variables[1], variables[0]))))) + variables[202] = pow(and_func(variables[1], variables[0]), pow(variables[0] if gt_func(variables[5], variables[17]) else nan, pow(pow(variables[178], variables[0] if gt_func(variables[5], variables[17]) else nan), and_func(variables[1], variables[0])))) + variables[203] = pow(pow(pow(and_func(variables[1], variables[0]), 1.0/pow(variables[0] if gt_func(variables[5], variables[17]) else nan, 1.0/variables[178])), 1.0/(variables[0] if gt_func(variables[5], variables[17]) else nan)), 1.0/and_func(variables[1], variables[0])) + variables[204] = -and_func(variables[1], variables[0])+-(variables[0] if gt_func(variables[5], variables[17]) else nan) def compute_rates(voi, states, rates, variables): From c513d2a86b9c4a2a1f9b8b154e5b019b7a6548a4 Mon Sep 17 00:00:00 2001 From: Hugh Sorby Date: Sat, 9 Nov 2024 08:43:38 +1300 Subject: [PATCH 04/10] Update ModelFlattening, hodgkinHuxleyDefinedUsingImports expected output. --- .../model.py | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) 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 3f43f2da31..1b40e563c0 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 @@ -30,10 +30,10 @@ class VariableType(Enum): VARIABLE_INFO = [ {"name": "i_Stim", "units": "microA_per_cm2", "component": "membrane", "type": VariableType.ALGEBRAIC}, + {"name": "Cm", "units": "microF_per_cm2", "component": "membrane", "type": VariableType.CONSTANT}, {"name": "i_L", "units": "microA_per_cm2", "component": "leakage_current", "type": VariableType.ALGEBRAIC}, {"name": "i_K", "units": "microA_per_cm2", "component": "potassium_channel", "type": VariableType.ALGEBRAIC}, {"name": "i_Na", "units": "microA_per_cm2", "component": "sodium_channel", "type": VariableType.ALGEBRAIC}, - {"name": "Cm", "units": "microF_per_cm2", "component": "membrane", "type": VariableType.CONSTANT}, {"name": "E_R", "units": "millivolt", "component": "membrane", "type": VariableType.CONSTANT}, {"name": "E_L", "units": "millivolt", "component": "leakage_current", "type": VariableType.COMPUTED_CONSTANT}, {"name": "g_L", "units": "milliS_per_cm2", "component": "leakage_current", "type": VariableType.CONSTANT}, @@ -71,7 +71,7 @@ def create_variables_array(): def initialise_variables(states, rates, variables): - variables[4] = 1.0 + variables[1] = 1.0 variables[5] = 0.0 variables[7] = 0.3 variables[9] = 120.0 @@ -90,28 +90,28 @@ def compute_computed_constants(variables): def compute_rates(voi, states, rates, variables): 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[2] = variables[7]*(states[0]-variables[6]) + variables[3] = variables[15]*pow(states[3], 4.0)*(states[0]-variables[14]) + variables[4] = variables[9]*pow(states[2], 3.0)*states[1]*(states[0]-variables[8]) + rates[0] = -(-variables[0]+variables[4]+variables[3]+variables[2])/variables[1] variables[11] = 4.0*exp(states[0]/18.0) + variables[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.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) + variables[12] = 0.07*exp(states[0]/20.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) + 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] def compute_variables(voi, states, rates, variables): - variables[1] = variables[7]*(states[0]-variables[6]) - variables[3] = variables[9]*pow(states[2], 3.0)*states[1]*(states[0]-variables[8]) + variables[2] = variables[7]*(states[0]-variables[6]) + variables[4] = 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[3] = 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) From b6f3b17cbdf2c03b28047c6f3577d1266f4ea4db Mon Sep 17 00:00:00 2001 From: Hugh Sorby Date: Sat, 9 Nov 2024 11:43:22 +1300 Subject: [PATCH 05/10] Update generator test expected output. --- .../algebraic_eqn_computed_var_on_rhs/model.c | 8 +- .../model.external.c | 10 +- .../model.external.py | 10 +- .../model.py | 8 +- .../algebraic_eqn_const_var_on_rhs/model.c | 8 +- .../algebraic_eqn_const_var_on_rhs/model.py | 8 +- .../model.c | 10 +- .../model.py | 10 +- .../model.three.externals.c | 4 +- .../model.three.externals.py | 4 +- .../model.not.ordered.c | 28 +- .../model.not.ordered.py | 28 +- .../model.ordered.c | 12 +- .../model.ordered.py | 12 +- .../generator/cell_geometry_model/model.c | 10 +- .../cell_geometry_model/model.external.c | 10 +- .../cell_geometry_model/model.external.py | 10 +- .../generator/cell_geometry_model/model.py | 10 +- .../generator/cellml_slc_example/model.py | 34 +- .../generator/dae_cellml_1_1_model/model.c | 34 +- .../generator/dae_cellml_1_1_model/model.py | 34 +- .../generator/dependent_eqns/model.c | 8 +- .../generator/dependent_eqns/model.py | 8 +- .../model.c | 614 +++++++++--------- .../model.py | 614 +++++++++--------- .../model.c | 548 ++++++++-------- .../model.py | 548 ++++++++-------- .../model.algebraic.c | 24 +- .../model.algebraic.py | 24 +- .../model.computed.constant.c | 24 +- .../model.computed.constant.py | 24 +- .../model.constant.c | 28 +- .../model.constant.py | 28 +- .../model.dae.c | 44 +- .../model.dae.py | 44 +- .../model.dependent.algebraic.c | 22 +- .../model.dependent.algebraic.py | 22 +- .../model.dependent.computed.constant.c | 24 +- .../model.dependent.computed.constant.py | 24 +- .../model.dependent.constant.c | 30 +- .../model.dependent.constant.py | 30 +- .../model.dependent.state.c | 38 +- .../model.dependent.state.py | 38 +- .../model.external.c | 26 +- .../model.external.py | 26 +- .../model.state.c | 32 +- .../model.state.py | 32 +- .../generator/noble_model_1962/model.c | 60 +- .../generator/noble_model_1962/model.py | 60 +- .../ode_multiple_dependent_odes/model.c | 12 +- .../ode_multiple_dependent_odes/model.py | 12 +- .../model.c | 12 +- .../model.py | 12 +- .../robertson_model_1966/model.dae.c | 30 +- .../robertson_model_1966/model.dae.py | 30 +- .../robertson_model_1966/model.ode.c | 22 +- .../robertson_model_1966/model.ode.py | 22 +- .../model.c | 36 +- .../model.py | 36 +- 59 files changed, 1785 insertions(+), 1785 deletions(-) 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 489892987f..dc30aa91ad 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 @@ -11,8 +11,8 @@ const char LIBCELLML_VERSION[] = "0.6.2"; const size_t VARIABLE_COUNT = 2; const VariableInfo VARIABLE_INFO[] = { - {"x", "dimensionless", "my_algebraic_eqn", COMPUTED_CONSTANT}, - {"a", "dimensionless", "my_algebraic_eqn", COMPUTED_CONSTANT} + {"a", "dimensionless", "my_algebraic_eqn", COMPUTED_CONSTANT}, + {"x", "dimensionless", "my_algebraic_eqn", COMPUTED_CONSTANT} }; double * createVariablesArray() @@ -33,12 +33,12 @@ void deleteArray(double *array) void initialiseVariables(double *variables) { - variables[1] = 1.0; + variables[0] = 1.0; } void computeComputedConstants(double *variables) { - variables[0] = variables[1]; + variables[1] = variables[0]; } void computeVariables(double *variables) 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 60ac1a53d4..8382436f92 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 @@ -11,8 +11,8 @@ const char LIBCELLML_VERSION[] = "0.6.2"; const size_t VARIABLE_COUNT = 2; const VariableInfo VARIABLE_INFO[] = { - {"x", "dimensionless", "my_algebraic_eqn", ALGEBRAIC}, - {"a", "dimensionless", "my_algebraic_eqn", EXTERNAL} + {"a", "dimensionless", "my_algebraic_eqn", EXTERNAL}, + {"x", "dimensionless", "my_algebraic_eqn", ALGEBRAIC} }; double * createVariablesArray() @@ -33,7 +33,7 @@ void deleteArray(double *array) void initialiseVariables(double *variables, ExternalVariable externalVariable) { - variables[1] = externalVariable(variables, 1); + variables[0] = externalVariable(variables, 0); } void computeComputedConstants(double *variables) @@ -42,6 +42,6 @@ void computeComputedConstants(double *variables) void computeVariables(double *variables, ExternalVariable externalVariable) { - variables[1] = externalVariable(variables, 1); - variables[0] = variables[1]; + variables[0] = externalVariable(variables, 0); + variables[1] = variables[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 3431893ba2..596735276d 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 @@ -18,8 +18,8 @@ class VariableType(Enum): VARIABLE_INFO = [ - {"name": "x", "units": "dimensionless", "component": "my_algebraic_eqn", "type": VariableType.ALGEBRAIC}, - {"name": "a", "units": "dimensionless", "component": "my_algebraic_eqn", "type": VariableType.EXTERNAL} + {"name": "a", "units": "dimensionless", "component": "my_algebraic_eqn", "type": VariableType.EXTERNAL}, + {"name": "x", "units": "dimensionless", "component": "my_algebraic_eqn", "type": VariableType.ALGEBRAIC} ] @@ -28,7 +28,7 @@ def create_variables_array(): def initialise_variables(variables, external_variable): - variables[1] = external_variable(variables, 1) + variables[0] = external_variable(variables, 0) def compute_computed_constants(variables): @@ -36,5 +36,5 @@ def compute_computed_constants(variables): def compute_variables(variables, external_variable): - variables[1] = external_variable(variables, 1) - variables[0] = variables[1] + variables[0] = external_variable(variables, 0) + variables[1] = variables[0] 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 a2b2414b5a..d3409ab1d5 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 @@ -17,8 +17,8 @@ class VariableType(Enum): VARIABLE_INFO = [ - {"name": "x", "units": "dimensionless", "component": "my_algebraic_eqn", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "a", "units": "dimensionless", "component": "my_algebraic_eqn", "type": VariableType.COMPUTED_CONSTANT} + {"name": "a", "units": "dimensionless", "component": "my_algebraic_eqn", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "x", "units": "dimensionless", "component": "my_algebraic_eqn", "type": VariableType.COMPUTED_CONSTANT} ] @@ -27,11 +27,11 @@ def create_variables_array(): def initialise_variables(variables): - variables[1] = 1.0 + variables[0] = 1.0 def compute_computed_constants(variables): - variables[0] = variables[1] + variables[1] = variables[0] def compute_variables(variables): 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 2855044f01..629fdd9bed 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 @@ -11,8 +11,8 @@ const char LIBCELLML_VERSION[] = "0.6.2"; const size_t VARIABLE_COUNT = 2; const VariableInfo VARIABLE_INFO[] = { - {"x", "dimensionless", "my_algebraic_eqn", COMPUTED_CONSTANT}, - {"a", "dimensionless", "my_algebraic_eqn", CONSTANT} + {"a", "dimensionless", "my_algebraic_eqn", CONSTANT}, + {"x", "dimensionless", "my_algebraic_eqn", COMPUTED_CONSTANT} }; double * createVariablesArray() @@ -33,12 +33,12 @@ void deleteArray(double *array) void initialiseVariables(double *variables) { - variables[1] = 1.0; + variables[0] = 1.0; } void computeComputedConstants(double *variables) { - variables[0] = variables[1]; + variables[1] = variables[0]; } void computeVariables(double *variables) 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 804f72bfd9..ecff508571 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 @@ -17,8 +17,8 @@ class VariableType(Enum): VARIABLE_INFO = [ - {"name": "x", "units": "dimensionless", "component": "my_algebraic_eqn", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "a", "units": "dimensionless", "component": "my_algebraic_eqn", "type": VariableType.CONSTANT} + {"name": "a", "units": "dimensionless", "component": "my_algebraic_eqn", "type": VariableType.CONSTANT}, + {"name": "x", "units": "dimensionless", "component": "my_algebraic_eqn", "type": VariableType.COMPUTED_CONSTANT} ] @@ -27,11 +27,11 @@ def create_variables_array(): def initialise_variables(variables): - variables[1] = 1.0 + variables[0] = 1.0 def compute_computed_constants(variables): - variables[0] = variables[1] + variables[1] = variables[0] def compute_variables(variables): 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 3517a52c97..77fd9dfff2 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 @@ -11,9 +11,9 @@ const char LIBCELLML_VERSION[] = "0.6.2"; const size_t VARIABLE_COUNT = 3; const VariableInfo VARIABLE_INFO[] = { - {"x", "dimensionless", "my_algebraic_system", ALGEBRAIC}, + {"z", "dimensionless", "my_algebraic_system", ALGEBRAIC}, {"y", "dimensionless", "my_algebraic_system", ALGEBRAIC}, - {"z", "dimensionless", "my_algebraic_system", ALGEBRAIC} + {"x", "dimensionless", "my_algebraic_system", ALGEBRAIC} }; double * createVariablesArray() @@ -47,9 +47,9 @@ void objectiveFunction0(double *u, double *f, void *data) variables[1] = u[1]; variables[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*variables[2]+variables[1]-2.0*variables[0]-(-1.0); + f[1] = 3.0*variables[2]-3.0*variables[1]-variables[0]-5.0; + f[2] = variables[2]-2.0*variables[1]+3.0*variables[0]-6.0; } void findRoot0(double *variables) 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 3b3e6b84f0..9705a12c97 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 @@ -17,9 +17,9 @@ class VariableType(Enum): VARIABLE_INFO = [ - {"name": "x", "units": "dimensionless", "component": "my_algebraic_system", "type": VariableType.ALGEBRAIC}, + {"name": "z", "units": "dimensionless", "component": "my_algebraic_system", "type": VariableType.ALGEBRAIC}, {"name": "y", "units": "dimensionless", "component": "my_algebraic_system", "type": VariableType.ALGEBRAIC}, - {"name": "z", "units": "dimensionless", "component": "my_algebraic_system", "type": VariableType.ALGEBRAIC} + {"name": "x", "units": "dimensionless", "component": "my_algebraic_system", "type": VariableType.ALGEBRAIC} ] @@ -37,9 +37,9 @@ def objective_function_0(u, f, data): variables[1] = u[1] variables[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*variables[2]+variables[1]-2.0*variables[0]-(-1.0) + f[1] = 3.0*variables[2]-3.0*variables[1]-variables[0]-5.0 + f[2] = variables[2]-2.0*variables[1]+3.0*variables[0]-6.0 def find_root_0(variables): 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 466ae39a95..a94e7d4a66 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 @@ -11,9 +11,9 @@ const char LIBCELLML_VERSION[] = "0.6.2"; const size_t VARIABLE_COUNT = 3; const VariableInfo VARIABLE_INFO[] = { - {"x", "dimensionless", "my_algebraic_system", EXTERNAL}, + {"z", "dimensionless", "my_algebraic_system", EXTERNAL}, {"y", "dimensionless", "my_algebraic_system", EXTERNAL}, - {"z", "dimensionless", "my_algebraic_system", EXTERNAL} + {"x", "dimensionless", "my_algebraic_system", EXTERNAL} }; double * createVariablesArray() 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 acdf7cc5e5..1c83d57576 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 @@ -18,9 +18,9 @@ class VariableType(Enum): VARIABLE_INFO = [ - {"name": "x", "units": "dimensionless", "component": "my_algebraic_system", "type": VariableType.EXTERNAL}, + {"name": "z", "units": "dimensionless", "component": "my_algebraic_system", "type": VariableType.EXTERNAL}, {"name": "y", "units": "dimensionless", "component": "my_algebraic_system", "type": VariableType.EXTERNAL}, - {"name": "z", "units": "dimensionless", "component": "my_algebraic_system", "type": VariableType.EXTERNAL} + {"name": "x", "units": "dimensionless", "component": "my_algebraic_system", "type": VariableType.EXTERNAL} ] 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 11b1401a36..3478b2547d 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 @@ -11,12 +11,12 @@ const char LIBCELLML_VERSION[] = "0.6.2"; const size_t VARIABLE_COUNT = 6; const VariableInfo VARIABLE_INFO[] = { - {"d", "dimensionless", "my_algebraic_system", ALGEBRAIC}, - {"b", "dimensionless", "my_algebraic_system", ALGEBRAIC}, {"c", "dimensionless", "my_algebraic_system", ALGEBRAIC}, + {"b", "dimensionless", "my_algebraic_system", ALGEBRAIC}, + {"d", "dimensionless", "my_algebraic_system", ALGEBRAIC}, {"a", "dimensionless", "my_algebraic_system", COMPUTED_CONSTANT}, - {"x", "dimensionless", "my_algebraic_system", CONSTANT}, - {"y", "dimensionless", "my_algebraic_system", CONSTANT} + {"y", "dimensionless", "my_algebraic_system", CONSTANT}, + {"x", "dimensionless", "my_algebraic_system", CONSTANT} }; double * createVariablesArray() @@ -46,11 +46,11 @@ void objectiveFunction0(double *u, double *f, void *data) { double *variables = ((RootFindingInfo *) data)->variables; - variables[2] = u[0]; + variables[0] = u[0]; variables[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*variables[3]+2.0*variables[1]+variables[0]-57.0; + f[1] = variables[3]+3.0*variables[1]-variables[0]-19.0; } void findRoot0(double *variables) @@ -58,30 +58,30 @@ void findRoot0(double *variables) RootFindingInfo rfi = { variables }; double u[2]; - u[0] = variables[2]; + u[0] = variables[0]; u[1] = variables[1]; nlaSolve(objectiveFunction0, u, 2, &rfi); - variables[2] = u[0]; + variables[0] = u[0]; variables[1] = u[1]; } void initialiseVariables(double *variables) { + variables[0] = 1.0; variables[1] = 1.0; - variables[2] = 1.0; - variables[4] = 3.0; - variables[5] = 5.0; + variables[4] = 5.0; + variables[5] = 3.0; } void computeComputedConstants(double *variables) { - variables[3] = 3.0*variables[4]+variables[5]; + variables[3] = 3.0*variables[5]+variables[4]; } void computeVariables(double *variables) { findRoot0(variables); - variables[0] = variables[1]+variables[2]; + variables[2] = variables[1]+variables[0]; } 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 d5eeed45cf..79eb2fb38d 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 @@ -17,12 +17,12 @@ class VariableType(Enum): VARIABLE_INFO = [ - {"name": "d", "units": "dimensionless", "component": "my_algebraic_system", "type": VariableType.ALGEBRAIC}, - {"name": "b", "units": "dimensionless", "component": "my_algebraic_system", "type": VariableType.ALGEBRAIC}, {"name": "c", "units": "dimensionless", "component": "my_algebraic_system", "type": VariableType.ALGEBRAIC}, + {"name": "b", "units": "dimensionless", "component": "my_algebraic_system", "type": VariableType.ALGEBRAIC}, + {"name": "d", "units": "dimensionless", "component": "my_algebraic_system", "type": VariableType.ALGEBRAIC}, {"name": "a", "units": "dimensionless", "component": "my_algebraic_system", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "x", "units": "dimensionless", "component": "my_algebraic_system", "type": VariableType.CONSTANT}, - {"name": "y", "units": "dimensionless", "component": "my_algebraic_system", "type": VariableType.CONSTANT} + {"name": "y", "units": "dimensionless", "component": "my_algebraic_system", "type": VariableType.CONSTANT}, + {"name": "x", "units": "dimensionless", "component": "my_algebraic_system", "type": VariableType.CONSTANT} ] @@ -36,36 +36,36 @@ def create_variables_array(): def objective_function_0(u, f, data): variables = data[0] - variables[2] = u[0] + variables[0] = u[0] variables[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*variables[3]+2.0*variables[1]+variables[0]-57.0 + f[1] = variables[3]+3.0*variables[1]-variables[0]-19.0 def find_root_0(variables): u = [nan]*2 - u[0] = variables[2] + u[0] = variables[0] u[1] = variables[1] u = nla_solve(objective_function_0, u, 2, [variables]) - variables[2] = u[0] + variables[0] = u[0] variables[1] = u[1] def initialise_variables(variables): + variables[0] = 1.0 variables[1] = 1.0 - variables[2] = 1.0 - variables[4] = 3.0 - variables[5] = 5.0 + variables[4] = 5.0 + variables[5] = 3.0 def compute_computed_constants(variables): - variables[3] = 3.0*variables[4]+variables[5] + variables[3] = 3.0*variables[5]+variables[4] def compute_variables(variables): find_root_0(variables) - variables[0] = variables[1]+variables[2] + variables[2] = variables[1]+variables[0] 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 59d5128a4e..8e46828b4f 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 @@ -11,9 +11,9 @@ const char LIBCELLML_VERSION[] = "0.6.2"; const size_t VARIABLE_COUNT = 6; const VariableInfo VARIABLE_INFO[] = { - {"a", "dimensionless", "my_algebraic_system", COMPUTED_CONSTANT}, - {"x", "dimensionless", "my_algebraic_system", CONSTANT}, {"y", "dimensionless", "my_algebraic_system", CONSTANT}, + {"x", "dimensionless", "my_algebraic_system", CONSTANT}, + {"a", "dimensionless", "my_algebraic_system", COMPUTED_CONSTANT}, {"c", "dimensionless", "my_algebraic_system", ALGEBRAIC}, {"b", "dimensionless", "my_algebraic_system", ALGEBRAIC}, {"d", "dimensionless", "my_algebraic_system", ALGEBRAIC} @@ -49,8 +49,8 @@ void objectiveFunction0(double *u, double *f, void *data) variables[3] = u[0]; variables[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*variables[2]+2.0*variables[4]+variables[3]-57.0; + f[1] = variables[2]+3.0*variables[4]-variables[3]-19.0; } void findRoot0(double *variables) @@ -69,15 +69,15 @@ void findRoot0(double *variables) void initialiseVariables(double *variables) { + variables[0] = 5.0; variables[1] = 3.0; - variables[2] = 5.0; variables[3] = 1.0; variables[4] = 1.0; } void computeComputedConstants(double *variables) { - variables[0] = 3.0*variables[1]+variables[2]; + variables[2] = 3.0*variables[1]+variables[0]; } void computeVariables(double *variables) 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 998e80c7ff..7e08e3c214 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 @@ -17,9 +17,9 @@ class VariableType(Enum): VARIABLE_INFO = [ - {"name": "a", "units": "dimensionless", "component": "my_algebraic_system", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "x", "units": "dimensionless", "component": "my_algebraic_system", "type": VariableType.CONSTANT}, {"name": "y", "units": "dimensionless", "component": "my_algebraic_system", "type": VariableType.CONSTANT}, + {"name": "x", "units": "dimensionless", "component": "my_algebraic_system", "type": VariableType.CONSTANT}, + {"name": "a", "units": "dimensionless", "component": "my_algebraic_system", "type": VariableType.COMPUTED_CONSTANT}, {"name": "c", "units": "dimensionless", "component": "my_algebraic_system", "type": VariableType.ALGEBRAIC}, {"name": "b", "units": "dimensionless", "component": "my_algebraic_system", "type": VariableType.ALGEBRAIC}, {"name": "d", "units": "dimensionless", "component": "my_algebraic_system", "type": VariableType.ALGEBRAIC} @@ -39,8 +39,8 @@ def objective_function_0(u, f, data): variables[3] = u[0] variables[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*variables[2]+2.0*variables[4]+variables[3]-57.0 + f[1] = variables[2]+3.0*variables[4]-variables[3]-19.0 def find_root_0(variables): @@ -56,14 +56,14 @@ def find_root_0(variables): def initialise_variables(variables): + variables[0] = 5.0 variables[1] = 3.0 - variables[2] = 5.0 variables[3] = 1.0 variables[4] = 1.0 def compute_computed_constants(variables): - variables[0] = 3.0*variables[1]+variables[2] + variables[2] = 3.0*variables[1]+variables[0] def compute_variables(variables): diff --git a/tests/resources/generator/cell_geometry_model/model.c b/tests/resources/generator/cell_geometry_model/model.c index afdcd57751..993f171302 100644 --- a/tests/resources/generator/cell_geometry_model/model.c +++ b/tests/resources/generator/cell_geometry_model/model.c @@ -11,9 +11,9 @@ const char LIBCELLML_VERSION[] = "0.6.2"; const size_t VARIABLE_COUNT = 4; const VariableInfo VARIABLE_INFO[] = { - {"vcell", "microlitre", "cell_geometry", COMPUTED_CONSTANT}, {"L", "centimeter", "cell_geometry", CONSTANT}, {"rad", "centimeter", "cell_geometry", CONSTANT}, + {"vcell", "microlitre", "cell_geometry", COMPUTED_CONSTANT}, {"vss", "microlitre", "cell_geometry", COMPUTED_CONSTANT} }; @@ -35,14 +35,14 @@ void deleteArray(double *array) void initialiseVariables(double *variables) { - variables[1] = 0.01; - variables[2] = 0.0011; + variables[0] = 0.01; + variables[1] = 0.0011; } void computeComputedConstants(double *variables) { - variables[0] = 1000.0*3.14*variables[2]*variables[2]*variables[1]; - variables[3] = 0.02*variables[0]; + variables[2] = 1000.0*3.14*variables[1]*variables[1]*variables[0]; + variables[3] = 0.02*variables[2]; } void computeVariables(double *variables) diff --git a/tests/resources/generator/cell_geometry_model/model.external.c b/tests/resources/generator/cell_geometry_model/model.external.c index 0f85d7c7ce..ed5c2deb14 100644 --- a/tests/resources/generator/cell_geometry_model/model.external.c +++ b/tests/resources/generator/cell_geometry_model/model.external.c @@ -11,9 +11,9 @@ const char LIBCELLML_VERSION[] = "0.6.2"; const size_t VARIABLE_COUNT = 4; const VariableInfo VARIABLE_INFO[] = { - {"vcell", "microlitre", "cell_geometry", ALGEBRAIC}, {"L", "centimeter", "cell_geometry", EXTERNAL}, {"rad", "centimeter", "cell_geometry", EXTERNAL}, + {"vcell", "microlitre", "cell_geometry", ALGEBRAIC}, {"vss", "microlitre", "cell_geometry", ALGEBRAIC} }; @@ -35,8 +35,8 @@ void deleteArray(double *array) void initialiseVariables(double *variables, ExternalVariable externalVariable) { + variables[0] = externalVariable(variables, 0); variables[1] = externalVariable(variables, 1); - variables[2] = externalVariable(variables, 2); } void computeComputedConstants(double *variables) @@ -45,8 +45,8 @@ void computeComputedConstants(double *variables) void computeVariables(double *variables, ExternalVariable externalVariable) { + variables[0] = externalVariable(variables, 0); 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]; + variables[2] = 1000.0*3.14*variables[1]*variables[1]*variables[0]; + variables[3] = 0.02*variables[2]; } diff --git a/tests/resources/generator/cell_geometry_model/model.external.py b/tests/resources/generator/cell_geometry_model/model.external.py index 3473b8d534..f902b1b7a0 100644 --- a/tests/resources/generator/cell_geometry_model/model.external.py +++ b/tests/resources/generator/cell_geometry_model/model.external.py @@ -18,9 +18,9 @@ class VariableType(Enum): VARIABLE_INFO = [ - {"name": "vcell", "units": "microlitre", "component": "cell_geometry", "type": VariableType.ALGEBRAIC}, {"name": "L", "units": "centimeter", "component": "cell_geometry", "type": VariableType.EXTERNAL}, {"name": "rad", "units": "centimeter", "component": "cell_geometry", "type": VariableType.EXTERNAL}, + {"name": "vcell", "units": "microlitre", "component": "cell_geometry", "type": VariableType.ALGEBRAIC}, {"name": "vss", "units": "microlitre", "component": "cell_geometry", "type": VariableType.ALGEBRAIC} ] @@ -30,8 +30,8 @@ def create_variables_array(): def initialise_variables(variables, external_variable): + variables[0] = external_variable(variables, 0) variables[1] = external_variable(variables, 1) - variables[2] = external_variable(variables, 2) def compute_computed_constants(variables): @@ -39,7 +39,7 @@ def compute_computed_constants(variables): def compute_variables(variables, external_variable): + variables[0] = external_variable(variables, 0) 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] + variables[2] = 1000.0*3.14*variables[1]*variables[1]*variables[0] + variables[3] = 0.02*variables[2] diff --git a/tests/resources/generator/cell_geometry_model/model.py b/tests/resources/generator/cell_geometry_model/model.py index 5322ce591f..eea0616c98 100644 --- a/tests/resources/generator/cell_geometry_model/model.py +++ b/tests/resources/generator/cell_geometry_model/model.py @@ -17,9 +17,9 @@ class VariableType(Enum): VARIABLE_INFO = [ - {"name": "vcell", "units": "microlitre", "component": "cell_geometry", "type": VariableType.COMPUTED_CONSTANT}, {"name": "L", "units": "centimeter", "component": "cell_geometry", "type": VariableType.CONSTANT}, {"name": "rad", "units": "centimeter", "component": "cell_geometry", "type": VariableType.CONSTANT}, + {"name": "vcell", "units": "microlitre", "component": "cell_geometry", "type": VariableType.COMPUTED_CONSTANT}, {"name": "vss", "units": "microlitre", "component": "cell_geometry", "type": VariableType.COMPUTED_CONSTANT} ] @@ -29,13 +29,13 @@ def create_variables_array(): def initialise_variables(variables): - variables[1] = 0.01 - variables[2] = 0.0011 + variables[0] = 0.01 + variables[1] = 0.0011 def compute_computed_constants(variables): - variables[0] = 1000.0*3.14*variables[2]*variables[2]*variables[1] - variables[3] = 0.02*variables[0] + variables[2] = 1000.0*3.14*variables[1]*variables[1]*variables[0] + variables[3] = 0.02*variables[2] def compute_variables(variables): diff --git a/tests/resources/generator/cellml_slc_example/model.py b/tests/resources/generator/cellml_slc_example/model.py index ea1146cd2d..db3b9a0edf 100644 --- a/tests/resources/generator/cellml_slc_example/model.py +++ b/tests/resources/generator/cellml_slc_example/model.py @@ -17,16 +17,16 @@ class VariableType(Enum): VARIABLE_INFO = [ - {"name": "v", "units": "fmol_per_sec", "component": "SLC_template3_ss", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "E", "units": "fmol", "component": "SLC_template3_ss", "type": VariableType.CONSTANT}, - {"name": "P_0", "units": "per_fmol_sec4", "component": "SLC_template3_ss", "type": VariableType.CONSTANT}, + {"name": "P_5", "units": "per_sec3", "component": "SLC_template3_ss", "type": VariableType.CONSTANT}, {"name": "q_Ao", "units": "fmol", "component": "SLC_template3_ss", "type": VariableType.CONSTANT}, - {"name": "P_1", "units": "per_fmol_sec4", "component": "SLC_template3_ss", "type": VariableType.CONSTANT}, {"name": "q_Ai", "units": "fmol", "component": "SLC_template3_ss", "type": VariableType.CONSTANT}, - {"name": "P_2", "units": "per_fmol_sec3", "component": "SLC_template3_ss", "type": VariableType.CONSTANT}, - {"name": "P_5", "units": "per_sec3", "component": "SLC_template3_ss", "type": VariableType.CONSTANT}, {"name": "P_4", "units": "per_fmol2_sec3", "component": "SLC_template3_ss", "type": VariableType.CONSTANT}, - {"name": "P_3", "units": "per_fmol_sec3", "component": "SLC_template3_ss", "type": VariableType.CONSTANT} + {"name": "P_3", "units": "per_fmol_sec3", "component": "SLC_template3_ss", "type": VariableType.CONSTANT}, + {"name": "P_2", "units": "per_fmol_sec3", "component": "SLC_template3_ss", "type": VariableType.CONSTANT}, + {"name": "P_1", "units": "per_fmol_sec4", "component": "SLC_template3_ss", "type": VariableType.CONSTANT}, + {"name": "P_0", "units": "per_fmol_sec4", "component": "SLC_template3_ss", "type": VariableType.CONSTANT}, + {"name": "E", "units": "fmol", "component": "SLC_template3_ss", "type": VariableType.CONSTANT}, + {"name": "v", "units": "fmol_per_sec", "component": "SLC_template3_ss", "type": VariableType.COMPUTED_CONSTANT} ] @@ -35,19 +35,19 @@ def create_variables_array(): def initialise_variables(variables): - 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 + variables[0] = 810000.0 + variables[1] = 150.0 + variables[2] = 2.0 + variables[3] = 247140.0 + variables[4] = 2902500.0 + variables[5] = 2902500.0 + variables[6] = 3402000.0 + variables[7] = 21262500.0 + variables[8] = 1.1 def compute_computed_constants(variables): - 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]) + variables[9] = variables[8]*(variables[7]*variables[1]-variables[6]*variables[2])/(variables[5]*variables[2]+variables[4]*variables[1]+variables[3]*variables[2]*variables[1]+variables[0]) def compute_variables(variables): 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 b172db4412..796576e552 100644 --- a/tests/resources/generator/dae_cellml_1_1_model/model.c +++ b/tests/resources/generator/dae_cellml_1_1_model/model.c @@ -20,12 +20,12 @@ const VariableInfo STATE_INFO[] = { const VariableInfo VARIABLE_INFO[] = { {"v_1", "C_per_s", "main", ALGEBRAIC}, - {"v_in", "C_per_s", "main", CONSTANT}, {"v_2", "C_per_s", "main", ALGEBRAIC}, + {"v_in", "C_per_s", "main", CONSTANT}, {"v_out", "C_per_s", "main", CONSTANT}, - {"u_1", "J_per_C", "main", ALGEBRAIC}, - {"u_2", "J_per_C", "main", ALGEBRAIC}, {"u_3", "J_per_C", "main", ALGEBRAIC}, + {"u_2", "J_per_C", "main", ALGEBRAIC}, + {"u_1", "J_per_C", "main", ALGEBRAIC}, {"C", "C2_per_J", "main", CONSTANT}, {"R", "Js_per_C2", "main", CONSTANT}, {"L", "Js2_per_C2", "main", CONSTANT} @@ -77,7 +77,7 @@ void objectiveFunction0(double *u, double *f, void *data) variables[0] = u[0]; - f[0] = variables[1]-(variables[0]+variables[2]); + f[0] = variables[2]-(variables[0]+variables[1]); } void findRoot0(double voi, double *states, double *rates, double *variables) @@ -99,9 +99,9 @@ void objectiveFunction1(double *u, double *f, void *data) double *rates = ((RootFindingInfo *) data)->rates; double *variables = ((RootFindingInfo *) data)->variables; - variables[6] = u[0]; + variables[4] = u[0]; - f[0] = variables[4]-(variables[5]+variables[6]); + f[0] = variables[6]-(variables[5]+variables[4]); } void findRoot1(double voi, double *states, double *rates, double *variables) @@ -109,19 +109,19 @@ 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] = variables[4]; nlaSolve(objectiveFunction1, u, 1, &rfi); - variables[6] = u[0]; + variables[4] = u[0]; } void initialiseVariables(double *states, double *rates, double *variables) { variables[0] = 0.0; - variables[1] = 1.0; + variables[2] = 1.0; variables[3] = 1.0; - variables[6] = 0.0; + variables[4] = 0.0; variables[7] = 20.0; variables[8] = 2.0; variables[9] = 10.0; @@ -135,20 +135,20 @@ void computeComputedConstants(double *variables) void computeRates(double voi, double *states, double *rates, double *variables) { - variables[2] = states[1]+variables[3]; + variables[1] = states[1]+variables[3]; findRoot0(voi, states, rates, variables); rates[0] = variables[0]; - variables[4] = states[0]/variables[7]; - variables[5] = variables[8]*variables[2]; + variables[5] = variables[8]*variables[1]; + variables[6] = states[0]/variables[7]; findRoot1(voi, states, rates, variables); - rates[1] = variables[6]/variables[9]; + rates[1] = variables[4]/variables[9]; } void computeVariables(double voi, double *states, double *rates, double *variables) { - variables[2] = states[1]+variables[3]; + variables[1] = states[1]+variables[3]; findRoot0(voi, states, rates, variables); - variables[4] = states[0]/variables[7]; - variables[5] = variables[8]*variables[2]; + variables[5] = variables[8]*variables[1]; + variables[6] = states[0]/variables[7]; 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 e9c1899743..ee226aff55 100644 --- a/tests/resources/generator/dae_cellml_1_1_model/model.py +++ b/tests/resources/generator/dae_cellml_1_1_model/model.py @@ -28,12 +28,12 @@ class VariableType(Enum): VARIABLE_INFO = [ {"name": "v_1", "units": "C_per_s", "component": "main", "type": VariableType.ALGEBRAIC}, - {"name": "v_in", "units": "C_per_s", "component": "main", "type": VariableType.CONSTANT}, {"name": "v_2", "units": "C_per_s", "component": "main", "type": VariableType.ALGEBRAIC}, + {"name": "v_in", "units": "C_per_s", "component": "main", "type": VariableType.CONSTANT}, {"name": "v_out", "units": "C_per_s", "component": "main", "type": VariableType.CONSTANT}, - {"name": "u_1", "units": "J_per_C", "component": "main", "type": VariableType.ALGEBRAIC}, - {"name": "u_2", "units": "J_per_C", "component": "main", "type": VariableType.ALGEBRAIC}, {"name": "u_3", "units": "J_per_C", "component": "main", "type": VariableType.ALGEBRAIC}, + {"name": "u_2", "units": "J_per_C", "component": "main", "type": VariableType.ALGEBRAIC}, + {"name": "u_1", "units": "J_per_C", "component": "main", "type": VariableType.ALGEBRAIC}, {"name": "C", "units": "C2_per_J", "component": "main", "type": VariableType.CONSTANT}, {"name": "R", "units": "Js_per_C2", "component": "main", "type": VariableType.CONSTANT}, {"name": "L", "units": "Js2_per_C2", "component": "main", "type": VariableType.CONSTANT} @@ -59,7 +59,7 @@ def objective_function_0(u, f, data): variables[0] = u[0] - f[0] = variables[1]-(variables[0]+variables[2]) + f[0] = variables[2]-(variables[0]+variables[1]) def find_root_0(voi, states, rates, variables): @@ -78,26 +78,26 @@ def objective_function_1(u, f, data): rates = data[2] variables = data[3] - variables[6] = u[0] + variables[4] = u[0] - f[0] = variables[4]-(variables[5]+variables[6]) + f[0] = variables[6]-(variables[5]+variables[4]) def find_root_1(voi, states, rates, variables): u = [nan]*1 - u[0] = variables[6] + u[0] = variables[4] u = nla_solve(objective_function_1, u, 1, [voi, states, rates, variables]) - variables[6] = u[0] + variables[4] = u[0] def initialise_variables(states, rates, variables): variables[0] = 0.0 - variables[1] = 1.0 + variables[2] = 1.0 variables[3] = 1.0 - variables[6] = 0.0 + variables[4] = 0.0 variables[7] = 20.0 variables[8] = 2.0 variables[9] = 10.0 @@ -110,18 +110,18 @@ def compute_computed_constants(variables): def compute_rates(voi, states, rates, variables): - variables[2] = states[1]+variables[3] + variables[1] = states[1]+variables[3] find_root_0(voi, states, rates, variables) rates[0] = variables[0] - variables[4] = states[0]/variables[7] - variables[5] = variables[8]*variables[2] + variables[5] = variables[8]*variables[1] + variables[6] = states[0]/variables[7] find_root_1(voi, states, rates, variables) - rates[1] = variables[6]/variables[9] + rates[1] = variables[4]/variables[9] def compute_variables(voi, states, rates, variables): - variables[2] = states[1]+variables[3] + variables[1] = states[1]+variables[3] find_root_0(voi, states, rates, variables) - variables[4] = states[0]/variables[7] - variables[5] = variables[8]*variables[2] + variables[5] = variables[8]*variables[1] + variables[6] = states[0]/variables[7] 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 f0aebd1d3e..27f83d863a 100644 --- a/tests/resources/generator/dependent_eqns/model.c +++ b/tests/resources/generator/dependent_eqns/model.c @@ -18,8 +18,8 @@ const VariableInfo STATE_INFO[] = { }; const VariableInfo VARIABLE_INFO[] = { - {"a", "second", "my_component", ALGEBRAIC}, - {"b", "second", "my_component", ALGEBRAIC} + {"b", "second", "my_component", ALGEBRAIC}, + {"a", "second", "my_component", ALGEBRAIC} }; double * createStatesArray() @@ -65,6 +65,6 @@ void computeRates(double voi, double *states, double *rates, double *variables) void computeVariables(double voi, double *states, double *rates, double *variables) { - variables[1] = 2.0*voi; - variables[0] = 3.0*variables[1]; + variables[0] = 2.0*voi; + variables[1] = 3.0*variables[0]; } diff --git a/tests/resources/generator/dependent_eqns/model.py b/tests/resources/generator/dependent_eqns/model.py index b7e9a74dd6..8310ae6ed8 100644 --- a/tests/resources/generator/dependent_eqns/model.py +++ b/tests/resources/generator/dependent_eqns/model.py @@ -26,8 +26,8 @@ class VariableType(Enum): ] VARIABLE_INFO = [ - {"name": "a", "units": "second", "component": "my_component", "type": VariableType.ALGEBRAIC}, - {"name": "b", "units": "second", "component": "my_component", "type": VariableType.ALGEBRAIC} + {"name": "b", "units": "second", "component": "my_component", "type": VariableType.ALGEBRAIC}, + {"name": "a", "units": "second", "component": "my_component", "type": VariableType.ALGEBRAIC} ] @@ -52,5 +52,5 @@ def compute_rates(voi, states, rates, variables): def compute_variables(voi, states, rates, variables): - variables[1] = 2.0*voi - variables[0] = 3.0*variables[1] + variables[0] = 2.0*voi + variables[1] = 3.0*variables[0] 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 aeeca719a6..f5446177df 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 @@ -43,8 +43,8 @@ const VariableInfo STATE_INFO[] = { {"r", "dimensionless", "i_to_r_gate", STATE}, {"q", "dimensionless", "i_to_q_gate", STATE}, {"piy", "dimensionless", "i_Kr_pi_gate", STATE}, - {"paF", "dimensionless", "i_Kr_pa_gate", STATE}, {"paS", "dimensionless", "i_Kr_pa_gate", STATE}, + {"paF", "dimensionless", "i_Kr_pa_gate", STATE}, {"n", "dimensionless", "i_Ks_n_gate", STATE}, {"a", "dimensionless", "i_KACh_a_gate", STATE} }; @@ -52,136 +52,136 @@ const VariableInfo STATE_INFO[] = { const VariableInfo VARIABLE_INFO[] = { {"ACh", "millimolar", "Rate_modulation_experiments", CONSTANT}, {"Iso_1_uM", "dimensionless", "Rate_modulation_experiments", CONSTANT}, - {"E_Na", "millivolt", "Ionic_values", ALGEBRAIC}, - {"RTONF", "millivolt", "Membrane", COMPUTED_CONSTANT}, - {"Nao", "millimolar", "Ionic_values", CONSTANT}, {"Nai", "millimolar", "Nai_concentration", ALGEBRAIC}, - {"E_K", "millivolt", "Ionic_values", COMPUTED_CONSTANT}, - {"Ko", "millimolar", "Ionic_values", CONSTANT}, + {"Nao", "millimolar", "Ionic_values", CONSTANT}, + {"RTONF", "millivolt", "Membrane", COMPUTED_CONSTANT}, + {"E_Na", "millivolt", "Ionic_values", ALGEBRAIC}, {"Ki", "millimolar", "Ionic_values", CONSTANT}, - {"E_Ca", "millivolt", "Ionic_values", ALGEBRAIC}, + {"Ko", "millimolar", "Ionic_values", CONSTANT}, + {"E_K", "millivolt", "Ionic_values", COMPUTED_CONSTANT}, {"Cao", "millimolar", "Ionic_values", CONSTANT}, - {"Nai_clamp", "dimensionless", "Nai_concentration", CONSTANT}, - {"i_Na", "nanoA", "i_Na", ALGEBRAIC}, + {"E_Ca", "millivolt", "Ionic_values", ALGEBRAIC}, + {"F", "coulomb_per_mole", "Membrane", CONSTANT}, + {"V_sub", "millimetre3", "Cell_parameters", COMPUTED_CONSTANT}, + {"V_i", "millimetre3", "Cell_parameters", COMPUTED_CONSTANT}, {"i_NaCa", "nanoA", "i_NaCa", ALGEBRAIC}, {"i_NaK", "nanoA", "i_NaK", ALGEBRAIC}, {"i_siNa", "nanoA", "i_CaL", ALGEBRAIC}, {"i_fNa", "nanoA", "i_f", ALGEBRAIC}, - {"F", "coulomb_per_mole", "Membrane", CONSTANT}, - {"V_i", "millimetre3", "Cell_parameters", COMPUTED_CONSTANT}, - {"V_sub", "millimetre3", "Cell_parameters", COMPUTED_CONSTANT}, + {"i_Na", "nanoA", "i_Na", ALGEBRAIC}, + {"Nai_clamp", "dimensionless", "Nai_concentration", CONSTANT}, {"Iso_increase", "dimensionless", "i_NaK", COMPUTED_CONSTANT}, {"V", "millivolt", "Membrane", ALGEBRAIC}, {"Km_Nap", "millimolar", "i_NaK", CONSTANT}, {"Km_Kp", "millimolar", "i_NaK", CONSTANT}, {"i_NaK_max", "nanoA", "i_NaK", CONSTANT}, - {"blockade_NaCa", "dimensionless", "i_NaCa", CONSTANT}, + {"x4", "dimensionless", "i_NaCa", ALGEBRAIC}, + {"x3", "dimensionless", "i_NaCa", ALGEBRAIC}, {"x2", "dimensionless", "i_NaCa", ALGEBRAIC}, - {"k21", "dimensionless", "i_NaCa", ALGEBRAIC}, {"x1", "dimensionless", "i_NaCa", ALGEBRAIC}, {"k12", "dimensionless", "i_NaCa", ALGEBRAIC}, + {"k21", "dimensionless", "i_NaCa", ALGEBRAIC}, {"K_NaCa", "nanoA", "i_NaCa", CONSTANT}, - {"x4", "dimensionless", "i_NaCa", ALGEBRAIC}, - {"x3", "dimensionless", "i_NaCa", ALGEBRAIC}, + {"blockade_NaCa", "dimensionless", "i_NaCa", CONSTANT}, {"k41", "dimensionless", "i_NaCa", ALGEBRAIC}, - {"k23", "dimensionless", "i_NaCa", ALGEBRAIC}, - {"k34", "dimensionless", "i_NaCa", COMPUTED_CONSTANT}, {"k43", "dimensionless", "i_NaCa", ALGEBRAIC}, {"k32", "dimensionless", "i_NaCa", ALGEBRAIC}, + {"k23", "dimensionless", "i_NaCa", ALGEBRAIC}, + {"k34", "dimensionless", "i_NaCa", COMPUTED_CONSTANT}, {"k14", "dimensionless", "i_NaCa", ALGEBRAIC}, {"K3ni", "millimolar", "i_NaCa", CONSTANT}, - {"Kci", "millimolar", "i_NaCa", CONSTANT}, - {"Qci", "dimensionless", "i_NaCa", CONSTANT}, {"di", "dimensionless", "i_NaCa", ALGEBRAIC}, - {"K1ni", "millimolar", "i_NaCa", CONSTANT}, - {"K2ni", "millimolar", "i_NaCa", CONSTANT}, + {"Qci", "dimensionless", "i_NaCa", CONSTANT}, + {"Kci", "millimolar", "i_NaCa", CONSTANT}, {"Qn", "dimensionless", "i_NaCa", CONSTANT}, + {"K2ni", "millimolar", "i_NaCa", CONSTANT}, + {"K1ni", "millimolar", "i_NaCa", CONSTANT}, {"Kcni", "millimolar", "i_NaCa", CONSTANT}, {"K3no", "millimolar", "i_NaCa", CONSTANT}, - {"Kco", "millimolar", "i_NaCa", CONSTANT}, - {"Qco", "dimensionless", "i_NaCa", CONSTANT}, {"do", "dimensionless", "i_NaCa", ALGEBRAIC}, - {"K1no", "millimolar", "i_NaCa", CONSTANT}, + {"Qco", "dimensionless", "i_NaCa", CONSTANT}, + {"Kco", "millimolar", "i_NaCa", CONSTANT}, {"K2no", "millimolar", "i_NaCa", CONSTANT}, - {"j_SRCarel", "millimolar_per_second", "Ca_SR_release", ALGEBRAIC}, + {"K1no", "millimolar", "i_NaCa", CONSTANT}, {"ks", "per_second", "Ca_SR_release", CONSTANT}, + {"j_SRCarel", "millimolar_per_second", "Ca_SR_release", ALGEBRAIC}, {"diff", "millimolar", "Ca_SR_release", ALGEBRAIC}, - {"kCaSR", "dimensionless", "Ca_SR_release", ALGEBRAIC}, - {"MaxSR", "dimensionless", "Ca_SR_release", CONSTANT}, - {"MinSR", "dimensionless", "Ca_SR_release", CONSTANT}, - {"EC50_SR", "millimolar", "Ca_SR_release", CONSTANT}, {"HSR", "dimensionless", "Ca_SR_release", CONSTANT}, - {"koSRCa", "per_millimolar2_second", "Ca_SR_release", ALGEBRAIC}, + {"EC50_SR", "millimolar", "Ca_SR_release", CONSTANT}, + {"MinSR", "dimensionless", "Ca_SR_release", CONSTANT}, + {"MaxSR", "dimensionless", "Ca_SR_release", CONSTANT}, + {"kCaSR", "dimensionless", "Ca_SR_release", ALGEBRAIC}, {"koCa", "per_millimolar2_second", "Ca_SR_release", CONSTANT}, - {"kiSRCa", "per_millimolar_second", "Ca_SR_release", ALGEBRAIC}, + {"koSRCa", "per_millimolar2_second", "Ca_SR_release", ALGEBRAIC}, {"kiCa", "per_millimolar_second", "Ca_SR_release", CONSTANT}, - {"kim", "per_second", "Ca_SR_release", CONSTANT}, + {"kiSRCa", "per_millimolar_second", "Ca_SR_release", ALGEBRAIC}, {"kom", "per_second", "Ca_SR_release", CONSTANT}, + {"kim", "per_second", "Ca_SR_release", CONSTANT}, {"P_tot", "dimensionless", "Ca_SR_release", ALGEBRAIC}, {"b_up", "dimensionless", "Ca_intracellular_fluxes", COMPUTED_CONSTANT}, - {"P_up", "millimolar_per_second", "Ca_intracellular_fluxes", COMPUTED_CONSTANT}, {"P_up_basal", "millimolar_per_second", "Ca_intracellular_fluxes", CONSTANT}, - {"j_Ca_dif", "millimolar_per_second", "Ca_intracellular_fluxes", ALGEBRAIC}, + {"P_up", "millimolar_per_second", "Ca_intracellular_fluxes", COMPUTED_CONSTANT}, {"tau_dif_Ca", "second", "Ca_intracellular_fluxes", CONSTANT}, - {"j_up", "millimolar_per_second", "Ca_intracellular_fluxes", ALGEBRAIC}, - {"K_up", "millimolar", "Ca_intracellular_fluxes", CONSTANT}, + {"j_Ca_dif", "millimolar_per_second", "Ca_intracellular_fluxes", ALGEBRAIC}, {"slope_up", "millimolar", "Ca_intracellular_fluxes", CONSTANT}, - {"j_tr", "millimolar_per_second", "Ca_intracellular_fluxes", ALGEBRAIC}, + {"K_up", "millimolar", "Ca_intracellular_fluxes", CONSTANT}, + {"j_up", "millimolar_per_second", "Ca_intracellular_fluxes", ALGEBRAIC}, {"tau_tr", "second", "Ca_intracellular_fluxes", CONSTANT}, + {"j_tr", "millimolar_per_second", "Ca_intracellular_fluxes", ALGEBRAIC}, {"delta_fTC", "per_second", "Ca_buffering", ALGEBRAIC}, - {"kf_TC", "per_millimolar_second", "Ca_buffering", CONSTANT}, {"kb_TC", "per_second", "Ca_buffering", CONSTANT}, + {"kf_TC", "per_millimolar_second", "Ca_buffering", CONSTANT}, {"delta_fTMC", "per_second", "Ca_buffering", ALGEBRAIC}, - {"kf_TMC", "per_millimolar_second", "Ca_buffering", CONSTANT}, {"kb_TMC", "per_second", "Ca_buffering", CONSTANT}, + {"kf_TMC", "per_millimolar_second", "Ca_buffering", CONSTANT}, {"delta_fTMM", "per_second", "Ca_buffering", ALGEBRAIC}, - {"kf_TMM", "per_millimolar_second", "Ca_buffering", CONSTANT}, - {"Mgi", "millimolar", "Ca_buffering", CONSTANT}, {"kb_TMM", "per_second", "Ca_buffering", CONSTANT}, + {"Mgi", "millimolar", "Ca_buffering", CONSTANT}, + {"kf_TMM", "per_millimolar_second", "Ca_buffering", CONSTANT}, {"delta_fCMi", "per_second", "Ca_buffering", ALGEBRAIC}, - {"kf_CM", "per_millimolar_second", "Ca_buffering", CONSTANT}, {"kb_CM", "per_second", "Ca_buffering", CONSTANT}, + {"kf_CM", "per_millimolar_second", "Ca_buffering", CONSTANT}, {"delta_fCMs", "per_second", "Ca_buffering", ALGEBRAIC}, {"delta_fCQ", "per_second", "Ca_buffering", ALGEBRAIC}, - {"kf_CQ", "per_millimolar_second", "Ca_buffering", CONSTANT}, {"kb_CQ", "per_second", "Ca_buffering", CONSTANT}, + {"kf_CQ", "per_millimolar_second", "Ca_buffering", CONSTANT}, {"TC_tot", "millimolar", "Ca_buffering", CONSTANT}, {"TMC_tot", "millimolar", "Ca_buffering", CONSTANT}, {"CM_tot", "millimolar", "Ca_buffering", CONSTANT}, {"CQ_tot", "millimolar", "Ca_buffering", CONSTANT}, {"V_nsr", "millimetre3", "Cell_parameters", COMPUTED_CONSTANT}, - {"V_jsr", "millimetre3", "Cell_parameters", COMPUTED_CONSTANT}, - {"i_siCa", "nanoA", "i_CaL", ALGEBRAIC}, {"i_CaT", "nanoA", "i_CaT", ALGEBRAIC}, - {"V_cell", "millimetre3", "Cell_parameters", COMPUTED_CONSTANT}, + {"i_siCa", "nanoA", "i_CaL", ALGEBRAIC}, + {"V_jsr", "millimetre3", "Cell_parameters", COMPUTED_CONSTANT}, {"L_cell", "micrometre", "Cell_parameters", CONSTANT}, {"R_cell", "micrometre", "Cell_parameters", CONSTANT}, + {"V_cell", "millimetre3", "Cell_parameters", COMPUTED_CONSTANT}, {"L_sub", "micrometre", "Cell_parameters", CONSTANT}, {"V_jsr_part", "dimensionless", "Cell_parameters", CONSTANT}, {"V_i_part", "dimensionless", "Cell_parameters", CONSTANT}, {"V_nsr_part", "dimensionless", "Cell_parameters", CONSTANT}, - {"i_tot", "nanoA", "Membrane", ALGEBRAIC}, - {"i_f", "nanoA", "i_f", ALGEBRAIC}, {"i_Kur", "nanoA", "i_Kur", ALGEBRAIC}, {"i_KACh", "nanoA", "i_KACh", ALGEBRAIC}, {"i_CaL", "nanoA", "i_CaL", ALGEBRAIC}, {"i_to", "nanoA", "i_to", ALGEBRAIC}, {"i_Ks", "nanoA", "i_Ks", ALGEBRAIC}, {"i_Kr", "nanoA", "i_Kr", ALGEBRAIC}, + {"i_f", "nanoA", "i_f", ALGEBRAIC}, + {"i_tot", "nanoA", "Membrane", ALGEBRAIC}, {"C", "microF", "Membrane", CONSTANT}, - {"R", "joule_per_kilomole_kelvin", "Membrane", CONSTANT}, {"T", "kelvin", "Membrane", CONSTANT}, + {"R", "joule_per_kilomole_kelvin", "Membrane", CONSTANT}, {"V_clamp", "millivolt", "Voltage_clamp", ALGEBRAIC}, {"clamp_mode", "dimensionless", "Membrane", CONSTANT}, {"V_test", "millivolt", "Voltage_clamp", CONSTANT}, - {"t_holding", "second", "Voltage_clamp", CONSTANT}, {"t_test", "second", "Voltage_clamp", CONSTANT}, + {"t_holding", "second", "Voltage_clamp", CONSTANT}, {"V_holding", "millivolt", "Voltage_clamp", CONSTANT}, - {"G_f", "microS", "i_f", COMPUTED_CONSTANT}, - {"g_f", "microS", "i_f", CONSTANT}, {"Km_f", "millimolar", "i_f", CONSTANT}, - {"G_f_K", "microS", "i_f", COMPUTED_CONSTANT}, + {"g_f", "microS", "i_f", CONSTANT}, + {"G_f", "microS", "i_f", COMPUTED_CONSTANT}, {"alpha", "dimensionless", "i_f", CONSTANT}, + {"G_f_K", "microS", "i_f", COMPUTED_CONSTANT}, {"G_f_Na", "microS", "i_f", COMPUTED_CONSTANT}, {"g_f_Na", "microS", "i_f", COMPUTED_CONSTANT}, {"g_f_K", "microS", "i_f", COMPUTED_CONSTANT}, @@ -190,17 +190,17 @@ const VariableInfo VARIABLE_INFO[] = { {"ACh_shift", "millivolt", "i_f_y_gate", COMPUTED_CONSTANT}, {"Iso_shift", "millivolt", "i_f_y_gate", COMPUTED_CONSTANT}, {"tau_y", "second", "i_f_y_gate", ALGEBRAIC}, - {"y_infinity", "dimensionless", "i_f_y_gate", ALGEBRAIC}, {"y_shift", "millivolt", "i_f_y_gate", CONSTANT}, + {"y_infinity", "dimensionless", "i_f_y_gate", ALGEBRAIC}, {"E_mh", "millivolt", "i_Na", ALGEBRAIC}, - {"i_Na_", "nanoA", "i_Na", ALGEBRAIC}, {"g_Na", "microS", "i_Na", CONSTANT}, - {"i_Na_L", "nanoA", "i_Na", ALGEBRAIC}, + {"i_Na_", "nanoA", "i_Na", ALGEBRAIC}, {"g_Na_L", "microS", "i_Na", CONSTANT}, + {"i_Na_L", "nanoA", "i_Na", ALGEBRAIC}, {"m_infinity", "dimensionless", "i_Na_m_gate", ALGEBRAIC}, {"E0_m", "millivolt", "i_Na_m_gate", ALGEBRAIC}, - {"alpha_m", "per_second", "i_Na_m_gate", ALGEBRAIC}, {"delta_m", "millivolt", "i_Na_m_gate", CONSTANT}, + {"alpha_m", "per_second", "i_Na_m_gate", ALGEBRAIC}, {"beta_m", "per_second", "i_Na_m_gate", ALGEBRAIC}, {"tau_m", "second", "i_Na_m_gate", ALGEBRAIC}, {"h_infinity", "dimensionless", "i_Na_h_gate", ALGEBRAIC}, @@ -208,38 +208,38 @@ const VariableInfo VARIABLE_INFO[] = { {"beta_h", "per_second", "i_Na_h_gate", ALGEBRAIC}, {"tau_h", "second", "i_Na_h_gate", ALGEBRAIC}, {"g_Kur", "microS", "i_Kur", CONSTANT}, - {"r_Kur_infinity", "dimensionless", "i_Kur_rKur_gate", ALGEBRAIC}, {"tau_r_Kur", "second", "i_Kur_rKur_gate", ALGEBRAIC}, - {"s_Kur_infinity", "dimensionless", "i_Kur_sKur_gate", ALGEBRAIC}, + {"r_Kur_infinity", "dimensionless", "i_Kur_rKur_gate", ALGEBRAIC}, {"tau_s_Kur", "second", "i_Kur_sKur_gate", ALGEBRAIC}, + {"s_Kur_infinity", "dimensionless", "i_Kur_sKur_gate", ALGEBRAIC}, {"Iso_increase", "dimensionless", "i_CaL", COMPUTED_CONSTANT}, {"P_CaL", "nanoA_per_millimolar", "i_CaL", CONSTANT}, {"i_siK", "nanoA", "i_CaL", ALGEBRAIC}, {"ACh_block", "dimensionless", "i_CaL", COMPUTED_CONSTANT}, {"Iso_shift_dL", "millivolt", "i_CaL_dL_gate", COMPUTED_CONSTANT}, {"Iso_slope_dL", "dimensionless", "i_CaL_dL_gate", COMPUTED_CONSTANT}, - {"dL_infinity", "dimensionless", "i_CaL_dL_gate", ALGEBRAIC}, - {"V_dL", "millivolt", "i_CaL_dL_gate", CONSTANT}, {"k_dL", "millivolt", "i_CaL_dL_gate", CONSTANT}, - {"tau_dL", "second", "i_CaL_dL_gate", ALGEBRAIC}, - {"alpha_dL", "per_second", "i_CaL_dL_gate", ALGEBRAIC}, + {"V_dL", "millivolt", "i_CaL_dL_gate", CONSTANT}, + {"dL_infinity", "dimensionless", "i_CaL_dL_gate", ALGEBRAIC}, {"beta_dL", "per_second", "i_CaL_dL_gate", ALGEBRAIC}, + {"alpha_dL", "per_second", "i_CaL_dL_gate", ALGEBRAIC}, + {"tau_dL", "second", "i_CaL_dL_gate", ALGEBRAIC}, {"adVm", "millivolt", "i_CaL_dL_gate", ALGEBRAIC}, {"bdVm", "millivolt", "i_CaL_dL_gate", ALGEBRAIC}, - {"fL_infinity", "dimensionless", "i_CaL_fL_gate", ALGEBRAIC}, - {"shift_fL", "millivolt", "i_CaL_fL_gate", CONSTANT}, {"k_fL", "millivolt", "i_CaL_fL_gate", CONSTANT}, + {"shift_fL", "millivolt", "i_CaL_fL_gate", CONSTANT}, + {"fL_infinity", "dimensionless", "i_CaL_fL_gate", ALGEBRAIC}, {"tau_fL", "second", "i_CaL_fL_gate", ALGEBRAIC}, - {"fCa_infinity", "dimensionless", "i_CaL_fCa_gate", ALGEBRAIC}, {"Km_fCa", "millimolar", "i_CaL_fCa_gate", CONSTANT}, - {"tau_fCa", "second", "i_CaL_fCa_gate", ALGEBRAIC}, + {"fCa_infinity", "dimensionless", "i_CaL_fCa_gate", ALGEBRAIC}, {"alpha_fCa", "per_second", "i_CaL_fCa_gate", CONSTANT}, + {"tau_fCa", "second", "i_CaL_fCa_gate", ALGEBRAIC}, {"P_CaT", "nanoA_per_millimolar", "i_CaT", CONSTANT}, {"dT_infinity", "dimensionless", "i_CaT_dT_gate", ALGEBRAIC}, {"tau_dT", "second", "i_CaT_dT_gate", ALGEBRAIC}, {"fT_infinity", "dimensionless", "i_CaT_fT_gate", ALGEBRAIC}, - {"tau_fT", "second", "i_CaT_fT_gate", ALGEBRAIC}, {"offset_fT", "second", "i_CaT_fT_gate", CONSTANT}, + {"tau_fT", "second", "i_CaT_fT_gate", ALGEBRAIC}, {"g_to", "microS", "i_to", CONSTANT}, {"q_infinity", "dimensionless", "i_to_q_gate", ALGEBRAIC}, {"tau_q", "second", "i_to_q_gate", ALGEBRAIC}, @@ -253,16 +253,16 @@ const VariableInfo VARIABLE_INFO[] = { {"tau_paF", "second", "i_Kr_pa_gate", ALGEBRAIC}, {"tau_pi", "second", "i_Kr_pi_gate", ALGEBRAIC}, {"pi_infinity", "dimensionless", "i_Kr_pi_gate", ALGEBRAIC}, - {"g_Ks", "microS", "i_Ks", COMPUTED_CONSTANT}, {"g_Ks_", "microS", "i_Ks", CONSTANT}, + {"g_Ks", "microS", "i_Ks", COMPUTED_CONSTANT}, {"E_Ks", "millivolt", "i_Ks", ALGEBRAIC}, {"Iso_shift", "millivolt", "i_Ks_n_gate", COMPUTED_CONSTANT}, {"n_infinity", "dimensionless", "i_Ks_n_gate", ALGEBRAIC}, - {"tau_n", "second", "i_Ks_n_gate", ALGEBRAIC}, - {"alpha_n", "per_second", "i_Ks_n_gate", ALGEBRAIC}, {"beta_n", "per_second", "i_Ks_n_gate", ALGEBRAIC}, - {"ACh_on", "dimensionless", "i_KACh", CONSTANT}, + {"alpha_n", "per_second", "i_Ks_n_gate", ALGEBRAIC}, + {"tau_n", "second", "i_Ks_n_gate", ALGEBRAIC}, {"g_KACh", "microS", "i_KACh", CONSTANT}, + {"ACh_on", "dimensionless", "i_KACh", CONSTANT}, {"alpha_a", "per_second", "i_KACh_a_gate", COMPUTED_CONSTANT}, {"beta_a", "per_second", "i_KACh_a_gate", ALGEBRAIC}, {"a_infinity", "dimensionless", "i_KACh_a_gate", ALGEBRAIC}, @@ -300,95 +300,95 @@ void initialiseVariables(double *states, double *rates, double *variables) { variables[0] = 0.0; variables[1] = 0.0; - variables[4] = 140.0; + variables[3] = 140.0; + variables[6] = 140.0; variables[7] = 5.4; - variables[8] = 140.0; - variables[10] = 1.8; - variables[11] = 1.0; - variables[17] = 96485.3415; + variables[9] = 1.8; + variables[11] = 96485.3415; + variables[19] = 1.0; variables[22] = 14.0; variables[23] = 1.4; variables[24] = 0.08105; - variables[25] = 0.0; - variables[30] = 3.343; + variables[31] = 3.343; + variables[32] = 0.0; variables[39] = 26.44; - variables[40] = 0.0207; variables[41] = 0.1369; - variables[43] = 395.3; + variables[42] = 0.0207; + variables[43] = 0.4315; variables[44] = 2.289; - variables[45] = 0.4315; + variables[45] = 395.3; 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[50] = 3.663; + variables[51] = 561.4; + variables[52] = 1628.0; + variables[53] = 148041085.1; + variables[56] = 2.5; + variables[57] = 0.45; 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[59] = 15.0; + variables[61] = 10000.0; + variables[63] = 500.0; + variables[65] = 660.0; + variables[66] = 5.0; + variables[69] = 5.0; + variables[71] = 5.469e-5; + variables[73] = 5.0e-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[76] = 0.04; + variables[79] = 446.0; + variables[80] = 88800.0; + variables[82] = 7.51; + variables[83] = 227700.0; + variables[85] = 751.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[87] = 2277.0; + variables[89] = 542.0; + variables[90] = 1.642e6; + variables[93] = 445.0; + variables[94] = 175.4; 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[103] = 67.0; + variables[104] = 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[119] = 310.0; + variables[120] = 8314.472; variables[122] = 0.0; variables[123] = -35.0; variables[124] = 0.5; variables[125] = 0.5; variables[126] = -45.0; + variables[127] = 45.0; variables[128] = 0.00427; - variables[129] = 45.0; - variables[131] = 0.5927; + variables[130] = 0.5927; variables[135] = 0.0; - variables[141] = 0.0; - variables[144] = 0.0223; - variables[146] = 0.0; - variables[150] = 1.0e-5; + variables[140] = 0.0; + variables[143] = 0.0223; + variables[145] = 0.0; + variables[149] = 1.0e-5; variables[157] = 0.1539e-3; variables[163] = 0.4578; + variables[168] = 4.3371; variables[169] = -16.4508; - variables[170] = 4.3371; + variables[176] = 0.0; variables[177] = 0.0; - variables[178] = 0.0; - variables[181] = 0.000338; - variables[183] = 0.0075; + variables[180] = 0.000338; + variables[182] = 0.0075; variables[184] = 0.04132; - variables[189] = 0.0; + variables[188] = 0.0; variables[190] = 3.5e-3; variables[195] = 0.00424; - variables[204] = 0.00065; - variables[211] = 1.0; - variables[212] = 0.00345; + variables[203] = 0.00065; + variables[211] = 0.00345; + variables[212] = 1.0; states[0] = 6.226104e-5; states[1] = 5.0; states[2] = 0.409551; @@ -418,258 +418,258 @@ void initialiseVariables(double *states, double *rates, double *variables) states[26] = 0.014523; states[27] = 0.430836; states[28] = 0.709051; - states[29] = 0.011068; - states[30] = 0.283185; + states[29] = 0.283185; + states[30] = 0.011068; states[31] = 0.1162; states[32] = 0.00277; } void computeComputedConstants(double *variables) { - variables[3] = variables[119]*variables[120]/variables[17]; - variables[6] = variables[3]*log(variables[7]/variables[8]); + variables[4] = variables[120]*variables[119]/variables[11]; + variables[8] = variables[4]*log(variables[7]/variables[6]); variables[20] = (variables[1] > 0.0)?1.2:1.0; - variables[35] = variables[4]/(variables[47]+variables[4]); + variables[37] = variables[3]/(variables[47]+variables[3]); 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[70] = variables[69]*(1.0-variables[68]); + variables[105] = 0.000000001*3.14159265358979*pow(variables[104], 2.0)*variables[103]; + variables[12] = 0.000000001*2.0*3.14159265358979*variables[106]*(variables[104]-variables[106]/2.0)*variables[103]; + variables[102] = variables[107]*variables[105]; + variables[13] = variables[108]*variables[105]-variables[12]; + variables[99] = variables[109]*variables[105]; + variables[129] = variables[128]/(variables[7]/(variables[7]+variables[127])); + variables[131] = variables[129]/(variables[130]+1.0); + variables[132] = variables[130]*variables[131]; + variables[133] = variables[132]*variables[7]/(variables[7]+variables[127]); + variables[134] = variables[131]*variables[7]/(variables[7]+variables[127]); 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[204] = (variables[1] > 0.0)?1.2*variables[203]:variables[203]; 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; } void computeRates(double voi, double *states, double *rates, double *variables) { - 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[2] = states[1]; + variables[121] = ((voi > variables[125]) && (voi < variables[125]+variables[124]))?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]; + variables[16] = 0.0000185*variables[163]*(variables[21]-0.0)/(variables[4]*(1.0-exp(-1.0*(variables[21]-0.0)/variables[4])))*(variables[2]-variables[3]*exp(-1.0*(variables[21]-0.0)/variables[4]))*states[23]*states[22]*states[21]; + variables[5] = variables[4]*log(variables[3]/variables[2]); + variables[17] = states[16]*variables[133]*(variables[21]-variables[5])*(1.0-variables[135]); + variables[142] = variables[4]*log((variables[3]+0.12*variables[7])/(variables[2]+0.12*variables[6])); + variables[146] = variables[145]*pow(states[18], 3.0)*(variables[21]-variables[142]); + variables[144] = variables[143]*pow(states[18], 3.0)*states[17]*(variables[21]-variables[142]); + variables[18] = variables[144]+variables[146]; + variables[15] = variables[20]*variables[24]*pow(1.0+pow(variables[23]/variables[7], 1.2), -1.0)*pow(1.0+pow(variables[22]/variables[2], 1.3), -1.0)*pow(1.0+exp(-(variables[21]-variables[5]+110.0)/20.0), -1.0); + variables[40] = 1.0+states[0]/variables[42]*(1.0+exp(-variables[41]*variables[21]/variables[4])+variables[2]/variables[46])+variables[2]/variables[45]*(1.0+variables[2]/variables[44]*(1.0+variables[2]/variables[39])); + variables[29] = states[0]/variables[42]*exp(-variables[41]*variables[21]/variables[4])/variables[40]; + variables[48] = 1.0+variables[9]/variables[50]*(1.0+exp(variables[49]*variables[21]/variables[4]))+variables[3]/variables[52]*(1.0+variables[3]/variables[51]*(1.0+variables[3]/variables[47])); + variables[30] = variables[9]/variables[50]*exp(variables[49]*variables[21]/variables[4])/variables[48]; + variables[35] = exp(variables[43]*variables[21]/(2.0*variables[4])); + variables[38] = variables[2]/variables[45]*variables[2]/variables[44]*(1.0+variables[2]/variables[39])*exp(variables[43]*variables[21]/(2.0*variables[4]))/variables[40]; + variables[36] = variables[3]/variables[52]*variables[3]/variables[51]*(1.0+variables[3]/variables[47])*exp(-variables[43]*variables[21]/(2.0*variables[4]))/variables[48]; + variables[25] = variables[36]*variables[37]*(variables[38]+variables[29])+variables[38]*variables[30]*(variables[37]+variables[35]); + variables[34] = variables[2]/(variables[39]+variables[2]); + variables[33] = exp(-variables[43]*variables[21]/(2.0*variables[4])); + variables[26] = variables[38]*variables[34]*(variables[36]+variables[30])+variables[29]*variables[36]*(variables[34]+variables[33]); + variables[27] = variables[35]*variables[34]*(variables[38]+variables[29])+variables[33]*variables[29]*(variables[37]+variables[35]); + variables[28] = variables[33]*variables[37]*(variables[36]+variables[30])+variables[30]*variables[35]*(variables[34]+variables[33]); + variables[14] = (1.0-variables[32])*variables[31]*(variables[27]*variables[30]-variables[28]*variables[29])/(variables[28]+variables[27]+variables[26]+variables[25]); + rates[1] = (1.0-variables[19])*-1.0*(variables[18]+variables[17]+variables[16]+3.0*variables[15]+3.0*variables[14])/(1.0*(variables[13]+variables[12])*variables[11]); + variables[60] = variables[59]-(variables[59]-variables[58])/(1.0+pow(variables[57]/states[2], variables[56])); + variables[62] = variables[61]/variables[60]; + variables[64] = variables[63]*variables[60]; + rates[4] = variables[66]*states[5]-variables[64]*states[0]*states[4]-(variables[62]*pow(states[0], 2.0)*states[4]-variables[65]*states[3]); + rates[3] = variables[62]*pow(states[0], 2.0)*states[4]-variables[65]*states[3]-(variables[64]*states[0]*states[3]-variables[66]*states[6]); + rates[6] = variables[64]*states[0]*states[3]-variables[66]*states[6]-(variables[65]*states[6]-variables[62]*pow(states[0], 2.0)*states[5]); + rates[5] = variables[65]*states[6]-variables[62]*pow(states[0], 2.0)*states[5]-(variables[66]*states[5]-variables[64]*states[0]*states[4]); + variables[78] = variables[80]*states[7]*(1.0-states[9])-variables[79]*states[9]; rates[9] = variables[78]; - variables[81] = variables[82]*states[7]*(1.0-(states[10]+states[11]))-variables[83]*states[10]; + variables[81] = variables[83]*states[7]*(1.0-(states[10]+states[11]))-variables[82]*states[10]; rates[10] = variables[81]; - variables[84] = variables[85]*variables[86]*(1.0-(states[10]+states[11]))-variables[87]*states[11]; + variables[84] = variables[87]*variables[86]*(1.0-(states[10]+states[11]))-variables[85]*states[11]; rates[11] = variables[84]; - variables[88] = variables[89]*states[7]*(1.0-states[12])-variables[90]*states[12]; + variables[88] = variables[90]*states[7]*(1.0-states[12])-variables[89]*states[12]; rates[12] = variables[88]; - variables[91] = variables[89]*states[0]*(1.0-states[13])-variables[90]*states[13]; + variables[91] = variables[90]*states[0]*(1.0-states[13])-variables[89]*states[13]; rates[13] = variables[91]; - variables[92] = variables[93]*states[2]*(1.0-states[14])-variables[94]*states[14]; + variables[92] = variables[94]*states[2]*(1.0-states[14])-variables[93]*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[75] = variables[70]/(1.0+exp((-states[7]+variables[74])/variables[73])); + variables[72] = (states[0]-states[7])/variables[71]; + rates[7] = 1.0*(variables[72]*variables[12]-variables[75]*variables[99])/variables[13]-(variables[97]*variables[88]+variables[95]*variables[78]+variables[96]*variables[81]); + variables[54] = variables[53]*states[3]*(states[2]-states[0]); + variables[100] = 2.0*variables[184]*variables[21]/(variables[4]*(1.0-exp(-1.0*variables[21]*2.0/variables[4])))*(states[0]-variables[9]*exp(-2.0*variables[21]/variables[4]))*states[25]*states[24]; + variables[101] = 2.0*variables[163]*(variables[21]-0.0)/(variables[4]*(1.0-exp(-1.0*(variables[21]-0.0)*2.0/variables[4])))*(states[0]-variables[9]*exp(-2.0*(variables[21]-0.0)/variables[4]))*states[23]*states[22]*states[21]; + rates[0] = variables[54]*variables[102]/variables[12]-((variables[101]+variables[100]-2.0*variables[14])/(2.0*variables[11]*variables[12])+variables[72]+variables[97]*variables[91]); + variables[77] = (states[8]-states[2])/variables[76]; + rates[8] = variables[75]-variables[77]*variables[102]/variables[99]; + rates[2] = variables[77]-(variables[54]+variables[98]*variables[92]); + variables[110] = variables[157]*states[20]*states[19]*(variables[21]-variables[8]); + variables[111] = (variables[0] > 0.0)?variables[212]*variables[211]*(variables[21]-variables[8])*(1.0+exp((variables[21]+20.0)/20.0))*states[32]:0.0; + variables[164] = 0.000365*variables[163]*(variables[21]-0.0)/(variables[4]*(1.0-exp(-1.0*(variables[21]-0.0)/variables[4])))*(variables[6]-variables[7]*exp(-1.0*(variables[21]-0.0)/variables[4]))*states[23]*states[22]*states[21]; + variables[112] = (variables[101]+variables[164]+variables[16])*(1.0-variables[165])*1.0*variables[162]; + variables[113] = variables[190]*(variables[21]-variables[8])*states[27]*states[26]; + variables[205] = variables[4]*log((variables[7]+0.12*variables[3])/(variables[6]+0.12*variables[2])); + variables[114] = variables[204]*(variables[21]-variables[205])*pow(states[31], 2.0); + variables[115] = variables[195]*(variables[21]-variables[8])*(0.9*states[30]+0.1*states[29])*states[28]; + variables[136] = states[16]*variables[134]*(variables[21]-variables[8])*(1.0-variables[135]); + variables[116] = variables[17]+variables[136]; + variables[117] = variables[116]+variables[115]+variables[114]+variables[113]+variables[15]+variables[14]+variables[18]+variables[112]+variables[100]+variables[111]+variables[110]; + rates[15] = -variables[117]/variables[118]; 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[141] = (variables[21] < -(80.0-variables[137]-variables[138]-variables[140]))?0.01329+0.99921/(1.0+exp((variables[21]+97.134-variables[137]-variables[138]-variables[140])/8.1752)):0.0002501*exp(-(variables[21]-variables[137]-variables[138]-variables[140])/12.861); + rates[16] = (variables[141]-states[16])/variables[139]; variables[151] = 8000.0*exp(-0.056*(variables[21]+66.0)); - variables[152] = 1.0/(variables[149]+variables[151]); + variables[148] = variables[21]+41.0; + variables[150] = (fabs(variables[148]) < variables[149])?2000.0:200.0*variables[148]/(1.0-exp(-0.1*variables[148])); + variables[152] = 1.0/(variables[150]+variables[151]); + variables[147] = 1.0/(1.0+exp(-(variables[21]+42.0504)/8.3106)); 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[154] = 20.0*exp(-0.125*(variables[21]+75.0)); variables[156] = 1.0/(variables[154]+variables[155]); + variables[153] = 1.0/(1.0+exp((variables[21]+69.804)/4.4565)); 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[158] = 0.009/(1.0+exp((variables[21]+5.0)/12.0))+0.0005; + variables[159] = 1.0/(1.0+exp((variables[21]+6.0)/-8.6)); + rates[20] = (variables[159]-states[20])/variables[158]; + variables[160] = 0.59/(1.0+exp((variables[21]+60.0)/10.0))+3.05; + variables[161] = 1.0/(1.0+exp((variables[21]+7.5)/10.0)); + rates[19] = (variables[161]-states[19])/variables[160]; + variables[170] = 1.0/(1.0+exp(-(variables[21]-variables[169]-variables[166])/(variables[168]*(1.0+variables[167]/100.0)))); + variables[175] = (variables[21] == -1.8)?-1.80001:variables[21]; + variables[171] = 0.01143*(variables[175]+1.8)/(exp((variables[175]+1.8)/2.5)-1.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[173] = 0.001/(variables[172]+variables[171]); + rates[23] = (variables[170]-states[23])/variables[173]; 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[178] = 1.0/(1.0+exp((variables[21]+37.4+variables[177])/(5.3+variables[176]))); + rates[22] = (variables[178]-states[22])/variables[179]; + variables[181] = variables[180]/(variables[180]+states[0]); + variables[183] = 0.001*variables[181]/variables[182]; + rates[21] = (variables[181]-states[21])/variables[183]; variables[186] = 0.001/(1.068*exp((variables[21]+38.3)/30.0)+1.068*exp(-(variables[21]+38.3)/30.0)); + variables[185] = 1.0/(1.0+exp(-(variables[21]+38.3)/5.5)); rates[25] = (variables[185]-states[25])/variables[186]; + variables[189] = 1.0/(16.67*exp(-(variables[21]+75.0)/83.3)+16.67*exp((variables[21]+75.0)/15.38))+variables[188]; 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)); + rates[24] = (variables[187]-states[24])/variables[189]; 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[191] = 1.0/(1.0+exp((variables[21]+49.0)/13.0)); 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); + variables[193] = 1.0/(1.0+exp(-(variables[21]-19.3)/15.0)); 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[198] = 1.0/(1.0+exp(-(variables[21]+10.0144)/7.6607)); + rates[29] = (variables[198]-states[29])/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)); + rates[30] = (variables[198]-states[30])/variables[200]; 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)); 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[208] = 1.0*exp(-(variables[21]-variables[206]-5.0)/25.0); 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[210] = 1.0/(variables[209]+variables[208]); + rates[31] = (variables[207]-states[31])/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]); + variables[215] = variables[213]/(variables[213]+variables[214]); rates[32] = (variables[215]-states[32])/variables[216]; } void computeVariables(double voi, double *states, double *rates, double *variables) { - 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[2] = states[1]; + variables[5] = variables[4]*log(variables[3]/variables[2]); + variables[10] = 0.5*variables[4]*log(variables[9]/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[15] = variables[20]*variables[24]*pow(1.0+pow(variables[23]/variables[7], 1.2), -1.0)*pow(1.0+pow(variables[22]/variables[2], 1.3), -1.0)*pow(1.0+exp(-(variables[21]-variables[5]+110.0)/20.0), -1.0); + variables[40] = 1.0+states[0]/variables[42]*(1.0+exp(-variables[41]*variables[21]/variables[4])+variables[2]/variables[46])+variables[2]/variables[45]*(1.0+variables[2]/variables[44]*(1.0+variables[2]/variables[39])); + variables[29] = states[0]/variables[42]*exp(-variables[41]*variables[21]/variables[4])/variables[40]; + variables[48] = 1.0+variables[9]/variables[50]*(1.0+exp(variables[49]*variables[21]/variables[4]))+variables[3]/variables[52]*(1.0+variables[3]/variables[51]*(1.0+variables[3]/variables[47])); + variables[30] = variables[9]/variables[50]*exp(variables[49]*variables[21]/variables[4])/variables[48]; + variables[35] = exp(variables[43]*variables[21]/(2.0*variables[4])); + variables[38] = variables[2]/variables[45]*variables[2]/variables[44]*(1.0+variables[2]/variables[39])*exp(variables[43]*variables[21]/(2.0*variables[4]))/variables[40]; + variables[36] = variables[3]/variables[52]*variables[3]/variables[51]*(1.0+variables[3]/variables[47])*exp(-variables[43]*variables[21]/(2.0*variables[4]))/variables[48]; + variables[25] = variables[36]*variables[37]*(variables[38]+variables[29])+variables[38]*variables[30]*(variables[37]+variables[35]); + variables[34] = variables[2]/(variables[39]+variables[2]); + variables[33] = exp(-variables[43]*variables[21]/(2.0*variables[4])); + variables[26] = variables[38]*variables[34]*(variables[36]+variables[30])+variables[29]*variables[36]*(variables[34]+variables[33]); + variables[27] = variables[35]*variables[34]*(variables[38]+variables[29])+variables[33]*variables[29]*(variables[37]+variables[35]); + variables[28] = variables[33]*variables[37]*(variables[36]+variables[30])+variables[30]*variables[35]*(variables[34]+variables[33]); + variables[14] = (1.0-variables[32])*variables[31]*(variables[27]*variables[30]-variables[28]*variables[29])/(variables[28]+variables[27]+variables[26]+variables[25]); + variables[54] = variables[53]*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[60] = variables[59]-(variables[59]-variables[58])/(1.0+pow(variables[57]/states[2], variables[56])); + variables[62] = variables[61]/variables[60]; + variables[64] = variables[63]*variables[60]; 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[72] = (states[0]-states[7])/variables[71]; + variables[75] = variables[70]/(1.0+exp((-states[7]+variables[74])/variables[73])); + variables[77] = (states[8]-states[2])/variables[76]; + variables[78] = variables[80]*states[7]*(1.0-states[9])-variables[79]*states[9]; + variables[81] = variables[83]*states[7]*(1.0-(states[10]+states[11]))-variables[82]*states[10]; + variables[84] = variables[87]*variables[86]*(1.0-(states[10]+states[11]))-variables[85]*states[11]; + variables[88] = variables[90]*states[7]*(1.0-states[12])-variables[89]*states[12]; + variables[91] = variables[90]*states[0]*(1.0-states[13])-variables[89]*states[13]; + variables[92] = variables[94]*states[2]*(1.0-states[14])-variables[93]*states[14]; + variables[110] = variables[157]*states[20]*states[19]*(variables[21]-variables[8]); + variables[111] = (variables[0] > 0.0)?variables[212]*variables[211]*(variables[21]-variables[8])*(1.0+exp((variables[21]+20.0)/20.0))*states[32]:0.0; + variables[100] = 2.0*variables[184]*variables[21]/(variables[4]*(1.0-exp(-1.0*variables[21]*2.0/variables[4])))*(states[0]-variables[9]*exp(-2.0*variables[21]/variables[4]))*states[25]*states[24]; + variables[16] = 0.0000185*variables[163]*(variables[21]-0.0)/(variables[4]*(1.0-exp(-1.0*(variables[21]-0.0)/variables[4])))*(variables[2]-variables[3]*exp(-1.0*(variables[21]-0.0)/variables[4]))*states[23]*states[22]*states[21]; + variables[164] = 0.000365*variables[163]*(variables[21]-0.0)/(variables[4]*(1.0-exp(-1.0*(variables[21]-0.0)/variables[4])))*(variables[6]-variables[7]*exp(-1.0*(variables[21]-0.0)/variables[4]))*states[23]*states[22]*states[21]; + variables[101] = 2.0*variables[163]*(variables[21]-0.0)/(variables[4]*(1.0-exp(-1.0*(variables[21]-0.0)*2.0/variables[4])))*(states[0]-variables[9]*exp(-2.0*(variables[21]-0.0)/variables[4]))*states[23]*states[22]*states[21]; + variables[112] = (variables[101]+variables[164]+variables[16])*(1.0-variables[165])*1.0*variables[162]; + variables[142] = variables[4]*log((variables[3]+0.12*variables[7])/(variables[2]+0.12*variables[6])); + variables[146] = variables[145]*pow(states[18], 3.0)*(variables[21]-variables[142]); + variables[144] = variables[143]*pow(states[18], 3.0)*states[17]*(variables[21]-variables[142]); + variables[18] = variables[144]+variables[146]; + variables[113] = variables[190]*(variables[21]-variables[8])*states[27]*states[26]; + variables[205] = variables[4]*log((variables[7]+0.12*variables[3])/(variables[6]+0.12*variables[2])); + variables[114] = variables[204]*(variables[21]-variables[205])*pow(states[31], 2.0); + variables[115] = variables[195]*(variables[21]-variables[8])*(0.9*states[30]+0.1*states[29])*states[28]; + variables[136] = states[16]*variables[134]*(variables[21]-variables[8])*(1.0-variables[135]); + variables[17] = states[16]*variables[133]*(variables[21]-variables[5])*(1.0-variables[135]); + variables[116] = variables[17]+variables[136]; + variables[117] = variables[116]+variables[115]+variables[114]+variables[113]+variables[15]+variables[14]+variables[18]+variables[112]+variables[100]+variables[111]+variables[110]; 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[141] = (variables[21] < -(80.0-variables[137]-variables[138]-variables[140]))?0.01329+0.99921/(1.0+exp((variables[21]+97.134-variables[137]-variables[138]-variables[140])/8.1752)):0.0002501*exp(-(variables[21]-variables[137]-variables[138]-variables[140])/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[150] = (fabs(variables[148]) < variables[149])?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[152] = 1.0/(variables[150]+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[159] = 1.0/(1.0+exp((variables[21]+6.0)/-8.6)); + variables[158] = 0.009/(1.0+exp((variables[21]+5.0)/12.0))+0.0005; + variables[161] = 1.0/(1.0+exp((variables[21]+7.5)/10.0)); + variables[160] = 0.59/(1.0+exp((variables[21]+60.0)/10.0))+3.05; + variables[170] = 1.0/(1.0+exp(-(variables[21]-variables[169]-variables[166])/(variables[168]*(1.0+variables[167]/100.0)))); + variables[175] = (variables[21] == -1.8)?-1.80001:variables[21]; + variables[171] = 0.01143*(variables[175]+1.8)/(exp((variables[175]+1.8)/2.5)-1.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[173] = 0.001/(variables[172]+variables[171]); + variables[178] = 1.0/(1.0+exp((variables[21]+37.4+variables[177])/(5.3+variables[176]))); 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[181] = variables[180]/(variables[180]+states[0]); + variables[183] = 0.001*variables[181]/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)); 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[189] = 1.0/(16.67*exp(-(variables[21]+75.0)/83.3)+16.67*exp((variables[21]+75.0)/15.38))+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); variables[193] = 1.0/(1.0+exp(-(variables[21]-19.3)/15.0)); @@ -682,9 +682,9 @@ void computeVariables(double voi, double *states, double *rates, double *variabl 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[208] = 1.0*exp(-(variables[21]-variables[206]-5.0)/25.0); 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[210] = 1.0/(variables[209]+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]); 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 a1f6428696..7ed0e96897 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 @@ -51,8 +51,8 @@ class VariableType(Enum): {"name": "r", "units": "dimensionless", "component": "i_to_r_gate", "type": VariableType.STATE}, {"name": "q", "units": "dimensionless", "component": "i_to_q_gate", "type": VariableType.STATE}, {"name": "piy", "units": "dimensionless", "component": "i_Kr_pi_gate", "type": VariableType.STATE}, - {"name": "paF", "units": "dimensionless", "component": "i_Kr_pa_gate", "type": VariableType.STATE}, {"name": "paS", "units": "dimensionless", "component": "i_Kr_pa_gate", "type": VariableType.STATE}, + {"name": "paF", "units": "dimensionless", "component": "i_Kr_pa_gate", "type": VariableType.STATE}, {"name": "n", "units": "dimensionless", "component": "i_Ks_n_gate", "type": VariableType.STATE}, {"name": "a", "units": "dimensionless", "component": "i_KACh_a_gate", "type": VariableType.STATE} ] @@ -60,136 +60,136 @@ class VariableType(Enum): VARIABLE_INFO = [ {"name": "ACh", "units": "millimolar", "component": "Rate_modulation_experiments", "type": VariableType.CONSTANT}, {"name": "Iso_1_uM", "units": "dimensionless", "component": "Rate_modulation_experiments", "type": VariableType.CONSTANT}, - {"name": "E_Na", "units": "millivolt", "component": "Ionic_values", "type": VariableType.ALGEBRAIC}, - {"name": "RTONF", "units": "millivolt", "component": "Membrane", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "Nao", "units": "millimolar", "component": "Ionic_values", "type": VariableType.CONSTANT}, {"name": "Nai", "units": "millimolar", "component": "Nai_concentration", "type": VariableType.ALGEBRAIC}, - {"name": "E_K", "units": "millivolt", "component": "Ionic_values", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "Ko", "units": "millimolar", "component": "Ionic_values", "type": VariableType.CONSTANT}, + {"name": "Nao", "units": "millimolar", "component": "Ionic_values", "type": VariableType.CONSTANT}, + {"name": "RTONF", "units": "millivolt", "component": "Membrane", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "E_Na", "units": "millivolt", "component": "Ionic_values", "type": VariableType.ALGEBRAIC}, {"name": "Ki", "units": "millimolar", "component": "Ionic_values", "type": VariableType.CONSTANT}, - {"name": "E_Ca", "units": "millivolt", "component": "Ionic_values", "type": VariableType.ALGEBRAIC}, + {"name": "Ko", "units": "millimolar", "component": "Ionic_values", "type": VariableType.CONSTANT}, + {"name": "E_K", "units": "millivolt", "component": "Ionic_values", "type": VariableType.COMPUTED_CONSTANT}, {"name": "Cao", "units": "millimolar", "component": "Ionic_values", "type": VariableType.CONSTANT}, - {"name": "Nai_clamp", "units": "dimensionless", "component": "Nai_concentration", "type": VariableType.CONSTANT}, - {"name": "i_Na", "units": "nanoA", "component": "i_Na", "type": VariableType.ALGEBRAIC}, + {"name": "E_Ca", "units": "millivolt", "component": "Ionic_values", "type": VariableType.ALGEBRAIC}, + {"name": "F", "units": "coulomb_per_mole", "component": "Membrane", "type": VariableType.CONSTANT}, + {"name": "V_sub", "units": "millimetre3", "component": "Cell_parameters", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "V_i", "units": "millimetre3", "component": "Cell_parameters", "type": VariableType.COMPUTED_CONSTANT}, {"name": "i_NaCa", "units": "nanoA", "component": "i_NaCa", "type": VariableType.ALGEBRAIC}, {"name": "i_NaK", "units": "nanoA", "component": "i_NaK", "type": VariableType.ALGEBRAIC}, {"name": "i_siNa", "units": "nanoA", "component": "i_CaL", "type": VariableType.ALGEBRAIC}, {"name": "i_fNa", "units": "nanoA", "component": "i_f", "type": VariableType.ALGEBRAIC}, - {"name": "F", "units": "coulomb_per_mole", "component": "Membrane", "type": VariableType.CONSTANT}, - {"name": "V_i", "units": "millimetre3", "component": "Cell_parameters", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "V_sub", "units": "millimetre3", "component": "Cell_parameters", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "i_Na", "units": "nanoA", "component": "i_Na", "type": VariableType.ALGEBRAIC}, + {"name": "Nai_clamp", "units": "dimensionless", "component": "Nai_concentration", "type": VariableType.CONSTANT}, {"name": "Iso_increase", "units": "dimensionless", "component": "i_NaK", "type": VariableType.COMPUTED_CONSTANT}, {"name": "V", "units": "millivolt", "component": "Membrane", "type": VariableType.ALGEBRAIC}, {"name": "Km_Nap", "units": "millimolar", "component": "i_NaK", "type": VariableType.CONSTANT}, {"name": "Km_Kp", "units": "millimolar", "component": "i_NaK", "type": VariableType.CONSTANT}, {"name": "i_NaK_max", "units": "nanoA", "component": "i_NaK", "type": VariableType.CONSTANT}, - {"name": "blockade_NaCa", "units": "dimensionless", "component": "i_NaCa", "type": VariableType.CONSTANT}, + {"name": "x4", "units": "dimensionless", "component": "i_NaCa", "type": VariableType.ALGEBRAIC}, + {"name": "x3", "units": "dimensionless", "component": "i_NaCa", "type": VariableType.ALGEBRAIC}, {"name": "x2", "units": "dimensionless", "component": "i_NaCa", "type": VariableType.ALGEBRAIC}, - {"name": "k21", "units": "dimensionless", "component": "i_NaCa", "type": VariableType.ALGEBRAIC}, {"name": "x1", "units": "dimensionless", "component": "i_NaCa", "type": VariableType.ALGEBRAIC}, {"name": "k12", "units": "dimensionless", "component": "i_NaCa", "type": VariableType.ALGEBRAIC}, + {"name": "k21", "units": "dimensionless", "component": "i_NaCa", "type": VariableType.ALGEBRAIC}, {"name": "K_NaCa", "units": "nanoA", "component": "i_NaCa", "type": VariableType.CONSTANT}, - {"name": "x4", "units": "dimensionless", "component": "i_NaCa", "type": VariableType.ALGEBRAIC}, - {"name": "x3", "units": "dimensionless", "component": "i_NaCa", "type": VariableType.ALGEBRAIC}, + {"name": "blockade_NaCa", "units": "dimensionless", "component": "i_NaCa", "type": VariableType.CONSTANT}, {"name": "k41", "units": "dimensionless", "component": "i_NaCa", "type": VariableType.ALGEBRAIC}, - {"name": "k23", "units": "dimensionless", "component": "i_NaCa", "type": VariableType.ALGEBRAIC}, - {"name": "k34", "units": "dimensionless", "component": "i_NaCa", "type": VariableType.COMPUTED_CONSTANT}, {"name": "k43", "units": "dimensionless", "component": "i_NaCa", "type": VariableType.ALGEBRAIC}, {"name": "k32", "units": "dimensionless", "component": "i_NaCa", "type": VariableType.ALGEBRAIC}, + {"name": "k23", "units": "dimensionless", "component": "i_NaCa", "type": VariableType.ALGEBRAIC}, + {"name": "k34", "units": "dimensionless", "component": "i_NaCa", "type": VariableType.COMPUTED_CONSTANT}, {"name": "k14", "units": "dimensionless", "component": "i_NaCa", "type": VariableType.ALGEBRAIC}, {"name": "K3ni", "units": "millimolar", "component": "i_NaCa", "type": VariableType.CONSTANT}, - {"name": "Kci", "units": "millimolar", "component": "i_NaCa", "type": VariableType.CONSTANT}, - {"name": "Qci", "units": "dimensionless", "component": "i_NaCa", "type": VariableType.CONSTANT}, {"name": "di", "units": "dimensionless", "component": "i_NaCa", "type": VariableType.ALGEBRAIC}, - {"name": "K1ni", "units": "millimolar", "component": "i_NaCa", "type": VariableType.CONSTANT}, - {"name": "K2ni", "units": "millimolar", "component": "i_NaCa", "type": VariableType.CONSTANT}, + {"name": "Qci", "units": "dimensionless", "component": "i_NaCa", "type": VariableType.CONSTANT}, + {"name": "Kci", "units": "millimolar", "component": "i_NaCa", "type": VariableType.CONSTANT}, {"name": "Qn", "units": "dimensionless", "component": "i_NaCa", "type": VariableType.CONSTANT}, + {"name": "K2ni", "units": "millimolar", "component": "i_NaCa", "type": VariableType.CONSTANT}, + {"name": "K1ni", "units": "millimolar", "component": "i_NaCa", "type": VariableType.CONSTANT}, {"name": "Kcni", "units": "millimolar", "component": "i_NaCa", "type": VariableType.CONSTANT}, {"name": "K3no", "units": "millimolar", "component": "i_NaCa", "type": VariableType.CONSTANT}, - {"name": "Kco", "units": "millimolar", "component": "i_NaCa", "type": VariableType.CONSTANT}, - {"name": "Qco", "units": "dimensionless", "component": "i_NaCa", "type": VariableType.CONSTANT}, {"name": "do", "units": "dimensionless", "component": "i_NaCa", "type": VariableType.ALGEBRAIC}, - {"name": "K1no", "units": "millimolar", "component": "i_NaCa", "type": VariableType.CONSTANT}, + {"name": "Qco", "units": "dimensionless", "component": "i_NaCa", "type": VariableType.CONSTANT}, + {"name": "Kco", "units": "millimolar", "component": "i_NaCa", "type": VariableType.CONSTANT}, {"name": "K2no", "units": "millimolar", "component": "i_NaCa", "type": VariableType.CONSTANT}, - {"name": "j_SRCarel", "units": "millimolar_per_second", "component": "Ca_SR_release", "type": VariableType.ALGEBRAIC}, + {"name": "K1no", "units": "millimolar", "component": "i_NaCa", "type": VariableType.CONSTANT}, {"name": "ks", "units": "per_second", "component": "Ca_SR_release", "type": VariableType.CONSTANT}, + {"name": "j_SRCarel", "units": "millimolar_per_second", "component": "Ca_SR_release", "type": VariableType.ALGEBRAIC}, {"name": "diff", "units": "millimolar", "component": "Ca_SR_release", "type": VariableType.ALGEBRAIC}, - {"name": "kCaSR", "units": "dimensionless", "component": "Ca_SR_release", "type": VariableType.ALGEBRAIC}, - {"name": "MaxSR", "units": "dimensionless", "component": "Ca_SR_release", "type": VariableType.CONSTANT}, - {"name": "MinSR", "units": "dimensionless", "component": "Ca_SR_release", "type": VariableType.CONSTANT}, - {"name": "EC50_SR", "units": "millimolar", "component": "Ca_SR_release", "type": VariableType.CONSTANT}, {"name": "HSR", "units": "dimensionless", "component": "Ca_SR_release", "type": VariableType.CONSTANT}, - {"name": "koSRCa", "units": "per_millimolar2_second", "component": "Ca_SR_release", "type": VariableType.ALGEBRAIC}, + {"name": "EC50_SR", "units": "millimolar", "component": "Ca_SR_release", "type": VariableType.CONSTANT}, + {"name": "MinSR", "units": "dimensionless", "component": "Ca_SR_release", "type": VariableType.CONSTANT}, + {"name": "MaxSR", "units": "dimensionless", "component": "Ca_SR_release", "type": VariableType.CONSTANT}, + {"name": "kCaSR", "units": "dimensionless", "component": "Ca_SR_release", "type": VariableType.ALGEBRAIC}, {"name": "koCa", "units": "per_millimolar2_second", "component": "Ca_SR_release", "type": VariableType.CONSTANT}, - {"name": "kiSRCa", "units": "per_millimolar_second", "component": "Ca_SR_release", "type": VariableType.ALGEBRAIC}, + {"name": "koSRCa", "units": "per_millimolar2_second", "component": "Ca_SR_release", "type": VariableType.ALGEBRAIC}, {"name": "kiCa", "units": "per_millimolar_second", "component": "Ca_SR_release", "type": VariableType.CONSTANT}, - {"name": "kim", "units": "per_second", "component": "Ca_SR_release", "type": VariableType.CONSTANT}, + {"name": "kiSRCa", "units": "per_millimolar_second", "component": "Ca_SR_release", "type": VariableType.ALGEBRAIC}, {"name": "kom", "units": "per_second", "component": "Ca_SR_release", "type": VariableType.CONSTANT}, + {"name": "kim", "units": "per_second", "component": "Ca_SR_release", "type": VariableType.CONSTANT}, {"name": "P_tot", "units": "dimensionless", "component": "Ca_SR_release", "type": VariableType.ALGEBRAIC}, {"name": "b_up", "units": "dimensionless", "component": "Ca_intracellular_fluxes", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "P_up", "units": "millimolar_per_second", "component": "Ca_intracellular_fluxes", "type": VariableType.COMPUTED_CONSTANT}, {"name": "P_up_basal", "units": "millimolar_per_second", "component": "Ca_intracellular_fluxes", "type": VariableType.CONSTANT}, - {"name": "j_Ca_dif", "units": "millimolar_per_second", "component": "Ca_intracellular_fluxes", "type": VariableType.ALGEBRAIC}, + {"name": "P_up", "units": "millimolar_per_second", "component": "Ca_intracellular_fluxes", "type": VariableType.COMPUTED_CONSTANT}, {"name": "tau_dif_Ca", "units": "second", "component": "Ca_intracellular_fluxes", "type": VariableType.CONSTANT}, - {"name": "j_up", "units": "millimolar_per_second", "component": "Ca_intracellular_fluxes", "type": VariableType.ALGEBRAIC}, - {"name": "K_up", "units": "millimolar", "component": "Ca_intracellular_fluxes", "type": VariableType.CONSTANT}, + {"name": "j_Ca_dif", "units": "millimolar_per_second", "component": "Ca_intracellular_fluxes", "type": VariableType.ALGEBRAIC}, {"name": "slope_up", "units": "millimolar", "component": "Ca_intracellular_fluxes", "type": VariableType.CONSTANT}, - {"name": "j_tr", "units": "millimolar_per_second", "component": "Ca_intracellular_fluxes", "type": VariableType.ALGEBRAIC}, + {"name": "K_up", "units": "millimolar", "component": "Ca_intracellular_fluxes", "type": VariableType.CONSTANT}, + {"name": "j_up", "units": "millimolar_per_second", "component": "Ca_intracellular_fluxes", "type": VariableType.ALGEBRAIC}, {"name": "tau_tr", "units": "second", "component": "Ca_intracellular_fluxes", "type": VariableType.CONSTANT}, + {"name": "j_tr", "units": "millimolar_per_second", "component": "Ca_intracellular_fluxes", "type": VariableType.ALGEBRAIC}, {"name": "delta_fTC", "units": "per_second", "component": "Ca_buffering", "type": VariableType.ALGEBRAIC}, - {"name": "kf_TC", "units": "per_millimolar_second", "component": "Ca_buffering", "type": VariableType.CONSTANT}, {"name": "kb_TC", "units": "per_second", "component": "Ca_buffering", "type": VariableType.CONSTANT}, + {"name": "kf_TC", "units": "per_millimolar_second", "component": "Ca_buffering", "type": VariableType.CONSTANT}, {"name": "delta_fTMC", "units": "per_second", "component": "Ca_buffering", "type": VariableType.ALGEBRAIC}, - {"name": "kf_TMC", "units": "per_millimolar_second", "component": "Ca_buffering", "type": VariableType.CONSTANT}, {"name": "kb_TMC", "units": "per_second", "component": "Ca_buffering", "type": VariableType.CONSTANT}, + {"name": "kf_TMC", "units": "per_millimolar_second", "component": "Ca_buffering", "type": VariableType.CONSTANT}, {"name": "delta_fTMM", "units": "per_second", "component": "Ca_buffering", "type": VariableType.ALGEBRAIC}, - {"name": "kf_TMM", "units": "per_millimolar_second", "component": "Ca_buffering", "type": VariableType.CONSTANT}, - {"name": "Mgi", "units": "millimolar", "component": "Ca_buffering", "type": VariableType.CONSTANT}, {"name": "kb_TMM", "units": "per_second", "component": "Ca_buffering", "type": VariableType.CONSTANT}, + {"name": "Mgi", "units": "millimolar", "component": "Ca_buffering", "type": VariableType.CONSTANT}, + {"name": "kf_TMM", "units": "per_millimolar_second", "component": "Ca_buffering", "type": VariableType.CONSTANT}, {"name": "delta_fCMi", "units": "per_second", "component": "Ca_buffering", "type": VariableType.ALGEBRAIC}, - {"name": "kf_CM", "units": "per_millimolar_second", "component": "Ca_buffering", "type": VariableType.CONSTANT}, {"name": "kb_CM", "units": "per_second", "component": "Ca_buffering", "type": VariableType.CONSTANT}, + {"name": "kf_CM", "units": "per_millimolar_second", "component": "Ca_buffering", "type": VariableType.CONSTANT}, {"name": "delta_fCMs", "units": "per_second", "component": "Ca_buffering", "type": VariableType.ALGEBRAIC}, {"name": "delta_fCQ", "units": "per_second", "component": "Ca_buffering", "type": VariableType.ALGEBRAIC}, - {"name": "kf_CQ", "units": "per_millimolar_second", "component": "Ca_buffering", "type": VariableType.CONSTANT}, {"name": "kb_CQ", "units": "per_second", "component": "Ca_buffering", "type": VariableType.CONSTANT}, + {"name": "kf_CQ", "units": "per_millimolar_second", "component": "Ca_buffering", "type": VariableType.CONSTANT}, {"name": "TC_tot", "units": "millimolar", "component": "Ca_buffering", "type": VariableType.CONSTANT}, {"name": "TMC_tot", "units": "millimolar", "component": "Ca_buffering", "type": VariableType.CONSTANT}, {"name": "CM_tot", "units": "millimolar", "component": "Ca_buffering", "type": VariableType.CONSTANT}, {"name": "CQ_tot", "units": "millimolar", "component": "Ca_buffering", "type": VariableType.CONSTANT}, {"name": "V_nsr", "units": "millimetre3", "component": "Cell_parameters", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "V_jsr", "units": "millimetre3", "component": "Cell_parameters", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "i_siCa", "units": "nanoA", "component": "i_CaL", "type": VariableType.ALGEBRAIC}, {"name": "i_CaT", "units": "nanoA", "component": "i_CaT", "type": VariableType.ALGEBRAIC}, - {"name": "V_cell", "units": "millimetre3", "component": "Cell_parameters", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "i_siCa", "units": "nanoA", "component": "i_CaL", "type": VariableType.ALGEBRAIC}, + {"name": "V_jsr", "units": "millimetre3", "component": "Cell_parameters", "type": VariableType.COMPUTED_CONSTANT}, {"name": "L_cell", "units": "micrometre", "component": "Cell_parameters", "type": VariableType.CONSTANT}, {"name": "R_cell", "units": "micrometre", "component": "Cell_parameters", "type": VariableType.CONSTANT}, + {"name": "V_cell", "units": "millimetre3", "component": "Cell_parameters", "type": VariableType.COMPUTED_CONSTANT}, {"name": "L_sub", "units": "micrometre", "component": "Cell_parameters", "type": VariableType.CONSTANT}, {"name": "V_jsr_part", "units": "dimensionless", "component": "Cell_parameters", "type": VariableType.CONSTANT}, {"name": "V_i_part", "units": "dimensionless", "component": "Cell_parameters", "type": VariableType.CONSTANT}, {"name": "V_nsr_part", "units": "dimensionless", "component": "Cell_parameters", "type": VariableType.CONSTANT}, - {"name": "i_tot", "units": "nanoA", "component": "Membrane", "type": VariableType.ALGEBRAIC}, - {"name": "i_f", "units": "nanoA", "component": "i_f", "type": VariableType.ALGEBRAIC}, {"name": "i_Kur", "units": "nanoA", "component": "i_Kur", "type": VariableType.ALGEBRAIC}, {"name": "i_KACh", "units": "nanoA", "component": "i_KACh", "type": VariableType.ALGEBRAIC}, {"name": "i_CaL", "units": "nanoA", "component": "i_CaL", "type": VariableType.ALGEBRAIC}, {"name": "i_to", "units": "nanoA", "component": "i_to", "type": VariableType.ALGEBRAIC}, {"name": "i_Ks", "units": "nanoA", "component": "i_Ks", "type": VariableType.ALGEBRAIC}, {"name": "i_Kr", "units": "nanoA", "component": "i_Kr", "type": VariableType.ALGEBRAIC}, + {"name": "i_f", "units": "nanoA", "component": "i_f", "type": VariableType.ALGEBRAIC}, + {"name": "i_tot", "units": "nanoA", "component": "Membrane", "type": VariableType.ALGEBRAIC}, {"name": "C", "units": "microF", "component": "Membrane", "type": VariableType.CONSTANT}, - {"name": "R", "units": "joule_per_kilomole_kelvin", "component": "Membrane", "type": VariableType.CONSTANT}, {"name": "T", "units": "kelvin", "component": "Membrane", "type": VariableType.CONSTANT}, + {"name": "R", "units": "joule_per_kilomole_kelvin", "component": "Membrane", "type": VariableType.CONSTANT}, {"name": "V_clamp", "units": "millivolt", "component": "Voltage_clamp", "type": VariableType.ALGEBRAIC}, {"name": "clamp_mode", "units": "dimensionless", "component": "Membrane", "type": VariableType.CONSTANT}, {"name": "V_test", "units": "millivolt", "component": "Voltage_clamp", "type": VariableType.CONSTANT}, - {"name": "t_holding", "units": "second", "component": "Voltage_clamp", "type": VariableType.CONSTANT}, {"name": "t_test", "units": "second", "component": "Voltage_clamp", "type": VariableType.CONSTANT}, + {"name": "t_holding", "units": "second", "component": "Voltage_clamp", "type": VariableType.CONSTANT}, {"name": "V_holding", "units": "millivolt", "component": "Voltage_clamp", "type": VariableType.CONSTANT}, - {"name": "G_f", "units": "microS", "component": "i_f", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "g_f", "units": "microS", "component": "i_f", "type": VariableType.CONSTANT}, {"name": "Km_f", "units": "millimolar", "component": "i_f", "type": VariableType.CONSTANT}, - {"name": "G_f_K", "units": "microS", "component": "i_f", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "g_f", "units": "microS", "component": "i_f", "type": VariableType.CONSTANT}, + {"name": "G_f", "units": "microS", "component": "i_f", "type": VariableType.COMPUTED_CONSTANT}, {"name": "alpha", "units": "dimensionless", "component": "i_f", "type": VariableType.CONSTANT}, + {"name": "G_f_K", "units": "microS", "component": "i_f", "type": VariableType.COMPUTED_CONSTANT}, {"name": "G_f_Na", "units": "microS", "component": "i_f", "type": VariableType.COMPUTED_CONSTANT}, {"name": "g_f_Na", "units": "microS", "component": "i_f", "type": VariableType.COMPUTED_CONSTANT}, {"name": "g_f_K", "units": "microS", "component": "i_f", "type": VariableType.COMPUTED_CONSTANT}, @@ -198,17 +198,17 @@ class VariableType(Enum): {"name": "ACh_shift", "units": "millivolt", "component": "i_f_y_gate", "type": VariableType.COMPUTED_CONSTANT}, {"name": "Iso_shift", "units": "millivolt", "component": "i_f_y_gate", "type": VariableType.COMPUTED_CONSTANT}, {"name": "tau_y", "units": "second", "component": "i_f_y_gate", "type": VariableType.ALGEBRAIC}, - {"name": "y_infinity", "units": "dimensionless", "component": "i_f_y_gate", "type": VariableType.ALGEBRAIC}, {"name": "y_shift", "units": "millivolt", "component": "i_f_y_gate", "type": VariableType.CONSTANT}, + {"name": "y_infinity", "units": "dimensionless", "component": "i_f_y_gate", "type": VariableType.ALGEBRAIC}, {"name": "E_mh", "units": "millivolt", "component": "i_Na", "type": VariableType.ALGEBRAIC}, - {"name": "i_Na_", "units": "nanoA", "component": "i_Na", "type": VariableType.ALGEBRAIC}, {"name": "g_Na", "units": "microS", "component": "i_Na", "type": VariableType.CONSTANT}, - {"name": "i_Na_L", "units": "nanoA", "component": "i_Na", "type": VariableType.ALGEBRAIC}, + {"name": "i_Na_", "units": "nanoA", "component": "i_Na", "type": VariableType.ALGEBRAIC}, {"name": "g_Na_L", "units": "microS", "component": "i_Na", "type": VariableType.CONSTANT}, + {"name": "i_Na_L", "units": "nanoA", "component": "i_Na", "type": VariableType.ALGEBRAIC}, {"name": "m_infinity", "units": "dimensionless", "component": "i_Na_m_gate", "type": VariableType.ALGEBRAIC}, {"name": "E0_m", "units": "millivolt", "component": "i_Na_m_gate", "type": VariableType.ALGEBRAIC}, - {"name": "alpha_m", "units": "per_second", "component": "i_Na_m_gate", "type": VariableType.ALGEBRAIC}, {"name": "delta_m", "units": "millivolt", "component": "i_Na_m_gate", "type": VariableType.CONSTANT}, + {"name": "alpha_m", "units": "per_second", "component": "i_Na_m_gate", "type": VariableType.ALGEBRAIC}, {"name": "beta_m", "units": "per_second", "component": "i_Na_m_gate", "type": VariableType.ALGEBRAIC}, {"name": "tau_m", "units": "second", "component": "i_Na_m_gate", "type": VariableType.ALGEBRAIC}, {"name": "h_infinity", "units": "dimensionless", "component": "i_Na_h_gate", "type": VariableType.ALGEBRAIC}, @@ -216,38 +216,38 @@ class VariableType(Enum): {"name": "beta_h", "units": "per_second", "component": "i_Na_h_gate", "type": VariableType.ALGEBRAIC}, {"name": "tau_h", "units": "second", "component": "i_Na_h_gate", "type": VariableType.ALGEBRAIC}, {"name": "g_Kur", "units": "microS", "component": "i_Kur", "type": VariableType.CONSTANT}, - {"name": "r_Kur_infinity", "units": "dimensionless", "component": "i_Kur_rKur_gate", "type": VariableType.ALGEBRAIC}, {"name": "tau_r_Kur", "units": "second", "component": "i_Kur_rKur_gate", "type": VariableType.ALGEBRAIC}, - {"name": "s_Kur_infinity", "units": "dimensionless", "component": "i_Kur_sKur_gate", "type": VariableType.ALGEBRAIC}, + {"name": "r_Kur_infinity", "units": "dimensionless", "component": "i_Kur_rKur_gate", "type": VariableType.ALGEBRAIC}, {"name": "tau_s_Kur", "units": "second", "component": "i_Kur_sKur_gate", "type": VariableType.ALGEBRAIC}, + {"name": "s_Kur_infinity", "units": "dimensionless", "component": "i_Kur_sKur_gate", "type": VariableType.ALGEBRAIC}, {"name": "Iso_increase", "units": "dimensionless", "component": "i_CaL", "type": VariableType.COMPUTED_CONSTANT}, {"name": "P_CaL", "units": "nanoA_per_millimolar", "component": "i_CaL", "type": VariableType.CONSTANT}, {"name": "i_siK", "units": "nanoA", "component": "i_CaL", "type": VariableType.ALGEBRAIC}, {"name": "ACh_block", "units": "dimensionless", "component": "i_CaL", "type": VariableType.COMPUTED_CONSTANT}, {"name": "Iso_shift_dL", "units": "millivolt", "component": "i_CaL_dL_gate", "type": VariableType.COMPUTED_CONSTANT}, {"name": "Iso_slope_dL", "units": "dimensionless", "component": "i_CaL_dL_gate", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "dL_infinity", "units": "dimensionless", "component": "i_CaL_dL_gate", "type": VariableType.ALGEBRAIC}, - {"name": "V_dL", "units": "millivolt", "component": "i_CaL_dL_gate", "type": VariableType.CONSTANT}, {"name": "k_dL", "units": "millivolt", "component": "i_CaL_dL_gate", "type": VariableType.CONSTANT}, - {"name": "tau_dL", "units": "second", "component": "i_CaL_dL_gate", "type": VariableType.ALGEBRAIC}, - {"name": "alpha_dL", "units": "per_second", "component": "i_CaL_dL_gate", "type": VariableType.ALGEBRAIC}, + {"name": "V_dL", "units": "millivolt", "component": "i_CaL_dL_gate", "type": VariableType.CONSTANT}, + {"name": "dL_infinity", "units": "dimensionless", "component": "i_CaL_dL_gate", "type": VariableType.ALGEBRAIC}, {"name": "beta_dL", "units": "per_second", "component": "i_CaL_dL_gate", "type": VariableType.ALGEBRAIC}, + {"name": "alpha_dL", "units": "per_second", "component": "i_CaL_dL_gate", "type": VariableType.ALGEBRAIC}, + {"name": "tau_dL", "units": "second", "component": "i_CaL_dL_gate", "type": VariableType.ALGEBRAIC}, {"name": "adVm", "units": "millivolt", "component": "i_CaL_dL_gate", "type": VariableType.ALGEBRAIC}, {"name": "bdVm", "units": "millivolt", "component": "i_CaL_dL_gate", "type": VariableType.ALGEBRAIC}, - {"name": "fL_infinity", "units": "dimensionless", "component": "i_CaL_fL_gate", "type": VariableType.ALGEBRAIC}, - {"name": "shift_fL", "units": "millivolt", "component": "i_CaL_fL_gate", "type": VariableType.CONSTANT}, {"name": "k_fL", "units": "millivolt", "component": "i_CaL_fL_gate", "type": VariableType.CONSTANT}, + {"name": "shift_fL", "units": "millivolt", "component": "i_CaL_fL_gate", "type": VariableType.CONSTANT}, + {"name": "fL_infinity", "units": "dimensionless", "component": "i_CaL_fL_gate", "type": VariableType.ALGEBRAIC}, {"name": "tau_fL", "units": "second", "component": "i_CaL_fL_gate", "type": VariableType.ALGEBRAIC}, - {"name": "fCa_infinity", "units": "dimensionless", "component": "i_CaL_fCa_gate", "type": VariableType.ALGEBRAIC}, {"name": "Km_fCa", "units": "millimolar", "component": "i_CaL_fCa_gate", "type": VariableType.CONSTANT}, - {"name": "tau_fCa", "units": "second", "component": "i_CaL_fCa_gate", "type": VariableType.ALGEBRAIC}, + {"name": "fCa_infinity", "units": "dimensionless", "component": "i_CaL_fCa_gate", "type": VariableType.ALGEBRAIC}, {"name": "alpha_fCa", "units": "per_second", "component": "i_CaL_fCa_gate", "type": VariableType.CONSTANT}, + {"name": "tau_fCa", "units": "second", "component": "i_CaL_fCa_gate", "type": VariableType.ALGEBRAIC}, {"name": "P_CaT", "units": "nanoA_per_millimolar", "component": "i_CaT", "type": VariableType.CONSTANT}, {"name": "dT_infinity", "units": "dimensionless", "component": "i_CaT_dT_gate", "type": VariableType.ALGEBRAIC}, {"name": "tau_dT", "units": "second", "component": "i_CaT_dT_gate", "type": VariableType.ALGEBRAIC}, {"name": "fT_infinity", "units": "dimensionless", "component": "i_CaT_fT_gate", "type": VariableType.ALGEBRAIC}, - {"name": "tau_fT", "units": "second", "component": "i_CaT_fT_gate", "type": VariableType.ALGEBRAIC}, {"name": "offset_fT", "units": "second", "component": "i_CaT_fT_gate", "type": VariableType.CONSTANT}, + {"name": "tau_fT", "units": "second", "component": "i_CaT_fT_gate", "type": VariableType.ALGEBRAIC}, {"name": "g_to", "units": "microS", "component": "i_to", "type": VariableType.CONSTANT}, {"name": "q_infinity", "units": "dimensionless", "component": "i_to_q_gate", "type": VariableType.ALGEBRAIC}, {"name": "tau_q", "units": "second", "component": "i_to_q_gate", "type": VariableType.ALGEBRAIC}, @@ -261,16 +261,16 @@ class VariableType(Enum): {"name": "tau_paF", "units": "second", "component": "i_Kr_pa_gate", "type": VariableType.ALGEBRAIC}, {"name": "tau_pi", "units": "second", "component": "i_Kr_pi_gate", "type": VariableType.ALGEBRAIC}, {"name": "pi_infinity", "units": "dimensionless", "component": "i_Kr_pi_gate", "type": VariableType.ALGEBRAIC}, - {"name": "g_Ks", "units": "microS", "component": "i_Ks", "type": VariableType.COMPUTED_CONSTANT}, {"name": "g_Ks_", "units": "microS", "component": "i_Ks", "type": VariableType.CONSTANT}, + {"name": "g_Ks", "units": "microS", "component": "i_Ks", "type": VariableType.COMPUTED_CONSTANT}, {"name": "E_Ks", "units": "millivolt", "component": "i_Ks", "type": VariableType.ALGEBRAIC}, {"name": "Iso_shift", "units": "millivolt", "component": "i_Ks_n_gate", "type": VariableType.COMPUTED_CONSTANT}, {"name": "n_infinity", "units": "dimensionless", "component": "i_Ks_n_gate", "type": VariableType.ALGEBRAIC}, - {"name": "tau_n", "units": "second", "component": "i_Ks_n_gate", "type": VariableType.ALGEBRAIC}, - {"name": "alpha_n", "units": "per_second", "component": "i_Ks_n_gate", "type": VariableType.ALGEBRAIC}, {"name": "beta_n", "units": "per_second", "component": "i_Ks_n_gate", "type": VariableType.ALGEBRAIC}, - {"name": "ACh_on", "units": "dimensionless", "component": "i_KACh", "type": VariableType.CONSTANT}, + {"name": "alpha_n", "units": "per_second", "component": "i_Ks_n_gate", "type": VariableType.ALGEBRAIC}, + {"name": "tau_n", "units": "second", "component": "i_Ks_n_gate", "type": VariableType.ALGEBRAIC}, {"name": "g_KACh", "units": "microS", "component": "i_KACh", "type": VariableType.CONSTANT}, + {"name": "ACh_on", "units": "dimensionless", "component": "i_KACh", "type": VariableType.CONSTANT}, {"name": "alpha_a", "units": "per_second", "component": "i_KACh_a_gate", "type": VariableType.COMPUTED_CONSTANT}, {"name": "beta_a", "units": "per_second", "component": "i_KACh_a_gate", "type": VariableType.ALGEBRAIC}, {"name": "a_infinity", "units": "dimensionless", "component": "i_KACh_a_gate", "type": VariableType.ALGEBRAIC}, @@ -309,95 +309,95 @@ def create_variables_array(): def initialise_variables(states, rates, variables): variables[0] = 0.0 variables[1] = 0.0 - variables[4] = 140.0 + variables[3] = 140.0 + variables[6] = 140.0 variables[7] = 5.4 - variables[8] = 140.0 - variables[10] = 1.8 - variables[11] = 1.0 - variables[17] = 96485.3415 + variables[9] = 1.8 + variables[11] = 96485.3415 + variables[19] = 1.0 variables[22] = 14.0 variables[23] = 1.4 variables[24] = 0.08105 - variables[25] = 0.0 - variables[30] = 3.343 + variables[31] = 3.343 + variables[32] = 0.0 variables[39] = 26.44 - variables[40] = 0.0207 variables[41] = 0.1369 - variables[43] = 395.3 + variables[42] = 0.0207 + variables[43] = 0.4315 variables[44] = 2.289 - variables[45] = 0.4315 + variables[45] = 395.3 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[50] = 3.663 + variables[51] = 561.4 + variables[52] = 1628.0 + variables[53] = 148041085.1 + variables[56] = 2.5 + variables[57] = 0.45 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[59] = 15.0 + variables[61] = 10000.0 + variables[63] = 500.0 + variables[65] = 660.0 + variables[66] = 5.0 + variables[69] = 5.0 + variables[71] = 5.469e-5 + variables[73] = 5.0e-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[76] = 0.04 + variables[79] = 446.0 + variables[80] = 88800.0 + variables[82] = 7.51 + variables[83] = 227700.0 + variables[85] = 751.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[87] = 2277.0 + variables[89] = 542.0 + variables[90] = 1.642e6 + variables[93] = 445.0 + variables[94] = 175.4 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[103] = 67.0 + variables[104] = 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[119] = 310.0 + variables[120] = 8314.472 variables[122] = 0.0 variables[123] = -35.0 variables[124] = 0.5 variables[125] = 0.5 variables[126] = -45.0 + variables[127] = 45.0 variables[128] = 0.00427 - variables[129] = 45.0 - variables[131] = 0.5927 + variables[130] = 0.5927 variables[135] = 0.0 - variables[141] = 0.0 - variables[144] = 0.0223 - variables[146] = 0.0 - variables[150] = 1.0e-5 + variables[140] = 0.0 + variables[143] = 0.0223 + variables[145] = 0.0 + variables[149] = 1.0e-5 variables[157] = 0.1539e-3 variables[163] = 0.4578 + variables[168] = 4.3371 variables[169] = -16.4508 - variables[170] = 4.3371 + variables[176] = 0.0 variables[177] = 0.0 - variables[178] = 0.0 - variables[181] = 0.000338 - variables[183] = 0.0075 + variables[180] = 0.000338 + variables[182] = 0.0075 variables[184] = 0.04132 - variables[189] = 0.0 + variables[188] = 0.0 variables[190] = 3.5e-3 variables[195] = 0.00424 - variables[204] = 0.00065 - variables[211] = 1.0 - variables[212] = 0.00345 + variables[203] = 0.00065 + variables[211] = 0.00345 + variables[212] = 1.0 states[0] = 6.226104e-5 states[1] = 5.0 states[2] = 0.409551 @@ -427,255 +427,255 @@ def initialise_variables(states, rates, variables): states[26] = 0.014523 states[27] = 0.430836 states[28] = 0.709051 - states[29] = 0.011068 - states[30] = 0.283185 + states[29] = 0.283185 + states[30] = 0.011068 states[31] = 0.1162 states[32] = 0.00277 def compute_computed_constants(variables): - variables[3] = variables[119]*variables[120]/variables[17] - variables[6] = variables[3]*log(variables[7]/variables[8]) + variables[4] = variables[120]*variables[119]/variables[11] + variables[8] = variables[4]*log(variables[7]/variables[6]) variables[20] = 1.2 if gt_func(variables[1], 0.0) else 1.0 - variables[35] = variables[4]/(variables[47]+variables[4]) + variables[37] = variables[3]/(variables[47]+variables[3]) 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[70] = variables[69]*(1.0-variables[68]) + variables[105] = 0.000000001*3.14159265358979*pow(variables[104], 2.0)*variables[103] + variables[12] = 0.000000001*2.0*3.14159265358979*variables[106]*(variables[104]-variables[106]/2.0)*variables[103] + variables[102] = variables[107]*variables[105] + variables[13] = variables[108]*variables[105]-variables[12] + variables[99] = variables[109]*variables[105] + variables[129] = variables[128]/(variables[7]/(variables[7]+variables[127])) + variables[131] = variables[129]/(variables[130]+1.0) + variables[132] = variables[130]*variables[131] + variables[133] = variables[132]*variables[7]/(variables[7]+variables[127]) + variables[134] = variables[131]*variables[7]/(variables[7]+variables[127]) 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[204] = 1.2*variables[203] if gt_func(variables[1], 0.0) else variables[203] 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 def compute_rates(voi, states, rates, variables): - 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[2] = states[1] + variables[121] = variables[123] if and_func(gt_func(voi, variables[125]), lt_func(voi, variables[125]+variables[124])) 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] + variables[16] = 0.0000185*variables[163]*(variables[21]-0.0)/(variables[4]*(1.0-exp(-1.0*(variables[21]-0.0)/variables[4])))*(variables[2]-variables[3]*exp(-1.0*(variables[21]-0.0)/variables[4]))*states[23]*states[22]*states[21] + variables[5] = variables[4]*log(variables[3]/variables[2]) + variables[17] = states[16]*variables[133]*(variables[21]-variables[5])*(1.0-variables[135]) + variables[142] = variables[4]*log((variables[3]+0.12*variables[7])/(variables[2]+0.12*variables[6])) + variables[146] = variables[145]*pow(states[18], 3.0)*(variables[21]-variables[142]) + variables[144] = variables[143]*pow(states[18], 3.0)*states[17]*(variables[21]-variables[142]) + variables[18] = variables[144]+variables[146] + variables[15] = variables[20]*variables[24]*pow(1.0+pow(variables[23]/variables[7], 1.2), -1.0)*pow(1.0+pow(variables[22]/variables[2], 1.3), -1.0)*pow(1.0+exp(-(variables[21]-variables[5]+110.0)/20.0), -1.0) + variables[40] = 1.0+states[0]/variables[42]*(1.0+exp(-variables[41]*variables[21]/variables[4])+variables[2]/variables[46])+variables[2]/variables[45]*(1.0+variables[2]/variables[44]*(1.0+variables[2]/variables[39])) + variables[29] = states[0]/variables[42]*exp(-variables[41]*variables[21]/variables[4])/variables[40] + variables[48] = 1.0+variables[9]/variables[50]*(1.0+exp(variables[49]*variables[21]/variables[4]))+variables[3]/variables[52]*(1.0+variables[3]/variables[51]*(1.0+variables[3]/variables[47])) + variables[30] = variables[9]/variables[50]*exp(variables[49]*variables[21]/variables[4])/variables[48] + variables[35] = exp(variables[43]*variables[21]/(2.0*variables[4])) + variables[38] = variables[2]/variables[45]*variables[2]/variables[44]*(1.0+variables[2]/variables[39])*exp(variables[43]*variables[21]/(2.0*variables[4]))/variables[40] + variables[36] = variables[3]/variables[52]*variables[3]/variables[51]*(1.0+variables[3]/variables[47])*exp(-variables[43]*variables[21]/(2.0*variables[4]))/variables[48] + variables[25] = variables[36]*variables[37]*(variables[38]+variables[29])+variables[38]*variables[30]*(variables[37]+variables[35]) + variables[34] = variables[2]/(variables[39]+variables[2]) + variables[33] = exp(-variables[43]*variables[21]/(2.0*variables[4])) + variables[26] = variables[38]*variables[34]*(variables[36]+variables[30])+variables[29]*variables[36]*(variables[34]+variables[33]) + variables[27] = variables[35]*variables[34]*(variables[38]+variables[29])+variables[33]*variables[29]*(variables[37]+variables[35]) + variables[28] = variables[33]*variables[37]*(variables[36]+variables[30])+variables[30]*variables[35]*(variables[34]+variables[33]) + variables[14] = (1.0-variables[32])*variables[31]*(variables[27]*variables[30]-variables[28]*variables[29])/(variables[28]+variables[27]+variables[26]+variables[25]) + rates[1] = (1.0-variables[19])*-1.0*(variables[18]+variables[17]+variables[16]+3.0*variables[15]+3.0*variables[14])/(1.0*(variables[13]+variables[12])*variables[11]) + variables[60] = variables[59]-(variables[59]-variables[58])/(1.0+pow(variables[57]/states[2], variables[56])) + variables[62] = variables[61]/variables[60] + variables[64] = variables[63]*variables[60] + rates[4] = variables[66]*states[5]-variables[64]*states[0]*states[4]-(variables[62]*pow(states[0], 2.0)*states[4]-variables[65]*states[3]) + rates[3] = variables[62]*pow(states[0], 2.0)*states[4]-variables[65]*states[3]-(variables[64]*states[0]*states[3]-variables[66]*states[6]) + rates[6] = variables[64]*states[0]*states[3]-variables[66]*states[6]-(variables[65]*states[6]-variables[62]*pow(states[0], 2.0)*states[5]) + rates[5] = variables[65]*states[6]-variables[62]*pow(states[0], 2.0)*states[5]-(variables[66]*states[5]-variables[64]*states[0]*states[4]) + variables[78] = variables[80]*states[7]*(1.0-states[9])-variables[79]*states[9] rates[9] = variables[78] - variables[81] = variables[82]*states[7]*(1.0-(states[10]+states[11]))-variables[83]*states[10] + variables[81] = variables[83]*states[7]*(1.0-(states[10]+states[11]))-variables[82]*states[10] rates[10] = variables[81] - variables[84] = variables[85]*variables[86]*(1.0-(states[10]+states[11]))-variables[87]*states[11] + variables[84] = variables[87]*variables[86]*(1.0-(states[10]+states[11]))-variables[85]*states[11] rates[11] = variables[84] - variables[88] = variables[89]*states[7]*(1.0-states[12])-variables[90]*states[12] + variables[88] = variables[90]*states[7]*(1.0-states[12])-variables[89]*states[12] rates[12] = variables[88] - variables[91] = variables[89]*states[0]*(1.0-states[13])-variables[90]*states[13] + variables[91] = variables[90]*states[0]*(1.0-states[13])-variables[89]*states[13] rates[13] = variables[91] - variables[92] = variables[93]*states[2]*(1.0-states[14])-variables[94]*states[14] + variables[92] = variables[94]*states[2]*(1.0-states[14])-variables[93]*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[75] = variables[70]/(1.0+exp((-states[7]+variables[74])/variables[73])) + variables[72] = (states[0]-states[7])/variables[71] + rates[7] = 1.0*(variables[72]*variables[12]-variables[75]*variables[99])/variables[13]-(variables[97]*variables[88]+variables[95]*variables[78]+variables[96]*variables[81]) + variables[54] = variables[53]*states[3]*(states[2]-states[0]) + variables[100] = 2.0*variables[184]*variables[21]/(variables[4]*(1.0-exp(-1.0*variables[21]*2.0/variables[4])))*(states[0]-variables[9]*exp(-2.0*variables[21]/variables[4]))*states[25]*states[24] + variables[101] = 2.0*variables[163]*(variables[21]-0.0)/(variables[4]*(1.0-exp(-1.0*(variables[21]-0.0)*2.0/variables[4])))*(states[0]-variables[9]*exp(-2.0*(variables[21]-0.0)/variables[4]))*states[23]*states[22]*states[21] + rates[0] = variables[54]*variables[102]/variables[12]-((variables[101]+variables[100]-2.0*variables[14])/(2.0*variables[11]*variables[12])+variables[72]+variables[97]*variables[91]) + variables[77] = (states[8]-states[2])/variables[76] + rates[8] = variables[75]-variables[77]*variables[102]/variables[99] + rates[2] = variables[77]-(variables[54]+variables[98]*variables[92]) + variables[110] = variables[157]*states[20]*states[19]*(variables[21]-variables[8]) + variables[111] = variables[212]*variables[211]*(variables[21]-variables[8])*(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[4]*(1.0-exp(-1.0*(variables[21]-0.0)/variables[4])))*(variables[6]-variables[7]*exp(-1.0*(variables[21]-0.0)/variables[4]))*states[23]*states[22]*states[21] + variables[112] = (variables[101]+variables[164]+variables[16])*(1.0-variables[165])*1.0*variables[162] + variables[113] = variables[190]*(variables[21]-variables[8])*states[27]*states[26] + variables[205] = variables[4]*log((variables[7]+0.12*variables[3])/(variables[6]+0.12*variables[2])) + variables[114] = variables[204]*(variables[21]-variables[205])*pow(states[31], 2.0) + variables[115] = variables[195]*(variables[21]-variables[8])*(0.9*states[30]+0.1*states[29])*states[28] + variables[136] = states[16]*variables[134]*(variables[21]-variables[8])*(1.0-variables[135]) + variables[116] = variables[17]+variables[136] + variables[117] = variables[116]+variables[115]+variables[114]+variables[113]+variables[15]+variables[14]+variables[18]+variables[112]+variables[100]+variables[111]+variables[110] + rates[15] = -variables[117]/variables[118] 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[141] = 0.01329+0.99921/(1.0+exp((variables[21]+97.134-variables[137]-variables[138]-variables[140])/8.1752)) if lt_func(variables[21], -(80.0-variables[137]-variables[138]-variables[140])) else 0.0002501*exp(-(variables[21]-variables[137]-variables[138]-variables[140])/12.861) + rates[16] = (variables[141]-states[16])/variables[139] variables[151] = 8000.0*exp(-0.056*(variables[21]+66.0)) - variables[152] = 1.0/(variables[149]+variables[151]) + variables[148] = variables[21]+41.0 + variables[150] = 2000.0 if lt_func(fabs(variables[148]), variables[149]) else 200.0*variables[148]/(1.0-exp(-0.1*variables[148])) + variables[152] = 1.0/(variables[150]+variables[151]) + variables[147] = 1.0/(1.0+exp(-(variables[21]+42.0504)/8.3106)) 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[154] = 20.0*exp(-0.125*(variables[21]+75.0)) variables[156] = 1.0/(variables[154]+variables[155]) + variables[153] = 1.0/(1.0+exp((variables[21]+69.804)/4.4565)) 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[158] = 0.009/(1.0+exp((variables[21]+5.0)/12.0))+0.0005 + variables[159] = 1.0/(1.0+exp((variables[21]+6.0)/-8.6)) + rates[20] = (variables[159]-states[20])/variables[158] + variables[160] = 0.59/(1.0+exp((variables[21]+60.0)/10.0))+3.05 + variables[161] = 1.0/(1.0+exp((variables[21]+7.5)/10.0)) + rates[19] = (variables[161]-states[19])/variables[160] + variables[170] = 1.0/(1.0+exp(-(variables[21]-variables[169]-variables[166])/(variables[168]*(1.0+variables[167]/100.0)))) + variables[175] = -1.80001 if eq_func(variables[21], -1.8) else variables[21] + variables[171] = 0.01143*(variables[175]+1.8)/(exp((variables[175]+1.8)/2.5)-1.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[173] = 0.001/(variables[172]+variables[171]) + rates[23] = (variables[170]-states[23])/variables[173] 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[178] = 1.0/(1.0+exp((variables[21]+37.4+variables[177])/(5.3+variables[176]))) + rates[22] = (variables[178]-states[22])/variables[179] + variables[181] = variables[180]/(variables[180]+states[0]) + variables[183] = 0.001*variables[181]/variables[182] + rates[21] = (variables[181]-states[21])/variables[183] variables[186] = 0.001/(1.068*exp((variables[21]+38.3)/30.0)+1.068*exp(-(variables[21]+38.3)/30.0)) + variables[185] = 1.0/(1.0+exp(-(variables[21]+38.3)/5.5)) rates[25] = (variables[185]-states[25])/variables[186] + variables[189] = 1.0/(16.67*exp(-(variables[21]+75.0)/83.3)+16.67*exp((variables[21]+75.0)/15.38))+variables[188] 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)) + rates[24] = (variables[187]-states[24])/variables[189] 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[191] = 1.0/(1.0+exp((variables[21]+49.0)/13.0)) 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) + variables[193] = 1.0/(1.0+exp(-(variables[21]-19.3)/15.0)) 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[198] = 1.0/(1.0+exp(-(variables[21]+10.0144)/7.6607)) + rates[29] = (variables[198]-states[29])/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)) + rates[30] = (variables[198]-states[30])/variables[200] 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)) 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[208] = 1.0*exp(-(variables[21]-variables[206]-5.0)/25.0) 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[210] = 1.0/(variables[209]+variables[208]) + rates[31] = (variables[207]-states[31])/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]) + variables[215] = variables[213]/(variables[213]+variables[214]) rates[32] = (variables[215]-states[32])/variables[216] def compute_variables(voi, states, rates, variables): - 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[2] = states[1] + variables[5] = variables[4]*log(variables[3]/variables[2]) + variables[10] = 0.5*variables[4]*log(variables[9]/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[15] = variables[20]*variables[24]*pow(1.0+pow(variables[23]/variables[7], 1.2), -1.0)*pow(1.0+pow(variables[22]/variables[2], 1.3), -1.0)*pow(1.0+exp(-(variables[21]-variables[5]+110.0)/20.0), -1.0) + variables[40] = 1.0+states[0]/variables[42]*(1.0+exp(-variables[41]*variables[21]/variables[4])+variables[2]/variables[46])+variables[2]/variables[45]*(1.0+variables[2]/variables[44]*(1.0+variables[2]/variables[39])) + variables[29] = states[0]/variables[42]*exp(-variables[41]*variables[21]/variables[4])/variables[40] + variables[48] = 1.0+variables[9]/variables[50]*(1.0+exp(variables[49]*variables[21]/variables[4]))+variables[3]/variables[52]*(1.0+variables[3]/variables[51]*(1.0+variables[3]/variables[47])) + variables[30] = variables[9]/variables[50]*exp(variables[49]*variables[21]/variables[4])/variables[48] + variables[35] = exp(variables[43]*variables[21]/(2.0*variables[4])) + variables[38] = variables[2]/variables[45]*variables[2]/variables[44]*(1.0+variables[2]/variables[39])*exp(variables[43]*variables[21]/(2.0*variables[4]))/variables[40] + variables[36] = variables[3]/variables[52]*variables[3]/variables[51]*(1.0+variables[3]/variables[47])*exp(-variables[43]*variables[21]/(2.0*variables[4]))/variables[48] + variables[25] = variables[36]*variables[37]*(variables[38]+variables[29])+variables[38]*variables[30]*(variables[37]+variables[35]) + variables[34] = variables[2]/(variables[39]+variables[2]) + variables[33] = exp(-variables[43]*variables[21]/(2.0*variables[4])) + variables[26] = variables[38]*variables[34]*(variables[36]+variables[30])+variables[29]*variables[36]*(variables[34]+variables[33]) + variables[27] = variables[35]*variables[34]*(variables[38]+variables[29])+variables[33]*variables[29]*(variables[37]+variables[35]) + variables[28] = variables[33]*variables[37]*(variables[36]+variables[30])+variables[30]*variables[35]*(variables[34]+variables[33]) + variables[14] = (1.0-variables[32])*variables[31]*(variables[27]*variables[30]-variables[28]*variables[29])/(variables[28]+variables[27]+variables[26]+variables[25]) + variables[54] = variables[53]*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[60] = variables[59]-(variables[59]-variables[58])/(1.0+pow(variables[57]/states[2], variables[56])) + variables[62] = variables[61]/variables[60] + variables[64] = variables[63]*variables[60] 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[72] = (states[0]-states[7])/variables[71] + variables[75] = variables[70]/(1.0+exp((-states[7]+variables[74])/variables[73])) + variables[77] = (states[8]-states[2])/variables[76] + variables[78] = variables[80]*states[7]*(1.0-states[9])-variables[79]*states[9] + variables[81] = variables[83]*states[7]*(1.0-(states[10]+states[11]))-variables[82]*states[10] + variables[84] = variables[87]*variables[86]*(1.0-(states[10]+states[11]))-variables[85]*states[11] + variables[88] = variables[90]*states[7]*(1.0-states[12])-variables[89]*states[12] + variables[91] = variables[90]*states[0]*(1.0-states[13])-variables[89]*states[13] + variables[92] = variables[94]*states[2]*(1.0-states[14])-variables[93]*states[14] + variables[110] = variables[157]*states[20]*states[19]*(variables[21]-variables[8]) + variables[111] = variables[212]*variables[211]*(variables[21]-variables[8])*(1.0+exp((variables[21]+20.0)/20.0))*states[32] if gt_func(variables[0], 0.0) else 0.0 + variables[100] = 2.0*variables[184]*variables[21]/(variables[4]*(1.0-exp(-1.0*variables[21]*2.0/variables[4])))*(states[0]-variables[9]*exp(-2.0*variables[21]/variables[4]))*states[25]*states[24] + variables[16] = 0.0000185*variables[163]*(variables[21]-0.0)/(variables[4]*(1.0-exp(-1.0*(variables[21]-0.0)/variables[4])))*(variables[2]-variables[3]*exp(-1.0*(variables[21]-0.0)/variables[4]))*states[23]*states[22]*states[21] + variables[164] = 0.000365*variables[163]*(variables[21]-0.0)/(variables[4]*(1.0-exp(-1.0*(variables[21]-0.0)/variables[4])))*(variables[6]-variables[7]*exp(-1.0*(variables[21]-0.0)/variables[4]))*states[23]*states[22]*states[21] + variables[101] = 2.0*variables[163]*(variables[21]-0.0)/(variables[4]*(1.0-exp(-1.0*(variables[21]-0.0)*2.0/variables[4])))*(states[0]-variables[9]*exp(-2.0*(variables[21]-0.0)/variables[4]))*states[23]*states[22]*states[21] + variables[112] = (variables[101]+variables[164]+variables[16])*(1.0-variables[165])*1.0*variables[162] + variables[142] = variables[4]*log((variables[3]+0.12*variables[7])/(variables[2]+0.12*variables[6])) + variables[146] = variables[145]*pow(states[18], 3.0)*(variables[21]-variables[142]) + variables[144] = variables[143]*pow(states[18], 3.0)*states[17]*(variables[21]-variables[142]) + variables[18] = variables[144]+variables[146] + variables[113] = variables[190]*(variables[21]-variables[8])*states[27]*states[26] + variables[205] = variables[4]*log((variables[7]+0.12*variables[3])/(variables[6]+0.12*variables[2])) + variables[114] = variables[204]*(variables[21]-variables[205])*pow(states[31], 2.0) + variables[115] = variables[195]*(variables[21]-variables[8])*(0.9*states[30]+0.1*states[29])*states[28] + variables[136] = states[16]*variables[134]*(variables[21]-variables[8])*(1.0-variables[135]) + variables[17] = states[16]*variables[133]*(variables[21]-variables[5])*(1.0-variables[135]) + variables[116] = variables[17]+variables[136] + variables[117] = variables[116]+variables[115]+variables[114]+variables[113]+variables[15]+variables[14]+variables[18]+variables[112]+variables[100]+variables[111]+variables[110] 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[141] = 0.01329+0.99921/(1.0+exp((variables[21]+97.134-variables[137]-variables[138]-variables[140])/8.1752)) if lt_func(variables[21], -(80.0-variables[137]-variables[138]-variables[140])) else 0.0002501*exp(-(variables[21]-variables[137]-variables[138]-variables[140])/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[150] = 2000.0 if lt_func(fabs(variables[148]), variables[149]) 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[152] = 1.0/(variables[150]+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[159] = 1.0/(1.0+exp((variables[21]+6.0)/-8.6)) + variables[158] = 0.009/(1.0+exp((variables[21]+5.0)/12.0))+0.0005 + variables[161] = 1.0/(1.0+exp((variables[21]+7.5)/10.0)) + variables[160] = 0.59/(1.0+exp((variables[21]+60.0)/10.0))+3.05 + variables[170] = 1.0/(1.0+exp(-(variables[21]-variables[169]-variables[166])/(variables[168]*(1.0+variables[167]/100.0)))) + variables[175] = -1.80001 if eq_func(variables[21], -1.8) else variables[21] + variables[171] = 0.01143*(variables[175]+1.8)/(exp((variables[175]+1.8)/2.5)-1.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[173] = 0.001/(variables[172]+variables[171]) + variables[178] = 1.0/(1.0+exp((variables[21]+37.4+variables[177])/(5.3+variables[176]))) 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[181] = variables[180]/(variables[180]+states[0]) + variables[183] = 0.001*variables[181]/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)) 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[189] = 1.0/(16.67*exp(-(variables[21]+75.0)/83.3)+16.67*exp((variables[21]+75.0)/15.38))+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) variables[193] = 1.0/(1.0+exp(-(variables[21]-19.3)/15.0)) @@ -688,9 +688,9 @@ def compute_variables(voi, states, rates, variables): 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[208] = 1.0*exp(-(variables[21]-variables[206]-5.0)/25.0) 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[210] = 1.0/(variables[209]+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]) 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 2ca29f1fff..52c7b72789 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 @@ -16,30 +16,29 @@ const VariableInfo VOI_INFO = {"time", "second", "environment", VARIABLE_OF_INTE const VariableInfo STATE_INFO[] = { {"V", "millivolt", "membrane", STATE}, {"m", "dimensionless", "sodium_current_m_gate", STATE}, - {"h1", "dimensionless", "sodium_current_h_gate", STATE}, {"h2", "dimensionless", "sodium_current_h_gate", STATE}, - {"f_L", "dimensionless", "L_type_Ca_channel_f_gate", STATE}, + {"h1", "dimensionless", "sodium_current_h_gate", STATE}, {"d_L", "dimensionless", "L_type_Ca_channel_d_gate", STATE}, + {"f_L", "dimensionless", "L_type_Ca_channel_f_gate", STATE}, {"f_T", "dimensionless", "T_type_Ca_channel_f_gate", STATE}, {"d_T", "dimensionless", "T_type_Ca_channel_d_gate", STATE}, {"r", "dimensionless", "four_AP_sensitive_currents_r_gate", STATE}, {"q", "dimensionless", "four_AP_sensitive_currents_q_gate", STATE}, {"P_i", "dimensionless", "rapid_delayed_rectifying_potassium_current_P_i_gate", STATE}, - {"P_af", "dimensionless", "rapid_delayed_rectifying_potassium_current_P_af_gate", STATE}, {"P_as", "dimensionless", "rapid_delayed_rectifying_potassium_current_P_as_gate", STATE}, + {"P_af", "dimensionless", "rapid_delayed_rectifying_potassium_current_P_af_gate", STATE}, {"xs", "dimensionless", "slow_delayed_rectifying_potassium_current_xs_gate", STATE}, {"y", "dimensionless", "hyperpolarisation_activated_current_y_gate", STATE} }; const VariableInfo VARIABLE_INFO[] = { - {"FCell", "dimensionless", "membrane", COMPUTED_CONSTANT}, {"dCell", "dimensionless", "membrane", CONSTANT}, {"Version", "dimensionless", "membrane", CONSTANT}, {"FCellConstant", "dimensionless", "membrane", CONSTANT}, - {"Cm", "microF", "membrane", COMPUTED_CONSTANT}, + {"FCell", "dimensionless", "membrane", COMPUTED_CONSTANT}, {"CmCentre", "microF", "membrane", CONSTANT}, {"CmPeriphery", "microF", "membrane", CONSTANT}, - {"i_Na", "nanoA", "sodium_current", ALGEBRAIC}, + {"Cm", "microF", "membrane", COMPUTED_CONSTANT}, {"i_Ca_p", "nanoA", "persistent_calcium_current", COMPUTED_CONSTANT}, {"i_p", "nanoA", "sodium_potassium_pump", ALGEBRAIC}, {"i_NaCa", "nanoA", "sodium_calcium_exchanger", ALGEBRAIC}, @@ -54,169 +53,170 @@ const VariableInfo VARIABLE_INFO[] = { {"i_to", "nanoA", "four_AP_sensitive_currents", ALGEBRAIC}, {"i_Ca_T", "nanoA", "T_type_Ca_channel", ALGEBRAIC}, {"i_Ca_L", "nanoA", "L_type_Ca_channel", ALGEBRAIC}, + {"i_Na", "nanoA", "sodium_current", ALGEBRAIC}, {"R", "millijoule_per_mole_kelvin", "membrane", CONSTANT}, {"T", "kelvin", "membrane", CONSTANT}, {"F", "coulomb_per_mole", "membrane", CONSTANT}, - {"g_b_Na", "microS", "sodium_background_current", COMPUTED_CONSTANT}, {"g_b_Na_Centre_Published", "microS", "sodium_background_current", CONSTANT}, {"g_b_Na_Periphery_Published", "microS", "sodium_background_current", CONSTANT}, {"g_b_Na_Centre_1DCapable", "microS", "sodium_background_current", CONSTANT}, {"g_b_Na_Periphery_1DCapable", "microS", "sodium_background_current", CONSTANT}, {"g_b_Na_Centre_0DCapable", "microS", "sodium_background_current", CONSTANT}, {"g_b_Na_Periphery_0DCapable", "microS", "sodium_background_current", CONSTANT}, + {"g_b_Na", "microS", "sodium_background_current", COMPUTED_CONSTANT}, {"E_Na", "millivolt", "reversal_and_equilibrium_potentials", COMPUTED_CONSTANT}, - {"g_b_K", "microS", "potassium_background_current", COMPUTED_CONSTANT}, {"g_b_K_Centre_Published", "microS", "potassium_background_current", CONSTANT}, {"g_b_K_Periphery_Published", "microS", "potassium_background_current", CONSTANT}, {"g_b_K_Centre_1DCapable", "microS", "potassium_background_current", CONSTANT}, {"g_b_K_Periphery_1DCapable", "microS", "potassium_background_current", CONSTANT}, {"g_b_K_Centre_0DCapable", "microS", "potassium_background_current", CONSTANT}, {"g_b_K_Periphery_0DCapable", "microS", "potassium_background_current", CONSTANT}, + {"g_b_K", "microS", "potassium_background_current", COMPUTED_CONSTANT}, {"E_K", "millivolt", "reversal_and_equilibrium_potentials", COMPUTED_CONSTANT}, - {"g_b_Ca", "microS", "calcium_background_current", COMPUTED_CONSTANT}, {"g_b_Ca_Centre_Published", "microS", "calcium_background_current", CONSTANT}, {"g_b_Ca_Periphery_Published", "microS", "calcium_background_current", CONSTANT}, {"g_b_Ca_Centre_1DCapable", "microS", "calcium_background_current", CONSTANT}, {"g_b_Ca_Periphery_1DCapable", "microS", "calcium_background_current", CONSTANT}, {"g_b_Ca_Centre_0DCapable", "microS", "calcium_background_current", CONSTANT}, {"g_b_Ca_Periphery_0DCapable", "microS", "calcium_background_current", CONSTANT}, + {"g_b_Ca", "microS", "calcium_background_current", COMPUTED_CONSTANT}, {"E_Ca", "millivolt", "reversal_and_equilibrium_potentials", COMPUTED_CONSTANT}, - {"k_NaCa", "nanoA", "sodium_calcium_exchanger", COMPUTED_CONSTANT}, {"k_NaCa_Centre_Published", "nanoA", "sodium_calcium_exchanger", CONSTANT}, {"k_NaCa_Periphery_Published", "nanoA", "sodium_calcium_exchanger", CONSTANT}, {"k_NaCa_Centre_1DCapable", "nanoA", "sodium_calcium_exchanger", CONSTANT}, {"k_NaCa_Periphery_1DCapable", "nanoA", "sodium_calcium_exchanger", CONSTANT}, {"k_NaCa_Centre_0DCapable", "nanoA", "sodium_calcium_exchanger", CONSTANT}, {"k_NaCa_Periphery_0DCapable", "nanoA", "sodium_calcium_exchanger", CONSTANT}, + {"k_NaCa", "nanoA", "sodium_calcium_exchanger", COMPUTED_CONSTANT}, {"Na_i", "millimolar", "ionic_concentrations", CONSTANT}, - {"gamma_NaCa", "dimensionless", "sodium_calcium_exchanger", CONSTANT}, {"Ca_o", "millimolar", "ionic_concentrations", CONSTANT}, {"Na_o", "millimolar", "ionic_concentrations", CONSTANT}, {"Ca_i", "millimolar", "ionic_concentrations", CONSTANT}, {"d_NaCa", "dimensionless", "sodium_calcium_exchanger", CONSTANT}, - {"i_p_max", "nanoA", "sodium_potassium_pump", COMPUTED_CONSTANT}, + {"gamma_NaCa", "dimensionless", "sodium_calcium_exchanger", CONSTANT}, {"i_p_max_Centre_Published", "nanoA", "sodium_potassium_pump", CONSTANT}, {"i_p_max_Periphery_Published", "nanoA", "sodium_potassium_pump", CONSTANT}, {"i_p_max_Centre_1DCapable", "nanoA", "sodium_potassium_pump", CONSTANT}, {"i_p_max_Periphery_1DCapable", "nanoA", "sodium_potassium_pump", CONSTANT}, {"i_p_max_Centre_0DCapable", "nanoA", "sodium_potassium_pump", CONSTANT}, {"i_p_max_Periphery_0DCapable", "nanoA", "sodium_potassium_pump", CONSTANT}, + {"i_p_max", "nanoA", "sodium_potassium_pump", COMPUTED_CONSTANT}, {"K_o", "millimolar", "ionic_concentrations", CONSTANT}, {"K_m_K", "millimolar", "sodium_potassium_pump", CONSTANT}, {"K_m_Na", "millimolar", "sodium_potassium_pump", CONSTANT}, - {"i_Ca_p_max", "nanoA", "persistent_calcium_current", COMPUTED_CONSTANT}, {"i_Ca_p_max_Centre_Published", "nanoA", "persistent_calcium_current", CONSTANT}, {"i_Ca_p_max_Periphery_Published", "nanoA", "persistent_calcium_current", CONSTANT}, {"i_Ca_p_max_Centre_1DCapable", "nanoA", "persistent_calcium_current", CONSTANT}, {"i_Ca_p_max_Periphery_1DCapable", "nanoA", "persistent_calcium_current", CONSTANT}, {"i_Ca_p_max_Centre_0DCapable", "nanoA", "persistent_calcium_current", CONSTANT}, {"i_Ca_p_max_Periphery_0DCapable", "nanoA", "persistent_calcium_current", CONSTANT}, + {"i_Ca_p_max", "nanoA", "persistent_calcium_current", COMPUTED_CONSTANT}, {"K_i", "millimolar", "ionic_concentrations", CONSTANT}, {"E_K_s", "millivolt", "reversal_and_equilibrium_potentials", COMPUTED_CONSTANT}, - {"g_Na", "microlitre_per_second", "sodium_current", COMPUTED_CONSTANT}, {"g_Na_Centre_Published", "microlitre_per_second", "sodium_current", CONSTANT}, {"g_Na_Periphery_Published", "microlitre_per_second", "sodium_current", CONSTANT}, {"g_Na_Centre_1DCapable", "microlitre_per_second", "sodium_current", CONSTANT}, {"g_Na_Periphery_1DCapable", "microlitre_per_second", "sodium_current", CONSTANT}, {"g_Na_Centre_0DCapable", "microlitre_per_second", "sodium_current", CONSTANT}, {"g_Na_Periphery_0DCapable", "microlitre_per_second", "sodium_current", CONSTANT}, + {"g_Na", "microlitre_per_second", "sodium_current", COMPUTED_CONSTANT}, {"h", "dimensionless", "sodium_current_h_gate", ALGEBRAIC}, - {"m_infinity", "dimensionless", "sodium_current_m_gate", ALGEBRAIC}, {"tau_m", "second", "sodium_current_m_gate", ALGEBRAIC}, + {"m_infinity", "dimensionless", "sodium_current_m_gate", ALGEBRAIC}, {"F_Na", "dimensionless", "sodium_current_h_gate", ALGEBRAIC}, - {"h1_infinity", "dimensionless", "sodium_current_h_gate", ALGEBRAIC}, {"tau_h1", "second", "sodium_current_h_gate", ALGEBRAIC}, - {"h2_infinity", "dimensionless", "sodium_current_h_gate", ALGEBRAIC}, + {"h1_infinity", "dimensionless", "sodium_current_h_gate", ALGEBRAIC}, {"tau_h2", "second", "sodium_current_h_gate", ALGEBRAIC}, - {"g_Ca_L", "microS", "L_type_Ca_channel", COMPUTED_CONSTANT}, + {"h2_infinity", "dimensionless", "sodium_current_h_gate", ALGEBRAIC}, {"g_Ca_L_Centre_Published", "microS", "L_type_Ca_channel", CONSTANT}, {"g_Ca_L_Periphery_Published", "microS", "L_type_Ca_channel", CONSTANT}, {"g_Ca_L_Centre_1DCapable", "microS", "L_type_Ca_channel", CONSTANT}, {"g_Ca_L_Periphery_1DCapable", "microS", "L_type_Ca_channel", CONSTANT}, {"g_Ca_L_Centre_0DCapable", "microS", "L_type_Ca_channel", CONSTANT}, {"g_Ca_L_Periphery_0DCapable", "microS", "L_type_Ca_channel", CONSTANT}, + {"g_Ca_L", "microS", "L_type_Ca_channel", COMPUTED_CONSTANT}, {"E_Ca_L", "millivolt", "L_type_Ca_channel", CONSTANT}, - {"d_L_infinity", "dimensionless", "L_type_Ca_channel_d_gate", ALGEBRAIC}, {"tau_d_L", "second", "L_type_Ca_channel_d_gate", ALGEBRAIC}, + {"d_L_infinity", "dimensionless", "L_type_Ca_channel_d_gate", ALGEBRAIC}, {"alpha_d_L", "per_second", "L_type_Ca_channel_d_gate", ALGEBRAIC}, {"beta_d_L", "per_second", "L_type_Ca_channel_d_gate", ALGEBRAIC}, - {"f_L_infinity", "dimensionless", "L_type_Ca_channel_f_gate", ALGEBRAIC}, {"tau_f_L", "second", "L_type_Ca_channel_f_gate", ALGEBRAIC}, + {"f_L_infinity", "dimensionless", "L_type_Ca_channel_f_gate", ALGEBRAIC}, {"alpha_f_L", "per_second", "L_type_Ca_channel_f_gate", ALGEBRAIC}, {"beta_f_L", "per_second", "L_type_Ca_channel_f_gate", ALGEBRAIC}, - {"g_Ca_T", "microS", "T_type_Ca_channel", COMPUTED_CONSTANT}, {"g_Ca_T_Centre_Published", "microS", "T_type_Ca_channel", CONSTANT}, {"g_Ca_T_Periphery_Published", "microS", "T_type_Ca_channel", CONSTANT}, {"g_Ca_T_Centre_1DCapable", "microS", "T_type_Ca_channel", CONSTANT}, {"g_Ca_T_Periphery_1DCapable", "microS", "T_type_Ca_channel", CONSTANT}, {"g_Ca_T_Centre_0DCapable", "microS", "T_type_Ca_channel", CONSTANT}, {"g_Ca_T_Periphery_0DCapable", "microS", "T_type_Ca_channel", CONSTANT}, + {"g_Ca_T", "microS", "T_type_Ca_channel", COMPUTED_CONSTANT}, {"E_Ca_T", "millivolt", "T_type_Ca_channel", CONSTANT}, - {"d_T_infinity", "dimensionless", "T_type_Ca_channel_d_gate", ALGEBRAIC}, {"tau_d_T", "second", "T_type_Ca_channel_d_gate", ALGEBRAIC}, + {"d_T_infinity", "dimensionless", "T_type_Ca_channel_d_gate", ALGEBRAIC}, {"alpha_d_T", "per_second", "T_type_Ca_channel_d_gate", ALGEBRAIC}, {"beta_d_T", "per_second", "T_type_Ca_channel_d_gate", ALGEBRAIC}, - {"f_T_infinity", "dimensionless", "T_type_Ca_channel_f_gate", ALGEBRAIC}, {"tau_f_T", "second", "T_type_Ca_channel_f_gate", ALGEBRAIC}, + {"f_T_infinity", "dimensionless", "T_type_Ca_channel_f_gate", ALGEBRAIC}, {"alpha_f_T", "per_second", "T_type_Ca_channel_f_gate", ALGEBRAIC}, {"beta_f_T", "per_second", "T_type_Ca_channel_f_gate", ALGEBRAIC}, - {"g_to", "microS", "four_AP_sensitive_currents", COMPUTED_CONSTANT}, {"g_to_Centre_Published", "microS", "four_AP_sensitive_currents", CONSTANT}, {"g_to_Periphery_Published", "microS", "four_AP_sensitive_currents", CONSTANT}, {"g_to_Centre_1DCapable", "microS", "four_AP_sensitive_currents", CONSTANT}, {"g_to_Periphery_1DCapable", "microS", "four_AP_sensitive_currents", CONSTANT}, {"g_to_Centre_0DCapable", "microS", "four_AP_sensitive_currents", CONSTANT}, {"g_to_Periphery_0DCapable", "microS", "four_AP_sensitive_currents", CONSTANT}, - {"g_sus", "microS", "four_AP_sensitive_currents", COMPUTED_CONSTANT}, + {"g_to", "microS", "four_AP_sensitive_currents", COMPUTED_CONSTANT}, {"g_sus_Centre_Published", "microS", "four_AP_sensitive_currents", CONSTANT}, {"g_sus_Periphery_Published", "microS", "four_AP_sensitive_currents", CONSTANT}, {"g_sus_Centre_1DCapable", "microS", "four_AP_sensitive_currents", CONSTANT}, {"g_sus_Periphery_1DCapable", "microS", "four_AP_sensitive_currents", CONSTANT}, {"g_sus_Centre_0DCapable", "microS", "four_AP_sensitive_currents", CONSTANT}, {"g_sus_Periphery_0DCapable", "microS", "four_AP_sensitive_currents", CONSTANT}, - {"q_infinity", "dimensionless", "four_AP_sensitive_currents_q_gate", ALGEBRAIC}, + {"g_sus", "microS", "four_AP_sensitive_currents", COMPUTED_CONSTANT}, {"tau_q", "second", "four_AP_sensitive_currents_q_gate", ALGEBRAIC}, - {"r_infinity", "dimensionless", "four_AP_sensitive_currents_r_gate", ALGEBRAIC}, + {"q_infinity", "dimensionless", "four_AP_sensitive_currents_q_gate", ALGEBRAIC}, {"tau_r", "second", "four_AP_sensitive_currents_r_gate", ALGEBRAIC}, - {"g_K_r", "microS", "rapid_delayed_rectifying_potassium_current", COMPUTED_CONSTANT}, + {"r_infinity", "dimensionless", "four_AP_sensitive_currents_r_gate", ALGEBRAIC}, {"g_K_r_Centre_Published", "microS", "rapid_delayed_rectifying_potassium_current", CONSTANT}, {"g_K_r_Periphery_Published", "microS", "rapid_delayed_rectifying_potassium_current", CONSTANT}, {"g_K_r_Centre_1DCapable", "microS", "rapid_delayed_rectifying_potassium_current", CONSTANT}, {"g_K_r_Periphery_1DCapable", "microS", "rapid_delayed_rectifying_potassium_current", CONSTANT}, {"g_K_r_Centre_0DCapable", "microS", "rapid_delayed_rectifying_potassium_current", CONSTANT}, {"g_K_r_Periphery_0DCapable", "microS", "rapid_delayed_rectifying_potassium_current", CONSTANT}, + {"g_K_r", "microS", "rapid_delayed_rectifying_potassium_current", COMPUTED_CONSTANT}, {"P_a", "dimensionless", "rapid_delayed_rectifying_potassium_current", ALGEBRAIC}, - {"P_af_infinity", "dimensionless", "rapid_delayed_rectifying_potassium_current_P_af_gate", ALGEBRAIC}, {"tau_P_af", "second", "rapid_delayed_rectifying_potassium_current_P_af_gate", ALGEBRAIC}, - {"P_as_infinity", "dimensionless", "rapid_delayed_rectifying_potassium_current_P_as_gate", ALGEBRAIC}, + {"P_af_infinity", "dimensionless", "rapid_delayed_rectifying_potassium_current_P_af_gate", ALGEBRAIC}, {"tau_P_as", "second", "rapid_delayed_rectifying_potassium_current_P_as_gate", ALGEBRAIC}, + {"P_as_infinity", "dimensionless", "rapid_delayed_rectifying_potassium_current_P_as_gate", ALGEBRAIC}, {"tau_P_i", "second", "rapid_delayed_rectifying_potassium_current_P_i_gate", COMPUTED_CONSTANT}, {"P_i_infinity", "dimensionless", "rapid_delayed_rectifying_potassium_current_P_i_gate", ALGEBRAIC}, - {"g_K_s", "microS", "slow_delayed_rectifying_potassium_current", COMPUTED_CONSTANT}, {"g_K_s_Centre_Published", "microS", "slow_delayed_rectifying_potassium_current", CONSTANT}, {"g_K_s_Periphery_Published", "microS", "slow_delayed_rectifying_potassium_current", CONSTANT}, {"g_K_s_Centre_1DCapable", "microS", "slow_delayed_rectifying_potassium_current", CONSTANT}, {"g_K_s_Periphery_1DCapable", "microS", "slow_delayed_rectifying_potassium_current", CONSTANT}, {"g_K_s_Centre_0DCapable", "microS", "slow_delayed_rectifying_potassium_current", CONSTANT}, {"g_K_s_Periphery_0DCapable", "microS", "slow_delayed_rectifying_potassium_current", CONSTANT}, - {"alpha_xs", "per_second", "slow_delayed_rectifying_potassium_current_xs_gate", ALGEBRAIC}, + {"g_K_s", "microS", "slow_delayed_rectifying_potassium_current", COMPUTED_CONSTANT}, {"beta_xs", "per_second", "slow_delayed_rectifying_potassium_current_xs_gate", ALGEBRAIC}, - {"g_f_Na", "microS", "hyperpolarisation_activated_current", COMPUTED_CONSTANT}, + {"alpha_xs", "per_second", "slow_delayed_rectifying_potassium_current_xs_gate", ALGEBRAIC}, {"g_f_Na_Centre_Published", "microS", "hyperpolarisation_activated_current", CONSTANT}, {"g_f_Na_Periphery_Published", "microS", "hyperpolarisation_activated_current", CONSTANT}, {"g_f_Na_Centre_1DCapable", "microS", "hyperpolarisation_activated_current", CONSTANT}, {"g_f_Na_Periphery_1DCapable", "microS", "hyperpolarisation_activated_current", CONSTANT}, {"g_f_Na_Centre_0DCapable", "microS", "hyperpolarisation_activated_current", CONSTANT}, {"g_f_Na_Periphery_0DCapable", "microS", "hyperpolarisation_activated_current", CONSTANT}, - {"g_f_K", "microS", "hyperpolarisation_activated_current", COMPUTED_CONSTANT}, + {"g_f_Na", "microS", "hyperpolarisation_activated_current", COMPUTED_CONSTANT}, {"g_f_K_Centre_Published", "microS", "hyperpolarisation_activated_current", CONSTANT}, {"g_f_K_Periphery_Published", "microS", "hyperpolarisation_activated_current", CONSTANT}, {"g_f_K_Centre_1DCapable", "microS", "hyperpolarisation_activated_current", CONSTANT}, {"g_f_K_Periphery_1DCapable", "microS", "hyperpolarisation_activated_current", CONSTANT}, {"g_f_K_Centre_0DCapable", "microS", "hyperpolarisation_activated_current", CONSTANT}, {"g_f_K_Periphery_0DCapable", "microS", "hyperpolarisation_activated_current", CONSTANT}, - {"alpha_y", "per_second", "hyperpolarisation_activated_current_y_gate", ALGEBRAIC}, - {"beta_y", "per_second", "hyperpolarisation_activated_current_y_gate", ALGEBRAIC} + {"g_f_K", "microS", "hyperpolarisation_activated_current", COMPUTED_CONSTANT}, + {"beta_y", "per_second", "hyperpolarisation_activated_current_y_gate", ALGEBRAIC}, + {"alpha_y", "per_second", "hyperpolarisation_activated_current_y_gate", ALGEBRAIC} }; double * createStatesArray() @@ -248,283 +248,283 @@ void deleteArray(double *array) void initialiseVariables(double *states, double *rates, double *variables) { - variables[1] = 0.0; - variables[2] = 1.0; - variables[3] = 1.0309347; - variables[5] = 2.0e-5; - variables[6] = 6.5e-5; + variables[0] = 0.0; + variables[1] = 1.0; + variables[2] = 1.0309347; + variables[4] = 2.0e-5; + variables[5] = 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[25] = 5.8e-5; + variables[26] = 0.000189; + variables[27] = 5.8e-5; + variables[28] = 0.000189; + variables[29] = 5.81818e-5; + variables[30] = 0.0001888; + variables[33] = 2.52e-5; + variables[34] = 8.19e-5; + variables[35] = 2.52e-5; + variables[36] = 8.19e-5; + variables[37] = 2.523636e-5; + variables[38] = 8.1892e-5; + variables[41] = 1.32e-5; + variables[42] = 4.3e-5; + variables[43] = 1.323e-5; + variables[44] = 4.29e-5; + variables[45] = 1.3236e-5; + variables[46] = 4.2952e-5; + variables[49] = 2.7e-6; + variables[50] = 8.8e-6; + variables[51] = 2.8e-6; + variables[52] = 8.8e-6; + variables[53] = 2.7229e-6; + variables[54] = 8.83584e-6; variables[56] = 8.0; - variables[57] = 0.5; - variables[58] = 2.0; - variables[59] = 140.0; + variables[57] = 2.0; + variables[58] = 140.0; + variables[59] = 0.0001; 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[61] = 0.5; + variables[62] = 0.0478; + variables[63] = 0.16; + variables[64] = 0.0478; + variables[65] = 0.16; + variables[66] = 0.04782545; + variables[67] = 0.1551936; variables[69] = 5.4; variables[70] = 0.621; variables[71] = 5.64; + variables[72] = 0.0; variables[73] = 0.0; - variables[74] = 0.0; - variables[75] = 0.0042; - variables[76] = 0.03339; + variables[74] = 0.0042; + variables[75] = 0.03339; + variables[76] = 0.0; 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[81] = 0.0; + variables[82] = 1.2e-6; + variables[83] = 0.0; + variables[84] = 3.7e-7; + variables[85] = 0.0; + variables[86] = 1.204e-6; + variables[96] = 0.0058; + variables[97] = 0.0659; + variables[98] = 0.0082; + variables[99] = 0.0659; + variables[100] = 0.0057938; + variables[101] = 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[112] = 0.0043; + variables[113] = 0.0139; + variables[114] = 0.0021; + variables[115] = 0.00694; + variables[116] = 0.00427806; + variables[117] = 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; + variables[128] = 0.00491; + variables[129] = 0.03649; + variables[130] = 0.004905; + variables[131] = 0.0365; + variables[132] = 0.004905; + variables[133] = 0.036495; + variables[135] = 6.65e-5; + variables[136] = 0.0114; + variables[137] = 0.000266; + variables[138] = 0.0114; + variables[139] = 6.645504e-5; + variables[140] = 0.01138376; + variables[146] = 0.000797; + variables[147] = 0.016; + variables[148] = 0.000738; + variables[149] = 0.0208; + variables[150] = 0.00079704; + variables[151] = 0.016; + variables[160] = 0.000518; + variables[161] = 0.0104; + variables[162] = 0.000345; + variables[163] = 0.0104; + variables[164] = 0.0003445; + variables[165] = 0.0104; + variables[169] = 0.000548; + variables[170] = 0.0069; + variables[171] = 0.000437; + variables[172] = 0.0055; + variables[173] = 0.0005465; + variables[174] = 0.006875; + variables[176] = 0.000548; + variables[177] = 0.0069; + variables[178] = 0.000437; + variables[179] = 0.0055; + variables[180] = 0.0005465; + variables[181] = 0.006875; states[0] = -39.013558536; states[1] = 0.092361701692; - states[2] = 0.015905380261; - states[3] = 0.01445216109; - states[4] = 0.48779845203; - states[5] = 0.04804900895; + states[2] = 0.01445216109; + states[3] = 0.015905380261; + states[4] = 0.04804900895; + states[5] = 0.48779845203; states[6] = 0.038968420558; states[7] = 0.42074047435; states[8] = 0.064402950262; states[9] = 0.29760539675; states[10] = 0.87993375273; - states[11] = 0.13034201158; - states[12] = 0.46960956028; + states[11] = 0.46960956028; + states[12] = 0.13034201158; states[13] = 0.082293827208; states[14] = 0.03889291759; } void computeComputedConstants(double *variables) { - 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[3] = (variables[1] == 0.0)?1.07*(3.0*variables[0]-0.1)/(3.0*(1.0+0.7745*exp(-(3.0*variables[0]-2.05)/0.295))):(variables[1] == 1.0)?variables[2]*variables[0]/(1.0+0.7745*exp(-(3.0*variables[0]-2.05)/0.295)):1.07*29.0*variables[0]/(30.0*(1.0+0.7745*exp(-(29.0*variables[0]-24.5)/1.95))); + variables[6] = variables[4]+variables[3]*(variables[5]-variables[4]); + variables[31] = (variables[1] == 0.0)?variables[25]+variables[3]*(variables[26]-variables[25]):(variables[1] == 1.0)?variables[29]+variables[3]*(variables[30]-variables[29]):variables[27]+variables[3]*(variables[28]-variables[27]); + variables[39] = (variables[1] == 0.0)?variables[33]+variables[3]*(variables[34]-variables[33]):(variables[1] == 1.0)?variables[37]+variables[3]*(variables[38]-variables[37]):variables[35]+variables[3]*(variables[36]-variables[35]); + variables[47] = (variables[1] == 0.0)?variables[41]+variables[3]*(variables[42]-variables[41]):(variables[1] == 1.0)?variables[45]+variables[3]*(variables[46]-variables[45]):variables[43]+variables[3]*(variables[44]-variables[43]); + variables[55] = (variables[1] == 0.0)?variables[49]+variables[3]*(variables[50]-variables[49]):(variables[1] == 1.0)?variables[53]+variables[3]*(variables[54]-variables[53]):variables[51]+variables[3]*(variables[52]-variables[51]); + variables[68] = (variables[1] == 0.0)?variables[62]+variables[3]*(variables[63]-variables[62]):(variables[1] == 1.0)?variables[66]+variables[3]*(variables[67]-variables[66]):variables[64]+variables[3]*(variables[65]-variables[64]); + variables[78] = (variables[1] == 0.0)?variables[72]+variables[3]*(variables[73]-variables[72]):(variables[1] == 1.0)?variables[76]+variables[3]*(variables[77]-variables[76]):variables[74]+variables[3]*(variables[75]-variables[74]); + variables[7] = variables[78]*variables[59]/(variables[59]+0.0004); + variables[32] = variables[22]*variables[23]/variables[24]*log(variables[58]/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]); + variables[48] = variables[22]*variables[23]/(2.0*variables[24])*log(variables[57]/variables[59]); + variables[80] = (variables[1] == 0.0)?variables[22]*variables[23]/variables[24]*log((variables[69]+0.12*variables[58])/(variables[79]+0.12*variables[56])):variables[22]*variables[23]/variables[24]*log((variables[69]+0.03*variables[58])/(variables[79]+0.03*variables[56])); + variables[87] = (variables[1] == 0.0)?variables[81]+variables[3]*(variables[82]-variables[81]):(variables[1] == 1.0)?variables[85]+variables[3]*(variables[86]-variables[85]):variables[83]+variables[3]*(variables[84]-variables[83]); + variables[102] = (variables[1] == 0.0)?variables[96]+variables[3]*(variables[97]-variables[96]):(variables[1] == 1.0)?variables[100]+variables[3]*(variables[101]-variables[100]):variables[98]+variables[3]*(variables[99]-variables[98]); + variables[118] = (variables[1] == 0.0)?variables[112]+variables[3]*(variables[113]-variables[112]):(variables[1] == 1.0)?variables[116]+variables[3]*(variables[117]-variables[116]):variables[114]+variables[3]*(variables[115]-variables[114]); + variables[134] = (variables[1] == 0.0)?variables[128]+variables[3]*(variables[129]-variables[128]):(variables[1] == 1.0)?variables[132]+variables[3]*(variables[133]-variables[132]):variables[130]+variables[3]*(variables[131]-variables[130]); + variables[141] = (variables[1] == 0.0)?variables[135]+variables[3]*(variables[136]-variables[135]):(variables[1] == 1.0)?variables[139]+variables[3]*(variables[140]-variables[139]):variables[137]+variables[3]*(variables[138]-variables[137]); + variables[152] = (variables[1] == 0.0)?variables[146]+variables[3]*(variables[147]-variables[146]):(variables[1] == 1.0)?variables[150]+variables[3]*(variables[151]-variables[150]):variables[148]+variables[3]*(variables[149]-variables[148]); + variables[158] = (variables[1] == 0.0)?0.002:(variables[1] == 1.0)?0.002:0.006; + variables[166] = (variables[1] == 0.0)?variables[160]+variables[3]*(variables[161]-variables[160]):(variables[1] == 1.0)?variables[164]+variables[3]*(variables[165]-variables[164]):variables[162]+variables[3]*(variables[163]-variables[162]); + variables[175] = (variables[1] == 0.0)?variables[169]+variables[3]*(variables[170]-variables[169]):(variables[1] == 1.0)?variables[173]+variables[3]*(variables[174]-variables[173]):variables[171]+variables[3]*(variables[172]-variables[171]); + variables[182] = (variables[1] == 0.0)?variables[176]+variables[3]*(variables[177]-variables[176]):(variables[1] == 1.0)?variables[180]+variables[3]*(variables[181]-variables[180]):variables[178]+variables[3]*(variables[179]-variables[178]); } void computeRates(double voi, double *states, double *rates, double *variables) { - 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[8] = variables[68]*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[9] = (variables[1] == 0.0)?variables[55]*(pow(variables[56], 3.0)*variables[57]*exp(0.03743*states[0]*variables[61])-pow(variables[58], 3.0)*variables[59]*exp(0.0374*states[0]*(variables[61]-1.0)))/(1.0+variables[60]*(variables[59]*pow(variables[58], 3.0)+variables[57]*pow(variables[56], 3.0))):variables[55]*(pow(variables[56], 3.0)*variables[57]*exp(0.03743*states[0]*variables[61])-pow(variables[58], 3.0)*variables[59]*exp(0.03743*states[0]*(variables[61]-1.0)))/(1.0+variables[60]*(variables[59]*pow(variables[58], 3.0)+variables[57]*pow(variables[56], 3.0))); + variables[13] = (variables[1] != 2.0)?variables[182]*states[14]*(states[0]-variables[40]):variables[182]*states[14]*(states[0]+102.0); + variables[14] = (variables[1] != 2.0)?variables[175]*states[14]*(states[0]-variables[32]):variables[175]*states[14]*(states[0]-77.6); + variables[15] = variables[166]*pow(states[13], 2.0)*(states[0]-variables[80]); + variables[17] = variables[141]*states[8]*(states[0]-variables[40]); + variables[18] = variables[134]*states[9]*states[8]*(states[0]-variables[40]); + variables[19] = variables[118]*states[7]*states[6]*(states[0]-variables[119]); + variables[20] = variables[102]*(states[5]*states[4]+0.006/(1.0+exp(-(states[0]+14.1)/6.0)))*(states[0]-variables[103]); + variables[10] = variables[39]*(states[0]-variables[40]); + variables[11] = variables[47]*(states[0]-variables[48]); + variables[12] = variables[31]*(states[0]-variables[32]); + variables[153] = 0.6*states[12]+0.4*states[11]; + variables[16] = variables[152]*variables[153]*states[10]*(states[0]-variables[40]); + variables[91] = (variables[1] == 0.0)?0.0952*exp(-0.063*(states[0]+34.4))/(1.0+1.66*exp(-0.225*(states[0]+63.7)))+0.0869:0.09518*exp(-0.06306*(states[0]+34.4))/(1.0+1.662*exp(-0.2251*(states[0]+63.7)))+0.08693; + variables[88] = (1.0-variables[91])*states[3]+variables[91]*states[2]; + variables[21] = variables[87]*pow(states[1], 3.0)*variables[88]*variables[58]*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]; + rates[0] = -1.0/variables[6]*(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[7]); + variables[89] = (variables[1] == 0.0)?0.0006247/(0.832*exp(-0.335*(states[0]+56.7))+0.627*exp(0.082*(states[0]+65.01)))+4.0e-5:0.0006247/(0.8322166*exp(-0.33566*(states[0]+56.7062))+0.6274*exp(0.0823*(states[0]+65.0131)))+4.569e-5; + variables[90] = (variables[1] == 0.0)?pow(1.0/(1.0+exp(-states[0]/5.46)), 1.0/3.0):pow(1.0/(1.0+exp(-(states[0]+30.32)/5.46)), 1.0/3.0); + rates[1] = (variables[90]-states[1])/variables[89]; + variables[92] = 3.717e-6*exp(-0.2815*(states[0]+17.11))/(1.0+0.003732*exp(-0.3426*(states[0]+37.76)))+0.0005977; + variables[93] = 1.0/(1.0+exp((states[0]+66.1)/6.4)); + rates[3] = (variables[93]-states[3])/variables[92]; + variables[94] = 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[95] = variables[93]; + rates[2] = (variables[95]-states[2])/variables[94]; + variables[107] = (variables[1] == 1.0)?11.43*(states[0]-5.0)/(exp(0.4*(states[0]-5.0))-1.0):11.42*(states[0]-5.0)/(exp(0.4*(states[0]-5.0))-1.0); + variables[106] = (variables[1] == 0.0)?-28.38*(states[0]+35.0)/(exp(-(states[0]+35.0)/2.5)-1.0)-84.9*states[0]/(exp(-0.208*states[0])-1.0):(variables[1] == 1.0)?-28.39*(states[0]+35.0)/(exp(-(states[0]+35.0)/2.5)-1.0)-84.9*states[0]/(exp(-0.208*states[0])-1.0):-28.4*(states[0]+35.0)/(exp(-(states[0]+35.0)/2.5)-1.0)-84.9*states[0]/(exp(-0.208*states[0])-1.0); + variables[104] = 2.0/(variables[106]+variables[107]); + variables[105] = (variables[1] == 0.0)?1.0/(1.0+exp(-(states[0]+23.1)/6.0)):(variables[1] == 1.0)?1.0/(1.0+exp(-(states[0]+22.3+0.8*variables[3])/6.0)):1.0/(1.0+exp(-(states[0]+22.2)/6.0)); + rates[4] = (variables[105]-states[4])/variables[104]; + variables[111] = (variables[1] == 1.0)?30.0/(1.0+exp(-(states[0]+28.0)/4.0)):25.0/(1.0+exp(-(states[0]+28.0)/4.0)); + variables[110] = (variables[1] == 1.0)?3.75*(states[0]+28.0)/(exp((states[0]+28.0)/4.0)-1.0):3.12*(states[0]+28.0)/(exp((states[0]+28.0)/4.0)-1.0); + variables[108] = (variables[1] == 1.0)?(1.2-0.2*variables[3])/(variables[110]+variables[111]):1.0/(variables[110]+variables[111]); + variables[109] = 1.0/(1.0+exp((states[0]+45.0)/5.0)); + rates[5] = (variables[109]-states[5])/variables[108]; 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[122] = 1068.0*exp((states[0]+26.3)/30.0); + variables[120] = 1.0/(variables[122]+variables[123]); + variables[121] = 1.0/(1.0+exp(-(states[0]+37.0)/6.8)); + rates[7] = (variables[121]-states[7])/variables[120]; + variables[127] = (variables[1] == 1.0)?15.0*exp((states[0]+71.0)/15.38):15.0*exp((states[0]+71.7)/15.38); + variables[126] = (variables[1] == 1.0)?15.3*exp(-(states[0]+71.0+0.7*variables[3])/83.3):15.3*exp(-(states[0]+71.7)/83.3); + variables[124] = 1.0/(variables[126]+variables[127]); + variables[125] = 1.0/(1.0+exp((states[0]+71.0)/9.0)); + rates[6] = (variables[125]-states[6])/variables[124]; + variables[142] = (variables[1] == 0.0)?0.0101+0.06517/(0.57*exp(-0.08*(states[0]+49.0)))+2.4e-5*exp(0.1*(states[0]+50.93)):(variables[1] == 1.0)?0.001/3.0*(30.31+195.5/(0.5686*exp(-0.08161*(states[0]+39.0+10.0*variables[3]))+0.7174*exp((0.2719-0.1719*variables[3])*1.0*(states[0]+40.93+10.0*variables[3])))):0.0101+0.06517/(0.5686*exp(-0.08161*(states[0]+39.0))+0.7174*exp(0.2719*(states[0]+40.93))); + variables[143] = 1.0/(1.0+exp((states[0]+59.37)/13.1)); + rates[9] = (variables[143]-states[9])/variables[142]; + variables[144] = (variables[1] == 0.0)?0.001*(2.98+15.59/(1.037*exp(0.09*(states[0]+30.61))+0.369*exp(-0.12*(states[0]+23.84)))):(variables[1] == 1.0)?0.0025*(1.191+7.838/(1.037*exp(0.09012*(states[0]+30.61))+0.369*exp(-0.119*(states[0]+23.84)))):0.001*(2.98+19.59/(1.037*exp(0.09012*(states[0]+30.61))+0.369*exp(-0.119*(states[0]+23.84)))); + variables[145] = 1.0/(1.0+exp(-(states[0]-10.93)/19.7)); + rates[8] = (variables[145]-states[8])/variables[144]; + variables[154] = (variables[1] != 2.0)?1.0/(37.2*exp((states[0]-9.0)/15.9)+0.96*exp(-(states[0]-9.0)/22.5)):1.0/(37.2*exp((states[0]-10.0)/15.9)+0.96*exp(-(states[0]-10.0)/22.5)); + variables[155] = (variables[1] != 2.0)?1.0/(1.0+exp(-(states[0]+14.2)/10.6)):1.0/(1.0+exp(-(states[0]+13.2)/10.6)); + rates[12] = (variables[155]-states[12])/variables[154]; + variables[156] = (variables[1] != 2.0)?1.0/(4.2*exp((states[0]-9.0)/17.0)+0.15*exp(-(states[0]-9.0)/21.6)):1.0/(4.2*exp((states[0]-10.0)/17.0)+0.15*exp(-(states[0]-10.0)/21.6)); + variables[157] = variables[155]; + rates[11] = (variables[157]-states[11])/variables[156]; 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]; + variables[167] = 1.0*exp(-states[0]/45.0); + variables[168] = 14.0/(1.0+exp(-(states[0]-40.0)/9.0)); + rates[13] = variables[168]*(1.0-states[13])-variables[167]*states[13]; + variables[183] = 1.0*exp((states[0]+75.13)/21.25); + variables[184] = (variables[1] == 0.0)?1.0*exp(-(states[0]+78.91)/26.62):1.0*exp(-(states[0]+78.91)/26.63); + rates[14] = variables[184]*(1.0-states[14])-variables[183]*states[14]; } void computeVariables(double voi, double *states, double *rates, double *variables) { - 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[12] = variables[31]*(states[0]-variables[32]); + variables[10] = variables[39]*(states[0]-variables[40]); + variables[11] = variables[47]*(states[0]-variables[48]); + variables[9] = (variables[1] == 0.0)?variables[55]*(pow(variables[56], 3.0)*variables[57]*exp(0.03743*states[0]*variables[61])-pow(variables[58], 3.0)*variables[59]*exp(0.0374*states[0]*(variables[61]-1.0)))/(1.0+variables[60]*(variables[59]*pow(variables[58], 3.0)+variables[57]*pow(variables[56], 3.0))):variables[55]*(pow(variables[56], 3.0)*variables[57]*exp(0.03743*states[0]*variables[61])-pow(variables[58], 3.0)*variables[59]*exp(0.03743*states[0]*(variables[61]-1.0)))/(1.0+variables[60]*(variables[59]*pow(variables[58], 3.0)+variables[57]*pow(variables[56], 3.0))); + variables[8] = variables[68]*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[1] == 0.0)?0.0952*exp(-0.063*(states[0]+34.4))/(1.0+1.66*exp(-0.225*(states[0]+63.7)))+0.0869:0.09518*exp(-0.06306*(states[0]+34.4))/(1.0+1.662*exp(-0.2251*(states[0]+63.7)))+0.08693; + variables[88] = (1.0-variables[91])*states[3]+variables[91]*states[2]; + variables[21] = variables[87]*pow(states[1], 3.0)*variables[88]*variables[58]*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[90] = (variables[1] == 0.0)?pow(1.0/(1.0+exp(-states[0]/5.46)), 1.0/3.0):pow(1.0/(1.0+exp(-(states[0]+30.32)/5.46)), 1.0/3.0); + variables[89] = (variables[1] == 0.0)?0.0006247/(0.832*exp(-0.335*(states[0]+56.7))+0.627*exp(0.082*(states[0]+65.01)))+4.0e-5:0.0006247/(0.8322166*exp(-0.33566*(states[0]+56.7062))+0.6274*exp(0.0823*(states[0]+65.0131)))+4.569e-5; + variables[93] = 1.0/(1.0+exp((states[0]+66.1)/6.4)); + variables[95] = variables[93]; + variables[92] = 3.717e-6*exp(-0.2815*(states[0]+17.11))/(1.0+0.003732*exp(-0.3426*(states[0]+37.76)))+0.0005977; + variables[94] = 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[20] = variables[102]*(states[5]*states[4]+0.006/(1.0+exp(-(states[0]+14.1)/6.0)))*(states[0]-variables[103]); + variables[106] = (variables[1] == 0.0)?-28.38*(states[0]+35.0)/(exp(-(states[0]+35.0)/2.5)-1.0)-84.9*states[0]/(exp(-0.208*states[0])-1.0):(variables[1] == 1.0)?-28.39*(states[0]+35.0)/(exp(-(states[0]+35.0)/2.5)-1.0)-84.9*states[0]/(exp(-0.208*states[0])-1.0):-28.4*(states[0]+35.0)/(exp(-(states[0]+35.0)/2.5)-1.0)-84.9*states[0]/(exp(-0.208*states[0])-1.0); + variables[107] = (variables[1] == 1.0)?11.43*(states[0]-5.0)/(exp(0.4*(states[0]-5.0))-1.0):11.42*(states[0]-5.0)/(exp(0.4*(states[0]-5.0))-1.0); + variables[104] = 2.0/(variables[106]+variables[107]); + variables[105] = (variables[1] == 0.0)?1.0/(1.0+exp(-(states[0]+23.1)/6.0)):(variables[1] == 1.0)?1.0/(1.0+exp(-(states[0]+22.3+0.8*variables[3])/6.0)):1.0/(1.0+exp(-(states[0]+22.2)/6.0)); + variables[110] = (variables[1] == 1.0)?3.75*(states[0]+28.0)/(exp((states[0]+28.0)/4.0)-1.0):3.12*(states[0]+28.0)/(exp((states[0]+28.0)/4.0)-1.0); + variables[111] = (variables[1] == 1.0)?30.0/(1.0+exp(-(states[0]+28.0)/4.0)):25.0/(1.0+exp(-(states[0]+28.0)/4.0)); + variables[108] = (variables[1] == 1.0)?(1.2-0.2*variables[3])/(variables[110]+variables[111]):1.0/(variables[110]+variables[111]); + variables[109] = 1.0/(1.0+exp((states[0]+45.0)/5.0)); + variables[19] = variables[118]*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[120] = 1.0/(variables[122]+variables[123]); + variables[121] = 1.0/(1.0+exp(-(states[0]+37.0)/6.8)); + variables[126] = (variables[1] == 1.0)?15.3*exp(-(states[0]+71.0+0.7*variables[3])/83.3):15.3*exp(-(states[0]+71.7)/83.3); + variables[127] = (variables[1] == 1.0)?15.0*exp((states[0]+71.0)/15.38):15.0*exp((states[0]+71.7)/15.38); + variables[124] = 1.0/(variables[126]+variables[127]); + variables[125] = 1.0/(1.0+exp((states[0]+71.0)/9.0)); + variables[18] = variables[134]*states[9]*states[8]*(states[0]-variables[40]); + variables[17] = variables[141]*states[8]*(states[0]-variables[40]); + variables[143] = 1.0/(1.0+exp((states[0]+59.37)/13.1)); + variables[142] = (variables[1] == 0.0)?0.0101+0.06517/(0.57*exp(-0.08*(states[0]+49.0)))+2.4e-5*exp(0.1*(states[0]+50.93)):(variables[1] == 1.0)?0.001/3.0*(30.31+195.5/(0.5686*exp(-0.08161*(states[0]+39.0+10.0*variables[3]))+0.7174*exp((0.2719-0.1719*variables[3])*1.0*(states[0]+40.93+10.0*variables[3])))):0.0101+0.06517/(0.5686*exp(-0.08161*(states[0]+39.0))+0.7174*exp(0.2719*(states[0]+40.93))); + variables[145] = 1.0/(1.0+exp(-(states[0]-10.93)/19.7)); + variables[144] = (variables[1] == 0.0)?0.001*(2.98+15.59/(1.037*exp(0.09*(states[0]+30.61))+0.369*exp(-0.12*(states[0]+23.84)))):(variables[1] == 1.0)?0.0025*(1.191+7.838/(1.037*exp(0.09012*(states[0]+30.61))+0.369*exp(-0.119*(states[0]+23.84)))):0.001*(2.98+19.59/(1.037*exp(0.09012*(states[0]+30.61))+0.369*exp(-0.119*(states[0]+23.84)))); + variables[153] = 0.6*states[12]+0.4*states[11]; + variables[16] = variables[152]*variables[153]*states[10]*(states[0]-variables[40]); + variables[155] = (variables[1] != 2.0)?1.0/(1.0+exp(-(states[0]+14.2)/10.6)):1.0/(1.0+exp(-(states[0]+13.2)/10.6)); + variables[154] = (variables[1] != 2.0)?1.0/(37.2*exp((states[0]-9.0)/15.9)+0.96*exp(-(states[0]-9.0)/22.5)):1.0/(37.2*exp((states[0]-10.0)/15.9)+0.96*exp(-(states[0]-10.0)/22.5)); + variables[157] = variables[155]; + variables[156] = (variables[1] != 2.0)?1.0/(4.2*exp((states[0]-9.0)/17.0)+0.15*exp(-(states[0]-9.0)/21.6)):1.0/(4.2*exp((states[0]-10.0)/17.0)+0.15*exp(-(states[0]-10.0)/21.6)); 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); + variables[15] = variables[166]*pow(states[13], 2.0)*(states[0]-variables[80]); + variables[168] = 14.0/(1.0+exp(-(states[0]-40.0)/9.0)); + variables[167] = 1.0*exp(-states[0]/45.0); + variables[14] = (variables[1] != 2.0)?variables[175]*states[14]*(states[0]-variables[32]):variables[175]*states[14]*(states[0]-77.6); + variables[13] = (variables[1] != 2.0)?variables[182]*states[14]*(states[0]-variables[40]):variables[182]*states[14]*(states[0]+102.0); + variables[184] = (variables[1] == 0.0)?1.0*exp(-(states[0]+78.91)/26.62):1.0*exp(-(states[0]+78.91)/26.63); + variables[183] = 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 d363566667..8d72b4c4e2 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 @@ -24,30 +24,29 @@ class VariableType(Enum): STATE_INFO = [ {"name": "V", "units": "millivolt", "component": "membrane", "type": VariableType.STATE}, {"name": "m", "units": "dimensionless", "component": "sodium_current_m_gate", "type": VariableType.STATE}, - {"name": "h1", "units": "dimensionless", "component": "sodium_current_h_gate", "type": VariableType.STATE}, {"name": "h2", "units": "dimensionless", "component": "sodium_current_h_gate", "type": VariableType.STATE}, - {"name": "f_L", "units": "dimensionless", "component": "L_type_Ca_channel_f_gate", "type": VariableType.STATE}, + {"name": "h1", "units": "dimensionless", "component": "sodium_current_h_gate", "type": VariableType.STATE}, {"name": "d_L", "units": "dimensionless", "component": "L_type_Ca_channel_d_gate", "type": VariableType.STATE}, + {"name": "f_L", "units": "dimensionless", "component": "L_type_Ca_channel_f_gate", "type": VariableType.STATE}, {"name": "f_T", "units": "dimensionless", "component": "T_type_Ca_channel_f_gate", "type": VariableType.STATE}, {"name": "d_T", "units": "dimensionless", "component": "T_type_Ca_channel_d_gate", "type": VariableType.STATE}, {"name": "r", "units": "dimensionless", "component": "four_AP_sensitive_currents_r_gate", "type": VariableType.STATE}, {"name": "q", "units": "dimensionless", "component": "four_AP_sensitive_currents_q_gate", "type": VariableType.STATE}, {"name": "P_i", "units": "dimensionless", "component": "rapid_delayed_rectifying_potassium_current_P_i_gate", "type": VariableType.STATE}, - {"name": "P_af", "units": "dimensionless", "component": "rapid_delayed_rectifying_potassium_current_P_af_gate", "type": VariableType.STATE}, {"name": "P_as", "units": "dimensionless", "component": "rapid_delayed_rectifying_potassium_current_P_as_gate", "type": VariableType.STATE}, + {"name": "P_af", "units": "dimensionless", "component": "rapid_delayed_rectifying_potassium_current_P_af_gate", "type": VariableType.STATE}, {"name": "xs", "units": "dimensionless", "component": "slow_delayed_rectifying_potassium_current_xs_gate", "type": VariableType.STATE}, {"name": "y", "units": "dimensionless", "component": "hyperpolarisation_activated_current_y_gate", "type": VariableType.STATE} ] VARIABLE_INFO = [ - {"name": "FCell", "units": "dimensionless", "component": "membrane", "type": VariableType.COMPUTED_CONSTANT}, {"name": "dCell", "units": "dimensionless", "component": "membrane", "type": VariableType.CONSTANT}, {"name": "Version", "units": "dimensionless", "component": "membrane", "type": VariableType.CONSTANT}, {"name": "FCellConstant", "units": "dimensionless", "component": "membrane", "type": VariableType.CONSTANT}, - {"name": "Cm", "units": "microF", "component": "membrane", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "FCell", "units": "dimensionless", "component": "membrane", "type": VariableType.COMPUTED_CONSTANT}, {"name": "CmCentre", "units": "microF", "component": "membrane", "type": VariableType.CONSTANT}, {"name": "CmPeriphery", "units": "microF", "component": "membrane", "type": VariableType.CONSTANT}, - {"name": "i_Na", "units": "nanoA", "component": "sodium_current", "type": VariableType.ALGEBRAIC}, + {"name": "Cm", "units": "microF", "component": "membrane", "type": VariableType.COMPUTED_CONSTANT}, {"name": "i_Ca_p", "units": "nanoA", "component": "persistent_calcium_current", "type": VariableType.COMPUTED_CONSTANT}, {"name": "i_p", "units": "nanoA", "component": "sodium_potassium_pump", "type": VariableType.ALGEBRAIC}, {"name": "i_NaCa", "units": "nanoA", "component": "sodium_calcium_exchanger", "type": VariableType.ALGEBRAIC}, @@ -62,169 +61,170 @@ class VariableType(Enum): {"name": "i_to", "units": "nanoA", "component": "four_AP_sensitive_currents", "type": VariableType.ALGEBRAIC}, {"name": "i_Ca_T", "units": "nanoA", "component": "T_type_Ca_channel", "type": VariableType.ALGEBRAIC}, {"name": "i_Ca_L", "units": "nanoA", "component": "L_type_Ca_channel", "type": VariableType.ALGEBRAIC}, + {"name": "i_Na", "units": "nanoA", "component": "sodium_current", "type": VariableType.ALGEBRAIC}, {"name": "R", "units": "millijoule_per_mole_kelvin", "component": "membrane", "type": VariableType.CONSTANT}, {"name": "T", "units": "kelvin", "component": "membrane", "type": VariableType.CONSTANT}, {"name": "F", "units": "coulomb_per_mole", "component": "membrane", "type": VariableType.CONSTANT}, - {"name": "g_b_Na", "units": "microS", "component": "sodium_background_current", "type": VariableType.COMPUTED_CONSTANT}, {"name": "g_b_Na_Centre_Published", "units": "microS", "component": "sodium_background_current", "type": VariableType.CONSTANT}, {"name": "g_b_Na_Periphery_Published", "units": "microS", "component": "sodium_background_current", "type": VariableType.CONSTANT}, {"name": "g_b_Na_Centre_1DCapable", "units": "microS", "component": "sodium_background_current", "type": VariableType.CONSTANT}, {"name": "g_b_Na_Periphery_1DCapable", "units": "microS", "component": "sodium_background_current", "type": VariableType.CONSTANT}, {"name": "g_b_Na_Centre_0DCapable", "units": "microS", "component": "sodium_background_current", "type": VariableType.CONSTANT}, {"name": "g_b_Na_Periphery_0DCapable", "units": "microS", "component": "sodium_background_current", "type": VariableType.CONSTANT}, + {"name": "g_b_Na", "units": "microS", "component": "sodium_background_current", "type": VariableType.COMPUTED_CONSTANT}, {"name": "E_Na", "units": "millivolt", "component": "reversal_and_equilibrium_potentials", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "g_b_K", "units": "microS", "component": "potassium_background_current", "type": VariableType.COMPUTED_CONSTANT}, {"name": "g_b_K_Centre_Published", "units": "microS", "component": "potassium_background_current", "type": VariableType.CONSTANT}, {"name": "g_b_K_Periphery_Published", "units": "microS", "component": "potassium_background_current", "type": VariableType.CONSTANT}, {"name": "g_b_K_Centre_1DCapable", "units": "microS", "component": "potassium_background_current", "type": VariableType.CONSTANT}, {"name": "g_b_K_Periphery_1DCapable", "units": "microS", "component": "potassium_background_current", "type": VariableType.CONSTANT}, {"name": "g_b_K_Centre_0DCapable", "units": "microS", "component": "potassium_background_current", "type": VariableType.CONSTANT}, {"name": "g_b_K_Periphery_0DCapable", "units": "microS", "component": "potassium_background_current", "type": VariableType.CONSTANT}, + {"name": "g_b_K", "units": "microS", "component": "potassium_background_current", "type": VariableType.COMPUTED_CONSTANT}, {"name": "E_K", "units": "millivolt", "component": "reversal_and_equilibrium_potentials", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "g_b_Ca", "units": "microS", "component": "calcium_background_current", "type": VariableType.COMPUTED_CONSTANT}, {"name": "g_b_Ca_Centre_Published", "units": "microS", "component": "calcium_background_current", "type": VariableType.CONSTANT}, {"name": "g_b_Ca_Periphery_Published", "units": "microS", "component": "calcium_background_current", "type": VariableType.CONSTANT}, {"name": "g_b_Ca_Centre_1DCapable", "units": "microS", "component": "calcium_background_current", "type": VariableType.CONSTANT}, {"name": "g_b_Ca_Periphery_1DCapable", "units": "microS", "component": "calcium_background_current", "type": VariableType.CONSTANT}, {"name": "g_b_Ca_Centre_0DCapable", "units": "microS", "component": "calcium_background_current", "type": VariableType.CONSTANT}, {"name": "g_b_Ca_Periphery_0DCapable", "units": "microS", "component": "calcium_background_current", "type": VariableType.CONSTANT}, + {"name": "g_b_Ca", "units": "microS", "component": "calcium_background_current", "type": VariableType.COMPUTED_CONSTANT}, {"name": "E_Ca", "units": "millivolt", "component": "reversal_and_equilibrium_potentials", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "k_NaCa", "units": "nanoA", "component": "sodium_calcium_exchanger", "type": VariableType.COMPUTED_CONSTANT}, {"name": "k_NaCa_Centre_Published", "units": "nanoA", "component": "sodium_calcium_exchanger", "type": VariableType.CONSTANT}, {"name": "k_NaCa_Periphery_Published", "units": "nanoA", "component": "sodium_calcium_exchanger", "type": VariableType.CONSTANT}, {"name": "k_NaCa_Centre_1DCapable", "units": "nanoA", "component": "sodium_calcium_exchanger", "type": VariableType.CONSTANT}, {"name": "k_NaCa_Periphery_1DCapable", "units": "nanoA", "component": "sodium_calcium_exchanger", "type": VariableType.CONSTANT}, {"name": "k_NaCa_Centre_0DCapable", "units": "nanoA", "component": "sodium_calcium_exchanger", "type": VariableType.CONSTANT}, {"name": "k_NaCa_Periphery_0DCapable", "units": "nanoA", "component": "sodium_calcium_exchanger", "type": VariableType.CONSTANT}, + {"name": "k_NaCa", "units": "nanoA", "component": "sodium_calcium_exchanger", "type": VariableType.COMPUTED_CONSTANT}, {"name": "Na_i", "units": "millimolar", "component": "ionic_concentrations", "type": VariableType.CONSTANT}, - {"name": "gamma_NaCa", "units": "dimensionless", "component": "sodium_calcium_exchanger", "type": VariableType.CONSTANT}, {"name": "Ca_o", "units": "millimolar", "component": "ionic_concentrations", "type": VariableType.CONSTANT}, {"name": "Na_o", "units": "millimolar", "component": "ionic_concentrations", "type": VariableType.CONSTANT}, {"name": "Ca_i", "units": "millimolar", "component": "ionic_concentrations", "type": VariableType.CONSTANT}, {"name": "d_NaCa", "units": "dimensionless", "component": "sodium_calcium_exchanger", "type": VariableType.CONSTANT}, - {"name": "i_p_max", "units": "nanoA", "component": "sodium_potassium_pump", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "gamma_NaCa", "units": "dimensionless", "component": "sodium_calcium_exchanger", "type": VariableType.CONSTANT}, {"name": "i_p_max_Centre_Published", "units": "nanoA", "component": "sodium_potassium_pump", "type": VariableType.CONSTANT}, {"name": "i_p_max_Periphery_Published", "units": "nanoA", "component": "sodium_potassium_pump", "type": VariableType.CONSTANT}, {"name": "i_p_max_Centre_1DCapable", "units": "nanoA", "component": "sodium_potassium_pump", "type": VariableType.CONSTANT}, {"name": "i_p_max_Periphery_1DCapable", "units": "nanoA", "component": "sodium_potassium_pump", "type": VariableType.CONSTANT}, {"name": "i_p_max_Centre_0DCapable", "units": "nanoA", "component": "sodium_potassium_pump", "type": VariableType.CONSTANT}, {"name": "i_p_max_Periphery_0DCapable", "units": "nanoA", "component": "sodium_potassium_pump", "type": VariableType.CONSTANT}, + {"name": "i_p_max", "units": "nanoA", "component": "sodium_potassium_pump", "type": VariableType.COMPUTED_CONSTANT}, {"name": "K_o", "units": "millimolar", "component": "ionic_concentrations", "type": VariableType.CONSTANT}, {"name": "K_m_K", "units": "millimolar", "component": "sodium_potassium_pump", "type": VariableType.CONSTANT}, {"name": "K_m_Na", "units": "millimolar", "component": "sodium_potassium_pump", "type": VariableType.CONSTANT}, - {"name": "i_Ca_p_max", "units": "nanoA", "component": "persistent_calcium_current", "type": VariableType.COMPUTED_CONSTANT}, {"name": "i_Ca_p_max_Centre_Published", "units": "nanoA", "component": "persistent_calcium_current", "type": VariableType.CONSTANT}, {"name": "i_Ca_p_max_Periphery_Published", "units": "nanoA", "component": "persistent_calcium_current", "type": VariableType.CONSTANT}, {"name": "i_Ca_p_max_Centre_1DCapable", "units": "nanoA", "component": "persistent_calcium_current", "type": VariableType.CONSTANT}, {"name": "i_Ca_p_max_Periphery_1DCapable", "units": "nanoA", "component": "persistent_calcium_current", "type": VariableType.CONSTANT}, {"name": "i_Ca_p_max_Centre_0DCapable", "units": "nanoA", "component": "persistent_calcium_current", "type": VariableType.CONSTANT}, {"name": "i_Ca_p_max_Periphery_0DCapable", "units": "nanoA", "component": "persistent_calcium_current", "type": VariableType.CONSTANT}, + {"name": "i_Ca_p_max", "units": "nanoA", "component": "persistent_calcium_current", "type": VariableType.COMPUTED_CONSTANT}, {"name": "K_i", "units": "millimolar", "component": "ionic_concentrations", "type": VariableType.CONSTANT}, {"name": "E_K_s", "units": "millivolt", "component": "reversal_and_equilibrium_potentials", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "g_Na", "units": "microlitre_per_second", "component": "sodium_current", "type": VariableType.COMPUTED_CONSTANT}, {"name": "g_Na_Centre_Published", "units": "microlitre_per_second", "component": "sodium_current", "type": VariableType.CONSTANT}, {"name": "g_Na_Periphery_Published", "units": "microlitre_per_second", "component": "sodium_current", "type": VariableType.CONSTANT}, {"name": "g_Na_Centre_1DCapable", "units": "microlitre_per_second", "component": "sodium_current", "type": VariableType.CONSTANT}, {"name": "g_Na_Periphery_1DCapable", "units": "microlitre_per_second", "component": "sodium_current", "type": VariableType.CONSTANT}, {"name": "g_Na_Centre_0DCapable", "units": "microlitre_per_second", "component": "sodium_current", "type": VariableType.CONSTANT}, {"name": "g_Na_Periphery_0DCapable", "units": "microlitre_per_second", "component": "sodium_current", "type": VariableType.CONSTANT}, + {"name": "g_Na", "units": "microlitre_per_second", "component": "sodium_current", "type": VariableType.COMPUTED_CONSTANT}, {"name": "h", "units": "dimensionless", "component": "sodium_current_h_gate", "type": VariableType.ALGEBRAIC}, - {"name": "m_infinity", "units": "dimensionless", "component": "sodium_current_m_gate", "type": VariableType.ALGEBRAIC}, {"name": "tau_m", "units": "second", "component": "sodium_current_m_gate", "type": VariableType.ALGEBRAIC}, + {"name": "m_infinity", "units": "dimensionless", "component": "sodium_current_m_gate", "type": VariableType.ALGEBRAIC}, {"name": "F_Na", "units": "dimensionless", "component": "sodium_current_h_gate", "type": VariableType.ALGEBRAIC}, - {"name": "h1_infinity", "units": "dimensionless", "component": "sodium_current_h_gate", "type": VariableType.ALGEBRAIC}, {"name": "tau_h1", "units": "second", "component": "sodium_current_h_gate", "type": VariableType.ALGEBRAIC}, - {"name": "h2_infinity", "units": "dimensionless", "component": "sodium_current_h_gate", "type": VariableType.ALGEBRAIC}, + {"name": "h1_infinity", "units": "dimensionless", "component": "sodium_current_h_gate", "type": VariableType.ALGEBRAIC}, {"name": "tau_h2", "units": "second", "component": "sodium_current_h_gate", "type": VariableType.ALGEBRAIC}, - {"name": "g_Ca_L", "units": "microS", "component": "L_type_Ca_channel", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "h2_infinity", "units": "dimensionless", "component": "sodium_current_h_gate", "type": VariableType.ALGEBRAIC}, {"name": "g_Ca_L_Centre_Published", "units": "microS", "component": "L_type_Ca_channel", "type": VariableType.CONSTANT}, {"name": "g_Ca_L_Periphery_Published", "units": "microS", "component": "L_type_Ca_channel", "type": VariableType.CONSTANT}, {"name": "g_Ca_L_Centre_1DCapable", "units": "microS", "component": "L_type_Ca_channel", "type": VariableType.CONSTANT}, {"name": "g_Ca_L_Periphery_1DCapable", "units": "microS", "component": "L_type_Ca_channel", "type": VariableType.CONSTANT}, {"name": "g_Ca_L_Centre_0DCapable", "units": "microS", "component": "L_type_Ca_channel", "type": VariableType.CONSTANT}, {"name": "g_Ca_L_Periphery_0DCapable", "units": "microS", "component": "L_type_Ca_channel", "type": VariableType.CONSTANT}, + {"name": "g_Ca_L", "units": "microS", "component": "L_type_Ca_channel", "type": VariableType.COMPUTED_CONSTANT}, {"name": "E_Ca_L", "units": "millivolt", "component": "L_type_Ca_channel", "type": VariableType.CONSTANT}, - {"name": "d_L_infinity", "units": "dimensionless", "component": "L_type_Ca_channel_d_gate", "type": VariableType.ALGEBRAIC}, {"name": "tau_d_L", "units": "second", "component": "L_type_Ca_channel_d_gate", "type": VariableType.ALGEBRAIC}, + {"name": "d_L_infinity", "units": "dimensionless", "component": "L_type_Ca_channel_d_gate", "type": VariableType.ALGEBRAIC}, {"name": "alpha_d_L", "units": "per_second", "component": "L_type_Ca_channel_d_gate", "type": VariableType.ALGEBRAIC}, {"name": "beta_d_L", "units": "per_second", "component": "L_type_Ca_channel_d_gate", "type": VariableType.ALGEBRAIC}, - {"name": "f_L_infinity", "units": "dimensionless", "component": "L_type_Ca_channel_f_gate", "type": VariableType.ALGEBRAIC}, {"name": "tau_f_L", "units": "second", "component": "L_type_Ca_channel_f_gate", "type": VariableType.ALGEBRAIC}, + {"name": "f_L_infinity", "units": "dimensionless", "component": "L_type_Ca_channel_f_gate", "type": VariableType.ALGEBRAIC}, {"name": "alpha_f_L", "units": "per_second", "component": "L_type_Ca_channel_f_gate", "type": VariableType.ALGEBRAIC}, {"name": "beta_f_L", "units": "per_second", "component": "L_type_Ca_channel_f_gate", "type": VariableType.ALGEBRAIC}, - {"name": "g_Ca_T", "units": "microS", "component": "T_type_Ca_channel", "type": VariableType.COMPUTED_CONSTANT}, {"name": "g_Ca_T_Centre_Published", "units": "microS", "component": "T_type_Ca_channel", "type": VariableType.CONSTANT}, {"name": "g_Ca_T_Periphery_Published", "units": "microS", "component": "T_type_Ca_channel", "type": VariableType.CONSTANT}, {"name": "g_Ca_T_Centre_1DCapable", "units": "microS", "component": "T_type_Ca_channel", "type": VariableType.CONSTANT}, {"name": "g_Ca_T_Periphery_1DCapable", "units": "microS", "component": "T_type_Ca_channel", "type": VariableType.CONSTANT}, {"name": "g_Ca_T_Centre_0DCapable", "units": "microS", "component": "T_type_Ca_channel", "type": VariableType.CONSTANT}, {"name": "g_Ca_T_Periphery_0DCapable", "units": "microS", "component": "T_type_Ca_channel", "type": VariableType.CONSTANT}, + {"name": "g_Ca_T", "units": "microS", "component": "T_type_Ca_channel", "type": VariableType.COMPUTED_CONSTANT}, {"name": "E_Ca_T", "units": "millivolt", "component": "T_type_Ca_channel", "type": VariableType.CONSTANT}, - {"name": "d_T_infinity", "units": "dimensionless", "component": "T_type_Ca_channel_d_gate", "type": VariableType.ALGEBRAIC}, {"name": "tau_d_T", "units": "second", "component": "T_type_Ca_channel_d_gate", "type": VariableType.ALGEBRAIC}, + {"name": "d_T_infinity", "units": "dimensionless", "component": "T_type_Ca_channel_d_gate", "type": VariableType.ALGEBRAIC}, {"name": "alpha_d_T", "units": "per_second", "component": "T_type_Ca_channel_d_gate", "type": VariableType.ALGEBRAIC}, {"name": "beta_d_T", "units": "per_second", "component": "T_type_Ca_channel_d_gate", "type": VariableType.ALGEBRAIC}, - {"name": "f_T_infinity", "units": "dimensionless", "component": "T_type_Ca_channel_f_gate", "type": VariableType.ALGEBRAIC}, {"name": "tau_f_T", "units": "second", "component": "T_type_Ca_channel_f_gate", "type": VariableType.ALGEBRAIC}, + {"name": "f_T_infinity", "units": "dimensionless", "component": "T_type_Ca_channel_f_gate", "type": VariableType.ALGEBRAIC}, {"name": "alpha_f_T", "units": "per_second", "component": "T_type_Ca_channel_f_gate", "type": VariableType.ALGEBRAIC}, {"name": "beta_f_T", "units": "per_second", "component": "T_type_Ca_channel_f_gate", "type": VariableType.ALGEBRAIC}, - {"name": "g_to", "units": "microS", "component": "four_AP_sensitive_currents", "type": VariableType.COMPUTED_CONSTANT}, {"name": "g_to_Centre_Published", "units": "microS", "component": "four_AP_sensitive_currents", "type": VariableType.CONSTANT}, {"name": "g_to_Periphery_Published", "units": "microS", "component": "four_AP_sensitive_currents", "type": VariableType.CONSTANT}, {"name": "g_to_Centre_1DCapable", "units": "microS", "component": "four_AP_sensitive_currents", "type": VariableType.CONSTANT}, {"name": "g_to_Periphery_1DCapable", "units": "microS", "component": "four_AP_sensitive_currents", "type": VariableType.CONSTANT}, {"name": "g_to_Centre_0DCapable", "units": "microS", "component": "four_AP_sensitive_currents", "type": VariableType.CONSTANT}, {"name": "g_to_Periphery_0DCapable", "units": "microS", "component": "four_AP_sensitive_currents", "type": VariableType.CONSTANT}, - {"name": "g_sus", "units": "microS", "component": "four_AP_sensitive_currents", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "g_to", "units": "microS", "component": "four_AP_sensitive_currents", "type": VariableType.COMPUTED_CONSTANT}, {"name": "g_sus_Centre_Published", "units": "microS", "component": "four_AP_sensitive_currents", "type": VariableType.CONSTANT}, {"name": "g_sus_Periphery_Published", "units": "microS", "component": "four_AP_sensitive_currents", "type": VariableType.CONSTANT}, {"name": "g_sus_Centre_1DCapable", "units": "microS", "component": "four_AP_sensitive_currents", "type": VariableType.CONSTANT}, {"name": "g_sus_Periphery_1DCapable", "units": "microS", "component": "four_AP_sensitive_currents", "type": VariableType.CONSTANT}, {"name": "g_sus_Centre_0DCapable", "units": "microS", "component": "four_AP_sensitive_currents", "type": VariableType.CONSTANT}, {"name": "g_sus_Periphery_0DCapable", "units": "microS", "component": "four_AP_sensitive_currents", "type": VariableType.CONSTANT}, - {"name": "q_infinity", "units": "dimensionless", "component": "four_AP_sensitive_currents_q_gate", "type": VariableType.ALGEBRAIC}, + {"name": "g_sus", "units": "microS", "component": "four_AP_sensitive_currents", "type": VariableType.COMPUTED_CONSTANT}, {"name": "tau_q", "units": "second", "component": "four_AP_sensitive_currents_q_gate", "type": VariableType.ALGEBRAIC}, - {"name": "r_infinity", "units": "dimensionless", "component": "four_AP_sensitive_currents_r_gate", "type": VariableType.ALGEBRAIC}, + {"name": "q_infinity", "units": "dimensionless", "component": "four_AP_sensitive_currents_q_gate", "type": VariableType.ALGEBRAIC}, {"name": "tau_r", "units": "second", "component": "four_AP_sensitive_currents_r_gate", "type": VariableType.ALGEBRAIC}, - {"name": "g_K_r", "units": "microS", "component": "rapid_delayed_rectifying_potassium_current", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "r_infinity", "units": "dimensionless", "component": "four_AP_sensitive_currents_r_gate", "type": VariableType.ALGEBRAIC}, {"name": "g_K_r_Centre_Published", "units": "microS", "component": "rapid_delayed_rectifying_potassium_current", "type": VariableType.CONSTANT}, {"name": "g_K_r_Periphery_Published", "units": "microS", "component": "rapid_delayed_rectifying_potassium_current", "type": VariableType.CONSTANT}, {"name": "g_K_r_Centre_1DCapable", "units": "microS", "component": "rapid_delayed_rectifying_potassium_current", "type": VariableType.CONSTANT}, {"name": "g_K_r_Periphery_1DCapable", "units": "microS", "component": "rapid_delayed_rectifying_potassium_current", "type": VariableType.CONSTANT}, {"name": "g_K_r_Centre_0DCapable", "units": "microS", "component": "rapid_delayed_rectifying_potassium_current", "type": VariableType.CONSTANT}, {"name": "g_K_r_Periphery_0DCapable", "units": "microS", "component": "rapid_delayed_rectifying_potassium_current", "type": VariableType.CONSTANT}, + {"name": "g_K_r", "units": "microS", "component": "rapid_delayed_rectifying_potassium_current", "type": VariableType.COMPUTED_CONSTANT}, {"name": "P_a", "units": "dimensionless", "component": "rapid_delayed_rectifying_potassium_current", "type": VariableType.ALGEBRAIC}, - {"name": "P_af_infinity", "units": "dimensionless", "component": "rapid_delayed_rectifying_potassium_current_P_af_gate", "type": VariableType.ALGEBRAIC}, {"name": "tau_P_af", "units": "second", "component": "rapid_delayed_rectifying_potassium_current_P_af_gate", "type": VariableType.ALGEBRAIC}, - {"name": "P_as_infinity", "units": "dimensionless", "component": "rapid_delayed_rectifying_potassium_current_P_as_gate", "type": VariableType.ALGEBRAIC}, + {"name": "P_af_infinity", "units": "dimensionless", "component": "rapid_delayed_rectifying_potassium_current_P_af_gate", "type": VariableType.ALGEBRAIC}, {"name": "tau_P_as", "units": "second", "component": "rapid_delayed_rectifying_potassium_current_P_as_gate", "type": VariableType.ALGEBRAIC}, + {"name": "P_as_infinity", "units": "dimensionless", "component": "rapid_delayed_rectifying_potassium_current_P_as_gate", "type": VariableType.ALGEBRAIC}, {"name": "tau_P_i", "units": "second", "component": "rapid_delayed_rectifying_potassium_current_P_i_gate", "type": VariableType.COMPUTED_CONSTANT}, {"name": "P_i_infinity", "units": "dimensionless", "component": "rapid_delayed_rectifying_potassium_current_P_i_gate", "type": VariableType.ALGEBRAIC}, - {"name": "g_K_s", "units": "microS", "component": "slow_delayed_rectifying_potassium_current", "type": VariableType.COMPUTED_CONSTANT}, {"name": "g_K_s_Centre_Published", "units": "microS", "component": "slow_delayed_rectifying_potassium_current", "type": VariableType.CONSTANT}, {"name": "g_K_s_Periphery_Published", "units": "microS", "component": "slow_delayed_rectifying_potassium_current", "type": VariableType.CONSTANT}, {"name": "g_K_s_Centre_1DCapable", "units": "microS", "component": "slow_delayed_rectifying_potassium_current", "type": VariableType.CONSTANT}, {"name": "g_K_s_Periphery_1DCapable", "units": "microS", "component": "slow_delayed_rectifying_potassium_current", "type": VariableType.CONSTANT}, {"name": "g_K_s_Centre_0DCapable", "units": "microS", "component": "slow_delayed_rectifying_potassium_current", "type": VariableType.CONSTANT}, {"name": "g_K_s_Periphery_0DCapable", "units": "microS", "component": "slow_delayed_rectifying_potassium_current", "type": VariableType.CONSTANT}, - {"name": "alpha_xs", "units": "per_second", "component": "slow_delayed_rectifying_potassium_current_xs_gate", "type": VariableType.ALGEBRAIC}, + {"name": "g_K_s", "units": "microS", "component": "slow_delayed_rectifying_potassium_current", "type": VariableType.COMPUTED_CONSTANT}, {"name": "beta_xs", "units": "per_second", "component": "slow_delayed_rectifying_potassium_current_xs_gate", "type": VariableType.ALGEBRAIC}, - {"name": "g_f_Na", "units": "microS", "component": "hyperpolarisation_activated_current", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "alpha_xs", "units": "per_second", "component": "slow_delayed_rectifying_potassium_current_xs_gate", "type": VariableType.ALGEBRAIC}, {"name": "g_f_Na_Centre_Published", "units": "microS", "component": "hyperpolarisation_activated_current", "type": VariableType.CONSTANT}, {"name": "g_f_Na_Periphery_Published", "units": "microS", "component": "hyperpolarisation_activated_current", "type": VariableType.CONSTANT}, {"name": "g_f_Na_Centre_1DCapable", "units": "microS", "component": "hyperpolarisation_activated_current", "type": VariableType.CONSTANT}, {"name": "g_f_Na_Periphery_1DCapable", "units": "microS", "component": "hyperpolarisation_activated_current", "type": VariableType.CONSTANT}, {"name": "g_f_Na_Centre_0DCapable", "units": "microS", "component": "hyperpolarisation_activated_current", "type": VariableType.CONSTANT}, {"name": "g_f_Na_Periphery_0DCapable", "units": "microS", "component": "hyperpolarisation_activated_current", "type": VariableType.CONSTANT}, - {"name": "g_f_K", "units": "microS", "component": "hyperpolarisation_activated_current", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "g_f_Na", "units": "microS", "component": "hyperpolarisation_activated_current", "type": VariableType.COMPUTED_CONSTANT}, {"name": "g_f_K_Centre_Published", "units": "microS", "component": "hyperpolarisation_activated_current", "type": VariableType.CONSTANT}, {"name": "g_f_K_Periphery_Published", "units": "microS", "component": "hyperpolarisation_activated_current", "type": VariableType.CONSTANT}, {"name": "g_f_K_Centre_1DCapable", "units": "microS", "component": "hyperpolarisation_activated_current", "type": VariableType.CONSTANT}, {"name": "g_f_K_Periphery_1DCapable", "units": "microS", "component": "hyperpolarisation_activated_current", "type": VariableType.CONSTANT}, {"name": "g_f_K_Centre_0DCapable", "units": "microS", "component": "hyperpolarisation_activated_current", "type": VariableType.CONSTANT}, {"name": "g_f_K_Periphery_0DCapable", "units": "microS", "component": "hyperpolarisation_activated_current", "type": VariableType.CONSTANT}, - {"name": "alpha_y", "units": "per_second", "component": "hyperpolarisation_activated_current_y_gate", "type": VariableType.ALGEBRAIC}, - {"name": "beta_y", "units": "per_second", "component": "hyperpolarisation_activated_current_y_gate", "type": VariableType.ALGEBRAIC} + {"name": "g_f_K", "units": "microS", "component": "hyperpolarisation_activated_current", "type": VariableType.COMPUTED_CONSTANT}, + {"name": "beta_y", "units": "per_second", "component": "hyperpolarisation_activated_current_y_gate", "type": VariableType.ALGEBRAIC}, + {"name": "alpha_y", "units": "per_second", "component": "hyperpolarisation_activated_current_y_gate", "type": VariableType.ALGEBRAIC} ] @@ -245,279 +245,279 @@ def create_variables_array(): def initialise_variables(states, rates, variables): - variables[1] = 0.0 - variables[2] = 1.0 - variables[3] = 1.0309347 - variables[5] = 2.0e-5 - variables[6] = 6.5e-5 + variables[0] = 0.0 + variables[1] = 1.0 + variables[2] = 1.0309347 + variables[4] = 2.0e-5 + variables[5] = 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[25] = 5.8e-5 + variables[26] = 0.000189 + variables[27] = 5.8e-5 + variables[28] = 0.000189 + variables[29] = 5.81818e-5 + variables[30] = 0.0001888 + variables[33] = 2.52e-5 + variables[34] = 8.19e-5 + variables[35] = 2.52e-5 + variables[36] = 8.19e-5 + variables[37] = 2.523636e-5 + variables[38] = 8.1892e-5 + variables[41] = 1.32e-5 + variables[42] = 4.3e-5 + variables[43] = 1.323e-5 + variables[44] = 4.29e-5 + variables[45] = 1.3236e-5 + variables[46] = 4.2952e-5 + variables[49] = 2.7e-6 + variables[50] = 8.8e-6 + variables[51] = 2.8e-6 + variables[52] = 8.8e-6 + variables[53] = 2.7229e-6 + variables[54] = 8.83584e-6 variables[56] = 8.0 - variables[57] = 0.5 - variables[58] = 2.0 - variables[59] = 140.0 + variables[57] = 2.0 + variables[58] = 140.0 + variables[59] = 0.0001 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[61] = 0.5 + variables[62] = 0.0478 + variables[63] = 0.16 + variables[64] = 0.0478 + variables[65] = 0.16 + variables[66] = 0.04782545 + variables[67] = 0.1551936 variables[69] = 5.4 variables[70] = 0.621 variables[71] = 5.64 + variables[72] = 0.0 variables[73] = 0.0 - variables[74] = 0.0 - variables[75] = 0.0042 - variables[76] = 0.03339 + variables[74] = 0.0042 + variables[75] = 0.03339 + variables[76] = 0.0 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[81] = 0.0 + variables[82] = 1.2e-6 + variables[83] = 0.0 + variables[84] = 3.7e-7 + variables[85] = 0.0 + variables[86] = 1.204e-6 + variables[96] = 0.0058 + variables[97] = 0.0659 + variables[98] = 0.0082 + variables[99] = 0.0659 + variables[100] = 0.0057938 + variables[101] = 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[112] = 0.0043 + variables[113] = 0.0139 + variables[114] = 0.0021 + variables[115] = 0.00694 + variables[116] = 0.00427806 + variables[117] = 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 + variables[128] = 0.00491 + variables[129] = 0.03649 + variables[130] = 0.004905 + variables[131] = 0.0365 + variables[132] = 0.004905 + variables[133] = 0.036495 + variables[135] = 6.65e-5 + variables[136] = 0.0114 + variables[137] = 0.000266 + variables[138] = 0.0114 + variables[139] = 6.645504e-5 + variables[140] = 0.01138376 + variables[146] = 0.000797 + variables[147] = 0.016 + variables[148] = 0.000738 + variables[149] = 0.0208 + variables[150] = 0.00079704 + variables[151] = 0.016 + variables[160] = 0.000518 + variables[161] = 0.0104 + variables[162] = 0.000345 + variables[163] = 0.0104 + variables[164] = 0.0003445 + variables[165] = 0.0104 + variables[169] = 0.000548 + variables[170] = 0.0069 + variables[171] = 0.000437 + variables[172] = 0.0055 + variables[173] = 0.0005465 + variables[174] = 0.006875 + variables[176] = 0.000548 + variables[177] = 0.0069 + variables[178] = 0.000437 + variables[179] = 0.0055 + variables[180] = 0.0005465 + variables[181] = 0.006875 states[0] = -39.013558536 states[1] = 0.092361701692 - states[2] = 0.015905380261 - states[3] = 0.01445216109 - states[4] = 0.48779845203 - states[5] = 0.04804900895 + states[2] = 0.01445216109 + states[3] = 0.015905380261 + states[4] = 0.04804900895 + states[5] = 0.48779845203 states[6] = 0.038968420558 states[7] = 0.42074047435 states[8] = 0.064402950262 states[9] = 0.29760539675 states[10] = 0.87993375273 - states[11] = 0.13034201158 - states[12] = 0.46960956028 + states[11] = 0.46960956028 + states[12] = 0.13034201158 states[13] = 0.082293827208 states[14] = 0.03889291759 def compute_computed_constants(variables): - 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[3] = 1.07*(3.0*variables[0]-0.1)/(3.0*(1.0+0.7745*exp(-(3.0*variables[0]-2.05)/0.295))) if eq_func(variables[1], 0.0) else variables[2]*variables[0]/(1.0+0.7745*exp(-(3.0*variables[0]-2.05)/0.295)) if eq_func(variables[1], 1.0) else 1.07*29.0*variables[0]/(30.0*(1.0+0.7745*exp(-(29.0*variables[0]-24.5)/1.95))) + variables[6] = variables[4]+variables[3]*(variables[5]-variables[4]) + variables[31] = variables[25]+variables[3]*(variables[26]-variables[25]) if eq_func(variables[1], 0.0) else variables[29]+variables[3]*(variables[30]-variables[29]) if eq_func(variables[1], 1.0) else variables[27]+variables[3]*(variables[28]-variables[27]) + variables[39] = variables[33]+variables[3]*(variables[34]-variables[33]) if eq_func(variables[1], 0.0) else variables[37]+variables[3]*(variables[38]-variables[37]) if eq_func(variables[1], 1.0) else variables[35]+variables[3]*(variables[36]-variables[35]) + variables[47] = variables[41]+variables[3]*(variables[42]-variables[41]) if eq_func(variables[1], 0.0) else variables[45]+variables[3]*(variables[46]-variables[45]) if eq_func(variables[1], 1.0) else variables[43]+variables[3]*(variables[44]-variables[43]) + variables[55] = variables[49]+variables[3]*(variables[50]-variables[49]) if eq_func(variables[1], 0.0) else variables[53]+variables[3]*(variables[54]-variables[53]) if eq_func(variables[1], 1.0) else variables[51]+variables[3]*(variables[52]-variables[51]) + variables[68] = variables[62]+variables[3]*(variables[63]-variables[62]) if eq_func(variables[1], 0.0) else variables[66]+variables[3]*(variables[67]-variables[66]) if eq_func(variables[1], 1.0) else variables[64]+variables[3]*(variables[65]-variables[64]) + variables[78] = variables[72]+variables[3]*(variables[73]-variables[72]) if eq_func(variables[1], 0.0) else variables[76]+variables[3]*(variables[77]-variables[76]) if eq_func(variables[1], 1.0) else variables[74]+variables[3]*(variables[75]-variables[74]) + variables[7] = variables[78]*variables[59]/(variables[59]+0.0004) + variables[32] = variables[22]*variables[23]/variables[24]*log(variables[58]/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]) + variables[48] = variables[22]*variables[23]/(2.0*variables[24])*log(variables[57]/variables[59]) + variables[80] = variables[22]*variables[23]/variables[24]*log((variables[69]+0.12*variables[58])/(variables[79]+0.12*variables[56])) if eq_func(variables[1], 0.0) else variables[22]*variables[23]/variables[24]*log((variables[69]+0.03*variables[58])/(variables[79]+0.03*variables[56])) + variables[87] = variables[81]+variables[3]*(variables[82]-variables[81]) if eq_func(variables[1], 0.0) else variables[85]+variables[3]*(variables[86]-variables[85]) if eq_func(variables[1], 1.0) else variables[83]+variables[3]*(variables[84]-variables[83]) + variables[102] = variables[96]+variables[3]*(variables[97]-variables[96]) if eq_func(variables[1], 0.0) else variables[100]+variables[3]*(variables[101]-variables[100]) if eq_func(variables[1], 1.0) else variables[98]+variables[3]*(variables[99]-variables[98]) + variables[118] = variables[112]+variables[3]*(variables[113]-variables[112]) if eq_func(variables[1], 0.0) else variables[116]+variables[3]*(variables[117]-variables[116]) if eq_func(variables[1], 1.0) else variables[114]+variables[3]*(variables[115]-variables[114]) + variables[134] = variables[128]+variables[3]*(variables[129]-variables[128]) if eq_func(variables[1], 0.0) else variables[132]+variables[3]*(variables[133]-variables[132]) if eq_func(variables[1], 1.0) else variables[130]+variables[3]*(variables[131]-variables[130]) + variables[141] = variables[135]+variables[3]*(variables[136]-variables[135]) if eq_func(variables[1], 0.0) else variables[139]+variables[3]*(variables[140]-variables[139]) if eq_func(variables[1], 1.0) else variables[137]+variables[3]*(variables[138]-variables[137]) + variables[152] = variables[146]+variables[3]*(variables[147]-variables[146]) if eq_func(variables[1], 0.0) else variables[150]+variables[3]*(variables[151]-variables[150]) if eq_func(variables[1], 1.0) else variables[148]+variables[3]*(variables[149]-variables[148]) + variables[158] = 0.002 if eq_func(variables[1], 0.0) else 0.002 if eq_func(variables[1], 1.0) else 0.006 + variables[166] = variables[160]+variables[3]*(variables[161]-variables[160]) if eq_func(variables[1], 0.0) else variables[164]+variables[3]*(variables[165]-variables[164]) if eq_func(variables[1], 1.0) else variables[162]+variables[3]*(variables[163]-variables[162]) + variables[175] = variables[169]+variables[3]*(variables[170]-variables[169]) if eq_func(variables[1], 0.0) else variables[173]+variables[3]*(variables[174]-variables[173]) if eq_func(variables[1], 1.0) else variables[171]+variables[3]*(variables[172]-variables[171]) + variables[182] = variables[176]+variables[3]*(variables[177]-variables[176]) if eq_func(variables[1], 0.0) else variables[180]+variables[3]*(variables[181]-variables[180]) if eq_func(variables[1], 1.0) else variables[178]+variables[3]*(variables[179]-variables[178]) def compute_rates(voi, states, rates, variables): - 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[8] = variables[68]*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[9] = variables[55]*(pow(variables[56], 3.0)*variables[57]*exp(0.03743*states[0]*variables[61])-pow(variables[58], 3.0)*variables[59]*exp(0.0374*states[0]*(variables[61]-1.0)))/(1.0+variables[60]*(variables[59]*pow(variables[58], 3.0)+variables[57]*pow(variables[56], 3.0))) if eq_func(variables[1], 0.0) else variables[55]*(pow(variables[56], 3.0)*variables[57]*exp(0.03743*states[0]*variables[61])-pow(variables[58], 3.0)*variables[59]*exp(0.03743*states[0]*(variables[61]-1.0)))/(1.0+variables[60]*(variables[59]*pow(variables[58], 3.0)+variables[57]*pow(variables[56], 3.0))) + variables[13] = variables[182]*states[14]*(states[0]-variables[40]) if neq_func(variables[1], 2.0) else variables[182]*states[14]*(states[0]+102.0) + variables[14] = variables[175]*states[14]*(states[0]-variables[32]) if neq_func(variables[1], 2.0) else variables[175]*states[14]*(states[0]-77.6) + variables[15] = variables[166]*pow(states[13], 2.0)*(states[0]-variables[80]) + variables[17] = variables[141]*states[8]*(states[0]-variables[40]) + variables[18] = variables[134]*states[9]*states[8]*(states[0]-variables[40]) + variables[19] = variables[118]*states[7]*states[6]*(states[0]-variables[119]) + variables[20] = variables[102]*(states[5]*states[4]+0.006/(1.0+exp(-(states[0]+14.1)/6.0)))*(states[0]-variables[103]) + variables[10] = variables[39]*(states[0]-variables[40]) + variables[11] = variables[47]*(states[0]-variables[48]) + variables[12] = variables[31]*(states[0]-variables[32]) + variables[153] = 0.6*states[12]+0.4*states[11] + variables[16] = variables[152]*variables[153]*states[10]*(states[0]-variables[40]) + 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[1], 0.0) else 0.09518*exp(-0.06306*(states[0]+34.4))/(1.0+1.662*exp(-0.2251*(states[0]+63.7)))+0.08693 + variables[88] = (1.0-variables[91])*states[3]+variables[91]*states[2] + variables[21] = variables[87]*pow(states[1], 3.0)*variables[88]*variables[58]*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] + rates[0] = -1.0/variables[6]*(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[7]) + variables[89] = 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[1], 0.0) else 0.0006247/(0.8322166*exp(-0.33566*(states[0]+56.7062))+0.6274*exp(0.0823*(states[0]+65.0131)))+4.569e-5 + variables[90] = pow(1.0/(1.0+exp(-states[0]/5.46)), 1.0/3.0) if eq_func(variables[1], 0.0) else pow(1.0/(1.0+exp(-(states[0]+30.32)/5.46)), 1.0/3.0) + rates[1] = (variables[90]-states[1])/variables[89] + variables[92] = 3.717e-6*exp(-0.2815*(states[0]+17.11))/(1.0+0.003732*exp(-0.3426*(states[0]+37.76)))+0.0005977 + variables[93] = 1.0/(1.0+exp((states[0]+66.1)/6.4)) + rates[3] = (variables[93]-states[3])/variables[92] + variables[94] = 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[95] = variables[93] + rates[2] = (variables[95]-states[2])/variables[94] + variables[107] = 11.43*(states[0]-5.0)/(exp(0.4*(states[0]-5.0))-1.0) if eq_func(variables[1], 1.0) else 11.42*(states[0]-5.0)/(exp(0.4*(states[0]-5.0))-1.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[1], 0.0) else -28.39*(states[0]+35.0)/(exp(-(states[0]+35.0)/2.5)-1.0)-84.9*states[0]/(exp(-0.208*states[0])-1.0) if eq_func(variables[1], 1.0) else -28.4*(states[0]+35.0)/(exp(-(states[0]+35.0)/2.5)-1.0)-84.9*states[0]/(exp(-0.208*states[0])-1.0) + variables[104] = 2.0/(variables[106]+variables[107]) + variables[105] = 1.0/(1.0+exp(-(states[0]+23.1)/6.0)) if eq_func(variables[1], 0.0) else 1.0/(1.0+exp(-(states[0]+22.3+0.8*variables[3])/6.0)) if eq_func(variables[1], 1.0) else 1.0/(1.0+exp(-(states[0]+22.2)/6.0)) + rates[4] = (variables[105]-states[4])/variables[104] + variables[111] = 30.0/(1.0+exp(-(states[0]+28.0)/4.0)) if eq_func(variables[1], 1.0) else 25.0/(1.0+exp(-(states[0]+28.0)/4.0)) + variables[110] = 3.75*(states[0]+28.0)/(exp((states[0]+28.0)/4.0)-1.0) if eq_func(variables[1], 1.0) else 3.12*(states[0]+28.0)/(exp((states[0]+28.0)/4.0)-1.0) + variables[108] = (1.2-0.2*variables[3])/(variables[110]+variables[111]) if eq_func(variables[1], 1.0) else 1.0/(variables[110]+variables[111]) + variables[109] = 1.0/(1.0+exp((states[0]+45.0)/5.0)) + rates[5] = (variables[109]-states[5])/variables[108] 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[122] = 1068.0*exp((states[0]+26.3)/30.0) + variables[120] = 1.0/(variables[122]+variables[123]) + variables[121] = 1.0/(1.0+exp(-(states[0]+37.0)/6.8)) + rates[7] = (variables[121]-states[7])/variables[120] + variables[127] = 15.0*exp((states[0]+71.0)/15.38) if eq_func(variables[1], 1.0) else 15.0*exp((states[0]+71.7)/15.38) + variables[126] = 15.3*exp(-(states[0]+71.0+0.7*variables[3])/83.3) if eq_func(variables[1], 1.0) else 15.3*exp(-(states[0]+71.7)/83.3) + variables[124] = 1.0/(variables[126]+variables[127]) + variables[125] = 1.0/(1.0+exp((states[0]+71.0)/9.0)) + rates[6] = (variables[125]-states[6])/variables[124] + variables[142] = 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[1], 0.0) else 0.001/3.0*(30.31+195.5/(0.5686*exp(-0.08161*(states[0]+39.0+10.0*variables[3]))+0.7174*exp((0.2719-0.1719*variables[3])*1.0*(states[0]+40.93+10.0*variables[3])))) if eq_func(variables[1], 1.0) else 0.0101+0.06517/(0.5686*exp(-0.08161*(states[0]+39.0))+0.7174*exp(0.2719*(states[0]+40.93))) + variables[143] = 1.0/(1.0+exp((states[0]+59.37)/13.1)) + rates[9] = (variables[143]-states[9])/variables[142] + variables[144] = 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[1], 0.0) else 0.0025*(1.191+7.838/(1.037*exp(0.09012*(states[0]+30.61))+0.369*exp(-0.119*(states[0]+23.84)))) if eq_func(variables[1], 1.0) else 0.001*(2.98+19.59/(1.037*exp(0.09012*(states[0]+30.61))+0.369*exp(-0.119*(states[0]+23.84)))) + variables[145] = 1.0/(1.0+exp(-(states[0]-10.93)/19.7)) + rates[8] = (variables[145]-states[8])/variables[144] + variables[154] = 1.0/(37.2*exp((states[0]-9.0)/15.9)+0.96*exp(-(states[0]-9.0)/22.5)) if neq_func(variables[1], 2.0) else 1.0/(37.2*exp((states[0]-10.0)/15.9)+0.96*exp(-(states[0]-10.0)/22.5)) + variables[155] = 1.0/(1.0+exp(-(states[0]+14.2)/10.6)) if neq_func(variables[1], 2.0) else 1.0/(1.0+exp(-(states[0]+13.2)/10.6)) + rates[12] = (variables[155]-states[12])/variables[154] + variables[156] = 1.0/(4.2*exp((states[0]-9.0)/17.0)+0.15*exp(-(states[0]-9.0)/21.6)) if neq_func(variables[1], 2.0) else 1.0/(4.2*exp((states[0]-10.0)/17.0)+0.15*exp(-(states[0]-10.0)/21.6)) + variables[157] = variables[155] + rates[11] = (variables[157]-states[11])/variables[156] 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] + variables[167] = 1.0*exp(-states[0]/45.0) + variables[168] = 14.0/(1.0+exp(-(states[0]-40.0)/9.0)) + rates[13] = variables[168]*(1.0-states[13])-variables[167]*states[13] + variables[183] = 1.0*exp((states[0]+75.13)/21.25) + variables[184] = 1.0*exp(-(states[0]+78.91)/26.62) if eq_func(variables[1], 0.0) else 1.0*exp(-(states[0]+78.91)/26.63) + rates[14] = variables[184]*(1.0-states[14])-variables[183]*states[14] def compute_variables(voi, states, rates, variables): - 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[12] = variables[31]*(states[0]-variables[32]) + variables[10] = variables[39]*(states[0]-variables[40]) + variables[11] = variables[47]*(states[0]-variables[48]) + variables[9] = variables[55]*(pow(variables[56], 3.0)*variables[57]*exp(0.03743*states[0]*variables[61])-pow(variables[58], 3.0)*variables[59]*exp(0.0374*states[0]*(variables[61]-1.0)))/(1.0+variables[60]*(variables[59]*pow(variables[58], 3.0)+variables[57]*pow(variables[56], 3.0))) if eq_func(variables[1], 0.0) else variables[55]*(pow(variables[56], 3.0)*variables[57]*exp(0.03743*states[0]*variables[61])-pow(variables[58], 3.0)*variables[59]*exp(0.03743*states[0]*(variables[61]-1.0)))/(1.0+variables[60]*(variables[59]*pow(variables[58], 3.0)+variables[57]*pow(variables[56], 3.0))) + variables[8] = variables[68]*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[1], 0.0) else 0.09518*exp(-0.06306*(states[0]+34.4))/(1.0+1.662*exp(-0.2251*(states[0]+63.7)))+0.08693 + variables[88] = (1.0-variables[91])*states[3]+variables[91]*states[2] + variables[21] = variables[87]*pow(states[1], 3.0)*variables[88]*variables[58]*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[90] = pow(1.0/(1.0+exp(-states[0]/5.46)), 1.0/3.0) if eq_func(variables[1], 0.0) else pow(1.0/(1.0+exp(-(states[0]+30.32)/5.46)), 1.0/3.0) + variables[89] = 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[1], 0.0) else 0.0006247/(0.8322166*exp(-0.33566*(states[0]+56.7062))+0.6274*exp(0.0823*(states[0]+65.0131)))+4.569e-5 + variables[93] = 1.0/(1.0+exp((states[0]+66.1)/6.4)) + variables[95] = variables[93] + variables[92] = 3.717e-6*exp(-0.2815*(states[0]+17.11))/(1.0+0.003732*exp(-0.3426*(states[0]+37.76)))+0.0005977 + variables[94] = 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[20] = variables[102]*(states[5]*states[4]+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[1], 0.0) else -28.39*(states[0]+35.0)/(exp(-(states[0]+35.0)/2.5)-1.0)-84.9*states[0]/(exp(-0.208*states[0])-1.0) if eq_func(variables[1], 1.0) else -28.4*(states[0]+35.0)/(exp(-(states[0]+35.0)/2.5)-1.0)-84.9*states[0]/(exp(-0.208*states[0])-1.0) + variables[107] = 11.43*(states[0]-5.0)/(exp(0.4*(states[0]-5.0))-1.0) if eq_func(variables[1], 1.0) else 11.42*(states[0]-5.0)/(exp(0.4*(states[0]-5.0))-1.0) + variables[104] = 2.0/(variables[106]+variables[107]) + variables[105] = 1.0/(1.0+exp(-(states[0]+23.1)/6.0)) if eq_func(variables[1], 0.0) else 1.0/(1.0+exp(-(states[0]+22.3+0.8*variables[3])/6.0)) if eq_func(variables[1], 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[1], 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[1], 1.0) else 25.0/(1.0+exp(-(states[0]+28.0)/4.0)) + variables[108] = (1.2-0.2*variables[3])/(variables[110]+variables[111]) if eq_func(variables[1], 1.0) else 1.0/(variables[110]+variables[111]) + variables[109] = 1.0/(1.0+exp((states[0]+45.0)/5.0)) + variables[19] = variables[118]*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[120] = 1.0/(variables[122]+variables[123]) + variables[121] = 1.0/(1.0+exp(-(states[0]+37.0)/6.8)) + variables[126] = 15.3*exp(-(states[0]+71.0+0.7*variables[3])/83.3) if eq_func(variables[1], 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[1], 1.0) else 15.0*exp((states[0]+71.7)/15.38) + variables[124] = 1.0/(variables[126]+variables[127]) + variables[125] = 1.0/(1.0+exp((states[0]+71.0)/9.0)) + variables[18] = variables[134]*states[9]*states[8]*(states[0]-variables[40]) + variables[17] = variables[141]*states[8]*(states[0]-variables[40]) + variables[143] = 1.0/(1.0+exp((states[0]+59.37)/13.1)) + variables[142] = 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[1], 0.0) else 0.001/3.0*(30.31+195.5/(0.5686*exp(-0.08161*(states[0]+39.0+10.0*variables[3]))+0.7174*exp((0.2719-0.1719*variables[3])*1.0*(states[0]+40.93+10.0*variables[3])))) if eq_func(variables[1], 1.0) else 0.0101+0.06517/(0.5686*exp(-0.08161*(states[0]+39.0))+0.7174*exp(0.2719*(states[0]+40.93))) + variables[145] = 1.0/(1.0+exp(-(states[0]-10.93)/19.7)) + variables[144] = 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[1], 0.0) else 0.0025*(1.191+7.838/(1.037*exp(0.09012*(states[0]+30.61))+0.369*exp(-0.119*(states[0]+23.84)))) if eq_func(variables[1], 1.0) else 0.001*(2.98+19.59/(1.037*exp(0.09012*(states[0]+30.61))+0.369*exp(-0.119*(states[0]+23.84)))) + variables[153] = 0.6*states[12]+0.4*states[11] + variables[16] = variables[152]*variables[153]*states[10]*(states[0]-variables[40]) + variables[155] = 1.0/(1.0+exp(-(states[0]+14.2)/10.6)) if neq_func(variables[1], 2.0) else 1.0/(1.0+exp(-(states[0]+13.2)/10.6)) + variables[154] = 1.0/(37.2*exp((states[0]-9.0)/15.9)+0.96*exp(-(states[0]-9.0)/22.5)) if neq_func(variables[1], 2.0) else 1.0/(37.2*exp((states[0]-10.0)/15.9)+0.96*exp(-(states[0]-10.0)/22.5)) + variables[157] = variables[155] + variables[156] = 1.0/(4.2*exp((states[0]-9.0)/17.0)+0.15*exp(-(states[0]-9.0)/21.6)) if neq_func(variables[1], 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) + variables[15] = variables[166]*pow(states[13], 2.0)*(states[0]-variables[80]) + variables[168] = 14.0/(1.0+exp(-(states[0]-40.0)/9.0)) + variables[167] = 1.0*exp(-states[0]/45.0) + variables[14] = variables[175]*states[14]*(states[0]-variables[32]) if neq_func(variables[1], 2.0) else variables[175]*states[14]*(states[0]-77.6) + variables[13] = variables[182]*states[14]*(states[0]-variables[40]) if neq_func(variables[1], 2.0) else variables[182]*states[14]*(states[0]+102.0) + variables[184] = 1.0*exp(-(states[0]+78.91)/26.62) if eq_func(variables[1], 0.0) else 1.0*exp(-(states[0]+78.91)/26.63) + variables[183] = 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 8e00e89cf5..87ead0ea04 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 @@ -22,10 +22,10 @@ const VariableInfo STATE_INFO[] = { const VariableInfo VARIABLE_INFO[] = { {"i_Stim", "microA_per_cm2", "membrane", EXTERNAL}, + {"Cm", "microF_per_cm2", "membrane", CONSTANT}, {"i_L", "microA_per_cm2", "leakage_current", ALGEBRAIC}, {"i_K", "microA_per_cm2", "potassium_channel", ALGEBRAIC}, {"i_Na", "microA_per_cm2", "sodium_channel", ALGEBRAIC}, - {"Cm", "microF_per_cm2", "membrane", CONSTANT}, {"E_R", "millivolt", "membrane", CONSTANT}, {"E_L", "millivolt", "leakage_current", COMPUTED_CONSTANT}, {"g_L", "milliS_per_cm2", "leakage_current", CONSTANT}, @@ -70,7 +70,7 @@ void deleteArray(double *array) void initialiseVariables(double voi, double *states, double *rates, double *variables, ExternalVariable externalVariable) { - variables[4] = 1.0; + variables[1] = 1.0; variables[5] = 0.0; variables[7] = 0.3; variables[9] = 120.0; @@ -92,31 +92,31 @@ void computeComputedConstants(double *variables) void computeRates(double voi, double *states, double *rates, double *variables, 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[2] = variables[7]*(states[0]-variables[6]); + variables[3] = variables[15]*pow(states[3], 4.0)*(states[0]-variables[14]); + variables[4] = variables[9]*pow(states[2], 3.0)*states[1]*(states[0]-variables[8]); + rates[0] = -(-variables[0]+variables[4]+variables[3]+variables[2])/variables[1]; variables[11] = 4.0*exp(states[0]/18.0); + variables[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.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); + variables[12] = 0.07*exp(states[0]/20.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); + 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]; } void computeVariables(double voi, double *states, double *rates, double *variables, 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[2] = variables[7]*(states[0]-variables[6]); + variables[4] = 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[3] = 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); } 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 9d1faf7582..23f3a6d8e4 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 @@ -31,10 +31,10 @@ class VariableType(Enum): VARIABLE_INFO = [ {"name": "i_Stim", "units": "microA_per_cm2", "component": "membrane", "type": VariableType.EXTERNAL}, + {"name": "Cm", "units": "microF_per_cm2", "component": "membrane", "type": VariableType.CONSTANT}, {"name": "i_L", "units": "microA_per_cm2", "component": "leakage_current", "type": VariableType.ALGEBRAIC}, {"name": "i_K", "units": "microA_per_cm2", "component": "potassium_channel", "type": VariableType.ALGEBRAIC}, {"name": "i_Na", "units": "microA_per_cm2", "component": "sodium_channel", "type": VariableType.ALGEBRAIC}, - {"name": "Cm", "units": "microF_per_cm2", "component": "membrane", "type": VariableType.CONSTANT}, {"name": "E_R", "units": "millivolt", "component": "membrane", "type": VariableType.CONSTANT}, {"name": "E_L", "units": "millivolt", "component": "leakage_current", "type": VariableType.COMPUTED_CONSTANT}, {"name": "g_L", "units": "milliS_per_cm2", "component": "leakage_current", "type": VariableType.CONSTANT}, @@ -72,7 +72,7 @@ def create_variables_array(): def initialise_variables(voi, states, rates, variables, external_variable): - variables[4] = 1.0 + variables[1] = 1.0 variables[5] = 0.0 variables[7] = 0.3 variables[9] = 120.0 @@ -92,29 +92,29 @@ def compute_computed_constants(variables): def compute_rates(voi, states, rates, variables, 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[2] = variables[7]*(states[0]-variables[6]) + variables[3] = variables[15]*pow(states[3], 4.0)*(states[0]-variables[14]) + variables[4] = variables[9]*pow(states[2], 3.0)*states[1]*(states[0]-variables[8]) + rates[0] = -(-variables[0]+variables[4]+variables[3]+variables[2])/variables[1] variables[11] = 4.0*exp(states[0]/18.0) + variables[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.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) + variables[12] = 0.07*exp(states[0]/20.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) + 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] def compute_variables(voi, states, rates, variables, 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[2] = variables[7]*(states[0]-variables[6]) + variables[4] = 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[3] = 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) 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 9756ae7da5..ae7fb100a0 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 @@ -22,10 +22,10 @@ const VariableInfo STATE_INFO[] = { const VariableInfo VARIABLE_INFO[] = { {"i_Stim", "microA_per_cm2", "membrane", ALGEBRAIC}, + {"Cm", "microF_per_cm2", "membrane", CONSTANT}, {"i_L", "microA_per_cm2", "leakage_current", ALGEBRAIC}, {"i_K", "microA_per_cm2", "potassium_channel", ALGEBRAIC}, {"i_Na", "microA_per_cm2", "sodium_channel", ALGEBRAIC}, - {"Cm", "microF_per_cm2", "membrane", CONSTANT}, {"E_R", "millivolt", "membrane", CONSTANT}, {"E_L", "millivolt", "leakage_current", EXTERNAL}, {"g_L", "milliS_per_cm2", "leakage_current", CONSTANT}, @@ -70,7 +70,7 @@ void deleteArray(double *array) void initialiseVariables(double voi, double *states, double *rates, double *variables, ExternalVariable externalVariable) { - variables[4] = 1.0; + variables[1] = 1.0; variables[5] = 0.0; variables[7] = 0.3; variables[9] = 120.0; @@ -92,31 +92,31 @@ void computeRates(double voi, double *states, double *rates, double *variables, { 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[2] = variables[7]*(states[0]-variables[6]); + variables[3] = variables[15]*pow(states[3], 4.0)*(states[0]-variables[14]); + variables[4] = variables[9]*pow(states[2], 3.0)*states[1]*(states[0]-variables[8]); + rates[0] = -(-variables[0]+variables[4]+variables[3]+variables[2])/variables[1]; variables[11] = 4.0*exp(states[0]/18.0); + variables[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.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); + variables[12] = 0.07*exp(states[0]/20.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); + 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]; } void computeVariables(double voi, double *states, double *rates, double *variables, 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[2] = variables[7]*(states[0]-variables[6]); + variables[4] = 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[3] = 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); } 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 0f5ce104ab..d095f3c580 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 @@ -31,10 +31,10 @@ class VariableType(Enum): VARIABLE_INFO = [ {"name": "i_Stim", "units": "microA_per_cm2", "component": "membrane", "type": VariableType.ALGEBRAIC}, + {"name": "Cm", "units": "microF_per_cm2", "component": "membrane", "type": VariableType.CONSTANT}, {"name": "i_L", "units": "microA_per_cm2", "component": "leakage_current", "type": VariableType.ALGEBRAIC}, {"name": "i_K", "units": "microA_per_cm2", "component": "potassium_channel", "type": VariableType.ALGEBRAIC}, {"name": "i_Na", "units": "microA_per_cm2", "component": "sodium_channel", "type": VariableType.ALGEBRAIC}, - {"name": "Cm", "units": "microF_per_cm2", "component": "membrane", "type": VariableType.CONSTANT}, {"name": "E_R", "units": "millivolt", "component": "membrane", "type": VariableType.CONSTANT}, {"name": "E_L", "units": "millivolt", "component": "leakage_current", "type": VariableType.EXTERNAL}, {"name": "g_L", "units": "milliS_per_cm2", "component": "leakage_current", "type": VariableType.CONSTANT}, @@ -72,7 +72,7 @@ def create_variables_array(): def initialise_variables(voi, states, rates, variables, external_variable): - variables[4] = 1.0 + variables[1] = 1.0 variables[5] = 0.0 variables[7] = 0.3 variables[9] = 120.0 @@ -92,29 +92,29 @@ def compute_computed_constants(variables): def compute_rates(voi, states, rates, variables, 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[2] = variables[7]*(states[0]-variables[6]) + variables[3] = variables[15]*pow(states[3], 4.0)*(states[0]-variables[14]) + variables[4] = variables[9]*pow(states[2], 3.0)*states[1]*(states[0]-variables[8]) + rates[0] = -(-variables[0]+variables[4]+variables[3]+variables[2])/variables[1] variables[11] = 4.0*exp(states[0]/18.0) + variables[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.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) + variables[12] = 0.07*exp(states[0]/20.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) + 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] def compute_variables(voi, states, rates, variables, 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[2] = variables[7]*(states[0]-variables[6]) + variables[4] = 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[3] = 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) 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 ff6e2ab581..1daf6c0728 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 @@ -22,10 +22,10 @@ const VariableInfo STATE_INFO[] = { const VariableInfo VARIABLE_INFO[] = { {"i_Stim", "microA_per_cm2", "membrane", ALGEBRAIC}, + {"Cm", "microF_per_cm2", "membrane", EXTERNAL}, {"i_L", "microA_per_cm2", "leakage_current", ALGEBRAIC}, {"i_K", "microA_per_cm2", "potassium_channel", ALGEBRAIC}, {"i_Na", "microA_per_cm2", "sodium_channel", ALGEBRAIC}, - {"Cm", "microF_per_cm2", "membrane", EXTERNAL}, {"E_R", "millivolt", "membrane", CONSTANT}, {"E_L", "millivolt", "leakage_current", COMPUTED_CONSTANT}, {"g_L", "milliS_per_cm2", "leakage_current", CONSTANT}, @@ -78,7 +78,7 @@ void initialiseVariables(double voi, double *states, double *rates, double *vari states[1] = 0.6; states[2] = 0.05; states[3] = 0.325; - variables[4] = externalVariable(voi, states, rates, variables, 4); + variables[1] = externalVariable(voi, states, rates, variables, 1); } void computeComputedConstants(double *variables) @@ -90,33 +90,33 @@ void computeComputedConstants(double *variables) void computeRates(double voi, double *states, double *rates, double *variables, ExternalVariable externalVariable) { + variables[1] = externalVariable(voi, states, rates, variables, 1); 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[2] = variables[7]*(states[0]-variables[6]); + variables[3] = variables[15]*pow(states[3], 4.0)*(states[0]-variables[14]); + variables[4] = variables[9]*pow(states[2], 3.0)*states[1]*(states[0]-variables[8]); + rates[0] = -(-variables[0]+variables[4]+variables[3]+variables[2])/variables[1]; variables[11] = 4.0*exp(states[0]/18.0); + variables[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.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); + variables[12] = 0.07*exp(states[0]/20.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); + 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]; } void computeVariables(double voi, double *states, double *rates, double *variables, 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[2] = variables[7]*(states[0]-variables[6]); + variables[4] = 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[3] = 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); + variables[1] = externalVariable(voi, states, rates, variables, 1); } 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 b8d5d0baf5..8c6c1602a1 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 @@ -31,10 +31,10 @@ class VariableType(Enum): VARIABLE_INFO = [ {"name": "i_Stim", "units": "microA_per_cm2", "component": "membrane", "type": VariableType.ALGEBRAIC}, + {"name": "Cm", "units": "microF_per_cm2", "component": "membrane", "type": VariableType.EXTERNAL}, {"name": "i_L", "units": "microA_per_cm2", "component": "leakage_current", "type": VariableType.ALGEBRAIC}, {"name": "i_K", "units": "microA_per_cm2", "component": "potassium_channel", "type": VariableType.ALGEBRAIC}, {"name": "i_Na", "units": "microA_per_cm2", "component": "sodium_channel", "type": VariableType.ALGEBRAIC}, - {"name": "Cm", "units": "microF_per_cm2", "component": "membrane", "type": VariableType.EXTERNAL}, {"name": "E_R", "units": "millivolt", "component": "membrane", "type": VariableType.CONSTANT}, {"name": "E_L", "units": "millivolt", "component": "leakage_current", "type": VariableType.COMPUTED_CONSTANT}, {"name": "g_L", "units": "milliS_per_cm2", "component": "leakage_current", "type": VariableType.CONSTANT}, @@ -80,7 +80,7 @@ def initialise_variables(voi, states, rates, variables, external_variable): states[1] = 0.6 states[2] = 0.05 states[3] = 0.325 - variables[4] = external_variable(voi, states, rates, variables, 4) + variables[1] = external_variable(voi, states, rates, variables, 1) def compute_computed_constants(variables): @@ -90,31 +90,31 @@ def compute_computed_constants(variables): def compute_rates(voi, states, rates, variables, external_variable): + variables[1] = external_variable(voi, states, rates, variables, 1) 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[2] = variables[7]*(states[0]-variables[6]) + variables[3] = variables[15]*pow(states[3], 4.0)*(states[0]-variables[14]) + variables[4] = variables[9]*pow(states[2], 3.0)*states[1]*(states[0]-variables[8]) + rates[0] = -(-variables[0]+variables[4]+variables[3]+variables[2])/variables[1] variables[11] = 4.0*exp(states[0]/18.0) + variables[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.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) + variables[12] = 0.07*exp(states[0]/20.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) + 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] def compute_variables(voi, states, rates, variables, 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[2] = variables[7]*(states[0]-variables[6]) + variables[4] = 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[3] = 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) + variables[1] = external_variable(voi, states, rates, variables, 1) 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 22acb90160..7b79583ebd 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 @@ -22,10 +22,10 @@ const VariableInfo STATE_INFO[] = { const VariableInfo VARIABLE_INFO[] = { {"i_Stim", "microA_per_cm2", "membrane", ALGEBRAIC}, + {"Cm", "microF_per_cm2", "membrane", CONSTANT}, {"i_L", "microA_per_cm2", "leakage_current", ALGEBRAIC}, {"i_K", "microA_per_cm2", "potassium_channel", ALGEBRAIC}, {"i_Na", "microA_per_cm2", "sodium_channel", ALGEBRAIC}, - {"Cm", "microF_per_cm2", "membrane", CONSTANT}, {"E_R", "millivolt", "membrane", CONSTANT}, {"E_L", "millivolt", "leakage_current", COMPUTED_CONSTANT}, {"g_L", "milliS_per_cm2", "leakage_current", CONSTANT}, @@ -111,7 +111,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]-(-(-variables[0]+variables[4]+variables[3]+variables[2])/variables[1])-0.0; } void findRoot1(double voi, double *states, double *rates, double *variables) @@ -157,9 +157,9 @@ void objectiveFunction3(double *u, double *f, void *data) double *rates = ((RootFindingInfo *) data)->rates; double *variables = ((RootFindingInfo *) data)->variables; - variables[1] = u[0]; + variables[2] = u[0]; - f[0] = variables[1]-variables[7]*(states[0]-variables[6])-0.0; + f[0] = variables[2]-variables[7]*(states[0]-variables[6])-0.0; } void findRoot3(double voi, double *states, double *rates, double *variables) @@ -167,11 +167,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] = variables[2]; nlaSolve(objectiveFunction3, u, 1, &rfi); - variables[1] = u[0]; + variables[2] = u[0]; } void objectiveFunction4(double *u, double *f, void *data) @@ -205,9 +205,9 @@ void objectiveFunction5(double *u, double *f, void *data) double *rates = ((RootFindingInfo *) data)->rates; double *variables = ((RootFindingInfo *) data)->variables; - variables[3] = u[0]; + variables[4] = u[0]; - f[0] = variables[3]-variables[9]*pow(states[2], 3.0)*states[1]*(states[0]-variables[8])-0.0; + f[0] = variables[4]-variables[9]*pow(states[2], 3.0)*states[1]*(states[0]-variables[8])-0.0; } void findRoot5(double voi, double *states, double *rates, double *variables) @@ -215,11 +215,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] = variables[4]; nlaSolve(objectiveFunction5, u, 1, &rfi); - variables[3] = u[0]; + variables[4] = u[0]; } void objectiveFunction6(double *u, double *f, void *data) @@ -397,9 +397,9 @@ void objectiveFunction13(double *u, double *f, void *data) double *rates = ((RootFindingInfo *) data)->rates; double *variables = ((RootFindingInfo *) data)->variables; - variables[2] = u[0]; + variables[3] = u[0]; - f[0] = variables[2]-variables[15]*pow(states[3], 4.0)*(states[0]-variables[14])-0.0; + f[0] = variables[3]-variables[15]*pow(states[3], 4.0)*(states[0]-variables[14])-0.0; } void findRoot13(double voi, double *states, double *rates, double *variables) @@ -407,11 +407,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] = variables[3]; nlaSolve(objectiveFunction13, u, 1, &rfi); - variables[2] = u[0]; + variables[3] = u[0]; } void objectiveFunction14(double *u, double *f, void *data) @@ -489,10 +489,10 @@ void findRoot16(double voi, double *states, double *rates, double *variables) void initialiseVariables(double *states, double *rates, double *variables) { variables[0] = 0.0; - variables[1] = 0.0; + variables[1] = 1.0; variables[2] = 0.0; variables[3] = 0.0; - variables[4] = 1.0; + variables[4] = 0.0; variables[5] = 0.0; variables[6] = 0.0; variables[7] = 0.3; @@ -525,16 +525,16 @@ void computeRates(double voi, double *states, double *rates, double *variables) findRoot0(voi, states, rates, variables); findRoot2(voi, states, rates, variables); findRoot3(voi, states, rates, variables); - findRoot14(voi, states, rates, variables); findRoot15(voi, states, rates, variables); + findRoot14(voi, states, rates, variables); findRoot16(voi, states, rates, variables); findRoot12(voi, states, rates, variables); findRoot13(voi, states, rates, variables); - findRoot9(voi, states, rates, variables); findRoot10(voi, states, rates, variables); + findRoot9(voi, states, rates, variables); findRoot11(voi, states, rates, variables); - findRoot6(voi, states, rates, variables); findRoot7(voi, states, rates, variables); + findRoot6(voi, states, rates, variables); findRoot8(voi, states, rates, variables); findRoot4(voi, states, rates, variables); findRoot5(voi, states, rates, variables); @@ -546,16 +546,16 @@ void computeVariables(double voi, double *states, double *rates, double *variabl findRoot0(voi, states, rates, variables); findRoot2(voi, states, rates, variables); findRoot3(voi, states, rates, variables); - findRoot14(voi, states, rates, variables); findRoot15(voi, states, rates, variables); + findRoot14(voi, states, rates, variables); findRoot16(voi, states, rates, variables); findRoot12(voi, states, rates, variables); findRoot13(voi, states, rates, variables); - findRoot9(voi, states, rates, variables); findRoot10(voi, states, rates, variables); + findRoot9(voi, states, rates, variables); findRoot11(voi, states, rates, variables); - findRoot6(voi, states, rates, variables); findRoot7(voi, states, rates, variables); + findRoot6(voi, states, rates, variables); findRoot8(voi, states, rates, variables); findRoot4(voi, states, rates, variables); findRoot5(voi, states, rates, variables); 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 dfb15b2471..3ea98e2e97 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 @@ -30,10 +30,10 @@ class VariableType(Enum): VARIABLE_INFO = [ {"name": "i_Stim", "units": "microA_per_cm2", "component": "membrane", "type": VariableType.ALGEBRAIC}, + {"name": "Cm", "units": "microF_per_cm2", "component": "membrane", "type": VariableType.CONSTANT}, {"name": "i_L", "units": "microA_per_cm2", "component": "leakage_current", "type": VariableType.ALGEBRAIC}, {"name": "i_K", "units": "microA_per_cm2", "component": "potassium_channel", "type": VariableType.ALGEBRAIC}, {"name": "i_Na", "units": "microA_per_cm2", "component": "sodium_channel", "type": VariableType.ALGEBRAIC}, - {"name": "Cm", "units": "microF_per_cm2", "component": "membrane", "type": VariableType.CONSTANT}, {"name": "E_R", "units": "millivolt", "component": "membrane", "type": VariableType.CONSTANT}, {"name": "E_L", "units": "millivolt", "component": "leakage_current", "type": VariableType.COMPUTED_CONSTANT}, {"name": "g_L", "units": "milliS_per_cm2", "component": "leakage_current", "type": VariableType.CONSTANT}, @@ -102,7 +102,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]-(-(-variables[0]+variables[4]+variables[3]+variables[2])/variables[1])-0.0 def find_root_1(voi, states, rates, variables): @@ -142,19 +142,19 @@ def objective_function_3(u, f, data): rates = data[2] variables = data[3] - variables[1] = u[0] + variables[2] = u[0] - f[0] = variables[1]-variables[7]*(states[0]-variables[6])-0.0 + f[0] = variables[2]-variables[7]*(states[0]-variables[6])-0.0 def find_root_3(voi, states, rates, variables): u = [nan]*1 - u[0] = variables[1] + u[0] = variables[2] u = nla_solve(objective_function_3, u, 1, [voi, states, rates, variables]) - variables[1] = u[0] + variables[2] = u[0] def objective_function_4(u, f, data): @@ -184,19 +184,19 @@ def objective_function_5(u, f, data): rates = data[2] variables = data[3] - variables[3] = u[0] + variables[4] = u[0] - f[0] = variables[3]-variables[9]*pow(states[2], 3.0)*states[1]*(states[0]-variables[8])-0.0 + f[0] = variables[4]-variables[9]*pow(states[2], 3.0)*states[1]*(states[0]-variables[8])-0.0 def find_root_5(voi, states, rates, variables): u = [nan]*1 - u[0] = variables[3] + u[0] = variables[4] u = nla_solve(objective_function_5, u, 1, [voi, states, rates, variables]) - variables[3] = u[0] + variables[4] = u[0] def objective_function_6(u, f, data): @@ -352,19 +352,19 @@ def objective_function_13(u, f, data): rates = data[2] variables = data[3] - variables[2] = u[0] + variables[3] = u[0] - f[0] = variables[2]-variables[15]*pow(states[3], 4.0)*(states[0]-variables[14])-0.0 + f[0] = variables[3]-variables[15]*pow(states[3], 4.0)*(states[0]-variables[14])-0.0 def find_root_13(voi, states, rates, variables): u = [nan]*1 - u[0] = variables[2] + u[0] = variables[3] u = nla_solve(objective_function_13, u, 1, [voi, states, rates, variables]) - variables[2] = u[0] + variables[3] = u[0] def objective_function_14(u, f, data): @@ -432,10 +432,10 @@ def find_root_16(voi, states, rates, variables): def initialise_variables(states, rates, variables): variables[0] = 0.0 - variables[1] = 0.0 + variables[1] = 1.0 variables[2] = 0.0 variables[3] = 0.0 - variables[4] = 1.0 + variables[4] = 0.0 variables[5] = 0.0 variables[6] = 0.0 variables[7] = 0.3 @@ -467,16 +467,16 @@ def compute_rates(voi, states, rates, variables): find_root_0(voi, states, rates, variables) find_root_2(voi, states, rates, variables) find_root_3(voi, states, rates, variables) - find_root_14(voi, states, rates, variables) find_root_15(voi, states, rates, variables) + find_root_14(voi, states, rates, variables) find_root_16(voi, states, rates, variables) find_root_12(voi, states, rates, variables) find_root_13(voi, states, rates, variables) - find_root_9(voi, states, rates, variables) find_root_10(voi, states, rates, variables) + find_root_9(voi, states, rates, variables) find_root_11(voi, states, rates, variables) - find_root_6(voi, states, rates, variables) find_root_7(voi, states, rates, variables) + find_root_6(voi, states, rates, variables) find_root_8(voi, states, rates, variables) find_root_4(voi, states, rates, variables) find_root_5(voi, states, rates, variables) @@ -487,16 +487,16 @@ def compute_variables(voi, states, rates, variables): find_root_0(voi, states, rates, variables) find_root_2(voi, states, rates, variables) find_root_3(voi, states, rates, variables) - find_root_14(voi, states, rates, variables) find_root_15(voi, states, rates, variables) + find_root_14(voi, states, rates, variables) find_root_16(voi, states, rates, variables) find_root_12(voi, states, rates, variables) find_root_13(voi, states, rates, variables) - find_root_9(voi, states, rates, variables) find_root_10(voi, states, rates, variables) + find_root_9(voi, states, rates, variables) find_root_11(voi, states, rates, variables) - find_root_6(voi, states, rates, variables) find_root_7(voi, states, rates, variables) + find_root_6(voi, states, rates, variables) find_root_8(voi, states, rates, variables) find_root_4(voi, states, rates, variables) find_root_5(voi, states, rates, variables) 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 6b459df5ba..6b36536c14 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 @@ -22,10 +22,10 @@ const VariableInfo STATE_INFO[] = { const VariableInfo VARIABLE_INFO[] = { {"i_Stim", "microA_per_cm2", "membrane", EXTERNAL}, + {"Cm", "microF_per_cm2", "membrane", CONSTANT}, {"i_L", "microA_per_cm2", "leakage_current", ALGEBRAIC}, {"i_K", "microA_per_cm2", "potassium_channel", ALGEBRAIC}, {"i_Na", "microA_per_cm2", "sodium_channel", ALGEBRAIC}, - {"Cm", "microF_per_cm2", "membrane", CONSTANT}, {"E_R", "millivolt", "membrane", CONSTANT}, {"E_L", "millivolt", "leakage_current", COMPUTED_CONSTANT}, {"g_L", "milliS_per_cm2", "leakage_current", CONSTANT}, @@ -70,7 +70,7 @@ void deleteArray(double *array) void initialiseVariables(double voi, double *states, double *rates, double *variables, ExternalVariable externalVariable) { - variables[4] = 1.0; + variables[1] = 1.0; variables[5] = 0.0; variables[7] = 0.3; variables[9] = 120.0; @@ -94,15 +94,15 @@ void computeRates(double voi, double *states, double *rates, double *variables, { 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[2] = variables[7]*(states[0]-variables[6]); + variables[3] = variables[15]*pow(states[3], 4.0)*(states[0]-variables[14]); + variables[4] = variables[9]*pow(states[2], 3.0)*states[1]*(states[0]-variables[8]); + rates[0] = -(-variables[0]+variables[4]+variables[3]+variables[2])/variables[1]; variables[11] = 4.0*exp(states[0]/18.0); + variables[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.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); + variables[12] = 0.07*exp(states[0]/20.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]; @@ -112,12 +112,12 @@ void computeVariables(double voi, double *states, double *rates, double *variabl { 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[2] = variables[7]*(states[0]-variables[6]); + variables[4] = 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[3] = 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); } 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 df6c744fed..466d1991a0 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 @@ -31,10 +31,10 @@ class VariableType(Enum): VARIABLE_INFO = [ {"name": "i_Stim", "units": "microA_per_cm2", "component": "membrane", "type": VariableType.EXTERNAL}, + {"name": "Cm", "units": "microF_per_cm2", "component": "membrane", "type": VariableType.CONSTANT}, {"name": "i_L", "units": "microA_per_cm2", "component": "leakage_current", "type": VariableType.ALGEBRAIC}, {"name": "i_K", "units": "microA_per_cm2", "component": "potassium_channel", "type": VariableType.ALGEBRAIC}, {"name": "i_Na", "units": "microA_per_cm2", "component": "sodium_channel", "type": VariableType.ALGEBRAIC}, - {"name": "Cm", "units": "microF_per_cm2", "component": "membrane", "type": VariableType.CONSTANT}, {"name": "E_R", "units": "millivolt", "component": "membrane", "type": VariableType.CONSTANT}, {"name": "E_L", "units": "millivolt", "component": "leakage_current", "type": VariableType.COMPUTED_CONSTANT}, {"name": "g_L", "units": "milliS_per_cm2", "component": "leakage_current", "type": VariableType.CONSTANT}, @@ -72,7 +72,7 @@ def create_variables_array(): def initialise_variables(voi, states, rates, variables, external_variable): - variables[4] = 1.0 + variables[1] = 1.0 variables[5] = 0.0 variables[7] = 0.3 variables[9] = 120.0 @@ -94,15 +94,15 @@ def compute_computed_constants(variables): def compute_rates(voi, states, rates, variables, 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[2] = variables[7]*(states[0]-variables[6]) + variables[3] = variables[15]*pow(states[3], 4.0)*(states[0]-variables[14]) + variables[4] = variables[9]*pow(states[2], 3.0)*states[1]*(states[0]-variables[8]) + rates[0] = -(-variables[0]+variables[4]+variables[3]+variables[2])/variables[1] variables[11] = 4.0*exp(states[0]/18.0) + variables[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.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) + variables[12] = 0.07*exp(states[0]/20.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] @@ -111,11 +111,11 @@ def compute_rates(voi, states, rates, variables, external_variable): def compute_variables(voi, states, rates, variables, 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[2] = variables[7]*(states[0]-variables[6]) + variables[4] = 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[3] = 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) 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 a2e835931b..90079641b8 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 @@ -22,10 +22,10 @@ const VariableInfo STATE_INFO[] = { const VariableInfo VARIABLE_INFO[] = { {"i_Stim", "microA_per_cm2", "membrane", ALGEBRAIC}, + {"Cm", "microF_per_cm2", "membrane", CONSTANT}, {"i_L", "microA_per_cm2", "leakage_current", ALGEBRAIC}, {"i_K", "microA_per_cm2", "potassium_channel", ALGEBRAIC}, {"i_Na", "microA_per_cm2", "sodium_channel", ALGEBRAIC}, - {"Cm", "microF_per_cm2", "membrane", CONSTANT}, {"E_R", "millivolt", "membrane", EXTERNAL}, {"E_L", "millivolt", "leakage_current", ALGEBRAIC}, {"g_L", "milliS_per_cm2", "leakage_current", CONSTANT}, @@ -70,7 +70,7 @@ void deleteArray(double *array) void initialiseVariables(double voi, double *states, double *rates, double *variables, ExternalVariable externalVariable) { - variables[4] = 1.0; + variables[1] = 1.0; variables[7] = 0.3; variables[9] = 120.0; variables[15] = 36.0; @@ -92,19 +92,19 @@ void computeRates(double voi, double *states, double *rates, double *variables, 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[2] = variables[7]*(states[0]-variables[6]); + variables[3] = 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[4] = variables[9]*pow(states[2], 3.0)*states[1]*(states[0]-variables[8]); + rates[0] = -(-variables[0]+variables[4]+variables[3]+variables[2])/variables[1]; variables[11] = 4.0*exp(states[0]/18.0); + variables[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.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); + variables[12] = 0.07*exp(states[0]/20.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); + 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]; } @@ -113,14 +113,14 @@ void computeVariables(double voi, double *states, double *rates, double *variabl 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[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[4] = 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[3] = 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); } 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 5320abeb41..a7697792ea 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 @@ -31,10 +31,10 @@ class VariableType(Enum): VARIABLE_INFO = [ {"name": "i_Stim", "units": "microA_per_cm2", "component": "membrane", "type": VariableType.ALGEBRAIC}, + {"name": "Cm", "units": "microF_per_cm2", "component": "membrane", "type": VariableType.CONSTANT}, {"name": "i_L", "units": "microA_per_cm2", "component": "leakage_current", "type": VariableType.ALGEBRAIC}, {"name": "i_K", "units": "microA_per_cm2", "component": "potassium_channel", "type": VariableType.ALGEBRAIC}, {"name": "i_Na", "units": "microA_per_cm2", "component": "sodium_channel", "type": VariableType.ALGEBRAIC}, - {"name": "Cm", "units": "microF_per_cm2", "component": "membrane", "type": VariableType.CONSTANT}, {"name": "E_R", "units": "millivolt", "component": "membrane", "type": VariableType.EXTERNAL}, {"name": "E_L", "units": "millivolt", "component": "leakage_current", "type": VariableType.ALGEBRAIC}, {"name": "g_L", "units": "milliS_per_cm2", "component": "leakage_current", "type": VariableType.CONSTANT}, @@ -72,7 +72,7 @@ def create_variables_array(): def initialise_variables(voi, states, rates, variables, external_variable): - variables[4] = 1.0 + variables[1] = 1.0 variables[7] = 0.3 variables[9] = 120.0 variables[15] = 36.0 @@ -93,19 +93,19 @@ def compute_rates(voi, states, rates, variables, 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[2] = variables[15]*pow(states[3], 4.0)*(states[0]-variables[14]) + variables[2] = variables[7]*(states[0]-variables[6]) + variables[3] = 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[4] = variables[9]*pow(states[2], 3.0)*states[1]*(states[0]-variables[8]) + rates[0] = -(-variables[0]+variables[4]+variables[3]+variables[2])/variables[1] variables[11] = 4.0*exp(states[0]/18.0) + variables[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.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) + variables[12] = 0.07*exp(states[0]/20.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) + 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] @@ -113,13 +113,13 @@ def compute_variables(voi, states, rates, variables, 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[2] = 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[4] = 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[3] = 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) 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 0af423c562..5803d84ae8 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 @@ -22,10 +22,10 @@ const VariableInfo STATE_INFO[] = { const VariableInfo VARIABLE_INFO[] = { {"i_Stim", "microA_per_cm2", "membrane", ALGEBRAIC}, + {"Cm", "microF_per_cm2", "membrane", EXTERNAL}, {"i_L", "microA_per_cm2", "leakage_current", ALGEBRAIC}, {"i_K", "microA_per_cm2", "potassium_channel", ALGEBRAIC}, {"i_Na", "microA_per_cm2", "sodium_channel", ALGEBRAIC}, - {"Cm", "microF_per_cm2", "membrane", EXTERNAL}, {"E_R", "millivolt", "membrane", CONSTANT}, {"E_L", "millivolt", "leakage_current", COMPUTED_CONSTANT}, {"g_L", "milliS_per_cm2", "leakage_current", CONSTANT}, @@ -78,7 +78,7 @@ void initialiseVariables(double voi, double *states, double *rates, double *vari states[2] = 0.05; states[3] = 0.325; variables[9] = externalVariable(voi, states, rates, variables, 9); - variables[4] = externalVariable(voi, states, rates, variables, 4); + variables[1] = externalVariable(voi, states, rates, variables, 1); } void computeComputedConstants(double *variables) @@ -90,35 +90,35 @@ void computeComputedConstants(double *variables) void computeRates(double voi, double *states, double *rates, double *variables, 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[1] = externalVariable(voi, states, rates, variables, 1); + variables[0] = ((voi >= 10.0) && (voi <= 10.5))?-20.0:0.0; + variables[2] = variables[7]*(states[0]-variables[6]); + variables[3] = variables[15]*pow(states[3], 4.0)*(states[0]-variables[14]); + variables[4] = variables[9]*pow(states[2], 3.0)*states[1]*(states[0]-variables[8]); + rates[0] = -(-variables[0]+variables[4]+variables[3]+variables[2])/variables[1]; variables[11] = 4.0*exp(states[0]/18.0); + variables[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.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); + variables[12] = 0.07*exp(states[0]/20.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); + 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]; } void computeVariables(double voi, double *states, double *rates, double *variables, ExternalVariable externalVariable) { - variables[1] = variables[7]*(states[0]-variables[6]); + variables[2] = 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[4] = 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[3] = 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); + variables[1] = externalVariable(voi, states, rates, variables, 1); } 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 24f4db123b..f04b000216 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 @@ -31,10 +31,10 @@ class VariableType(Enum): VARIABLE_INFO = [ {"name": "i_Stim", "units": "microA_per_cm2", "component": "membrane", "type": VariableType.ALGEBRAIC}, + {"name": "Cm", "units": "microF_per_cm2", "component": "membrane", "type": VariableType.EXTERNAL}, {"name": "i_L", "units": "microA_per_cm2", "component": "leakage_current", "type": VariableType.ALGEBRAIC}, {"name": "i_K", "units": "microA_per_cm2", "component": "potassium_channel", "type": VariableType.ALGEBRAIC}, {"name": "i_Na", "units": "microA_per_cm2", "component": "sodium_channel", "type": VariableType.ALGEBRAIC}, - {"name": "Cm", "units": "microF_per_cm2", "component": "membrane", "type": VariableType.EXTERNAL}, {"name": "E_R", "units": "millivolt", "component": "membrane", "type": VariableType.CONSTANT}, {"name": "E_L", "units": "millivolt", "component": "leakage_current", "type": VariableType.COMPUTED_CONSTANT}, {"name": "g_L", "units": "milliS_per_cm2", "component": "leakage_current", "type": VariableType.CONSTANT}, @@ -80,7 +80,7 @@ def initialise_variables(voi, states, rates, variables, external_variable): 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) + variables[1] = external_variable(voi, states, rates, variables, 1) def compute_computed_constants(variables): @@ -90,33 +90,33 @@ def compute_computed_constants(variables): def compute_rates(voi, states, rates, variables, 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[1] = external_variable(voi, states, rates, variables, 1) + variables[0] = -20.0 if and_func(geq_func(voi, 10.0), leq_func(voi, 10.5)) else 0.0 + variables[2] = variables[7]*(states[0]-variables[6]) + variables[3] = variables[15]*pow(states[3], 4.0)*(states[0]-variables[14]) + variables[4] = variables[9]*pow(states[2], 3.0)*states[1]*(states[0]-variables[8]) + rates[0] = -(-variables[0]+variables[4]+variables[3]+variables[2])/variables[1] variables[11] = 4.0*exp(states[0]/18.0) + variables[10] = 0.1*(states[0]+25.0)/(exp((states[0]+25.0)/10.0)-1.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) + variables[12] = 0.07*exp(states[0]/20.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) + 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] def compute_variables(voi, states, rates, variables, external_variable): - variables[1] = variables[7]*(states[0]-variables[6]) + variables[2] = 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[4] = 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[3] = 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) + variables[1] = external_variable(voi, states, rates, variables, 1) 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 70d760bb64..4d7dd6ef71 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 @@ -20,17 +20,17 @@ const VariableInfo STATE_INFO[] = { const VariableInfo VARIABLE_INFO[] = { {"i_Stim", "microA_per_cm2", "membrane", ALGEBRAIC}, - {"V", "millivolt", "membrane", EXTERNAL}, + {"Cm", "microF_per_cm2", "membrane", CONSTANT}, {"i_L", "microA_per_cm2", "leakage_current", ALGEBRAIC}, {"i_K", "microA_per_cm2", "potassium_channel", ALGEBRAIC}, {"i_Na", "microA_per_cm2", "sodium_channel", ALGEBRAIC}, - {"Cm", "microF_per_cm2", "membrane", CONSTANT}, + {"V", "millivolt", "membrane", EXTERNAL}, {"E_R", "millivolt", "membrane", CONSTANT}, {"E_L", "millivolt", "leakage_current", COMPUTED_CONSTANT}, {"g_L", "milliS_per_cm2", "leakage_current", CONSTANT}, {"E_Na", "millivolt", "sodium_channel", COMPUTED_CONSTANT}, - {"g_Na", "milliS_per_cm2", "sodium_channel", CONSTANT}, {"m", "dimensionless", "sodium_channel_m_gate", EXTERNAL}, + {"g_Na", "milliS_per_cm2", "sodium_channel", CONSTANT}, {"alpha_m", "per_millisecond", "sodium_channel_m_gate", ALGEBRAIC}, {"beta_m", "per_millisecond", "sodium_channel_m_gate", ALGEBRAIC}, {"alpha_h", "per_millisecond", "sodium_channel_h_gate", ALGEBRAIC}, @@ -70,15 +70,15 @@ void deleteArray(double *array) void initialiseVariables(double voi, double *states, double *rates, double *variables, ExternalVariable externalVariable) { - variables[5] = 1.0; + variables[1] = 1.0; variables[6] = 0.0; variables[8] = 0.3; - variables[10] = 120.0; + variables[11] = 120.0; variables[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); + variables[5] = externalVariable(voi, states, rates, variables, 5); + variables[10] = externalVariable(voi, states, rates, variables, 10); } void computeComputedConstants(double *variables) @@ -90,23 +90,23 @@ void computeComputedConstants(double *variables) void computeRates(double voi, double *states, double *rates, double *variables, 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); + variables[5] = externalVariable(voi, states, rates, variables, 5); + variables[15] = 1.0/(exp((variables[5]+30.0)/10.0)+1.0); + variables[14] = 0.07*exp(variables[5]/20.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); + variables[19] = 0.125*exp(variables[5]/80.0); + variables[18] = 0.01*(variables[5]+10.0)/(exp((variables[5]+10.0)/10.0)-1.0); rates[1] = variables[18]*(1.0-states[1])-variables[19]*states[1]; } void computeVariables(double voi, double *states, double *rates, double *variables, 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]); + variables[5] = externalVariable(voi, states, rates, variables, 5); + variables[2] = variables[8]*(variables[5]-variables[7]); + variables[10] = externalVariable(voi, states, rates, variables, 10); + variables[4] = variables[11]*pow(variables[10], 3.0)*states[0]*(variables[5]-variables[9]); + variables[12] = 0.1*(variables[5]+25.0)/(exp((variables[5]+25.0)/10.0)-1.0); + variables[13] = 4.0*exp(variables[5]/18.0); + variables[3] = variables[17]*pow(states[1], 4.0)*(variables[5]-variables[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 c9d8564537..741ca82c2e 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 @@ -29,17 +29,17 @@ class VariableType(Enum): VARIABLE_INFO = [ {"name": "i_Stim", "units": "microA_per_cm2", "component": "membrane", "type": VariableType.ALGEBRAIC}, - {"name": "V", "units": "millivolt", "component": "membrane", "type": VariableType.EXTERNAL}, + {"name": "Cm", "units": "microF_per_cm2", "component": "membrane", "type": VariableType.CONSTANT}, {"name": "i_L", "units": "microA_per_cm2", "component": "leakage_current", "type": VariableType.ALGEBRAIC}, {"name": "i_K", "units": "microA_per_cm2", "component": "potassium_channel", "type": VariableType.ALGEBRAIC}, {"name": "i_Na", "units": "microA_per_cm2", "component": "sodium_channel", "type": VariableType.ALGEBRAIC}, - {"name": "Cm", "units": "microF_per_cm2", "component": "membrane", "type": VariableType.CONSTANT}, + {"name": "V", "units": "millivolt", "component": "membrane", "type": VariableType.EXTERNAL}, {"name": "E_R", "units": "millivolt", "component": "membrane", "type": VariableType.CONSTANT}, {"name": "E_L", "units": "millivolt", "component": "leakage_current", "type": VariableType.COMPUTED_CONSTANT}, {"name": "g_L", "units": "milliS_per_cm2", "component": "leakage_current", "type": VariableType.CONSTANT}, {"name": "E_Na", "units": "millivolt", "component": "sodium_channel", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "g_Na", "units": "milliS_per_cm2", "component": "sodium_channel", "type": VariableType.CONSTANT}, {"name": "m", "units": "dimensionless", "component": "sodium_channel_m_gate", "type": VariableType.EXTERNAL}, + {"name": "g_Na", "units": "milliS_per_cm2", "component": "sodium_channel", "type": VariableType.CONSTANT}, {"name": "alpha_m", "units": "per_millisecond", "component": "sodium_channel_m_gate", "type": VariableType.ALGEBRAIC}, {"name": "beta_m", "units": "per_millisecond", "component": "sodium_channel_m_gate", "type": VariableType.ALGEBRAIC}, {"name": "alpha_h", "units": "per_millisecond", "component": "sodium_channel_h_gate", "type": VariableType.ALGEBRAIC}, @@ -72,15 +72,15 @@ def create_variables_array(): def initialise_variables(voi, states, rates, variables, external_variable): - variables[5] = 1.0 + variables[1] = 1.0 variables[6] = 0.0 variables[8] = 0.3 - variables[10] = 120.0 + variables[11] = 120.0 variables[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) + variables[5] = external_variable(voi, states, rates, variables, 5) + variables[10] = external_variable(voi, states, rates, variables, 10) def compute_computed_constants(variables): @@ -90,21 +90,21 @@ def compute_computed_constants(variables): def compute_rates(voi, states, rates, variables, 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) + variables[5] = external_variable(voi, states, rates, variables, 5) + variables[15] = 1.0/(exp((variables[5]+30.0)/10.0)+1.0) + variables[14] = 0.07*exp(variables[5]/20.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) + variables[19] = 0.125*exp(variables[5]/80.0) + variables[18] = 0.01*(variables[5]+10.0)/(exp((variables[5]+10.0)/10.0)-1.0) rates[1] = variables[18]*(1.0-states[1])-variables[19]*states[1] def compute_variables(voi, states, rates, variables, 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]) + variables[5] = external_variable(voi, states, rates, variables, 5) + variables[2] = variables[8]*(variables[5]-variables[7]) + variables[10] = external_variable(voi, states, rates, variables, 10) + variables[4] = variables[11]*pow(variables[10], 3.0)*states[0]*(variables[5]-variables[9]) + variables[12] = 0.1*(variables[5]+25.0)/(exp((variables[5]+25.0)/10.0)-1.0) + variables[13] = 4.0*exp(variables[5]/18.0) + variables[3] = variables[17]*pow(states[1], 4.0)*(variables[5]-variables[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 86ad504a13..d3a9b1c093 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 @@ -21,11 +21,11 @@ const VariableInfo STATE_INFO[] = { const VariableInfo VARIABLE_INFO[] = { {"i_Stim", "microA_per_cm2", "membrane", ALGEBRAIC}, - {"V", "millivolt", "membrane", EXTERNAL}, + {"Cm", "microF_per_cm2", "membrane", CONSTANT}, {"i_L", "microA_per_cm2", "leakage_current", ALGEBRAIC}, {"i_K", "microA_per_cm2", "potassium_channel", ALGEBRAIC}, {"i_Na", "microA_per_cm2", "sodium_channel", EXTERNAL}, - {"Cm", "microF_per_cm2", "membrane", CONSTANT}, + {"V", "millivolt", "membrane", EXTERNAL}, {"E_R", "millivolt", "membrane", CONSTANT}, {"E_L", "millivolt", "leakage_current", COMPUTED_CONSTANT}, {"g_L", "milliS_per_cm2", "leakage_current", CONSTANT}, @@ -70,7 +70,7 @@ void deleteArray(double *array) void initialiseVariables(double voi, double *states, double *rates, double *variables, ExternalVariable externalVariable) { - variables[5] = 1.0; + variables[1] = 1.0; variables[6] = 0.0; variables[8] = 0.3; variables[10] = 120.0; @@ -78,7 +78,7 @@ void initialiseVariables(double voi, double *states, double *rates, double *vari states[0] = 0.6; states[1] = 0.05; states[2] = 0.325; - variables[1] = externalVariable(voi, states, rates, variables, 1); + variables[5] = externalVariable(voi, states, rates, variables, 5); variables[17] = externalVariable(voi, states, rates, variables, 17); variables[4] = externalVariable(voi, states, rates, variables, 4); } @@ -92,24 +92,24 @@ void computeComputedConstants(double *variables) void computeRates(double voi, double *states, double *rates, double *variables, 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); + variables[5] = externalVariable(voi, states, rates, variables, 5); + variables[12] = 4.0*exp(variables[5]/18.0); + variables[11] = 0.1*(variables[5]+25.0)/(exp((variables[5]+25.0)/10.0)-1.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); + variables[14] = 1.0/(exp((variables[5]+30.0)/10.0)+1.0); + variables[13] = 0.07*exp(variables[5]/20.0); rates[0] = variables[13]*(1.0-states[0])-variables[14]*states[0]; + variables[18] = 0.125*exp(variables[5]/80.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]; } void computeVariables(double voi, double *states, double *rates, double *variables, 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[5] = externalVariable(voi, states, rates, variables, 5); + variables[2] = variables[8]*(variables[5]-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]); + variables[3] = variables[16]*pow(states[2], 4.0)*(variables[5]-variables[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 af7def3ad4..58631b6ed0 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 @@ -30,11 +30,11 @@ class VariableType(Enum): VARIABLE_INFO = [ {"name": "i_Stim", "units": "microA_per_cm2", "component": "membrane", "type": VariableType.ALGEBRAIC}, - {"name": "V", "units": "millivolt", "component": "membrane", "type": VariableType.EXTERNAL}, + {"name": "Cm", "units": "microF_per_cm2", "component": "membrane", "type": VariableType.CONSTANT}, {"name": "i_L", "units": "microA_per_cm2", "component": "leakage_current", "type": VariableType.ALGEBRAIC}, {"name": "i_K", "units": "microA_per_cm2", "component": "potassium_channel", "type": VariableType.ALGEBRAIC}, {"name": "i_Na", "units": "microA_per_cm2", "component": "sodium_channel", "type": VariableType.EXTERNAL}, - {"name": "Cm", "units": "microF_per_cm2", "component": "membrane", "type": VariableType.CONSTANT}, + {"name": "V", "units": "millivolt", "component": "membrane", "type": VariableType.EXTERNAL}, {"name": "E_R", "units": "millivolt", "component": "membrane", "type": VariableType.CONSTANT}, {"name": "E_L", "units": "millivolt", "component": "leakage_current", "type": VariableType.COMPUTED_CONSTANT}, {"name": "g_L", "units": "milliS_per_cm2", "component": "leakage_current", "type": VariableType.CONSTANT}, @@ -72,7 +72,7 @@ def create_variables_array(): def initialise_variables(voi, states, rates, variables, external_variable): - variables[5] = 1.0 + variables[1] = 1.0 variables[6] = 0.0 variables[8] = 0.3 variables[10] = 120.0 @@ -80,7 +80,7 @@ def initialise_variables(voi, states, rates, variables, external_variable): states[0] = 0.6 states[1] = 0.05 states[2] = 0.325 - variables[1] = external_variable(voi, states, rates, variables, 1) + variables[5] = external_variable(voi, states, rates, variables, 5) variables[17] = external_variable(voi, states, rates, variables, 17) variables[4] = external_variable(voi, states, rates, variables, 4) @@ -92,22 +92,22 @@ def compute_computed_constants(variables): def compute_rates(voi, states, rates, variables, 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) + variables[5] = external_variable(voi, states, rates, variables, 5) + variables[12] = 4.0*exp(variables[5]/18.0) + variables[11] = 0.1*(variables[5]+25.0)/(exp((variables[5]+25.0)/10.0)-1.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) + variables[14] = 1.0/(exp((variables[5]+30.0)/10.0)+1.0) + variables[13] = 0.07*exp(variables[5]/20.0) rates[0] = variables[13]*(1.0-states[0])-variables[14]*states[0] + variables[18] = 0.125*exp(variables[5]/80.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] def compute_variables(voi, states, rates, variables, 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[5] = external_variable(voi, states, rates, variables, 5) + variables[2] = variables[8]*(variables[5]-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]) + variables[3] = variables[16]*pow(states[2], 4.0)*(variables[5]-variables[15]) 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 96dd530544..09f454951a 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 @@ -21,16 +21,16 @@ const VariableInfo STATE_INFO[] = { const VariableInfo VARIABLE_INFO[] = { {"i_Stim", "microA_per_cm2", "membrane", ALGEBRAIC}, + {"Cm", "microF_per_cm2", "membrane", CONSTANT}, {"i_L", "microA_per_cm2", "leakage_current", ALGEBRAIC}, {"i_K", "microA_per_cm2", "potassium_channel", ALGEBRAIC}, {"i_Na", "microA_per_cm2", "sodium_channel", ALGEBRAIC}, - {"Cm", "microF_per_cm2", "membrane", CONSTANT}, {"E_R", "millivolt", "membrane", CONSTANT}, {"E_L", "millivolt", "leakage_current", COMPUTED_CONSTANT}, {"g_L", "milliS_per_cm2", "leakage_current", CONSTANT}, {"E_Na", "millivolt", "sodium_channel", COMPUTED_CONSTANT}, - {"g_Na", "milliS_per_cm2", "sodium_channel", CONSTANT}, {"m", "dimensionless", "sodium_channel_m_gate", EXTERNAL}, + {"g_Na", "milliS_per_cm2", "sodium_channel", CONSTANT}, {"alpha_m", "per_millisecond", "sodium_channel_m_gate", ALGEBRAIC}, {"beta_m", "per_millisecond", "sodium_channel_m_gate", ALGEBRAIC}, {"alpha_h", "per_millisecond", "sodium_channel_h_gate", ALGEBRAIC}, @@ -70,15 +70,15 @@ void deleteArray(double *array) void initialiseVariables(double voi, double *states, double *rates, double *variables, ExternalVariable externalVariable) { - variables[4] = 1.0; + variables[1] = 1.0; variables[5] = 0.0; variables[7] = 0.3; - variables[9] = 120.0; + variables[10] = 120.0; variables[16] = 36.0; states[0] = 0.0; states[1] = 0.6; states[2] = 0.325; - variables[10] = externalVariable(voi, states, rates, variables, 10); + variables[9] = externalVariable(voi, states, rates, variables, 9); } void computeComputedConstants(double *variables) @@ -91,29 +91,29 @@ void computeComputedConstants(double *variables) void computeRates(double voi, double *states, double *rates, double *variables, 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[2] = variables[7]*(states[0]-variables[6]); + variables[3] = variables[16]*pow(states[2], 4.0)*(states[0]-variables[15]); + variables[9] = externalVariable(voi, states, rates, variables, 9); + variables[4] = variables[10]*pow(variables[9], 3.0)*states[1]*(states[0]-variables[8]); + rates[0] = -(-variables[0]+variables[4]+variables[3]+variables[2])/variables[1]; variables[14] = 1.0/(exp((states[0]+30.0)/10.0)+1.0); + variables[13] = 0.07*exp(states[0]/20.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); + variables[17] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0); rates[2] = variables[17]*(1.0-states[2])-variables[18]*states[2]; } void computeVariables(double voi, double *states, double *rates, double *variables, 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[2] = variables[7]*(states[0]-variables[6]); + variables[9] = externalVariable(voi, states, rates, variables, 9); + variables[4] = variables[10]*pow(variables[9], 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[3] = 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); } 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 028033fdd1..8069b01586 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 @@ -30,16 +30,16 @@ class VariableType(Enum): VARIABLE_INFO = [ {"name": "i_Stim", "units": "microA_per_cm2", "component": "membrane", "type": VariableType.ALGEBRAIC}, + {"name": "Cm", "units": "microF_per_cm2", "component": "membrane", "type": VariableType.CONSTANT}, {"name": "i_L", "units": "microA_per_cm2", "component": "leakage_current", "type": VariableType.ALGEBRAIC}, {"name": "i_K", "units": "microA_per_cm2", "component": "potassium_channel", "type": VariableType.ALGEBRAIC}, {"name": "i_Na", "units": "microA_per_cm2", "component": "sodium_channel", "type": VariableType.ALGEBRAIC}, - {"name": "Cm", "units": "microF_per_cm2", "component": "membrane", "type": VariableType.CONSTANT}, {"name": "E_R", "units": "millivolt", "component": "membrane", "type": VariableType.CONSTANT}, {"name": "E_L", "units": "millivolt", "component": "leakage_current", "type": VariableType.COMPUTED_CONSTANT}, {"name": "g_L", "units": "milliS_per_cm2", "component": "leakage_current", "type": VariableType.CONSTANT}, {"name": "E_Na", "units": "millivolt", "component": "sodium_channel", "type": VariableType.COMPUTED_CONSTANT}, - {"name": "g_Na", "units": "milliS_per_cm2", "component": "sodium_channel", "type": VariableType.CONSTANT}, {"name": "m", "units": "dimensionless", "component": "sodium_channel_m_gate", "type": VariableType.EXTERNAL}, + {"name": "g_Na", "units": "milliS_per_cm2", "component": "sodium_channel", "type": VariableType.CONSTANT}, {"name": "alpha_m", "units": "per_millisecond", "component": "sodium_channel_m_gate", "type": VariableType.ALGEBRAIC}, {"name": "beta_m", "units": "per_millisecond", "component": "sodium_channel_m_gate", "type": VariableType.ALGEBRAIC}, {"name": "alpha_h", "units": "per_millisecond", "component": "sodium_channel_h_gate", "type": VariableType.ALGEBRAIC}, @@ -72,15 +72,15 @@ def create_variables_array(): def initialise_variables(voi, states, rates, variables, external_variable): - variables[4] = 1.0 + variables[1] = 1.0 variables[5] = 0.0 variables[7] = 0.3 - variables[9] = 120.0 + variables[10] = 120.0 variables[16] = 36.0 states[0] = 0.0 states[1] = 0.6 states[2] = 0.325 - variables[10] = external_variable(voi, states, rates, variables, 10) + variables[9] = external_variable(voi, states, rates, variables, 9) def compute_computed_constants(variables): @@ -91,27 +91,27 @@ def compute_computed_constants(variables): def compute_rates(voi, states, rates, variables, 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[2] = variables[7]*(states[0]-variables[6]) + variables[3] = variables[16]*pow(states[2], 4.0)*(states[0]-variables[15]) + variables[9] = external_variable(voi, states, rates, variables, 9) + variables[4] = variables[10]*pow(variables[9], 3.0)*states[1]*(states[0]-variables[8]) + rates[0] = -(-variables[0]+variables[4]+variables[3]+variables[2])/variables[1] variables[14] = 1.0/(exp((states[0]+30.0)/10.0)+1.0) + variables[13] = 0.07*exp(states[0]/20.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) + variables[17] = 0.01*(states[0]+10.0)/(exp((states[0]+10.0)/10.0)-1.0) rates[2] = variables[17]*(1.0-states[2])-variables[18]*states[2] def compute_variables(voi, states, rates, variables, 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[2] = variables[7]*(states[0]-variables[6]) + variables[9] = external_variable(voi, states, rates, variables, 9) + variables[4] = variables[10]*pow(variables[9], 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[3] = 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) diff --git a/tests/resources/generator/noble_model_1962/model.c b/tests/resources/generator/noble_model_1962/model.c index 2215923b1a..f51e57790a 100644 --- a/tests/resources/generator/noble_model_1962/model.c +++ b/tests/resources/generator/noble_model_1962/model.c @@ -15,27 +15,27 @@ const VariableInfo VOI_INFO = {"time", "millisecond", "environment", VARIABLE_OF const VariableInfo STATE_INFO[] = { {"V", "millivolt", "membrane", STATE}, - {"m", "dimensionless", "sodium_channel_m_gate", STATE}, {"h", "dimensionless", "sodium_channel_h_gate", STATE}, + {"m", "dimensionless", "sodium_channel_m_gate", STATE}, {"n", "dimensionless", "potassium_channel_n_gate", STATE} }; const VariableInfo VARIABLE_INFO[] = { - {"i_Na", "microA_per_cm2", "sodium_channel", ALGEBRAIC}, + {"Cm", "microF_per_cm2", "membrane", CONSTANT}, {"i_Leak", "microA_per_cm2", "leakage_current", ALGEBRAIC}, {"i_K", "microA_per_cm2", "potassium_channel", ALGEBRAIC}, - {"Cm", "microF_per_cm2", "membrane", CONSTANT}, - {"g_L", "milliS_per_cm2", "leakage_current", CONSTANT}, + {"i_Na", "microA_per_cm2", "sodium_channel", ALGEBRAIC}, {"E_L", "millivolt", "leakage_current", CONSTANT}, - {"g_Na", "milliS_per_cm2", "sodium_channel", ALGEBRAIC}, + {"g_L", "milliS_per_cm2", "leakage_current", CONSTANT}, {"g_Na_max", "milliS_per_cm2", "sodium_channel", CONSTANT}, + {"g_Na", "milliS_per_cm2", "sodium_channel", ALGEBRAIC}, {"E_Na", "millivolt", "sodium_channel", CONSTANT}, {"alpha_m", "per_millisecond", "sodium_channel_m_gate", ALGEBRAIC}, {"beta_m", "per_millisecond", "sodium_channel_m_gate", ALGEBRAIC}, {"alpha_h", "per_millisecond", "sodium_channel_h_gate", ALGEBRAIC}, {"beta_h", "per_millisecond", "sodium_channel_h_gate", ALGEBRAIC}, - {"g_K1", "milliS_per_cm2", "potassium_channel", ALGEBRAIC}, {"g_K2", "milliS_per_cm2", "potassium_channel", ALGEBRAIC}, + {"g_K1", "milliS_per_cm2", "potassium_channel", ALGEBRAIC}, {"alpha_n", "per_millisecond", "potassium_channel_n_gate", ALGEBRAIC}, {"beta_n", "per_millisecond", "potassium_channel_n_gate", ALGEBRAIC} }; @@ -69,14 +69,14 @@ void deleteArray(double *array) void initialiseVariables(double *states, double *rates, double *variables) { - variables[3] = 12.0; - variables[4] = 0.075; - variables[5] = -60.0; - variables[7] = 400.0; + variables[0] = 12.0; + variables[4] = -60.0; + variables[5] = 0.075; + variables[6] = 400.0; variables[8] = 40.0; states[0] = -87.0; - states[1] = 0.01; - states[2] = 0.8; + states[1] = 0.8; + states[2] = 0.01; states[3] = 0.01; } @@ -86,36 +86,36 @@ void computeComputedConstants(double *variables) void computeRates(double voi, double *states, double *rates, double *variables) { - 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[1] = variables[5]*(states[0]-variables[4]); + variables[7] = pow(states[2], 3.0)*states[1]*variables[6]; + variables[3] = (variables[7]+0.14)*(states[0]-variables[8]); + variables[13] = 1.2*pow(states[3], 4.0); + variables[14] = 1.2*exp((-states[0]-90.0)/50.0)+0.015*exp((states[0]+90.0)/60.0); + variables[2] = (variables[14]+variables[13])*(states[0]+100.0); + rates[0] = -(variables[3]+variables[2]+variables[1])/variables[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[9] = 0.1*(-states[0]-48.0)/(exp((-states[0]-48.0)/15.0)-1.0); + rates[2] = variables[9]*(1.0-states[2])-variables[10]*states[2]; 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[11] = 0.17*exp((-states[0]-90.0)/20.0); + rates[1] = variables[11]*(1.0-states[1])-variables[12]*states[1]; variables[16] = 0.002*exp((-states[0]-90.0)/80.0); + variables[15] = 0.0001*(-states[0]-50.0)/(exp((-states[0]-50.0)/10.0)-1.0); rates[3] = variables[15]*(1.0-states[3])-variables[16]*states[3]; } void computeVariables(double voi, double *states, double *rates, double *variables) { - 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[1] = variables[5]*(states[0]-variables[4]); + variables[7] = pow(states[2], 3.0)*states[1]*variables[6]; + variables[3] = (variables[7]+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[13] = 1.2*pow(states[3], 4.0); + variables[14] = 1.2*exp((-states[0]-90.0)/50.0)+0.015*exp((states[0]+90.0)/60.0); + variables[2] = (variables[14]+variables[13])*(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); } diff --git a/tests/resources/generator/noble_model_1962/model.py b/tests/resources/generator/noble_model_1962/model.py index c5e7019b99..935f5e0f55 100644 --- a/tests/resources/generator/noble_model_1962/model.py +++ b/tests/resources/generator/noble_model_1962/model.py @@ -23,27 +23,27 @@ class VariableType(Enum): STATE_INFO = [ {"name": "V", "units": "millivolt", "component": "membrane", "type": VariableType.STATE}, - {"name": "m", "units": "dimensionless", "component": "sodium_channel_m_gate", "type": VariableType.STATE}, {"name": "h", "units": "dimensionless", "component": "sodium_channel_h_gate", "type": VariableType.STATE}, + {"name": "m", "units": "dimensionless", "component": "sodium_channel_m_gate", "type": VariableType.STATE}, {"name": "n", "units": "dimensionless", "component": "potassium_channel_n_gate", "type": VariableType.STATE} ] VARIABLE_INFO = [ - {"name": "i_Na", "units": "microA_per_cm2", "component": "sodium_channel", "type": VariableType.ALGEBRAIC}, + {"name": "Cm", "units": "microF_per_cm2", "component": "membrane", "type": VariableType.CONSTANT}, {"name": "i_Leak", "units": "microA_per_cm2", "component": "leakage_current", "type": VariableType.ALGEBRAIC}, {"name": "i_K", "units": "microA_per_cm2", "component": "potassium_channel", "type": VariableType.ALGEBRAIC}, - {"name": "Cm", "units": "microF_per_cm2", "component": "membrane", "type": VariableType.CONSTANT}, - {"name": "g_L", "units": "milliS_per_cm2", "component": "leakage_current", "type": VariableType.CONSTANT}, + {"name": "i_Na", "units": "microA_per_cm2", "component": "sodium_channel", "type": VariableType.ALGEBRAIC}, {"name": "E_L", "units": "millivolt", "component": "leakage_current", "type": VariableType.CONSTANT}, - {"name": "g_Na", "units": "milliS_per_cm2", "component": "sodium_channel", "type": VariableType.ALGEBRAIC}, + {"name": "g_L", "units": "milliS_per_cm2", "component": "leakage_current", "type": VariableType.CONSTANT}, {"name": "g_Na_max", "units": "milliS_per_cm2", "component": "sodium_channel", "type": VariableType.CONSTANT}, + {"name": "g_Na", "units": "milliS_per_cm2", "component": "sodium_channel", "type": VariableType.ALGEBRAIC}, {"name": "E_Na", "units": "millivolt", "component": "sodium_channel", "type": VariableType.CONSTANT}, {"name": "alpha_m", "units": "per_millisecond", "component": "sodium_channel_m_gate", "type": VariableType.ALGEBRAIC}, {"name": "beta_m", "units": "per_millisecond", "component": "sodium_channel_m_gate", "type": VariableType.ALGEBRAIC}, {"name": "alpha_h", "units": "per_millisecond", "component": "sodium_channel_h_gate", "type": VariableType.ALGEBRAIC}, {"name": "beta_h", "units": "per_millisecond", "component": "sodium_channel_h_gate", "type": VariableType.ALGEBRAIC}, - {"name": "g_K1", "units": "milliS_per_cm2", "component": "potassium_channel", "type": VariableType.ALGEBRAIC}, {"name": "g_K2", "units": "milliS_per_cm2", "component": "potassium_channel", "type": VariableType.ALGEBRAIC}, + {"name": "g_K1", "units": "milliS_per_cm2", "component": "potassium_channel", "type": VariableType.ALGEBRAIC}, {"name": "alpha_n", "units": "per_millisecond", "component": "potassium_channel_n_gate", "type": VariableType.ALGEBRAIC}, {"name": "beta_n", "units": "per_millisecond", "component": "potassium_channel_n_gate", "type": VariableType.ALGEBRAIC} ] @@ -58,14 +58,14 @@ def create_variables_array(): def initialise_variables(states, rates, variables): - variables[3] = 12.0 - variables[4] = 0.075 - variables[5] = -60.0 - variables[7] = 400.0 + variables[0] = 12.0 + variables[4] = -60.0 + variables[5] = 0.075 + variables[6] = 400.0 variables[8] = 40.0 states[0] = -87.0 - states[1] = 0.01 - states[2] = 0.8 + states[1] = 0.8 + states[2] = 0.01 states[3] = 0.01 @@ -74,34 +74,34 @@ def compute_computed_constants(variables): def compute_rates(voi, states, rates, variables): - 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[1] = variables[5]*(states[0]-variables[4]) + variables[7] = pow(states[2], 3.0)*states[1]*variables[6] + variables[3] = (variables[7]+0.14)*(states[0]-variables[8]) + variables[13] = 1.2*pow(states[3], 4.0) + variables[14] = 1.2*exp((-states[0]-90.0)/50.0)+0.015*exp((states[0]+90.0)/60.0) + variables[2] = (variables[14]+variables[13])*(states[0]+100.0) + rates[0] = -(variables[3]+variables[2]+variables[1])/variables[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[9] = 0.1*(-states[0]-48.0)/(exp((-states[0]-48.0)/15.0)-1.0) + rates[2] = variables[9]*(1.0-states[2])-variables[10]*states[2] 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[11] = 0.17*exp((-states[0]-90.0)/20.0) + rates[1] = variables[11]*(1.0-states[1])-variables[12]*states[1] variables[16] = 0.002*exp((-states[0]-90.0)/80.0) + variables[15] = 0.0001*(-states[0]-50.0)/(exp((-states[0]-50.0)/10.0)-1.0) rates[3] = variables[15]*(1.0-states[3])-variables[16]*states[3] def compute_variables(voi, states, rates, variables): - 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[1] = variables[5]*(states[0]-variables[4]) + variables[7] = pow(states[2], 3.0)*states[1]*variables[6] + variables[3] = (variables[7]+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[13] = 1.2*pow(states[3], 4.0) + variables[14] = 1.2*exp((-states[0]-90.0)/50.0)+0.015*exp((states[0]+90.0)/60.0) + variables[2] = (variables[14]+variables[13])*(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) diff --git a/tests/resources/generator/ode_multiple_dependent_odes/model.c b/tests/resources/generator/ode_multiple_dependent_odes/model.c index e587f0fb37..17fa7b0bd0 100644 --- a/tests/resources/generator/ode_multiple_dependent_odes/model.c +++ b/tests/resources/generator/ode_multiple_dependent_odes/model.c @@ -14,8 +14,8 @@ const size_t VARIABLE_COUNT = 1; const VariableInfo VOI_INFO = {"t", "second", "environment", VARIABLE_OF_INTEGRATION}; const VariableInfo STATE_INFO[] = { - {"x", "dimensionless", "my_x_ode", STATE}, - {"y", "dimensionless", "my_y_ode", STATE} + {"y", "dimensionless", "my_y_ode", STATE}, + {"x", "dimensionless", "my_x_ode", STATE} }; const VariableInfo VARIABLE_INFO[] = { @@ -52,8 +52,8 @@ void deleteArray(double *array) void initialiseVariables(double *states, double *rates, double *variables) { variables[0] = 1.0; - states[0] = -2.0; - states[1] = 0.0; + states[0] = 0.0; + states[1] = -2.0; } void computeComputedConstants(double *variables) @@ -62,8 +62,8 @@ void computeComputedConstants(double *variables) void computeRates(double voi, double *states, double *rates, double *variables) { - 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] = states[0]*1.0; + rates[0] = (variables[0]*(1.0-pow(states[1], 2.0))*states[0]-states[1])*1.0; } void computeVariables(double voi, double *states, double *rates, double *variables) diff --git a/tests/resources/generator/ode_multiple_dependent_odes/model.py b/tests/resources/generator/ode_multiple_dependent_odes/model.py index 7460bf0280..5cea471ccf 100644 --- a/tests/resources/generator/ode_multiple_dependent_odes/model.py +++ b/tests/resources/generator/ode_multiple_dependent_odes/model.py @@ -22,8 +22,8 @@ class VariableType(Enum): VOI_INFO = {"name": "t", "units": "second", "component": "environment", "type": VariableType.VARIABLE_OF_INTEGRATION} STATE_INFO = [ - {"name": "x", "units": "dimensionless", "component": "my_x_ode", "type": VariableType.STATE}, - {"name": "y", "units": "dimensionless", "component": "my_y_ode", "type": VariableType.STATE} + {"name": "y", "units": "dimensionless", "component": "my_y_ode", "type": VariableType.STATE}, + {"name": "x", "units": "dimensionless", "component": "my_x_ode", "type": VariableType.STATE} ] VARIABLE_INFO = [ @@ -41,8 +41,8 @@ def create_variables_array(): def initialise_variables(states, rates, variables): variables[0] = 1.0 - states[0] = -2.0 - states[1] = 0.0 + states[0] = 0.0 + states[1] = -2.0 def compute_computed_constants(variables): @@ -50,8 +50,8 @@ def compute_computed_constants(variables): def compute_rates(voi, states, rates, variables): - 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] = states[0]*1.0 + rates[0] = (variables[0]*(1.0-pow(states[1], 2.0))*states[0]-states[1])*1.0 def compute_variables(voi, states, rates, variables): 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 0570ef141a..8bbe3d04f2 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 @@ -14,8 +14,8 @@ const size_t VARIABLE_COUNT = 1; const VariableInfo VOI_INFO = {"t", "second", "my_component", VARIABLE_OF_INTEGRATION}; const VariableInfo STATE_INFO[] = { - {"x", "dimensionless", "my_component", STATE}, - {"y", "dimensionless", "my_component", STATE} + {"y", "dimensionless", "my_component", STATE}, + {"x", "dimensionless", "my_component", STATE} }; const VariableInfo VARIABLE_INFO[] = { @@ -52,8 +52,8 @@ void deleteArray(double *array) void initialiseVariables(double *states, double *rates, double *variables) { variables[0] = 1.0; - states[0] = -2.0; - states[1] = 0.0; + states[0] = 0.0; + states[1] = -2.0; } void computeComputedConstants(double *variables) @@ -62,8 +62,8 @@ void computeComputedConstants(double *variables) void computeRates(double voi, double *states, double *rates, double *variables) { - 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] = states[0]*1.0; + rates[0] = (variables[0]*(1.0-pow(states[1], 2.0))*states[0]-states[1])*1.0; } void computeVariables(double voi, double *states, double *rates, double *variables) 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 65f0e52abb..c007c7d27e 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 @@ -22,8 +22,8 @@ class VariableType(Enum): VOI_INFO = {"name": "t", "units": "second", "component": "my_component", "type": VariableType.VARIABLE_OF_INTEGRATION} STATE_INFO = [ - {"name": "x", "units": "dimensionless", "component": "my_component", "type": VariableType.STATE}, - {"name": "y", "units": "dimensionless", "component": "my_component", "type": VariableType.STATE} + {"name": "y", "units": "dimensionless", "component": "my_component", "type": VariableType.STATE}, + {"name": "x", "units": "dimensionless", "component": "my_component", "type": VariableType.STATE} ] VARIABLE_INFO = [ @@ -41,8 +41,8 @@ def create_variables_array(): def initialise_variables(states, rates, variables): variables[0] = 1.0 - states[0] = -2.0 - states[1] = 0.0 + states[0] = 0.0 + states[1] = -2.0 def compute_computed_constants(variables): @@ -50,8 +50,8 @@ def compute_computed_constants(variables): def compute_rates(voi, states, rates, variables): - 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] = states[0]*1.0 + rates[0] = (variables[0]*(1.0-pow(states[1], 2.0))*states[0]-states[1])*1.0 def compute_variables(voi, states, rates, variables): diff --git a/tests/resources/generator/robertson_model_1966/model.dae.c b/tests/resources/generator/robertson_model_1966/model.dae.c index 33537ce40b..37dc9c60ac 100644 --- a/tests/resources/generator/robertson_model_1966/model.dae.c +++ b/tests/resources/generator/robertson_model_1966/model.dae.c @@ -14,14 +14,14 @@ const size_t VARIABLE_COUNT = 5; const VariableInfo VOI_INFO = {"t", "dimensionless", "main", VARIABLE_OF_INTEGRATION}; const VariableInfo STATE_INFO[] = { - {"y1", "dimensionless", "main", STATE}, - {"y2", "dimensionless", "main", STATE} + {"y2", "dimensionless", "main", STATE}, + {"y1", "dimensionless", "main", STATE} }; const VariableInfo VARIABLE_INFO[] = { - {"k1", "dimensionless", "main", CONSTANT}, - {"k3", "dimensionless", "main", CONSTANT}, {"y3", "dimensionless", "main", ALGEBRAIC}, + {"k3", "dimensionless", "main", CONSTANT}, + {"k1", "dimensionless", "main", CONSTANT}, {"k2", "dimensionless", "main", CONSTANT}, {"y2_scaled", "dimensionless", "main", ALGEBRAIC} }; @@ -70,9 +70,9 @@ void objectiveFunction0(double *u, double *f, void *data) double *rates = ((RootFindingInfo *) data)->rates; double *variables = ((RootFindingInfo *) data)->variables; - variables[2] = u[0]; + variables[0] = u[0]; - f[0] = 1.0-(states[0]+states[1]+variables[2]); + f[0] = 1.0-(states[1]+states[0]+variables[0]); } void findRoot0(double voi, double *states, double *rates, double *variables) @@ -80,21 +80,21 @@ 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] = variables[0]; nlaSolve(objectiveFunction0, u, 1, &rfi); - variables[2] = u[0]; + variables[0] = u[0]; } void initialiseVariables(double *states, double *rates, double *variables) { - variables[0] = 0.04; + variables[0] = 0.0; variables[1] = 1.0e4; - variables[2] = 0.0; + variables[2] = 0.04; variables[3] = 3.0e7; - states[0] = 1.0; - states[1] = 0.0; + states[0] = 0.0; + states[1] = 1.0; } void computeComputedConstants(double *variables) @@ -104,12 +104,12 @@ void computeComputedConstants(double *variables) void computeRates(double voi, double *states, double *rates, double *variables) { 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[1] = -variables[2]*states[1]+variables[1]*states[0]*variables[0]; + rates[0] = variables[2]*states[1]-variables[3]*pow(states[0], 2.0)-variables[1]*states[0]*variables[0]; } void computeVariables(double voi, double *states, double *rates, double *variables) { findRoot0(voi, states, rates, variables); - variables[4] = 10000.0*states[1]; + variables[4] = 10000.0*states[0]; } diff --git a/tests/resources/generator/robertson_model_1966/model.dae.py b/tests/resources/generator/robertson_model_1966/model.dae.py index 1d3acf9e16..55b4e85dc8 100644 --- a/tests/resources/generator/robertson_model_1966/model.dae.py +++ b/tests/resources/generator/robertson_model_1966/model.dae.py @@ -22,14 +22,14 @@ class VariableType(Enum): VOI_INFO = {"name": "t", "units": "dimensionless", "component": "main", "type": VariableType.VARIABLE_OF_INTEGRATION} STATE_INFO = [ - {"name": "y1", "units": "dimensionless", "component": "main", "type": VariableType.STATE}, - {"name": "y2", "units": "dimensionless", "component": "main", "type": VariableType.STATE} + {"name": "y2", "units": "dimensionless", "component": "main", "type": VariableType.STATE}, + {"name": "y1", "units": "dimensionless", "component": "main", "type": VariableType.STATE} ] VARIABLE_INFO = [ - {"name": "k1", "units": "dimensionless", "component": "main", "type": VariableType.CONSTANT}, - {"name": "k3", "units": "dimensionless", "component": "main", "type": VariableType.CONSTANT}, {"name": "y3", "units": "dimensionless", "component": "main", "type": VariableType.ALGEBRAIC}, + {"name": "k3", "units": "dimensionless", "component": "main", "type": VariableType.CONSTANT}, + {"name": "k1", "units": "dimensionless", "component": "main", "type": VariableType.CONSTANT}, {"name": "k2", "units": "dimensionless", "component": "main", "type": VariableType.CONSTANT}, {"name": "y2_scaled", "units": "dimensionless", "component": "main", "type": VariableType.ALGEBRAIC} ] @@ -52,28 +52,28 @@ def objective_function_0(u, f, data): rates = data[2] variables = data[3] - variables[2] = u[0] + variables[0] = u[0] - f[0] = 1.0-(states[0]+states[1]+variables[2]) + f[0] = 1.0-(states[1]+states[0]+variables[0]) def find_root_0(voi, states, rates, variables): u = [nan]*1 - u[0] = variables[2] + u[0] = variables[0] u = nla_solve(objective_function_0, u, 1, [voi, states, rates, variables]) - variables[2] = u[0] + variables[0] = u[0] def initialise_variables(states, rates, variables): - variables[0] = 0.04 + variables[0] = 0.0 variables[1] = 1.0e4 - variables[2] = 0.0 + variables[2] = 0.04 variables[3] = 3.0e7 - states[0] = 1.0 - states[1] = 0.0 + states[0] = 0.0 + states[1] = 1.0 def compute_computed_constants(variables): @@ -82,10 +82,10 @@ def compute_computed_constants(variables): def compute_rates(voi, states, rates, variables): 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[1] = -variables[2]*states[1]+variables[1]*states[0]*variables[0] + rates[0] = variables[2]*states[1]-variables[3]*pow(states[0], 2.0)-variables[1]*states[0]*variables[0] def compute_variables(voi, states, rates, variables): find_root_0(voi, states, rates, variables) - variables[4] = 10000.0*states[1] + variables[4] = 10000.0*states[0] diff --git a/tests/resources/generator/robertson_model_1966/model.ode.c b/tests/resources/generator/robertson_model_1966/model.ode.c index 9bbeba9efd..2cf4a5cac7 100644 --- a/tests/resources/generator/robertson_model_1966/model.ode.c +++ b/tests/resources/generator/robertson_model_1966/model.ode.c @@ -14,14 +14,14 @@ const size_t VARIABLE_COUNT = 4; const VariableInfo VOI_INFO = {"t", "dimensionless", "main", VARIABLE_OF_INTEGRATION}; const VariableInfo STATE_INFO[] = { - {"y1", "dimensionless", "main", STATE}, {"y3", "dimensionless", "main", STATE}, - {"y2", "dimensionless", "main", STATE} + {"y2", "dimensionless", "main", STATE}, + {"y1", "dimensionless", "main", STATE} }; const VariableInfo VARIABLE_INFO[] = { - {"k1", "dimensionless", "main", CONSTANT}, {"k3", "dimensionless", "main", CONSTANT}, + {"k1", "dimensionless", "main", CONSTANT}, {"k2", "dimensionless", "main", CONSTANT}, {"y2_scaled", "dimensionless", "main", ALGEBRAIC} }; @@ -55,12 +55,12 @@ void deleteArray(double *array) void initialiseVariables(double *states, double *rates, double *variables) { - variables[0] = 0.04; - variables[1] = 1.0e4; + variables[0] = 1.0e4; + variables[1] = 0.04; variables[2] = 3.0e7; - states[0] = 1.0; + states[0] = 0.0; states[1] = 0.0; - states[2] = 0.0; + states[2] = 1.0; } void computeComputedConstants(double *variables) @@ -69,12 +69,12 @@ void computeComputedConstants(double *variables) void computeRates(double voi, double *states, double *rates, double *variables) { - 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[2] = -variables[1]*states[2]+variables[0]*states[1]*states[0]; + rates[1] = variables[1]*states[2]-variables[2]*pow(states[1], 2.0)-variables[0]*states[1]*states[0]; + rates[0] = variables[2]*pow(states[1], 2.0); } void computeVariables(double voi, double *states, double *rates, double *variables) { - variables[3] = 10000.0*states[2]; + variables[3] = 10000.0*states[1]; } diff --git a/tests/resources/generator/robertson_model_1966/model.ode.py b/tests/resources/generator/robertson_model_1966/model.ode.py index 32b9c8b8e8..91718e1dd7 100644 --- a/tests/resources/generator/robertson_model_1966/model.ode.py +++ b/tests/resources/generator/robertson_model_1966/model.ode.py @@ -22,14 +22,14 @@ class VariableType(Enum): VOI_INFO = {"name": "t", "units": "dimensionless", "component": "main", "type": VariableType.VARIABLE_OF_INTEGRATION} STATE_INFO = [ - {"name": "y1", "units": "dimensionless", "component": "main", "type": VariableType.STATE}, {"name": "y3", "units": "dimensionless", "component": "main", "type": VariableType.STATE}, - {"name": "y2", "units": "dimensionless", "component": "main", "type": VariableType.STATE} + {"name": "y2", "units": "dimensionless", "component": "main", "type": VariableType.STATE}, + {"name": "y1", "units": "dimensionless", "component": "main", "type": VariableType.STATE} ] VARIABLE_INFO = [ - {"name": "k1", "units": "dimensionless", "component": "main", "type": VariableType.CONSTANT}, {"name": "k3", "units": "dimensionless", "component": "main", "type": VariableType.CONSTANT}, + {"name": "k1", "units": "dimensionless", "component": "main", "type": VariableType.CONSTANT}, {"name": "k2", "units": "dimensionless", "component": "main", "type": VariableType.CONSTANT}, {"name": "y2_scaled", "units": "dimensionless", "component": "main", "type": VariableType.ALGEBRAIC} ] @@ -44,12 +44,12 @@ def create_variables_array(): def initialise_variables(states, rates, variables): - variables[0] = 0.04 - variables[1] = 1.0e4 + variables[0] = 1.0e4 + variables[1] = 0.04 variables[2] = 3.0e7 - states[0] = 1.0 + states[0] = 0.0 states[1] = 0.0 - states[2] = 0.0 + states[2] = 1.0 def compute_computed_constants(variables): @@ -57,10 +57,10 @@ def compute_computed_constants(variables): def compute_rates(voi, states, rates, variables): - 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[2] = -variables[1]*states[2]+variables[0]*states[1]*states[0] + rates[1] = variables[1]*states[2]-variables[2]*pow(states[1], 2.0)-variables[0]*states[1]*states[0] + rates[0] = variables[2]*pow(states[1], 2.0) def compute_variables(voi, states, rates, variables): - variables[3] = 10000.0*states[2] + variables[3] = 10000.0*states[1] 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 67d8b624ae..c9be58dcc1 100644 --- a/tests/resources/generator/unknown_variable_as_external_variable/model.c +++ b/tests/resources/generator/unknown_variable_as_external_variable/model.c @@ -11,16 +11,16 @@ const char LIBCELLML_VERSION[] = "0.6.2"; const size_t VARIABLE_COUNT = 10; const VariableInfo VARIABLE_INFO[] = { - {"v", "fmol_per_sec", "SLC_template3_ss", ALGEBRAIC}, - {"E", "fmol", "SLC_template3_ss", CONSTANT}, - {"P_0", "per_fmol_sec4", "SLC_template3_ss", CONSTANT}, + {"P_5", "per_sec3", "SLC_template3_ss", CONSTANT}, {"q_Ao", "fmol", "SLC_template3_ss", CONSTANT}, - {"P_1", "per_fmol_sec4", "SLC_template3_ss", CONSTANT}, {"q_Ai", "fmol", "SLC_template3_ss", CONSTANT}, - {"P_2", "per_fmol_sec3", "SLC_template3_ss", CONSTANT}, - {"P_5", "per_sec3", "SLC_template3_ss", CONSTANT}, {"P_4", "per_fmol2_sec3", "SLC_template3_ss", CONSTANT}, - {"P_3", "per_fmol_sec3", "SLC_template3_ss", EXTERNAL} + {"P_3", "per_fmol_sec3", "SLC_template3_ss", EXTERNAL}, + {"P_2", "per_fmol_sec3", "SLC_template3_ss", CONSTANT}, + {"P_1", "per_fmol_sec4", "SLC_template3_ss", CONSTANT}, + {"P_0", "per_fmol_sec4", "SLC_template3_ss", CONSTANT}, + {"E", "fmol", "SLC_template3_ss", CONSTANT}, + {"v", "fmol_per_sec", "SLC_template3_ss", ALGEBRAIC} }; double * createVariablesArray() @@ -41,15 +41,15 @@ void deleteArray(double *array) void initialiseVariables(double *variables, 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); + variables[0] = 810000.0; + variables[1] = 150.0; + variables[2] = 2.0; + variables[3] = 247140.0; + variables[5] = 2902500.0; + variables[6] = 3402000.0; + variables[7] = 21262500.0; + variables[8] = 1.1; + variables[4] = externalVariable(variables, 4); } void computeComputedConstants(double *variables) @@ -58,6 +58,6 @@ void computeComputedConstants(double *variables) void computeVariables(double *variables, 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]); + variables[4] = externalVariable(variables, 4); + variables[9] = variables[8]*(variables[7]*variables[1]-variables[6]*variables[2])/(variables[5]*variables[2]+variables[4]*variables[1]+variables[3]*variables[2]*variables[1]+variables[0]); } 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 22a45965e8..55573e18a2 100644 --- a/tests/resources/generator/unknown_variable_as_external_variable/model.py +++ b/tests/resources/generator/unknown_variable_as_external_variable/model.py @@ -18,16 +18,16 @@ class VariableType(Enum): VARIABLE_INFO = [ - {"name": "v", "units": "fmol_per_sec", "component": "SLC_template3_ss", "type": VariableType.ALGEBRAIC}, - {"name": "E", "units": "fmol", "component": "SLC_template3_ss", "type": VariableType.CONSTANT}, - {"name": "P_0", "units": "per_fmol_sec4", "component": "SLC_template3_ss", "type": VariableType.CONSTANT}, + {"name": "P_5", "units": "per_sec3", "component": "SLC_template3_ss", "type": VariableType.CONSTANT}, {"name": "q_Ao", "units": "fmol", "component": "SLC_template3_ss", "type": VariableType.CONSTANT}, - {"name": "P_1", "units": "per_fmol_sec4", "component": "SLC_template3_ss", "type": VariableType.CONSTANT}, {"name": "q_Ai", "units": "fmol", "component": "SLC_template3_ss", "type": VariableType.CONSTANT}, - {"name": "P_2", "units": "per_fmol_sec3", "component": "SLC_template3_ss", "type": VariableType.CONSTANT}, - {"name": "P_5", "units": "per_sec3", "component": "SLC_template3_ss", "type": VariableType.CONSTANT}, {"name": "P_4", "units": "per_fmol2_sec3", "component": "SLC_template3_ss", "type": VariableType.CONSTANT}, - {"name": "P_3", "units": "per_fmol_sec3", "component": "SLC_template3_ss", "type": VariableType.EXTERNAL} + {"name": "P_3", "units": "per_fmol_sec3", "component": "SLC_template3_ss", "type": VariableType.EXTERNAL}, + {"name": "P_2", "units": "per_fmol_sec3", "component": "SLC_template3_ss", "type": VariableType.CONSTANT}, + {"name": "P_1", "units": "per_fmol_sec4", "component": "SLC_template3_ss", "type": VariableType.CONSTANT}, + {"name": "P_0", "units": "per_fmol_sec4", "component": "SLC_template3_ss", "type": VariableType.CONSTANT}, + {"name": "E", "units": "fmol", "component": "SLC_template3_ss", "type": VariableType.CONSTANT}, + {"name": "v", "units": "fmol_per_sec", "component": "SLC_template3_ss", "type": VariableType.ALGEBRAIC} ] @@ -36,15 +36,15 @@ def create_variables_array(): def initialise_variables(variables, 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) + variables[0] = 810000.0 + variables[1] = 150.0 + variables[2] = 2.0 + variables[3] = 247140.0 + variables[5] = 2902500.0 + variables[6] = 3402000.0 + variables[7] = 21262500.0 + variables[8] = 1.1 + variables[4] = external_variable(variables, 4) def compute_computed_constants(variables): @@ -52,5 +52,5 @@ def compute_computed_constants(variables): def compute_variables(variables, 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]) + variables[4] = external_variable(variables, 4) + variables[9] = variables[8]*(variables[7]*variables[1]-variables[6]*variables[2])/(variables[5]*variables[2]+variables[4]*variables[1]+variables[3]*variables[2]*variables[1]+variables[0]) From 5e40b6b287073e54fcc689d3c019c86f159cacf0 Mon Sep 17 00:00:00 2001 From: Hugh Sorby Date: Sat, 9 Nov 2024 11:54:43 +1300 Subject: [PATCH 06/10] Fix expected output for python analyser test. --- tests/bindings/python/test_analyser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/bindings/python/test_analyser.py b/tests/bindings/python/test_analyser.py index 654daf1a20..5e40941624 100644 --- a/tests/bindings/python/test_analyser.py +++ b/tests/bindings/python/test_analyser.py @@ -152,12 +152,12 @@ def test_coverage(self): # Ensure coverage for AnalyserVariable. - av = am.variable(3) + av = am.variable(4) self.assertEqual(AnalyserVariable.Type.CONSTANT, av.type()) self.assertEqual("constant", AnalyserVariable.typeAsString(av.type())) self.assertEqual("constant", AnalyserVariable_typeAsString(av.type())) - self.assertEqual(3, av.index()) + self.assertEqual(4, av.index()) self.assertIsNotNone(av.initialisingVariable()) self.assertIsNotNone(av.variable()) self.assertEqual(1, av.equationCount()) From 0f316ad9f3a9ea906d3aaf132428977f0c6de937 Mon Sep 17 00:00:00 2001 From: Hugh Sorby Date: Sat, 9 Nov 2024 12:17:16 +1300 Subject: [PATCH 07/10] Update Checking Analyser Model variables related API expected output. --- tests/bindings/javascript/analysermodel.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/bindings/javascript/analysermodel.test.js b/tests/bindings/javascript/analysermodel.test.js index a84ad5e3d2..bfe5604c93 100644 --- a/tests/bindings/javascript/analysermodel.test.js +++ b/tests/bindings/javascript/analysermodel.test.js @@ -64,7 +64,7 @@ describe("Analyser Model tests", () => { test('Checking Analyser Model variables related API.', () => { expect(am.variableCount()).toBe(18) expect(am.variables().size()).toBe(18) - expect(am.variable(2).variable().name()).toBe("i_K") + expect(am.variable(2).variable().name()).toBe("i_L") }); test('Checking Analyser Model need* API.', () => { expect(am.needEqFunction()).toBe(false) From 6ef2088b29619db0e93d0756bbda12740afcdb21 Mon Sep 17 00:00:00 2001 From: Alan Garny Date: Sat, 9 Nov 2024 13:19:48 +1300 Subject: [PATCH 08/10] Analyser: added some empty lines. Makes the code easier to read/maintain for me... who tends to work on the analyser. :) --- src/analyser.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/analyser.cpp b/src/analyser.cpp index df07564ef7..8ceabbf2d9 100644 --- a/src/analyser.cpp +++ b/src/analyser.cpp @@ -745,9 +745,11 @@ void Analyser::AnalyserImpl::analyseNode(const XmlNodePtr &node, AnalyserEquationAstPtr tempAst; AnalyserEquationAstPtr astRightChild; + for (size_t i = childCount - 1; i > 0; --i) { astRightChild = tempAst; tempAst = AnalyserEquationAst::create(); + if (astRightChild) { if (i == childCount - 2) { astRightChild->swapLeftAndRightChildren(); @@ -757,12 +759,16 @@ void Analyser::AnalyserImpl::analyseNode(const XmlNodePtr &node, tempAst->mPimpl->mOwnedRightChild = astRightChild; } } + if (i != childCount - 2) { analyseNode(mathmlChildNode(node, 0), tempAst, nullptr, component, equation); } + analyseNode(mathmlChildNode(node, i), tempAst->mPimpl->mOwnedLeftChild, tempAst, component, equation); } + analyseNode(mathmlChildNode(node, 0), tempAst, astParent, component, equation); + ast = tempAst; // Relational and logical operators. From 76b4b5baefca6b035dce8dc5e14ea08595b46cf3 Mon Sep 17 00:00:00 2001 From: Alan Garny Date: Sat, 9 Nov 2024 13:22:45 +1300 Subject: [PATCH 09/10] Analyser: removed an empty lines. --- src/analyser.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/analyser.cpp b/src/analyser.cpp index 8ceabbf2d9..5421c12c26 100644 --- a/src/analyser.cpp +++ b/src/analyser.cpp @@ -742,7 +742,6 @@ void Analyser::AnalyserImpl::analyseNode(const XmlNodePtr &node, // +-------------+ auto childCount = mathmlChildCount(node); - AnalyserEquationAstPtr tempAst; AnalyserEquationAstPtr astRightChild; From 949994882593991b504a5aac41a4632b8f2ac8d2 Mon Sep 17 00:00:00 2001 From: Alan Garny Date: Sat, 9 Nov 2024 13:32:30 +1300 Subject: [PATCH 10/10] Analyser: test against nullptr. --- src/analyser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/analyser.cpp b/src/analyser.cpp index 5421c12c26..085afdb432 100644 --- a/src/analyser.cpp +++ b/src/analyser.cpp @@ -749,7 +749,7 @@ void Analyser::AnalyserImpl::analyseNode(const XmlNodePtr &node, astRightChild = tempAst; tempAst = AnalyserEquationAst::create(); - if (astRightChild) { + if (astRightChild != nullptr) { if (i == childCount - 2) { astRightChild->swapLeftAndRightChildren(); tempAst = astRightChild;