Message Boards Message Boards

0
|
1687 Views
|
4 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Avoiding computational underflow when using Plot3D

Posted 6 months ago

I get a surface when using Plot3d that is incomplete. The error message says that some numbers could not be handled because of underflow. How can I avoid underflow and get a complete surface? Thank you.

Bob Frenkel frenkelfamily@hotmail,com

Attachments:
POSTED BY: bob frenkel
4 Replies

Even simpler: just add the option "PlotPoints->101" to your original code.

POSTED BY: Gareth Russell

If you want a nicer plot, try scaling:

Plot3D[(1/(2*Pi))*(1/0.2)*(1/0.5)*(1/
    6)*(Exp[-(0.5/0.04)*(x + 2.0)^2]*Exp[-(0.5/0.25)*(y - 1.2)^2] + 
    Exp[-(0.5/0.04)*(x + 0.5)^2]*Exp[-(0.5/0.25)*(y - 1.5)^2] + 
    Exp[-(0.5/0.04)*(x - 1.4)^2]*Exp[-(0.5/0.25)*(y - 2.9)^2] + 
    Exp[-(0.5/0.04)*(x - 3.1)^2]*Exp[-(0.5/0.25)*(y - 3.1)^2] + 
    Exp[-(0.5/0.04)*(x - 4.3)^2]*Exp[-(0.5/0.25)*(y - 3.3)^2] + 
    Exp[-(0.5/0.04)*(x - 5.7)^2]*
     Exp[-(0.5/0.25)*(y - 4.2)^2]), {x, -4, 8}, {y, -4, 8},
 PlotRange -> {0, 0.5}, ScalingFunctions -> {10^4 # &, #/10^4 &}]
POSTED BY: Michael Rogers
Posted 6 months ago

Thanks Gianluca, I now have the solution.

POSTED BY: bob frenkel

The underflow would be a problem if you had to multiply it by an overflow. It doesn't seem to be your case.

POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract