Aerospace Blockset Previous page   Next Page

Running the Simulation

You can now run the simulation block diagram that you built to see how the system behaves in time:

  1. Double-click the Scope block if the Scope window is not already open on your screen. The Scope window appears.
  2. Select Start from the Simulation menu in the block diagram window. The signal containing the 10 rad/sec sinusoid and the signal containing the actuator position are plotted on the scope.
  3. Adjust the Scope block's display. While the simulation is running, right-click the y-axis of the scope and select Autoscale. The vertical range of the scope is adjusted to better fit the signal.
  4. Vary the Sine Wave block parameters.
    1. While the simulation is running, double-click the Sine Wave block to open its parameter dialog box. This will cause the simulation to pause.
    2. You can then change the frequency of the sinusoid. Try entering or 20 in the Frequency field. Close the Sine Wave dialog box to enter your change and allow the simulation to continue. You can then observe the changes on the scope.

  5. Select Stop from the Simulation menu to stop the simulation.

Many parameters cannot be changed while a simulation is running. This is usually the case for parameters that directly or indirectly alter a signal's dimensions or sample rate. There are some parameters, however, like the Sine Wave Frequency parameter, that you can tune without terminating the simulation.

Running a Simulation from an M-File

You can also modify and run a Simulink simulation from within a MATLAB M-file. By doing this, you can automate the variation of model parameters to explore a large number of simulation conditions rapidly and efficiently. For information on how to do this, see Running a Simulation Programmatically in the Simulink documentation.


Previous page  Building a Simple Actuator System Case Studies Next page

Learn more about the latest releases of MathWorks products:

 © 1994-2009 The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS