フィルターのクリア

How to use symbolic math toolbox to generate the gradient of a very long function?

3 ビュー (過去 30 日間)
GKH
GKH 2018 年 9 月 5 日
コメント済み: madhan ravi 2018 年 12 月 3 日
I am currently trying to use fmincon for Nonlinear Model Predictive Control. Typical MPC modeling has its objective function dependent on the length of the horizon, i.e. the number of elements in the optimum solution. My problem is almost same as the closed loop Matlab simulation example given in Swing-up Control of a Pendulum The differences compared to my model are: 1. I am using 4th Runge-Kutta method instead of Euler 2. The expressions used to define the continuous model have other components like tanh function and so on.
I tried to generate gradient and hessian as mentioned in: Symbolic Math Toolbox Example
The problem is that the objective function becomes more and more complex when the length of the optimum solution increases. The expressions become very long and it takes eternally long time to generate those expressions when the length of optimum solution is greater than 4.
I have to generate the expressions for a length of atleast 25. Is there a work around to do this? I understand that longer expressions mean longer time but any tips to make it faster would be appreciated.
Thanks in advance
  3 件のコメント
Christopher Creutzig
Christopher Creutzig 2018 年 12 月 3 日
It may be worth including your expressions in the question. Or, if you prefer not to make them public, contact support@mathworks.com, so the Symbolic Math team has a chance to look at your problem and either give hints to increase the performance or get feedback about places the toolbox can be improved. Or both.
madhan ravi
madhan ravi 2018 年 12 月 3 日
@Christopher I am a big fan of symbolic math toolbox it makes the life a lot easier.

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

回答 (0 件)

カテゴリ

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

製品


リリース

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by