Skip to content
Tutorials Center
My learning

Topics

Lesson 1 of 36 ยท Getting Started

What Is Simulink? Block Diagram Modeling Explained

Learn what Simulink is, how block diagrams describe dynamic systems, what simulation means and why engineers use model-based design for control, signals and embedded code.

Simulink is a graphical environment for modeling, simulating and analyzing dynamic systems: things whose behavior changes over time, such as a car's cruise control, a motor drive, a heater with a thermostat or a flight controller. Instead of writing equations as program text, you draw a block diagram. Each block does one job (add, integrate, filter, compare) and lines carry signals from block to block. Press Run, and Simulink computes what every signal does over a span of time.

Simulink is a commercial product from MathWorks that runs on top of MATLAB. It cannot run on this website. Everything about menus, shortcuts and settings in this tutorial describes the real product, and we never show fabricated screenshots or output. To let you practice the same ideas, every lesson includes clearly labeled stand-ins: small Python programs that you can run here and that work like the Simulink concept they teach.

Why block diagrams?

Many systems are naturally described as flows of signals. A thermostat reads a temperature, compares it with a target, decides to heat or not, and the room reacts. Drawing this as boxes and arrows matches how engineers think and talk, and it makes three things easier:

  • Seeing structure. A glance shows feedback loops, inputs and outputs.
  • Simulating before building. You can test a controller against a model of the plant (the physical system) long before hardware exists.
  • Reusing the model. The same diagram can generate C code, run in real-time tests or be checked against requirements. This is called model-based design.

Anatomy of a model

A Simulink model (a file ending in .slx) consists of:

Part Meaning
Block A function with input ports, output ports and parameters (Gain, Sum, Integrator...)
Line (signal) Carries a value from an output port to an input port
Subsystem A group of blocks packaged as one block
Solver The numerical algorithm that advances time
Configuration Start/stop time, step size, data logging, code generation options

Anatomy of a Simulink model

Blocks Small operations
Signals Lines carry values
Solver Advances time
Scope Shows the result

Draw, run, inspect, repeat.

1 / 2

Time and simulation

Simulink does not run in real time. A simulation has a start time (default 0) and a stop time (default 10 seconds of simulated time). The solver moves a clock forward in steps. At each step every block computes its outputs from its inputs; blocks with memory, such as an integrator, also update their internal state. A one-minute simulated drive might take half a second of wall-clock time, or an hour if the model is huge. Keep the difference between simulated time and wall-clock time in mind from the start.

A diagram is a program

A block diagram is executable: Simulink sorts the blocks into an order in which every block runs after the blocks feeding it, then repeats that order at each time step. You can mimic this idea in a few lines.

Python Stand-in: a tiny block diagram executor (Python)

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The loop is the whole story of a fixed-step simulation: for each time step, evaluate the blocks in sorted order. Real Simulink adds states, variable step sizes, event detection and hundreds of block types.

Time-domain thinking

The output of a model is a set of signals, each a function of time. A signal might be a number per step (scalar), a vector, a matrix or a structured bus. Signals have a data type (double by default, plus single, integers, boolean and fixed-point) and a sample time (continuous, discrete or inherited).

Python Stand-in: simulated time versus wall-clock time

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Simulink also has companion products: Stateflow for state machines, Simscape for physical modeling, Simulink Control Design, Embedded Coder, Simulink Test and more. Some chapters of this tutorial use them. Where a product is optional, we say so.

Automotive (engine, battery and driver-assistance software), aerospace (flight control), power electronics and motor control, medical devices, industrial automation, robotics and communications. Standards such as ISO 26262 and DO-178C are often met with Simulink-based workflows, including generated code and requirement tests.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What does a line between two blocks represent?

    Lines connect an output port to an input port and carry a signal.
  2. 2. What does the default stop time of 10 mean?

    Simulation time is virtual time; the wall-clock duration depends on model size and step size.
  3. 3. Which statement about block diagram execution is correct?

    Simulink computes a sorted execution order from the signal connections.
  4. 4. Why simulate a controller against a plant model?

    Early testing against a model finds design errors cheaply.

Summary

  • Simulink models dynamic systems as executable block diagrams: blocks, signals, subsystems and a solver.
  • Simulated time is not wall-clock time; the default run is 0 to 10 s.
  • Blocks are executed in a sorted order at every time step; blocks with memory keep states.
  • Model-based design reuses one model for simulation, code generation and testing.
  • This site cannot run Simulink, so each lesson uses labeled Python stand-ins.

Next: Your First Model: Interface, Library Browser and Scope