Using Simulink | ![]() ![]() |
Running a Demo Model |
Example of how to run a Simulink model. |
Building a Simple Model |
Example of how to build a Simulink model. |
Setting Simulink Preferences |
How to set Simulink preferences. |
Running a Demo Model
An interesting demo program provided with Simulink models the thermodynamics of a house. To run this demo, follow these steps:
thermo
in the MATLAB command window. This command starts up Simulink and creates a model window that contains this model.
Description of the Demo
The demo models the thermodynamics of a house using a simple model. The thermostat is set to 70 degrees Fahrenheit and is affected by the outside temperature, which varies by applying a sine wave with amplitude of 15 degrees to a base temperature of 50 degrees. This simulates daily temperature fluctuations.
The model uses subsystems to simplify the model diagram and create reusable systems. A subsystem is a group of blocks that is represented by a Subsystem block. This model contains five subsystems: one named Thermostat, one named House, and three Temp Convert subsystems (two convert Fahrenheit to Celsius, one converts Celsius to Fahrenheit).
The internal and external temperatures are fed into the House subsystem, which updates the internal temperature. Double-click the House block to see the underlying blocks in that subsystem.
The Thermostat subsystem models the operation of a thermostat, determining when the heating system is turned on and off. Double-click the block to see the underlying blocks in that subsystem.
Both the outside and inside temperatures are converted from Fahrenheit to Celsius by identical subsystems.
When the heat is on, the heating costs are computed and displayed on the Heat Cost ($) plot on the Thermo Plots Scope. The internal temperature is displayed on the Indoor Temp Scope.
![]() | Typographical Conventions | Some Things to Try | ![]() |