7
Unit 7 Symbolic Processing Unit 7 Symbolic Processing 中中中中中中中中中 中中中中中中中中中 中中中 中中中 中中中 中中中 中中中 中中中 中中中 中中中

Unit 7 Symbolic Processing

Embed Size (px)

DESCRIPTION

Unit 7 Symbolic Processing. 中華技術學院電子系 副教授 蔡樸生 副教授 林盈灝. Algebraic and Math. Operator. syms : Create Symbolic Variables expand : expands the expression by carrying out power simplify : simplifies the expression E factor : factors the expression E >> syms x y >> expand ((x+y)^3) - PowerPoint PPT Presentation

Citation preview

Page 1: Unit 7   Symbolic Processing

Unit 7 Symbolic ProcessingUnit 7 Symbolic Processing

中華技術學院電子系中華技術學院電子系副教授 蔡樸生副教授 蔡樸生副教授 林盈灝副教授 林盈灝

Page 2: Unit 7   Symbolic Processing

Algebraic and Math. Algebraic and Math. OperatorOperator

syms : Create Symbolic Variablessyms : Create Symbolic Variables expand : expands the expression by carrying out powerexpand : expands the expression by carrying out power simplify : simplifies the expression Esimplify : simplifies the expression E factor : factors the expression Efactor : factors the expression E >> syms x y>> syms x y >> expand ((x+y)^3)>> expand ((x+y)^3) >> expand (sin(x+y))>> expand (sin(x+y)) >> factor(x^2-1)>> factor(x^2-1)

Page 3: Unit 7   Symbolic Processing

Algebraic and Math. Algebraic and Math. OperatorOperator

>> E1=x^2+5;>> E1=x^2+5; >> E2=y^3-2;>> E2=y^3-2; >> S1=E1+E2 : S1=x^2+3+y^3>> S1=E1+E2 : S1=x^2+3+y^3 >> S2=E1*E2 : S2=(x^2+5)*(y^3-2)>> S2=E1*E2 : S2=(x^2+5)*(y^3-2) >> expand(S2)>> expand(S2) >> E3=x^3+2*x^2+5*x+10>> E3=x^3+2*x^2+5*x+10 >> S3=E3/E1>> S3=E3/E1 >> simplify(S3)>> simplify(S3)

Page 4: Unit 7   Symbolic Processing

Evaluating ExpressionsEvaluating Expressions

subs(E,old,new): To replace old with a numeric value subs(E,old,new): To replace old with a numeric value to new in the expression Eto new in the expression E

ezplot(E,[xmin xmax])ezplot(E,[xmin xmax]) poly2sym([a,b,c…….],’v’)poly2sym([a,b,c…….],’v’) >> syms x>> syms x >> E=x^2+6*x+7>> E=x^2+6*x+7 >> G=subs(E,x,2)>> G=subs(E,x,2) >> ezplot(E,[-2 6])>> ezplot(E,[-2 6]) >> poly2sym([2,5,-3],’x’)>> poly2sym([2,5,-3],’x’)

Page 5: Unit 7   Symbolic Processing

Test Your Understanding Test Your Understanding (I)(I)

Given the expressions:Given the expressions:

Find the product E1*E2 and Find the product E1*E2 and express it in its simplest formexpress it in its simplest form

Find the quotient E1/E2 and Find the quotient E1/E2 and express it in its simplest formexpress it in its simplest form

Evaluate the sum E1+E2 at x=7.1Evaluate the sum E1+E2 at x=7.1

3 21 15 75 125E x x x

22 ( 5) 20E x x

Page 6: Unit 7   Symbolic Processing

DifferentiationDifferentiation syms n x ysyms n x y diff(f(x,y),y,n) :diff(f(x,y),y,n) : 對於對於 f(x,y)f(x,y) 中的 中的 y y 作偏微 作偏微 n n

次次

IntegrationIntegration int(f(x,y),y,a,b) : int(f(x,y),y,a,b) : 對於對於 f(x,y)f(x,y) 由 由 a a 到 到 b b 作定積作定積

分分

2

2

[ sin( )]x xy

y

[ sin( )]x xy

y

[ln( )]x

x

( )nx

x

5 2

0xy dy sin

te

txdx nx dn

5b

ax dx

Page 7: Unit 7   Symbolic Processing

Test Your Understanding Test Your Understanding (II)(II)

Given that ,Given that , use use MATLAB MATLAB toto find at x=0.2. find at x=0.2.

Given that ,Given that , use use MATLABMATLAB

toto find find Given that ,use MATLAB Given that ,use MATLAB toto

findfind

Use MATLAB to evaluate Use MATLAB to evaluate

sinh(3 )cosh(5 )y x xdydx

5cos(2 ) ln(4 )z x ydzdy

sin(3 )y x x

ydx 5

2sin(3 )x x dx