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

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

Post on 18-Jan-2016

220 views

Category:

Documents

2 download

TRANSCRIPT

<ul><li><p>Chapter 11Calculus</p></li><li><p>Symbolic ExpressionsRequired:&gt; Symbolic Math Toolbox&gt; Use Symbolic Variables</p></li><li><p>Functions for Symbolic Processingx = sym(x) Creates the symbolic variable with name x.</p><p>syms x y u v Creates the symbolic variables x, y, u, &amp; v.</p><p>Simplify(ans) Simplifies the expression ans.</p></li><li><p>Symbolic Expression Example&gt;&gt;syms x y&gt;&gt;s=x+y;&gt;&gt;r=sqrt(x^2+y^2);</p></li><li><p>Symbolic Expression Example&gt;&gt;n=3;&gt;&gt;syms x;&gt;&gt;A=x.^((0:n)*(0:n))&gt;&gt;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]</p></li><li><p>Manipulating ExpressionsUse the expand command:&gt;&gt;syms x y&gt;&gt;expand((x+y)^2)ans=x^2+2*x*y+y^2&gt;&gt;expand(sin(x+y))ans=sin(x)*cos(y)+cos(x)*sin(y)</p></li><li><p>Evaluating ExpressionsUse subs(E, old, new) or double(y):&gt;&gt;syms x&gt;&gt;E=x^2+6*x+7;&gt;&gt;G=subs(E,x,2)G= 23</p></li><li><p>Multiple Variables&gt;&gt;syms x y z&gt;&gt;E=x^2+6*y+2*z;&gt;&gt;subs(E,{x,y,z},{2,2,3})ans = 22</p></li><li><p>Using Double Command Example&gt;&gt;sqroot2=sym(sqrt(2));&gt;&gt;y=6*sqroot2y=6*2^(1/2)&gt;&gt;z=double(y)z=8.4853 </p></li><li><p>Plotting ExpressionsUse ezplot command:&gt;&gt;syms x&gt;&gt;E=x^2-6*x+7;&gt;&gt;ezplot(E,[-2 6])</p></li><li><p>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</p></li><li><p>Laplace Transformslaplace(exp) Returns Laplace transform.</p><p>ilaplace(exp) Returns inverse Laplace.</p></li></ul>