Suppose I want to find the smallest circle, centered at the origin, which circumscribes a Piriform curve
( Piriform Curve -- from Wolfram MathWorld ),
defined by piri[ { x, y} ] == 0 where
piri[{x_, y_}] = x^3 (2 - x) - y^2;
by shifting the curve’s center along the x-axis. This involves minimizing the maximum distance from the origin to the shifted curve. The maximum distance as a function of the shift can be calculated as follows:
The result is a Piecewise function containing Root functions and cannot be analytically minimized, but is equal to -x0 for x0 <= 1/27 (-17 - 7 Sqrt[7]) and larger values for x0 greater than that value, as shown in the following plot
In[162]:= FindRoot[Area[RegionIntersection[\[ScriptCapitalR], Disk[{x, 0}, x]]] - Area[\[ScriptCapitalR]], {x, 1, 0, 6}]
During evaluation of In[162]:= Area::nmet: Unable to compute the area of region RegionIntersection[Disk[{x,0},x],ImplicitRegion[-9 (4-x) x^3+16 y^2<0,{x,y}]]. >>
During evaluation of In[162]:= FindRoot::jsing: Encountered a singular Jacobian at the point {x} = {4.05281}. Try perturbing the initial point(s). >>
Out[162]= {x -> 4.05281}
In[163]:= RegionPlot[{\[ScriptCapitalR], Disk[{x, 0}, x] /. %} ]
the function is not ideal for FindRoot because it becomes constant zero for x equal to or greater than the searched x and FindRoot complains about that, nevertheless
That’s an interesting approach. I’ve been trying to define a constraint for ellipse packing that prevents their overlap, but it didn’t occur to me to use the area of the region intersection.
No error messages anymore, but one has to choose two constants: an upper bound for the intersections and an upper bound for the numerical integration which has the only purpose to find out the jumping point from 5 intersections through 3 into 1 intersection.