Solve with absolute value

조회 수: 11 (최근 30일)
sarah pabst
sarah pabst 2019년 8월 4일
편집: John D'Errico 2019년 8월 4일
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?

채택된 답변

John D'Errico
John D'Errico 2019년 8월 4일
편집: John D'Errico 2019년 8월 4일
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개)

카테고리

Help CenterFile Exchange에서 Numeric Solvers에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by