Message Boards Message Boards


[✓] Solve this system of equations with some assumptions?

Posted 7 months ago
3 Replies
4 Total Likes

I want to solve a system of equations which will result in expressions for xs, ys, zs for a coordinate (xs, ys, zs) which corresponds to the point at which a vector, originating from the point (xp, yp, zp), intersects a paraboloid of equation zs = [ (xs^2 +ys^2) / 4f ] - f .

assumptions = {rps > 0,  -Pi/2 < theta < Pi/2, rps \[Element] Real, 
  theta \[Element] Real, xp \[Element] Real, yp \[Element] Real , 
  zp \[Element] Real, phi \[Element] Real, f > 0, f \[Element] real}

Solve[{rps^2  ==  (xs - xp)^2 + (ys - yp)^2 + (zs - 
  rps Sin[theta] Cos[phi] + xp  == Sqrt[4 f zs + 4 f^2 - ys^2],       
  rps Sin[theta] Sin[phi] + yp  == Sqrt[4 f zs + 4 f^2 - xs^2],       
  rps Cos[theta]  + zp  == (xs^2 + ys^2 )/(4 f) - f}, {xs, ys, zs}, 
 Assumptions ->  assumptions ]

rps is the length of the vector (from the point (xp,yp,zp) to the intersection point on the paraboloid); for the last three equations i have used the spherical coordinate definitions of x, y ,z in terms of theta and phi (since my answer must be in terms of these variables) and equated them to the rearranged form of the expression of the paraboloid.

BUT when i run this code it will either run for hours (and i left it over night!) or simply crashes my computer.

What am i doing wrong?

I'm sure that this reasonable straight forward geometric problem must have a solution.

3 Replies

For the set of the real numbers the symbol is Reals, not Real. Assumptions is not an option for Solve. With Solve you can use the syntax Solve[{x^2 == 1, x > 0}, x] or Solve[x^3 == 1, x, Reals]. Your system is 4 equations and three unknowns. Each equation is of degree 2. You can simplify it a bit by calling a,b,c,d the left-hand sides and squaring the second and third equation. Without the assumptions it gives solutions quickly:

Reduce[{a == (xs - xp)^2 + (ys - yp)^2 + (zs - zp)^2, 
  b^2 == 4 f zs + 4 f^2 - ys^2, c^2 == 4 f zs + 4 f^2 - xs^2, 
  d == (xs^2 + ys^2)/(4 f) - f}, {xs, ys, zs}]
Posted 7 months ago

Thank you for your corrections on my use of "Real" and "Assumptions". However i think the problem must be a bug in my copy of Mathematica, or simply my computer being very slow. I attempted this problem previously with no assumptions at all and it still took forever, i also tried inputting the equations in various forms. On running your example code, the program ran for over ten minutes at which point I aborted :(. Perhaps i need to re-install and/or get a new computer.

Another issue is that the system is overdetermined (four equation in three variables) and has no generic solution. When I remove the radicals by squaring I get reasonable speed and an empty solution set.

Solve[{rps^2 == (xs - xp)^2 + (ys - yp)^2 + (zs - 
       zp)^2, (rps Sin[theta] Cos[phi] + xp)^2 == 
   4 f zs + 4 f^2 - ys^2, (rps Sin[theta] Sin[phi] + yp)^2 == 
   4 f zs + 4 f^2 - xs^2, 
  rps Cos[theta] + zp == (xs^2 + ys^2)/(4 f) - f}, {xs, ys, zs}]

(* Out[385]= {} *)
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract