Modelling and Simulation - Lecture 06
Modelling and Simulation - Lecture 06
MPW331
Lecture 06
Simulink for System Simulation
(Part I)
Email: [email protected]
Course Content
10. Parameter
9. Model
Estimation and 11. Introduction to
Verification and
System Optimization
Validation
Identification
Modelling and Simulation MPW327
(Bylaw Breakdown)
Lecture Outline
❑ Simulink is a graphical programming environment for modeling, simulating, and analyzing dynamic systems.
It is part of the larger MATLAB software suite developed by MathWorks, widely used for designing control
systems, signal processing, communication systems, and other engineering applications. Simulink allows
you to build models as block diagrams, making it an intuitive and powerful tool for understanding complex
system behaviors.
Example
Example
Example
Example
Example
Example
Example
Example
Example
Example
Example
1. Basic Structure and Interface
❑ Library Browser: Contains various pre-defined blocks organized into libraries such as sources, sinks, and
mathematical operations.
❑ Simulink Model Canvas: A workspace where you create your model by dragging blocks from the Library
Browser and connecting them.
❑ Block Diagram: A graphical representation of your system model, consisting of blocks (representing
components) connected by lines (representing signals).
2. Types of Blocks
❑ Sources: Blocks like step functions, sine waves, or random signals to provide input to the system.
❑ Sinks: Output blocks, such as scopes or displays, that show simulation results.
❑ Math Operations: Blocks for arithmetic operations (addition, multiplication), trigonometric functions, or
integrators.
❑ Continuous/Discrete: Represent dynamic behavior, for example, integrators for continuous systems or
delay blocks for discrete systems.
3. Building a Model
❑ Adding Blocks: Drag and drop blocks from the Library Browser to the model canvas.
❑ Connecting Blocks: Use connection lines to link blocks, representing data or signal flow.
❑ Configuring Blocks: Double-click a block to set parameters such as gains, time constants, or initial
values.
4. Running a Simulation
❑ Setting Simulation Parameters: Define the simulation time and solver settings. For example, you can
specify the start and stop times for the simulation and choose a solver that best fits the system
dynamics.
❑ Running the Simulation: Click "Run" to start the simulation, and observe the outputs in real-time using
display blocks like the scope.
5. Analyzing Results
❑ Scope and Display: Use Scope blocks to visualize signal changes over time. Displays and To Workspace
blocks can be used to export results to MATLAB for further analysis.
❑ Parameter Sweeps: Simulink also allows you to run simulations with different parameter values to see
how changes affect the system.
6. Advanced Features
❑ Subsystems: Group blocks into subsystems to create reusable, modular components within your model.
❑ Stateflow: Integrate Stateflow (a MATLAB tool) for modeling logic-based systems, state machines, or
event-driven systems.
❑ Code Generation: Simulink can generate C/C++ code, allowing you to implement your model on real
hardware for real-time applications.
Practical Lecture Outline
❑ Lecture Overview Review dynamic systems and learn how they relate to Simulink.
what is Simulink? ▪ Dynamic Systems
▪ Course Overview ❑ Discrete Systems
▪ Running Simulations Model discrete-time systems.
❑ Simulink Graphical Environment ▪ Discrete Systems
Learn about Simulink blocks and signals. ❑ Continuous Systems
▪ Blocks and Parameters Model continuous-time systems.
▪ Identifying Blocks and Signals ▪ Continuous Systems
❑ Inspecting Signals ❑ Simulation Time
Visualize signal values during simulation. Choose the simulation duration.
▪ Inspecting Signals ▪ Simulation Time
▪ Simulink Scopes Overview ❑ Project - Modeling a Thermostat
❑ Basic Algorithms Practice your understanding of discrete dynamic systems.
Use math and logic operators to write algorithms. ▪ Project - Thermostat
▪ Mathematical Operators ❑ Project - Peregrine Falcon Dive
▪ Basic Logic Practice your understanding of continuous dynamic systems.
▪ Conditional Statements ▪ Project - Peregrine Falcon Dive
❑ Obtaining Help ❑ Conclusion
Access documentation from Simulink.
▪ Obtaining Help
❑ Project - Automotive Performance Modes
Practice working with math and logic operators.
• Project - Automotive Performance Modes
❑ Simulink and MATLAB
Use MATLAB variables and functions in Simulink.
▪ MATLAB Workspace Variables
▪ MATLAB Function Block
❑ Dynamic Systems in Simulink
Lecture Overview
❑ Lecture Overview Review dynamic systems and learn how they relate to Simulink.
what is Simulink? ▪ Dynamic Systems
▪ Course Overview ❑ Discrete Systems
▪ Running Simulations Model discrete-time systems.
❑ Simulink Graphical Environment ▪ Discrete Systems
Learn about Simulink blocks and signals. ❑ Continuous Systems
▪ Blocks and Parameters Model continuous-time systems.
▪ Identifying Blocks and Signals ▪ Continuous Systems
❑ Inspecting Signals ❑ Simulation Time
Visualize signal values during simulation. Choose the simulation duration.
▪ Inspecting Signals ▪ Simulation Time
▪ Simulink Scopes Overview ❑ Project - Modeling a Thermostat
❑ Basic Algorithms Practice your understanding of discrete dynamic systems.
Use math and logic operators to write algorithms. ▪ Project - Thermostat
▪ Mathematical Operators ❑ Project - Peregrine Falcon Dive
▪ Basic Logic Practice your understanding of continuous dynamic systems.
▪ Conditional Statements ▪ Project - Peregrine Falcon Dive
❑ Obtaining Help ❑ Conclusion
Access documentation from Simulink.
▪ Obtaining Help
❑ Project - Automotive Performance Modes
Practice working with math and logic operators.
• Project - Automotive Performance Modes
❑ Simulink and MATLAB
Use MATLAB variables and functions in Simulink.
▪ MATLAB Workspace Variables
▪ MATLAB Function Block
❑ Dynamic Systems in Simulink
Lecture Overview
Lecture Overview
Lecture Overview
Lecture Overview
Lecture Overview
Lecture Overview
Lecture Overview
Lecture Overview
Lecture Overview
Lecture Overview
Lecture Overview
Lecture Overview
Lecture Overview
Lecture Overview
Lecture Overview
Lecture Overview
Lecture Overview
Lecture Overview
Lecture Overview
Lecture Overview
Simulink Graphical Environment
❑ Lecture Overview Review dynamic systems and learn how they relate to Simulink.
what is Simulink? ▪ Dynamic Systems
▪ Course Overview ❑ Discrete Systems
▪ Running Simulations Model discrete-time systems.
❑ Simulink Graphical Environment ▪ Discrete Systems
Learn about Simulink blocks and signals. ❑ Continuous Systems
▪ Blocks and Parameters Model continuous-time systems.
▪ Identifying Blocks and Signals ▪ Continuous Systems
❑ Inspecting Signals ❑ Simulation Time
Visualize signal values during simulation. Choose the simulation duration.
▪ Inspecting Signals ▪ Simulation Time
▪ Simulink Scopes Overview ❑ Project - Modeling a Thermostat
❑ Basic Algorithms Practice your understanding of discrete dynamic systems.
Use math and logic operators to write algorithms. ▪ Project - Thermostat
▪ Mathematical Operators ❑ Project - Peregrine Falcon Dive
▪ Basic Logic Practice your understanding of continuous dynamic systems.
▪ Conditional Statements ▪ Project - Peregrine Falcon Dive
❑ Obtaining Help ❑ Conclusion
Access documentation from Simulink.
▪ Obtaining Help
❑ Project - Automotive Performance Modes
Practice working with math and logic operators.
• Project - Automotive Performance Modes
❑ Simulink and MATLAB
Use MATLAB variables and functions in Simulink.
▪ MATLAB Workspace Variables
▪ MATLAB Function Block
❑ Dynamic Systems in Simulink
Simulink Graphical Environment
Simulink Graphical Environment
Simulink Graphical Environment
Simulink Graphical Environment
Simulink Graphical Environment
Simulink Graphical Environment
Simulink Graphical Environment
Simulink Graphical Environment
Simulink Graphical Environment
Simulink Graphical Environment
Simulink Graphical Environment
Simulink Graphical Environment
Simulink Graphical Environment
Simulink Graphical Environment
Simulink Graphical Environment
Simulink Graphical Environment
Simulink Graphical Environment
Simulink Graphical Environment
Simulink Graphical Environment
Simulink Graphical Environment
Simulink Graphical Environment
Simulink Graphical Environment
Simulink Graphical Environment
Simulink Graphical Environment
Simulink Graphical Environment
Simulink Graphical Environment
Simulink Graphical Environment
Simulink Graphical Environment
Simulink Graphical Environment
Inspecting Signals
❑ Lecture Overview Review dynamic systems and learn how they relate to Simulink.
what is Simulink? ▪ Dynamic Systems
▪ Course Overview ❑ Discrete Systems
▪ Running Simulations Model discrete-time systems.
❑ Simulink Graphical Environment ▪ Discrete Systems
Learn about Simulink blocks and signals. ❑ Continuous Systems
▪ Blocks and Parameters Model continuous-time systems.
▪ Identifying Blocks and Signals ▪ Continuous Systems
❑ Inspecting Signals ❑ Simulation Time
Visualize signal values during simulation. Choose the simulation duration.
▪ Inspecting Signals ▪ Simulation Time
▪ Simulink Scopes Overview ❑ Project - Modeling a Thermostat
❑ Basic Algorithms Practice your understanding of discrete dynamic systems.
Use math and logic operators to write algorithms. ▪ Project - Thermostat
▪ Mathematical Operators ❑ Project - Peregrine Falcon Dive
▪ Basic Logic Practice your understanding of continuous dynamic systems.
▪ Conditional Statements ▪ Project - Peregrine Falcon Dive
❑ Obtaining Help ❑ Conclusion
Access documentation from Simulink.
▪ Obtaining Help
❑ Project - Automotive Performance Modes
Practice working with math and logic operators.
• Project - Automotive Performance Modes
❑ Simulink and MATLAB
Use MATLAB variables and functions in Simulink.
▪ MATLAB Workspace Variables
▪ MATLAB Function Block
❑ Dynamic Systems in Simulink
Inspecting Signals
Inspecting Signals
Inspecting Signals
Inspecting Signals
Inspecting Signals
Inspecting Signals
Inspecting Signals
Inspecting Signals
Inspecting Signals
Inspecting Signals
Inspecting Signals
Inspecting Signals
Inspecting Signals
Inspecting Signals
Inspecting Signals
Inspecting Signals
Inspecting Signals
Inspecting Signals
Inspecting Signals
Inspecting Signals
Inspecting Signals
Inspecting Signals
Inspecting Signals
Inspecting Signals
Inspecting Signals
Inspecting Signals
Inspecting Signals
Inspecting Signals
Inspecting Signals
Inspecting Signals
Inspecting Signals
Inspecting Signals
Basic Algorithms
❑ Lecture Overview Review dynamic systems and learn how they relate to Simulink.
what is Simulink? ▪ Dynamic Systems
▪ Course Overview ❑ Discrete Systems
▪ Running Simulations Model discrete-time systems.
❑ Simulink Graphical Environment ▪ Discrete Systems
Learn about Simulink blocks and signals. ❑ Continuous Systems
▪ Blocks and Parameters Model continuous-time systems.
▪ Identifying Blocks and Signals ▪ Continuous Systems
❑ Inspecting Signals ❑ Simulation Time
Visualize signal values during simulation. Choose the simulation duration.
▪ Inspecting Signals ▪ Simulation Time
▪ Simulink Scopes Overview ❑ Project - Modeling a Thermostat
❑ Basic Algorithms Practice your understanding of discrete dynamic systems.
Use math and logic operators to write algorithms. ▪ Project - Thermostat
▪ Mathematical Operators ❑ Project - Peregrine Falcon Dive
▪ Basic Logic Practice your understanding of continuous dynamic systems.
▪ Conditional Statements ▪ Project - Peregrine Falcon Dive
❑ Obtaining Help ❑ Conclusion
Access documentation from Simulink.
▪ Obtaining Help
❑ Project - Automotive Performance Modes
Practice working with math and logic operators.
• Project - Automotive Performance Modes
❑ Simulink and MATLAB
Use MATLAB variables and functions in Simulink.
▪ MATLAB Workspace Variables
▪ MATLAB Function Block
❑ Dynamic Systems in Simulink
Basic Algorithms
Mathematical
Operator
Basic Algorithms
Mathematical
Operator
Basic Algorithms
Mathematical
Operator
Basic Algorithms
Mathematical
Operator
Basic Algorithms
Mathematical
Operator
Basic Algorithms
Mathematical
Operator
Basic Algorithms
Mathematical
Operator
Basic Algorithms
Mathematical
Operator
Basic Algorithms
Mathematical
Operator
Basic Algorithms
Mathematical
Operator
Basic Algorithms
Basic Logic
Basic Algorithms
Basic Logic
Basic Algorithms
Basic Logic
Basic Algorithms
Basic Logic
Basic Algorithms
Basic Logic
Basic Algorithms
Basic Logic
Basic Algorithms
Basic Logic
Basic Algorithms
Basic Logic
Basic Algorithms
Basic Logic
Basic Algorithms
Basic Logic
Basic Algorithms
Conditional
Statements
Basic Algorithms
Conditional
Statements
Basic Algorithms
Conditional
Statements
Basic Algorithms
Conditional
Statements
Basic Algorithms
Conditional
Statements
Basic Algorithms
Conditional
Statements
Basic Algorithms
Conditional
Statements
Basic Algorithms
Conditional
Statements
Basic Algorithms
Conditional
Statements
Obtaining Help
❑ Lecture Overview Review dynamic systems and learn how they relate to Simulink.
what is Simulink? ▪ Dynamic Systems
▪ Course Overview ❑ Discrete Systems
▪ Running Simulations Model discrete-time systems.
❑ Simulink Graphical Environment ▪ Discrete Systems
Learn about Simulink blocks and signals. ❑ Continuous Systems
▪ Blocks and Parameters Model continuous-time systems.
▪ Identifying Blocks and Signals ▪ Continuous Systems
❑ Inspecting Signals ❑ Simulation Time
Visualize signal values during simulation. Choose the simulation duration.
▪ Inspecting Signals ▪ Simulation Time
▪ Simulink Scopes Overview ❑ Project - Modeling a Thermostat
❑ Basic Algorithms Practice your understanding of discrete dynamic systems.
Use math and logic operators to write algorithms. ▪ Project - Thermostat
▪ Mathematical Operators ❑ Project - Peregrine Falcon Dive
▪ Basic Logic Practice your understanding of continuous dynamic systems.
▪ Conditional Statements ▪ Project - Peregrine Falcon Dive
❑ Obtaining Help ❑ Conclusion
Access documentation from Simulink.
▪ Obtaining Help
❑ Project - Automotive Performance Modes
Practice working with math and logic operators.
• Project - Automotive Performance Modes
❑ Simulink and MATLAB
Use MATLAB variables and functions in Simulink.
▪ MATLAB Workspace Variables
▪ MATLAB Function Block
❑ Dynamic Systems in Simulink
Obtaining Help
Obtaining Help
Obtaining Help
Obtaining Help
Obtaining Help
Obtaining Help
Project - Automotive Performance Modes
❑ Lecture Overview Review dynamic systems and learn how they relate to Simulink.
what is Simulink? ▪ Dynamic Systems
▪ Course Overview ❑ Discrete Systems
▪ Running Simulations Model discrete-time systems.
❑ Simulink Graphical Environment ▪ Discrete Systems
Learn about Simulink blocks and signals. ❑ Continuous Systems
▪ Blocks and Parameters Model continuous-time systems.
▪ Identifying Blocks and Signals ▪ Continuous Systems
❑ Inspecting Signals ❑ Simulation Time
Visualize signal values during simulation. Choose the simulation duration.
▪ Inspecting Signals ▪ Simulation Time
▪ Simulink Scopes Overview ❑ Project - Modeling a Thermostat
❑ Basic Algorithms Practice your understanding of discrete dynamic systems.
Use math and logic operators to write algorithms. ▪ Project - Thermostat
▪ Mathematical Operators ❑ Project - Peregrine Falcon Dive
▪ Basic Logic Practice your understanding of continuous dynamic systems.
▪ Conditional Statements ▪ Project - Peregrine Falcon Dive
❑ Obtaining Help ❑ Conclusion
Access documentation from Simulink.
▪ Obtaining Help
❑ Project - Automotive Performance Modes
Practice working with math and logic operators.
• Project - Automotive Performance Modes
❑ Simulink and MATLAB
Use MATLAB variables and functions in Simulink.
▪ MATLAB Workspace Variables
▪ MATLAB Function Block
❑ Dynamic Systems in Simulink
Project - Automotive Performance Modes
Project - Automotive Performance Modes
Project - Automotive Performance Modes
Project - Automotive Performance Modes
Project - Automotive Performance Modes
Project - Automotive Performance Modes
Project - Automotive Performance Modes
Project - Automotive Performance Modes
Project - Automotive Performance Modes
Project - Automotive Performance Modes
The End!
Any Questions