MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: How to get plot Exclusions for a numerical function?

You might find the following code to be useful:

(* This defines a numerical function with a discontinuity *)
f[x_?NumericQ, y_?NumericQ, z_?NumericQ] := If[x^2 + y^3 - 2 x y + 0.1
> x z, 0, 1];

(* Using NIntegrate to get the sampling points of a global adaptive
The sampling points will be clustered around the discontinuity.  *)
Clear[c, x, y, z]
c = 2;
rng = Rescale[Range[1, 2], {-c, c}];
pnts = Reap[
      f[x, y, z], {x, -c, c}, {y, -c, c}, {z, -c, c} // Evaluate,
      MinRecursion -> 3, MaxRecursion -> 4, PrecisionGoal -> 4,
      EvaluationMonitor :>
       Sow[{x, y, z},
        Method -> {GlobalAdaptive, SingularityHandler -> None,
          Method -> {TrapezoidalRule, Points -> 5},
          SymbolicProcessing -> 0}]]][[2, 1]]; // AbsoluteTiming

(* Plot the points using small point size. Rotate the plot... *)
Graphics3D[{PointSize[0.00051], Point[pnts]}]

On Aug 13, 3:20 am, asdf qwerty <bradc355... at> wrote:
> I have a complex analytic function that I'm computing numerically, and
> it has branch cuts along arbitrary curves that I can't know
> beforehand. Does anyone have any ideas on how I can get Exclusions-
> like functionality from Plot3D for this case?
> With the allowed form "Exclusions -> {{lhs = rhs, ineqs}, ...}", I
> can't think of an easy way to do it numerically... maybe something
> like "Exclusions -> {{True, <something clever>}}"? Has anyone tackled
> this problem before?

  • Prev by Date: Re: Bug: ListPlot and Tooltip
  • Next by Date: ListLogLinearPlot with two y-axis
  • Previous by thread: How to get plot Exclusions for a numerical function?
  • Next by thread: Re: How to get plot Exclusions for a numerical function?