Empty sym: 0-by-1
조회 수: 10 (최근 30일)
이전 댓글 표시
syms x
c2 = 5.231727664128001e-27;
c1 = 1.6500123538833403e-33;
eqn = c2/2 + (sqrt((x^2/4)+c1))/c1 == log((x/2-sqrt(x^2/4+c1))/(sqrt(x^2/4+c1)-x/2));
solve(eqn)
I am unable to get any value when I try to solve for x in this equation.
댓글 수: 0
답변 (2개)
Walter Roberson
2020년 7월 13일
The equation has no solutions.
You can use vpasolve() specifying a large number of digits and you will get some answer, but the calculation being done is within tolerances and the tolerances turn out to not be valid for this equation.
If you use too few digits in the solution, then the results can vary quite a bit, making it almost appear that the real portion is probably zero and not showing up as non-zero due to rounding. However, if you use sufficient digits, then the real portion and imaginary portions will settle down. Unfortunately they will not settle into a valid solution.
The x^2/4 + c1 will involve squaring a pretty small number, such that x^2/4 is within round-off of c1. The x^2/4 portion effectively vanishes, leading to invalid solutions. In theory you could balance that term with infinite number of digits... but you cannot really calculate accurately enough with finite number of digits.
But all that does not matter. The algebraic chain that permits you to get far enough to do those calculations, turns out to have a branch cut that cannot be satisfied. When you back-substitute the numeric solutions to the difference between the left and right side of the equation, you get out a real component about 1e-27, but the sign is wrong between the imaginary components, so instead of pi imaginary component on each side canceling out, you end up with 2*pi imaginary component. Though I can't say that I thought to test the complex conjugate to see whether that would work.
댓글 수: 0
Mahesh Taparia
2020년 7월 13일
Hi
The function solve is the symbolic solver. You can use vpasolve function to find the solution. For example, for your case:
vpasolve(eqn)
ans =
1.5089977350351154212617542935339e-35 - 0.000000000000000081240688177374279597779655094221i
댓글 수: 1
Walter Roberson
2020년 7월 13일
This solution is invalid, it turns out. If you back-substitute it, the two sides of the equation will not come anywhere close to balancing.
참고 항목
카테고리
Help Center 및 File Exchange에서 Equation Solving에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!