How to compute numerical gradient of an unknown function in matlab Simulink?

8 ビュー (過去 30 日間)
Amardeep Mishra
Amardeep Mishra 2019 年 7 月 19 日
編集済み: Torsten 2019 年 7 月 22 日
Hi! I have a function that is unknown and that is being generated at every time instant t in my simulink model (Imagine it like a black box, wherein, I have data for at every time instant but not the mapping itself, the data looks something like this: ). In order to implement my algorithm, I need to find the direction that corresponds to greatest decrease (or increase) of this scalar mapping at every time instant. So, how can I find the numerical gradient descent of this unknown function at every time step, i.e at any ? The only thing known is that is lipshitz continuous. Kindly suggest me ways in which it can be implemented in simulink. Thanks for your time and consideration.

回答 (1 件)

Torsten
Torsten 2019 年 7 月 19 日
The i'th component gi of the gradient vector g is approximately given by
gi = (f(x1,...,xi+h,...,x10)-f(x1,...,xi,...,x10))/h
Thus for each time t, given (x1,...,x10), you will have to evaluate f at (x1+h,x2,...,x10),(x1,x2+h,x3,...,x10),...,(x1,x2,...,x10+h) and calculate the gi.
  10 件のコメント
Amardeep Mishra
Amardeep Mishra 2019 年 7 月 19 日
Because that would mean that, we'd have to perturb the parameters, and then perturb u and then integrate xdot to find the next state. Now at any given instant of time you can either give u(w). How can you give both u(w) and u(w+h) to the system?
Torsten
Torsten 2019 年 7 月 22 日
編集済み: Torsten 2019 年 7 月 22 日
How can you give both u(w) and u(w+h) to the system?
If this is a technical problem that concerns SIMULINK, I can't answer it.
As you wrote, u is the control input specified by you. So in general, it should be possible to evaluate it at (x(t),w(t)) and (x(t),perturbed w(t)).

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

カテゴリ

Help Center および File ExchangeGeneral Applications についてさらに検索

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by