Comments on: How to model a hard stop in Simulink https://blogs.mathworks.com/simulink/2014/01/22/how-to-model-a-hard-stop-in-simulink/?s_tid=feedtopost Guy Rouleau is an Application Engineer for MathWorks. He writes here about Simulink and other MathWorks tools used in Model-Based Design. Thu, 09 May 2019 20:42:08 +0000 hourly 1 https://wordpress.org/?v=6.2.2 By: Matthias Liermann https://blogs.mathworks.com/simulink/2014/01/22/how-to-model-a-hard-stop-in-simulink/#comment-251819 Thu, 09 May 2019 20:42:08 +0000 https://blogs.mathworks.com/seth/?p=2541#comment-251819 Hi Guy, you are not choosing the option ‘Reinitialize dx/dt when x reaches saturation’. Would you not want to choose that to make sure that the velocity is zero? If the velocity is not zeroed and the input changes its sign, the mass would not immediately move from its hard stop, would it?

]]>
By: Guy Rouleau https://blogs.mathworks.com/simulink/2014/01/22/how-to-model-a-hard-stop-in-simulink/#comment-187499 Wed, 14 Dec 2016 19:06:14 +0000 https://blogs.mathworks.com/seth/?p=2541#comment-187499 Hi Alex,

I agree with you that results for this kind of model can be affected by solver settings. As far as I remember, I used the ode45 solver with default settings.

When there are discontinuities like in this case, it is important to enable zero-crossing detection to capture them accurately.

Typically, I recommend doing a convergence study, where you increase/decrease the absolute and relative tolerance until you find a good trade off between performance and accuracy.

]]>
By: Alex https://blogs.mathworks.com/simulink/2014/01/22/how-to-model-a-hard-stop-in-simulink/#comment-187480 Wed, 14 Dec 2016 16:32:07 +0000 https://blogs.mathworks.com/seth/?p=2541#comment-187480 Could you please share your solver config settings and the settings of the source block? To me, the result of different approaches seems to highly depend upon these settings.

]]>