Matlab Simulink 7
Differential equations with MATLAB: updated for MATLAB 7 and Simulink 6 [Book]By Brian R. Hunt - Wiley (2005) - Paperback - 295 pages - ISBN 0471718122
"Differential Equations with MATLAB" (2nd ed.) by B. Hunt, R. Lipsman, J.Osborn and J.Rosenberg is a supplemental text that can enrich and enhance any first course in ordinary differential equations. Designed to accompany Wiley's ODE texts written by Boyce/DiPrima, Borrelli/Coleman and Lomen/Lovelock, this supplement helps instructors move towards an earlier use of numerical and geometric methods, place a greater emphasis on systems (including nonlinear ones), and increase discussi... Read more [ Report abuse or wrong photo | Share your Matlab Simulink 7 photo ]
Manual
Download
(English)
|
Matlab Simulink 7
Video review
USB HID Real Time Data Acquisition into Matlab/Simulink Demonstration (part ...
User reviews and opinions
No opinions have been provided. Be the first and add a new opinion/review.
Documents

How to Contact The MathWorks:
www.mathworks.com comp.soft-sys.matlab suggest@mathworks.com bugs@mathworks.com doc@mathworks.com
Web Newsgroup Product enhancement suggestions Bug reports Documentation error reports
ISBN 0-9755787-6-6
Learning MATLAB COPYRIGHT 1984 - 2005 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, Simulink, Stateflow, Handle Graphics, Real-Time Workshop, and xPC TargetBox are registered trademarks of The MathWorks, Inc. Other product or brand names are trademarks or registered trademarks of their respective holders. Patents The MathWorks products are protected by one or more U.S. patents. Please see www.mathworks.com/patents for more information.
Revision History
August 1999 January 2001 November 2002 July 2004 December 2005 First printing Second printing Third printing Fourth printing Fifth printing New manual Revised for MATLAB 6.0 (Release 12) Revised for MATLAB 6.5 (Release 13) Revised for MATLAB 7.0 (Release 14) Revised for MATLAB 7.1 (Release 14SP3)
Contents
Introducing MATLAB & Simulink Student Version
Quick Start. 1-2 About the Student Version. 1-3 Student Use Policy. 1-3 Student Version Activation. 1-4 Obtaining Additional MathWorks Products. 1-5 Getting Started with MATLAB. 1-6 Finding Reference Information. 1-7 Troubleshooting. 1-8 Other Resources. 1-9 Documentation. 1-9 MathWorks Web Site. 1-9 MathWorks Academia Web Site. 1-9 MATLAB and Simulink Based Books. 1-9 MathWorks Store. 1-9 MATLAB Central File Exchange/Newsgroup Access. 1-10 Technical Support. 1-10 Differences Between the Student and Professional Versions. MATLAB. Simulink. Symbolic Math Toolbox.
1-11 1-11 1-11 1-12
Installing MATLAB & Simulink Student Version
Installing on Windows. System Requirements. Installing and Activating the Student Version. Installing Additional Toolboxes. Accessing the Online Documentation (Help).
2-2 2-2 2-3 2-5 2-6
Installing on Mac OS X. 2-7 System Requirements. 2-7 Installing and Activating the Student Version. 2-8 Installing Additional Toolboxes. 2-14 Accessing the Online Documentation (Help). 2-14 Mac OS X Documentation. 2-15 Installing on Linux. System Requirements. Installing and Activating the Student Version. Installing Additional Toolboxes. Accessing the Online Documentation (Help).
Student Use Policy
This MATLAB & Simulink Student Version License is for use in conjunction with courses offered at degree-granting institutions. The MathWorks offers this license as a special service to the student community and asks your help in seeing that its terms are not abused. To use this Student License, you must be a student either enrolled in a degree-granting institution or participating in a continuing education program at a degree-granting educational university.
You may not use this Student License at a company or government lab. Also, you may not use it if you are an instructor at a university, or for research, commercial, or industrial purposes. In these cases, you can acquire the appropriate professional or academic license by contacting The MathWorks.
Student Version Activation
Activation is a secure process that verifies licensed student users. This process validates the serial number and ensures that it is not used on more systems than allowed by the MathWorks End User License Agreement. The activation technology is designed to provide an easier and more effective way for students to authenticate and use their product than prior releases of MATLAB & Simulink Student Version. The quickest way to activate your software is to use the activation program that starts following product installation. The activation program will guide you through the activation process. Alternatively, you can activate your software on the mathworks.com Web site. Activation requires completion of three activities: Provide registration information by creating a MathWorks Account. Provide your serial number and the Machine ID for the computer you will be installing the software on. For those students who did not provide proof of student status at the time of purchase, submission and verification of proof of student status is needed. For more information on activation, see
www.mathworks.com/academia/student_version/activation.html.
Obtaining Additional MathWorks Products
Many college courses recommend MATLAB and Simulink as standard instructional software. In some cases, the courses may require particular toolboxes, blocksets, or other products. Toolboxes and blocksets are add-on products that extend MATLAB and Simulink with domain-specific capabilities. Many of these products are available for MATLAB & Simulink Student Version. You may purchase and download these additional products at special student prices from the MathWorks Store at www.mathworks.com/store. Some of the products you can purchase include Bioinformatics Toolbox Communications Blockset Control System Toolbox Fixed-Point Toolbox Fuzzy Logic Toolbox Image Processing Toolbox Neural Network Toolbox Optimization Toolbox Signal Processing Toolbox Statistics Toolbox Stateflow (A demo version of Stateflow is included with your MATLAB & Simulink Student Version.) For an up-to-date list of available products and their product dependencies, visit the MathWorks Store.
Note The toolboxes and blocksets that are available for MATLAB & Simulink Student Version have the same functionality as the professional versions. However, the student versions of the toolboxes and blocksets will work only with the Student Version. Likewise, the professional versions of the toolboxes and blocksets will not work with the Student Version.
Getting Started with MATLAB
What I Want What I Should Do
I need to install and activate MATLAB. I want to start MATLAB.
See Chapter 2, Installing MATLAB & Simulink Student Version.
(Microsoft Windows) Double-click the MATLAB icon on your
desktop.
(Macintosh OS X) Double-click the MATLAB icon on your desktop. (Linux) Enter the matlab command at the command prompt.
Im new to MATLAB and want to learn it quickly.
Start by reading Chapter 3, Introduction, through Chapter 6, Programming, in this book. The most important things to learn are how to enter matrices, how to use the : (colon) operator, and how to invoke functions. You will also get a brief overview of graphics and programming in MATLAB. After you master the basics, you can access the rest of the documentation through the online help facility (Help). There are numerous demonstrations and video tutorials included with MATLAB. You can see these by clicking Demos in the Help browser or selecting Demos from the Help menu. There are demonstrations of mathematics, graphics, programming, and much more. You also will find a large selection of demos at www.mathworks.com/demos.
I want to look at some samples of what you can do with MATLAB.
Finding Reference Information
I want to know how to use a specific function.
Use the online help facility (Help). To access Help, use the command helpbrowser or use the Help menu. MATLAB Functions: Volume 1 (A-E), Volume 2 (F-O), and Volume 3 (P-Z) are also available in PDF format from Printing the Documentation Set on the MATLAB product page. There are several choices: From Help, browse the MATLAB functions by selecting Functions Categorical List or Functions Alphabetical List. Use lookfor (e.g., lookfor inverse) from the command line. Use Index or Search from Help.
I want to find a function for a specific purpose, but I dont know the function name.
I want to learn about a specific topic such as sparse matrices, ordinary differential equations, or cell arrays. I want to know what functions are available in a general area. I want to learn about the Symbolic Math Toolbox.
Use Help to locate the appropriate sections in the MATLAB documentation, for example, MATLAB -> Mathematics -> Sparse Matrices.
Use Help to view Functions Categorical List under MATLAB. Help provides access to the reference pages for the hundreds of functions included with MATLAB. See Chapter 9, Introducing the Symbolic Math Toolbox, and Chapter 10, Using the Symbolic Math Toolbox, in this book. For complete descriptions of the Symbolic Math Toolbox functions, use Help and select Functions Categorical List or Functions Alphabetical List from the Symbolic Math Toolbox documentation.
corresponding information. At the completion of the activation process, you will be able to use your Student Version of MATLAB & Simulink. In certain cases, your software will be temporarily activated for 30 days until your proof of student status is verified. In these cases, you will be reminded that your activation is temporary and that you need to complete the activation
process. Once your proof of student status is verified, your activation is complete. Note If you encounter a problem during the activation process, check www.mathworks.com/academia/student_version/activation.html for more information.
on your desktop. For More Information The Installation Guide for Mac OS X documentation provides additional installation information. This manual is available from Help.
To purchase additional toolboxes, visit the MathWorks Store at www.mathworks.com/store. Once you purchase a toolbox, the product and its online documentation are downloaded to your computer. When you download a toolbox, you receive a file for the toolbox. Double-clicking the downloaded files icon creates a folder that contains the installation program for the toolbox. To install the toolbox and its documentation, run the installation program by double-clicking its icon. After you successfully install the toolbox, all of its functionality and documentation will be available to you when you start MATLAB.
Mac OS X Documentation
In general, the documentation for MathWorks products is not specific for individual platforms unless the product is available only on a particular platform. For the Macintosh, when you access a products documentation either in print or online through the Help browser, make sure you refer to the UNIX platform if there is different documentation for different platforms.
Installing on Linux
This section describes the system requirements necessary to install MATLAB & Simulink Student Version on a Linux computer. It also provides step-by-step instructions for installing and activating the software.
Linux Kernel 2.4.x; glibc (glibc6) 2.3.2 and 2.2.5 or Linux 2.6.x; (glibc6) 2.3.2 Intel Pentium III processor or later, Celeron processor or Intel Xeon processor family; AMD Athlon / Duron/ Opteron; or compatible processor 256 MB RAM (512 MB recommended) 500 MB disk space 16-bit graphics or higher adaptor and display (24-bit recommended) CD-ROM or DVD drive (for installation) E-mail (required), internet access (recommended) for product activation
The following instructions describe how to install and activate MATLAB & Simulink Student Version on a Linux computer.
Note On most systems, you will need root privileges to perform certain steps in the installation procedure.
If your CD-ROM drive is not accessible to your operating system, you will need to mount the CD-ROM drive on your system. Create a directory to be the mount point for it.
More About Matrices and Arrays (p. 4-18) Controlling Command Window Input and Output (p. 4-28)
Matrices and Magic Squares
In MATLAB, a matrix is a rectangular array of numbers. Special meaning is sometimes attached to 1-by-1 matrices, which are scalars, and to matrices with only one row or column, which are vectors. MATLAB has other ways of storing both numeric and nonnumeric data, but in the beginning, it is usually best to think of everything as a matrix. The operations in MATLAB are designed to be as natural as possible. Where other programming languages work with numbers one at a time, MATLAB allows you to work with entire matrices quickly and easily. A good example matrix, used throughout this book, appears in the Renaissance engraving Melencolia I by the German artist and amateur mathematician Albrecht Drer.
This image is filled with mathematical symbolism, and if you look carefully, you will see a matrix in the upper right corner. This matrix is known as a magic square and was believed by many in Drers time to have genuinely magical properties. It does turn out to have some fascinating characteristics worth exploring.
Entering Matrices
The best way for you to get started with MATLAB is to learn how to handle matrices. Start MATLAB and follow along with each example. You can enter matrices into MATLAB in several different ways: Enter an explicit list of elements. Load matrices from external data files. Generate matrices using built-in functions. Create matrices with your own functions in M-files. Start by entering Drers matrix as a list of its elements. You only have to follow a few basic conventions: Separate the elements of a row with blanks or commas. Use a semicolon, ; , to indicate the end of each row. Surround the entire list of elements with square brackets, [ ].
To enter Drers matrix, simply type in the Command Window
A = [2 13; 11 8; 7 12; 14 1]
MATLAB displays the matrix you just entered.
A = 12 1
This matrix matches the numbers in the engraving. Once you have entered the matrix, it is automatically remembered in the MATLAB workspace. You can refer to it simply as A. Now that you have A in the workspace, take a look at what makes it so interesting. Why is it magic?
sum, transpose, and diag
You are probably already aware that the special properties of a magic square have to do with the various ways of summing its elements. If you take the sum along any row or column, or along either of the two main diagonals, you will always get the same number. Let us verify that using MATLAB. The first statement to try is
sum(A)
MATLAB replies with
ans = 34 34
When you do not specify an output variable, MATLAB uses the variable ans, short for answer, to store the results of a calculation. You have computed a row vector containing the sums of the columns of A. Sure enough, each of the columns has the same sum, the magic sum, 34. How about the row sums? MATLAB has a preference for working with the columns of a matrix, so the easiest way to get the row sums is to transpose the matrix, compute the column sums of the transpose, and then transpose the result. MATLAB has two transpose operators. The apostrophe operator (e.g., A') performs a complex conjugate transposition. It flips a matrix about its main
B = [A A+32; A+48 A+16]
The result is an 8-by-8 matrix, obtained by joining the four submatrices.
B = 28 17
This matrix is halfway to being another magic square. Its elements are a rearrangement of the integers 1:64. Its column sums are the correct value for an 8-by-8 magic square.
sum(B) ans = 260
But its row sums, sum(B')', are not all the same. Further manipulation is necessary to make this a valid 8-by-8 magic square.
Deleting Rows and Columns
You can delete rows and columns from a matrix using just a pair of square brackets. Start with
X = A;
Then, to delete the second column of X, use
X(:,2) = []
This changes X to
X = 12 1
If you delete a single element from a matrix, the result is not a matrix anymore. So, expressions like
X(1,2) = []
result in an error. However, using a single subscript deletes a single element, or sequence of elements, and reshapes the remaining elements into a row vector. So
X(2:2:10) = []
results in
More About Matrices and Arrays
This section shows you more about working with matrices and arrays, focusing on Linear Algebra on page 4-18 Arrays on page 4-21 Multivariate Data on page 4-24 Scalar Expansion on page 4-25 Logical Subscripting on page 4-26 The find Function on page 4-27
Linear Algebra
Informally, the terms matrix and array are often used interchangeably. More precisely, a matrix is a two-dimensional numeric array that represents a linear transformation. The mathematical operations defined on matrices are the subject of linear algebra. Drers magic square
A = []
provides several examples that give a taste of MATLAB matrix operations. You have already seen the matrix transpose, A'. Adding a matrix to its transpose produces a symmetric matrix.
A + A' ans = 11 17
The multiplication symbol, *, denotes the matrix multiplication involving inner products between rows and columns. Multiplying the transpose of a matrix by the original matrix also produces a symmetric matrix.
A'*A ans = 206 360
368 206
370 212
212 378
The determinant of this particular matrix happens to be zero, indicating that the matrix is singular.
d = det(A) d = 0
The reduced row echelon form of A is not the identity.
R = rref(A) R = 1 -0
Since the matrix is singular, it does not have an inverse. If you try to compute the inverse with
X = inv(A)
you will get a warning message
Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 9.796086e-018.
Roundoff error has prevented the matrix inversion algorithm from detecting exact singularity. But the value of rcond, which stands for reciprocal condition estimate, is on the order of eps, the floating-point relative precision, so the computed inverse is unlikely to be of much use.
x = 0:pi/100:2*pi; y = sin(x); plot(x,y)
Now label the axes and add a title. The characters \pi create the symbol. See the text string property for more symbols.
xlabel('x = 0:2\pi') ylabel('Sine of x') title('Plot of the Sine Function','FontSize',12)
Plot of the Sine Function
1 0.8 0.6 0.4 0.2 Sine of x 0 0.2 0.4 0.6 0.0
3 x = 0:2
Multiple Data Sets in One Graph
Multiple x-y pair arguments create multiple graphs with a single call to plot. MATLAB automatically cycles through a predefined (but user settable) list of colors to allow discrimination among sets of data. See the axes ColorOrder and LineStyleOrder properties. For example, these statements plot three related functions of x, with each curve in a separate distinguishing color.
x = 0:pi/100:2*pi; y = sin(x); y2 = sin(x-.25); y3 = sin(x-.5); plot(x,y,x,y2,x,y3)
The legend command provides an easy way to identify the individual plots.
legend('sin(x)','sin(x-.25)','sin(x-.5)')
1 sin(x) sin(x.25) sin(x.5)
For More Information See Defining the Color of Lines for Plotting in Axes Properties in the MATLAB documentation.
Specifying Line Styles and Colors
It is possible to specify color, line styles, and markers (such as plus signs or circles) when you plot your data using the plot command.
plot(x,y,'color_style_marker') color_style_marker is a string containing from one to four characters
(enclosed in single quotation marks) constructed from a color, a line style, and a marker type: Color strings are 'c', 'm', 'y', 'r', 'g', 'b', 'w', and 'k'. These correspond to cyan, magenta, yellow, red, green, blue, white, and black. Line style strings are '-' for solid, '--' for dashed, ':' for dotted, '-.' for dash-dot. Omit the line style for no line. The marker types are '+', 'o', '*', and 'x', and the filled marker types are 's' for square, 'd' for diamond, '^' for up triangle, 'v' for down triangle, '>' for right triangle, '<' for left triangle, 'p' for pentagram, 'h' for hexagram, and none for no marker. You can also edit color, line style, and markers interactively. See Editing Plots on page 5-16 for more information.
Plotting Lines and Markers
If you specify a marker type but not a line style, MATLAB draws only the marker. For example,
plot(x,y,'ks')
plots black squares at each data point, but does not connect the markers with a line.
The statement
plot(x,y,'r:+')
plots a red dotted line and places plus sign markers at each data point.
Placing Markers at Every Tenth Data Point
You might want to use fewer data points to plot the markers than you use to plot the lines. This example plots the data twice using a different number of points for the dotted line and marker plots.
x1 = 0:pi/100:2*pi; x2 = 0:pi/10:2*pi; plot(x1,sin(x1),'r:',x2,sin(x2),'r+')
This section describes how to analyze a simple function to find its asymptotes, maximum, minimum, and inflection point. The section covers the following topics: Defining the Function on page 10-21 Finding the Asymptotes on page 10-22 Finding the Maximum and Minimum on page 10-24 Finding the Inflection Point on page 10-26
Defining the Function
The function in this example is 3x + 6x 1 f ( x ) = ------------------------------2 x +x3 To create the function, enter the following commands:
syms x num = 3*x^2 + 6*x -1; denom = x^2 + x - 3; f = num/denom
f = (3*x^2+6*x-1)/(x^2+x-3)
You can plot the graph of f by entering
ezplot(f)
This displays the following plot.
(3 x2+6 x1)/(x2+x3)
Finding the Asymptotes
To find the horizontal asymptote of the graph of f, take the limit of f as x approaches positive infinity:
limit(f, inf) ans = 3
The limit as x approaches negative infinity is also 3. This tells you that the line y = 3 is a horizontal asymptote to the graph. To find the vertical asymptotes of f, set the denominator equal to 0 and solve by entering the following command:
roots = solve(denom)
This returns to solutions to x + x 3 = 0 :
roots = [ -1/2+1/2*13^(1/2)] [ -1/2-1/2*13^(1/2)]
This tells you that vertical asymptotes are the lines 1 + 13 x = -----------------------2 and x = ----------------------2 You can plot the horizontal and vertical asymptotes with the following commands:
ezplot(f) hold on % Keep the graph of f in the figure % Plot horizontal asymptote plot([-2*pi 2*pi], [3 3],'g') % Plot vertical asymptotes plot(double(roots(1))*[1 1], [-5 10],'r') plot(double(roots(2))*[1 1], [-5 10],'r') title('Horizontal and Vertical Asymptotes') hold off
Note that roots must be converted to double to use the plot command.
The preceding commands display the following figure.
Horizontal and Vertical Asymptotes
To recover the graph of f without the asymptotes, enter
Finding the Maximum and Minimum
You can see from the graph that f has a local maximum somewhere between the points x = 2 and x = 3, and might have a local minimum between x = -4 and x = -2. To find the x-coordinates of the maximum and minimum, first take the derivative of f:
convert the zeros to double form:
zerosd = 0 0+ 2.4381i 0- 2.4381i 2.4483 -2.4483
So far, you have found three real zeros and two complex zeros. However, as the following graph of f3 shows, these are not all its zeros:
ezplot(f3) hold on; plot(zerosd,0*zerosd,'ro') % Plot zeros plot([-2*pi,2*pi], [0,0],'g-.'); % Plot x-axis title('Graph of f3')
Graph of f3 3
The red circles in the graph correspond to zerosd(1), zerosd(4), and zerosd(5). As you can see in the graph, there are also zeros at . The additional zeros occur because f (x) contains a factor of sin ( x ) , which is zero at integer multiples of . The function, solve(sin(x)), however, only finds the zero at x = 0. A complete list of the zeros of f (x) in the interval ( ] is
zerosd = [zerosd(1) zerosd(4) zerosd(5) pi];
You can display these zeros on the graph of f (x) with the following commands:
ezplot(f3) hold on; plot(zerosd,0*zerosd,'ro') plot([-2*pi,2*pi], [0,0],'g-.'); % Plot x-axis title('Zeros of f3') hold off;
Zeros of f3 3
Finding the Maxima and Minima of f2
To find the maxima and minima of f (x) , calculate the value of f (x) at each of the zeros of f (x). To do so, substitute zeros into f2 and display the result below zeros:
[zerosd; subs(f2,zerosd)] ans = 0 2.4483 -2.4483 0.0494 1.0051 1.0051
3.1416 -4.0000
This shows the following: f (x) has an absolute maximum at x = 2.4483 , whose value is 1.0051. f (x) has an absolute minimum at x = , whose value is -4. f (x) has a local minimum at x = , whose value is 0.0494. You can display the maxima and minima with the following commands:
clf ezplot(f2) axis([-2*pi 2*pi -4.5 1.5]) ylabel('f2'); title('Maxima and Minima of f2') hold on plot(zeros, subs(f2,zeros), 'ro') text(-4, 1.25, 'Absolute maximum') text(-1,-0.25,'Local minimum') text(.9, 1.25, 'Absolute maximum') text(1.6, -4.25, 'Absolute minimum') hold off;
Maxima and Minima of f2 Absolute maximum 1 Absolute maximum
0 Local minimum 1 fAbsolute minimum x 6
The preceding analysis shows that the actual range of f (x) is [-4, 1.0051].
Integrating
To see whether integrating f (x) twice with respect to x recovers the original function f (x) = 1 ( 5 + 4 cos x ) , enter the command
g = int(int(f2))
g = -8/(tan(1/2*x)^2+9)
This is certainly not the original expression for f(x). Now look at the difference f(x) g(x).
d = f - g pretty(d)
The matrix H from the last section provides the first example:
The matrix is singular, so one of its eigenvalues must be zero. The statement
[T,E] = eig(H)
produces the matrices T and E. The columns of T are the eigenvectors of H:
T = [ 1, 28/153+2/153*12589^(1/2), 28/153-2/153*12589^(12)] [ -4, 1, 1] [ 10/3, 92/255-1/255*12589^(1/2), 292/255+1/255*12589^(12)]
Similarly, the diagonal elements of E are the eigenvalues of H:
E = [0, 0, 0] [0, 32/45+1/180*12589^(1/2), 0] [0, 0, 32/45-1/180*12589^(1/2)]
It may be easier to understand the structure of the matrices of eigenvectors, T, and eigenvalues, E, if you convert T and E to decimal notation. To do so, proceed as follows. The commands
Td = double(T) Ed = double(E)
Td = 1.0000 -4.0000 3.3333 1.6497 1.0000 0.7051 -1.2837 1.0000 1.5851
Ed = 1.0.0878
The first eigenvalue is zero. The corresponding eigenvector (the first column of Td) is the same as the basis for the null space found in the last section. The other two eigenvalues are the result of applying the quadratic formula to
x^2-64/45*x+253/2160
which is the quadratic factor in factor(poly(H)).
syms x g = simple(factor(poly(H))/x); solve(g) ans = [ 32/45+1/180*12589^(1/2)] [ 32/45-1/180*12589^(1/2)]
Closed form symbolic expressions for the eigenvalues are possible only when the characteristic polynomial can be expressed as a product of rational polynomials of degree four or less. The Rosser matrix is a classic numerical analysis test matrix that illustrates this requirement. The statement
R = sym(gallery('rosser'))
generates
R = [ 611 [ 196 [-192 [ 407 [ -8 [ -52 [ -49 [ -192 -71 -43 -8 -44 -407 --23 -8 --208 -52 -44 --49 --911 29] -44] 52] -23] 208] 208] -911] 99]
The commands
p = poly(R); pretty(factor(p))
2 x (x - 1020) (x - 1020 x + 100)(x - 1040500) (x - 1000)
The characteristic polynomial (of degree 8) factors nicely into the product of two linear terms and three quadratic terms. You can see immediately that four of the eigenvalues are 0, 1020, and a double root at 1000. The other four roots are obtained from the remaining quadratics. Use
B e p f = = = = sym(A); eig(B)' poly(B) factor(p)
e = [1, 2, 3]
p = x^3-6*x^2+11*x-6 f = (x-1)*(x-2)*(x-3)
Are the eigenvalues sensitive to the perturbations caused by roundoff error because they are close together? Ordinarily, the values 1, 2, and 3 would be regarded as well separated. But, in this case, the separation should be viewed on the scale of the original matrix. If A were replaced by A/1000, the eigenvalues, which would be.001,.002,.003, would seem to be closer together. But eigenvalue sensitivity is more subtle than just closeness. With a carefully chosen perturbation of the matrix, it is possible to make two of its eigenvalues coalesce into an actual double root that is extremely sensitive to roundoff and other errors.
One good perturbation direction can be obtained from the outer product of the left and right eigenvectors associated with the most sensitive eigenvalue. The following statement creates
E = [130,-390,0;43,-129,0;133,-399,0]
the perturbation matrix
E = 133 -390 -129 -0 0
The perturbation can now be expressed in terms of a single, scalar parameter t. The statements
syms x t A = A+t*E
replace A with the symbolic representation of its perturbation:
A = [-149+130*t, -50-390*t, -154] [ 537+43*t, 180-129*t, 546] [ -27+133*t, -9-399*t, -25]
Computing the characteristic polynomial of this new A
p = poly(A)
p = x^3-6*x^2+11*x-t*x^2+492512*t*x-6-1221271*t
Prettyprinting
pretty(collect(p,x))
shows more clearly that p is a cubic in x whose coefficients vary linearly with t.
3 x + (- t - 6) x 2 + (492512 t + 11) x - 6 - 1221271 t
It turns out that when t is varied over a very small interval, from 0 to 1.0e-6, the desired double root appears. This can best be seen graphically. The first figure shows plots of p, considered as a function of x, for three different values of t: t = 0, t = 0.5e-6, and t = 1.0e-6. For each value, the eigenvalues are computed numerically and also plotted:
x =.8:.01:3.2; for k = 0:2 c = sym2poly(subs(p,t,k*0.5e-6)); y = polyval(c,x); lambda = eig(double(subs(A,t,k*0.5e-6))); subplot(3,1,3-k) plot(x,y,'-',x,0*x,':',lambda,0*lambda,'o') axis([.8 3.2 -.5.5]) text(2.25,.35,['t = ' num2str( k*0.5e-6 )]); end
0.5 t = 1e006 0
0.5 0.5
t = 5e007 0
The bottom subplot shows the unperturbed polynomial, with its three roots at 1, 2, and 3. The middle subplot shows the first two roots approaching each other. In the top subplot, these two roots have become complex and only one real root remains. The next statements compute and display the actual eigenvalues
preallocating 6-31 structure 6-16 variable names 4-10 arrow keys for editing commands 4-30 aspect ratio of axes 5-48 AVI files 5-71 axes managing 5-48 visibility 5-49 axis 5-49 axis function 5-48
backslash operator 10-64 Bessel functions differentiating 10-5 integrating 10-13 besselj 10-5 besselk 10-93 bit map 5-59 blockset 3-4 books MATLAB related 1-9 break function 6-7 built-in functions defined 4-12
calculus 10-2 example 10-20 extended example 10-28 callbacks 7-6 case function 6-4 catch function 6-8
Index-1
cell arrays 6-11 char function 6-15 character arrays 6-13 characteristic polynomial 4-21 circulant matrix 9-13 clear 9-12 clearing variables 9-12 collect 10-42 colon operator 4-7 colormap 5-54 colors lines for plotting 5-41 column space 10-65 Command History 8-5 command line editing 4-30 Command Window 8-4 comp.soft-sys.matlab 1-10 complex numbers plotting 5-43 complex symbolic variables 9-12 concatenation 4-16 strings 6-14 configuring additional products on Windows 2-5 conj 9-12 constants special 4-12 continue function 6-6 continuing statements on multiple lines 4-30 control keys for editing commands 4-30 converting symbolic matrices to numeric form 9-11 current directory 8-9 Current Directory browser 8-9
data source 5-27 debugging M-files 8-13 decimal symbolic expressions 9-10 default symbolic variable 9-9 definite integration 10-12 deleting array elements 4-17 demos MATLAB 1-6 running from the Start button 8-3 desktop for MATLAB 3-7 desktop tools 8-1 determinant of matrix 4-19 diag function 4-4 diff 10-2 differentiation 10-2 digits 9-11 documentation 8-6 Mac OS X 2-15
double
converting to floating-point with 10-60
dsolve 10-90
editing command lines 4-30 Editor/Debugger 8-13 eig 10-67 eigenvalue 4-20 eigenvalue trajectories 10-77 eigenvalues 10-67 computing 10-67 eigenvector 4-20 elements of arrays 4-11 entering matrices 4-3 eps 9-10 erase mode 5-71
Index-2
eval function 6-27
executing MATLAB 3-7 exiting MATLAB 3-7 expand 10-43 exporting graphs 5-35 expressions evaluating 6-27 examples 4-13 using in MATLAB 4-10
function M-files 6-19 naming 6-21 function of two variables 5-52 functions built-in, defined 4-12 defined 6-21 finding specific 1-7 how to find 4-12 running 8-4 variable number of arguments 6-22
Technical specifications
Full description
"Differential Equations with MATLAB" (2nd ed.) by B. Hunt, R. Lipsman, J.Osborn and J.Rosenberg is a supplemental text that can enrich and enhance any first course in ordinary differential equations. Designed to accompany Wiley's ODE texts written by Boyce/DiPrima, Borrelli/Coleman and Lomen/Lovelock, this supplement helps instructors move towards an earlier use of numerical and geometric methods, place a greater emphasis on systems (including nonlinear ones), and increase discussions of both the benefits and possible pitfalls in numerical solution of ODEs. By providing an introduction to the software that is integrated with the relevant mathematics, "Differential Equations with MATLAB" can perfectly complement and enhance these texts.
Tags
KDL-32V4000 S3400 440000 25 LP PS-7900 H UX-W55CW 880GMA-e45 IC-W2A Premium LC-26GA5U 575MM-lm575ea- 8707V Kbic-series Iloa 110 8135H TS0GSJ35u-EU MY2000 CVP-65 CDX-GT350MP SE2453S HD7810-85 HC400MLS SIM D880 TH-42PA20 And F60 SLV3220 FC8732 02 Dslink 260E Polaroid A515 SC-PT475 GS 300 LW20M21C CS 2159 BAR112hgla ML-1630W XEU AR-M237 277 Telstra 6100 Xtreme 870-G45 WS-28M206V NWZ-B152F 932BW Headset Achieva 1995 LE40A676a1M Tiger PL-J2500 I865 CS 820 MFP Logic VSX-1018AH-S 32PFL5404H EOS 50 K-720 Dimension 8100 PCG-K215S Satellite M30 SD-CX9 Review Maker Drive MF-HE700 GVM-1311Q XD250U-ST S3000 Touring L1730B W2271TC-PF DH-200 Makita 9403 Zelda Touring Cs 350 Aopen MX46 10 IV Ketron MS50 4X4-1998 Canon S800 T57520 XDM6825 107625-01 X-trail P1205J S6500 FD Nokia 770 Sport Nokia 6820 H5360 WF0602NCE AF200T DC 32 XVM-F65 D-NF341 LH-T6740A 50-2005 SLV3100 00 PC27R-8 Stylus 830 Pentax 67II DL-500 3 1
manuel d'instructions, Guide de l'utilisateur | Manual de instrucciones, Instrucciones de uso | Bedienungsanleitung, Bedienungsanleitung | Manual de Instruções, guia do usuário | инструкция | návod na použitie, Užívateľská príručka, návod k použití | bruksanvisningen | instrukcja, podręcznik użytkownika | kullanım kılavuzu, Kullanım | kézikönyv, használati útmutató | manuale di istruzioni, istruzioni d'uso | handleiding, gebruikershandleiding
Sitemap
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101

1. THE MathWorks (Learning MatLab 7 & Learning Simulink 6, Student Version, Release 14)
2. MATLAB & SIMULINK Student Version R2007a
3. Modern Control Systems Analysis and Design Using Matlab and Simulink
4. MATLAB in der Ingenieurpraxis
5. Digitale Signalverarbeitung in der Nachrichten bertragung: Elemente, Bausteine, Systeme und ihre Algorithmen (German Edition)
6. Home Networking Basis: Transmission Environments and Wired/Wireless Protocols





