Group Abstract Group Abstract

Message Boards Message Boards

0
|
3.5K Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

Plot an expression which computation underflows

Posted 6 years ago

Hello everyone, I only started using Mathematica yesterday. I want to plot 4 functions on the same graph. My problem that the expressions given are too small to compute. Each time I enter the code, it says:

General::munfl: Exp[-1799.88] is too small to represent as a normalized machine number; precision may be lost.

My (not so great) code is:

Plot[{(1/(2 I*Sqrt[2*Pi]))*(Exp[-((w - 1)^2)*(1^2)/2] - Exp[-((w + 1)^2)*(1^2)/2]), (5/(2 I*Sqrt[2*Pi]))*(Exp[-((w - 1)^2)*(5^2)/2] - Exp[-((w + 1)^2)*(5^2)/2]}, {w, -5, 5}]

I saw on help we can define: By using an arbitrary-precision number, a small nonzero result is found:

Exp[N[800, $MachinePrecision]]

How do I change it for expressions?

Thank you for your help.

  1. I don't get those underflows
  2. There is a paren missing from your post.
  3. the expression as typed is complex so it will not plot, Consider ComplexPlot on a single expression if that is what you meant. (or using Abs, Arg , Im, Re, etc. to make your plot expressions real.)
  4. SetPrecision will change the precision of an expression but I do not think you need it here.
  5. Try quitting the Kernel and trying again to see if the underflow goes away. Maybe something is defined that should not be.

I hope this helps

Regards,

Neil

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