Book Image

Mastering Python Scientific Computing

Book Image

Mastering Python Scientific Computing

Overview of this book

Table of Contents (17 chapters)
Mastering Python Scientific Computing
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Symbolic computing using SymPy


Symbolic computation manipulates mathematical objects and expressions. These mathematical objects and expressions are represented as they are, and they are not evaluated/approximated. Expressions/objects with unevaluated variables are left in their symbolic form.

Let's see the difference between computerized normal computation and computerized symbolic computation in the following diagram. We have two examples each for both the cases. Example A1 and Example A2 are examples of normal computation, and Example B1 and Example B2 are examples of symbolic computation. Example A1 and Example A2 have obvious output. Let's take a look at the output of Example B1 and Example B2. The output of Example B1 is the same sqrt(3). No evaluation is performed; it's only the original symbols. This is because in symbolic computing, if the argument for the sqrt function is not a perfect square, then it will be left as it is. On the other hand, in Example B2, the output is slightly...