Solve with absolute value

27 visualizzazioni (ultimi 30 giorni)
sarah pabst
sarah pabst il 4 Ago 2019
Modificato: John D'Errico il 4 Ago 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?

Risposta accettata

John D'Errico
John D'Errico il 4 Ago 2019
Modificato: John D'Errico il 4 Ago 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.

Più risposte (0)

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by