Linear System Theory - Introduction to Simulink
Prof. Robert X. GaoElectromechanical Systems LaboratoryDepartment of Mechanical Engineering
ME3253-01
/212
ME3253-01: Prof. Gao
Outline
Block Diagram Introduction Launching Simulink Modeling Procedure System Modeling with Simulink - Example Summary Practice
ME3253-01
/213
ME3253-01: Prof. Gao
Block Diagram
Definition: – A block diagram is an interconnection of blocks representing basic
mathematical operations in such a way that the overall diagram is equivalent to the system’s mathematical model.
Components: – Summer – Addition and subtraction– Gain – Multiplication– Integrator – Integration – Constant – No Input, Output Never Changes
Base: – Input – Output Equation– State – Variable Equations
ME3253-01
/215
ME3253-01: Prof. Gao
Introduction
Definition: – “Simulink is a software package that enables you to model, simulate, and analyze
systems whose outputs change over time. ” - Mathworks
Features: – Model – based Design– Graphical Programming
Icon - Driven Build Systems by Drawing Block Diagrams
Applications:– Aerospace and Defense– Automotive – Communications – Electronics and Signal Processing– Medical Instrumentation– Etc.
Example – Plane Take - Off
ME3253-01
/216
ME3253-01: Prof. Gao
Launching Simulink
Launch MATLAB and Specify Work Directory
Launch SimulinkType “simulink” in command window Click Start Simulink Library Browser
Select Library
Block Description
Select Block
Block Search
ME3253-01
/217
ME3253-01: Prof. Gao
Modeling Procedure
Defining the Problem
Identifying System Components
Modeling System with Equations
Building the Simulink Block Diagrams
Running the Simulation
Validating the Simulation Results
ME3253-01
OUTSIDE SIMULINK
MODELING IN SIMULINK
/218
ME3253-01: Prof. Gao
Example 4.7
A Parachute Jumper and a Mechanical Model
Conditions: – t = 0 as the moment the parachute opens– Risers fully extended, no deformation– Velocity: vj = 20 m/s, vp = 20 m/s– Constant = 9.807 m/s^2
Mass of the Parachute Mp 10 kG
Mass of the Jumper Mj 60 kG
Drag Coefficient of Parachute Bp 100 N/(m/s)
Drag Coefficient of Jumper Bj 10 N/(m/s)
Spring Constant of Riser KR 400 N/m
Values:
ME3253-01
/2110
ME3253-01: Prof. Gao
Equilibrium Equations
Equilibrium Equations
Re – write
( )
( )p p p p R j p p
j j j j R j p j
M x B x K x x M g
M x B x K x x M g
1 [ ( ) ]
1 [ ( ) ]
p p p R j p pp
j j j R j p jj
x B x K x x M gM
x B x K x x M gM
ME3253-01
/2111
ME3253-01: Prof. Gao
Start a New Model
From the Library Browser, File New Model
Launch the Programming Interface
Drag Block Components From Library into This Area
ME3253-01
/2113
ME3253-01: Prof. Gao
Modeling of Parachute
1 [ ( ) ]p p p R j p pp
x B x K x x M gM
px px
px
( )j px x
ME3253-01
/2114
ME3253-01: Prof. Gao
Modeling of Jumper
1 [ ( ) ]j j j R j p jj
x B x K x x M gM
( )j px x
jxjx
jx
Time
ME3253-01
/2115
ME3253-01: Prof. Gao
Output Ports Assignment
Sequence Variable
1 Displacement of Parachute
2 Velocity of Parachute
3 Acceleration of Parachute
4 Displacement of Jumper
5 Velocity of Jumper
6 Acceleration of Jumper
7 Spring Elongation
8 Time
ME3253-01
/2116
ME3253-01: Prof. Gao
Run the Simulation
Script
Run the Script (F5)
% DEMONSTRATION OF EXAMPLE 4.7 PARACHUTE
% 1. Value AssignmentMp = 10; % mass of parachute 10 kGMj = 60; % mass of jumper 60 kGBp = 100; % drag coef. of parachute 100 N/(m/s)Bj = 10; % drag coef. of jumper 10 N/(m/s)KR = 400; % spring constant of riser 400 N/m
% 2. Simulation Executionsim('parachute');
ME3253-01
/2118
ME3253-01: Prof. Gao
Visualization of Result % PLOT THE SIMULATION RESULT
% OUTPUT VARIABLE : yout % TIME OUTPUT: toutfigure; subplot(4,1,1); % 1ST PLOTplot(tout,yout(:,1),'b','LineWidth',3); % PLOT DISP. OF PARACHUTE VS. TIMEhold on;grid on;plot(tout,yout(:,4),'--r','LineWidth',3); % PLOT DISP. OF JUMPER VS. TIMEylabel('meter','FontSize',22); % SET YLABLE set(gca,'FontSize',16); % SET FONT SIZE OF AXES
subplot(4,1,2); % 2ND PLOTplot(tout,yout(:,2),'b','LineWidth',3); % PLOT VELOCITY OF PARACHUTE VS. TIMEhold on;grid on;plot(tout,yout(:,5),'--r','LineWidth',3); % PLOT VELOCITY OF JUMPER VS. TIMEylabel('meter/sec.','FontSize',22); % SET YLABLE set(gca,'FontSize',16); % SET FONT SIZE OF AXES
subplot(4,1,3); % 3RD PLOTplot(tout,yout(:,3),'b','LineWidth',3); % PLOT ACCELERATION OF PARACHUTE VS. TIMEhold on;grid on;plot(tout,yout(:,6),'--r','LineWidth',3); % PLOT ACCELERATION OF JUMPER VS. TIMEylabel('meter/sec.^2','FontSize',22); % SET YLABLE set(gca,'FontSize',16); % SET FONT SIZE OF AXES
subplot(4,1,4); % 4TH PLOTplot(tout,yout(:,7),'k','LineWidth',3); % PLOT ELONGATIONylabel('meter','FontSize',22); % SET YLABLE xlabel('Time/sec.','FontSize',22); % SET XLABLEset(gca,'FontSize',16); % SET FONT SIZE OF AXESgrid on;
ME3253-01
/2119
ME3253-01: Prof. Gao
Plot
0 0.5 1 1.5 2 2.5 3 3.5 40
20
40
met
er
0 0.5 1 1.5 2 2.5 3 3.5 40
10
20
30
met
er/s
ec.
0 0.5 1 1.5 2 2.5 3 3.5 4-200
-100
0
100
met
er/s
ec.2
0 0.5 1 1.5 2 2.5 3 3.5 40
2
4
met
er/s
ec.2
Time/sec.
Elongation
ParachuteJumper
ME3253-01
/2120
ME3253-01: Prof. Gao
Summary
Introduction to Block Diagram
Introduction to Simulink
Demonstration of Model – based Design
Demonstration of Simulink Operation
ME3253-01