Re: Plot3D: plot does not display when PlotPoints different from 25. Mathematica 5.2
- To: mathgroup at smc.vnet.net
- Subject: [mg65824] Re: [mg65730] Plot3D: plot does not display when PlotPoints different from 25. Mathematica 5.2
- From: bsyehuda at gmail.com
- Date: Mon, 17 Apr 2006 02:29:21 -0400 (EDT)
- References: <200604160749.DAA11119@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
I would recommend on changing the way you define the function u[x_,y_].
Which[] is a better way of expressing this function.
As for the graphical problem, you are trying to compare to an exact number
(0 in your case) while Plot3D has a sampling algorithm which for PlotPoints
different from 25 skips this value since it uses approximate values (Machine
precision numbers). Therefore, only 0 is returned (the default value of your function).
A better way is defining something such as
If[Abs[x]<= some small number
rather than
If[x==0
regards
yehuda
On 4/16/06, nma at 12000.org <nma at 12000.org> wrote:
>
> [This post has been delayed due to email problems - moderator]
>
>
> Remove["Global`*"]
>
> u[x_, y_] := Module[{},
> If[x == 0, Return[1 + y]];
> If[y == 0, Return[1]];
> Return[0];
> ]
>
> Plot3D[u[x, y], {x, -1, 2}, {y, -1, 2},
> FaceGrids -> None,
> AxesLabel -> {"U(x,y)", "x", "y"},
> PlotLabel -> "Boundary conditions",
> PlotPoints -> 25]
>
> works OK. But if you change 25 to say 26 in the last line above, the
> plot does not show up any more !
>
> Can someone explain why this is?
>
> thanks,
> Nasser Abbasi
>
>
- References:
- Plot3D: plot does not display when PlotPoints different from 25. Mathematica 5.2
- From: nma@12000.org
- Plot3D: plot does not display when PlotPoints different from 25. Mathematica 5.2