2
$\begingroup$

No matter what option I set to DiscretizeRegion it fails on the region (missing second line).

What else can be done?

$Version
Region[ImplicitRegion[(1/2 (-1 - Sqrt[5]) <= x <= 1/2 (-1 + Sqrt[5]) ||
      x >= 1) && y == 5/100, {x, y}], PlotRange -> {{-2, 2}, {-1, 1}},
  Axes -> True]

DiscretizeRegion[%, PlotRange -> {{-2, 2}, {-1, 1}}, Axes -> True, 
 AccuracyGoal -> 10, PrecisionGoal -> 10, MaxCellMeasure -> 1/10, 
 MeshQualityGoal -> "Maximal"]

"13.0.1 for Microsoft Windows (64-bit) (January 28, 2022)"

enter image description here

For a similar region it works:

Region[ImplicitRegion[(1/2 (-1 - Sqrt[5]) <= x <= -1 || 
     x >= 1/2 (-1 + Sqrt[5])) && y == 1/20, {x, y}], 
 PlotRange -> {{-2, 2}, {-1, 1}}, Axes -> True]

DiscretizeRegion[%, PlotRange -> {{-2, 2}, {-1, 1}}, Axes -> True, 
 AccuracyGoal -> 10, PrecisionGoal -> 10, MaxCellMeasure -> 1/10, 
 MeshQualityGoal -> "Maximal"]

enter image description here

$\endgroup$
2
  • $\begingroup$ Could it be because the region is not bounded? $\endgroup$
    – Syed
    Commented Mar 27 at 14:24
  • $\begingroup$ On other unbounded regions it works. For example ImplicitRegion[(1/2 (-1 - Sqrt[5]) <= x <= -1 || x >= 1/2 (-1 + Sqrt[5])) && y == 1/20, {x, y}] $\endgroup$ Commented Mar 27 at 14:24

2 Answers 2

4
$\begingroup$
  • add data range {{-2, 2}, {-1, 1}} before PlotRange -> {{-2, 2}, {-1, 1}}
reg = ImplicitRegion[(1/2  (-1 - Sqrt[5]) <= x <= 
       1/2  (-1 + Sqrt[5]) || x >= 1) && y == 5/100, {x, y}];
DiscretizeRegion[reg, {{-2, 2}, {-1, 1}}, 
 PlotRange -> {{-2, 2}, {-1, 1}}, Axes -> True]

enter image description here

  • Another way is only use RegionPlot.
RegionPlot[reg, Method -> {"DiscretizationMethod" -> "Symbolic"}, 
 PlotRange -> {{-2, 2}, {-1, 1}}, Frame -> False, Axes -> True]

enter image description here

$\endgroup$
2
  • $\begingroup$ I need the plot range as is specified. $\endgroup$ Commented Mar 27 at 14:35
  • $\begingroup$ @azerbajdzan as my updated answer or use Show[..., PlotRange -> {{-2, 2}, {-1, 1}}] $\endgroup$
    – cvgmt
    Commented Mar 27 at 14:38
1
$\begingroup$

I found a workaround by adding LogicalExpand in the code.

Region[ImplicitRegion[
  LogicalExpand[(1/2 (-1 - Sqrt[5]) <= x <= 1/2 (-1 + Sqrt[5]) || 
      x >= 1) && y == 5/100], {x, y}], 
 PlotRange -> {{-2, 2}, {-1, 1}}, Axes -> True]

DiscretizeRegion[%, PlotRange -> {{-2, 2}, {-1, 1}}, Axes -> True, 
 AccuracyGoal -> 10, PrecisionGoal -> 10, MaxCellMeasure -> 1/10, 
 MeshQualityGoal -> "Maximal"]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.