MATLAB and LABView - Chapter 7 PDF
MATLAB and LABView - Chapter 7 PDF
Todd Atkins
[email protected]
1
Outline
What is Simulink?
Componentizing models
4
Simulink Applications
5
Simulink
Simulink is a software package for
modeling, simulating, and analyzing
dynamical systems
• Block diagram editing
• Nonlinear simulation
• Hybrid (continuous and discrete) models
• Asynchronous (non-uniform sampling)
simulation
• Fully integrated with MATLAB, MATLAB
toolboxes and blocksets.
6
Simulink
7
Model Based Design with Simulink
Challenge
To design and build the BA609, the first and fastest
commercially available tiltrotor aircraft in the world
The BA609, flying in airplane mode.
Solution
Use Model-Based Design with MATLAB, Simulink,
and Real-Time Workshop software to model, simulate, "Simulations and a rapid, iterative
test, and verify designs approach enabled us to minimize
Results the unknowns and ensure that we
Full collaboration with suppliers via Simulink models had established enough margin
Flight control system code generated automatically that when we ran into a surprise we
from models could continue to have a safe flight
40% improvement in design and development time test program—and run it with
Flawless first flight, which went exactly like unprecedented efficiency.”
the simulation
David King
Bell Helicopter
Link to technical article
10
Outline
Why Simulink?
Componentizing models
11
Launching Simulink
12
Simulink Library Browser
13
Finding Blocks
14
Getting Help
15
Demo
y = 4 ∗ sin(t ) − 10
Running a simulation
Saving/opening a model
16
Outline
Why Simulink?
Componentizing models
17
How Simulink Works
18
Simulink Solvers
Solver?
– Determines solution at current time step
– Determines the next simulation time step
Why Simulink?
Componentizing models
24
Creating Subsystem
Why?
– Reduce blocks displayed in a model window
– Keep functionally related block together
– Establish hierarchical block diagram
29
Model Referencing
One model in another- parent and referenced
model
Advantages:
– Componentization/Modularization
– IP protection
– Multiple referencing
– Acceleration
30
Block Library
Collection of blocks
Prototype block vs Reference block
Library Links
– Disable link
– Restore link
– Break link
Other features
– Display in Simulink Library Browser
– Add documentation
31
Outline
Why Simulink?
Componentizing models
32
‘Continuous’ Library
33
Continuous systems: Time-Domain
Representation using Integrator Block
x' (t ) = 3x(t ) + u (t )
34
Continuous systems: Frequency-Domain
Representation using Transfer Function Block
X (s ) 1
x' (t ) = 3x(t ) + u (t ) ⇔ = Transfer function:
U (s ) s − 3 sx = 3x + u
x = u/(s-3)
x/u = 1/(s-3)
35
Simulink Demo: Foucault Pendulum
Model with VRML Visualization
sldemo_foucault_vr.mdl
38
Other Demos for Continuous Systems
39
Discrete Systems
System
x[n] y[n]
40
‘Discrete’ Library
41
Discrete system example
x[k ] + ax[k − 2]
y[k ] =
2
42
Summary
Why Simulink?
Componentizing models
48
More on Simulink
Simulink Tutorials
Documentation
49