Reputation: 311
So I'm new to Simulink (I've been working on it for less than 1 hour). I've put a "Sine Wave" block with an amplitude of 3 and a frequency of 2*pi and connected it to a "Scope". The problem is that the plot has some kind of edges:
Would you mind telling me, please, how to fix this?
Thank you !
Upvotes: 1
Views: 2413
Reputation: 21
Here is the path to solver settings: Your Simulink model -> Modeling -> Model Settings -> Model Settings -> Solver -> Solver: ode45, Max step size: 0.1.
Upvotes: 0
Reputation: 13876
This is because by default Simulink chooses a time step of the simulation end time divided by 50, unless the dynamics of the model requires smaller time steps (for a variable step solver).
I assume you haven't changed any of the solver settings, in which case you probably have ode45
as a solver with the default settings. Change the MaxStepSize
to be something small, say 0.1s or even smaller. The simulation will take a bit longer but you'll get more data points and therefore a smoother curve.
Have a read of Choose a Solver in the Simulink documentation for more details.
Upvotes: 4