I know it is a redundant question, but i have no idea why solve keeps returning 0
조회 수: 2 (최근 30일)
이전 댓글 표시
G1 = 10;
G2 = 12;
syms x1 x2 y1 y2
solutions = solve(-(70992*G1*G2*(x1-x2))/(25*((3944*(x1-x2)^2)/25+(y1-y2)^2)^2) == 0,...
(70992*G1*G2*(x1-x2))/(25*((3944*(x1-x2)^2)/25+(y1-y2)^2)^2) == 0,...
-(18*G1*G2*(y1-y2))/((y1-y2)^2+(3944*(x1-x2)^2)/25)^2 == 0,...
(18*G1*G2*(y1-y2))/((y1-y2)^2+(3944*(x1-x2)^2)/25)^2 == 0,...
[x1 x2 y1 y2])
double (solutions.x1)
double (solutions.x2)
double (solutions.y1)
double (solutions.y2)
I know it is written horribly, but i am past any kind of mental stability now :))))
These are the equations. Is it something I am not seeing? It keeps answering each and one of them as 0, when they are not.
댓글 수: 1
Luca Ferro
2023년 4월 18일
could you please explain what result do you expect from it? clearly not 0, but which values then?
답변 (1개)
David Goodmanson
2023년 4월 19일
편집: David Goodmanson
2023년 4월 19일
Hello Andrei,
First of all, all these expressions are functions of (x1-x2) and (y1-y2) only. That means if x1,x2,y1,y2 is a solution, then
x1--> x1+a, x2--> x2+a, y1--> y1+b, y2--> y2+b
is also a solution. So there is a lot of redundancy. Second, the first two expressions are of the form
[expression] = 0, -[same expression] = 0
which are not two independent equations. Same for the third and fourth expressions so there are only two independent equations overall.
To look at the dependence of the solutions on the variables you can repace (x1-x2) by x and (y1-y2) by y. Factors such as 70992G1G2 / 25 make no difference to an expression that equals 0, and can be dropped. For simplicity, rescaling x appropriately by sqrt(3944/25) leads to
x/(x^2+y+2)^2 = 0
y/(x^2+y+2)^2 = 0
Go to polar coordinates x = r cos(theta), y = r sin(theta), then
cos(theta)/r^3 = 0
sin(theta)/r^3 = 0
The preferred solution would be cos(theta) = 0 sin(theta) = 0, r~=0 (r being finite), but that is not possible. So the only solution is
r --> inf
which is technically correct but not a very satisfactory result.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!