Fixed step solver explanation needed
4 views (last 30 days)
Show older comments
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!
0 Comments
Accepted Answer
Fangjun Jiang
on 14 Feb 2024
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.
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!