MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Plot works in Mathematca 7 but not in Mathematica 8

  • To: mathgroup at smc.vnet.net
  • Subject: [mg115871] Re: Plot works in Mathematca 7 but not in Mathematica 8
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Sun, 23 Jan 2011 05:37:26 -0500 (EST)

Works if you pull the function out of the Plot.

$Version

"8.0 for Mac OS X x86 (64-bit) (November 6, 2010)"

f[ki_?NumericQ, h_, kn_?NumericQ, kr_?NumericQ] := 
 Abs[((kn^2 - (kr + ki I)^2)*(4 h (Log[4 h/a] - 
          NIntegrate[(1 - Exp[I (kr + ki I) y Cos[kn y]])/y, {y, 0, 2}]) + 
       I/((kr + ki I) + kn) (Exp[I 2 ((kr + ki I) + kn) h] - 1) + 
       I/((kr + ki I) - kn) (Exp[I 2 ((kr + ki I) - kn) h] - 
          1)) - (kn^2 + (kr + ki I)^2)*
     NIntegrate[Exp[I (kr + ki I) y] Sin[kn y]/y, {y, 0, 2}])]

h = 1; kn = Pi/h; kr = 3.050;

Plot[f[ki, h, kn, kr], {ki, -0.23, -.10}]


Bob Hanlon

---- "1.156" <rob at piovere.com> wrote: 

=============
I've found very little to complain about using Mathematica 8 but I just ran into a 
Plot which only displays the two plot axes, no graph. Fortunately I 
still have Mathematica 7 installed and found that Mathematica 7 Plots this same code nicely. 
Can anyone give me clues on what may make this work correctly in Mathematica 8? 
Code below, thanks.

***************
h = 1; a = 0.0001; kn = Pi/h; kr = 3.050;
Plot[Abs[((kn^2 - (kr + ki I)^2)*
      (4 h (Log[4 h/a] -
      NIntegrate[(1 - Exp[I (kr + ki I) y Cos[kn y]])/y, {y, 0, 2}]) +
        I/((kr + ki I) + kn) (Exp[I 2 ((kr + ki I) + kn) h] - 1) +
        I/((kr + ki I) - kn) (Exp[I 2 ((kr + ki I) - kn) h] - 1) ) -
     (kn^2 + (kr + ki I)^2)*
      NIntegrate[
       Exp[I (kr + ki I) y] Sin[kn y]/y, {y, 0, 2}])], {ki, -0.23, -.10}]
-- 




  • Prev by Date: Re: complex output for real integral
  • Next by Date: Re: cells touched in grid on move between cells
  • Previous by thread: Re: Plot works in Mathematca 7 but not in Mathematica 8
  • Next by thread: Re: Plot works in Mathematca 7 but not in Mathematica 8