Optimization with asymmetrical prices

2 views (last 30 days)
Hi!
I am solving an optimization problem where a storage device is used to whether to buy or sell electricity during different time periods. I trying to understand how to mathematically solve an optimization problem in Matlab where there are different price/ cost arrays for selling and purchasing energy accordingly. It basically depends on a sign of the specific storage-related parameter (whether to take or give energy).
How could I implement this kind of conditional pricing in an objective function using the Matlab optimization toolbox?

Accepted Answer

Walter Roberson
Walter Roberson on 5 Sep 2023
When you have any kind of situation like that, the objective function almost always has discontinuous first derivatives. You have abrupt changes of behaviour between buy and sell, rather than smooth transitions between . You do not, for example, buy and sell according to a sine wave or according to Bessel functions: you effectively react according to unpredictable non-smooth external stimuli and abruptly change state.
Any optimization routine that relies upon jacobians or hessians cannot deal with those kinds of systems.
You need an optimization routine such as Genetic Algorithm (ga) which does not require that the functions be smooth.
It seems to me that if you had 100% accurate knowledge of the future, that you could achieve absolute best optimization. But you will never have 100% accurate knowledge of the future -- so it seems to me that your real problem is to try to pick the best forecasting algorithm that predicts the future the most accurately, with ability to make (possibly large) corrections based upon the "actual" data. You would have to test such algorithms multiple times over different scenarios in order to decide which algorithm was best overall (which is not necessarily going to be the one that optimizes best for any one scenario.)
  2 Comments
Anne
Anne on 6 Sep 2023
Thank you for a very good overview.
This means that in this case, I couldn't use that simple optimization algorithm as it is with linear problems for example? Definitely, I will try to find more information about the genetic algorithm routine. Could you suggest some Matlab examples of a similar optimization problem so that I could learn and understand the testing part?
Torsten
Torsten on 6 Sep 2023
Edited: Torsten on 6 Sep 2023
If you define integer binary variables (0/1) where 0 stands for buying and 1 stands for selling, e.g., could you formulate your optimization problem with these variables ? In this case, you could try to use "intlinprog" for solving.
Is this of help for you ?

Sign in to comment.

More Answers (0)

Categories

Find more on Get Started with Optimization Toolbox in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!