►
Model Configuration Parameters
Or simply use the shortcut on the toolbar
Once opened, select Solver.
There are many configurable
settings.
Start/Stop time: It is suggested that you leave the start time as zero.
The stop time is same as in the toolbar at the top of your model.
There are two types of solver:
o
A variable step solver (the default): This will automatically adjust the step size as the
model runs. If you are using variable step generally keep the default solver (ode45).
Set the Max step size to a small fixed value to improve the smoothness of any plots.
o
A fixed step solver will be necessary for models with discrete components. If it also
has no continuous components, change the solver to Discrete (no continuous states)
and set the step size to a known value. The fixed solvers are numbered in order of
simplicity, ode1 being the simplest.
Zero-crossing options: Under “Additional Parameters” you will find the Zero-crossing
options. Further details about zero-crossing are found on page 27.
For more information about solvers, click on the Help button at the bottom of the configuration
parameters window, while you are viewing the solver section.
8
Sources Library
Source blocks provide different signals for your model.
The simplest source is simply a Constant.
A block that outputs a constant value.
The Signal Builder allows custom signals to be built
using a graphical user interface (see right).
For more typical periodic functions, see the table below with key blocks from this library:
Block
Key Block Parameters
Block
Key Block Parameters
Amplitude and Frequency
Bias and Phase
Time can be input as external signal
Amplitude
Period (seconds)
Pulse Width (% of period)
Phase Delay (seconds)
Step Time
Initial Value
Final Value
Waveform: Sine, Square,
Sawtooth or Random
Amplitude
Frequency
Units (rad/sec or Hertz)
Assume we want to use the sine wave block to look at the frequency response of a system.
Repeatedly editing the block parameters to change the frequency of the sine wave is tedious.
The alternative is to use an external time input to the block.
To do this, in the Sine Wave block parameters you set the Time parameter to Use external signal
and set the frequency to 2*pi. You then connect a clock to the new input via a slider gain. The
slider then sets the frequency of the sine wave.
|