Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
slref.pdf
Скачиваний:
39
Добавлен:
26.03.2015
Размер:
16.01 Mб
Скачать

Simulink®

Reference

R2012b

How to Contact MathWorks

 

 

 

www.mathworks.com

Web

 

 

 

comp.soft-sys.matlab

Newsgroup

 

 

 

 

 

 

www.mathworks.com/contact_TS.html Technical Support

 

 

 

suggest@mathworks.com

Product enhancement suggestions

 

 

 

 

 

 

bugs@mathworks.com

Bug reports

 

 

 

 

 

 

doc@mathworks.com

Documentation error reports

 

 

 

service@mathworks.com

Order status, license renewals, passcodes

 

 

 

info@mathworks.com

Sales, pricing, and general information

508-647-7000 (Phone)

508-647-7001 (Fax)

The MathWorks, Inc. 3 Apple Hill Drive

Natick, MA 01760-2098

For contact information about worldwide offices, see the MathWorks Web site.

Simulink® Reference

© COPYRIGHT 2002–2012 by The MathWorks, Inc.

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.

FEDERAL ACQUISITION: This provision applies to all acquisitions of the Program and Documentation by, for, or through the federal government of the United States. By accepting delivery of the Program or Documentation, the government hereby agrees that this software or documentation qualifies as commercial computer software or commercial computer software documentation as such terms are used or defined in FAR 12.212, DFARS Part 227.72, and DFARS 252.227-7014. Accordingly, the terms and

conditions of this Agreement and only those rights specified in this Agreement, shall pertain to and govern the use, modification, reproduction, release, performance, display, and disclosure of the Program and Documentation by the federal government (or other entity acquiring for or through the federal government) and shall supersede any conflicting contractual terms or conditions. If this License fails to meet the government’s needs or is inconsistent in any respect with federal procurement law, the government agrees to return the Program and Documentation, unused, to The MathWorks, Inc.

Trademarks

MATLAB and Simulink are registered trademarks of The MathWorks, Inc. See www.mathworks.com/trademarks for a list of additional trademarks. Other product or brand names may be trademarks or registered trademarks of their respective holders.

Patents

MathWorks products are protected by one or more U.S. patents. Please see www.mathworks.com/patents for more information.

Revision History

 

 

July 2002

Online only

Revised for Simulink 5 (Release 13)

April 2003

Online only

Revised for Simulink 5.1 (Release 13SP1)

April 2004

Online only

Revised for Simulink 5.1.1 (Release 13SP1+)

June 2004

Online only

Revised for Simulink 6 (Release 14)

October 2004

Online only

Revised for Simulink 6.1 (Release 14SP1)

March 2005

Online only

Revised for Simulink 6.2 (Release 14SP2)

September 2005

Online only

Revised for Simulink 6.3 (Release 14SP3)

March 2006

Online only

Revised for Simulink 6.4 (Release 2006a)

September 2006

Online only

Revised for Simulink 6.5 (Release 2006b)

March 2007

Online only

Revised for Simulink 6.6 (Release 2007a)

September 2007

Online only

Revised for Simulink 7.0 (Release 2007b)

March 2008

Online only

Revised for Simulink 7.1 (Release 2008a)

October 2008

Online only

Revised for Simulink 7.2 (Release 2008b)

March 2009

Online only

Revised for Simulink 7.3 (Release 2009a)

September 2009

Online only

Revised for Simulink 7.4 (Release 2009b)

March 2010

Online only

Revised for Simulink 7.5 (Release 2010a)

September 2010

Online only

Revised for Simulink 7.6 (Release 2010b)

April 2011

Online only

Revised for Simulink 7.7 (Release 2011a)

September 2011

Online only

Revised for Simulink 7.8 (Release 2011b)

March 2012

Online only

Revised for Simulink 7.9 (Release 2012a)

September 2012

Online only

Revised for Simulink 8.0 (Release 2012b)

Contents

1

 

 

Block Reference

 

Commonly Used

1-2

 

 

 

 

 

Continuous . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . 1-4

 

 

Discontinuities . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . 1-5

 

 

Discrete . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . 1-6

 

 

Logic and Bit Operations . . . . . . . . . . . . .

. . . . . . . . . . . . . . 1-8

 

 

Lookup Tables . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . 1-10

 

 

Math Operations . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . 1-11

 

 

Model Verification . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . 1-13

 

 

Model-Wide Utilities . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . 1-14

 

 

Ports & Subsystems . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . 1-15

 

 

Signal Attributes . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . 1-16

 

 

Signal Routing . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . 1-17

 

 

Sinks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . 1-19

 

 

Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . 1-20

 

 

User-Defined Functions . . . . . . . . . . . . . .

. . . . . . . . . . . . . . 1-22

v

Additional Math & Discrete . . . . . . . . . . . . . . . . . . . . . . . . .

1-23

Additional Discrete . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

1-23

Additional Math: Increment — Decrement . . . . . . . . . . . . .

1-23

Run on Target Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . .

1-24

Target for Use with Arduino Hardware . . . . . . . . . . . . . . . .

1-24

Target for Use with BeagleBoard Hardware . . . . . . . . . . . .

1-25

Target for Use with LEGO MINDSTORMS NXT

 

Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

1-26

Blocks — Alphabetical List

2

3

 

 

Function Reference

 

Model Construction

3-2

 

 

 

 

Simulation . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . 3-7

 

 

Linearization and Trimming . . . . . .

. . . . . . . . . . . . . . . . . . 3-10

 

 

Data Type . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . 3-11

vi Contents

Functions — Alphabetical List

4

Mask Icon Drawing Commands

5

Simulink Debugger Commands

6

Simulink Classes

7

Model and Block Parameters

8

Model Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

8-2

About Model Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . .

8-2

Examples of Setting Model Parameters . . . . . . . . . . . . . . . .

8-95

Common Block Parameters . . . . . . . . . . . . . . . . . . . . . . . . .

8-96

About Common Block Parameters . . . . . . . . . . . . . . . . . . . .

8-96

Examples of Setting Block Parameters . . . . . . . . . . . . . . . .

8-107

Block-Specific Parameters . . . . . . . . . . . . . . . . . . . . . . . . .

8-109

Mask Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

8-259

About Mask Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . .

8-259

Notes on Mask Parameter Storage . . . . . . . . . . . . . . . . . . .

8-265

vii

Simulink Identifier

9

Simulink Identifier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

9-2

10

 

Model Advisor Checks

 

Simulink Checks

10-2

 

 

 

 

Simulink Check Overview . . . . . . . . . . . . . . . . . . . . . . . . . .

10-4

 

 

Identify unconnected lines, input ports, and output

 

 

 

ports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

10-5

 

 

Check root model Inport block specifications . . . . . . . . . . .

10-6

 

 

Check optimization settings . . . . . . . . . . . . . . . . . . . . . . . . .

10-7

 

 

Check for parameter tunability information ignored for

 

 

 

referenced models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

10-10

 

 

Check for implicit signal resolution . . . . . . . . . . . . . . . . . . .

10-11

 

 

Check for optimal bus virtuality . . . . . . . . . . . . . . . . . . . . .

10-12

 

 

Check for Discrete-Time Integrator blocks with initial

 

 

 

condition uncertainty . . . . . . . . . . . . . . . . . . . . . . . . . . . .

10-13

 

 

Identify disabled library links . . . . . . . . . . . . . . . . . . . . . . .

10-14

 

 

Identify parameterized library links . . . . . . . . . . . . . . . . . .

10-15

 

 

Identify unresolved library links . . . . . . . . . . . . . . . . . . . . .

10-16

 

 

Identify model reference variants and variant subsystems

 

 

 

that override variant choice . . . . . . . . . . . . . . . . . . . . . . .

10-17

 

 

Identify configurable subsystem blocks for converting to

 

 

 

variant subsystem blocks . . . . . . . . . . . . . . . . . . . . . . . . .

10-18

 

 

Check usage of function-call connections . . . . . . . . . . . . . . .

10-18

 

 

Check signal logging save format . . . . . . . . . . . . . . . . . . . . .

10-19

 

 

Check Data Store Memory blocks for multitasking, strong

 

 

 

typing, and shadowing issues . . . . . . . . . . . . . . . . . . . . . .

10-21

 

 

Check if read/write diagnostics are enabled for data store

 

 

 

blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

10-23

 

 

Check data store block sample times for modeling errors . .

10-25

 

 

Check for potential ordering issues involving data store

 

 

 

access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

10-26

 

 

Check for partial structure parameter usage with bus

 

 

 

signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

10-28

 

 

Check for calls to slDataTypeAndScale . . . . . . . . . . . . . . . .

10-30

 

 

Check for proper bus usage . . . . . . . . . . . . . . . . . . . . . . . . .

10-32

viii Contents

Check for potentially delayed function-call subsystem

 

return values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

10-34

Identify block output signals with continuous sample time

 

and non-floating point data type . . . . . . . . . . . . . . . . . . .

10-35

Check for proper Merge block usage . . . . . . . . . . . . . . . . . .

10-36

Check consistency of initialization parameters for Outport

 

and Merge blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

10-37

Check for non-continuous signals driving derivative

 

ports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

10-55

Runtime diagnostics for S-functions . . . . . . . . . . . . . . . . . .

10-57

Check file for foreign characters . . . . . . . . . . . . . . . . . . . . .

10-59

Check model for known block upgrade issues . . . . . . . . . . .

10-64

Check model for known block upgrade issues requiring

 

compile time information . . . . . . . . . . . . . . . . . . . . . . . . .

10-65

Check that the model is saved in SLX format . . . . . . . . . . .

10-68

Check Model History properties . . . . . . . . . . . . . . . . . . . . . .

