How to write equality constraints for receivers that hourly consume a certain amount of energy
1 view (last 30 days)
Show older comments
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
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)?
Accepted Answer
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
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!