What is lsim?
lsim simulates the (time) response of continuous or discrete linear systems to arbitrary inputs. When invoked without left-hand arguments, lsim plots the response on the screen.
How do I plot the simulated response using lsim?
When you use lsim to plot the simulated response, lsim provides separate axes for each output, representing the system response in each output channel to the input u (t) applied at all inputs. Consider the two-input, three-output state-space model with the following state-space matrices.
How does lsim perform interpolation?
By default, lsimselects the interpolation method automatically based on the smoothness of the signal U. Finally, lsim(sys1,sys2,…,sysN,u,t) simulates the responses of several LTI models to the same input history t,uandplots these responses on a single figure.
Why does lsim say the input signal is undersampled?
lsim simulates the model using the specified input signal, but it issues a warning that the input signal is undersampled. lsim recommends a sample time that generates at least 64 samples per period of the input u. To see why this recommendation matters, simulate sys again using a sample time smaller than the recommended maximum.