Anda di halaman 1dari 13

21/07/2017

Symbolic Math

Creating Symbolic Objects


Symbolic objects can be variables or numbers.
They can be created with the sym and/or syms
commands.
A single symbolic object can be created with
the sym command:

where the string, which is the symbolic object,


is assigned to a name.

1
21/07/2017

String as a single letter


a, bb, and x, can be defined as symbolic
variables as follows:

String as a single letter


The name of the symbolic object can be
different from the name of the variable

2
21/07/2017

Symbolic object as a number


symbolic objects can also be numbers.

The numbers dont have to be typed as


strings.

Creating Symbolic Expressions

3
21/07/2017

Creating Symbolic Expressions


When a symbolic expression, which includes
mathematical operations that can be executed
(addition, subtraction, multiplication, and
division), is entered, MATLAB executes the
operations as the expression is created

The difference between exact and


approximate calculations

4
21/07/2017

The expand command


It carries out products of terms that include
summation
it uses trigonometric identities and
exponential and logarithmic laws to expand
corresponding terms that include summation

The expand command

Examples:

10

5
21/07/2017

The factor command


The factor command changes an expression
that is a polynomial to a product of
polynomials of a lower degree

11

The simplify command


The simplify command uses mathematical
operations (addition, multiplication, rules of
fractions, powers, logarithms, etc.) and
functional and trigonometric identities to
generate a simpler form of the expression.

12

6
21/07/2017

The simplify command

13

The pretty Command


The pretty command displays a symbolic
expression in a format resembling the
mathematical format

14

7
21/07/2017

SOLVING ALGEBRAIC EQUATIONS


An algebraic equation can have one or several
symbolic variables

15

SOLVING ALGEBRAIC EQUATIONS

16

8
21/07/2017

17

DIFFERENTIATION
Symbolic differentiation can be carried out by
using the diff command

18

9
21/07/2017

DIFFERENTIATION

19

INTEGRATION
Symbolic integration can be carried out by
using the int command

20

10
21/07/2017

INTEGRATION

21

INTEGRATION
For definite integration the form of the
command is:

a and b are the limits of integration. The limits


can be numbers or symbolic variables.

22

11
21/07/2017

ORDINARY DIFFERENTIAL EQUATION


An ordinary differential equation (ODE) can be
solved symbolically with the dsolve command.

Dy stands for dy/dt


A second derivative is typed as D2, third
derivative as D3, and so on.

23

ORDINARY DIFFERENTIAL EQUATION

24

12
21/07/2017

ORDINARY DIFFERENTIAL EQUATION


The following examples illustrate the solution
of differential equations that contain symbolic
variables in addition to the independent and
dependent variables.

25

ORDINARY DIFFERENTIAL EQUATION

26

13

Anda mungkin juga menyukai