Re: Problem with the range of a plot
- To: mathgroup at smc.vnet.net
- Subject: [mg94687] Re: [mg94669] Problem with the range of a plot
- From: "David Park" <djmpark at comcast.net>
- Date: Sat, 20 Dec 2008 06:21:45 -0500 (EST)
- References: <32633742.1229690471916.JavaMail.root@m02>
Christian, This one is a little tricky. The problem is that the Gamma function becomes imaginary when the second argument becomes negative. Mathematica just omits plotting points where the function is imaginary. But Mathematica does not know enough to be careful around the transition point. One method is to limit the plot domain to the domain where Gamma is real. We can also use PlotPoints and MaxRecursion to obtain better resolution. F[v_] = 0.0652 8.04*^23 10*^-9 Exp[ 0.0000385/(1*^-3 (12.7*^-6/60 - v) 3*^-9/(1.38*^-23 300))] Gamma[0, 0.00003847/((1*^-3 (12.7*^-6/60 - v) 3*^-9)/(1.38*^-23 300))] 1.38*^-23 300/(2 3*^-9 \ 12.07)*20*^-6 5*^-6 Plot[F[v], {v, 0, 2.1166667*^-7}, PlotRange -> {Full, {0, .5*^-7}}, PlotPoints -> 25, MaxRecursion -> 3] David Park djmpark at comcast.net http://home.comcast.net/~djmpark/ From: Christian Schreiber [mailto:cs359 at removethis.cam.ac.uk] Hi there, I got the following problem with Mathematica: When executing the following commands, the plot of the curve does not go all the way down to the x-axis. Any ideas? Best wishes, Christian ############# F[v_] = 0.0652 8.04*^23 10*^-9 Exp[ 0.0000385/(1*^-3 (12.7*^-6/60 - v ) 3*^-9/(1.38*^-23 300))] Gamma[ 0, 0.00003847/((1*^-3 (12.7*^-6/60 - v) 3*^-9)/(1.38*^-23 300))] 1.38*^-23 300/(2 3*^-9 \ 12.07)*20*^-6 5*^-6 Plot[F[v], {v, 0, 10*^-7}, PlotRange -> {0, 5*^-8}]