Hi I am having an issue with a constraint in the optimisation problem that I have developed.
I am using the following constraint.
P = sdpvar(Nunits,1, 'full');
DemandSlack = sdpvar(1, 1) ;
DemandPenalty = 10 ;
Constraints = [Constraints, (sum(P)+ DemandSlack == Pdemand):'SumPower'];
I actually need to keep the
sum(P) as close as possible to Pdemand which is a constant.
Actually I get a feasible solution to the above problem. But the problem is no matter the Pdemand it gives the same sum(P) and most of the time it is greater than the Pdemand given.
But when I define the constraint in the following form,
Constraints = [Constraints, (sum(P)<= Pdemand):'SumPower'];
The sum(P) is always very much less than the Pdemand which I do not want to happen.
Can anyone please help me with this.