Если действительные, то
(моделька)
Код:
var x;
var y;
var z;
var u;
s.t. st1 : x+y+z+u <= 2;
s.t. st2 : y*z <= 0;
minimize F : (x-1/2)^2 + (y-3/10)^2 + (z-7/10)^2 + (u-2/5)^2;
#option solver cplex;
#option cplex_options 'timing=1 threads=3 display=1 mipdisplay=4 mipinterval=10000';
#option solver gurobi;
#option gurobi_options 'logfreq=10 outlev=1 timing=1 threads=3';
option solver scip;
solve;
printf ("\nF = " & F & "\n");
printf ("{x,y,z,u} = {" & x & "," & y & "," & z & "," & u & "}");
printf ("\n");
и
(сиплех и гуроби не будут решать)
Код:
CPLEX 12.8.0.0: QP Hessian is not positive semi-definite.
Gurobi 8.1.0: quadratic objective or constraint is not positive definite
но
(сцип решает)
Код:
SCIP version 6.0.0 [precision: 8 byte] [memory: block] [mode: optimized] [LP solver: SoP
lex 4.0.0] [GitHash: 77d3bc8]
Copyright (C) 2002-2018 Konrad-Zuse-Zentrum fuer Informationstechnik Berlin (ZIB)
External codes:
SoPlex 4.0.0 Linear Programming Solver developed at Zuse Institute Berlin (sop
lex.zib.de) [GitHash: 82cab95]
CppAD 20180000.0 Algorithmic Differentiation of C++ algorithms developed by B. Bel
l (www.coin-or.org/CppAD)
Ipopt 3.12.12 Interior Point Optimizer developed by A. Waechter et.al. (www.coi
n-or.org/Ipopt)
ASL AMPL Solver Library developed by D. Gay (www.netlib.com/ampl)
number of parameters = 2428
non-default parameter settings:
display/headerfreq = 32
lp/threads = 3
read problem <C:\Users\User\AppData\Local\Temp\at3728.nl>
============
original problem has 5 variables (0 bin, 0 int, 0 impl, 5 cont) and 3 constraints
feasible solution found by trysol heuristic after 0.0 seconds, objective value 9.900000e
-01
presolving:
(round 1, fast) 0 del vars, 0 del conss, 1 add conss, 1 chg bounds, 0 chg sides, 0
chg coeffs, 1 upgd conss, 0 impls, 0 clqs
(round 2, fast) 0 del vars, 0 del conss, 1 add conss, 10 chg bounds, 0 chg sides,
0 chg coeffs, 1 upgd conss, 0 impls, 0 clqs
presolving (3 rounds: 3 fast, 1 medium, 1 exhaustive):
0 deleted vars, 0 deleted constraints, 1 added constraints, 10 tightened bounds, 0 adde
d holes, 0 changed sides, 0 changed coefficients
0 implications, 0 cliques
presolved problem has 5 variables (0 bin, 0 int, 0 impl, 5 cont) and 4 constraints
1 constraints of type <linear>
2 constraints of type <bounddisjunction>
1 constraints of type <quadratic>
Presolving Time: 0.00
transformed 1/2 original solutions to the transformed problem space
time | node | left |LP iter|LP it/n| mem |mdpt |frac |vars |cons |cols |rows |cuts |c
onfs|strbr| dualbound | primalbound | gap
0.0s| 1 | 0 | 2 | - | 581k| 0 | 0 | 5 | 4 | 5 | 5 | 0 |
0 | 0 |-1.000000e-09 | 9.900000e-01 | Inf
******************************************************************************
This program contains Ipopt, a library for large-scale nonlinear optimization.
Ipopt is released as open source code under the Eclipse Public License (EPL).
For more information visit http://projects.coin-or.org/Ipopt
******************************************************************************
0.0s| 1 | 0 | 3 | - | 585k| 0 | 0 | 5 | 4 | 5 | 6 | 1 |
0 | 0 |-1.000000e-09 | 9.900000e-01 | Inf
0.0s| 1 | 0 | 4 | - | 585k| 0 | 0 | 5 | 4 | 5 | 7 | 2 |
0 | 0 |-1.000000e-09 | 9.900000e-01 | Inf
0.0s| 1 | 0 | 5 | - | 585k| 0 | 0 | 5 | 4 | 5 | 8 | 3 |
0 | 0 |-1.000000e-09 | 9.900000e-01 | Inf
0.0s| 1 | 0 | 6 | - | 585k| 0 | 0 | 5 | 4 | 5 | 9 | 4 |
0 | 0 |-1.000000e-09 | 9.900000e-01 | Inf
0.0s| 1 | 0 | 7 | - | 589k| 0 | 0 | 5 | 4 | 5 | 10 | 5 |
0 | 0 |-1.000000e-09 | 9.900000e-01 | Inf
0.0s| 1 | 0 | 8 | - | 589k| 0 | 0 | 5 | 4 | 5 | 11 | 6 |
0 | 0 |-1.000000e-09 | 9.900000e-01 | Inf
0.0s| 1 | 0 | 9 | - | 589k| 0 | 0 | 5 | 4 | 5 | 12 | 7 |
0 | 0 |-1.000000e-09 | 9.900000e-01 | Inf
0.0s| 1 | 0 | 10 | - | 589k| 0 | 0 | 5 | 4 | 5 | 13 | 8 |
0 | 0 |-1.000000e-09 | 9.900000e-01 | Inf
0.0s| 1 | 0 | 11 | - | 591k| 0 | 0 | 5 | 4 | 5 | 14 | 9 |
0 | 0 |-1.000000e-09 | 9.900000e-01 | Inf
0.0s| 1 | 0 | 12 | - | 591k| 0 | 0 | 5 | 4 | 5 | 15 | 10 |
0 | 0 |-1.000000e-09 | 9.900000e-01 | Inf
0.0s| 1 | 0 | 13 | - | 591k| 0 | 0 | 5 | 4 | 5 | 12 | 11 |
0 | 0 |-1.000000e-09 | 9.900000e-01 | Inf
L 0.1s| 1 | 0 | 38 | - | 591k| 0 | 0 | 5 | 4 | 5 | 12 | 11 |
0 | 0 |-1.000000e-09 | 9.801000e-01 | Inf
0.1s| 1 | 0 | 38 | - | 634k| 0 | 0 | 5 | 4 | 5 | 12 | 11 |
0 | 0 |-1.000000e-09 | 9.801000e-01 | Inf
0.1s| 1 | 0 | 41 | - | 634k| 0 | 0 | 5 | 4 | 5 | 13 | 12 |
0 | 0 |-1.000000e-09 | 9.801000e-01 | Inf
0.1s| 1 | 0 | 44 | - | 634k| 0 | 0 | 5 | 4 | 5 | 14 | 13 |
0 | 0 |-1.000000e-09 | 9.801000e-01 | Inf
0.1s| 1 | 0 | 45 | - | 634k| 0 | 0 | 5 | 4 | 5 | 15 | 14 |
0 | 0 |-1.000000e-09 | 9.801000e-01 | Inf
0.1s| 1 | 0 | 46 | - | 634k| 0 | 0 | 5 | 4 | 5 | 11 | 15 |
0 | 0 |-1.000000e-09 | 9.801000e-01 | Inf
0.1s| 1 | 0 | 47 | - | 634k| 0 | 0 | 5 | 4 | 5 | 12 | 16 |
0 | 0 |-1.000000e-09 | 9.801000e-01 | Inf
0.1s| 1 | 0 | 48 | - | 634k| 0 | 0 | 5 | 4 | 5 | 13 | 17 |
0 | 0 |-1.000000e-09 | 9.801000e-01 | Inf
0.1s| 1 | 0 | 49 | - | 634k| 0 | 0 | 5 | 4 | 5 | 14 | 18 |
0 | 0 |-1.000000e-09 | 9.801000e-01 | Inf
0.1s| 1 | 0 | 50 | - | 634k| 0 | 0 | 5 | 4 | 5 | 15 | 19 |
0 | 0 |-1.000000e-09 | 9.801000e-01 | Inf
0.1s| 1 | 0 | 51 | - | 634k| 0 | 0 | 5 | 4 | 5 | 16 | 20 |
0 | 0 |-1.000000e-09 | 9.801000e-01 | Inf
0.1s| 1 | 0 | 52 | - | 634k| 0 | 0 | 5 | 4 | 5 | 11 | 21 |
0 | 0 |-1.000000e-09 | 9.801000e-01 | Inf
0.1s| 1 | 0 | 53 | - | 634k| 0 | 0 | 5 | 4 | 5 | 12 | 22 |
0 | 0 |-1.000000e-09 | 9.801000e-01 | Inf
0.1s| 1 | 0 | 54 | - | 634k| 0 | 0 | 5 | 4 | 5 | 13 | 23 |
0 | 0 |-1.000000e-09 | 9.801000e-01 | Inf
0.1s| 1 | 0 | 55 | - | 634k| 0 | 0 | 5 | 4 | 5 | 14 | 24 |
0 | 0 |-1.000000e-09 | 9.801000e-01 | Inf
0.1s| 1 | 0 | 56 | - | 634k| 0 | 0 | 5 | 4 | 5 | 15 | 25 |
0 | 0 |-1.000000e-09 | 9.801000e-01 | Inf
0.1s| 1 | 0 | 57 | - | 634k| 0 | 0 | 5 | 4 | 5 | 16 | 26 |
0 | 0 |-1.000000e-09 | 9.801000e-01 | Inf
0.1s| 1 | 0 | 58 | - | 634k| 0 | 0 | 5 | 4 | 5 | 14 | 27 |
0 | 0 |-1.000000e-09 | 9.801000e-01 | Inf
0.1s| 1 | 0 | 59 | - | 634k| 0 | 0 | 5 | 4 | 5 | 15 | 28 |
0 | 0 |-1.000000e-09 | 9.801000e-01 | Inf
0.1s| 1 | 0 | 60 | - | 634k| 0 | 0 | 5 | 4 | 5 | 16 | 29 |
0 | 0 |-1.000000e-09 | 9.801000e-01 | Inf
time | node | left |LP iter|LP it/n| mem |mdpt |frac |vars |cons |cols |rows |cuts |c
onfs|strbr| dualbound | primalbound | gap
0.1s| 1 | 0 | 61 | - | 634k| 0 | 0 | 5 | 4 | 5 | 17 | 30 |
0 | 0 |-1.000000e-09 | 9.801000e-01 | Inf
0.1s| 1 | 0 | 62 | - | 634k| 0 | 0 | 5 | 4 | 5 | 18 | 31 |
0 | 0 |-1.000000e-09 | 9.801000e-01 | Inf
0.1s| 1 | 0 | 63 | - | 634k| 0 | 0 | 5 | 4 | 5 | 19 | 32 |
0 | 0 |-1.000000e-09 | 9.801000e-01 | Inf
0.1s| 1 | 0 | 64 | - | 635k| 0 | 0 | 5 | 4 | 5 | 17 | 33 |
0 | 0 |-1.000000e-09 | 9.801000e-01 | Inf
0.1s| 1 | 0 | 65 | - | 635k| 0 | 0 | 5 | 4 | 5 | 18 | 34 |
0 | 0 |-1.000000e-09 | 9.801000e-01 | Inf
0.1s| 1 | 0 | 66 | - | 635k| 0 | 0 | 5 | 4 | 5 | 19 | 35 |
0 | 0 |-1.000000e-09 | 9.801000e-01 | Inf
0.1s| 1 | 0 | 67 | - | 635k| 0 | 0 | 5 | 4 | 5 | 20 | 36 |
0 | 0 |-1.000000e-09 | 9.801000e-01 | Inf
0.1s| 1 | 0 | 68 | - | 646k| 0 | 0 | 5 | 4 | 5 | 21 | 37 |
0 | 0 |-1.000000e-09 | 9.801000e-01 | Inf
0.1s| 1 | 0 | 69 | - | 650k| 0 | 0 | 5 | 4 | 5 | 22 | 38 |
0 | 0 |-1.000000e-09 | 9.801000e-01 | Inf
0.1s| 1 | 0 | 70 | - | 650k| 0 | 0 | 5 | 4 | 5 | 20 | 39 |
0 | 0 |-1.000000e-09 | 9.801000e-01 | Inf
0.1s| 1 | 0 | 71 | - | 650k| 0 | 0 | 5 | 4 | 5 | 21 | 40 |
0 | 0 |-1.000000e-09 | 9.801000e-01 | Inf
0.1s| 1 | 0 | 72 | - | 650k| 0 | 0 | 5 | 4 | 5 | 22 | 41 |
0 | 0 |-1.000000e-09 | 9.801000e-01 | Inf
0.1s| 1 | 0 | 73 | - | 650k| 0 | 0 | 5 | 4 | 5 | 23 | 42 |
0 | 0 |-1.000000e-09 | 9.801000e-01 | Inf
0.1s| 1 | 0 | 74 | - | 650k| 0 | 0 | 5 | 4 | 5 | 24 | 43 |
0 | 0 |-1.000000e-09 | 9.801000e-01 | Inf
0.1s| 1 | 0 | 75 | - | 650k| 0 | 0 | 5 | 4 | 5 | 25 | 44 |
0 | 0 |-1.000000e-09 | 9.801000e-01 | Inf
0.1s| 1 | 0 | 76 | - | 650k| 0 | 0 | 5 | 4 | 5 | 23 | 45 |
0 | 0 |-1.000000e-09 | 9.801000e-01 | Inf
0.1s| 1 | 0 | 77 | - | 650k| 0 | 0 | 5 | 4 | 5 | 24 | 46 |
0 | 0 |-1.000000e-09 | 9.801000e-01 | Inf
0.1s| 1 | 0 | 78 | - | 650k| 0 | 0 | 5 | 4 | 5 | 25 | 47 |
0 | 0 |-1.000000e-09 | 9.801000e-01 | Inf
0.1s| 1 | 0 | 79 | - | 650k| 0 | 0 | 5 | 4 | 5 | 26 | 48 |
0 | 0 |-1.000000e-09 | 9.801000e-01 | Inf
0.1s| 1 | 0 | 80 | - | 656k| 0 | 0 | 5 | 4 | 5 | 27 | 49 |
0 | 0 |-1.000000e-09 | 9.801000e-01 | Inf
0.1s| 1 | 0 | 81 | - | 656k| 0 | 0 | 5 | 4 | 5 | 28 | 50 |
0 | 0 |-1.000000e-09 | 9.801000e-01 | Inf
0.1s| 1 | 0 | 82 | - | 656k| 0 | 0 | 5 | 4 | 5 | 26 | 51 |
0 | 0 |-1.000000e-09 | 9.801000e-01 | Inf
0.1s| 1 | 0 | 83 | - | 656k| 0 | 0 | 5 | 4 | 5 | 27 | 52 |
0 | 0 |-1.000000e-09 | 9.801000e-01 | Inf
0.1s| 1 | 0 | 84 | - | 656k| 0 | 0 | 5 | 4 | 5 | 28 | 53 |
0 | 0 |-1.000000e-09 | 9.801000e-01 | Inf
0.1s| 1 | 0 | 85 | - | 656k| 0 | 0 | 5 | 4 | 5 | 29 | 54 |
0 | 0 |-1.000000e-09 | 9.801000e-01 | Inf
0.1s| 1 | 0 | 86 | - | 656k| 0 | 0 | 5 | 4 | 5 | 30 | 55 |
0 | 0 |-1.000000e-09 | 9.801000e-01 | Inf
0.1s| 1 | 0 | 87 | - | 656k| 0 | 0 | 5 | 4 | 5 | 31 | 56 |
0 | 0 |-1.000000e-09 | 9.801000e-01 | Inf
0.1s| 1 | 0 | 88 | - | 656k| 0 | 0 | 5 | 4 | 5 | 29 | 57 |
0 | 0 |-1.000000e-09 | 9.801000e-01 | Inf
0.1s| 1 | 0 | 89 | - | 656k| 0 | 0 | 5 | 4 | 5 | 30 | 58 |
0 | 0 |-1.000000e-09 | 9.801000e-01 | Inf
0.1s| 1 | 0 | 90 | - | 656k| 0 | 0 | 5 | 4 | 5 | 31 | 59 |
0 | 0 |-1.000000e-09 | 9.801000e-01 | Inf
0.1s| 1 | 0 | 91 | - | 656k| 0 | 0 | 5 | 4 | 5 | 32 | 60 |
0 | 0 |-1.000000e-09 | 9.801000e-01 | Inf
0.1s| 1 | 0 | 92 | - | 656k| 0 | 0 | 5 | 4 | 5 | 33 | 61 |
0 | 0 |-1.000000e-09 | 9.801000e-01 | Inf
time | node | left |LP iter|LP it/n| mem |mdpt |frac |vars |cons |cols |rows |cuts |c
onfs|strbr| dualbound | primalbound | gap
0.1s| 1 | 0 | 93 | - | 656k| 0 | 0 | 5 | 4 | 5 | 34 | 62 |
0 | 0 |-1.000000e-09 | 9.801000e-01 | Inf
0.1s| 1 | 0 | 94 | - | 656k| 0 | 0 | 5 | 4 | 5 | 32 | 63 |
0 | 0 |-1.000000e-09 | 9.801000e-01 | Inf
0.1s| 1 | 0 | 95 | - | 656k| 0 | 0 | 5 | 4 | 5 | 33 | 64 |
0 | 0 |-1.000000e-09 | 9.801000e-01 | Inf
0.1s| 1 | 0 | 96 | - | 656k| 0 | 0 | 5 | 4 | 5 | 34 | 65 |
0 | 0 |-1.000000e-09 | 9.801000e-01 | Inf
0.1s| 1 | 0 | 97 | - | 656k| 0 | 0 | 5 | 4 | 5 | 35 | 66 |
0 | 0 |-1.000000e-09 | 9.801000e-01 | Inf
0.1s| 1 | 2 | 97 | - | 656k| 0 | 0 | 5 | 4 | 5 | 35 | 66 |
0 | 0 |-1.000000e-09 | 9.801000e-01 | Inf
* 0.1s| 4 | 3 | 139 | 22.3 | 659k| 3 | - | 5 | 4 | 5 | 30 | 103 |
0 | 0 |-1.000000e-09 | 4.900000e-01 | Inf
* 0.1s| 5 | 2 | 176 | 26.0 | 659k| 3 | - | 5 | 4 | 5 | 26 | 135 |
0 | 0 |-1.000000e-09 | 9.000000e-02 | Inf
SCIP Status : problem is solved [optimal solution found]
Solving Time (sec) : 0.11
Solving Nodes : 5
Primal Bound : +8.99999989999999e-02 (5 solutions)
Dual Bound : +8.99999989999999e-02
Gap : 0.00 %
optimal solution found
optimal solution found
F = 0.09000072024651419
{x,y,z,u} = {0.5002169481274188,0,0.7003793013180546,0.40072753730785526}
-- Пн фев 04, 2019 16:27:14 --MiniZinc + SCIP - свободны.