Error in re-arranging equation - matlab

조회 수: 2 (최근 30일)
sarah
sarah 2015년 4월 3일
댓글: sarah 2015년 4월 6일
Hey guys I want to solve this equation to rearrange for x but it's giving a message which is strange. Does anyone know what the problem is? I know that the solution is complex but it should still solve for it. I know that my syntax etc are correct. Would anyone know an alternate way to display complex roots?
syms x y
>> eqn = (x^2.5 - (1250*(1-(0.525*x^0.5))^2)/(y*(1-(0.3*x^0.5)))==0)
eqn =
x^(5/2) + (1250*((21*x^(1/2))/40 - 1)^2)/(y*((3*x^(1/2))/10 - 1)) == 0
>> v_x=solve(eqn,x)
Warning: The solutions are parametrized by the symbols:
z1 = ({0.0} union Dom::ImageSet(1.0*x*I + y, [x, y], [R_,Dom::Interval(0.0, RD_INF)]) union
Dom::ImageSet(1.0*x*I, x, Dom::Interval(0.0, RD_INF))) intersect RootOf(48*y*z^6 - 160*y*z^5 + 55125*z^2 -
210000*z + 200000, z)
> In solve at 190
v_x =
z1^2

채택된 답변

John D'Errico
John D'Errico 2015년 4월 3일
So you want to solve for x, given an unknown y? Why do you think an analytical solution exists, or even if it does, that it can be found?
First, get rid of those radicals. Substitute
x = u^2
simplify(subs(eqn,x,u^2))
ans =
48*y*u^6 + 55125*u^2 + 200000 == 80*(2*y*u^4 + 2625)*(u^2)^(½) & ~u in {-10/3, 10/3} & y ~= 0
So, subject to some constraints on y and u, this reduces to a 6th degree polynomial in u, where the coefficients are functions of y. While it is possible to solve some for the roots of SOME simple polynomials, they are relatively rare. This is surely not one of them. In general, such polynomials of degree 5 or higher are not solvable analytically.
If you choose to supply a value for y, then you could solve for the roots numerically, but that is as much as you can ask to do. Even there you will get only numerical values for those roots, and only if a root exists.
Having done that, now lets go back to your original equation, because the transformation may introduce spurious solutions. ezplot being the impressive tool that it is, we get:
ezplot(eqn,[0,10])
grid on
vpasolve(subs(eqn,y,5))
ans =
2.6155171172702278618796721666051
To solve for a point on the upper branch of that curve,
vpasolve(subs(eqn,y,5),5)
ans =
6.25
  댓글 수: 4
sarah
sarah 2015년 4월 6일
thank you so much that was really helpful :))
sarah
sarah 2015년 4월 6일
I have another question for you regarding vpasolve for upper and lower branch. At times the graph would show two solutions but vpasolve for upper and lower branch gives the same answer. Would you know possibly why?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by