MATLAB: Discrete simulations

discrete time

if I am running a discrete simulation @ 40kHz, should I still use the variable step solver or switch to a fixed point solver at the sampling frequency?

Best Answer

If you are simulating a discrete system, then use the discrete solver with a fixed time step.
If your system has a 40kHz signal, you can't use a time step that is 1/40k. You need to use a time step that is not larger than 1/40k/2.
Preferably, the time step should be smaller than 1/40k/10.