Fixed step solver explanation needed

3 visualizaciones (últimos 30 días)
Askic V
Askic V el 14 de Feb. de 2024
Comentada: Askic V el 14 de Feb. de 2024
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!

Respuesta aceptada

Fangjun Jiang
Fangjun Jiang el 14 de Feb. de 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.

Más respuestas (0)

Categorías

Más información sobre Simulink en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by