mathscript basics - savvas

22
971 MathScript Basics B.1 INTRODUCTION LabVIEW is short for Laboratory Virtual Instrument Engineering Workbench. It is a flexible graphical development environment from National Instruments, Inc. En- gineers and scientists in research, development, production, test, and service indus- tries as diverse as automotive, semiconductor, aerospace, electronics, chemical, telecommunications, and pharmaceutical use LabVIEW, especially in the area of testing and measurements, industrial automation, and data analysis. Users of Lab- VIEW are familiar with the use of the graphical programming language to create programs relying on graphic symbols to describe programming actions. An important new development introduced in LabVIEW 8.0 or higher is the MathScript environ- ment. LabVIEW MathScript is a text-based command line environment using m-files and command line prompts. It is assumed here that the reader has LabVIEW 8 in- stalled and knows how to access the LabVIEW Getting Started window.This appen- dix only provides an introduction to MathScript. Readers should refer to Learning with LabVIEW 1 for a more complete introduction to LabVIEW and MathScript. In this appendix, we discuss the MathScript Interactive Window.The essentials of creating user-defined functions and scripts, of saving and loading data files, and of using the MathScript Node are presented.With the MathScript Interactive Window, students will be able to interact with LabVIEW through a command prompt. B.2 WHAT IS MATHSCRIPT? MathScript is a high-level, text-based programming language with an easily ac- cessible syntax and ample functionality to address programming tasks related to signal processing, analysis, and mathematics. MathScript includes more than 500 built-in functions. There are linear algebra functions, curve fitting function, digi- tal filters, functions for solving differential equations, and probability and statis- tics functions. And since MathScript employs a commonly used syntax, it follows that you can work with many of your previously developed mathematical compu- tation scripts, or any of those openly available in engineering textbooks or on the Internet. 1 Bishop, R. H., Learning with LabVIEW, Prentice Hall Publishing, 2007. APPENDIX B Modern Control Systems, Eleventh Edition, by Richard C Dorf and Robert H. Bishop. ISBN: 0132270285. © 2008 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permission(s), write to: Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.

Upload: others

Post on 18-Dec-2021

14 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: MathScript Basics - Savvas

971

MathScript Basics

B.1 INTRODUCTION

LabVIEW is short for Laboratory Virtual Instrument Engineering Workbench. It isa flexible graphical development environment from National Instruments, Inc. En-gineers and scientists in research, development, production, test, and service indus-tries as diverse as automotive, semiconductor, aerospace, electronics, chemical,telecommunications, and pharmaceutical use LabVIEW, especially in the area oftesting and measurements, industrial automation, and data analysis. Users of Lab-VIEW are familiar with the use of the graphical programming language to createprograms relying on graphic symbols to describe programming actions.An importantnew development introduced in LabVIEW 8.0 or higher is the MathScript environ-ment. LabVIEW MathScript is a text-based command line environment using m-filesand command line prompts. It is assumed here that the reader has LabVIEW 8 in-stalled and knows how to access the LabVIEW Getting Started window. This appen-dix only provides an introduction to MathScript. Readers should refer to Learningwith LabVIEW1 for a more complete introduction to LabVIEW and MathScript.

In this appendix, we discuss the MathScript Interactive Window. The essentialsof creating user-defined functions and scripts, of saving and loading data files, and ofusing the MathScript Node are presented. With the MathScript Interactive Window,students will be able to interact with LabVIEW through a command prompt.

B.2 WHAT IS MATHSCRIPT?

MathScript is a high-level, text-based programming language with an easily ac-cessible syntax and ample functionality to address programming tasks related tosignal processing, analysis, and mathematics. MathScript includes more than 500built-in functions. There are linear algebra functions, curve fitting function, digi-tal filters, functions for solving differential equations, and probability and statis-tics functions. And since MathScript employs a commonly used syntax, it followsthat you can work with many of your previously developed mathematical compu-tation scripts, or any of those openly available in engineering textbooks or on theInternet.

1Bishop, R. H., Learning with LabVIEW, Prentice Hall Publishing, 2007.

A P P E N D I X

B

DorfAppBff.qxd 7/2/07 9:04 PM Page 971

Modern Control Systems, Eleventh Edition, by Richard C Dorf and Robert H. Bishop.ISBN: 0132270285. © 2008 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.

This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in aretrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise.

For information regarding permission(s), write to: Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.

Page 2: MathScript Basics - Savvas

972 Appendix B MathScript Basics

The fundamental math-oriented data types in MathScript are matrices withbuilt-in operators for generating data and accessing elements.You can extend Math-Script by defining your own custom functions. You can find more information onMathScript at http://ni.com/mathscript including lists of built-in MathScript func-tions and links to online examples.

B.3 ACCESSING THE MATHSCRIPT INTERACTIVE WINDOW

The interactive interface is provided by the MathScript Interactive Window. You canaccess the interactive window from the Getting Started window or any VI by selecting

as illustrated in Figure B.1. The MathScript InteractiveWindow is a user interface comprised of a Command Window (the user command in-puts), an Output Window echoing the inputs and showing the resulting outputs, a ScriptEditor window (for loading, saving, compiling, and running scripts), a Variables window(showing variables, dimensions, and type), and a Command History window providinga historical account of commands and interactions with MathScript.A new MathScriptInteractive Window is shown in Figure B.2 with the various components highlighted.

