• Complain

César Pérez López - MATLAB Symbolic Algebra and Calculus Tools

Here you can read online César Pérez López - MATLAB Symbolic Algebra and Calculus Tools full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2014, publisher: Apress, genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

César Pérez López MATLAB Symbolic Algebra and Calculus Tools
  • Book:
    MATLAB Symbolic Algebra and Calculus Tools
  • Author:
  • Publisher:
    Apress
  • Genre:
  • Year:
    2014
  • Rating:
    5 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 100
    • 1
    • 2
    • 3
    • 4
    • 5

MATLAB Symbolic Algebra and Calculus Tools: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "MATLAB Symbolic Algebra and Calculus Tools" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

MATLAB is a high-level language and environment for numerical computation, visualization, and programming. Using MATLAB, you can analyze data, develop algorithms, and create models and applications. The language, tools, and built-in math functions enable you to explore multiple approaches and reach a solution faster than with spreadsheets or traditional programming languages, such as C/C++ or Java.

MATLAB Symbolic Algebra and Calculus Tools introduces you to the MATLAB language with practical hands-on instructions and results, allowing you to quickly achieve your goals. Starting with a look at symbolic variables and functions, you will learn how to solve equations in MATLAB, both symbolically and numerically, and how to simplify the results. Extensive coverage of polynomial solutions, inequalities and systems of equations are covered in detail. You will see how MATLAB incorporates vector, matrix and character variables, and functions thereof. MATLAB is a powerful symbolic manipulator which enables you to factorize, expand and simplify complex algebraic expressions over all common fields (including over finite fields and algebraic field extensions of the rational numbers). With MATLAB you can also work with ease in matrix algebra, making use of commands which allow you to find eigenvalues, eigenvectors, determinants, norms and various matrix decompositions, among many other features. Lastly, you will see how you can use MATLAB to explore mathematical analysis, finding limits of sequences and functions, sums of series, integrals, derivatives and solving differential equation.

What youll learn

How to use MATLAB to work with numeric and symbolic variables, including vector, matrix and character variables

How to use MATLAB to handle polynomials and general algebraic expressions, factorizing, expanding and simplifying over a wide range of fields

How to use MATLAB to work on matrix and vector functions, including all the standard matrix operations and decompositions

How to solve equations and systems of equations using MATLAB

How MATLAB can be used to explore mathematical analysis, by finding limits of sequences and functions, sums of series, integrals, derivatives, and solving differential equations

Who this book is for

This book is for anyone who wants to work in a practical, hands-on manner on symbolic algebra or calculus problems with MATLAB. Youll already have a core understanding of undergraduate level calculus, algebra and linear algebra, and have access to an installed version of MATLAB, but no previous experience of MATLAB is assumed.

César Pérez López: author's other books


Who wrote MATLAB Symbolic Algebra and Calculus Tools? Find out the surname, the name of the author of the book and a list of all author's works by series.

MATLAB Symbolic Algebra and Calculus Tools — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "MATLAB Symbolic Algebra and Calculus Tools" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
Csar Prez Lpez 2014
Csar Prez Lpez MATLAB Symbolic Algebra and Calculus Tools 10.1007/978-1-4842-0343-9_1
1. Symbolic Variables and Functions
Csar Prez Lpez 1
(1)
Madrid, Spain
1-1. Symbolic Variables
MATLAB deems as symbolic any algebraic expression whose variables have all been previously defined as symbolic; variables are declared as symbolic using the command syms . For example, if we want to treat as symbolic the expression 6 * a * b + 3 * a^2 + 2 * a * b, in order to simplify it, we need to declare the two variables a and b as symbolic, as shown here:
>> syms a b
>> simplify(6*a*b + 3*a^2 + 2*a*b)
ans =
8 * a * b + 3 * a ^ 2
As we will see, the command needed to transform a numeric expression to symbolic is sym . For example, if we want to simplify the numeric expression 2/5 + 6/10 + 8/20, we need to first transform it to a symbolic expression with sym(2/5+6/10+8/20) , performing the simplification as follows:
>> simplify(sym(2/5+6/10+8/20))
ans =
7/5
The variables of symbolic expressions must be symbolic. Some of the commands for working with symbolic and numeric variables are detailed below:
  • syms x y z... t makes the variables x , y , z ,..., t symbolic .
  • syms x y z... t real converts the variables x, y, z ,..., t to symbolic variables with real values .
  • syms x y z... t unreal undoes the previous declaration, so that the variables x, y, z,..., t may now have non-zero imaginary parts.
  • syms lists all symbolic variables currently in the workspace .
  • x = sym('x') declares the variable x as symbolic (equivalent to syms x ) .
  • x = sym('x', real) converts x to a real symbolic variable .
  • x = sym('x',unreal) enables the symbolic variable x to have non-zero imaginary part .
  • S = sym(A) creates a symbolic object from A, where A may be a string, a scalar, an array, a numeric expression, and so on .
  • S = sym(A,'option') converts the array, scalar or numeric expression to a symbolic expression according to the specified option. The option can be f for floating point, r for rational, e for estimate error , or d for decimal .
  • numeric(x) or double(x) converts the variable or expression x to double-precision .
  • sym2poly(poly) converts the symbolic polynomial poly to a vector whose components are its coefficients .
  • poly2sym(vector) returns a symbolic representation of the polynomial whose coefficients are given by the vector .
  • poly2sym(vector,'v') converts a vector into a symbolic polynomial in the variable v .
  • digits(d) sets the precision of symbolic variables to d significant decimal digits .
  • digits returns the current precision for symbolic variables .
  • vpa(expr) returns the numerical result of the expression with a number of significant decimal digits of precision determined by digits .
  • vpa(expr, n) or vpa('expr', n) returns the numerical result of the expression to n significant decimal digits .
  • pretty(expr) displays the symbolic expression using standard mathematical formatting .
EXERCISE 1-1
Solve the equation ax + bx + c = 0 assuming that the variable is x. Also solve it for the variables a, b and c, respectively.
Because MATLAB considers x to be symbolic by default, we can solve the equation directly for x without having to specify it as a symbolic variable using the command solve (note that in MATLAB the equations are introduced within single quotes):
>> solve('a*x^2+b*x+c=0')
ans =
[1/2/a*(-b+(b^2-4*a*c)^(1/2))]
[1/2/a*(-b-(b^2-4*a*c)^(1/2))]
However, to solve the equation with respect to the variables a , b or c , it is necessary to first declare them as symbolic variables:
>> syms a
>> solve('a*x^2+b*x+c=0',a)
ans =
-(b*x+c)/x^2
>> syms b
>> solve('a*x^2+b*x+c=0',b)
ans =
-(a*x^2+c)/x
>> syms c
>> solve('a*x^2+b*x+c=0',c)
ans =
-a*x^2 - b*x
EXERCISE 1-2
Find the roots of the polynomial x - 8 x + 16 = 0, obtaining the result to default accuracy, to 20 significant figures and to double-precision exact accuracy. Also generate the vector of coefficients associated with the polynomial.
>> p = solve('x^4-8*x^2-16=0')
p =
[ 2*(2^(1/2)+1)^(1/2)]
[-2*(2^(1/2)+1)^(1/2)]
[ 2*(1-2^(1/2))^(1/2)]
[-2*(1-2^(1/2))^(1/2)]
>> vpa(p)
ans =
[ 3.1075479480600746146883179061262]
[ -3.1075479480600746146883179061262]
[ 1.2871885058111652494708868748364*i]
[ -1.2871885058111652494708868748364*i]
>> numeric(p)
ans =
3.1075
-3.1075
0 + 1.2872i
0 - 1.2872i
>> vpa(p,20)
ans =
[ 3.1075479480600746146]
[ -3.1075479480600746146]
[ 1.2871885058111652495*i]
[-1.2871885058111652495*i]
>> syms x
>> sym2poly(x^4-8*x^2-16)
ans =
1 0 -8 0 -16
EXERCISE 1-3
Find the numerical value, to default precision, of the abscissa of the intersection of the curves y = sin(x) and y = cos(x) in the first quadrant. Find the exact (symbolic) solution. Find the abscissa to a precision of 12 decimal places.
>> p = numeric(solve('sin(x) = cos(x)'))
p =
0.7854
>> q = sym (p)
q =
PI/4
>> digits(12); r=numeric(solve('sin(x)=cos(x)'))
r =
.785398163398
EXERCISE 1-4
Simplify the following expressions as much as possible:
1/2m - 1/3m + 1/4m + 1/5m + 1/6m
1/2 - 1/3 + 1/4 + 1/5 + 1/6
>> syms m
>> simplify(1/(2*m) - 1/(3*m) + 1/(4*m) + 1/(5*m) + 1/(6*m))
ans =
47/60/m
>> pretty(simplify(1/(2*m) - 1/(3*m) + 1/(4*m) + 1/(5*m) + 1/(6*m)))
--
>> sym(1/2 - 1/3 + 1/4 + 1/5 + 1/6)
ans =
47/60
1-2. Symbolic Vector Variables
A variable that represents a vector of length n can be defined in MATLAB in the following ways:
variable = [e1, e2, e3,..., en]
variable = [e1 e2 e3... en]
Therefore, to define a vector variable, simply insert brackets around the vector elements, separated by commas or blank spaces.
On the other hand, you can also define symbolic vector variables , after previously using the syms command.
>> syms t
>> A=sym([sin(t),cos(t)])
A =
[sin (t), cos (t)]
1-3. Symbolic Matrix Variables
To define an array in MATLAB, simply enter in brackets all of its row vectors separated by semicolons. When entering a vector, you can separate its components by spaces or commas, as weve already seen. For example, a 3 3 matrix variable can be entered in the following two ways:
matrix = [a a a ;a a a ;a a a ]
matrix = [a , a , a ;a , a , a ;a , a , a ]
We would similarly define an M N variable array. To work with symbolic matrices , we simply declare the variables involved to be symbolic with the syms command:
>> syms t
>> A=sym([sin(t),cos(t);tan(t),exp(t)])
Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «MATLAB Symbolic Algebra and Calculus Tools»

Look at similar books to MATLAB Symbolic Algebra and Calculus Tools. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «MATLAB Symbolic Algebra and Calculus Tools»

Discussion, reviews of the book MATLAB Symbolic Algebra and Calculus Tools and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.