I know it is a redundant question, but i have no idea why solve keeps returning 0

1 回表示 (過去 30 日間)
Andrei Iacob
Andrei Iacob 2023 年 4 月 17 日
編集済み: David Goodmanson 2023 年 4 月 19 日
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])
solutions = struct with fields:
x1: 0 x2: 0 y1: 0 y2: 0
double (solutions.x1)
ans = 0
double (solutions.x2)
ans = 0
double (solutions.y1)
ans = 0
double (solutions.y2)
ans = 0
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
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
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.

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by