Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
Learning Python
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Steinmann, Victor
Learning Python
Commits
0528b858
Commit
0528b858
authored
5 months ago
by
Steinmann Victor
Browse files
Options
Downloads
Patches
Plain Diff
tidied up functions used to express constraints
parent
bfb60671
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
optimierung_pymoo.ipynb
+120
-69
120 additions, 69 deletions
optimierung_pymoo.ipynb
with
120 additions
and
69 deletions
optimierung_pymoo.ipynb
+
120
−
69
View file @
0528b858
...
@@ -58,8 +58,17 @@
...
@@ -58,8 +58,17 @@
"output_type": "stream",
"output_type": "stream",
"text": [
"text": [
"Defaulting to user installation because normal site-packages is not writeable\n",
"Defaulting to user installation because normal site-packages is not writeable\n",
"Requirement already satisfied: pyomo in c:\\users\\steinmann\\appdata\\roaming\\python\\python312\\site-packages (6.8.2)\n",
"Collecting pyomo\n",
"Requirement already satisfied: ply in c:\\users\\steinmann\\appdata\\roaming\\python\\python312\\site-packages (from pyomo) (3.11)\n"
" Downloading Pyomo-6.8.2-py3-none-any.whl.metadata (8.0 kB)\n",
"Collecting ply (from pyomo)\n",
" Downloading ply-3.11-py2.py3-none-any.whl.metadata (844 bytes)\n",
"Downloading Pyomo-6.8.2-py3-none-any.whl (3.7 MB)\n",
" ---------------------------------------- 0.0/3.7 MB ? eta -:--:--\n",
" ---------------------------- ----------- 2.6/3.7 MB 12.6 MB/s eta 0:00:01\n",
" ---------------------------------------- 3.7/3.7 MB 11.6 MB/s eta 0:00:00\n",
"Downloading ply-3.11-py2.py3-none-any.whl (49 kB)\n",
"Installing collected packages: ply, pyomo\n",
"Successfully installed ply-3.11 pyomo-6.8.2\n"
]
]
},
},
{
{
...
@@ -67,8 +76,8 @@
...
@@ -67,8 +76,8 @@
"output_type": "stream",
"output_type": "stream",
"text": [
"text": [
"\n",
"\n",
"[notice] A new release of pip is available: 24.
2
-> 25.0\n",
"[notice] A new release of pip is available: 24.
3.1
-> 25.0\n",
"[notice] To update, run: C:\\
Program Files\\Python312
\\python.exe -m pip install --upgrade pip\n"
"[notice] To update, run: C:\\
Users\\Victor\\AppData\\Local\\Microsoft\\WindowsApps\\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0
\\python.exe -m pip install --upgrade pip\n"
]
]
}
}
],
],
...
@@ -78,7 +87,7 @@
...
@@ -78,7 +87,7 @@
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count":
2
,
"execution_count":
4
,
"metadata": {},
"metadata": {},
"outputs": [
"outputs": [
{
{
...
@@ -108,7 +117,7 @@
...
@@ -108,7 +117,7 @@
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count":
3
,
"execution_count":
5
,
"metadata": {},
"metadata": {},
"outputs": [
"outputs": [
{
{
...
@@ -164,7 +173,7 @@
...
@@ -164,7 +173,7 @@
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count":
4
,
"execution_count":
7
,
"metadata": {},
"metadata": {},
"outputs": [],
"outputs": [],
"source": [
"source": [
...
@@ -174,7 +183,7 @@
...
@@ -174,7 +183,7 @@
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count":
5
,
"execution_count":
6
,
"metadata": {},
"metadata": {},
"outputs": [],
"outputs": [],
"source": [
"source": [
...
@@ -207,17 +216,9 @@
...
@@ -207,17 +216,9 @@
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count":
25
,
"execution_count":
null
,
"metadata": {},
"metadata": {},
"outputs": [
"outputs": [],
{
"name": "stdout",
"output_type": "stream",
"text": [
"{None: {'nodes': ['source', 'pump1', 'pump2', 'valveA', 'valveB', 'valveC'], 'pumps': ['pump1', 'pump2'], 'valves': ['valveA', 'valveB', 'valveC'], 'Q_valve': {'valveA': 1.0, 'valveB': 1.0, 'valveC': 2.0}}}\n"
]
}
],
"source": [
"source": [
"#defining abstract modell for given Network\n",
"#defining abstract modell for given Network\n",
"import pyomo.environ as pyo\n",
"import pyomo.environ as pyo\n",
...
@@ -237,23 +238,21 @@
...
@@ -237,23 +238,21 @@
"\n",
"\n",
"#Optimierungsvariable\n",
"#Optimierungsvariable\n",
"modell.n = pyo.Var(modell.pumps,bounds=(750/3600,1))\n",
"modell.n = pyo.Var(modell.pumps,bounds=(750/3600,1))\n",
"modell.Q = pyo.Var(modell.nodes)\n",
"modell.Q = pyo.Var(modell.nodes
,bounds=(0.,10.)
)\n",
"\n",
"\n",
"#expressions for constraints:\n",
"#expressions for constraints:\n",
"def PumpFlow(modell,pump):\n",
"def PumpFlow(modell,pump):\n",
" return
np.dot
(np.array([modell.Q[pump]**2,modell.n[pump]*modell.Q[pump],modell.n[pump]**2]),LR_H.coef_)\n",
" return
pyo.summation
(np.array([modell.Q[pump]**2,
modell.n[pump]*modell.Q[pump],
modell.n[pump]**2]),LR_H.coef_
,index=[0,1,2]
)\n",
"def Pump_delivery_req(modell,pump):\n",
"def Pump_delivery_req(modell,pump):\n",
" return PumpFlow(modell,pump) ==pyo.summation(modell.Q,index=graph.successors(pump))\n",
" return PumpFlow(modell,pump) ==pyo.summation(modell.Q,index=graph.successors(pump))\n",
"\n",
"\n",
"\n",
"def valve_req_rule(modell,valve):\n",
"def valve_req_rule(modell,valve):\n",
" return modell.Q[valve]>=modell.Q_valve[valve]\n",
" return modell.Q[valve]>=modell.Q_valve[valve]\n",
"\n",
"\n",
"#modell.Flow_Objective = pyo.Objective(modell.pumps,rule=Flow_req,sense=pyo.minimize)\n",
"def continuity_inflow(modell,node):\n",
"\n",
" return modell.Q[node]==pyo.summation(modell.Q, index=graph.successors(node))\n",
"#Constaints\n",
"def continuity_outflow(modell,node):\n",
"def continuityRule(modell,node):\n",
" return modell.Q[node]==pyo.summation(modell.Q,index=graph.predecessors(node))\n",
" return pyo.summation(modell.Q, index=graph.predecessors(node))==pyo.summation(modell.Q, index=graph.successors(node))\n",
"\n",
"\n",
"#Objective\n",
"#Objective\n",
"def PumpPower(modell):\n",
"def PumpPower(modell):\n",
...
@@ -262,18 +261,7 @@
...
@@ -262,18 +261,7 @@
" [modell.Q[i]**3,(modell.Q[i]**2)*modell.n[i],modell.Q[i]*modell.n[i]**2,modell.n[i]**3]\n",
" [modell.Q[i]**3,(modell.Q[i]**2)*modell.n[i],modell.Q[i]*modell.n[i]**2,modell.n[i]**3]\n",
" ),LR_P.coef_\n",
" ),LR_P.coef_\n",
" ) for i in modell.pumps)\n",
" ) for i in modell.pumps)\n",
"modell.Power_Objective = pyo.Objective(rule=PumpPower,sense=pyo.minimize)\n",
"modell.Power_Objective = pyo.Objective(rule=PumpPower,sense=pyo.minimize)"
"\n",
"TestData={\n",
" None:{\n",
" \n",
" 'nodes':[key for key in graph.nodes.keys()],\n",
" 'pumps':[key for key in graph.nodes.keys() if 'pump' in key],\n",
" 'valves':[key for key in graph.nodes.keys() if 'valve' in key],\n",
" 'Q_valve':{'valveA':1.,'valveB':1.,'valveC':2.},\n",
" }\n",
"}\n",
"print(TestData)"
]
]
},
},
{
{
...
@@ -289,79 +277,142 @@
...
@@ -289,79 +277,142 @@
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count":
26
,
"execution_count":
87
,
"metadata": {},
"metadata": {},
"outputs": [
"outputs": [
{
{
"name": "stdout",
"name": "stdout",
"output_type": "stream",
"output_type": "stream",
"text": [
"text": [
"SCIP version 9.2.
0
[precision: 8 byte] [memory: block] [mode: optimized] [LP solver: Soplex 7.1.
2
] [GitHash:
74cea9222e
]\n",
"SCIP version 9.2.
1
[precision: 8 byte] [memory: block] [mode: optimized] [LP solver: Soplex 7.1.
3
] [GitHash:
0d2d3c7c2d
]\n",
"Copyright (c) 2002-202
4
Zuse Institute Berlin (ZIB)\n",
"Copyright (c) 2002-202
5
Zuse Institute Berlin (ZIB)\n",
"\n",
"\n",
"External libraries: \n",
"External libraries: \n",
" Soplex 7.1.
2
Linear Programming Solver developed at Zuse Institute Berlin (soplex.zib.de) [GitHash:
b040369c
]\n",
" Soplex 7.1.
3
Linear Programming Solver developed at Zuse Institute Berlin (soplex.zib.de) [GitHash:
60fd96f2
]\n",
" CppAD 20180000.0 Algorithmic Differentiation of C++ algorithms developed by B. Bell (github.com/coin-or/CppAD)\n",
" CppAD 20180000.0 Algorithmic Differentiation of C++ algorithms developed by B. Bell (github.com/coin-or/CppAD)\n",
" TinyCThread 1.2 small portable implementation of the C11 threads API (tinycthread.github.io)\n",
" TinyCThread 1.2 small portable implementation of the C11 threads API (tinycthread.github.io)\n",
" MPIR 3.0.0 Multiple Precision Integers and Rationals Library developed by W. Hart (mpir.org)\n",
" MPIR 3.0.0 Multiple Precision Integers and Rationals Library developed by W. Hart (mpir.org)\n",
" ZIMPL 3.6.2 Zuse Institute Mathematical Programming Language developed by T. Koch (zimpl.zib.de)\n",
" ZIMPL 3.6.2 Zuse Institute Mathematical Programming Language developed by T. Koch (zimpl.zib.de)\n",
" AMPL/MP 690e9e7 AMPL .nl file reader library (github.com/ampl/mp)\n",
" AMPL/MP 690e9e7 AMPL .nl file reader library (github.com/ampl/mp)\n",
" PaPILO 2.4.
0
parallel presolve for integer and linear optimization (github.com/scipopt/papilo) (built with TBB) [GitHash:
2d9fe29f
]\n",
" PaPILO 2.4.
1
parallel presolve for integer and linear optimization (github.com/scipopt/papilo) (built with TBB) [GitHash:
11974394
]\n",
" Nauty 2.8.8 Computing Graph Automorphism Groups by Brendan D. McKay (users.cecs.anu.edu.au/~bdm/nauty)\n",
" Nauty 2.8.8 Computing Graph Automorphism Groups by Brendan D. McKay (users.cecs.anu.edu.au/~bdm/nauty)\n",
" sassy 1.1 Symmetry preprocessor by Markus Anders (github.com/markusa4/sassy)\n",
" sassy 1.1 Symmetry preprocessor by Markus Anders (github.com/markusa4/sassy)\n",
" Ipopt 3.14.16 Interior Point Optimizer developed by A. Waechter et.al. (github.com/coin-or/Ipopt)\n",
" Ipopt 3.14.16 Interior Point Optimizer developed by A. Waechter et.al. (github.com/coin-or/Ipopt)\n",
"\n",
"\n",
"user parameter file <scip.set> not found - using default parameters\n",
"user parameter file <scip.set> not found - using default parameters\n",
"read problem <C:\\Users\\
STEINM~1
\\AppData\\Local\\Temp\\tmp
rv0ikbwh
.pyomo.nl>\n",
"read problem <C:\\Users\\
Victor
\\AppData\\Local\\Temp\\tmp
fcunk5gi
.pyomo.nl>\n",
"============\n",
"============\n",
"\n",
"\n",
"original problem has
9
variables (0 bin, 0 int, 0 impl,
9
cont) and
12
constraints\n",
"original problem has
8
variables (0 bin, 0 int, 0 impl,
8
cont) and
6
constraints\n",
"\n",
"\n",
"solve problem\n",
"solve problem\n",
"=============\n",
"=============\n",
"\n",
"\n",
"presolving:\n",
"presolving:\n",
"(round 1, fast) 2 del vars, 6 del conss, 0 add conss, 12 chg bounds, 0 chg sides, 0 chg coeffs, 0 upgd conss, 0 impls, 0 clqs\n",
"(round 1, fast) 0 del vars, 3 del conss, 0 add conss, 11 chg bounds, 0 chg sides, 0 chg coeffs, 0 upgd conss, 0 impls, 0 clqs\n",
"presolving (2 rounds: 2 fast, 0 medium, 0 exhaustive):\n",
" (0.0s) symmetry computation started: requiring (bin +, int +, cont +), (fixed: bin -, int -, cont -)\n",
" 2 deleted vars, 6 deleted constraints, 0 added constraints, 16 tightened bounds, 0 added holes, 0 changed sides, 0 changed coefficients\n",
" (0.0s) symmetry computation finished: 1 generators found (max: 1500, log10 of symmetry group size: 0.0) (symcode time: 0.00)\n",
"dynamic symmetry handling statistics:\n",
" orbitopal reduction: no components\n",
" orbital reduction: no components\n",
" lexicographic reduction: no permutations\n",
"handled 1 out of 1 symmetry components\n",
"(round 2, exhaustive) 0 del vars, 3 del conss, 1 add conss, 11 chg bounds, 0 chg sides, 0 chg coeffs, 0 upgd conss, 0 impls, 0 clqs\n",
"presolving (3 rounds: 3 fast, 2 medium, 2 exhaustive):\n",
" 0 deleted vars, 3 deleted constraints, 0 added constraints, 11 tightened bounds, 0 added holes, 0 changed sides, 0 changed coefficients\n",
" 0 implications, 0 cliques\n",
" 0 implications, 0 cliques\n",
"presolving detected infeasibility\n",
"presolved problem has 8 variables (0 bin, 0 int, 0 impl, 8 cont) and 4 constraints\n",
" 1 constraints of type <linear>\n",
" 3 constraints of type <nonlinear>\n",
"Presolving Time: 0.00\n",
"Presolving Time: 0.00\n",
"\n",
"\n",
"SCIP Status : problem is solved [infeasible]\n",
" time | node | left |LP iter|LP it/n|mem/heur|mdpt |vars |cons |rows |cuts |sepa|confs|strbr| dualbound | primalbound | gap | compl. \n",
" 0.0s| 1 | 0 | 22 | - | 914k | 0 | 25 | 4 | 36 | 0 | 0 | 0 | 0 |-3.474607e+01 | -- | Inf | unknown\n",
"L 0.0s| 1 | 0 | 22 | - | subnlp| 0 | 25 | 4 | 36 | 0 | 0 | 0 | 0 |-3.474607e+01 | 1.151406e+01 | Inf | unknown\n",
" 0.0s| 1 | 0 | 22 | - | 914k | 0 | 25 | 4 | 36 | 0 | 0 | 0 | 0 |-3.474607e+01 | 1.151406e+01 | Inf | unknown\n",
" 0.0s| 1 | 0 | 22 | - | 914k | 0 | 25 | 4 | 36 | 0 | 0 | 0 | 0 |-3.474607e+01 | 1.151406e+01 | Inf | unknown\n",
" 0.0s| 1 | 0 | 26 | - | 920k | 0 | 25 | 4 | 39 | 3 | 1 | 0 | 0 |-1.963132e+01 | 1.151406e+01 | Inf | unknown\n",
" 0.0s| 1 | 0 | 26 | - | 920k | 0 | 25 | 4 | 39 | 3 | 1 | 0 | 0 |-1.963132e+01 | 1.151406e+01 | Inf | unknown\n",
" 0.0s| 1 | 0 | 30 | - | 935k | 0 | 25 | 4 | 42 | 6 | 2 | 0 | 0 |-1.885311e+01 | 1.151406e+01 | Inf | unknown\n",
" 0.0s| 1 | 0 | 33 | - | 939k | 0 | 25 | 4 | 45 | 9 | 3 | 0 | 0 |-1.766937e+01 | 1.151406e+01 | Inf | unknown\n",
" 0.0s| 1 | 0 | 33 | - | 939k | 0 | 25 | 4 | 45 | 9 | 3 | 0 | 0 |-1.766937e+01 | 1.151406e+01 | Inf | unknown\n",
" 0.0s| 1 | 0 | 36 | - | 939k | 0 | 25 | 4 | 47 | 11 | 4 | 0 | 0 |-1.728948e+01 | 1.151406e+01 | Inf | unknown\n",
" 0.0s| 1 | 0 | 37 | - | 941k | 0 | 25 | 4 | 48 | 12 | 5 | 0 | 0 |-1.712829e+01 | 1.151406e+01 | Inf | unknown\n",
" 0.0s| 1 | 0 | 38 | - | 941k | 0 | 25 | 4 | 49 | 13 | 6 | 0 | 0 |-1.701866e+01 | 1.151406e+01 | Inf | unknown\n",
" 0.0s| 1 | 0 | 39 | - | 943k | 0 | 25 | 4 | 50 | 14 | 7 | 0 | 0 |-1.701746e+01 | 1.151406e+01 | Inf | unknown\n",
" 0.0s| 1 | 0 | 41 | - | 951k | 0 | 25 | 4 | 52 | 16 | 8 | 0 | 0 |-1.695801e+01 | 1.151406e+01 | Inf | unknown\n",
" 0.0s| 1 | 0 | 332 | - | 957k | 0 | 25 | 4 | 52 | 16 | 9 | 0 | 0 | 1.150982e+01 | 1.151406e+01 | 0.04%| unknown\n",
" time | node | left |LP iter|LP it/n|mem/heur|mdpt |vars |cons |rows |cuts |sepa|confs|strbr| dualbound | primalbound | gap | compl. \n",
" 0.0s| 1 | 0 | 334 | - | 957k | 0 | 25 | 4 | 54 | 18 | 10 | 0 | 0 | 1.150982e+01 | 1.151406e+01 | 0.04%| unknown\n",
" 0.0s| 1 | 0 | 346 | - | 957k | 0 | 25 | 4 | 37 | 20 | 11 | 0 | 0 | 1.151405e+01 | 1.151406e+01 | 0.00%| unknown\n",
" 0.0s| 1 | 0 | 346 | - | 957k | 0 | 25 | 4 | 20 | 20 | 11 | 0 | 0 | 1.151405e+01 | 1.151406e+01 | 0.00%| unknown\n",
" 0.0s| 1 | 0 | 347 | - | 957k | 0 | 25 | 4 | 21 | 21 | 12 | 0 | 0 | 1.151406e+01 | 1.151406e+01 | 0.00%| unknown\n",
"L 0.0s| 1 | 0 | 347 | - | subnlp| 0 | 25 | 4 | 21 | 21 | 13 | 0 | 0 | 1.151406e+01 | 1.151406e+01 | 0.00%| unknown\n",
" 0.0s| 1 | 0 | 347 | - | 958k | 0 | 25 | 4 | 21 | 21 | 13 | 0 | 0 | 1.151406e+01 | 1.151406e+01 | 0.00%| unknown\n",
"* 0.0s| 1 | 0 | 347 | - | LP | 0 | 25 | 4 | 21 | 21 | 14 | 0 | 0 | 1.151406e+01 | 1.151406e+01 | 0.00%| unknown\n",
"\n",
"SCIP Status : problem is solved [optimal solution found]\n",
"Solving Time (sec) : 0.00\n",
"Solving Time (sec) : 0.00\n",
"Solving Nodes :
0
\n",
"Solving Nodes :
1
\n",
"Primal Bound : +1.
00000000000000e+20
(
0
solutions)\n",
"Primal Bound : +1.
15140564709997e+01
(
3
solutions)\n",
"Dual Bound : +1.
00000000000000e+20
\n",
"Dual Bound : +1.
15140564709997e+01
\n",
"Gap : 0.00 %\n",
"Gap : 0.00 %\n",
"WARNING: Loading a SolverResults object with a warning status into\n",
"\n",
"model.name=\"unknown\";\n",
"Problem: \n",
" - termination condition: infeasible\n",
"- Lower bound: -inf\n",
" - message from solver: infeasible\n",
" Upper bound: inf\n",
" Number of objectives: 1\n",
" Number of constraints: 0\n",
" Number of variables: 7\n",
" Sense: unknown\n",
"Solver: \n",
"- Status: ok\n",
" Message: optimal solution found\n",
" Termination condition: optimal\n",
" Id: 0\n",
" Error rc: 0\n",
" Time: 0.3383963108062744\n",
"Solution: \n",
"- number of solutions: 0\n",
" number of solutions displayed: 0\n",
"\n",
"n : Size=2, Index=pumps\n",
"n : Size=2, Index=pumps\n",
" Key : Lower : Value : Upper : Fixed : Stale : Domain\n",
" Key : Lower : Value : Upper : Fixed : Stale : Domain\n",
" pump1 : 0.20833333333333334 :
None
: 1 : False :
Tru
e : Reals\n",
" pump1 : 0.20833333333333334 :
0.34519801810114614
: 1 : False :
Fals
e : Reals\n",
" pump2 : 0.20833333333333334 :
None
: 1 : False :
Tru
e : Reals\n",
" pump2 : 0.20833333333333334 :
0.4881837415314729
: 1 : False :
Fals
e : Reals\n",
"Q : Size=6, Index=nodes\n",
"Q : Size=6, Index=nodes\n",
" Key : Lower : Value : Upper : Fixed : Stale : Domain\n",
" Key : Lower : Value : Upper : Fixed : Stale : Domain\n",
" pump1 :
None : None : None
: False :
Tru
e : Reals\n",
" pump1 :
0.0 : 0.0 : 10.0
: False :
Fals
e : Reals\n",
" pump2 :
None : None : None
: False :
Tru
e : Reals\n",
" pump2 :
0.0 : 0.0 : 10.0
: False :
Fals
e : Reals\n",
" source :
None
: None :
None
: False : True : Reals\n",
" source :
0.0
: None :
10.0
: False : True : Reals\n",
" valveA :
None : None : None
: False :
Tru
e : Reals\n",
" valveA :
0.0 : 1.0 : 10.0
: False :
Fals
e : Reals\n",
" valveB :
None : None : None
: False :
Tru
e : Reals\n",
" valveB :
0.0 : 1.0 : 10.0
: False :
Fals
e : Reals\n",
" valveC :
None : None : None
: False :
Tru
e : Reals\n"
" valveC :
0.0 : 1.0 : 10.0
: False :
Fals
e : Reals\n"
]
]
}
}
],
],
"source": [
"source": [
"from pyomo.opt import SolverFactory\n",
"from pyomo.opt import SolverFactory\n",
"\n",
"\n",
"opt = pyo.SolverFactory('scipampl', executable=r'C:\\Program Files\\SCIPOptSuite 9.2.0\\bin\\scip.exe')\n",
"TestData={\n",
" None:{\n",
" \n",
" 'nodes':[key for key in graph.nodes.keys()],\n",
" 'pumps':[key for key in graph.nodes.keys() if 'pump' in key],\n",
" 'valves':[key for key in graph.nodes.keys() if 'valve' in key],\n",
" 'Q_valve':{'valveA':1.,'valveB':1.,'valveC':1.},\n",
" \n",
" }\n",
"}\n",
"\n",
"opt = pyo.SolverFactory('scipampl', executable=r'C:\\Program Files\\SCIPOptSuite 9.2.1\\bin\\scip.exe')\n",
"instance = modell.create_instance(TestData)\n",
"instance = modell.create_instance(TestData)\n",
"instance.Continuity_constaint=pyo.Constraint(instance.nodes, rule=continuityRule)\n",
"instance.Flow_constraint=pyo.Constraint(instance.valves,rule=valve_req_rule)\n",
"instance.Flow_constraint=pyo.Constraint(instance.valves,rule=valve_req_rule)\n",
"instance.pump_Flow_constraint=pyo.Constraint(instance.pumps,rule=Pump_delivery_req)\n",
"instance.pump_Flow_constraint=pyo.Constraint(instance.pumps,rule=Pump_delivery_req)\n",
"#instance.flow_constraint=pyo.Constraint(instance.nodes,rule=continuity_inflow)\n",
"#instance.flow_constraint=pyo.Constraint(instance.nodes,rule=continuity_outflow)\n",
"result=opt.solve(instance, tee=True)\n",
"result=opt.solve(instance, tee=True)\n",
"print(result)\n",
"instance.n.pprint()\n",
"instance.n.pprint()\n",
"instance.Q.pprint()\n"
"instance.Q.pprint()\n"
]
]
...
@@ -383,7 +434,7 @@
...
@@ -383,7 +434,7 @@
"name": "python",
"name": "python",
"nbconvert_exporter": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"pygments_lexer": "ipython3",
"version": "3.12.
5
"
"version": "3.12.
8
"
}
}
},
},
"nbformat": 4,
"nbformat": 4,
...
...
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
Formulieren der Optimierungsgleichung in pymoo
Formulieren der Optimierungsgleichung in pymoo
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
Es gilt die Kontinuitätsgleichung:
Es gilt die Kontinuitätsgleichung:
$
\S
igma
\d
ot{V}_k(t) = O$
$
\S
igma
\d
ot{V}_k(t) = O$
und die aus der Topologie resultierende Inzidenzmatrix $A_i$
und die aus der Topologie resultierende Inzidenzmatrix $A_i$
sowie die aus dem Pumpenkennfeld folgende Beziehung:
sowie die aus dem Pumpenkennfeld folgende Beziehung:
$
\D
elta p=
\a
lpha_1 Q^2+
\a
lpha_2 Q n+
\a
lpha_3 n^2 : n
\i
n
\{
0
\}
\c
up [n_{
\m
athrm{min}},n_{
\m
athrm{max}}] $
$
\D
elta p=
\a
lpha_1 Q^2+
\a
lpha_2 Q n+
\a
lpha_3 n^2 : n
\i
n
\{
0
\}
\c
up [n_{
\m
athrm{min}},n_{
\m
athrm{max}}] $
$P=
\b
eta_1 Q^3+
\b
eta_2 Q^2 n+
\b
eta_3 Q n^2+
\b
eta_4n^3+
\b
eta_5$
$P=
\b
eta_1 Q^3+
\b
eta_2 Q^2 n+
\b
eta_3 Q n^2+
\b
eta_4n^3+
\b
eta_5$
und die beziehung für den Druckverlust an den Ventilen:
und die beziehung für den Druckverlust an den Ventilen:
$
\D
elta p_{
\m
athrm{loss}} = -
\f
rac{1}{2}
\v
arrho
\z
eta
\l
eft(
\f
rac{Q}{A}
\r
ight)^2 = -l Q^2 :l
\i
n [l_{
\m
athrm{min}}:
\i
nfty )$
$
\D
elta p_{
\m
athrm{loss}} = -
\f
rac{1}{2}
\v
arrho
\z
eta
\l
eft(
\f
rac{Q}{A}
\r
ight)^2 = -l Q^2 :l
\i
n [l_{
\m
athrm{min}}:
\i
nfty )$
nun soll für einen Gegebenen Volumenstrom $Q$ eine Optimale Drehzahl bestimmt werden, welche die Pumpenlesitung minimiert.
nun soll für einen Gegebenen Volumenstrom $Q$ eine Optimale Drehzahl bestimmt werden, welche die Pumpenlesitung minimiert.
$$
$$
\b
egin{align
*
}
\b
egin{align
*
}
\m
athrm{min}
\s
um_{p
\i
n
\m
athcal{P}} Po_{p}
\\
\m
athrm{min}
\s
um_{p
\i
n
\m
athcal{P}} Po_{p}
\\
Q_{p,i}
\g
eq
\s
um_{strang} Q_v +
\s
um_{strang} Q_p
\\
Q_{p,i}
\g
eq
\s
um_{strang} Q_v +
\s
um_{strang} Q_p
\\
Q_p , n
\e
psilon [n_{min},n_{max}]
\\
Q_p , n
\e
psilon [n_{min},n_{max}]
\\
\o
verrightarrow{n} = (1,n,n^2,n^3)^T
\\
\o
verrightarrow{n} = (1,n,n^2,n^3)^T
\\
min P = A
\o
verrightarrow{n}
\\
min P = A
\o
verrightarrow{n}
\\
-n
\l
eq n_{min}
\\
-n
\l
eq n_{min}
\\
n
\l
eq n_{max}
n
\l
eq n_{max}
\e
nd{align
*
}
\e
nd{align
*
}
$$
$$
Förderhöhe als constraint continuität fomulieren pro strang
Förderhöhe als constraint continuität fomulieren pro strang
%% Cell type:code id: tags:
%% Cell type:code id: tags:
```
python
```
python
!
pip
install
pyomo
!
pip
install
pyomo
```
```
%% Output
%% Output
Defaulting to user installation because normal site-packages is not writeable
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: pyomo in c:\users\steinmann\appdata\roaming\python\python312\site-packages (6.8.2)
Collecting pyomo
Requirement already satisfied: ply in c:\users\steinmann\appdata\roaming\python\python312\site-packages (from pyomo) (3.11)
Downloading Pyomo-6.8.2-py3-none-any.whl.metadata (8.0 kB)
Collecting ply (from pyomo)
Downloading ply-3.11-py2.py3-none-any.whl.metadata (844 bytes)
Downloading Pyomo-6.8.2-py3-none-any.whl (3.7 MB)
---------------------------------------- 0.0/3.7 MB ? eta -:--:--
---------------------------- ----------- 2.6/3.7 MB 12.6 MB/s eta 0:00:01
---------------------------------------- 3.7/3.7 MB 11.6 MB/s eta 0:00:00
Downloading ply-3.11-py2.py3-none-any.whl (49 kB)
Installing collected packages: ply, pyomo
Successfully installed ply-3.11 pyomo-6.8.2
[notice] A new release of pip is available: 24.
2
-> 25.0
[notice] A new release of pip is available: 24.
3.1
-> 25.0
[notice] To update, run: C:\
Program Files\Python312
\python.exe -m pip install --upgrade pip
[notice] To update, run: C:\
Users\Victor\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0
\python.exe -m pip install --upgrade pip
%% Cell type:code id: tags:
%% Cell type:code id: tags:
```
python
```
python
#Pump-Powercurve and Pump-Hightcurve
#Pump-Powercurve and Pump-Hightcurve
import
regression_own
import
regression_own
(
LR_H
,
LR_P
)
=
regression_own
.
regress_pump
()
(
LR_H
,
LR_P
)
=
regression_own
.
regress_pump
()
```
```
%% Output
%% Output
R^20.9998289611292903
R^20.9998289611292903
R^20.9994449560888792
R^20.9994449560888792
%% Cell type:code id: tags:
%% Cell type:code id: tags:
```
python
```
python
#Graph constroctor
#Graph constroctor
#Alle Ventile sind direkt mit der Quelle/Senke Verbunden
#Alle Ventile sind direkt mit der Quelle/Senke Verbunden
import
multiDiGraph
as
gr
import
multiDiGraph
as
gr
nodes
=
[
'
source
'
,
'
pump1
'
,
'
pump2
'
,
'
valveA
'
,
'
valveB
'
,
'
valveC
'
]
nodes
=
[
'
source
'
,
'
pump1
'
,
'
pump2
'
,
'
valveA
'
,
'
valveB
'
,
'
valveC
'
]
graph
=
gr
.
construct_graph
(
'
source
'
,(
'
source
'
,
'
pump1
'
,
0.
),(
'
pump1
'
,
'
pump2
'
,
0.
),(
'
pump2
'
,
'
valveA
'
,
0.
),(
'
pump2
'
,
'
valveB
'
,
0.
),
graph
=
gr
.
construct_graph
(
'
source
'
,(
'
source
'
,
'
pump1
'
,
0.
),(
'
pump1
'
,
'
pump2
'
,
0.
),(
'
pump2
'
,
'
valveA
'
,
0.
),(
'
pump2
'
,
'
valveB
'
,
0.
),
(
'
pump1
'
,
'
valveC
'
,
0.
),(
'
valveA
'
,
'
source
'
,
4.
),(
'
valveB
'
,
'
source
'
,
4.
),(
'
valveC
'
,
'
source
'
,
4.
))
(
'
pump1
'
,
'
valveC
'
,
0.
),(
'
valveA
'
,
'
source
'
,
4.
),(
'
valveB
'
,
'
source
'
,
4.
),(
'
valveC
'
,
'
source
'
,
4.
))
#ist das notwendig?!?
#ist das notwendig?!?
for
node
in
graph
.
nodes
:
for
node
in
graph
.
nodes
:
#definieren der Drehzahl für jede Pumpe im graphen
#definieren der Drehzahl für jede Pumpe im graphen
#inizieren des Durchflusses für jedes Ventil im Graphen
#inizieren des Durchflusses für jedes Ventil im Graphen
if
'
pump
'
in
node
:
if
'
pump
'
in
node
:
graph
.
nodes
[
node
][
'
n
'
]
=
750
/
3600
graph
.
nodes
[
node
][
'
n
'
]
=
750
/
3600
else
:
else
:
graph
.
nodes
[
node
][
'
n
'
]
=
None
graph
.
nodes
[
node
][
'
n
'
]
=
None
graph
.
nodes
[
node
][
'
flow
'
]
=
0.
graph
.
nodes
[
node
][
'
flow
'
]
=
0.
if
'
valve
'
in
node
:
if
'
valve
'
in
node
:
graph
.
nodes
[
node
][
'
flow
'
]
=
graph
[
node
][
'
source
'
][
0
][
'
weight
'
]
graph
.
nodes
[
node
][
'
flow
'
]
=
graph
[
node
][
'
source
'
][
0
][
'
weight
'
]
for
node
in
graph
.
nodes
:
for
node
in
graph
.
nodes
:
#Berechnen des Durchflusses im Knoten
#Berechnen des Durchflusses im Knoten
if
'
valve
'
in
node
:
if
'
valve
'
in
node
:
continue
continue
for
inF
in
graph
.
predecessors
(
node
):
for
inF
in
graph
.
predecessors
(
node
):
graph
.
nodes
[
node
][
'
flow
'
]
+=
graph
[
inF
][
node
][
0
][
'
weight
'
]
graph
.
nodes
[
node
][
'
flow
'
]
+=
graph
[
inF
][
node
][
0
][
'
weight
'
]
#Berechnen des Durchflusses der abgehenden Kanten
#Berechnen des Durchflusses der abgehenden Kanten
tempF
=
graph
.
nodes
[
node
][
'
flow
'
]
tempF
=
graph
.
nodes
[
node
][
'
flow
'
]
SC
=
0
SC
=
0
for
outF
in
graph
.
successors
(
node
):
for
outF
in
graph
.
successors
(
node
):
if
'
valve
'
in
outF
:
if
'
valve
'
in
outF
:
graph
[
node
][
outF
][
0
][
'
weight
'
]
=
graph
.
nodes
[
outF
][
'
flow
'
]
graph
[
node
][
outF
][
0
][
'
weight
'
]
=
graph
.
nodes
[
outF
][
'
flow
'
]
tempF
=
tempF
-
graph
.
nodes
[
outF
][
'
flow
'
]
tempF
=
tempF
-
graph
.
nodes
[
outF
][
'
flow
'
]
else
:
else
:
SC
+=
1
SC
+=
1
for
outF
in
graph
.
successors
(
node
):
for
outF
in
graph
.
successors
(
node
):
if
SC
!=
0.
and
not
'
valve
'
in
outF
:
if
SC
!=
0.
and
not
'
valve
'
in
outF
:
graph
[
node
][
outF
][
0
][
'
weight
'
]
=
tempF
/
SC
graph
[
node
][
outF
][
0
][
'
weight
'
]
=
tempF
/
SC
else
:
continue
else
:
continue
```
```
%% Output
%% Output
%% Cell type:code id: tags:
%% Cell type:code id: tags:
```
python
```
python
import
networkx
as
nx
import
networkx
as
nx
Mtrx
=
nx
.
incidence_matrix
(
graph
,
nodes
,
oriented
=
True
)
Mtrx
=
nx
.
incidence_matrix
(
graph
,
nodes
,
oriented
=
True
)
```
```
%% Cell type:code id: tags:
%% Cell type:code id: tags:
```
python
```
python
import
networkx
as
nx
import
networkx
as
nx
def
create_dict
(
GR
:
nx
.
multidigraph
):
def
create_dict
(
GR
:
nx
.
multidigraph
):
data
=
{
None
:{
'
nodes
'
:{},
data
=
{
None
:{
'
nodes
'
:{},
'
pumps
'
:{},
'
pumps
'
:{},
'
valves
'
:{},
'
valves
'
:{},
}
}
}
}
for
node
in
GR
.
nodes
:
for
node
in
GR
.
nodes
:
data
[
None
][
'
nodes
'
][
node
]
=
None
data
[
None
][
'
nodes
'
][
node
]
=
None
data
[
None
][
'
Q
'
][
node
]
=
GR
.
nodes
[
node
][
'
flow
'
]
data
[
None
][
'
Q
'
][
node
]
=
GR
.
nodes
[
node
][
'
flow
'
]
if
'
pump
'
in
node
:
if
'
pump
'
in
node
:
data
[
None
][
'
pumps
'
][
node
]
=
None
data
[
None
][
'
pumps
'
][
node
]
=
None
data
[
None
][
'
n
'
][
node
]
=
0.
data
[
None
][
'
n
'
][
node
]
=
0.
if
'
valve
'
in
node
:
if
'
valve
'
in
node
:
data
[
None
][
'
valves
'
][
node
]
=
None
data
[
None
][
'
valves
'
][
node
]
=
None
return
data
return
data
```
```
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
Durchfluss aus Incidenzmatrix beerechnen
Durchfluss aus Incidenzmatrix beerechnen
$-l Q^2 =
\a
lpha_1 Q^2+
\a
lpha_2 Q n+
\a
lpha_3 n^2$
$-l Q^2 =
\a
lpha_1 Q^2+
\a
lpha_2 Q n+
\a
lpha_3 n^2$
%% Cell type:code id: tags:
%% Cell type:code id: tags:
```
python
```
python
#defining abstract modell for given Network
#defining abstract modell for given Network
import
pyomo.environ
as
pyo
import
pyomo.environ
as
pyo
from
pyomo.dataportal
import
DataPortal
from
pyomo.dataportal
import
DataPortal
import
numpy
as
np
import
numpy
as
np
from
sklearn.linear_model
import
LinearRegression
from
sklearn.linear_model
import
LinearRegression
modell
=
pyo
.
AbstractModel
()
modell
=
pyo
.
AbstractModel
()
#notwendige Mengen zur Berechnung der Constraints
#notwendige Mengen zur Berechnung der Constraints
modell
.
nodes
=
pyo
.
Set
()
modell
.
nodes
=
pyo
.
Set
()
modell
.
pumps
=
pyo
.
Set
()
modell
.
pumps
=
pyo
.
Set
()
modell
.
valves
=
pyo
.
Set
()
modell
.
valves
=
pyo
.
Set
()
modell
.
Q_valve
=
pyo
.
Param
(
modell
.
valves
)
modell
.
Q_valve
=
pyo
.
Param
(
modell
.
valves
)
#Optimierungsvariable
#Optimierungsvariable
modell
.
n
=
pyo
.
Var
(
modell
.
pumps
,
bounds
=
(
750
/
3600
,
1
))
modell
.
n
=
pyo
.
Var
(
modell
.
pumps
,
bounds
=
(
750
/
3600
,
1
))
modell
.
Q
=
pyo
.
Var
(
modell
.
nodes
)
modell
.
Q
=
pyo
.
Var
(
modell
.
nodes
,
bounds
=
(
0.
,
10.
)
)
#expressions for constraints:
#expressions for constraints:
def
PumpFlow
(
modell
,
pump
):
def
PumpFlow
(
modell
,
pump
):
return
np
.
dot
(
np
.
array
([
modell
.
Q
[
pump
]
**
2
,
modell
.
n
[
pump
]
*
modell
.
Q
[
pump
],
modell
.
n
[
pump
]
**
2
]),
LR_H
.
coef_
)
return
pyo
.
summation
(
np
.
array
([
modell
.
Q
[
pump
]
**
2
,
modell
.
n
[
pump
]
*
modell
.
Q
[
pump
],
modell
.
n
[
pump
]
**
2
]),
LR_H
.
coef_
,
index
=
[
0
,
1
,
2
]
)
def
Pump_delivery_req
(
modell
,
pump
):
def
Pump_delivery_req
(
modell
,
pump
):
return
PumpFlow
(
modell
,
pump
)
==
pyo
.
summation
(
modell
.
Q
,
index
=
graph
.
successors
(
pump
))
return
PumpFlow
(
modell
,
pump
)
==
pyo
.
summation
(
modell
.
Q
,
index
=
graph
.
successors
(
pump
))
def
valve_req_rule
(
modell
,
valve
):
def
valve_req_rule
(
modell
,
valve
):
return
modell
.
Q
[
valve
]
>=
modell
.
Q_valve
[
valve
]
return
modell
.
Q
[
valve
]
>=
modell
.
Q_valve
[
valve
]
#modell.Flow_Objective = pyo.Objective(modell.pumps,rule=Flow_req,sense=pyo.minimize)
def
continuity_inflow
(
modell
,
node
):
return
modell
.
Q
[
node
]
==
pyo
.
summation
(
modell
.
Q
,
index
=
graph
.
successors
(
node
))
#Constaints
def
continuity_outflow
(
modell
,
node
):
def
continuityRule
(
modell
,
node
):
return
modell
.
Q
[
node
]
==
pyo
.
summation
(
modell
.
Q
,
index
=
graph
.
predecessors
(
node
))
return
pyo
.
summation
(
modell
.
Q
,
index
=
graph
.
predecessors
(
node
))
==
pyo
.
summation
(
modell
.
Q
,
index
=
graph
.
successors
(
node
))
#Objective
#Objective
def
PumpPower
(
modell
):
def
PumpPower
(
modell
):
return
sum
(
np
.
dot
(
return
sum
(
np
.
dot
(
np
.
array
(
np
.
array
(
[
modell
.
Q
[
i
]
**
3
,(
modell
.
Q
[
i
]
**
2
)
*
modell
.
n
[
i
],
modell
.
Q
[
i
]
*
modell
.
n
[
i
]
**
2
,
modell
.
n
[
i
]
**
3
]
[
modell
.
Q
[
i
]
**
3
,(
modell
.
Q
[
i
]
**
2
)
*
modell
.
n
[
i
],
modell
.
Q
[
i
]
*
modell
.
n
[
i
]
**
2
,
modell
.
n
[
i
]
**
3
]
),
LR_P
.
coef_
),
LR_P
.
coef_
)
for
i
in
modell
.
pumps
)
)
for
i
in
modell
.
pumps
)
modell
.
Power_Objective
=
pyo
.
Objective
(
rule
=
PumpPower
,
sense
=
pyo
.
minimize
)
modell
.
Power_Objective
=
pyo
.
Objective
(
rule
=
PumpPower
,
sense
=
pyo
.
minimize
)
TestData
=
{
None
:{
'
nodes
'
:[
key
for
key
in
graph
.
nodes
.
keys
()],
'
pumps
'
:[
key
for
key
in
graph
.
nodes
.
keys
()
if
'
pump
'
in
key
],
'
valves
'
:[
key
for
key
in
graph
.
nodes
.
keys
()
if
'
valve
'
in
key
],
'
Q_valve
'
:{
'
valveA
'
:
1.
,
'
valveB
'
:
1.
,
'
valveC
'
:
2.
},
}
}
print
(
TestData
)
```
```
%% Output
{None: {'nodes': ['source', 'pump1', 'pump2', 'valveA', 'valveB', 'valveC'], 'pumps': ['pump1', 'pump2'], 'valves': ['valveA', 'valveB', 'valveC'], 'Q_valve': {'valveA': 1.0, 'valveB': 1.0, 'valveC': 2.0}}}
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
Frage: gibt es nur eine Lösung für Drehzahl?
Frage: gibt es nur eine Lösung für Drehzahl?
Bsp. Optimierung nach Dezentraler Pumpe um modell zu prüfen
Bsp. Optimierung nach Dezentraler Pumpe um modell zu prüfen
%% Cell type:code id: tags:
%% Cell type:code id: tags:
```
python
```
python
from
pyomo.opt
import
SolverFactory
from
pyomo.opt
import
SolverFactory
opt
=
pyo
.
SolverFactory
(
'
scipampl
'
,
executable
=
r
'
C:\Program Files\SCIPOptSuite 9.2.0\bin\scip.exe
'
)
TestData
=
{
None
:{
'
nodes
'
:[
key
for
key
in
graph
.
nodes
.
keys
()],
'
pumps
'
:[
key
for
key
in
graph
.
nodes
.
keys
()
if
'
pump
'
in
key
],
'
valves
'
:[
key
for
key
in
graph
.
nodes
.
keys
()
if
'
valve
'
in
key
],
'
Q_valve
'
:{
'
valveA
'
:
1.
,
'
valveB
'
:
1.
,
'
valveC
'
:
1.
},
}
}
opt
=
pyo
.
SolverFactory
(
'
scipampl
'
,
executable
=
r
'
C:\Program Files\SCIPOptSuite 9.2.1\bin\scip.exe
'
)
instance
=
modell
.
create_instance
(
TestData
)
instance
=
modell
.
create_instance
(
TestData
)
instance
.
Continuity_constaint
=
pyo
.
Constraint
(
instance
.
nodes
,
rule
=
continuityRule
)
instance
.
Flow_constraint
=
pyo
.
Constraint
(
instance
.
valves
,
rule
=
valve_req_rule
)
instance
.
Flow_constraint
=
pyo
.
Constraint
(
instance
.
valves
,
rule
=
valve_req_rule
)
instance
.
pump_Flow_constraint
=
pyo
.
Constraint
(
instance
.
pumps
,
rule
=
Pump_delivery_req
)
instance
.
pump_Flow_constraint
=
pyo
.
Constraint
(
instance
.
pumps
,
rule
=
Pump_delivery_req
)
#instance.flow_constraint=pyo.Constraint(instance.nodes,rule=continuity_inflow)
#instance.flow_constraint=pyo.Constraint(instance.nodes,rule=continuity_outflow)
result
=
opt
.
solve
(
instance
,
tee
=
True
)
result
=
opt
.
solve
(
instance
,
tee
=
True
)
print
(
result
)
instance
.
n
.
pprint
()
instance
.
n
.
pprint
()
instance
.
Q
.
pprint
()
instance
.
Q
.
pprint
()
```
```
%% Output
%% Output
SCIP version 9.2.
0
[precision: 8 byte] [memory: block] [mode: optimized] [LP solver: Soplex 7.1.
2
] [GitHash:
74cea9222e
]
SCIP version 9.2.
1
[precision: 8 byte] [memory: block] [mode: optimized] [LP solver: Soplex 7.1.
3
] [GitHash:
0d2d3c7c2d
]
Copyright (c) 2002-202
4
Zuse Institute Berlin (ZIB)
Copyright (c) 2002-202
5
Zuse Institute Berlin (ZIB)
External libraries:
External libraries:
Soplex 7.1.
2
Linear Programming Solver developed at Zuse Institute Berlin (soplex.zib.de) [GitHash:
b040369c
]
Soplex 7.1.
3
Linear Programming Solver developed at Zuse Institute Berlin (soplex.zib.de) [GitHash:
60fd96f2
]
CppAD 20180000.0 Algorithmic Differentiation of C++ algorithms developed by B. Bell (github.com/coin-or/CppAD)
CppAD 20180000.0 Algorithmic Differentiation of C++ algorithms developed by B. Bell (github.com/coin-or/CppAD)
TinyCThread 1.2 small portable implementation of the C11 threads API (tinycthread.github.io)
TinyCThread 1.2 small portable implementation of the C11 threads API (tinycthread.github.io)
MPIR 3.0.0 Multiple Precision Integers and Rationals Library developed by W. Hart (mpir.org)
MPIR 3.0.0 Multiple Precision Integers and Rationals Library developed by W. Hart (mpir.org)
ZIMPL 3.6.2 Zuse Institute Mathematical Programming Language developed by T. Koch (zimpl.zib.de)
ZIMPL 3.6.2 Zuse Institute Mathematical Programming Language developed by T. Koch (zimpl.zib.de)
AMPL/MP 690e9e7 AMPL .nl file reader library (github.com/ampl/mp)
AMPL/MP 690e9e7 AMPL .nl file reader library (github.com/ampl/mp)
PaPILO 2.4.
0
parallel presolve for integer and linear optimization (github.com/scipopt/papilo) (built with TBB) [GitHash:
2d9fe29f
]
PaPILO 2.4.
1
parallel presolve for integer and linear optimization (github.com/scipopt/papilo) (built with TBB) [GitHash:
11974394
]
Nauty 2.8.8 Computing Graph Automorphism Groups by Brendan D. McKay (users.cecs.anu.edu.au/~bdm/nauty)
Nauty 2.8.8 Computing Graph Automorphism Groups by Brendan D. McKay (users.cecs.anu.edu.au/~bdm/nauty)
sassy 1.1 Symmetry preprocessor by Markus Anders (github.com/markusa4/sassy)
sassy 1.1 Symmetry preprocessor by Markus Anders (github.com/markusa4/sassy)
Ipopt 3.14.16 Interior Point Optimizer developed by A. Waechter et.al. (github.com/coin-or/Ipopt)
Ipopt 3.14.16 Interior Point Optimizer developed by A. Waechter et.al. (github.com/coin-or/Ipopt)
user parameter file <scip.set> not found - using default parameters
user parameter file <scip.set> not found - using default parameters
read problem <C:\Users\
STEINM~1
\AppData\Local\Temp\tmp
rv0ikbwh
.pyomo.nl>
read problem <C:\Users\
Victor
\AppData\Local\Temp\tmp
fcunk5gi
.pyomo.nl>
============
============
original problem has
9
variables (0 bin, 0 int, 0 impl,
9
cont) and
12
constraints
original problem has
8
variables (0 bin, 0 int, 0 impl,
8
cont) and
6
constraints
solve problem
solve problem
=============
=============
presolving:
presolving:
(round 1, fast) 2 del vars, 6 del conss, 0 add conss, 12 chg bounds, 0 chg sides, 0 chg coeffs, 0 upgd conss, 0 impls, 0 clqs
(round 1, fast) 0 del vars, 3 del conss, 0 add conss, 11 chg bounds, 0 chg sides, 0 chg coeffs, 0 upgd conss, 0 impls, 0 clqs
presolving (2 rounds: 2 fast, 0 medium, 0 exhaustive):
(0.0s) symmetry computation started: requiring (bin +, int +, cont +), (fixed: bin -, int -, cont -)
2 deleted vars, 6 deleted constraints, 0 added constraints, 16 tightened bounds, 0 added holes, 0 changed sides, 0 changed coefficients
(0.0s) symmetry computation finished: 1 generators found (max: 1500, log10 of symmetry group size: 0.0) (symcode time: 0.00)
dynamic symmetry handling statistics:
orbitopal reduction: no components
orbital reduction: no components
lexicographic reduction: no permutations
handled 1 out of 1 symmetry components
(round 2, exhaustive) 0 del vars, 3 del conss, 1 add conss, 11 chg bounds, 0 chg sides, 0 chg coeffs, 0 upgd conss, 0 impls, 0 clqs
presolving (3 rounds: 3 fast, 2 medium, 2 exhaustive):
0 deleted vars, 3 deleted constraints, 0 added constraints, 11 tightened bounds, 0 added holes, 0 changed sides, 0 changed coefficients
0 implications, 0 cliques
0 implications, 0 cliques
presolving detected infeasibility
presolved problem has 8 variables (0 bin, 0 int, 0 impl, 8 cont) and 4 constraints
1 constraints of type <linear>
3 constraints of type <nonlinear>
Presolving Time: 0.00
Presolving Time: 0.00
SCIP Status : problem is solved [infeasible]
time | node | left |LP iter|LP it/n|mem/heur|mdpt |vars |cons |rows |cuts |sepa|confs|strbr| dualbound | primalbound | gap | compl.
0.0s| 1 | 0 | 22 | - | 914k | 0 | 25 | 4 | 36 | 0 | 0 | 0 | 0 |-3.474607e+01 | -- | Inf | unknown
L 0.0s| 1 | 0 | 22 | - | subnlp| 0 | 25 | 4 | 36 | 0 | 0 | 0 | 0 |-3.474607e+01 | 1.151406e+01 | Inf | unknown
0.0s| 1 | 0 | 22 | - | 914k | 0 | 25 | 4 | 36 | 0 | 0 | 0 | 0 |-3.474607e+01 | 1.151406e+01 | Inf | unknown
0.0s| 1 | 0 | 22 | - | 914k | 0 | 25 | 4 | 36 | 0 | 0 | 0 | 0 |-3.474607e+01 | 1.151406e+01 | Inf | unknown
0.0s| 1 | 0 | 26 | - | 920k | 0 | 25 | 4 | 39 | 3 | 1 | 0 | 0 |-1.963132e+01 | 1.151406e+01 | Inf | unknown
0.0s| 1 | 0 | 26 | - | 920k | 0 | 25 | 4 | 39 | 3 | 1 | 0 | 0 |-1.963132e+01 | 1.151406e+01 | Inf | unknown
0.0s| 1 | 0 | 30 | - | 935k | 0 | 25 | 4 | 42 | 6 | 2 | 0 | 0 |-1.885311e+01 | 1.151406e+01 | Inf | unknown
0.0s| 1 | 0 | 33 | - | 939k | 0 | 25 | 4 | 45 | 9 | 3 | 0 | 0 |-1.766937e+01 | 1.151406e+01 | Inf | unknown
0.0s| 1 | 0 | 33 | - | 939k | 0 | 25 | 4 | 45 | 9 | 3 | 0 | 0 |-1.766937e+01 | 1.151406e+01 | Inf | unknown
0.0s| 1 | 0 | 36 | - | 939k | 0 | 25 | 4 | 47 | 11 | 4 | 0 | 0 |-1.728948e+01 | 1.151406e+01 | Inf | unknown
0.0s| 1 | 0 | 37 | - | 941k | 0 | 25 | 4 | 48 | 12 | 5 | 0 | 0 |-1.712829e+01 | 1.151406e+01 | Inf | unknown
0.0s| 1 | 0 | 38 | - | 941k | 0 | 25 | 4 | 49 | 13 | 6 | 0 | 0 |-1.701866e+01 | 1.151406e+01 | Inf | unknown
0.0s| 1 | 0 | 39 | - | 943k | 0 | 25 | 4 | 50 | 14 | 7 | 0 | 0 |-1.701746e+01 | 1.151406e+01 | Inf | unknown
0.0s| 1 | 0 | 41 | - | 951k | 0 | 25 | 4 | 52 | 16 | 8 | 0 | 0 |-1.695801e+01 | 1.151406e+01 | Inf | unknown
0.0s| 1 | 0 | 332 | - | 957k | 0 | 25 | 4 | 52 | 16 | 9 | 0 | 0 | 1.150982e+01 | 1.151406e+01 | 0.04%| unknown
time | node | left |LP iter|LP it/n|mem/heur|mdpt |vars |cons |rows |cuts |sepa|confs|strbr| dualbound | primalbound | gap | compl.
0.0s| 1 | 0 | 334 | - | 957k | 0 | 25 | 4 | 54 | 18 | 10 | 0 | 0 | 1.150982e+01 | 1.151406e+01 | 0.04%| unknown
0.0s| 1 | 0 | 346 | - | 957k | 0 | 25 | 4 | 37 | 20 | 11 | 0 | 0 | 1.151405e+01 | 1.151406e+01 | 0.00%| unknown
0.0s| 1 | 0 | 346 | - | 957k | 0 | 25 | 4 | 20 | 20 | 11 | 0 | 0 | 1.151405e+01 | 1.151406e+01 | 0.00%| unknown
0.0s| 1 | 0 | 347 | - | 957k | 0 | 25 | 4 | 21 | 21 | 12 | 0 | 0 | 1.151406e+01 | 1.151406e+01 | 0.00%| unknown
L 0.0s| 1 | 0 | 347 | - | subnlp| 0 | 25 | 4 | 21 | 21 | 13 | 0 | 0 | 1.151406e+01 | 1.151406e+01 | 0.00%| unknown
0.0s| 1 | 0 | 347 | - | 958k | 0 | 25 | 4 | 21 | 21 | 13 | 0 | 0 | 1.151406e+01 | 1.151406e+01 | 0.00%| unknown
* 0.0s| 1 | 0 | 347 | - | LP | 0 | 25 | 4 | 21 | 21 | 14 | 0 | 0 | 1.151406e+01 | 1.151406e+01 | 0.00%| unknown
SCIP Status : problem is solved [optimal solution found]
Solving Time (sec) : 0.00
Solving Time (sec) : 0.00
Solving Nodes :
0
Solving Nodes :
1
Primal Bound : +1.
00000000000000e+20
(
0
solutions)
Primal Bound : +1.
15140564709997e+01
(
3
solutions)
Dual Bound : +1.
00000000000000e+20
Dual Bound : +1.
15140564709997e+01
Gap : 0.00 %
Gap : 0.00 %
WARNING: Loading a SolverResults object with a warning status into
model.name="unknown";
Problem:
- termination condition: infeasible
- Lower bound: -inf
- message from solver: infeasible
Upper bound: inf
Number of objectives: 1
Number of constraints: 0
Number of variables: 7
Sense: unknown
Solver:
- Status: ok
Message: optimal solution found
Termination condition: optimal
Id: 0
Error rc: 0
Time: 0.3383963108062744
Solution:
- number of solutions: 0
number of solutions displayed: 0
n : Size=2, Index=pumps
n : Size=2, Index=pumps
Key : Lower : Value : Upper : Fixed : Stale : Domain
Key : Lower : Value
: Upper : Fixed : Stale : Domain
pump1 : 0.20833333333333334 :
None
: 1 : False :
Tru
e : Reals
pump1 : 0.20833333333333334 :
0.34519801810114614
: 1 : False :
Fals
e : Reals
pump2 : 0.20833333333333334 :
None
: 1 : False :
Tru
e : Reals
pump2 : 0.20833333333333334 :
0.4881837415314729
: 1 : False :
Fals
e : Reals
Q : Size=6, Index=nodes
Q : Size=6, Index=nodes
Key : Lower : Value : Upper : Fixed : Stale : Domain
Key : Lower : Value : Upper : Fixed : Stale : Domain
pump1 :
None : None : None
: False :
Tru
e : Reals
pump1 :
0.0 : 0.0 : 10.0
: False :
Fals
e : Reals
pump2 :
None : None : None
: False :
Tru
e : Reals
pump2 :
0.0 : 0.0 : 10.0
: False :
Fals
e : Reals
source :
None
: None :
None
: False : True : Reals
source :
0.0
: None :
10.0
: False : True : Reals
valveA :
None : None : None
: False :
Tru
e : Reals
valveA :
0.0 : 1.0 : 10.0
: False :
Fals
e : Reals
valveB :
None : None : None
: False :
Tru
e : Reals
valveB :
0.0 : 1.0 : 10.0
: False :
Fals
e : Reals
valveC :
None : None : None
: False :
Tru
e : Reals
valveC :
0.0 : 1.0 : 10.0
: False :
Fals
e : Reals
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment