Simulink users guide

516 1.1K 0
Simulink users guide

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

using_simulink_book_2.1 : Simulink.title Page Thursday, May 22, 1997 2:24 PM SIMULINK  Dynamic System Simulation for MATLAB Modeling Simulation Implementation User’s Guide Version 2.1 using_simulink_book_2.1 : noticepage Page Thursday, May 22, 1997 2:24 PM How to Contact The MathWorks: ☎ 508-647-7000 Phone 508-647-7001 Fax The MathWorks, Inc 24 Prime Park Way Natick, MA 01760-1500 Mail http://www.mathworks.com Web Anonymous FTP server Newsgroup FAX ✉ ftp.mathworks.com comp.soft-sys.matlab @ support@mathworks.com suggest@mathworks.com bugs@mathworks.com doc@mathworks.com subscribe@mathworks.com service@mathworks.com info@mathworks.com Technical support Product enhancement suggestions Bug reports Documentation error reports Subscribing user registration Order status, license renewals, passcodes Sales, pricing, and general information Simulink User’s Guide  COPYRIGHT 1984 - 1997 by The MathWorks, Inc All Rights Reserved The software described in this document is furnished under a license agreement The software may be used or copied only under the terms of the license agreement No part of this manual may be photocopied or reproduced in any form without prior written consent from The MathWorks, Inc U.S GOVERNMENT: If Licensee is acquiring the software on behalf of any unit or agency of the U S Government, the following shall apply: (a) for units of the Department of Defense: RESTRICTED RIGHTS LEGEND: Use, duplication, or disclosure by the Government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Software Clause at DFARS 252.227-7013 (b) for any other unit or agency: NOTICE - Notwithstanding any other lease or license agreement that may pertain to, or accompany the delivery of, the computer software and accompanying documentation, the rights of the Government regarding its use, reproduction and disclosure are as set forth in Clause 52.227-19(c)(2) of the FAR Contractor/manufacturer is The MathWorks Inc., 24 Prime Park Way, Natick, MA 01760-1500 MATLAB, Simulink, Handle Graphics, and Real-Time Workshop are registered trademarks and Stateflow and Target Language Compiler are trademarks of The MathWorks, Inc Other product or brand names are trademarks or registered trademarks of their respective holders Printing History: March 1992 First printing May 1997 Revised for 2.1 (online version) Reprints - December 1993, November 1994, June 1995, July 1996 using_simulink_book_2.1 : using_simulink_book_2.1TOC Page i Thursday, May 22, 1997 2:24 PM Contents Getting Started To the Reader 1-2 What Is Simulink? 1-2 How to Use This Manual 1-3 Professional Application Toolboxes 1-5 The Simulink Real-Time Workshop 1-10 Key Features 1-10 The Real-Time Workshop Ada Extension 1-12 Key Features 1-12 Blocksets The DSP Blockset The Fixed-Point Blockset The Nonlinear Control Design Blockset 1-14 1-14 1-14 1-15 Quick Start Running a Demo Model Description of the Demo Some Things to Try What This Demo Illustrates Other Useful Demos 2-2 2-3 2-4 2-4 2-5 i using_simulink_book_2.1 : using_simulink_book_2.1TOC Page ii Thursday, May 22, 1997 2:24 PM Building a Simple Model 2-6 Creating a Model Starting Simulink Simulink Windows Creating a New Model Editing an Existing Model Undoing a Command 3-2 3-3 3-3 3-3 3-3 Selecting Objects 3-4 Selecting One Object 3-4 Selecting More than One Object 3-4 Blocks 3-6 Copying and Moving Blocks from One Window to Another 3-6 Moving Blocks in a Model 3-7 Duplicating Blocks in a Model 3-7 Specifying Block Parameters 3-7 Deleting Blocks 3-8 Changing the Orientation of Blocks 3-8 Resizing Blocks 3-9 Manipulating Block Names 3-9 Disconnecting Blocks 3-10 Vector Input and Output 3-11 Scalar Expansion of Inputs and Parameters 3-11 Using Drop Shadows 3-12 Libraries Terminology Creating a Library Modifying a Library Copying a Library Block into a Model Updating a Linked Block Breaking a Link to a Library Block Finding the Library Block for a Reference Block ii Contents 3-13 3-13 3-13 3-14 3-14 3-15 3-15 3-16 using_simulink_book_2.1 : using_simulink_book_2.1TOC Page iii Thursday, May 22, 1997 2:24 PM Getting Information About Library Blocks 3-16 Lines Drawing a Line Between Blocks Drawing a Branch Line Drawing a Line Segment Displaying Line Widths 3-17 3-17 3-18 3-18 3-21 Signal Labels 3-22 Using Signal Labels 3-22 Signal Label Propagation 3-23 Annotations 3-24 Summary of Mouse and Keyboard Actions 3-25 Creating Subsystems Creating a Subsystem by Adding the Subsystem Block Creating a Subsystem by Grouping Existing Blocks Labeling Subsystem Ports Using Callback Routines 3-27 3-28 3-28 3-29 3-30 Tips for Building Models 3-33 Modeling Equations 3-34 Converting Celsius to Fahrenheit 3-34 Modeling a Simple Continuous System 3-35 Saving a Model 3-38 Printing a Block Diagram 3-39 Print Dialog Box 3-39 Print Command 3-40 The Model Browser 3-42 Contents of the Browser Window 3-42 Interpreting List Contents 3-43 iii using_simulink_book_2.1 : using_simulink_book_2.1TOC Page iv Thursday, May 22, 1997 2:24 PM Ending a Simulink Session 3-45 Running a Simulation Introduction 4-2 Using Menu Commands 4-2 Running a Simulation from the Command Line 4-3 Running a Simulation Using Menu Commands Setting Simulation Parameters and Choosing the Solver Applying the Simulation Parameters Starting the Simulation 4-4 4-4 4-4 4-4 The Simulation Parameters Dialog Box 4-6 The Solver Page 4-6 The Workspace I/O Page 4-14 The Diagnostics Page 4-17 Improving Simulation Performance and Accuracy 4-19 Speeding Up the Simulation 4-19 Improving Simulation Accuracy 4-20 Running a Simulation from the Command Line 4-21 Using the sim Command 4-21 Using the set_param Command 4-21 Analyzing Simulation Results Viewing Output Trajectories Using the Scope Block Using Return Variables Using the To Workspace Block iv Contents 5-2 5-2 5-2 5-3 using_simulink_book_2.1 : using_simulink_book_2.1TOC Page v Thursday, May 22, 1997 2:24 PM Linearization 5-4 Equilibrium Point Determination (trim) 5-7 Using Masks to Customize Blocks Introduction 6-2 A Sample Masked Subsystem Creating Mask Dialog Box Prompts Creating the Block Description and Help Text Creating the Block Icon Summary 6-3 6-4 6-6 6-6 6-8 The Mask Editor (An Overview) 6-9 The Initialization Page Prompts and Associated Variables Control Types Default Values for Masked Block Parameters Initialization Commands 6-10 6-10 6-12 6-14 6-14 The Icon Page Displaying Text on the Block Icon Displaying Graphics on the Block Icon Displaying a Transfer Function on the Block Icon Controlling Icon Properties 6-17 6-17 6-18 6-19 6-20 The Documentation Page The Mask Type Field The Block Description Field The Mask Help Text Field 6-24 6-24 6-24 6-25 v using_simulink_book_2.1 : using_simulink_book_2.1TOC Page vi Thursday, May 22, 1997 2:24 PM Conditionally Executed Subsystems Introduction 7-2 Enabled Subsystems 7-3 Creating an Enabled Subsystem 7-3 Blocks an Enabled Subsystem Can Contain 7-5 Triggered Subsystems 7-8 Creating a Triggered Subsystem 7-9 Function-Call Subsystems 7-10 Blocks a Triggered Subsystem Can Contain 7-10 Triggered and Enabled Subsystems 7-11 Creating a Triggered and Enabled Subsystem 7-11 A Sample Triggered and Enabled Subsystem 7-12 S-Functions Introduction 8-2 What Is an S-Function? 8-2 When To Use an S-Function 8-4 How S-Functions Work 8-4 S-Function Concepts 8-8 Sample S-Functions 8-10 Writing S-Functions as M-Files Defining S-Function Block Characteristics A Simple M-File S-Function Example Examples of M-File S-Functions Passing Additional Parameters 8-11 8-11 8-12 8-15 8-25 Writing S-Functions as C MEX-Files 8-26 Statements Required at the Top of the File 8-27 Statements Required at the Bottom of the File 8-27 vi Contents using_simulink_book_2.1 : using_simulink_book_2.1TOC Page vii Thursday, May 22, 1997 2:24 PM Defining S-Function Block Characteristics A Simple C MEX-File Example Examples of C MEX-File S-Function Blocks Creating General Purpose S-Function Blocks Specifying Parameter Values Interactively Output and Work Vector Widths Removing Ports When No Inputs and/or Outputs Using Function-Call Subsystems Instantaneous Update of S-Function Inputs Exception Handling Error Handling Normal or Real-Time Workshop Simulation Additional Macros in mdlInitializeSizes 8-28 8-29 8-32 8-42 8-43 8-51 8-51 8-51 8-53 8-53 8-54 8-54 8-54 Block Reference What Each Block Reference Page Contains 9-2 The Simulink Block Libraries 9-3 Additional Topics 10 How Simulink Works Zero Crossings Algebraic Loops Invariant Constants Discrete-Time Systems Discrete Blocks Sample Time Purely Discrete Systems Multirate Systems 10-2 10-3 10-7 10-9 10-11 10-11 10-11 10-11 10-12 vii using_simulink_book_2.1 : using_simulink_book_2.1TOC Page viii Thursday, May 22, 1997 2:24 PM Sample Time Colors 10-13 Mixed Continuous and Discrete Systems 10-15 Model Construction Commands 11 Introduction 11-2 How to Specify Parameters for the Commands 11-3 How to Specify a Path for a Simulink Object 11-3 Model and Block Parameters A Introduction A-2 Model Parameters A-3 Common Block Parameters A-7 Block-Specific Parameters A-10 Mask Parameters A-23 Model File Format B Model File Contents The Model Section The BlockDefaults Section The AnnotationDefaults Section The System Section viii Contents B-2 B-3 B-3 B-3 B-3 using_simulink_book_2.1 : using_simulink_book_2.1IX Page Thursday, May 22, 1997 2:24 PM Index eigenvalues of linearized matrix 5-10 either trigger type 7-9 Elementary Math block algebraic loops 10-7 Enable block 9-60 creating enabled subsystems 7-3 outputting enable signal 7-5 states when enabling 7-5 enabled subsystems 7-2, 7-3, 9-60 initializing states in S-function 8-47 setting states 7-4 ending Simulink session 3-45 EPS file, printing to 3-41 equations, modeling 3-34 equilibrium point 5-13 equilibrium point determination 5-7 error message, parameter undefined 6-20 error tolerance 4-11 simulation accuracy 4-20 simulation speed 4-19 Euler’s method 4-10 eval command and masked block help 6-25 Evaluate Assignment type 6-10 examples Clock block 5-3 continuous state S-function 8-15, 8-32 continuous system 3-35 converting Celsius to Fahrenheit 3-34 discrete state S-function 8-18, 8-35 equilibrium point determination 5-7 hybrid system S-function 8-20, 8-37 initial conditions vector, defining 8-48 linearization 5-4 masking 6-3 multirate discrete model 10-12 pointer work vector 8-49 return variables 5-2 I-6 sample time for continuous block 8-46 sample time for hybrid block 8-47 Scope block 5-2 To Workspace block 5-3 Transfer Function block 3-36 variable step S-function 8-23, 8-40 Exit MATLAB menu item 2-13, 3-45 Expand All menu item 3-43 Expand Library Links menu item 3-43 expressions, applying to block inputs 9-61, 9-94 external inputs 4-23 external inputs, from workspace 9-79, 9-80 extracting linear models 5-4, 5-9 Extras block library 9-3 F falling trigger 7-8, 7-9 Fcn block 9-61 compared to Math Function block 9-93 compared to Rounding Function block 9-119 compared to Trigonometric Function block 9-157 simulation speed 4-19 file reading from 9-66 writing to 4-5, 9-146 final states, saving 4-15 Financial Toolbox 1-6 find_system command 11-12 finding library block 3-16 finding objects 11-12 Finite Impulse Response filter 9-37 finite-state machines, implementing 9-20 First-Order Hold block 9-63 compared to Zero-Order Hold block 9-63 fixed icon rotation 6-21 using_simulink_book_2.1 : using_simulink_book_2.1IX Page Thursday, May 22, 1997 2:24 PM Index fixed step size 4-10, 4-25 Fixed-Point Blockset 1-14 fixed-step solvers 4-7, 4-9 flag parameter 8-6 Flip Block menu item 3-8, 3-35 Flip Name menu item 3-10 flip-flops, implementing 9-20 floating Display block 4-2, 9-57 floating Scope block 4-2, 9-122 fohdemo demo 9-63 font annotations 3-24 block icons 3-10 block names 3-10 signal labels 3-23 Font menu item 3-10, 3-23 Forward Euler method 9-42 Forward Rectangular method 9-42 fprintf command 6-17 Frequency-Domain System Identification Toolbox 1-6 From block 9-64 From File block 9-66 From Workspace block 9-68 fundamental sample time 4-8 Fuzzy Logic Toolbox 1-6 G Gain block 9-70 and algebraic loops 10-7 gain, varying during simulation 9-136 Gaussian number generator 9-111 gcb command 11-14 gcbh command 11-15 gcs command 11-16 get_param command 11-17 checking simulation status 4-21 global Goto tag visibility 9-64, 9-71 Go To Library Link menu item 3-16 Goto block 9-71 Goto Tag Visibility block 9-73 graphics on masked block icons 6-18 Ground block 9-74 grouping blocks 3-27 H handle of current block 11-15 handles on selected object 3-4 hardstop demo 9-75 held output of enabled subsystem 7-4 held states of enabled subsystem 7-5 Help button on Mask Editor 6-9 help text for masked blocks 6-6, 6-25 Heun’s method 4-10 Hide Name menu item 3-10, 3-29, 9-103 Hide Port Labels menu item 3-29 hiding block names 3-10 hierarchy of model 3-33, 10-2 Higher-Order Spectral Analysis Toolbox 1-7 Hit Crossing block 9-75 zero crossing detection 4-18 zero crossings 10-4, 10-6 hybrid block, setting sample time 8-47 hybrid system S-function, example 8-20, 8-37 hybrid systems integrating 10-15 linearization 5-10 simulating 10-11 I IC block 9-77 I-7 using_simulink_book_2.1 : using_simulink_book_2.1IX Page Thursday, May 22, 1997 2:24 PM Index icon frame mask property 6-21 Icon page of Mask Editor 6-9 icon rotation mask property 6-21 icon transparency mask property 6-21 icons creating for masked blocks 6-6, 6-17 graphics on 6-18 text on 6-17 transfer functions on 6-19 Image Processing Toolbox 1-7 improved Euler formula 4-10 inf values in mask plotting commands 6-19 Infinite Impulse Response filter 9-37 inherited sample times 8-9 InitFcn block callback parameter 3-31 initial conditions defining vector, example 8-48 determining 4-16 order of states 8-48 setting 9-77 S-Function block 8-47 S-functions 8-56 specifying 4-15 initial states 4-25 initial step size 4-10, 4-11, 4-25 simulation accuracy 4-20 initialization commands 6-14 debugging 6-16 Initialization page of Mask Editor 6-9 Inport block 9-78 in subsystem 3-28, 3-29, 9-141 linearization 5-4 linmod function 5-9 supplying input to model 4-14 input ports, unconnected 9-74 inputs adding 9-142 I-8 applying expressions to 9-61 applying MATLAB function to 9-61, 9-94 choosing between 9-99 combining into vector line 9-101 constraining 9-10 delaying and holding 9-159 delaying by specified time 9-164 delaying by variable amount 9-160 dynamically sized 8-8 external 4-23 from outside system 9-78 from previous time step 9-97 from workspace 9-79, 9-80 generating step between two levels 9-139 loading from base workspace 4-14 logical operations on 9-85 mixing vector and scalar 3-11 multiplying 9-70 outputting minimum or maximum 9-98 passing through stair-step function 9-109 piecewise linear mapping 9-87, 9-89 plotting 9-163 reading from file 9-66 scalar expansion 3-11 S-functions 8-13 sign of 9-131 vector or scalar 3-11 width of 9-162 inserting mask prompts 6-11 integration block input 9-81 discrete-time 9-42 Integrator block 9-81 algebraic loops 10-7 example 3-35 sample time colors 10-15 simulation speed 4-20 using_simulink_book_2.1 : using_simulink_book_2.1IX Page Thursday, May 22, 1997 2:24 PM Index zero crossings 10-6 invariant constants 10-9 invisible icon frame 6-21 J Jacobian matrices 4-9 Jacobians 5-9 K keyboard actions, summary 3-25 keyboard command 6-16 L labeling signals 3-22 labeling subsystem ports 3-29 left-hand approximation 9-42 libinfo command 3-16 libraries 3-13-3-16 creating 3-13 modifying 3-14 library block, definition 3-13 library block, finding 3-16 library blocks, getting information about 3-16 library, definition 3-13 limit rows to last check box 4-15 limiting derivative of signal 9-113 integral 9-82 signals 9-120 line segments 3-18 creating 3-20 diagonal 3-18 moving 3-19 line vertices, moving 3-21 Line Widths menu item 3-21 Linear block library 9-5 block parameters A-14 linear models, extracting 5-4, 5-9 linearization 5-4, 5-9 discrete-time systems 5-10 linearized matrix, eigenvalues 5-10 lines 3-17-3-21 adding 11-5 branch 3-18, 3-35 carrying the same signal 2-11 connecting to input ports 2-11 deleting 11-11 diagonal 3-17 dividing into segments 3-20 manipulating with mouse and keyboard 3-25 signals carried on 4-2 widths, displaying 3-21 link breaking 3-15 link to library block 3-14 link, definition 3-13 link, unresolved 3-14 LinkStatus parameter 3-15 linmod function 5-4, 5-9, 9-80 Transport Delay block 9-153 linmod2 function 5-11 Literal Assignment type 6-10 LMI Control Toolbox 1-7 load initial check box 4-15 LoadFcn block callback parameter 3-31 loading from base workspace 4-14 loading initial states 4-15 local Goto tag visibility 9-64, 9-71 location of block names 3-9, 3-10 logic circuits, modeling 9-20 Logical Operator block 9-85 I-9 using_simulink_book_2.1 : using_simulink_book_2.1IX Page 10 Thursday, May 22, 1997 2:24 PM Index Look Into System menu item 3-43 Look Under Mask Dialog menu item 3-43 Look Under Mask menu item 6-9 Look-Up Table (2-D) block 9-89 Look-Up Table block 9-87 loops, algebraic 10-7 lorenzs demo 9-163 M macros for SimStruct C-2 Manual Switch block 9-92 manual, organization 1-3 Mask Editor 6-9 mask help text 6-6 Mask Subsystem menu item 6-4, 6-9 mask type 6-6, 6-24 mask workspace 6-5, 6-14 masked blocks block descriptions 6-6 control types 6-12 creating icons 6-6, 6-17 description 6-24 documentation 6-24 help text 6-25 initialization commands 6-14 looking under 6-9 parameter default values 6-14 parameter prompts 6-10 parameters 6-3, A-23 question marks in icon 6-19, 6-20 type 6-24 unmasking 6-9 Math Function block 9-93 mathematical functions, performing 9-93, 9-119, 9-157 MATLAB Fcn block 9-94 I-10 simulation speed 4-19 MATLAB function, applying to block input 9-61, 9-94 Matrix Gain block 9-96 matrix, writing to 9-148 maximum number of output rows 4-25 maximum order of ode15s solver 4-12, 4-25 maximum step size 4-10, 4-25 maximum step size parameter 4-10 mdl file 3-38, B-2 mdlDerivatives function 8-55 mdlGetTimeOfNextVarHit function 8-23 mdlInitialize function 8-8 mdlInitializeConditions function 8-47, 8-49, 8-56 mdlInitializeSampleTimes function 8-45, 8-58 mdlInitializeSizes function 8-11, 8-44, 8-45, 8-47, 8-49, 8-60 mdlOutput function 8-9, 8-46 mdlOutputs function 8-61 mdlTerminate function 8-63 mdlUpdate function 8-9, 8-45, 8-46, 8-47, 8-64 memory and work vectors 8-48 Memory block 9-97 simulation speed 4-19 memory issues 3-33 memory region, shared 9-25, 9-26, 9-27 memory, deallocating for S-function 8-63 menus 3-2 mex utility 8-2 MEX-file models, simulating 4-3 M-file models, simulating 4-3 M-file S-functions 8-11 simulation speed 4-19 M-files, running simulation from 4-3 MinMax block 9-98 zero crossings 10-6 using_simulink_book_2.1 : using_simulink_book_2.1IX Page 11 Thursday, May 22, 1997 2:24 PM Index mixed continuous and discrete systems 10-15 mixedm.c example 8-37 Model Browser 3-42 model files 3-38, B-2 names 3-38 Model Predictive Control Toolbox 1-7 Model section of mdl file B-3 ModelCloseFcn block callback parameter 3-31 modeling equations 3-34 modeling strategies 3-33 models building 2-6 callback parameters 3-30 callback routines 3-30 closing 11-6 creating 3-3, 11-18 editing 3-3 name, getting 11-7 organizing and documenting 3-33 parameters A-3 printing 3-39 saving 2-13, 3-38 selecting entire 3-5 simulating 4-22 tips for building 3-33 modifying libraries 3-14 Monte Carlo analysis 4-21 mouse actions, summary 3-25 moving annotations 3-24 blocks and lines 3-7 blocks between windows 3-7 blocks in a model 2-9, 3-7 line segments 3-19 line vertices 3-21 mask prompts 6-12 signal labels 3-22 Mu-Analysis and Synthesis Toolbox 1-7 multiplying block inputs by constant, variable, or expression 9-70 by matrix 9-96 during simulation 9-136 together 9-106 Multiport Switch block 9-99 multirate S-Function blocks 8-46 multirate systems 10-11, 10-12 linearization 5-10 Mux block 9-101 changing number of input ports 2-9 N NAG Foundation Toolbox 1-7 NameChangeFcn block callback parameter 3-31 names blocks 3-9 C MEX-file routines 8-7 copied blocks 3-6 model files 3-38 Nan values in mask plotting commands 6-19 Neural Network Toolbox 1-8 New Library menu item 3-13 New menu item 3-3 new_system command 3-13, 11-18 newline in block name 11-3 Nonlinear block library 9-6 block parameters A-16 Nonlinear Control Design Blockset 1-15 nonlinear systems, spectral analysis of 9-18 Normalized icon drawing coordinates 6-7, 6-22 normally distributed random numbers 9-111 numerical differentiation formula 4-9 numerical integration 10-2 I-11 using_simulink_book_2.1 : using_simulink_book_2.1IX Page 12 Thursday, May 22, 1997 2:24 PM Index O objects finding 11-12 path 11-3 selecting more than one 3-4 selecting one 3-4 ode1 solver 4-10 ode113 solver 4-9 hybrid systems 10-15 Memory block 4-19, 9-97 ode15s solver 4-8, 4-9, 4-19 hybrid systems 10-15 maximum order 4-12, 4-25 Memory block 4-19, 9-97 unstable simulation results 4-20 ode2 solver 4-10 ode23 solver 4-9 hybrid systems 10-15 ode23s solver 4-9, 4-12, 4-20 ode3 solver 4-10 ode4 solver 4-9 ode45 solver 4-8 hybrid systems 10-15 ode5 solver 4-9 offset to sample time 10-11 offsets, specifying in S-functions 8-9, 8-45 opaque icon 6-21 Open menu item 3-3 Open System menu item 3-43 open_system command 11-19 OpenFcn block callback parameter 3-31 opening block dialog boxes 2-9, 3-7, 11-19 Simulink block library 11-24 Subsystem block 3-29 system windows 11-19 operating point 5-9 I-12 Optimization Toolbox 1-8 options structure getting values 4-28 setting values 4-24 ordering of states 4-16 organization of manual 1-3 orientation of blocks 3-8 Outport block 9-103 example 5-2 in subsystem 3-28, 3-29, 9-141 linearization 5-4 linmod function 5-9 output additional 4-12 between trigger events 7-10 disabled subsystem 7-4 displaying values of 9-57 enable signal 7-5 maximum rows 4-25 options 4-12 outside system 9-103 refine factor 4-26 saving to workspace 4-15 selected elements of input vector 9-128 S-function 8-13, 8-61 smoother 4-12 specifying for simulation 4-13 specifying points 4-26 switching between inputs 9-144 switching between values 9-117 trajectories, viewing 5-2 trigger signal 7-10 variables 4-26 vector or scalar 3-11 writing to file 4-5, 9-146 writing to workspace 4-5, 4-15, 9-148 zero within range 9-28 using_simulink_book_2.1 : using_simulink_book_2.1IX Page 13 Thursday, May 22, 1997 2:24 PM Index output ports capping unconnected 9-145 Enable block 7-5 Trigger block 7-10 P parameter undefined error message 6-20 parameters blocks A-7, A-10-A-22 getting values of 11-17 masked blocks A-23 model A-3 setting values of 11-22 S-functions 8-25 Parameters menu item 2-12, 4-4, 4-6 ParentCloseFcn block callback parameter 3-31 Partial Differential Equation Toolbox 1-8 Paste menu item 3-6, 3-7 path, specifying 11-3 Pause menu item 4-5 penddemo demo 8-4 perturbation factor 5-9 perturbation levels 5-11 phase-shifted wave 9-132 piecewise linear mapping 9-87, 9-89 Pixel icon drawing coordinates 6-22 plot command and masked block icon 6-18 plotting input signals 9-121, 9-163 pointer work vector, example 8-49 popup control type 6-13 port labels 9-103, 9-141 ports block orientation 3-8 labeling in subsystem 3-29 PostLoadFcn model callback parameter 3-30 PostSaveFcn block callback parameter 3-31 PostSaveFcn model callback parameter 3-30 PostScript file, printing to 3-41 PreLoadFcn model callback parameter 3-30 PreSaveFcn block callback parameter 3-31 PreSaveFcn model callback parameter 3-30 Print (Browser) menu item 3-42 print command 3-39 Print menu item 3-39 printing block diagrams 3-39 to bitmap 3-41 to EPS file 3-41 to PostScript file 3-41 proceeding with suspended simulation 4-5 produce additional output option 4-12 produce specified output only option 4-13 Product block 9-106 algebraic loops 10-7 programmable logic arrays, modeling 9-20 prompts control types 6-12 creating 6-11 deleting 6-11 editing 6-11 inserting 6-11 masked block parameters 6-10 moving 6-12 propagation of signal labels 3-23 properties of Scope block 9-126 Pulse Generator block 9-108 purely discrete systems 10-11 Q QFT Control Design Toolbox 1-8 Quantizer block 9-109 modeling A/D converter 9-164 I-13 using_simulink_book_2.1 : using_simulink_book_2.1IX Page 14 Thursday, May 22, 1997 2:24 PM Index question marks in masked block icon 6-19, 6-20 Quit MATLAB menu item 2-13, 3-45 Quit menu item 2-13, 3-45 R randn function 9-111 random noise, generating 9-132 Random Number block 9-111 and Band-Limited White Noise block 9-16 simulation speed 4-20 random numbers, generating normally distributed 9-16 Rate Limiter block 9-113 reading data from data store 9-26 from file 9-66 from workspace 9-68 Real-Time Workshop 1-10 Real-Time Workshop Ada Extension 1-12 Redo menu item 3-3 reentrancy 8-48 reference block 3-14 reference block, definition 3-13 refine factor 4-12, 4-26 region of zero output 9-28 Relational Operator block 9-115 zero crossings 10-6 relative tolerance 4-11, 4-26 simulation accuracy 4-20 Relay block 9-117 zero crossings 10-6 Repeating Sequence block 9-118 replace_block command 11-20 replacing blocks in model 11-20 reset output of enabled subsystem 7-4 reset states of enabled subsystem 7-5 I-14 resetting state 9-83 resizing blocks 3-9 return variables, example 5-2 reversing direction of signal flow 3-35 Revert button on Mask Editor 6-9 right-hand approximation 9-43 rising trigger 7-8, 7-9 Robust Control Toolbox 1-8 Rosenbrock formula 4-9 Rotate Block menu item 3-8 rotates icon rotation 6-21 Rounding Function block 9-119 Runge-Kutta (2,3) pair 4-9 Runge-Kutta (4,5) formula 4-8 Runge-Kutta fourth-order formula 4-9 running the simulation 2-12 S sample model 2-6 sample time 10-11 backpropagating 10-15 changing during simulation 10-11 colors 10-13 constant 10-9 continuous block, example 8-46 fundamental 4-8 hybrid block, example 8-47 inherited 8-9 offset 10-11 parameter 10-11 S-functions, specifying in 8-9, 8-45, 8-58 simulation speed 4-19 Sample Time Colors menu item 10-10, 10-13 sample time hit 8-9 sample-and-hold, applying to block input 9-97 sample-and-hold, implementing 9-164 using_simulink_book_2.1 : using_simulink_book_2.1IX Page 15 Thursday, May 22, 1997 2:24 PM Index sampled data systems 10-11 sampling interval, generating simulation time 9-36 Saturation block 9-120 zero crossings 10-4, 10-6 Save As menu item 3-38 Save menu item 2-13, 3-38 save options area 4-15 save to workspace area 4-15 save_system command 3-16, 11-21 saving axes settings on Scope 9-125 final states 4-15, 4-16 models 2-13, 3-38 output to workspace 4-15 systems 11-21 sawtooth wave, generating 9-132 scalar expansion 3-11 Scope block 9-121 example 3-36, 5-2 properties 9-126 scoped Goto tag visibility 9-64, 9-71 Select All menu item 3-5 selecting model 3-5 more than one object 3-4 one object 3-4 Selector block 9-128 separating vector signal 9-30 sequence numbers on block names 3-6, 3-7 sequence of signals 9-39, 9-108, 9-118 sequential circuits, implementing 9-22 Set Font dialog box 3-10 set_param command 3-16, 11-22 running a simulation 4-21 setting parameter values 11-22 S-Function block 8-2, 9-129 general purpose 8-42 multirate 8-46 S-Function parameter field 8-43 S-functions additional parameters 8-25 block characteristics 8-28 C MEX-files 8-2, 8-26 C MEX-files, names 8-7 definition 8-2 input arguments for M-files 8-13 MEX-file, bottom of file 8-27 MEX-file, top of file 8-27 M-files 8-11 output arguments for M-files 8-13 parameters 8-43 purpose 8-4 routines 8-6 templates 8-7 sfuntmpl.c template 8-7, 8-26, 8-27 sfuntmpl.m template 8-7, 8-11 Shampine, L F 4-9 shared data store 9-25, 9-26, 9-27 Show Browser menu item 3-42 Show Name menu item 3-10 show output port Enable block 7-5 Trigger block 7-10 showing block names 3-10 Sign block 9-131 zero crossings 10-6 signal flow through blocks 3-8 Signal Generator block 9-132 signal labels changing font 3-23 copying 3-22 creating 3-22 deleting 3-22 I-15 using_simulink_book_2.1 : using_simulink_book_2.1IX Page 16 Thursday, May 22, 1997 2:24 PM Index editing 3-22 manipulating with mouse and keyboard 3-26 moving 3-22 propagation 3-23 using to document models 3-33 Signal Processing Toolbox 1-9 signals 3-17 delaying and holding 9-159 displaying vector 9-121 labeling 3-22 limiting 9-120 limiting derivative of 9-113 passed from Goto block 9-64 passing to From block 9-71 plotting 9-121, 9-163 pulses 9-39, 9-108 repeating 9-118 vector 3-11 sim command 4-21, 4-22 simget command 4-28 simset command 4-24 simsizes function 8-11 SimStruct macros C-2 simulating models 4-22 simulation accuracy 4-20 command line 4-21 menu 4-4 proceeding with suspended 4-5 running 2-12 speed 4-19 stages 8-5 starting 4-4 stopping 2-12, 4-5, 9-140 suspending 4-5 simulation parameters 4-6 setting 4-4 I-16 specifying 2-12, 4-4 specifying using simset command 4-24 Simulation Parameters dialog box 2-12, 4-4, 4-6-4-18, A-3 simulation time compared to clock time 4-7 generating at sampling interval 9-36 outputting 9-19 writing to workspace 4-15 Simulink ending session 3-45 icon 3-2, 3-3 menus 3-2 Real-Time Workshop 1-10 starting 3-2 windows and screen resolution 3-3 Simulink block library 3-2 opening 11-24 simulink command 3-2, 11-24 simulink.c included in S-function 8-28 sine wave generating 9-132, 9-134 generating with increasing frequency 9-18 Sine Wave block 9-134 Sinks block library 9-4 block parameters A-19 size of block, changing 3-9 sizes structure 8-8, 8-11, 8-28 dynamically sized fields 8-43 initializing 8-60 setting values 8-29 sizes vector 4-16 slash in block name 11-3 Slider Gain block 9-136 Solver page of Simulation Parameters dialog box 4-6 solver properties, specifying 4-24 using_simulink_book_2.1 : using_simulink_book_2.1IX Page 17 Thursday, May 22, 1997 2:24 PM Index solvers 4-7-4-10 changing during simulation 4-2 choosing 4-4 default 4-8 discrete 4-8, 4-9, 4-10 fixed-step 4-7, 4-9 ode1 4-10 ode113 4-9, 4-19 ode15s 4-8, 4-9, 4-12, 4-19, 4-20 ode2 4-10 ode23 4-9 ode23s 4-9, 4-12, 4-20 ode3 4-10 ode4 4-9 ode45 4-8 ode5 4-9 specifying using simset command 4-26 variable-step 4-7, 4-8 Sources block library 2-7, 9-3 block parameters A-21 spectral analysis of nonlinear systems 9-18 speed of simulation 4-19 Spline Toolbox 1-9 square wave, generating 9-132 ss2tf function 5-12 ss2zp function 5-12 ssGetIWorkValue macro 8-49 ssGetPWorkValue macro 8-49 ssGetRWorkValue macro 8-49 ssIsSampleHit macro 8-46 ssSetIWorkValue macro 8-49 ssSetNumContStates macro 8-48 ssSetNumDiscStates macro 8-45, 8-48 ssSetNumInputArgs macro 8-44 ssSetNumIWork macro 8-49 ssSetNumPWork macro 8-49 ssSetNumRWork macro 8-49 ssSetNumSampleTimes macro 8-47 ssSetOffsetTime macro 8-45 ssSetPWorkValue macro 8-49 ssSetRWorkValue macro 8-49 ssSetSampleTime macro 8-45 stairs function 10-12 stair-step function, passing signal through 9-109 Start menu item 2-2, 2-12, 3-35, 4-4 start time 4-7 StartFcn block callback parameter 3-32 StartFcn model callback parameter 3-30 starting Simulink 3-2 state derivatives, setting to zero 5-13 state events 10-3 state space in discrete system 9-40 states absolute tolerance for 9-83 between trigger events 7-10 determining 10-3 initial 4-16, 4-25 initial conditions vector, order 8-48 loading initial 4-15 ordering of 4-16 outputting 4-26 resetting 9-83 saving at end of simulation 4-25 saving final 4-15, 4-16 updating 10-11 updating discrete in S-function 8-64 when enabling 7-5 writing to workspace 4-15 State-Space block 9-137 algebraic loops 10-7 Statistics Toolbox 1-9 Step block 9-139 zero crossings 10-6 step size 4-10 I-17 using_simulink_book_2.1 : using_simulink_book_2.1IX Page 18 Thursday, May 22, 1997 2:24 PM Index accuracy of derivative 9-34 simulation speed 4-19 stiff problems 4-9 stiff systems and simulation time 4-19 Stop menu item 2-3, 2-12, 4-5 Stop Simulation block 9-140 stop time 4-7 Stop Time parameter 2-12 StopFcn block callback parameter 3-32 StopFcn model callback parameter 3-30 stopping simulation 9-140 Subsystem block 9-141 adding to create subsystem 3-28 opening 3-29 zero crossings 10-6 subsystems and Inport blocks 9-78 creating 3-27-3-32 labeling ports 3-29 model hierarchy 3-33 path 11-3 underlying blocks 3-29 Sum block 9-142 algebraic loops 10-7 summary of mouse and keyboard actions 3-25 suspending simulation 4-5 Switch block 9-144 zero crossings 10-6 switching output between inputs 9-92, 9-144 switching output between values 9-117 Symbolic Math Toolbox 1-9 System Identification Toolbox 1-9 System section of mdl file B-3 systems current 11-16 path 11-3 I-18 T terminating MATLAB 2-13 terminating Simulink 2-13 terminating Simulink session 3-45 termination of simulation 8-63 Terminator block 9-145 text command 6-17 text on masked block icons 6-17 tf2ss utility 9-151 time delay, simulating 9-153 time interval and simulation speed 4-19 tips for building models 3-33 To File block 9-146 To Workspace block 9-148 example 5-3 toolboxes 1-5 Communications Toolbox 1-5 Control System Toolbox 1-6 Financial Toolbox 1-6 Frequency-Domain System Identification Toolbox 1-6 Fuzzy Logic Toolbox 1-6 Higher-Order Spectral Analysis Toolbox 1-7 Image Processing Toolbox 1-7 LMI Control Toolbox 1-7 Model Predictive Control Toolbox 1-7 Mu-Analysis and Synthesis Toolbox 1-7 NAG Foundation Toolbox 1-7 Neural Network Toolbox 1-8 Optimization Toolbox 1-8 Partial Differential Equation Toolbox 1-8 QFT Control Design Toolbox 1-8 Robust Control Toolbox 1-8 Signal Processing Toolbox 1-9 Spline Toolbox 1-9 Statistics Toolbox 1-9 Symbolic Math Toolbox 1-9 using_simulink_book_2.1 : using_simulink_book_2.1IX Page 19 Thursday, May 22, 1997 2:24 PM Index System Identification Toolbox 1-9 Wavelet Toolbox 1-9 tracing facilities 4-27 Transfer Fcn block 9-151 algebraic loops 10-7 example 3-36 linearization 5-5 transfer function form, converting to 5-12 transfer functions discrete 9-48 linear 9-151 masked block icons 6-19 poles and zeros 9-165 poles and zeros, discrete 9-50 transparent icon 6-21 Transport Delay block 9-153 linearization 5-5 Trapezoidal method 9-43 Trigger block 9-155 creating triggered subsystem 7-9 outputting trigger signal 7-10 showing output port 7-10 trigger control signal, outputting 7-10 trigger events 7-2, 7-8 trigger input 7-8 trigger type parameter 7-9 triggered and enabled subsystems 7-2, 7-11 triggered subsystems 7-2, 7-8, 9-155 Trigonometric Function block 9-157 trim function 5-7, 5-13, 9-80 truth tables, implementing 9-20 U Undo menu item 3-3 UndoDeleteFcn block callback parameter 3-32 Uniform Random Number block 9-158 uniformly distributed random numbers 9-158 Unit Delay block 9-159 compared to Transport Delay block 9-153 Unmask button on Mask Editor 6-9 unresolved link 3-14 unstable simulation results 4-20 Update Diagram menu item 3-11, 3-15, 3-23, 10-14, 11-22 updating linked blocks 3-15 updating states 10-11 URL specification in block help 6-25 V variable step S-function, example 8-23, 8-40 variable time delay 9-160 Variable Transport Delay block 9-160 variable-step solvers 4-7, 4-8 vdp model initial conditions 4-16 using Scope block 9-122 vector length, checking 10-2 vector signals, displaying 9-121 vector signals, generating from inputs 9-101 vector signals, separating 9-30 vectorization of blocks 3-11 vertices, moving 3-21 viewing output trajectories 5-2 viscous friction 9-24 visibility of Goto tag 9-73 visible icon frame 6-21 unconnected input ports 9-74 unconnected output ports, capping 9-145 undefined parameter error message 6-20 I-19 using_simulink_book_2.1 : using_simulink_book_2.1IX Page 20 Thursday, May 22, 1997 2:24 PM Index W Wavelet Toolbox 1-9 web command and masked block help 6-25 white noise, generating 9-16 Wide Vector Lines menu item 3-11 Width block 9-162 work vectors 8-48, 8-56 workspace destination 4-25 loading from 4-14 mask 6-5, 6-14 reading data from 9-68 saving to 4-15 source 4-26 writing output to 9-148 writing to 4-5 Workspace I/O page of Simulation Parameters dialog box 4-14 writing data to data store 9-27 output to file 9-146 output to workspace 9-148 X XY Graph block 9-163 Z zero crossings 10-3-10-6 detecting 4-27, 9-75 disabling detection of 4-18 zero output in region, generating 9-28 zero-crossing slope method 7-3 Zero-Order Hold block 9-159, 9-164 compared to First-Order Hold block 9-63 Zero-Pole block 9-165 I-20 algebraic loops 10-7 zero-pole form, converting to 5-12 zooming in on displayed data 9-123 [...]... was printed Please check the Simulink Late-Breaking News, delivered with your Simulink system, for the latest release notes 1-4 using _simulink_ book_2.1 : c01_getting_started Page 5 Thursday, May 22, 1997 2:24 PM Professional Application Toolboxes Professional Application Toolboxes One of the key features of Simulink is that it is built atop MATLAB As a result, Simulink users have direct access to the...using _simulink_ book_2.1 : using _simulink_ book_2.1TOC Page ix Thursday, May 22, 1997 2:24 PM A Sample Model File B-4 C The SimStruct ix using _simulink_ book_2.1 : using _simulink_ book_2.1TOC Page x Thursday, May 22, 1997 2:24 PM x Contents using _simulink_ book_2.1 : c01_getting_started Page 1 Thursday, May 22, 1997... 1-9 using _simulink_ book_2.1 : c01_getting_started Page 10 Thursday, May 22, 1997 2:24 PM 1 Getting Started The Simulink Real-Time Workshop The Simulink Real-Time Workshop™ automatically generates C code directly from Simulink block diagrams This allows the execution of continuous, discrete-time, and hybrid system models on a wide range of computer platforms, including real-time hardware Simulink is... Windows NT 1-13 using _simulink_ book_2.1 : c01_getting_started Page 14 Thursday, May 22, 1997 2:24 PM 1 Getting Started Blocksets Similar to MATLAB and its application toolboxes, The MathWorks offers Blocksets for use with Simulink Blocksets are collections of Simulink blocks that are grouped in a separate library from the main Simulink library The DSP Blockset The DSP Blockset extends Simulink for use in... modeling concepts You can access these demos from the Simulink block library window: 1 Type simulink in the MATLAB command window The Simulink block library window appears: the Demos icon 2 Double-click on the Demos icon The MATLAB Demos window appears This window contains several interesting sample models that illustrate useful Simulink features 2-5 using _simulink_ book_2.1 : c02_quick_start Page 6 Thursday,... Blockset, for use with Simulink, includes a collection of block diagram components that extend the standard Simulink block library With this new set of blocks, you can create discrete-time dynamic systems that utilize fixed-point arithmetic As a result, Simulink can simulate effects commonly encountered in fixed-point systems for applications such as control systems and time-domain filtering Simulink is required... 1-14 1-14 1-14 1-15 using _simulink_ book_2.1 : c01_getting_started Page 2 Thursday, May 22, 1997 2:24 PM 1 Getting Started To the Reader Welcome to Simulink ! In the last few years, Simulink has become the most widely used software package in academia and industry for modeling and simulating dynamical systems Simulink encourages you to try things out You can easily build... Data Translation, or Computer Boards I/O devices and Quanser Multiq board 1-11 using _simulink_ book_2.1 : c01_getting_started Page 12 Thursday, May 22, 1997 2:24 PM 1 Getting Started The Real-Time Workshop Ada Extension The Simulink Real-Time Workshop (RTW) Ada Extension automatically generates Ada code directly from Simulink block diagrams This allows the execution of continuous, discrete-time, and... a predator-prey model, or the effect of the monetary supply on the economy Simulink is also practical With thousands of engineers around the world using it to model and solve real problems, knowledge of this tool will serve you well throughout your professional career We hope you enjoy exploring the software What Is Simulink? Simulink is a software package for modeling, simulating, and analyzing dynamical... toolboxes And because MATLAB and Simulink are integrated, you can simulate, analyze, and revise your models in either environment at any point How to Use This Manual Because Simulink is graphical and interactive, we encourage you to jump right in and try it The manual contains eleven chapters and five appendices For a useful introduction that will help you start using Simulink quickly, take a look at

Ngày đăng: 22/09/2016, 01:34

Từ khóa liên quan

Mục lục

  • Getting Started

    • To the Reader

      • What Is Simulink?

      • How to Use This Manual

      • Professional Application Toolboxes

        • The Communications Toolbox.

        • The Control System Toolbox

        • The Financial Toolbox.

        • The Frequency-Domain System Identification Toolbox...

        • The Fuzzy Logic Toolbox

        • The Higher-Order Spectral Analysis Toolbox

        • The Image Processing Toolbox

        • The LMI Control Toolbox.

        • The Model Predictive Control Toolbox

        • The Mu-Analysis and Synthesis Toolbox

        • The NAG Foundation Toolbox

        • The Neural Network Toolbox

        • The Optimization Toolbox

        • The Partial Differential Equation Toolbox.

        • The QFT Control Design Toolbox

        • The Robust Control Toolbox

        • The Signal Processing Toolbox

        • The Spline Toolbox

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan