Mathematica Strange plotting behaviour- Mathematica 8

AI Thread Summary
Mathematica's behavior when plotting interpolated functions can lead to confusion, especially when dealing with functions that approach zero. In this case, the user is experiencing unexpected results in LogLogPlot, where the functions appear to decay to one instead of showing the anticipated behavior of 1/x^n for large x. The issue may stem from Mathematica interpreting the logarithm incorrectly, potentially plotting Log(f(x)) instead of Log[f(x)]. This misinterpretation is likely due to numerical stability concerns, as the functions are very small (around 10^(-10)) in the plotted range. To resolve this, adjusting the plotting range to ensure that f(x) remains positive could help clarify the output and allow for proper interpretation of the logarithmic scale.
muppet
Messages
602
Reaction score
1
I'm confused by Mathematica's behaviour when plotting some functions I've constructed by interpolating functions. I have three graphs (attached). The first is a plot of the family of functions; they're negative, and decreasing to zero. I tried to do a LogLogPlot to look at their behaviour as they decay, and it looks as if the functions decay to one, as if I was actually plotting Log(f(x)) for small f.

I was looking to see if these functions behaved like 1/x^n for large x, and when comparing one function to x^(-4) it doesn't look as if I'm getting the straight line I expect on a LogLogPlot.

Can someone please explain why? I should point out that my functions are on the order of 10^(-10) over the region I'm plotting.

Thanks in advance.
 

Attachments

  • Screenshot from 2012-09-13 19:30:07.png
    Screenshot from 2012-09-13 19:30:07.png
    21.1 KB · Views: 520
  • loglogplot2.png
    loglogplot2.png
    5.8 KB · Views: 507
Physics news on Phys.org
It is possible that Mathematica is plotting Log(f(x)) instead of Log[f(x)]. This could be due to the fact that f(x) is very close to 0 for the range you are plotting. Mathematica may be interpreting your input as Log(f(x)) instead of Log[f(x)] because it is more numerically stable. If this is the case, then you will need to adjust your plotting range so that f(x) is greater than 0. This should reduce the numerical instability and allow Mathematica to interpret your input correctly.
 

Similar threads

Back
Top