I'm trying to learn how to use the function Minimize
in Mathematica.
I first defined the following function in Mathematica:
$$r(x,y,z,i)=\sqrt{(x-X_i)^2+(y-Y_i)^2+(z-Z_i)^2}$$
with the command
r[x_, y_, z_, i_] := Sqrt[(x-Subscript[X, i])^2 + (y-Subscript[Y, i])^2 + (z-Subscript[Z, i])^2]
Then I tried minimizing the following function over $x,y,z$:
$$ f(x,y,z)=(R_i-r(x,y,z,i))^2 $$
with the following command:
Minimize[(Subscript[R, i] - r[x, y, z, 1])^2, {x, y, z}]
The output I was expecting is a circle of points centered around $(X_i,Y_i,Z_i)$ and with radius $R_i$ (since at these points the function attains the value zero), or at least any point on that circle.
However, Mathematica outputs a very long and (for my knowledge level) cryptic solution. I can't think of any reasonable way to post the output here in a human-readable way, so perhaps it's easier if you try doing the commands in your Mathematica and see the output there (if someone thinks it's clearer, I can insert the whole output here, or perhaps a screenshot of it).
So my question is: am I doing something wrong, or is there a way to interpret this output in a meaningful way?
Any help would be appreciated, thank you.
X,Y,Z,R
$\endgroup$Simplify[Minimize[(Subscript[R, i]-r[x,y,z,1])^2,{x,y,z}],{Subscript[R, i]>0,Element[{x,y,z,Subscript[X, i],Subscript[Y, i],Subscript[Z, i]},Reals]}]
$\endgroup$