Solve with absolute value

20 views (last 30 days)
sarah pabst
sarah pabst on 4 Aug 2019
Edited: John D'Errico on 4 Aug 2019
I've got a problem with the solve operator. I create a syms l and calculate the eigenvalues of a matrix (given by the H(app,l)-function) depending on l.
syms l;
[~,D] = eig(H(app,l));
I get the correct results when calculating
S = solve(D(1,1) == D(2,2),l);
but no results at all when trying
S = solve(abs(D(1,1))==abs(D(2,2)),l);
even though the solutions I've calculated in the first try should solve the second one, too. When debugging and trying with the consol I get the error message "Warning: Unable to solve symbolically. Returning a numeric solution using vpasolve.". Does anyone know a solution?

Accepted Answer

John D'Errico
John D'Errico on 4 Aug 2019
Edited: John D'Errico on 4 Aug 2019
Once you introduce that absolute value into the problem, you make it sufficiently nonlinear that no analytical solution can exist. Solve told you that. So it used vpasolve instead.
Wanting an analytical solution to exist when none exists is not going to make it happen.
This is similar to wanting to solve for the roots of a general 5'th degree polynomial. You can use vpasolve to get them numerically. But there will be no analytical solution to the general 5th degree problem, and that is provably true. So even though the roots do exist, solve can never find them, because solve is not a numerical solver. (Solve can solve SOME 5th degree polynomials, but not the general case.) It is the same thing as what you want to do.

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!