Closed mzaffalon closed 1 year ago
Thanks for the bug report, I'll fix it! What's the reason you did the conversion to transfer function? You should generally try to avoid converting a statespace system into a transfer function before simulating, the conversion will suffer from poor numerics, and before actually simulating the transfer function will be converted back into a statespace system.
Thank you for the prompt reply.
What's the reason you did the conversion to transfer function?
Ignorance. It is a lab I took in MATLAB and I could not figure out why the linearized plant with controller is unstable whereas Simulink on the full plant and the same controller gives a stable response.
This section of the manual contains some background on why statespace representations often are to be preferred over transfer functions for numerical reasons.
I could not figure out why the linearized plant with controller is unstable whereas Simulink on the full plant and the same controller gives a stable response.
Nonlinearities can be both helpful and detrimental. As a simple example of this, most real systems are never going to diverge to infinity, you'd usually hit the nonlinear input saturation at one point or another. Input saturation is usually a bad thing, but here it prevents your system from exploding :)
In your case, it could be that the gain is increased/decreased due to a nonlinearity and that may change the stability properties.
Thank you for your helpful comment (as usual) and the link!
The states of the Simulink simulation seem to remain close to the operating point where the linearization (using Simulink
and Julia's SymPy
) was done, and the non-linear system appears to have rather smooth functions. I have been banging my head over it for a week now.
How do you simulate the linearized system? Could it be that the sign of the feedback is different in simulink compared to if you close the feedback loop outside of simulink?
I cannot figure out the reason for
step
not working onwhereas everything works fine for
on
Julia v1.9.3
and[a6e380b2] ControlSystems v1.8.0
.