Solve with absolute value
23 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
sarah pabst
le 4 Août 2019
Modifié(e) : John D'Errico
le 4 Août 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?
0 commentaires
Réponse acceptée
John D'Errico
le 4 Août 2019
Modifié(e) : John D'Errico
le 4 Août 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.
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Linear Algebra dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!