How to solve non linear equations with three variables? I tried matlab codes available in www.mathworks.in. and also I tried Newton rapson method .But I could not get proper output.Please help me to solve this.
Afficher commentaires plus anciens
- ((x-x1)^2+(y-y1)^2+(z-z1)^2)^2-((x-x2)^2+(y-y2)^2+(z-z2)^2)^2=t1.
- ((x-x2)^2+(y-y2)^2+(z-z2)^2)^2-((x-x3)^2+(y-y3)^2+(z-z3)^2)^2=t2.
- ((x-x3)^2+(y-y3)^2+(z-z3)^2)^2-((x-x4)^2+(y-y4)^2+(z-z4)^2)^2=t3.Only unknowns are x,y,z.All other variables are known.
4 commentaires
Walter Roberson
le 19 Déc 2012
Modifié(e) : Walter Roberson
le 19 Déc 2012
It appears that you are trying to find the coordinates of the intersection of three spheres ? One at (x1,y1,z2) and radius t1, and so on? If so, then if I recall correctly, Roger has a solution for that.
Roger Stafford
le 19 Déc 2012
Modifié(e) : Walter Roberson
le 19 Déc 2012
Walter, these three equations equate differences in the fourth power of the Euclidean distance of a point (x,y,z) from three fixed points. It is analogous to the problem of a hyperbola which is the locus of points in x,y space with a given difference in the distances to two focal points. This is a different problem from finding the intersections of three spheres. Unfortunately for Deepak's attempt to "solve" them, the equations are not independent so they have an infinitude of solutions (analogously to a hyperbola) or else none at all.
Roger Stafford
Walter Roberson
le 19 Déc 2012
Roger, please re-check. Possibly the equations have been edited since you first looked. The sum of the first two cancels out the terms involving x2, y2, z2, leaving the 1's minus the 3's, but that is not the same as what is in the third equation.
Roger Stafford
le 20 Déc 2012
Thank you, you're right, Walter, there has been a significant alteration in the stated problem. The third equation formerly involved the points (x1,y1,z1) and (x3,y3,z3) and the three equations were mutually dependent or incompatible, depending on the t values. I am accustomed to CSSM where no change can be entered after an article is once entered.
Nevertheless it still is not a problem in sphere intersection. Each of the loci of the three equations is a surface of revolution about the connecting line segment between the two corresponding fixed points and approaches asymptotically the plane orthogonally bisecting that segment. With a 't' value of zero it would be that plane itself. The desired solution will be the point or points of intersection of the three surfaces - not a trivial problem.
Roger Stafford
Réponses (2)
Roger Stafford
le 16 Déc 2012
Modifié(e) : Walter Roberson
le 19 Déc 2012
1 vote
There is a very good reason why those three equations present a difficulty. If the left sides of the first two equations are added, their sum would be identically equal to the left side of the third equation. This means that to have any solutions at all, it must be true that t1+t2=t3. If that is true, then there really are only two independent equations but still three unknowns, and in general these would then have an infinite continuum of possible solutions.
It is not a well-posed problem.
Roger Stafford
7 commentaires
Roger Stafford
le 17 Déc 2012
Modifié(e) : Walter Roberson
le 19 Déc 2012
When I asserted that the request was not a "well-posed problem" I was referring to an apparent expectation that one could obtain a single solution, or at least a finite set of discrete solutions, and of course this cannot be realized in general. However if t1+t2=t3 is assumed to be true, or equivalently if only two of the equations are to be satisfied, and if your request was to plot the resulting 1D curve in 3D space of the "infinite continuum" of solutions, that would be a well-defined problem worthy of consideration. It is loosely analogous to defining 1D hyperbolas in 2D. Moreover I believe I can see a way that problem can actually be solved in terms of the roots of a certain polynomial, for which matlab's 'roots' function would be very useful.
Roger Stafford
deepak kg
le 18 Déc 2012
Roger Stafford
le 18 Déc 2012
Modifié(e) : Walter Roberson
le 19 Déc 2012
No, you are mistaken, Deepak! As I stated before, if you add the left and right sides of the first two equations, the result is an equation which is either the same as the third equation if t1+t2=t3, or incompatible with it otherwise. This means that in the first case the three equations are dependent and there are infinitely many solutions, or in the other case they are mutually incompatible and there are no solutions whatever.
Roger Stafford
deepak kg
le 19 Déc 2012
Roger Stafford
le 19 Déc 2012
Deepak, I will give you a simple example which is analogous to your three equations and demonstrates the difficulty of trying to "solve" them. Consider the three linear equations
2*x - 4*y + 3*z = t1
3*x + 2*y + 4*z = t2
5*x - 2*y + 7*z = t3
If you add the left and right sides of the first two equations you get the equation
5*x - 2*y + 7*z = t1 + t2
Obviously this equation and the third equation above, whose left sides are identical, cannot both be true at the same time unless t1 + t2 is equal to t3. With t1 + t2 not equal to t3 these would be incompatible equations, meaning that no combination of x, y, and z values could possibly satisfy all three equations simultaneously.
On the other hand, suppose t1 + t2 is equal to t3. In that case there will be infinitely many solutions. To see that, just set z equal to any value you please - there is are infinitely many to choose from. Then if x and y are chosen according to the formulas
x = (t1+2*t2-11*z)/8
y = (2*t2-3*t1+z)/16 ,
the three numbers x, y, and z will always satisfy all three equations. These solutions constitute a one-dimensional line in three dimensional space - the equations have an infinite continuum of solutions. This is a consequence of the three equations not being mutually independent of one another.
This same kind of dependency holds true for the three equations you have given here in this problem. With t1 + t2 equal to t3 your three equations have infinitely many solutions - it will be some one-dimensional curve in three-dimensional x,y,z space. With t1 + t2 not equal to t3 they cannot have any solutions at all. They would then be incompatible.
Roger Stafford
Roger Stafford
le 20 Déc 2012
My apologies to you, Deepak. I was unaware of the editing change that had been made to the original equations. As I pointed out to Walter, the solution to the revised equations is the point or points of intersection of three surfaces of revolution. Finding these intersection points using a function like 'fsolve' may be a matter of carefully selecting the appropriate initial estimates, and the same is true with the Newton-Raphson method. I would expect either one of them, particularly the latter, to fail unless a reasonably close initial value were used.
Roger Stafford
deepak kg
le 22 Déc 2012
Muruganandham Subramanian
le 14 Déc 2012
Modifié(e) : Muruganandham Subramanian
le 14 Déc 2012
0 votes
try using inline()
>>doc inline/formula
1 commentaire
deepak kg
le 15 Déc 2012
Catégories
En savoir plus sur Assembly dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!