How to solve the below equation.
조회 수: 2 (최근 30일)
이전 댓글 표시
P=30;A=1.73*10^-5;R=1.35; a=1.5;
P*A*R/x^2=(pi/2)-(a/x)*sqrt(1-(a/x)^2)-asin(a/x)
I tried to solve but I am not getting expected value. I am getting
x=-2.1904584724526039369361593374613e278980111
which is not true.
댓글 수: 0
채택된 답변
John D'Errico
2017년 5월 29일
편집: John D'Errico
2017년 5월 29일
It is NEVER right to just throw something at a computer without applying cognitive thought, and then hope the computer does something intelligent. If you cannot bother to do something intelligent, then how do you expect a computer program do be more intelligent that you?
PLOT EVERYTHING. Think about what you see. Do this BEFORE you throw something at solve, or any algorithm. Certainly do that as soon as you see something that you don't understand. Then think about what you see.
EQ = -P*A*R/x^2 + (pi/2)-(a/x)*sqrt(1-(a/x)^2)-asin(a/x);
ezplot(EQ),grid
As you should see, there MAY be a root near x==1.5.
However, does this problem have an analytical solution? Of course not! So if you throw it at solve, solve will give up quickly enough, and call vpasolve.
But what is the default start point for vpasolve? x==0. This relation seems to not even produce real values near x==0, and there is a singularity at x==0.
subs(EQ,x,0)
Error using symengine
Division by zero.
Error in sym/subs>mupadsubs (line 150)
G = mupadmex('symobj::fullsubs',F.s,X2,Y2);
Error in sym/subs (line 135)
G = mupadsubs(F,X,Y);
vpa(subs(EQ,x,.1))
ans =
- 0.070064999999999992737198528658382 - 221.09935879232314363432473672475i
So if you start at zero, the solver heads down the left branch towards -inf. It has clearly diverged.
Does it have a solution at all? It does appear to cross the axis, if you look carefully enough.
vpasolve(EQ,x,1.6)
ans =
1.5045119404060829982776470260739
The solution is to start vpasolve in the RIGHT branch, the branch that does admit a solution.
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 MATLAB Support Package for LEGO MINDSTORMS EV3 Hardware에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!