Академический Документы
Профессиональный Документы
Культура Документы
SIMULINK Basics
Simulink Basics Content Whats SIMULINK? SIMULINKLibraries Sources, Sinks und Math Simulation parameters Algorithms for numerical integration SIMULINKLibraries Signals&Systems, Subsystems
SIMULINK Basics Whats Simulink? Graphical modelling of dynamic systems by signal ow graphs Addition to MATLAB (Toolbox) SimulinkAdditions: Blocksets (SimPower-Systems, SimMechanics)
Sine Wave
1 Gain
Product3
1 Gain1
Mux
gedaempfte Sinusschwingung
SIMULINK Basics SIMULINK block libraries Sources and Sinks Block library Sources:
Generation of signals Import data from MATLAB workspace Import of data from les
untitled.mat
1 Constant
Step
From File
1 In1
simin From Workspace
Ramp
Signal 1
Signal 2
1 s Integrator
Scope
Signal Builder
Signal Builder : bsp sigbuild.mdl Signal Builder Dialog box for group of three signals
SIMULINK Basics SIMULINK block library Math Opertions Block library Math: Arithmetic, logical and relational operators Mathematical and trigonometric functions
etc.
1 eu Product Sum sin Dot Product Trigonometric Function K*u Matrix Gain Relational Operator Math Function Gain 1 Slider Gain AND Logical Operator <=
Sine Wave
1 Gain
Product3
1 Gain1
Mux
gedaempfte Sinusschwingung
SIMULINK Basics Simulation: parameters and solvers Conguration Parameters dialog box
Solver pane: Specify start and stop time of simulation Solvers for numerical integration Output options
Matlab/Simulink Dipl.-Ing. U. Wohlfarth
SIMULINK Basics Numerical integration of ODE Inhomogeneous linear ordinary dierential equation:
u(t) DGL y(t)
yn+1 = yn +
tn
f (u(t), y (t))dt
y1 = y0 + h y 0
Matlab/Simulink Dipl.-Ing. U. Wohlfarth
10
2h P )] y2 = y0 + [y 0 + 4y 1 + f (u2, y2 6
Matlab/Simulink Dipl.-Ing. U. Wohlfarth
11
12
SIMULINK Basics Solver: integration algorithms in MATLAB Variablestep solver: use variable step size allow error control & detection of zero crossings for continuous-time, non-sti systems: ode45 (rst try), ode23, ode113 for continuous-time, sti systems: ode15s, ode23s, ode23t,ode23tb for discrete-time systems: discrete (Variablestep)
Matlab/Simulink Dipl.-Ing. U. Wohlfarth
13
SIMULINK Basics Solver: integration algorithms in MATLAB Fixedstep solver: use xed step size no error control no detection of zero crossings for continuous-time systems: ode5, ode4, ode3, ode2, ode1 for discrete-time systems: discrete (Fixedstep)
Matlab/Simulink Dipl.-Ing. U. Wohlfarth
17
SIMULINK Basics Simulation: parameters and solver methods Conguration Parameters dialog box
Data Import/Export pane: Initialization Load data from Workspace Write data to Workspace
Matlab/Simulink Dipl.-Ing. U. Wohlfarth
18
SIMULINK Basics Simulation: parameters and solver methods Conguration Parameters dialog box
Diagnostics pane: Control of warning and error messages Set simulation options
Matlab/Simulink Dipl.-Ing. U. Wohlfarth
19
SIMULINK Basics Simulation Start and stop of simulation from SIMULINK window from MATLAB Command Window
set_param(sys, SimulationCommand, cmd) get_param(sys, SimulationStatus) [t,x,y] = sim(model, timespan, options, ut) options = simset(property, value, ...) newopts = simset(oldopts, property, value, ...) struct = simget(model)
Example:
[t,x,y] = sim(m1,[],simset(simget(m1),Solver,ode23,MaxStep,0.01))
Matlab/Simulink Dipl.-Ing. U. Wohlfarth
20
upper part: error information lower part: complete text of error message
23
SIMULINK Basics SIMULINK block library Signal Routing Block library Signal Routing:
Date saving
A Data Store Memory A Data Store Read A Data Store Write
24
SIMULINK Basics Subsystems Subsystems: Structural order of complex models Combining blocks of similar function hierarchic structuring Creation by 1. menue item Edit/Create Subsystem 2. block library Subsystems
25
In1
Out1
In1
Out1
In1
Out1
Subsystem
Atomic Subsystem
function() In1 Out1 In1
Triggered Subsystem
In1
If Action Subsystem
if(u1 > 0)
u1 else
FunctionCall Subsystem
If Enabled Subsystem
etc.
Matlab/Simulink Dipl.-Ing. U. Wohlfarth
26
SIMULINK Basics Conditionally executed subsystems / Masking Conditionally Executed Subsystems Execution controlled by control signal comprise Enable or Trigger Masking of subsystems building a new block from a subsystem easier parametrization of complex subsystems Setting up of user dened libraries
Matlab/Simulink Dipl.-Ing. U. Wohlfarth
27
m Steigung
b yAchsenabschnitt
y=mx+b
28