Before starting the simulation, we'll have a closer look at how Simulink computes the simulation results, in order to be able to choose the appropriate simulation time and solver.
Let's build a simple system that finds the solution to this problem:
The exact mathematical solution is y(t) = e -t.
The Simulink model (which we'll save as example.slx
) that implements the problem is:
Notice that we've set the Initial condition source parameter of the Integrator block to be external.
To configure the simulation time and solver of this model, click on the Model Configuration Parameters option from the Simulation menu (keyboard shortcut: Ctrl + E).
A new window will open; select the Solver node from the left-side panel, which will give you access to configure the Solver options and Simulation time parameters.
Under the Solver options section, select the Type list value as Fixed-step (don't worry, we'll explain the meaning later) as shown in the following screenshot:
Then let's edit...