Fixed step solver explanation needed

1 次查看(过去 30 天)
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.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Modeling 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by