Rev | Line | |
---|
[37] | 1 | clc |
---|
| 2 | echo on |
---|
| 3 | %********************************************************* |
---|
| 4 | % |
---|
| 5 | % Geomtric programming |
---|
| 6 | % |
---|
| 7 | %********************************************************* |
---|
| 8 | % |
---|
| 9 | % Geometric programming is optimization involving nonlinear |
---|
| 10 | % terms with non-integer and negative powers. |
---|
| 11 | % |
---|
| 12 | % MOSEK can be used to solve a special class of this, so |
---|
| 13 | % called posynomial geometric programming where all coefficients |
---|
| 14 | % in the objective function and the constraints are positive, and |
---|
| 15 | % the decision variables are constrained to be non-negative) |
---|
| 16 | pause |
---|
| 17 | |
---|
| 18 | % To define these problems, we first note that we can define |
---|
| 19 | % variables with negative and non-integer powers |
---|
| 20 | % |
---|
| 21 | % (note, only scalar unit sdpvar variables can be raised to negative |
---|
| 22 | % and non-integer powers. Hence (1+x)^pi is not a valid command) |
---|
| 23 | x = sdpvar(1,1); |
---|
| 24 | degree(x^pi) |
---|
| 25 | pause |
---|
| 26 | |
---|
| 27 | |
---|
| 28 | % The following example is taken from the MOSEK manual |
---|
| 29 | % (note, non-negativity does not need to be specified) |
---|
| 30 | t1 = sdpvar(1,1); |
---|
| 31 | t2 = sdpvar(1,1); |
---|
| 32 | t3 = sdpvar(1,1); |
---|
| 33 | |
---|
| 34 | obj = (40*t1^-1*t2^-0.5*t3^-1)+(20*t1*t3)+(40*t1*t2*t3); |
---|
| 35 | |
---|
| 36 | F = set((1/3)*t1^-2*t2^-2+(4/3)*t2^0.5*t3^-1 < 1); |
---|
| 37 | pause |
---|
| 38 | |
---|
| 39 | % Standard call to solve problem |
---|
| 40 | solvesdp(F,obj) |
---|
| 41 | |
---|
| 42 | pause |
---|
| 43 | echo off |
---|
Note: See
TracBrowser
for help on using the repository browser.