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

1 次查看(过去 30 天)
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 个评论
Brendan Hamm
Brendan Hamm 2015-8-12
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 2015-8-12
编辑:Simona 2015-8-12
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.

请先登录,再进行评论。

采纳的回答

Brendan Hamm
Brendan Hamm 2015-8-12
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 个评论
Simona
Simona 2015-8-12
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 2015-8-13
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.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Solver Outputs and Iterative Display 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by