encounter a problem in solvemp function

38 views
Skip to first unread message

Kai-Wen Tien

unread,
Jan 2, 2016, 9:40:06 PM1/2/16
to YALMIP
Hi, all.

I am trying to solve a single mp-LP problem by using solvemp in Matlab MPT toolboxes

My original problem is 

------------------------------------------------------------------------------------
A = [0.80 0.44;0.05 0.10;0.10 0.36];    % the ineq constraints matrix
b = [24000;2000;6000];                       % the ineq RHS
lb = [0;0];                                          % the lb of disturbance
ub = [6000;500];                                % the ub of distrubance
c = [-8.1;-10.8];                                 % the cost vector
B = [1 0;0 1;0 0];                               % the capacity changes
z = sdpvar(2,1);                                                    % define the variables
x = sdpvar(2,1);                                                    % define the parametric disturbance
obj = c'*z;                                                             % the objective function
F = [A*z<=b+B*x, z>=0, lb<=x<=ub];                     % define the constraints
[sol,diagnostics,aux,Valuefunction,Optimizer] = solvemp(F,obj,[],x);% solve the parametric problem
plot(Valuefunction);                                                % plot the value function
assign(x,[500;500]);                                               % assgin a value for disturbance
value(Valuefunction)                                              % get the optimal solution
value(Optimizer)
-----------------------------------------------------------------------------------------
The solution was wrong. For all possible combination of x, the optimal value is -189000

Then I figured out if I rescale the RHS b
------------------------------------------------------------------------------------
A = [0.80 0.44;0.05 0.10;0.10 0.36];    % the ineq constraints matrix
b = [24;2;6];                                      % the ineq RHS*10^3
lb = [0;0];                                          % the lb of disturbance*10^3
ub = [6;0.5];                                      % the ub of distrubance*10^3
c = [-8.1;-10.8];                                 % the cost vector
B = [1 0;0 1;0 0];                               % the capacity changes
-----------------------------------------------------------------------------------------
Then the solutions and the optimal value surface are right.... I don't know why this problem happened
Could someone help me to solve this mystery? Thanks

Kai-Wen

Johan Löfberg

unread,
Jan 7, 2016, 4:50:15 AM1/7/16
to YALMIP
I think the question answers itself. You have bad scaling, leading to numerical problems in the mp-solver
Reply all
Reply to author
Forward
0 new messages