symbolic
symbolic copied to clipboard
vpasolve only returns one solution for polynomial equations
The vpasolve
function only returns one numerical solution out of N possible solutions to a polynomial equation. The SMT vpasolve
function says that it returns all possible numerical solutions when the input is a polynomial
For polynomial equations,
vpasolve
returns all solutions.
(from https://www.mathworks.com/help/symbolic/vpasolve.html)
An example given on the Matlab page is
S = vpasolve(2*x^4 + 3*x^3 - 4*x^2 - 3*x + 2 == 0, x)
and the solution should be a column vector of 4 solutions. Ours only returns one solution, which is arrived at by nsolve
based on an initial guess of 0.
Based on a message to the Octave help list (https://lists.gnu.org/archive/html/help-octave/2019-11/msg00112.html)
I see. That is strange behaviour IMHO, because I think of vpasolve as basically Newton's method.
I guess it must be done by companion matrix eigenvalues or similar. I'd worry about if two roots are closer than the current vpa precision, and what about high multiplicity roots, etc.
I think its unlikely we will support this any time soon because I don't think mpmath has this feature, but of course a motivated person could work on adding it to mpmath!
To be honest, I'm not even sure how to symbolically assess if a given expression is polynomial or not!