fsolve() in Rapid accelerator mode

22 ビュー (過去 30 日間)
Pierre-Olivier Desrosiers
Pierre-Olivier Desrosiers 2022 年 8 月 28 日
回答済み: Divyam 2025 年 4 月 30 日
Hi guys, I need to know if it's possible to use the fsolve() function in Rapid accelerator mode. I know that the interpreted Matlab function block is not supported in that mode. However, are there any other solutions ? I'm using the 2021b version.

回答 (1 件)

Divyam
Divyam 2025 年 4 月 30 日
You cannot use 'fsolve' with the Rapid Accelerator Mode since it requires all the code to be compatible with Simulink Coder and hence as you stated above, no MATLAB function block will be supported. However, here are two alternative solutions that you could implement:
  1. Precompute the results of fsolve by running Simulink in Normal mode and pass the solution as a parameter/input to your Simulink Model.
  2. Create a custom S-function using C/C++ code for a root finding algorithm. This will enable you to run root finding algorithms in Rapid Accelerator Mode.
For more information regarding custom S-functions, refer to the following documentation: https://www.mathworks.com/help/simulink/slref/custom-code-and-hand-coded-blocks-using-the-s-function-api.html

カテゴリ

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

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by