As you work, the Output Window updates to show your inputs and the subse-quent results. The Command History window tracks your commands. The historyview is very useful because there you can access and reuse your previously executedcommands by double clicking a previous command to execute it again. You can alsonavigate up and down through the previous commands (which will appear in theCommand Window) by using the and keys. In the Script Editor window, youcan enter and execute groups of commands and then save the commands in a file(called a script) for use in a later LabVIEW session.

“p”“q”

Tools»MathScript Window…,

Select MathScript Window

( )

(b)

FIGURE B.1 Accessing the MathScript Interactive Window from (a) the Getting Started window, or (b) the Toolspull-down menu on the front panel or block diagram.

DorfAppBff.qxd 7/2/07 9:04 PM Page 972

Modern Control Systems, Eleventh Edition, by Richard C Dorf and Robert H. Bishop.ISBN: 0132270285. © 2008 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.

This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in aretrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise.

For information regarding permission(s), write to: Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.

Page 3: MathScript Basics - Savvas

Section B.3 Accessing the Mathscript Interactive Window 973

Variables Script Editor Command History

PreviewPane

CommandWindow

OutputWindow

MathScript InteractiveWindow

FIGURE B.2The basiccomponents of theMathScriptInteractive Window.

Clearing the Command History Window

The commands entered in previous sessions using the MathScript Interactive Win-dow will reappear in subsequent sessions. In the Command History window you willfind a header that shows the day and time that you entered the commands. This fea-ture allows you to easily discern when the commands were entered. If the Com-mand History window gets too full and you want to clear it out, you can right-clickthe Command History window and select Clear History from the shortcut menu.This process is illustrated in Figure B.3.

Clearing the Output Window

In a manner similar to the clearing the Command History window, you can clear theOutput Window. To accomplish this task, right-click the Output Window and selectClear from the shortcut menu, as shown in Figure B.3. You also can use the Math-Script function clc to clear the Output Window by typing in clc in the CommandWindow.

Copying Output Window Data

You can copy data from the Output Window and paste it in the Script Editor win-dow or a text editor. Right-click the Output Window and select Copy Data from theshortcut menu to copy the contents of the Output Window to the clipboard. Youalso can highlight text in the Output Window and select or press the

keys to copy the selected text to the clipboard.

Viewing Data in a Variety of Formats

In the MathScript Interactive Window you can view the variables in a variety of for-mats, as shown in Figure B.4. Depending on the variable type, the available formats

6Ctrl-C7

Edit»Copy

DorfAppBff.qxd 7/2/07 9:04 PM Page 973

Modern Control Systems, Eleventh Edition, by Richard C Dorf and Robert H. Bishop.ISBN: 0132270285. © 2008 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.

This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in aretrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise.

For information regarding permission(s), write to: Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.

Page 4: MathScript Basics - Savvas

974 Appendix B MathScript Basics

Right-click onCommand Historyand selectClear History

Right-click onOutput Window

and selectClear

Use the clcfunction in the

Command Window

FIGURE B.3 Clearing the Command History and the Output Window.

Select y

In pull-downmenu choosevariable type

Graph ofthe data invariable y

Define timeinterval and

computey � sin(t)

FIGURE B.4Showing the datatype in variousformats.

include: numeric, string, graph, XY graph, sound, surface, and picture. You can edita variable in the Preview Pane when the display type is Numeric or String. SelectingSound plays the data as a sound, but works for one-dimensional variables only. Theremaining display types show the data as graphs of one sort or another: Graph dis-plays the data on a waveform graph, XY Graph displays the data on an XY graph,Surface displays the data on a 3D surface graph, and Picture displays the data on anintensity graph.

DorfAppBff.qxd 7/2/07 9:04 PM Page 974

Modern Control Systems, Eleventh Edition, by Richard C Dorf and Robert H. Bishop.ISBN: 0132270285. © 2008 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.

This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in aretrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise.

For information regarding permission(s), write to: Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.

Page 5: MathScript Basics - Savvas

Section B.3 Accessing the Mathscript Interactive Window 975

Open a new MathScript Interactive Window from the Getting Started windowby selecting as illustrated in Figure B.1. In the Com-mand Window input the time from seconds to seconds in increments of0.1 seconds, as follows:

Then, compute the as follows:

Notice that in the Variables window the two variables t and y appear, as illustrated inFigure B.5a. Select the variable y and note that in the Preview Pane the variable ap-pears in the numeric format. Now, in the pull-down menu above the Preview Pane, se-lect Graph.The data will now be shown in graphical form, as illustrated in Figure B.5b.The graph can be undocked from the Preview Pane for re-sizing and customization.Toundock the graph, right-click on the graph and select Undock Window. The windowcan now be re-sized and the plot can be customized interactively and printed.

As an alternative to using the Preview Pane, you can also obtain a plot of the yversus t programmatically using the plot command:

plot(t,y)

y = cos(t);

y = cos(t)

t = [0 : 0.1 : 10];

t = 10t = 0Tools»MathScript Window…,

Select the variable y

Select the Graph to show data in graph format

Select the Numeric to show datavalues in numeric format

(a)

(b)

FIGURE B.5 (a) Entering the time, computing and viewing the variable y in numerical form.(b) Viewing the variable y in graphical form.

y = cos(t)

DorfAppBff.qxd 7/2/07 9:04 PM Page 975

Modern Control Systems, Eleventh Edition, by Richard C Dorf and Robert H. Bishop.ISBN: 0132270285. © 2008 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.

This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in aretrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise.

For information regarding permission(s), write to: Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.

Page 6: MathScript Basics - Savvas

976 Appendix B MathScript Basics

The process is illustrated in Figure B.6. A new window appears that presents thegraph of y versus t. Following the same procedure, see if you can obtain a plot of

where

B.4 MATHSCRIPT HELP

You can display several types of help content for MathScript by calling differenthelp commands from the Command Window. Table B.1 lists the help commands youcan call and the type of help these commands display in the Output Window.

As illustrated in Figure B.7, entering help classes in the Command Windowlaunches the LabVIEW Help showing all classes of functions and commands that Math-Script supports. Examples of the classes of functions are basic and matrixops. Enteringhelp basic in the Command Window results in a list of the members of the basic

v = 4 rad/sec.y = cos(vt)

Using the plot command

Plot windowappears withy � cos(t)

FIGURE B.6Obtaining a plot ofthe cosine functionusing the plotcommand.

Table B.1 Help Commands for MathScript

Command Description of Help Provided

help Provides an overview of the MathScript window.help classes Provides a list of all classes of MathScript functions and topics as well as a

short description of each class.help cdt Provides a list of the additional classes of functions that are installed with theclasses LabVIEW Control Design Toolkit.

help class Provides a list of the names and short descriptions of all functions in a par-ticular MathScript class.Example: help basic

help Provides reference help for a particular MathScript function or topic, infunction cluding its name, syntax, description, inputs and outputs, examples to type in

the Command Window, and related functions or topics.Example: help abs

DorfAppBff.qxd 7/2/07 9:04 PM Page 976

Modern Control Systems, Eleventh Edition, by Richard C Dorf and Robert H. Bishop.ISBN: 0132270285. © 2008 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.

This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in aretrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise.

For information regarding permission(s), write to: Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.

Page 7: MathScript Basics - Savvas

Section B.5 Syntax 977

class, including abs (i.e., the absolute value), conj (i.e., the complex conjugate func-tion), and exp (i.e., the exponential function). Then, entering help abs in the Com-mand Window will result in an output that contains a description of the absfunction, including examples of its usage and related topics.

B.5 SYNTAX

The syntax associated with MathScript is straightforward. Most students with someexperience programming a text-based language will be comfortable with the pro-gramming constructs in MathScript. If you need help getting started with Math-Script, you can access help by selecting Help Search the LabVIEW Help from theMathScript Interactive Window and typing mathscript in the search window.

Eleven basic MathScript syntax guidelines are:1. Scalar operations: MathScript is ideally suited for quick mathematical operations,

such as addition, subtraction, multiplication, and division. For example, consider theaddition of two scalar numbers, 16 and 3. This is a simple operation that you mightperform on a calculator. This can be accomplished using the MathScript command:

»

Functions of particular interest to students studying controls.

FIGURE B.7 Accessing the help for MathScript classes, members, and functions.

>>16+3ans=

19

Output Window display

In MathScript, if you perform any calculation or function without assigning the resultto a variable, the default variable ans is used. If you want to assign the value of theaddition of two scalars to the variable x, enter the following command:

DorfAppBff.qxd 7/2/07 9:04 PM Page 977

Modern Control Systems, Eleventh Edition, by Richard C Dorf and Robert H. Bishop.ISBN: 0132270285. © 2008 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.

This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in aretrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise.

For information regarding permission(s), write to: Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.

Page 8: MathScript Basics - Savvas

978 Appendix B MathScript Basics

In the same manner, you can add two scalar variables y and z by entering the follow-ing commands:

>>x=16+3

x=

19

>>y=16;>>z=3;>>y+zans= 19

>>disp(y); 16

Semicolon eliminates output display

No semicolon leads to output display

Using disp leads to output even with the semicolon

Notice that in the previous example a semicolon was used for the first two lines, andno output was displayed. In MathScript, if you end a command line with a semicolon,the MathScript Interactive Window does not display the output for that command.Some functions display output even if you end the command line with a semicolon.For example, the disp function displays an output even if followed by a semicolon.

You use the symbol ‘-’ for subtraction, the symbol ‘/’ for division, and the symbolfor multiplication, as illustrated below:‘*’

>>16-3ans= 13

>>16/3ans= 5.3333

>>16*3ans= 48

Subtraction

Division

Multiplication

2. Creating matrices and vectors: To create row or column vectors and matrices, usewhite space or commas to separate elements, and use semicolons to separate rows.Consider for example, the matrix A (a column vector),

In MathScript syntax, you would form the matrix as

Consider for example, the matrix B (a row vector)

B = [1 -2 7].

A = [1; 2; 3]

A = C123S .

DorfAppBff.qxd 7/2/07 9:04 PM Page 978

Modern Control Systems, Eleventh Edition, by Richard C Dorf and Robert H. Bishop.ISBN: 0132270285. © 2008 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.

This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in aretrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise.

For information regarding permission(s), write to: Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.

Page 9: MathScript Basics - Savvas

Section B.5 Syntax 979

>>C = [-1 2 0;4 10 -2;1 0 6]C= -1 2 0 4 10 -2 1 0 6

>>C(2,3)ans=

-2

C(2,3) denotes the second row ofthe third column

In MathScript syntax, you would form the matrix as

As a final example, consider the matrix C (a matrix)

In MathScript syntax, you would form the matrix as

3. Creating vectors using the colon operator: There are several ways to create a one-dimensional array of equally spaced elements. For example, you will often need to cre-ate a vector of elements representing time. To create a one-dimensional array equallyspaced and incremented by 1, use the MathScript syntax

1 2 3 4 5 6 7 8 9 10

To create a one-dimensional array equally spaced and incremented by 0.5, use theMathScript syntax

1 1.5 2 2.5 3 3.5 4 4.5 5 5.56 6.5 7 7.5 8 8.5 9 9.5 10

4. Accessing individual elements of a vector or matrix: You may want to access specificelements or subsets of a vector or matrix. Consider the matrix C:

In MathScript syntax, you can access the element in the second row and third columnof the matrix C, as follows:

C = C -1 2 04 10 -21 0 6

S .

3 * 3

t =

W t = 1 : 0.5 : 10

t =

W t = 1 : 10

C = [-1 2 0; 4 10 -2; 1 0 6] or C = [-1, 2, 0; 4, 10, -2; 1, 0, 6]

C = C -1 2 04 10 -21 0 6

S .

3 * 3

B = [1, -2, 7] or B = [1 -2 7]

DorfAppBff.qxd 7/2/07 9:04 PM Page 979

Modern Control Systems, Eleventh Edition, by Richard C Dorf and Robert H. Bishop.ISBN: 0132270285. © 2008 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.

This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in aretrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise.

For information regarding permission(s), write to: Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.

Page 10: MathScript Basics - Savvas

980 Appendix B MathScript Basics

>>C(2,:)ans=

4 10 -2

The second row of C

You can assign this value to a new variable by entering the following command:

>>F=C(2,3)F=

-2

You can also access an entire row or an entire column of a matrix using the colon op-erator. In MathScript syntax, if you want to access the entire second row of matrix C,enter the following command:

In the same way, if you wish to access the entire third column of matrix C, enter thefollowing command:

>>C(:,3)ans=

0 -2 6

The third row of C

Suppose you want to extract the submatrix from C consisting of rows 2 and 3 andcolumns 1 and 2. You use brackets to specify groups of rows and columns to access asubset of data as follows:

2 * 2

>>C([2 3], [1 2])ans=

4 10 1 0

A submatrix of C

5. Calling functions in MathScript: You can call MathScript functions from the Com-mand Window. Consider the creation of a vector of a certain number of elements thatare equally distributed in a given interval. To accomplish this in MathScript syntax, youcan use the built-in function linspace. Using the command help linspace you find thatthis function uses the syntax

linspace(a, b, n)

where a specifies the start of the interval, b specifies the end of the interval, and nidentifies the number of elements. Thus, to create a vector of numbers equallydistributed between and use the following command:b = 10,a = 1

n = 13

DorfAppBff.qxd 7/2/07 9:04 PM Page 980

Modern Control Systems, Eleventh Edition, by Richard C Dorf and Robert H. Bishop.ISBN: 0132270285. © 2008 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.

This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in aretrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise.

For information regarding permission(s), write to: Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.

Page 11: MathScript Basics - Savvas

Section B.5 Syntax 981

>>G = linspace (1, 10, 13)

G=

1 1.75 2.5 3.25 4 4.75 5.5 6.25 7

7.75 8.5 9.25 10

If you do not specify a value for n, the linspace command will automatically return a vec-tor of 100 elements. To select a subset of G that consists of all elements after a specifiedindex location, you can use the syntax described in guideline 4 and the end function tospecify the end of the vector. For example, the following command will return all elementsof G from the fifth element to the final element:

>>H=G(5: end(G))

H =

4 4.75 5.5 6.25 7 7.75 8.5 9.25 10

The function linspace is an example of a built-in MathScript function. Calling user-definedfunctions are discussed further in Section B.4.1.

6. Assigning data types to variables: MathScript variables adapt to data types. For example, if

then a is a double-precision floating-point number. If

then a is a string.

7. Using complex numbers: You can use either i or j to represent the imaginary unit equalto the square root of If you assign values to either i or j in your scripts, then thosevariable names are no longer complex numbers. For example, if you let theny is a complex number with real part equal to 4 and imaginary part equal to If how-ever, you assign and then compute the result is a real number.

8. Matrix operations: Many of the same mathematical functions used on scalars can alsobe applied to matrices and vectors. Consider adding two matrices K and L, where

To add the two matrices K and L, element by element, enter the following MathScriptcommand:

>>K+L

ans =

0 2 0

4 11 -2

1 0 7

K = C -1 2 04 10 -21 0 6

S and L = C1 0 00 1 00 0 1

S .

y = 7,y = 4 + j,j = 3,+j.

y = 4 + j,-1.

a = ‘temperature’

a = sin(3 * pi/2)

DorfAppBff.qxd 7/2/07 9:04 PM Page 981

Modern Control Systems, Eleventh Edition, by Richard C Dorf and Robert H. Bishop.ISBN: 0132270285. © 2008 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.

This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in aretrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise.

For information regarding permission(s), write to: Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.

Page 12: MathScript Basics - Savvas

982 Appendix B MathScript Basics

In a similar fashion, you can also multiply two matrices K and L, as follows:

>>K*L

ans =

-1 2 0

4 10 -2

1 0 6

Consider the matrix M (column vector) and the matrix N (row vector)

Then, the product is the matrix

>>M*N

ans =

0 1 2

0 2 40 3 6

and the product is a scalar

>>N*Mans =

8

To multiply two matrices, they must be of compatible dimensions. For example, supposea matrix M is of dimension and a second matrix N is of dimension Thenyou can multiply resulting in an matrix. In the example above, the matrix M (column vector) was multiplied with the matrix N (row vector) result-ing in a matrix. You cannot multiply unless In the exampleabove, the matrix N (row vector) was multiplied with the matrix M(column vector) resulting in a matrix (a scalar), so in this case,

When working with vectors and matrices in MathScript, it is often useful to per-form mathematical operations element-wise. For example, consider the two vectors

