0
$\begingroup$

A simple working example of RegionPlot3Dis

klist = {k1, k2, k3};
RegionPlot3D[
 Times @@ klist < 1, {k1, -5, 5}, {k2, -5, 5}, {k3, -5, 5}]

However, I would like to not explicitly write out {k1, -5, 5}etc. by hand, but rather get the variables from a list, e.g. {klist[[1]], -5, 5}. I am finding this more difficult than expected (Mathematica 11.0.1 for Windows 64-bit). For instance, this fails:

RegionPlot3D[Times @@ klist < 1, 
{klist[[1]], -5, 5}, {klist[[2]], -5, 5}, {klist[[3]], -5, 5}]

(* RegionPlot3D::write: Tag Part in klist[[1]] is Protected. *)

Plotting over a Cuboid[] does not work either:

RegionPlot3D[Times @@ klist < 1, 
klist \[Element] Cuboid[{-5, -5, -5}, {5, 5, 5}]] 

(* RegionPlot3D::pllim: Range specification klist\[Element]Cuboid[{-5,-5,-5},{5,5,5}] 
    is not of the form {x, xmin, xmax}. *)

The closest I got to my goal is with this rather convoluted solution:

RegionPlot3D[
 ImplicitRegion[(Times @@ klist < 1) && And @@ Thread[-5 < klist < 5],
   Evaluate@klist]]

enter image description here

I can't help but wonder if there is an easier way I am missing?

$\endgroup$
2
$\begingroup$

Maybe this?

RegionPlot3D @@ Join[{Times @@ klist < 1}, Evaluate@{#, -5, 5} & /@ klist]
$\endgroup$
1
  • $\begingroup$ Thank you! Evaluation was the key I was missing. Perfect. $\endgroup$ Feb 9 '18 at 14:42

Your Answer

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

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