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

2 vues (au cours des 30 derniers jours)
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 commentaire
Luca Ferro
Luca Ferro le 18 Avr 2023
could you please explain what result do you expect from it? clearly not 0, but which values then?

Connectez-vous pour commenter.

Réponses (1)

David Goodmanson
David Goodmanson le 19 Avr 2023
Modifié(e) : David Goodmanson le 19 Avr 2023
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.

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Tags

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by