Page 54 - MATLAB an introduction with applications
P. 54
MATLAB Basics ——— 39
1.19 SYMBOLIC MATHEMATICS
In Secs. 1.1 to 1.18, the capability of MATLAB for numerical computations have been described. In this
section some of MATLAB’s capabilities for symbolic manipulations will be presented. Specifically, the symbolic
expressions, symbolic algebra, simplification of mathematical expressions, operations on symbolic expressions,
solution of a single equation or a set of linear algebraic equations, solutions to differential equations,
differentiation and integration of functions using MATLAB are presented.
1.19.1 Symbolic Expressions
A symbolic expression is stored in MATLAB as a character string. A single quote marks are used to define
the symbolic expression. For instance:
‘sin(y/x)’; ‘x^4 + 5 * x^3 + 7 * x^2 – 7’
The independent variable in many functions is specified as an additional function argument. If an independent
variable is not specified, then MATLAB will pick one. When several variables exist, MATLAB will pick the
one that is a single lower case letter (except i and j), which is closest to x alphabetically.
The independent variable is returned by the function symvar,
symvar(s): Returns the independent variable for the symbolic expression s.
For example:
Expression (s) symvar(s)
‘5 * c * d + 34’ d
‘sin(y/x)’ x
In MATLAB, a number of functions are available to simplify mathematical expressions by expanding the
terms, factoring expressions, collecting coefficients, or simplifying the expression. For instance;
expand(s):Performs an expansion of s.
A summary of these expressions is given in Table 1.33. A summary of basic operations is given in Table 1.34.
The standard arithmetic operation (Table 1.35) is applied to symbolic expressions using symbolic functions.
These symbolic expressions are summarized in Table 1.36.
Table 1.33
Simplification
collect Collect common terms
expand Expand polynomials and elementary functions
factor Factorization
horner Nested polynomial representation
numden Numerator and denominator
simple Search for shortest form
simplify Simplification
subexpr Rewrite in terms of subexprssions
F:\Final Book\Sanjay\IIIrd Printout\Dt. 10-03-09