I would like to produce a region plot where some function is less than 1. This runs for hours without finishing (until I lose patience and abort it). However, I can plot the function (using Plot3D
), which finishes in a few minutes. I have tried putting in N's, etc., to force it to evaluate numerically to no avail.
In some more detail: the function is naively a function of three variables, $x$, $y$, $z$, but I use a constraint to (numerically) solve for $z$ in terms of $x$ and $y$. This reduces it to a function of two variables, which should be amenable to RegionPlot
. I at first thought something was going wrong with the numerical solution for $z$ in terms of $x$ and $y$, but Plot3D
is able to evaluate the function on the same $(x,y)$ region just fine.
"Minimal" working example:
Δ[z_, x_, a_] := (z^2*x/2)*(1 - a/(z*x))^2;
v = (220*10^3)/(3*10^8);
σ[z_, x_] := (4*Pi*z^2)/x^2*(2^10*Pi*z/v)/(3*Exp[4]);
Γ[z_, x_, y_] := σ[z, x]/y^2*8.440512301344581`*^25* .9*
Sqrt[1 - (2*10^-3)^2/(Δ[z, x, 2*10^-3] + x*v^2/2)^2];
zCons[x_, y_] := z /. NSolve[Γ[z, x, y] == 1.2000000000000002`*^19, z, Reals][[1]];
β[z_, x_, y_] := 10^-10/z^4* (y *x);
Plot3D[β[zCons[x, y], x, y], {x, 5, 45}, {y, 150, 350}]
RegionPlot[β[zCons[x, y], x, y] < 1, {x, 5, 45}, {y, 150, 350}]
My apologies that this is still rather complicated, but it's based on the actual function I'm trying to plot. On my computer, it takes about 3 minutes for the Plot3D
command to run, but RegionPlot
goes on for at least 3 hours. In that time, it only gives the Solve::ratnz
error, which is fine; I don't mind it using numerical techniques.
The output from Plot3D
is:
which does not show any pathological problems.
Thank you very much for you time and help.