The objective function of the original problem:min Y,S max X(sum(sum((c+q.*X).*Y))+p'*S)],it's about cost.
If z= max X(sum(sum((c+q.*X).*Y))+p'*S)], I think I can model it in the following ways :
f=z
F=[];
F=[F,z>=(sum(sum((c+q.*X1).*Y))+p'*S)];
F=[F,z>=(sum(sum((c+q.*X2).*Y))+p'*S)];
F=[F,z>=(sum(sum((c+q.*X3).*Y))+p'*S)];
Where X1 X2 X3 represents three scenarios, I modeled it this way but found that the results were wrong.
eg:
If I do X1,
f=z
F=[ ];
F=[F,z>=(sum(sum((c+q.*X1).*Y))+p'*S)];
The answer is 38.
If I do X2,
f=z
F=[ ];
F=[F,z>=(sum(sum((c+q.*X2).*Y))+p'*S)];
The answer is 62.
If I do X3,
f=z
F=[ ];
F=[F,z>=(sum(sum((c+q.*X3).*Y))+p'*S)];
The answer is 32.
But if I do X1, X2, X3, the answer is 67, and I think the answer should be 62.
And I don’t know why. Am I adding constraints or modeling in the wrong way??
Another question, if scenarios X1, X2, X3 are known, A{i}=Xi, and their optimal solutions are 38, 62, and 32 respectively. How do I add constraints so that the optimal solution min (z) is equal to 62 rather than 67?
And I try to do that:
k=intvar(1);
W=[z>=(sum(sum((c+q.*A{k}).*Y))+p'*S),1<=k<=3,uncertain(k)];
But the Matlab prompt :
Error using subsindex
There is no function 'subsindex' defined for the value of class 'sdpvar'.
How can I solve this problem? How do I get to 62? Or for The objective function of the original problem:min Y,S max X(sum(sum((c+q.*X).*Y))+p'*S)],where Y,S are decision variables.
How do I model this by using the Yalmip?
Dear professor,
This is a question of grid attack - scheduling, and we know all the possible attack scenarios of the grid, and I look for the best scheduling solution when the grid is under attack(we consider the minimum loss in the worst case scenario).
So this is a robust problem or a game problem.
Therefore, Xi represents the attack scenarios, and I will try to find the optimal scheduling scheme under the premise of knowing all possible attack scenarios. But I don't know how to solve this problem by using Yalmip. And I tried to enumerate all the attack scenarios to get the optimal scheduling solution. i.e. If I knew the losses in each scenario, I would know the losses in the worst case scenario.(It's a stupid way to do it,.)
So, I knew the result of every situation, and the question is how to use Yalmip to automatically minimize the worst case loss.
The model is a typical network flow problem.
s.t. ......
Yij : flow; xij
:1 if edge [i, j] ∈ E damaged, 0 otherwise; c,p,q is known