4
$\begingroup$

There are large differences in how long it takes to plot regions which, in my eyes, should be computationally very similar.

The following two work fine:

RegionPlot[ParametricRegion[{{x, y}, x + y^(4/3) >= 1 && 0 <= x <= 1 && 0 <= y <= 1}, {x, y}]]
RegionPlot[ParametricRegion[{{x, 1+y}, x + y^(5/3) >= 1 && 0 <= x <= 1 && 0 <= y <= 1}, {x, y}]]

However, the following takes so long that that I eventually had to abort:

RegionPlot[ParametricRegion[{{x, 1+y}, x + y^(4/3) >= 1 && 0 <= x <= 1 && 0 <= y <= 1}, {x, y}]]

Why should the first one be so much easier to compute than the last one? The only difference is a simple translation. How can I work around this?

$\endgroup$

2 Answers 2

5
$\begingroup$
  • Region
Region[ParametricRegion[{{x, 1 + y}, 
   x + y^(4/3) >= 1 && 0 <= x <= 1 && 0 <= y <= 1}, {x, y}]]
  • Or replace y^(4/3) with CubeRoot[y^4].
RegionPlot[
 ParametricRegion[{{x, 1 + y}, 
   x + CubeRoot[y^4] >= 1 && 0 <= x <= 1 && 0 <= y <= 1}, {x, y}]]

Edit

For arbitrary rational powers, e.g. p/q=12/5, we can use Surd[y^p,q].

p = 12; q = 5;
reg = ParametricRegion[{{x, 1 + y}, 
   x + Surd[y^p, q] >= 1 && 0 <= x <= 1 && 0 <= y <= 1}, {x, y}]
reg // RegionPlot

enter image description here

$\endgroup$
1
  • $\begingroup$ Thanks, both of these indeed work and fix the issue in this particular case! However, I would like to be able to do further things with the Region (e.g. intersect it with other Regions, call Plot3D using the region as the domain, etc.) and not all of this works when using the first of the two fixes. For the second fix, I do not know how to generalize it to accommodate arbitrary rational powers greater 1. 4/3 and 5/3 were specific examples, but in general the exponent is actually the result of some other computation. $\endgroup$
    – mashca
    Mar 17, 2023 at 16:39
2
$\begingroup$
Clear["Global`*"]

rgn = ParametricRegion[{{x, 1 + y}, 
    x + y^(4/3) >= 1 && 0 <= x <= 1 && 0 <= y <= 1}, {x, y}];

Region[rgn, Axes -> True] // AbsoluteTiming

enter image description here

RegionPlot[{x, y} ∈ rgn, {x, 0, 1}, {y, 1, 
   2}] // AbsoluteTiming

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.