10-70

Analyze model hierarchy for upgrade issues . . . . . . . . . . . .

10-72

Check and update masked blocks in library to use promoted

 

parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

10-74

Performance Advisor Checks

11

Simulink Performance Advisor Checks . . . . . . . . . . . . . .

11-2

Simulink Performance Advisor Check Overview . . . . . . . .

11-2

Baseline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

11-3

Check Preupdate Items . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

11-3

Checks that need Update Diagram . . . . . . . . . . . . . . . . . . .

11-3

Checks that require simulation to run . . . . . . . . . . . . . . . . .

11-3

Check Accelerator Settings . . . . . . . . . . . . . . . . . . . . . . . . . .

11-3

Create Baseline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

11-4

Identify resource intensive diagnostic settings . . . . . . . . . .

11-4

Check optimization settings . . . . . . . . . . . . . . . . . . . . . . . . .

11-4

Identify inefficient lookup table blocks . . . . . . . . . . . . . . . .

11-5

Identify Interpreted MATLAB Function blocks . . . . . . . . .

11-5

Check MATLAB Function block debug settings . . . . . . . . .

11-5

Check Stateflow block debug settings . . . . . . . . . . . . . . . . .

11-5

Identify simulation target settings . . . . . . . . . . . . . . . . . . .

11-6

Check model reference rebuild setting . . . . . . . . . . . . . . . . .

11-6

Check Model Reference parallel build . . . . . . . . . . . . . . . . .

11-6

Check solver type selection . . . . . . . . . . . . . . . . . . . . . . . . . .

11-8

ix

Select normal or accelerator simulation mode . . . . . . . . . .

11-9

Simulink Limits

12

Maximum Size Limits of Simulink Models . . . . . . . . . . .

12-2

Index

x Contents

1

Block Reference

Commonly Used (p. 1-2)

Continuous (p. 1-4)

Discontinuities (p. 1-5)

Discrete (p. 1-6)

Logic and Bit Operations (p. 1-8)

Lookup Tables (p. 1-10)

Math Operations (p. 1-11)

Model Verification (p. 1-13)

Model-Wide Utilities (p. 1-14)

Ports & Subsystems (p. 1-15)

Signal Attributes (p. 1-16)

Signal Routing (p. 1-17)

Sinks (p. 1-19)

Sources (p. 1-20)

User-Defined Functions (p. 1-22)

Additional Math & Discrete (p. 1-23)

Run on Target Hardware (p. 1-24)

Commonly used blocks Define continuous states Define discontinuous states Define discrete states

Perform logic and bit operations Support lookup tables

Perform math operations Perform model verification Support model-wide operations Support ports and subsystems Support signal attributes Support signal routing

Receive output from other blocks Input to other blocks

Support custom functions

Provide additional math and discrete support

1 Block Reference

Commonly Used

Bus Creator

Create signal bus

Bus Selector

Select signals from incoming bus

Constant

Generate constant value

Data Type Conversion

Convert input signal to specified

 

data type

Demux

Extract and output elements of

 

vector signal

Discrete-Time Integrator

Perform discrete-time integration or

 

accumulation of signal

Gain

Multiply input by constant

Ground

Ground unconnected input port

Inport

Create input port for subsystem or

 

external input

Integrator, Integrator Limited

Integrate signal

Logical Operator

Perform specified logical operation

 

on input

Mux

Combine several input signals into

 

vector

Outport

Create output port for subsystem or

 

external output

Product

Multiply and divide scalars and

 

nonscalars or multiply and invert

 

matrices

Relational Operator

Perform specified relational

 

operation on inputs

Saturation

Limit range of signal

Scope and Floating Scope

Display signals generated during

 

simulation

1-2

Commonly Used

Subsystem, Atomic Subsystem,

Represent system within another

Nonvirtual Subsystem, CodeReuse

system

Subsystem

 

Sum, Add, Subtract, Sum of

Add or subtract inputs

Elements

 

Switch

Switch output between first input

 

and third input based on value of

 

second input

Terminator

Terminate unconnected output port

Unit Delay

Delay signal one sample period

Vector Concatenate, Matrix

Concatenate input signals of same

Concatenate

data type to create contiguous output

 

signal

1-3

1 Block Reference

Continuous

Derivative

Output time derivative of input

Integrator, Integrator Limited

Integrate signal

PID Controller

Simulate continuousor

 

discrete-time PID controllers

PID Controller (2 DOF)

Simulate continuousor

 

discrete-time two-degree-of-freedom

 

PID controllers

Second-Order Integrator,

Integrate input signal twice

Second-Order Integrator Limited

 

State-Space

Implement linear state-space system

Transfer Fcn

Model linear system by transfer

 

function

Transport Delay

Delay input by given amount of time

Variable Time Delay, Variable

Delay input by variable amount of

Transport Delay

time

Zero-Pole

Model system by zero-pole-gain

 

transfer function

1-4

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]