Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "Chapter 11 Calculus. Symbolic Expressions Required: > Symbolic Math Toolbox > Use Symbolic Variables."— Presentation transcript:

1 Chapter 11 Calculus

2 Symbolic Expressions Required: > Symbolic Math Toolbox > Use Symbolic Variables

3 Functions for Symbolic Processing x = 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.

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

5 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]

6 Manipulating Expressions Use 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)

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

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

9 Using Double Command Example >>sqroot2=sym(‘sqrt(2)’); >>y=6*sqroot2 y= 6*2^(1/2) >>z=double(y) z= 8.4853

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

11

12 Symbolic Calculus Functions diff(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) n th derivative int(E) Returns the integral limit(E) Returns the limit

13

14

15 Laplace Transforms laplace(exp) Returns Laplace transform. ilaplace(exp) Returns inverse Laplace.

16


Download ppt "Chapter 11 Calculus. Symbolic Expressions Required: > Symbolic Math Toolbox > Use Symbolic Variables."

Similar presentations


Ads by Google