0% found this document useful (0 votes)
24 views3 pages

Simulink Basics

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views3 pages

Simulink Basics

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

simulink Basics

As you've just seen, Simulink uses graphical


elements to represent the inputs, outputs, and
calculations within a simulation. Signals make
connections between blocks at ports.

The simulated signal is a discrete sine wave.


The "noise" is added by superimposing a
higher frequency sine wave. The noisy signal
is passed through a filter that averages the
signal's current value with its previous value.
A signal is a piece of information, such as a
numeric value, that can change over the You will learn more about how to build
course of a simulation. Blocks accept signals models like these in the Discrete
at input ports, perform an operation, and return Systems chapter.
signals at output ports. Signal lines are visual
elements that connect block ports and show
where a signal flows: from output ports to input
ports, and in the direction of the arrow. You can access documentation for specific
blocks directly from Simulink. In the Block
Parameters dialog (accessed by double-
Inspecting Signals clicking a block), there are two ways to get
Reading the value of a signal is an important help:
aspect of understanding and debugging
simulations. For example, in a coding
environment, you might print values using a 1. The block description is a
statement such as disp, while in an short overview of the basic
electronics lab, you could use an functions of the block.
2. The Help button opens the
oscilloscope to measure an electrical signal
documentation page for that
over time. How can you inspect signals in
block.
Simulink models?

So far, you have visualized signals using


the Signal Assessment blocks. However, You can also access the documentation for
these are unique to the training environment. a block directly by using the right mouse
Simulink has various methods to display button to click the block and
signal values both as text and graphically. In selecting Help from the menu that appears.
the next task, you encounter Both the Help button and the Help item
the Display and Scope blocks, which are from this menu open the documentation
blocks that produce text and visual readouts, page for the block.
respectively.

Low-Pass Filter Example


Using these blocks, you will inspect the
performance of a filter that removes high-
frequency noise to smooth out a signal. The
model you will be working with consists of a
simulated, noisy signal and a filter that
selects low frequencies by taking a moving
average.
Project - Automotive
Performance Package
In this project, you'll simulate the logic for
an automotive performance package.
Vehicles today have dozens of computers
that work together to adjust the car's
behavior in response to data read from
hundreds of sensors. In this simplified
system, assume that you are responding to
two sensors—speed and lateral
acceleration—to decide between a "high
performance" and "economy" mode.
The input u and the output y of the function
are mapped to the input and output,
respectively, of the block. Adding more
inputs or outputs to the function changes
the number of ports on the block:

In order to simulate the sensor data, the


model uses a block that you haven't seen
yet: the Signal Editor block.
You can use the MATLAB Function block to
incorporate existing MATLAB code and to
model complicated algorithms.

Summary - Modeling
Difference Equations
To model difference equations, use this
Don't worry, though, Signal Editor is just procedure. The procedure applies to both
another type of source, like Sine single equations and systems of equations.
Wave or Ramp. You can inspect these
signals by using what you learned
previously, and by adding a Scope to the
model. As an example, consider the set of
equations:
The MATLAB Function Block
In addition to reading and creating x[k]−x[k−1]=u[k]−u[k−1]
MATLAB variables, Simulink can utilize
MATLAB functions. Simulink blocks
perform a specific operation on inputs and
return outputs, which is analogous to u[k]=sin[k]
functions in text-based code. The MATLAB
Function block (Simulink > User-Defined Summary - Modeling
functions) enables you to incorporate a Difference Equations
MATLAB function directly into your model. To model difference equations, use this
procedure. The procedure applies to both
single equations and systems of equations.

As an example, consider the set of


equations:

Double-clicking on the MATLAB


Function block opens a MATLAB Editor: x[k]−x[k−1]=u[k]−u[k−1]
u[k]=sin[k]  My Courses - Print or share a
progress certificate for
Project - Peregrine Falcon Dive Simulink Onramp and explore
other courses available to you.
When diving for prey, the Peregrine falcon Note: Submitting the survey at
the end of the course is
can reach speeds of up to 350 km/h. As the
required for 100% completion.
falcon dives, the two forces acting on it are
 Instructor-led courses - Take
gravity and air drag. The equation of motion an in-person class from an
experienced Simulink
for this is: instructor.

m˙v= ρCdAv2−mg Simulink Resources


12  Get Started with Simulink -
Documentation page
containing tutorials that
continue into more advanced
As it approaches the ground, however, it topics, such as model
hierarchy and design
changes the angle of its wings. This
principles.
increases drag, which rapidly decelerates it
 MathWorks examples -
to a safe landing speed. You can model this Documentation page
containing example models,
process in the equation of motion as a grouped by application.
change in the area Additional Capabilities
 Stateflow Product Page -
A Stateflow is an environment
that you can use within
and drag coefficient Simulink to model logic
systems and state machines.
Cd  Model-Based Design - Learn
about the tools available to
. In this project, you must use Simulink to implement model-based
design in Simulink.
model this behavior in two parts. First, you
model the equation of motion for a given set
of drag parameters. In the second part, you
model the wings opening to slow the bird
down.

Next Steps
Congratulations, you have just built your
first Simulink models! In this course, you
learned how to create mathematical and
logical expressions, as well as how to
model both discrete and continuous
dynamic systems. Simulink is a powerful
modeling environment used across
industries including aerospace, automotive,
signal processing, and wireless
communications.

MathWorks has many resources to help


you continue your learning. Explore the
links on this page for information on related
topics, or to get ideas of how you can use
Simulink in your work.

MathWorks Training

You might also like