[ 선형대수 : matlab ] ch ap 11: symbolic mathematics

Click here to load reader

Upload: emmett

Post on 05-Jan-2016

111 views

Category:

Documents


0 download

DESCRIPTION

최 윤 정. [ 선형대수 : Matlab ] Ch ap 11: Symbolic Mathematics. 학습내용. Symbolic variable 만들어 사용하기 Factor( 인수분해 ) and simplify mathematical expression Solve symbolic expression / System. Determine the symbolic derivative of an expression Integrate an expression symbolically. Matlab 의 기호연산 능력. - PowerPoint PPT Presentation

TRANSCRIPT

[:Matlab] Chap 1.

[:Matlab]

Chap 11: Symbolic Mathematics 1

Symbolic variable Factor() and simplify mathematical expressionSolve symbolic expression / System.Determine the symbolic derivative of an expressionIntegrate an expression symbolically

2

2Matlab Maple 8 . Maple 8Matlab 7 Maple 5 .

Symbolic Manipulation . .MATLAB for Engineers3Manipulate symbolic expressions to SimplifySolve symbolicallyEvaluate numerically( )Take derivativesIntegrate Perform linear algebraic manipulations More advanced features include LaPlace transformsFourier transformsVariable precision arithmetic

11.1 , , , .MATLAB for Engineers4

,! .!MATLAB for Engineers5

Matlab .MATLAB for Engineers6

Matlab Symbolic Variables Two approachesUse the sym command to create Single variable( )Expression()Equation( )Use the syms command to create Single variables( ) .

MATLAB for Engineers7 Define x as a symbolic variablex=sym('x') orsyms x Use x to create a more complicated expressiony = 2*(x+3)^2/(x^2+6*x+9)

MATLAB for Engineers8

MATLAB for Engineers9

Syms : syms Q R T D0

.

D=D0*exp(-Q/(R*T))

MATLAB for Engineers10Notice : (.*, ./ and .^) (*,/,^) .Sym : E=sym('m*c^2')

E m c E m c . .MATLAB for Engineers11

.

ideal_gas_law=sym('P*V=n*R*Temp')

MATLAB for Engineers12This is an algebraic equationThis is an assignment statement

: :

= .

MATLAB for Engineers13

MATLAB for Engineers14

Working with Equation & Expression .

MATLAB for Engineers15

MATLAB for Engineers16

Numden : (numerator) & (denomicator)MATLAB for Engineers17

.Expanding, factoring and collecting terms expandfactorcollectWhen used with equations, each side is treated separately

MATLAB for Engineers18MATLAB for Engineers19

w is an equation

w is an equationnum is an expressionMATLAB for Engineers20

The factor function , den The factor function w The collect function is similar, .SimplifyingExpand, factor, collect . . simplify .MATLAB for Engineers21MATLAB for Engineers22

simplify used on an expressionsimplify used on an equationSimple Simple simplify .!Simple .Poly2Sym Sym2poly MATLAB for Engineers23MATLAB for Engineers24

All of the possibilities evaluated are reported, however there is only one actual answerBoth simple and simplify work on expressions and equationsHintPoly2Sym : Sym2poly :

MATLAB for Engineers25

11.2 Solve ( 0 ) . / .MATLAB for Engineers26

MATLAB for Engineers27

MATLAB for Engineers28

Solve .

x .Solve .MATLAB for Engineers29

. a solve .Solve MATLAB for Engineers30

Solve MATLAB for Engineers31

Solve : .MATLAB for Engineers32

This result is a structure array. MATLAB for Engineers33There are several different approaches to find the actual values of x, y, and z

Specify the field name inside the structure array to retrieve the values for x, y, and zMATLAB for Engineers34

Assign individual variable names. Notice that x, y and z are symbolic variablesExample 11.1 D = D0*exp(-Q/RT)Solve for Q

MATLAB for Engineers35

MATLAB Solution

MATLAB for Engineers36

Substitution()MATLAB for Engineers37

E4 x 3 . Subs : , , .MATLAB for Engineers38

{ } .Example 7.2 .

5 . ? : ( ) : : , / : , /

MATLAB for Engineers39

MATLAB for Engineers40

Matlab MATLAB for Engineers41

MATLAB for Engineers42

11.3 ezplot()

MATLAB for Engineers43

MATLAB for Engineers44

MATLAB for Engineers45

, . .Explot(): , MATLAB for Engineers46

MATLAB for Engineers47

Peaks() MATLAB for Engineers48

MATLAB for Engineers49

MATLAB for Engineers50

MATLAB for Engineers51

MATLAB for Engineers52

Example 11.3 MATLAB for Engineers53

MATLAB for Engineers54

MATLAB for Engineers55

MATLAB for Engineers56

11.4 MATLABs symbolic toolbox supportsSymbolical differentiationSymbolic integration This makes it possible to find analytical solutions for many problems, instead of numeric approximations.

.

MATLAB for Engineers57 MATLAB for Engineers58

11.5 , ( ) . ) MATLAB for Engineers59

MATLAB for Engineers60

MATLAB for Engineers61

MATLAB for Engineers62

MATLAB for Engineers63

, . .

() MATLAB for Engineers64

MATLAB for Engineers65

Diff : () . diff() . .!MATLAB for Engineers66

MATLAB for Engineers67

, MATLAB for Engineers68

MATLAB for Engineers69MATLAB for Engineers70 . .

MATLAB for Engineers71

SummaryMatlab array! Data Type & Array type NumericdoublesingleintegersCharacterSymbolicLogical

MATLAB for Engineers72SparseCellStructure

+ .Num2str() . .

3 .Page ! 2 .

MATLAB for Engineers73