In light of our previous discussion, it is not possible to compute since the dimen-sions are not compatible. However, you can multiply the vectors element-wise using thesyntax for the multiplication operator, as follows:

M. * N = C -1 * 24 * (-2)

0 * 1S = C -2

-80S .

‘.*’

M * N

M = C -140S and N = C 2

-21S .

m = p = 1.1 * 13 * 11 * 3

m = p.N * M3 * 31 * 3

3 * 1m * pM * Nn * p.m * n,

N * M

3 * 3M * N

M = C123S and N = [0 1 2].

1 * 33 * 1

DorfAppBff.qxd 7/2/07 9:04 PM Page 982

Modern Control Systems, Eleventh Edition, by Richard C Dorf and Robert H. Bishop.ISBN: 0132270285. © 2008 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.

This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in aretrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise.

For information regarding permission(s), write to: Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.

Page 13: MathScript Basics - Savvas

Section B.5 Syntax 983

By definition, matrix addition and subtraction occurs element-wise. However, it is alsopossible to perform division element-wise. For M and N as above, we find that element-wise division yields

Element-wise operations are useful in plotting functions. For example, suppose thatyou wanted to plot for This would be achieved via thecommands

t = [0 : 0.1 : 10].y = t sin(t)

M./N = C -1/24/(-2)

0/1S = C -0.5

-20S .

t=[0:0.1:10];y=t .* sin(t);plot(t,y)

Element-wise multiplication using .*

9. Logical expressions: MathScript can evaluate logical expressions such as EQUAL,NOT EQUAL, AND, and OR. To perform an equality comparison, use the statement

If a is equal to b, MathScript will return a 1 (indicating True); if a and b are not equal,MathScript will return a 0 (indicating False). To perform an inequality comparison, usethe statement

If a is not equal to b, MathScript will return a 1 (indicating True); if a and b are equal,MathScript will return a 0 (indicating False).

In other scenarios, you may want to use MathScript to evaluate compound logicalexpressions, such as when at least one expression of many is True (OR), or when all ofyour expressions are True (AND). The compound logical expression AND is executedusing the ‘&’ command. The compound logical expression OR is executed using the command.

10. Control flow constructs: Table B.2 provides the MathScript syntax for commonly usedprogramming constructs.

11. Adding comments: To add comments to your scripts, precede each line of documenta-tion with a % character. For example, consider a script that has two inputs, x and y, andcomputes the addition of x and y as the output variable z.

% In this script, the inputs are x and y

Comments% and the output is z.% z is the addition of x and y

The script shown above has three comments, all preceded by the % character. In thenext section, we will discuss more details on how to use comments to provide help doc-umentation.

Some considerations that have a bearing on your usage of MathScript follow:

1. You cannot define variables that begin with an underscore, white space, or digit. Forexample, you can name a variable time, but you cannot name a variable 4time or _time.

2. MathScript variables are case sensitive. The variables X and x are not the same variables.

z = x + y;

r

‘ ƒ ’

a ' = b

a = = b

DorfAppBff.qxd 7/2/07 9:04 PM Page 983

Modern Control Systems, Eleventh Edition, by Richard C Dorf and Robert H. Bishop.ISBN: 0132270285. © 2008 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.

This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in aretrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise.

For information regarding permission(s), write to: Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.

Page 14: MathScript Basics - Savvas

984 Appendix B MathScript Basics

Table B.2 MathScript syntax for commonly used constructs

Construct Grammar Example

switch switch modeexpression case ‘start’case expression statement-list case ‘end’

Case-Switch [caseStatement expression otherwise

statement-list]end

[otherwise When a case in a case-switch statement executes, LabVIEW does not statement-list] select the next case automatically.Therefore, you do not need toend use break statements as in C.

For Loop for expression for statement-listend end

If-Else if expression if Statement statement-list

[elseif elseexpressionstatement-list] end

[elsestatement-list]end

Range start:[step:]end or t returns an array of numbers with a step size of 0.1If you do not specify a step size, LabVIEW uses a step size of 1.

While Loop while while expressionstatement-listend end

k = k + 1;a = cos(2 * pi * k/10)

k 6 10

0 … t … 10t = [0 : 0.1 : 10]t = 0 : 0.1 : 10

Á

c = 4

c = 3b = = 1

a = sin(2 * pi * k/10)k = 1 : 10

Á

a = a + 1;

a = -1;

a = 0;

Key MathScript Functions

MathScript offers more than 500 textual functions for math, signal processing,and analysis. These are in addition to the more than 600 graphical functions forsignal processing, analysis, and math that are available as VIs within LabVIEW.Table B.3 lists many of the key areas with supporting MathScript functions. For a comprehensive function list, visit the National Instruments website athttp://www.ni.com/mathscript or see the online help.

B.6 DEFINING FUNCTIONS AND CREATING SCRIPTS

You can define functions and create scripts to use in the MathScript Interactive Win-dow. Functions and scripts can be created in the Script Editor window on the Math-Script Interactive Window (see Figure B.2).You can also use your favorite text editorto create functions and scripts. Once your function or script is complete, you shouldsave it for use later. The filename for a function must be the same as the name of thefunction and must have a lowercase .m extension. For example, the filename for a

DorfAppBff.qxd 7/2/07 9:04 PM Page 984

Modern Control Systems, Eleventh Edition, by Richard C Dorf and Robert H. Bishop.ISBN: 0132270285. © 2008 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.

This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in aretrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise.

For information regarding permission(s), write to: Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.

