8
$\begingroup$

I am trying to learn how to describe and plot a 2D-region for $x_1$ and $x_2$ based on / parametrized by another 2D-region for $v_1$ and $v_2$.

In the following example, the region vreg for the variables v1 and v2 is described by the conditions vcond (in this simple example a circle). Now, for each point in vreg, I define some conditions for the variables x1 and x2 and with these conditions a region xreg.

At the end, I want to plot the region xreg by considering all points in vreg and generate points in this region. Unfortunately, however, the following code returns errors indicating that the region cannot be automatically discretized:

v = {v1, v2};
vcond = v1^2 + v2^2 <= 20;
vreg = ImplicitRegion[vcond, {v1, v2}];
f1low = 1 + v1*v2;
f1upp = 2 + 2*v1*v2 ;
f2low = 1 + v1*v2;
f2upp = 4 + 3*v1*v2;
xcond = f1low <= x1 <= f1upp && f2low <= x2 <= f2upp;
xreg = ImplicitRegion[xcond && Element[{v1, v2}, vreg], {x1, x2}]

RegionPlot@xreg
RandomPoint[xreg]

I know that I could begin generating points in vreg and try to evaluate all conditions with Or, e.g.,

vp = RandomPoint[vreg, 7];
xreg = ImplicitRegion[
  Simplify[Or @@ (xcond /. {v1 -> #[[1]], v2 -> #[[2]]} & /@ vp)], 
  {x1, x2}
]

 Show[
 {
  RegionPlot@xreg, 
  ParametricPlot[
    {{f1low, f2low}, {f1low, f2upp}, {f1upp, f2low}, {f1upp, f2upp}}, Element[{v1, v2}, vreg], 
    PlotLegends -> Automatic
  ]
 }, 
 PlotRange -> All
]

enter image description here

But this is very time consuming and I need to take a look at the whole set.

Later, I also want to use more complicated conditions for x1 and x2, e.g., f[v1, v2] <= x1*x2 for nonlinear f[v1, v2] but first I want to understand this simpler problem.

How can I plot the region xreg?

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.