Is it true that one can solve numeric problems with Symbolic Math Toolbox since all computations using symbols are performed analytically rather than numerically?

6 views (last 30 days)
For example, if one wants to calculate derivative, some numeric functions in MATLAB may handle this using finite differencing. However, since finite differencing sometimes suffer from numeric problems, one may get a inaccurate result. I wonder if Symbolic Math Toolbox is able to solve numeric issues completely and what is the possible limitations of using Symbolic Math Toolbox?

Accepted Answer

Walter Roberson
Walter Roberson on 31 Jan 2016
There are functions which have no known differentiation, or whose differentiation has not been implemented. For example, differentiating with respect to the nu parameter of a Bessel function might not be supported.
There are relationships that might be true but which might be beyond the ability of the package to prove without guidance. Some of these involve complicated known equivalences, but sometimes it is as simple as taking a power of a polynomial, expanding it out, adding a single term to it, and then asking that the package restore it to the ((polynomial)^power+term) form.
The Abel–Ruffini Theorem establishes that there are no general algebraic solutions to polynomials of degree 5 or higher. This makes it impossible to symbolically decide questions that involve the exact positions of roots of a polynomial of degree 5 or higher, except by expanding it out numerically, which then runs into problems based upon the number of digits you ask to calculate to. But at least in this case it is possible to tell how many roots you have to deal with.
For non-polynomial equations, it is difficult to figure out symbolically how many roots the equations have, or to figure out formulas for where the roots are.
There are a lot of functions whose closed-form integrals are not known.
Integral equations are often not solvable symbolically. Integral equations are equations of the form: find the x such that the integral from A to x is equal to this expression (which might be symbolic itself).
There are a number of forms of ODE (Ordinary Differential Equation) which can be solved symbolically, but it does not take much to end up with an ODE which is too tough for the package (but might have solutions) or which ends up in an integral equation.
Symbolic calculations of determinants or eigenvalues easily run out of memory even with 8+ Gb.
Simultaneous nonlinear equations easily run out of memory. Even if the maximum degree is only 2, in practice the limit is about 8 to 10 simultaneous equations. Just because there is a solution and the solution is straight forward doesn't mean it is practical to calculate it.
If your equations involve floating point numbers, the symbolic package still has to do roundoff and that roundoff might might make it impossible to find a solution. Floating point numbers are an implicit request for non-analytic solutions because the precision of floating point numbers is unspecified. Is 0.1234 intended as 1234/10000 ? Is it intended as 0.1234 +/- 0.00005 ? The lack of precision about floating point numbers makes a big difference in expressions as simple as quartics (polynomials of degree 4). A value to a power which is a floating point number has difficulty: if you have x^0.75 then is that sqrt(sqrt(x))^3? Is it (x^(1/4))^3 ? Is it (x^3)^(1/4) ? These different expressions have different meanings when it comes to negative numbers and to working with complex numbers. Effectively if you have even one floating point number in your equations, you are violating the assumptions of algebra and run the risk of getting nonsense answers.
There are expressions which have definite root within a known range but whose slope is so steep that finding the root numerically cannot be done for any given relative tolerance.
... and so on.
There are a lot of limitations in symbolic computing. Finding analytic solutions can take days for expressions that take only a few seconds to solve numerically (to a reasonable precision.) And you need to ask yourself, "Suppose I find the analytic solution and it is a few gigabytes: what I am going to do what that solution??"
A few weeks ago we had someone who was trying to solve symbolically for the eigenvalues of a large array, as the eigenvalues represented the vibration modes. We were able to give an order of magnitude estimate for the size of the symbolic solution; it exceeded the amount of storage available on Earth. The person needed to publish the result as part of a thesis. There certainly was a well-defined analytic solution to what the person needed to do, but there was no practical way that it could be computed within centuries or that the result could be stored. Just because there might be a straight-forward analytic solution doesn't mean that the analytic solution should be used.

More Answers (1)

John D'Errico
John D'Errico on 31 Jan 2016
It is impossible to state the possible limitations of the symbolic toolbox. Not all tools can solve all problems. In fact, it is trivial to pose a problem that has no symbolic solution. The symbolic TB will indeed solve many problems, but provably, it cannot solve all problems.
And yes, it is possible to use symbolic differentiation for many problems, however, the finite difference derivative estimates used in many places are entirely adequate for those purposes. Or you can use the derivest tools I've posted on the FEX to improve the accuracy of a derivative estimate, at some cost in time.
No tool will solve ALL problems. There is no magic bullet. Having a second tool to help you will improve your probability of success. Understanding the tools at your disposal will also help you greatly.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!