# Matlab tutorium

date post

05-Sep-2015Category

## Documents

view

77download

9

Embed Size (px)

description

### Transcript of Matlab tutorium

Symbolic Math Toolbox 5MuPAD Tutorial

How to Contact The MathWorks

www.mathworks.com Webcomp.soft-sys.matlab Newsgroupwww.mathworks.com/contact_TS.html Technical Support

suggest@mathworks.com Product enhancement suggestionsbugs@mathworks.com Bug reportsdoc@mathworks.com Documentation error reportsservice@mathworks.com Order status, license renewals, passcodesinfo@mathworks.com Sales, pricing, and general information

508-647-7000 (Phone)

508-647-7001 (Fax)

The MathWorks, Inc.3 Apple Hill DriveNatick, MA 01760-2098For contact information about worldwide offices, see the MathWorks Web site.

Symbolic Math Toolbox MuPAD Tutorial

COPYRIGHT 19972009 by SciFace Software GmbH & Co. KG.The software described in this document is furnished under a license agreement. The software may be usedor copied only under the terms of the license agreement. No part of this manual may be photocopied orreproduced in any form without prior written consent from The MathWorks, Inc.

FEDERAL ACQUISITION: This provision applies to all acquisitions of the Program and Documentationby, for, or through the federal government of the United States. By accepting delivery of the Program orDocumentation, the government hereby agrees that this software or documentation qualifies as commercialcomputer software or commercial computer software documentation as such terms are used or definedin FAR 12.212, DFARS Part 227.72, and DFARS 252.227-7014. Accordingly, the terms and conditions ofthis 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 Documentationby the federal government (or other entity acquiring for or through the federal government) and shallsupersede any conflicting contractual terms or conditions. If this License fails to meet the governmentsneeds or is inconsistent in any respect with federal procurement law, the government agrees to return theProgram and Documentation, unused, to The MathWorks, Inc.

Trademarks

MuPAD is a registered trademark of SciFace Software GmbH & Co. KG. MATLAB and Simulinkare registered trademarks of The MathWorks, Inc. See www.mathworks.com/trademarks for a listof additional trademarks. Other product or brand names may be trademarks or registeredtrademarks of their respective holders.

Patents

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

PrefaceThis book explains the basic use of the MuPAD computer algebra system, andgives some insight into the power of the system. MuPAD is available as part of theSymbolic Math Toolbox in MATLAB.

The book does not include the information about the latest features available inMuPAD. The updated documentation is available in the MuPAD Help Browser.To open the Help Browser, start MuPAD and click the Open Help button on thedesktop toolbar or use the Help menu. Also see the Release Notes section in theMuPAD Help Browser for the short summary of the new features, bug fixes, andupgrade issues.

This introduction addresses mathematicians, engineers, computer scientists,natural scientists and, more generally, all those in need of mathematicalcomputations for their education or their profession. Generally speaking, thisbook addresses anybody who wants to use the power of a modern computeralgebra package.

There are two ways to use a computer algebra system. On the one hand, you mayuse the mathematical knowledge it incorporates by calling system functionsinteractively. For example, you can compute symbolic integrals or generate andinvert matrices by calling appropriate functions. They comprise the systemsmathematical intelligence and may implement sophisticated algorithms.Chapters 2 through 14 discuss this way of using the MuPAD engine.

On the other hand, with the help of the MuPAD programming language, you caneasily add functionality to the system by implementing your own algorithms asMuPAD procedures. This is useful for special purpose applications if noappropriate system functions exist. Chapters 15 through 17 are an introduction toMuPAD programming.

You can read this book in the standard way linearly from the first to the lastpage. However, there are reasons to proceed otherwise. This may be the case, e.g.,if you are interested in a particular problem, or if you already know somethingabout MuPAD.

For beginners, we recommend to start reading Chapter 2, which gives a firstsurvey of MuPAD. The description of the online help system in Section 2.2 isprobably the most important part of this chapter. The help system providesinformation about details of system functions, their syntax, their calling

