chapter 11 calculus. symbolic expressions required: > symbolic math toolbox > use symbolic...

16
Chapter 11 Calculus

Upload: meghan-wood

Post on 18-Jan-2016

239 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Chapter 11 Calculus. Symbolic Expressions Required: > Symbolic Math Toolbox > Use Symbolic Variables

Chapter 11Calculus

Page 2: Chapter 11 Calculus. Symbolic Expressions Required: > Symbolic Math Toolbox > Use Symbolic Variables

Symbolic ExpressionsRequired:> Symbolic Math Toolbox> Use Symbolic Variables

Page 3: Chapter 11 Calculus. Symbolic Expressions Required: > Symbolic Math Toolbox > Use Symbolic Variables

Functions for Symbolic Processingx = sym(‘x’) Creates the symbolic variable with name x.

syms x y u v Creates the symbolic variables x, y, u, & v.

Simplify(ans) Simplifies the expression ans.

Page 4: Chapter 11 Calculus. Symbolic Expressions Required: > Symbolic Math Toolbox > Use Symbolic Variables

Symbolic Expression Example>>syms x y>>s=x+y;>>r=sqrt(x^2+y^2);

Page 5: Chapter 11 Calculus. Symbolic Expressions Required: > Symbolic Math Toolbox > Use Symbolic Variables

Symbolic Expression Example>>n=3;>>syms x;>>A=x.^((0:n)’*(0:n))>>A=

[1, 1, 1, 1][1, x, x^2, x^3][1, x^2, x^4, x^6][1, x^3, x^6, x^9]

Page 6: Chapter 11 Calculus. Symbolic Expressions Required: > Symbolic Math Toolbox > Use Symbolic Variables

Manipulating ExpressionsUse the expand command:>>syms x y>>expand((x+y)^2)ans=

x^2+2*x*y+y^2>>expand(sin(x+y))ans=

sin(x)*cos(y)+cos(x)*sin(y)

Page 7: Chapter 11 Calculus. Symbolic Expressions Required: > Symbolic Math Toolbox > Use Symbolic Variables

Evaluating ExpressionsUse subs(E, old, new) or double(y):>>syms x>>E=x^2+6*x+7;>>G=subs(E,x,2)G= 23

Page 8: Chapter 11 Calculus. Symbolic Expressions Required: > Symbolic Math Toolbox > Use Symbolic Variables

Multiple Variables>>syms x y z>>E=x^2+6*y+2*z;>>subs(E,{x,y,z},{2,2,3})ans =

22

Page 9: Chapter 11 Calculus. Symbolic Expressions Required: > Symbolic Math Toolbox > Use Symbolic Variables

Using Double Command Example>>sqroot2=sym(‘sqrt(2)’);>>y=6*sqroot2y=

6*2^(1/2)>>z=double(y)z=

8.4853

Page 10: Chapter 11 Calculus. Symbolic Expressions Required: > Symbolic Math Toolbox > Use Symbolic Variables

Plotting ExpressionsUse ezplot command:>>syms x>>E=x^2-6*x+7;>>ezplot(E,[-2 6])

Page 11: Chapter 11 Calculus. Symbolic Expressions Required: > Symbolic Math Toolbox > Use Symbolic Variables
Page 12: Chapter 11 Calculus. Symbolic Expressions Required: > Symbolic Math Toolbox > Use Symbolic Variables

Symbolic Calculus Functionsdiff(E) Returns the derivative of the expression E with respect to the default independent variable.diff(E,v) To variable v.diff(E,v,n) nth derivative int(E) Returns the integrallimit(E) Returns the limit

Page 13: Chapter 11 Calculus. Symbolic Expressions Required: > Symbolic Math Toolbox > Use Symbolic Variables
Page 14: Chapter 11 Calculus. Symbolic Expressions Required: > Symbolic Math Toolbox > Use Symbolic Variables
Page 15: Chapter 11 Calculus. Symbolic Expressions Required: > Symbolic Math Toolbox > Use Symbolic Variables

Laplace Transformslaplace(exp)

Returns Laplace transform.

ilaplace(exp) Returns inverse Laplace.

Page 16: Chapter 11 Calculus. Symbolic Expressions Required: > Symbolic Math Toolbox > Use Symbolic Variables