How to write equality constraints for receivers that hourly consume a certain amount of energy

1 view (last 30 days)
1. How to write equality constraints for receivers that hourly consume a certain amount of energy (let's say 0.9 kWh) once a day? Its hourly consumption can be 0 or 0.9. Its total daily consumption = 0.9. I set lb = 0 and up = 0.9. During the optimization process, this consumption is flexible, the receiver can be scheduled to consume at 11 or 12 o'clock for instance.
2. How to write equality constraints for receivers that can't be interrupted and consume at two consecutive hours certain amount of energy (let's say 2 and 0.7 kWh) once a day? Its total daily consumption = 2.7. I set lb = 0 and ub = 2. This receiver can also consume at any time intervals, the only restrictions are: it should consume at two consecutive time intervals and first 2 kWh and then 0.7 kWh.
  2 Comments
Brendan Hamm
Brendan Hamm on 12 Aug 2015
What does the vector of design variables look like? Is it hourly consumption rates for the entire day? What is the length of the variable (24-by-1)?
Simona
Simona on 12 Aug 2015
Edited: Simona on 12 Aug 2015
It is a 1x24 variable. Its hourly consumption = daily consumption, so it is on only for an hour. For other receivers (their hourly consumption forms variables), that consume entire day (such as refrigerator) I wrote Aeq(1,1:24) = [1,1,1,...x24], beq = 5, 5 means its daily consumption.

Sign in to comment.

Accepted Answer

Brendan Hamm
Brendan Hamm on 12 Aug 2015
You should be representing the design variables as a column vector, I will call it x. With that in mind we want the constraint:
Aeq*x = beq;
If we wish to write the sum of values in x is equal to 5, then we should have:
Aeq = ones(1,24);
beq = 5;
Now simply pass these into the appropriate solver.
For part 2 you will likely need to use some form of global optimization for this, unless your objective in linear as is expected by intlinprog.
  7 Comments
Simona
Simona on 12 Aug 2015
I will try this approach, that means to add new constraints related to on(1)/off(0) state to the existing ones. Thank you!
Simona
Simona on 13 Aug 2015
When I used intcon for a couple of variables 145:168 Matlab ignored lb=zeros(168,1) and I don't know why. I am very curious. Then I put intcon for all variables and it worked well. Now, I want to change objective function and I don't know how to do this because the new function depends on the results. Objective function should be min(hourly consumption). Hourly consumption should be consumption of 1st receiver + consumption of 2nd receiver... at 1 o'clock and so on.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!