Page 15: MathScript Basics - Savvas

Section B.6 Defining Functions and Creating Scripts 985

2The name starlight does not represent a real function. It is used here for illustrative purposes only.

Table B.3 MathScript Function Classes

Function Classes Brief Description

Control Design and Analysis Classical and state-space control design and analysis functions. Dynamiccharacteristics, root locus, frequency response, Bode, Nyquist, Nichols, modelcontstruction, connection, reduction and more.

Plots Standard x-y plot; mesh plot; 3D plot; surface plot; subplots; stairstep plot;(2D and 3D) logarithmic plots; stem plot and more.

Digital Signal Processing Signal synthesis; Butterworth, Chebyshev, Parks-McClellan, windowed FIR,(DSP) elliptic (Cauer), lattice and other filter designs; FFT (1D/2D); inverse FFT

(1D/2D); Hilbert transform; Hamming, Hanning, Kaiser-Bessel and otherwindows; pole/zero plotting and others.

Approximation Cubic spline, cubic Hermite and linear interpolation; exponential, linear and(Curve Fitting & Interpolation) power fit; rational approximation and others.

Ordinary Differential Equation Adams-Moulton, Runge-Kutta, Rosenbrock and other continuous ordinary(ODE) Solvers differential equation (ODE) solvers.

Polynomial Operations Convolution; deconvolution; polynomial fit; piecewise polynomial; partialfraction expansion and others.

Linear Algebra LU, QR, QZ, Cholesky, Schur decomposition; SVD; determinant; inverse;transpose; orthogonalization; solutions to special matrices; Taylor series; realand complex eigenvalues and eigenvectors; polynomial eigenvalue and more.

Matrix Operations Hankel, Hilbert, Rosser, Vandermonde special matrices; inverse;multiplication; division; unary operations and others.

Vector Operations Cross product; curl and angular velocity; gradient; Kronecker tensor productand more.

Probability and Statistics Mean; median; Poisson, Rayleigh, chi-squared, Weibull, T, gammadistributions; covariance; variance; standard deviation; cross correlation;histogram; numerous types of white noise distributions and other functions.

Optimization Quasi-Newton, quadratic, Simplex methods and more.

Advanced Functions Bessel, spherical Bessel, Psi, Airy, Legendre, Jacobi functions; trapezoidal,elliptic exponential integral functions and more.

Basic Absolute value; Cartesian to polar and spherical and other coordinateconversions; least common multiple; modulo; exponentials; logarithmicfunctions; complex conjugates and more.

Trigonometric Standard cosine, sine and tangent; inverse hyperbolic cosine, cotangent,cosecant, secant, sine and tangent; hyperbolic cosine cotangent, cosecant,secant, sine and tangent; exponential; natural logarithm and more.

Boolean and Bit Operations AND, OR, NOT and other logic operations; bitwise shift, bitwise OR andother bitwise operations.

Data Acquisition/Generation Perform analog and digital I/O using National Instruments devices.

Other Programming primitives such as if, for and while loops; unsigned and signeddatatype conversions; file I/O; benchmarking and other timing functions;various set and string operations and more.

user-defined starlight2 function must be starlight.m. Use unique names for all func-tions and scripts and save them in a directory that you specified in the Path section ofthe dialog box.File»MathScript Preferences

DorfAppBff.qxd 7/2/07 9:04 PM Page 985

Modern Control Systems, Eleventh Edition, by Richard C Dorf and Robert H. Bishop.ISBN: 0132270285. © 2008 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.

This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in aretrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise.

For information regarding permission(s), write to: Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.

Page 16: MathScript Basics - Savvas

986 Appendix B MathScript Basics

User-Defined Functions

MathScript offers more than 500 textual functions for math, signal processing, andanalysis. But what if you have a special purpose function that you want to add toyour personal library? This function may be particular to your area of study or re-search, and is one that you need to call as part of a larger program. With MathScriptit is simple to create a function once you understand the basic syntax.

A MathScript function definition must use the following syntax:

function% documentationscript

An example of a user-defined function definition utilizing the proper syntax is

% compute_average determines the average of the two inputs x and y.

Begin each function definition with the term function. The outputs lists the outputvariables of the function. If the function has more than one output variable, enclosethe variables in square brackets and separate the variables with white space or com-mas. The function_name is the name of the function you want to define and is thename that you use when calling the function.The inputs lists the input variables to thefunction. Use commas to separate the input variables. The documentation is the set ofcomments that you want MathScript to return for the function when you execute thehelp command. Comments are preceded with a % character.You can place commentsanywhere in the function; however, LabVIEW returns only the first comment block inthe Output Window to provide the help to the user. All other comment blocks are forinternal documentation.The script defines the executable body of the function.

Checking the help on the function compute_average.m and then executing thefunction with and as inputs yields

compute_average determines the average of the two inputs x and y.

3

Note that there is a MathScript function named mean that can also be used to com-pute the average of two inputs, as follows:

3

Functions can be edited in the Script Editor window and saved for later use. In FigureB.8, the buttons Load Script, Save Script As, Save & Compile Script As and Run

ans =

»mean([2 4])

ans =

»x = 2; y = 4; compute_average(x, y)

»help compute_average

y = 4x = 2

ave = (x + y)/2;

function ave = compute_average(x, y)

outputs = function_name(inputs)

DorfAppBff.qxd 7/2/07 9:04 PM Page 986

Modern Control Systems, Eleventh Edition, by Richard C Dorf and Robert H. Bishop.ISBN: 0132270285. © 2008 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.

This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in aretrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise.

