MATLAB Symbolic Math Toolbox

Download MATLAB Symbolic Math Toolbox

Post on 07-Apr-2018

216 views

Category:

Documents

0 download

Embed Size (px)

TRANSCRIPT

<ul><li><p>8/6/2019 MATLAB Symbolic Math Toolbox</p><p> 1/300</p><p>Computation</p><p>Visualization</p><p>Programming</p><p>For Use with MATLAB</p><p>Users Gu ideVersion 2</p><p>Symbolic MathToolbox</p></li><li><p>8/6/2019 MATLAB Symbolic Math Toolbox</p><p> 2/300</p><p>How to Contact The MathWorks:</p><p>508-647-7000 P h on e</p><p>508-647-7001 F a x</p><p>Th e Ma th Wor ks, In c. Ma il</p><p>24 Prime Park Way</p><p>Natick, MA 01760-1500</p><p>http://www.mathworks.com Web</p><p>ftp.mathworks.com Anonymous FTP server</p><p>comp.soft-sys.matlab Newsgroup</p><p>support@mathworks.com Techn ical support</p><p>suggest@mathworks.com Product enhancement suggestions</p><p>bugs@mathworks.com Bug reports</p><p>doc@mathworks.com Documentation error reports</p><p>subscribe@mathworks.com Subscribing user registration</p><p>service@mathworks.com Order status, license renewals, passcodes</p><p>info@mathworks.com Sales, pricing, an d genera l informa tion</p><p>S ymb olic Mat h T oolbox Users Guid e</p><p> COPYRIGHT 1993 - 1998 by The MathWorks, Inc.The softwar e described in this document is furnished un der a license agreement. The software m ay be usedor copied only under the t erms of the license agreement. No part of this manu al ma y be photocopied or repro-duced in a ny form without pr ior wr itten consent from The MathWorks, Inc.</p><p>U.S. GOVERNMENT: If Licensee is acquiring the Programs on behalf of any un it or agency of the U.S.Government , the following shall apply: (a) For un its of the Depart ment of Defense: the Governm ent sh allhave only the rights specified in t he license u nder which the commercial computer softwar e or commer cialsoftware documentat ion was obtained, as set forth in su bparagra ph (a) of the Rights in CommercialComput er Software or Commer cial Software Document ation Clause at DFARS 227.7202-3, therefore t herights set forth h erein shall apply; and (b) For an y other unit or agency: NOTICE: Notwithst anding anyother lease or license a greement t hat may pert ain t o, or a ccompany th e delivery of, the computer softwar e</p><p>and accompanying document ation, the r ights of the Governm ent r egarding its u se, reproduction, and disclo-sure are as set forth in Clause 52.227-19 (c)(2) of the FAR.</p><p>MATLAB, Simulink, Stat eflow, Han dle Graphics, and Real-Time Workshop are r egistered t radema rks, an dTarget Language Compiler is a trademark of The MathWorks, Inc.</p><p>Other product or brand names are trademarks or registered trademarks of their respective holders.</p><p>P r i n t in g H i st or y : Au g u s t 1 99 3 F i r st p r in t i n g</p><p>O ct ob er 1 99 4 S econ d p r in t i n g</p><p>M a y 1 99 7 T h ir d p r in t i n g for S ym b ol ic M a t h T ool box 2 .0</p><p>September 1998 Updated for Release 11 (online only)</p></li><li><p>8/6/2019 MATLAB Symbolic Math Toolbox</p><p> 3/300</p><p>i</p><p>Contents</p><p>1</p><p>T u t o r i a l</p><p>I n t r o d u c t i o n . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2</p><p>G e t t i n g H e l p . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-4</p><p>G e t t i n g S t a r t e d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-5</p><p>Symbolic Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-5Creating Symbolic Variables an d Expressions . . . . . . . . . . . . . 1-6</p><p>Symbolic and N um eric Conversions . . . . . . . . . . . . . . . . . . . . . . 1-7</p><p>Constr ucting Real a nd Complex Variables . . . . . . . . . . . . . . 1-9</p><p>Creating Abstr act Fu nctions . . . . . . . . . . . . . . . . . . . . . . . . 1-10</p><p>Using sym to Access Ma ple Fu nctions . . . . . . . . . . . . . . . . . 1-11</p><p>Exam ple: Crea ting a Symbolic Mat rix . . . . . . . . . . . . . . . . . 1-11</p><p>The Default Symbolic Var iable . . . . . . . . . . . . . . . . . . . . . . 1-13</p><p>Creating Symbolic Math Fu nctions . . . . . . . . . . . . . . . . . . . . . 1-15</p><p>Using S ymbolic Expr essions . . . . . . . . . . . . . . . . . . . . . . . . . 1-15</p><p>Creating a n M-File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-16</p><p>C a l c u l u s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-17</p><p>Differentia tion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-17</p><p>Limits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-21</p><p>Integra tion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-23Integra tion with Real Consta nts . . . . . . . . . . . . . . . . . . . . . 1-26</p><p>Real Varia bles via sym . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-28</p><p>Symbolic Summ at ion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-30</p><p>Taylor Series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-31</p><p>Extended Calculus E xample . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-33</p><p>Plotting Symbolic Fun ctions . . . . . . . . . . . . . . . . . . . . . . . . . 1-33</p></li><li><p>8/6/2019 MATLAB Symbolic Math Toolbox</p><p> 4/300</p><p>i i</p><p>S i m p l i f i c a t i o n s a n d S u b s t i t u t i o n s . . . . . . . . . . . . . . . . . . . . . 1-47</p><p>Simplificat ions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-47</p><p>collect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-48</p><p>expand . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-49horner . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-49</p><p>factor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-50</p><p>simplify . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-52</p><p>simple . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-52</p><p>Substitut ions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-56</p><p>subexpr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-56</p><p>subs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-59</p><p>V a ri a bl e-P reci s i o n A ri thm eti c . . . . . . . . . . . . . . . . . . . . . . . . . 1-64</p><p>Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-64</p><p>Example: Using th e Different Kinds of Arithm etic . . . . . . . . . 1-65</p><p>Rat iona l Arithm etic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-65</p><p>Var iable-Pr ecision Num bers . . . . . . . . . . . . . . . . . . . . . . . . . 1-66</p><p>Converting to Floating-Point . . . . . . . . . . . . . . . . . . . . . . . . 1-67</p><p>Another E xample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-67</p><p>Li nea r A l g ebra . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-69</p><p>Basic Algebra ic Opera tions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-69</p><p>Linear Algebraic Operat ions . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-70</p><p>Eigenvalues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-74</p><p>J orda n Canonical F orm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-81</p><p>Singular Value Decomposition . . . . . . . . . . . . . . . . . . . . . . . . . 1-82</p><p>Eigenvalue Tr ajectories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-86</p><p>S o l v i n g E q u a t i o n s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-96</p><p>Solving Algebra ic Equ at ions . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-96</p><p>Several Algebra ic Equ at ions . . . . . . . . . . . . . . . . . . . . . . . . . . 1-104</p><p>Single Differen tial E qua tion . . . . . . . . . . . . . . . . . . . . . . . . . . 1-107</p><p>Exam ple 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-108</p><p>Exam ple 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-108Exam ple 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-109</p><p>Several Differential E quat ions . . . . . . . . . . . . . . . . . . . . . . . . 1-109</p><p>I n t e g r a l T r a n s f o r m s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-112</p><p>The Fourier and In verse Fourier Tra nsforms . . . . . . . . . . . . 1-112</p><p>The Laplace and In verse Laplace Transforms . . . . . . . . . . . . 1-120</p></li><li><p>8/6/2019 MATLAB Symbolic Math Toolbox</p><p> 5/300</p></li><li><p>8/6/2019 MATLAB Symbolic Math Toolbox</p><p> 6/300</p><p>iv Contents</p></li><li><p>8/6/2019 MATLAB Symbolic Math Toolbox</p><p> 7/300</p><p>1</p><p>Tutorial</p><p>I n t r o d u c t i o n . . . . . . . . . . . . . . . . . . . . 1-2</p><p>G e t t i n g H e l p . . . . . . . . . . . . . . . . . . . . 1-4</p><p>Ge tt i n g S t a rte d . . . . . . . . . . . . . . . . . . 1-5</p><p>C a l c u l u s . . . . . . . . . . . . . . . . . . . . . . 1-17</p><p>S i m p l i f i c a t i o n s a n d S u b s t i t u t i o n s . . . . . . . . . . 1-47</p><p>Va ri a b le -P re ci s io n Ari th m e tic . . . . . . . . . . . 1-64</p><p>Li nea r A l g ebra . . . . . . . . . . . . . . . . . . . 1-69</p><p>S o l v i n g E q u a t i o n s . . . . . . . . . . . . . . . . . 1-96</p><p>I n t e g r a l T r a n s f o r m s . . . . . . . . . . . . . . . 1-112</p><p>S p e c i a l M a t h e m a t i c a l F u n c t i o n s . . . . . . . . . . 1-130</p><p>U s i n g M a p l e F u n c t i o n s . . . . . . . . . . . . . . 1-136</p><p>E x t e n d e d S y m b o l i c Ma t h T o o l b o x . . . . . . . . . 1-143</p></li><li><p>8/6/2019 MATLAB Symbolic Math Toolbox</p><p> 8/300</p><p>1 Tutorial</p><p>1-2</p><p>IntroductionThe Symbolic Math Toolboxes incorpora te symbolic computa tion int o</p><p>MATLABs nu mer ic envir onmen t. Th ese t oolboxes su ppleme nt MATLABs</p><p>numer ic and gra phical facilities with several oth er t ypes of mat hema tical</p><p>computation:</p><p>The computational engine underlying the toolboxes is the kernel of Maple, asystem developed primarily at the University of Waterloo, Canada, and, more</p><p>recently, at the Eidgenssiche Technische Hochschule, Zrich, Switzerland.Maple is mar keted a nd supported by Waterloo Maple, Inc.</p><p>These versions of the Symbolic Mat h Toolboxes a re designed to work with</p><p>MATLAB 5 a nd Maple V Release 4.</p><p>There are two toolboxes. The basic Symbolic Math Toolbox is a collection of</p><p>more than one-hundred MATLAB functions that provide access to the Maple</p><p>Facility Covers</p><p>C alcu lu s Diffe ren t ia t ion , in t egr a t ion , lim it s, s um m a tion ,</p><p>and Taylor series</p><p>L in e a r Alg eb r a I n ve r s es , d e t er m i n a n t s, e ige n va l u es , s in gu l a r</p><p>value decomposition, an d canonical form s of</p><p>symbolic ma tr ices</p><p>Sim plification M ethods of sim plifying algebraic expressions</p><p>Solution of</p><p>Equations</p><p>Symbolic and numerical solutions to algebraic and</p><p>differential equations</p><p>Variable-Precision</p><p>Arithmetic</p><p>Numer ical evaluation of ma thema tical expressions</p><p>to a ny specified a ccur acy</p><p>Tr an sfor ms F ou rier , La pla ce, z-tran sform, an d corr esponding</p><p>inverse t ra nsforms</p><p>Special</p><p>Mathematical</p><p>Functions</p><p>Special functions of classical a pplied ma th ema tics</p></li><li><p>8/6/2019 MATLAB Symbolic Math Toolbox</p><p> 9/300</p><p>Introduction</p><p>1-3</p><p>kernel using a synta x and st yle tha t is a nat ura l extension of the MATLABlan gua ge. The ba sic toolbox also allows you t o access fun ctions in Ma ples</p><p>linear algebra package. The Extended Symbolic Math Toolbox augments this</p><p>functiona lity to include a ccess t o all nongra phics Maple packa ges, Maple</p><p>program ming featu res, a nd user -defined pr ocedures. With both toolboxes, you</p><p>can wr ite your own M-files t o access Maple fun ctions an d t he Ma ple work space.</p><p>The following sections of th is Tut orial pr ovide explan at ion an d exam ples on</p><p>how to u se t he toolboxes.</p><p>Cha pter 2, Referen ce, provides det ailed descriptions of each of the functions</p><p>in the toolboxes.</p><p>Section Covers</p><p>Gettin g Help How to get online h elp for Symbolic Mat h</p><p>Toolbox functions</p><p>Getting Sta rt ed Basic symbolic ma th opera tions</p><p>Calculus How to differentiate and integrate symbolicexpressions</p><p>Simplifications and</p><p>Substitutions</p><p>How to simplify an d su bstitute values into</p><p>expressions</p><p>Variable-Precision</p><p>Arithmetic</p><p>How to cont rol th e pr ecision of</p><p>computations</p><p>Linear Algebra Exam ples usin g th e t oolbox functions</p><p>Solving Equ at ions How to solve symbolic equations</p><p>Integral Tran sforms Four ier, Lapla ce, an d z-transforms</p><p>Special Mathematical</p><p>Functions</p><p>How to a ccess Ma ples special ma th</p><p>functions</p><p>Using Maple Functions How to us e Ma ple s h elp, debugging, and</p><p>user-defined procedur e fun ctions</p><p>Exten ded S ymbolic Mat h</p><p>Toolbox</p><p>Featur es of the Extended Symbolic Math</p><p>Toolbox</p></li><li><p>8/6/2019 MATLAB Symbolic Math Toolbox</p><p> 10/300</p><p>1 Tutorial</p><p>1-4</p><p>Getting HelpTher e ar e two ways t o find inform at ion on usin g Symbolic Mat h Toolbox</p><p>fun ctions. On e, of cour se, is to rea d t his m an ua l! The oth er is t o use MATLABs</p><p>comman d line help syst em. Gener ally, you can obta in help on MATLAB</p><p>fun ctions simply by typing</p><p>help function</p><p>where function is the name of the MATLAB function for which you need help.This is n ot su fficient , however, for s ome Symbolic Mat h Toolbox functions. Th e</p><p>rea son? The Symbolic Ma th Toolbox overloads ma ny of MATLABs n um er ic</p><p>fun ctions. Tha t is, it provides symbolic-specific implement at ions of th e</p><p>functions, using the same function name. To obtain help for the symbolic</p><p>version of an overloaded function, type</p><p>help sym/function</p><p>where function is th e overloaded functions n am e. For exam ple, to obta in h elpon the symbolic version of the overloaded function, diff, type</p><p>help sym/diff</p><p>To obtain information on the numeric version, on the other hand, simply type</p><p>help diff</p><p>How can you tell whether a function is overloaded? The help for the numeric</p><p>version t ells you so. For example, th e help for th e diff function contains thesection</p><p>Overloaded methods</p><p>help char/diff.m</p><p>help sym/diff.m</p><p>This tells you t hat ther e ar e two other diff comma nds t hat operat e on</p><p>expressions of class char and class sym, respectively. See t he next section for</p><p>inform at ion on class sym. For m ore inform at ion on overloaded comm an ds, see</p><p>Chapt er 14 of the U s i n g M A T L A B guide.</p><p>You can use the mhelp command to obtain help on Maple commands. For</p><p>example, to obtain help on the Maple diff comma nd, type mhelp diff. This</p><p>retur ns t he help page for t he Maple diff fun ction. For m ore inform at ion on th e</p></li><li><p>8/6/2019 MATLAB Symbolic Math Toolbox</p><p> 11/300</p><p>G...</p></li></ul>

Recommended

View more >