One of the old Wolfram blog posts that I use frequently is this demonstration of the LQR gains computation.
https://blog.wolfram.com/2011/01/19/stabilized-inverted-pendulum/
I've been able to trust this since version 8. It's just one of those things I "go to" without thinking too much about it when starting a controls project.
It's now broken in ways I describe below, and despite a few hours of poking deep, I haven't found the root cause nor a workaround. This has me doubting not only Mathematica version 12 but my own sanity. I cannot trust the entire infrastructure this demo stands on.
I downloaded a fresh copy of the CDF this morning. The notebook no longer qualitatively matches the posted videos, and it certainly used to match in earlier versions of Mathematica.
In particular, the last two simulations are badly broken. In the penultimate demonstration, the cart does not return to center after the second bump, but drifts off to the right forever. That behavior is contrary to the video and contrary to the behavior I have observed in live notebooks since version 8.
Something changed in version 12!
The last demonstration fails even more dramatically. The cart does not move at all while being bumped hard. The video shows the expected behavior.
Anyone have any insight to this? Is NDSolve
broken? Could it be related to broken eigenvalues? Eigenvalues broken in Version 12.0
NDSolve
in the original blog. It's possible some of the defaults changed and that the breakage isn't as catastrophic as it seems at first glance. $\endgroup$