For information regarding permission(s), write to: Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.

Page 17: MathScript Basics - Savvas

Section B.6 Defining Functions and Creating Scripts 987

Script are shown. You can compile a function when you save it to decrease the run-time compilation time. Selecting Load Script will open a window to browse for thedesired function (or script) to load into MathScript. Similarly, selecting Save ScriptAs will open a browser to navigate to the desired folder to save the function.

In Figure B.8, the function compute_average is used to compute the averageof two arrays. Notice that the function computes the average element-wise. Ifcompute_average had inadvertently been named mean, then LabVIEW would ex-ecute the user-defined function instead of the built-in function. Generally it is not agood idea to redefine LabVIEW functions, and students should avoid doing so. Ifyou define a function with the same name as a built-in MathScript function, Lab-VIEW executes the function you defined instead of the original MathScript func-tion. When you execute the help command, LabVIEW returns help content for thefunction you defined and not the help content for the original MathScript function.

Other examples of valid function syntax for the starlight function include:

function starlight % No inputs and no outputsfunction % No inputs and one outputfunction % No inputs and two outputsfunction starlight (g) % One input and no outputsfunction (g) % One input and one outputfunction (g) % One input and two outputsfunction starlight (g, h) % No inputs and two outputsfunction (g, h) % One input and two outputsfunction (g, h) % Two inputs and two outputs

There are several restrictions on the use of functions. First, if you define multiplefunctions in one MathScript file, all functions following the first are subfunctionsand are accessible only to the main function. A function can call only those func-tions that you define below it. Second, you cannot call functions recursively. For ex-ample, the function starlight cannot call starlight. And third, LabVIEW also doesnot allow circular recursive function calls. For example, the function starlight cannotcall the function bar if bar calls starlight.

Scripts

A script is a sequence of MathScript commands that you want to perform to accom-plish a task. For convenience and reusability, once you have created a script, you cansave it and load it into another session of LabVIEW at a later time. Also, often youcan use a script designed for a different task as a starting point for the developmentof a new script. Since the scripts themselves are saved as common ascii text and ed-itable with any text editor (including the one found in the MathScript InteractiveWindow), it is easy to do this. The MathScript functions as well as the user-definedfunctions can be employed in scripts.

Continuing the example above, suppose that we used a script to compute theaverage of two numbers. The compute_average function could be used within thescript. Once saved, the script can subsequently be loaded into MathScript for use inanother session.A script using the compute_average function is shown in Figure B.9.

[a b] = starlighta = starlight

[a b] = starlighta = starlight

[a b] = starlighta = starlight

DorfAppBff.qxd 7/2/07 9:04 PM Page 987

Modern Control Systems, Eleventh Edition, by Richard C Dorf and Robert H. Bishop.ISBN: 0132270285. © 2008 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.

This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in aretrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise.

For information regarding permission(s), write to: Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.

Page 18: MathScript Basics - Savvas

988 Appendix B MathScript Basics

Results ofexecuting script

are displayed Script that uses thecompute_averagefunction

Select Run

FIGURE B.9 Editing, saving, and running a script to compute the average of two arrays element-wise.

B.7 SAVING AND LOADING DATA FILES AND SCRIPTS

In MathScript you can save and load data files in the MathScript Interactive Win-dow. A data file contains numerical values for variables. Being able to save and loaddjata gives you the flexibility to save important data output from a MathScript ses-sion for use in external programs. There are two ways to save data files. The first

Script Editor

The functioncompute_average.m

Select Save to browse for adirectory to save the function

Running the functionfor x � [1 4] and y � [2 6]

yields the average [1.5 5]

Select Load to browse for a function to load in MathScript

FIGURE B.8 Loading and saving functions.

DorfAppBff.qxd 7/2/07 9:04 PM Page 988

Modern Control Systems, Eleventh Edition, by Richard C Dorf and Robert H. Bishop.ISBN: 0132270285. © 2008 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.

This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in aretrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise.

For information regarding permission(s), write to: Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.

Page 19: MathScript Basics - Savvas

Section B.7 Saving, and Loading Data Files and Scripts 989

method saves the data for all the variables in the workspace, and the second methodallows you to select the variables to save to a file.

To save all the variables in the workspace, select in the Math-Script Interactive Window. You also can right-click the Variable List on the Vari-ables window and select Save Data from the shortcut menu. In the file dialog box,navigate to the directory in which you want to save the data file. Enter a name forthe data file in the File name field and click the OK button to save the data file.

The second method allows you to select the variables to save. In this case, in theCommand Window, enter the command save filename var1, var2, varn, wherefilename is the name of the file to store the data and var1, var2, varn are the vari-ables that you want to save. In this case, the data will be saved in filename in theLabVIEW Data directory in the path specified in In Figure B.10 the process of saving data is illustrated. In Figure B.10a, all the vari-ables are saved in the file save_all.mlv after navigating to the folder LabVIEW Data.In Figure B.10b, the variable x is saved in the file save_x.mlv.

You also can load existing data files into your MathScript session. In the Math-Script Interactive Window, select or right-click the Variable List onFile»Load Data

File»MathScript Preferences Á .

…….,

File»Save Data

Select Save Data to save all variables

Navigate to desired folder

Select OK when doneEnter desired file name

Save select variablesIn this case, save thevariable x in the file

save_x.mlv

Location ofsaved data

(a)

(b)

FIGURE B.10 Saving data files. (a) Saving all the variables in the workspace. (b) Saving select variables.

DorfAppBff.qxd 7/2/07 9:04 PM Page 989

