Escolar Documentos
Profissional Documentos
Cultura Documentos
Simulink
7.1 Simulink
7.1
7.1 Simulink
(2)
FileNewModeluntitled
7.2 Simulink
(5) SinksScope()untitled
(6) untitledSine WaveScope
7.3
(7) untitled
SimulinkStart Scope
7.4
(8)
Ex0701.mdl
7.3 Simulink
7.4
7.2 Simulink
7.2.1 Simulink
1.
MATLAB FileNewModel
7.1 Simulink FileNewModel
7.3 Simulink FileNewModel
2.
MATLAB Ex0701
MATLAB FileOpen
7.2.2 Simulink
.mdl
7.5
1.
2.
7.6
exe
7.6
3.
Simulink 7.1
7.1
File
Edit
View
Simulation
Format
Tools
NewModel
Model properties
Preferences
Print
Close
Exit MATLAB
Create subsystem
Mask subsystem
Look under mask
Update diagram
Go to parent
Model browser options
Block data tips options
Library browser
Fit system to view
Normal
StartStop
PauseContinue
Simulation Parameters
Normal
Accelerator
Text alignment
Filp name
ShowHide name
Filp block
Rotate Block
Library link display
ShowHide drop shadow
Sample time colors
Wide nonscalar lines
Signal dimensions
Port data types
Storage class
Data explorer
Simulink debugger
Data class designer
Linear Analysis
SIMULINK
Simulink
MATLAB
(100%)
Simulink
Simulink
Simulink
7.3
7.3.1
1.
Shift
7.7
7.7
EditSelect all
2.
(1) ()
CopyPaste
CopyPaste
(2) ( 7.8 )
Ctrl
CopyPaste
7.8
3.
Shift
4.
Delete EditClearCutCut
5.
6.
180
FormatFlip Block 180 7.9 180
90
FormatRotateBlock 90 7.9
7.9
7.
FormatFont
FormatHide /Show name
FormatFlip name
7.3.2
1.
2.
(1)
Ctrl
7.10
(2)
7.10
Shift 7.11
7.11
3. (label)
Ctrl
4.
7.3.3
(1)
(2)
7.4 Simulink
7.4.1
Simulink 9
1.
(Sources)
7.2
7.2
Constant
Step
Ramp
Sine Wave
Signal Generator
From File
From Workspace
Clock
In
2. (Sinks)
7.3
7.3
Scope
Display
XY Graph
X-Y
To File
To Workspace
Stop Simulation
Out
3. (Continuous)
7.4
7.4
Integrator
Derivative
State-Space
Transfer Fcn
Zero-Pole
Transport Delay
4. (Discrete)
7.5
7.5
Discrete Zero-Pole
Discrete State-Space
Discrete Filter
Zero-Order Hold
First-Order Hold
Unit Delay
7.4.2
1.
(1) (Sine Wave)
7.13
7.13
time
(2) (Step)
7.14
Step time
7.2 t y
t=0:0.1:10;
7.13
7.14
y=sin(t);
t=t';
y=y';
From Workspace 7.15(a)Data[t,y]OK 7.15(b)
7.15 (a)
(b)
DataFrom WorkspaceData+1
t=0:0.1:2*pi;
y=sin(t);
y1=[t;y];
save Ex0702 y1
%Ex0702.mat
7.2.mat
t=0:0.1:2*pi;
y=sin(t);
y1=[t;y];
save Ex0702 y1
%Ex0702.mat
Denominator[1 1.414 1]
7.18
7.18
7.17
7.19
(6) (Scope)
X-Y
7.19
2.
7.22
7.22
(1) (Description)
(2) (Priority)
(3) (Tag)
7.23
7.5
Simulink
7.5.1
SimulationSimulation parameters 7.24
1. Solver
7.24 Solver
(1)
(Start time)
(Stop time)
(2)
Solve options
(3)
Type
(4)
(Output options)
2. Workspace I/O()
7.25 Simulink
Time
7.5.2
7.3
1
2
s + 0.6s
7.26 Sum
(4)
7.27
7.27
(5)
Start simulation
Simulink SimulationSimulation parametersSolverStop time 15Start simulation
15
Y Y Y-min 0Y-max 2Title 7.28
7.28
GainGain-1 7.29
7.29
Sinks Out
toutyout 7.30
plot(tout,yout)
7.30 plot
7.5.3
7.4
(4) 7.31
7.31
T=Tk=0.1
(b) y(t)
(b) y(t)
(b) y(t)
T=Tk=0.6
7.5.4
7.35
Ex0705_1.m
% Ex0705_1
T=0.1;
Tk=0.6;
k=0.03;
%Gain
zt1=1.44;zt2=-1.26;zt3=1;zt4=-1;
tf11=6.7;tf12=0.1;tf13=1;
tf21=1;tf22=3;tf23=1
MATLAB
Ex0705_1
7.6
7.6.1
1.
7.6 7.4
EditCreate subsystem 7.36
Subsystem 7.37 In1
7.36
Out1
2.
7.7 7.6 7.6
7.36 Subsystem 7.37
7.38
7.37
7.38
7.39
7.39
7.6.2
1. (Enabled Subsystem)
(b) Out1
7.8
Sine waveScopeEnabled Subsystem
Sine waveEnabled Subsystem 7.42(a)
Enabled Subsystem 7.42(b)
2. (Triggered Subsystem)
7.9
7.43 (a)
(b)
7.42 (a)
(b)
7.6.3
1.
(1)
(2) EditMask subsystem
(3) IconParametersInitializationDocumentation
2.
Icon
Icon 7.44
7.44 Icon
3. Parameters
Parameters 7.45
7.45 Parameters
(1) Add
Delete
Move up
Move down
Evaluate
7.6 Assignment
on
off
type
Edit
Checkbox
1 0
on off
Popup
6.
ApplyUnmask
7.10
zeta wn
(1) zeta wn 7.46
(2) EditCreate Subsystem 7.47
7.46
7.47
Parameters Add
PrompttypePopupedit
(b) Initialization
Documentation 7.48(c)
7.48(c) Documentation
OK 7.49(a) 7.49(b)
zeta wn
7.49 (a)
(b)
new_system(newmodel,option)
newmodeloption LibraryModelModel
(2)
open_system Simulink
open_system(model)
model
(3)
save_system .mdl
save_system(model,)
model
7.11 MATLAB
new_system('Ex0711model')
open_system('Ex0711model')
save_system('Ex0711model','Ex0711')
2.
(1)
add_block
add_block(, 1, 1 2, 2,)
Simulink built-in/Sine Wave
(2)
add_line
add_line(,/, /)
add_line( ,m)
m
7.11 MATLAB
add_block('built-in/Step','Ex0711/Step','position',[20,100,40,120])
add_block('built-in/Sum','Ex0711/Sum','position',[60,100,80,120])
% Sum
add_block('built-in/Transfer Fcn','Ex0711/Fcn1','position',[120,90,200,130])
%
add_block('built-in/Scope','Ex0711/Scope','position',[240,100,260,120]) %
add_line('Ex0711','Step/1','Sum/1')
add_line('Ex0711','Sum/1','Fcn1/1')
add_line('Ex0711','Fcn1/1','Scope/1')
add_line('Ex0711','Fcn1/1','Sum/2')
'position''Ex0711'
7.50
7.50
3.
(1)
7.11
f1=simget('Ex0711')
f1 =
AbsTol: 'auto'
Debug: 'off'
Decimation: 1
DstWorkspace: 'current'
FinalStateName: ''
FixedStep: 'auto'
InitialState: []
InitialStep: 'auto'
MaxOrder: 5
SaveFormat: 'Array'
MaxDataPoints: 1000
%
%
% 1 1
%
%
%
%
%
%
%
%
MaxStep: 'auto'
MinStep: []
OutputPoints: 'all'
OutputVariables: 'ty'
%
%
Refine: 1
RelTol: 0.0010
Solver: 'ode45'
SrcWorkspace: 'base'
Trace: ''
ZeroCross: 'on'
(2)
(3)
7.11 7.3
set_param('Ex0711','StopTime','15')
set_param('Ex0711/Step','time','0')
set_param('Ex0711/Sum','Inputs','+-')
% Sum
7.51
7.51
4.
(1)
delete_block('Ex0711/Scope')
(2)
[t,x,y]=sim(model,timespan,options,ut)
[t,x,y1,y2,]=sim(model,timespan,options,ut)%
modeltimespan [t0,tf][]
options ut t x y timespan options
ut
7.11 7.50
[t,x,y]=sim('Ex0711',[0,15]);
plot(t,x(:,2))
7.50
7.8 Simulink
Simulink 7.1 (Block and Toolboxes)