Azzera filtri
Azzera filtri

Optimize/maximize for multiple functions that depend on eachother in time.

1 visualizzazione (ultimi 30 giorni)
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!

Risposte (1)

Chris Perkins
Chris Perkins il 8 Ago 2017
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:

Categorie

Scopri di più su Problem-Based Optimization Setup in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by