Re: How to set y always greater than or equal to x for a function?
- To: mathgroup at smc.vnet.net
- Subject: [mg46599] Re: How to set y always greater than or equal to x for a function?
- From: "David W. Cantrell" <DWCantrell at sigmaxi.org>
- Date: Wed, 25 Feb 2004 13:06:55 -0500 (EST)
- References: <c1ehpp$kgg$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Albert Franco <francoatnsuok at earthlink.net> wrote: > I recently purchased Mathematica 5.0, and I am in the process of > learning how to take advantage of it's many features. > > This is an example of one line I would like to calculate in Mathematica: > > Plot3D[Sqrt[y-x],{x,-100,100},{y,-100,100}]; > > How can I best edit this line to make y always greater than or equal to x > during calculation so the program doesn't try to take the square root of > a negative number? I've seen several responses so far, and am not really happy with any of them. Before making my suggestion, let me say that I'm not happy with it either! Nonetheless, it does have some virtues: It is not terribly complicated. It does not show the function to be 0, when in fact it isn't even real. No error messages are generated. The boundary at z = 0 is appears less jagged. I suggest Plot3D[Sign[y - x] Sqrt[Abs[y - x]], {x, -100, 100}, {y, -100, 100}, PlotRange -> {0, Automatic}, PlotPoints -> 75, Mesh -> False, ClipFill -> None] Regards, David Cantrell