Getting Started with SimulinkOverview of MATLAB Modeling/ Simulation gEnvironmentOrientation 2008 | Jamie Cassels, QC, Vice-President Academic and Pro
Complex System Model from Basic Building Blockspy gVehicle and ControlVehicle and Control
Simulink Library (blocks)Simulink Library (blocks)
Key Multiphysics Modeling ToolboxKey Multiphysics Modeling Toolbox Stateflow™Design and simulatestate machinesandStateflowDesign and simulate state ma
Modeling Dynamic Systems in SimulinkModeling Dynamic Systems in SimulinkModeling Dynamic Systems in SimulinkModeling Dynamic Systems in SimulinkModeli
SimDriveline™ModelSimDriveline Model
Simulink Online HelpSimulink Online HelpSimulink Getting Started GuideSimulink Getting Started Guide Simulink User’s Guide Simulink Reference Wri
Getting started with SimulinkAn introductory tutorialAn introductory tutorialES205 Analysis and Design of Engineering SystemsES205 Analysis and Design
Launch SimulinkIn the MATLAB command window,at the >> prompt, typesimulinkat the >> prompt, type simulinkand press Enter
MATLAB/Simulink ApplicationsMATLAB/Simulink ApplicationsMechanical SystemMechanical System AutomotiveControlsControls RoboticsAerospace and Def
Create a new model Click the new-model icon in the upper left corner to start a new Simulink file Select the Simulink icon to obtain elements of the
Your workspaceLibrary of elements Model is created in this window
Save your model You might create a new folder, like the one shown below, called simulink_files Use the .mdl suffix when saving
Example 1: a simple model Build a Simulink model that solves the differential equation qInitial conditiontx 2sin31)0(xInitial condition First,
Simulation diagram Input is the forcing function 3sin(2t)Output is the solution of the differentialOutput is the solution of the differential equati
Select an input blockDrag a Sine Waveblock from the Sourceslibrary to the model window
Select an operator blockDrag an Integratorblock from the Continuouslibrary yto the model window
Select an output blockDrag a Scopeblock from the Sinkslibrary to the modelSinkslibrary to the model window
Connect blocks with signals Place your cursor on the output port (>) of pp ()the Sine Waveblock Drag from the Sine Waveoutput to the Integratorin
Select simulation parametersDouble-click on theSine Wavethe Sine Waveblock to set amplitude = 3 and freq = 2.This p od ces theThis produces the desire
Model-Based DesignModelBased Design Faster, more cost-effective development of dynamic systems (e.g. control systems, vehicles, etc.) A system mode
Select simulation parametersDouble-click on theIntegratorthe Integratorblock to set initial condition = -1.This sets our IC x(0) = -1.
Select simulation parametersDouble-click on theScopeto viewthe Scopeto view the simulation results
Run the simulationIn the model window from thewindow, from the Simulationpull-down menu, ,select StartView the output x(t) in the Scopewindowwindow.
Simulation resultsTo verify that this plot represents the ppsolution to the problem, solve the equation analyticallyequation analytically. The analyti
Example 2 Build a Simulink model that solves the following differential equation (ODE)gq() 2nd-order mass-spring-damper systemzero ICszero ICs in
Create the simulation diagram On the following slides:The simulation diagram for solving theThe simulation diagram for solving the ODE is created
(continue) First, solve for the term with highest-order derivativeMake the lefthand side of this equationkxxctfxm)(Make the left-hand side of
Drag a Sumblock from the MathlibraryteatbayDouble-click to change the block parameters to rectangularand+rectangularand + --
(continue) Add a gain (multiplier) block to eliminate the coefficient and produce pthe highest-derivative alonexmm1xsumming block
Drag a Gainblock from the MathlibraryteatbayThe gain is 4 since 1/m=4.Double-click to change the block parameters.Add a titleAdd a title.
MATLAB Codes – Simulink Block & Block Parameters
(continue) Add integrators to obtain the desired output variablepxm11 1xxxmsumming blockssblock
Drag Integratorblocks from theContinuouslibrarythe ContinuouslibraryInitial Conditions (ICs) on the integrators are zero.Add a scope from the Sinkslib
(continue) Connect to the integrated signals with gain blocks to create the terms on the right-hand side of the EOMxm111xxxxmm1summings1s1xxxxc
Drag new Gainblocks from the MathlibraryoteatbayTo flip the gain block, select it and chooseFlip Blockin theand choose Flip Blockin the Formatpull-dow
Complete the model Bring all the signals and inputs to the summing block. Check signs on the summer.xmm1s1s1xxf(t)input+--xx(t)outputcxck-xou
Double-click on Stepblock to set parameters For ato set parameters. For a step input of magnitude 3, set Final valueto 3
Final Simulink model
Run the simulation
ResultsUnderdamped response.Overshoot of 0.5.Final value of 3 (gain = 1).(g )Is this expected?System design – adjust m, c, kvalues to get different sy
Paperandpencil analysisPaper-and-pencil analysis based on the equations of motion Standard form)(1tfkxxkcmkx Nat’l freq.0.2mkn Damping rat
Modeling ProcessModeling ProcessOn Paper:On Paper:1 Defining the System2 Identifying System Components2 Identifying System Components3 Modeling the Sy
Check simulation results Damping ratio of 0.5 is less than 1. Expect the system to be underdamped.py p Expect to see overshoot.Static gain is 1.St
The leading environment forThe leading environment fortechnical computing• The de facto industry-standard,fyhigh-level programming language for algori
The leading environment for system-levelmodeling, simulation, and verification ofcommunications and electronic systems• Multidomain system-level desig
From Research to Development and TestFrom Research to Development and TestFrom Research to Development and TestFrom Research to Development and TestSY
Graphical Layout of Functional ModulesGraphical Layout of Functional Modules
Kommentare zu diesen Handbüchern