Preface

parameters, etc. It is available online whenever the MuPAD notebook interface isrunning. In the beginning, requesting a help page is probably your most frequentquery to the system. After you have grown familiar with the help system, you maystart to experiment with MuPAD. Chapter 2 demonstrates some of the mostimportant system functions at work. You will find further details about thesefunctions in later parts of the book or in the help pages. For a deeperunderstanding of the data structures involved, you may consult the correspondingsections in Chapter 4.

Chapter 3 discusses the MuPAD libraries and their use. They contain manyfunctions and algorithms for particular mathematical topics.

The basic data types and the most important system functions for theirmanipulation are introduced in Chapter 4. It is not necessary to study all of themin the same depth. Depending on your intended application, you may selectivelyread only the passages about the relevant topics.

Chapter 5 explains how MuPAD evaluates objects; we strongly recommend to readthis chapter.

Chapters 6 through 11 discuss the use of some particularly important systemfunctions: substitution, differentiation, symbolic integration, equation solving,random number generation, and graphic commands.

Several useful features such as the history mechanism, input and output routines,or the definition of user preferences are described in Chapters 13.2 through 13.Preferences can be used to configure the systems interactive behavior after theusers fancy to a certain extent.

Chapters 15 through 17 give an introduction to the basic concepts of the MuPADprogramming language.

MuPAD provides algorithms that can handle a large class of mathematical objectsand computational tasks related to them. Upon reading this introduction, it ispossible that you encounter unknown mathematical notions such as rings orfields. This introduction is not intended to explain the mathematical backgroundfor such objects. Basic mathematical knowledge is helpful but not mandatory tounderstand the text. Sometimes you may ask what algorithm MuPAD uses tosolve a particular problem. The internal mode of operation of the MuPADprocedures is not addressed here: we do not intend to give a general introductionto computer algebra and its algorithms. The interested reader may consult text

ii

Preface

books such as, e.g., [GCL 92] or [GG 99].

This book gives an elementary introduction to MuPAD. Somewhat more abstractmathematical objects such as, e.g., field extensions, are easy to describe and tohandle in MuPAD. However, such advanced aspects of the system are notdiscussed here. The mathematical applications that are mentioned in the text areintentionally kept on a rather elementary level. This is to keep this text plain forreaders with little mathematical background and to make it applicable at schoollevel.

We cannot explain the complete functionality of MuPAD in this introduction.Some parts of the system are mentioned only briefly. It is beyond the scope of thistutorial to go into the details of the full power of the MuPAD programminglanguage. You find these in the MuPAD help system, available online during aMuPAD session.

This tutorial refers to MuPAD version 5 and later. Since the development of thesystem advances continuously, some of the details described may change in thefuture. Future versions will definitely provide additional functionality throughnew system functions and application packages. In this tutorial, we mainlypresent the basic tools and their use, which will probably remain essentiallyunchanged. We try to word all statements in the text in such a way that they staybasically valid for future MuPAD versions.

iii

Contents

Prefacei

Introduction1

Numerical Computations . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2Computer Algebra . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3Characteristics of Computer Algebra Systems . . . . . . . . . . . . . . . 1-5MuPAD Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-6

First Steps in MuPAD

2Notebook interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2Explanations and Help . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4Computing with Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . 2-5

Exact Computations . . . . . . . . . . . . . . . . . . . . . . . . . 2-6Numerical Approximations . . . . . . . . . . . . . . . . . . . . . 2-7Complex Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . 2-9

Symbolic Computation . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-11Introductory Examples . . . . . . . . . . . . . . . . . . . . . . . . 2-11Curve Sketching . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-21Elementary Number Theory . . . . . . . . . . . . . . . . . . . . . 2-24

Contents

The MuPAD Libraries3

Information About a Particular Library . . . . . . . . . . . . . . . . .

*View more*