フィルターのクリア

Punishing Term for Smoothing Optimization Results

2 ビュー (過去 30 日間)
Mathias Dirksmeier
Mathias Dirksmeier 2018 年 8 月 24 日
コメント済み: Mathias Dirksmeier 2018 年 8 月 24 日
Hi all,
this might be an interesting brainteaser: I am optimizing electric storage dispatch (fmincon solver) with a function to be optimized as follows:
fun = @(x)sum(x.*p)
,p is given as a price vector, x is the storage dispatch in kWh.
There are some constraints to this so that optimization results in a vector x. So far so good.
Now, plotting x reveals its jumping behavior (cp. attachment). However, I would rather have it smoothed just as or at least alike the price vector (Clearing Price, also cp. attachment). The jumping seems arbitrary (so far, there is no punishment for jumping).
How do I punish for jumping in my optimization function? I could not think of a way to include this into my constraints as I do not want to define strong constraints rather a little punishment (just strong enough to prevent jumping when it does not serve to optimality but still allow big leaps if necessary).
My idea so far: Add a punishment term to the optimization function like this:
fun = @(x)sum(x.*p+(x(n+1)-x(n))/1000)
That way, there should be a little punishment for all changes in x. The problem, that would require a loop in my optimization function and I have no idea if that's possible at all. I am really looking forward to your ideas and the following discussion.
Thanks in advance, Mathias

採用された回答

Matt J
Matt J 2018 年 8 月 24 日
fun = @(x) x(:).'*p(:) + beta*norm(diff(x)).^2 ;
  3 件のコメント
Matt J
Matt J 2018 年 8 月 24 日
編集済み: Matt J 2018 年 8 月 24 日
The penalty term norm(diff(x)).^2 is the same as sum(x(n+1)-x(n))^2. It is a very traditional roughness penalty.
beta is a coefficient you must define to control the weight of the penalty term. The error message is because you have not defined it, so Matlab thinks you mean to invoke the command beta().
Mathias Dirksmeier
Mathias Dirksmeier 2018 年 8 月 24 日
Thanks a lot, I got it! And it works!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSolver Outputs and Iterative Display についてさらに検索

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by