Line | |
---|
1 | function ex14_1_5 |
---|
2 | |
---|
3 | yalmip('clear') |
---|
4 | sdpvar x1 x2 x3 x4 x5 x6 objvar; |
---|
5 | |
---|
6 | F = set([]); |
---|
7 | F = F + set( - x6 + objvar == 0); |
---|
8 | F = F + set( 2*x1 + x2 + x3 + x4 + x5 == 6); |
---|
9 | F = F + set( x1 + 2*x2 + x3 + x4 + x5 == 6); |
---|
10 | F = F + set( x1 + x2 + 2*x3 + x4 + x5 == 6); |
---|
11 | F = F + set( x1 + x2 + x3 + 2*x4 + x5 == 6); |
---|
12 | F = F + set( x1*x2*x3*x4*x5 - x6 <= 1); |
---|
13 | F = F + set( - x1*x2*x3*x4*x5 - x6 <= -1); |
---|
14 | F = F + set( -2 < [x1 x2 x3 x4 x5 ] < 2); |
---|
15 | |
---|
16 | sol = solvesdp(F,objvar,sdpsettings('solver','bmibnb','bmibnb.upper','fmincon')); |
---|
17 | |
---|
18 | mbg_asserttolequal(sol.problem,0); |
---|
19 | mbg_asserttolequal(double([x1 x2 x3 x4 x5 ]), [1 1 1 1 1], 1e-5); |
---|
Note: See
TracBrowser
for help on using the repository browser.