Optimize/maximize for multiple functions that depend on eachother in time.
1 回表示 (過去 30 日間)
古いコメントを表示
I'm calculating the profit that can be made when connecting a battery to the electricity grid; Charging when electricity is cheap and discharging when it's expensive. I have a function [Level, Profit] = fun(Power,Level0,Eur) that calculates the level of charging of a battery and the profit/loss during discharging/charging for the price 'Eur' of electricity for that hour. I want to calculate the optimal power input/output per hour to maximize the profit for a period of N hours. The array Eur is set and Level0 depends on Level of the previous hour something like:
for i=Nhours
[Level(i); Profit(i)]=fun(power(i),Level(i-1),Eur(i))
end
total_profit=Sum(Profit)
I want to get the array for Power that maximizes total_profit. How can I find the array Power that maximizes total_profit?
Thanks!
0 件のコメント
回答 (1 件)
Chris Perkins
2017 年 8 月 8 日
Hi Maurice,
If you have the Optimization Toolbox, you can use any of the functions described in the following link, depending on which fit your custom function best:
If you do not have the Optimization Toolbox, some optimization functions are included with just MATLAB, and they are described in the following link:
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Problem-Based Optimization Setup についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!