Modern Control Systems, Eleventh Edition, by Richard C Dorf and Robert H. Bishop.ISBN: 0132270285. © 2008 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.

This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in aretrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise.

For information regarding permission(s), write to: Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.

Page 20: MathScript Basics - Savvas

990 Appendix B MathScript Basics

FIGURE B.11 Loading data from a previous MathScript session.

the Variables window and select Load Data from the shortcut menu to load the datafile you want, as illustrated in Figure B.11. Note that you must save data files beforeyou can load them into the MathScript Interactive Window.

Being able to save scripts is an important feature giving you the capability to de-velop a library of scripts that you can readily access in future MathScript sessions.Tosave a script that you have created in the Script Editor window, select

as illustrated in Figure B.12a. You can also save your script byclicking the Save button on the Script Editor window of the MathScript InteractiveWindow, as illustrated in Figure B.12b. In both cases, a file dialog box will appear foryou to navigate to the directory in which you want to save the script. Enter a namefor the script in the File name field.The name must have a lowercase .m extension ifyou want LabVIEW to run the script (in this example, we use the name average_example.m). Click the OK button to save the script.

You can compile a script by selecting or by clickingon the Save & Compile Script As button in the MathScript Interactive Window.This willsave and compile the script to decrease the run-time compilation time.You can load ex-isting scripts into the MathScript Interactive Window.This will be useful upon returningto a MathScript session or if you want to use a script in the current session that was de-veloped in a previous session.To load an existing script, select or clickthe Load button on the Script page on the MathScript Interactive Window.

Figure B.13 illustrates the process of loading scripts. In the example, the scriptcompute_average.m is loaded into a MathScript session, and then using the RunScript As button, the script is executed.

File»Load Script

File»Save & Compile Script

File»Save Script As,

DorfAppBff.qxd 7/2/07 9:04 PM Page 990

Modern Control Systems, Eleventh Edition, by Richard C Dorf and Robert H. Bishop.ISBN: 0132270285. © 2008 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.

This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in aretrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise.

For information regarding permission(s), write to: Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.

Page 21: MathScript Basics - Savvas

Section B.7 Saving, Loading, and Exporting Data Files and Scripts 991

Select Save Script

Navigate to desired folder

Select OKwhen done

Name fileto savescript

(a)

(b)

FIGURE B.12 (a) Saving a script using the pull-down menu. (b) Saving ascript using the Save Script As button on the MathScript Interactive Window.

File»Save Script As

Select desired file

SelectLoad

Script

Select Load(a)

(b)

FIGURE B.13(a) Loading a scriptusing the

pull-down menu. (b) Loading a scriptusing the LoadScript button onthe MathScriptInteractive Window.

File»Load Script

DorfAppBff.qxd 7/2/07 9:04 PM Page 991

Modern Control Systems, Eleventh Edition, by Richard C Dorf and Robert H. Bishop.ISBN: 0132270285. © 2008 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.

This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in aretrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise.

For information regarding permission(s), write to: Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.

Page 22: MathScript Basics - Savvas

992 Appendix B MathScript Basics

MATHSCRIPT BASICS: PROBLEMS

B.1 Write a script to generate a matrix M of ran-dom numbers using the rand function. Use the helpcommand for syntax help on the rand function. Verifythat each time you run the script the matrix M changes.

B.2 In the MathScript Interactive Window, create a scriptthat generates a time vector over the interval 0 to 10with a step size of 0.5 and creates a second vector, y,according to the equation

Add the plot function to generate a graph of y versus t.Type the script in the Script Editor window and, whendone, use the Save button in the Script Editor to savethe script. Clear the script from the Script Editor win-dow, and then Load the script back into the Script Edi-tor and select Run.

B.3 Create a plot of the cosine function,where t varies from 0 to with an increment of

B.4 Open the MathScript Interactive Window. In theCommand Window, create the matrices A and B:

A = C 1 - 20 3

- 1 5S and B = B1 - 1 7

2 0 - 2R .

p/20.p,y = cos(t),

y = e-t(0.5 sin 0.1t - 0.25 cos 0.2t).

3 * 2 Is it possible to perform the following math opera-tions on the matrices? If so, what is the result?(a)(b)(c)(d) (where is the transpose of B)(e)

B.5 Using MathScript, generate a plot of a sine wave offrequency Use the linspace functionto generate the time vector starting at and end-ing at Label the x-axis as Time (sec). Label they-axis as Add the following title to the plot:Sine wave with frequency

B.6 The rand function generates uniformly distributedrandom numbers between 0 and 1. This means that theaverage of all of the random values generated by therand function should approach 0.5 as the number ofrandom numbers increases. Using the rand function,generate random vectors of length 5, 100, 500, and 1000.Confirm that as the number of elements increases, theaverage of the random numbers approaches 0.5. Gen-erate a plot of the average of the random numbers as afunction of the number of random numbers. Use bothrand and mean functions in your script.

w � 10 rad/sec.sin(w * t).

t = 10.t = 0

v = 10 rad/sec.

A./B’B’A + B’

A + BB * AA * B

DorfAppBff.qxd 7/2/07 9:04 PM Page 992

Modern Control Systems, Eleventh Edition, by Richard C Dorf and Robert H. Bishop.ISBN: 0132270285. © 2008 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved.

This material is protected by Copyright and written permission should be obtained from the publisher prior to any prohibited reproduction, storage in aretrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise.

For information regarding permission(s), write to: Rights and Permissions Department, Pearson Education, Inc., Upper Saddle River, NJ 07458.