Hi,
I am trying to create a robust counterpart MATHEMATICAL PROGRAM of my LP model. I have read chapter 20 regarding Robust Optimization and understood that I need to call the GMP function GenerateRobustCounterpart.
I have declared a procedure with the following body:
GMP::Instance::GenerateRobustCounterpart(ProductionPlan,Demand(t),,[RC])
But when I try to save it I get the following error message:
The symbol "GenerateRobustCounterpart" is not expected.
What am I doing wrong?
Many thanks in advance,
Michal
Hi Michal,
The GenerateRobustCounterpart function returns an element into the set AllGeneratedMathematicalPrograms. You have to declare an element parameter MyGMP with range AllGeneratedMathematicalPrograms.
The second argument of GenerateRobustCounterpart should be a subset of AllUncertainParameters. If you want to include all the uncertain parameters that you have declared you can simply use:
MyGMP := GMP::Instance::GenerateRobustCounterpart(ProductionPlan, AllUncertainParameters,
AllUncertaintyConstraints, ‘MyRO’);
GMP::Instance::Solve( MyGMP );
If you want to use a selection of all uncertain parameters then you have to declare a set MyUncertainParameters that is a subset of AllUncertainParameters, and use:
MyUncertainParameters := { ‘Demand’ };
MyGMP := GMP::Instance::GenerateRobustCounterpart(ProductionPlan, MyUncertainParameters,
AllUncertaintyConstraints, ‘MyRO’);
GMP::Instance::Solve( MyGMP );
Attached is a small example with. You should create a new AIMMS project to load this file.
Best regards,
Marcel Hunting
AIMMS Software Developer
Dear Marcel,
Thank you very much for the quick response.
My
model has only non-negativity constraints: I declared my variables and used
their RANGE attribute in order to determine their non-negativity.
In
this case what should the third argument of the GMP function be?
Many
thanks in advance,
Hi Michal,
Normally the third argument is equal to AllUncertaintyConstraints which is the set of all uncertainty constraints, i.e., constraints that define the uncertainty set. It is independent of how you formulate your variables and normal constraints. Note that AllUncertaintyConstraints is a predefined set in AIMMS (like AllUncertainParameters).
How did you define your uncertainty parameter(s)?
Best regards,
Marcel Hunting
AIMMS Software Developer
Dear Marcel,
Thank you for your help.
I have used AllUncertaintyConstraints as the third argument and was able to solve the robust counterpart.
My model is a multi-period production planning with the objective of maximizing the total profit subject to non-negativity of the inventory level, shortage level and the variable production quantity itself. My uncertain parameter is the demand.
I have already solved this model directly using the solver MOSEK and I am now interested in using AIMMS for further versions of it. Therefore, I am comparing the optimal solutions I get using AIMMS to the ones I already have from MOSEK. So far the deterministic solution (with the demand taking its nominal values) as well as the Robust Counterpart (where the demand is considered uncertain) solution is the same.
My next step was to have my variables (ProductionQuantity and ShortageLevel) adjustable such that in each period t it may depend on the realization of the demand from period 1 until t including. For that purpose I have declared two new parameters (ProductionQdemandDependency and ShortageLdemandDependency) that define the dependency of each of my variable in the past demands as mentioned above. I have also declared a new element parameter (gmpAARC) to store this Robust Counterpart. Unfortunately, this optimal solution (objective function 88.8426) does not equal the solution I already have using MOSEK directly (objective function 81.6546).
I attach my model AIMMS files and will highly appreciate it if you can help me understand the reason for the difference. In addition I would like to know how to observe the new intermediate variables that AIMMS creates for the adjustable variables.
Many thanks in advance,
Michal
Hi Michal,
If I solve the deterministic solution I get an objective value of 98.714, and if I solve the RC I get an objective value of 36.672. Is that the same for you?
Without knowing the MOSEK model it is impossible for me to explain the difference you see for the AARC. The AARC solution returned by AIMMS seems to be better than the one you get with MOSEK directly (higher objective value while you are maximizing). Maybe it helps to print out the LP file in both cases and compare them (but this might be hard because the ordering of the variables and constraints in the robust counterpart might be different between AIMMS and MOSEK directly).
You can observe the intermediate variables by using:
display ShortageLevel.adjustable.Demand, ShortageLevel.adjustable.constant;
Best regards,
Marcel
You can observe the intermediate variables by using:
display ShortageLevel.adjustable.Demand, ShortageLevel.adjustable.constant;
what do you meam bt display?
Regards,
Michal