Fixed step solver explanation needed

3 ビュー (過去 30 日間)
Askic V
Askic V 2024 年 2 月 14 日
コメント済み: Askic V 2024 年 2 月 14 日
Hello,
I've developed a dedicated MATLAB function to simulate a dynamic response of a system using difference equations. I have created a discrete model and used "User defined function" in the Simulink to call this function. The discrete model needs sample time to calculate its output correctly. This is for example 0.1s. So when I start simulation with fixed step equal to 0.1s everything works fine, but if I leave default setting in the Simulation configuration parameters with fixed step size set to auto, I get a constant value.
Can you please explain, how this "auto" parameter works in Simulink and what "fundamental sample time" is in this case? Does it start with some predefined value somewhere and then reduce its value as simulation progress or something else?
I did not expect to get a a constant value with "auto" setting, but I do understand why fixed step should match the sample time Ts.
Thank you very much!

採用された回答

Fangjun Jiang
Fangjun Jiang 2024 年 2 月 14 日
A little explaination here.
You can select "auto" in config, if you specify the sample time of your MATLAB Function block as 0.1.
That is a better way to do modeling. Specify the sample time whereever it is needed (sometimes it's better to use the default), let the system determine the simulation step size.
  1 件のコメント
Askic V
Askic V 2024 年 2 月 14 日
Thank you, it is what I needed.

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by