Optimization Toolbox - Choosing a Solver
1 次查看(过去 30 天)
显示 更早的评论
I have a problem finding the correct solver for my optimization problem.
I have a vector called dayload, with dimension 1440x1, representing the electrical load profile of a household of one day (24h*60min/h=1440min). I also have a price profile for that day called price with dimension 1440x1. Furthermore there is a profile for a specific device with dimensions 120x1 (device is on 120min) and a startindex of 850 (refering to dayload). Now I want to shift device from the startindex 850 within the following bounds:
-200 <= shift <= 200 (which means the device can be shifted 200min backwards or forwards at most)
The new dayload including the shifted device would now be:
dayload_new = dayload; dayload_new(startindex+shift:startindex+shift+length(device)) = dayload_new(startindex+shift:startindex+shift+length(device))+device;
So I want to optimize shift, so that the costs are a minimum: costs = price.*(dayload_new) (costs represents a 1440x1 vector. Therefore I guess I'll have to sum up all the elements of costs and minimize sum(costs) to achieve minimizing the costs-function)
Thanks in advance!
0 个评论
回答(1 个)
Seth DeLand
2012-5-23
Hi Norbert, Since your decision variable shift will need to be an integer (it's being used as an index), you would need to use a solver that can constrain variables to be integers. GA from the Global Optimization Toolbox is the only solver with built-in support for constraining variables to be integers.
Since the calculation of "costs" should be pretty quick, I would recommend just looping through all possible values of shift -200:200, and see which one gave the lowest cost.
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!