MathGroup Archive 2002

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

Search the Archive

Re: help needed with mathematical calculation

  • To: mathgroup at smc.vnet.net
  • Subject: [mg33357] Re: [mg33336] help needed with mathematical calculation
  • From: BobHanlon at aol.com
  • Date: Sun, 17 Mar 2002 05:33:09 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

In a message dated 3/16/02 3:46:55 AM, dsalman at itee.uq.edu.au writes:

>The formula I have to program is
>
>P = ((M/2)/(M-1))* sum (k=1) to (M-1)
>[ binomial(M-1,k) *( ((-1)^(k+1)) /(1+k+k*K*X) )]
>
>where M =64
>
>K=log2(M)
>
>XdB = 0:5:30  ( dB values)
>
>X = 10^(XdB/10)
>
>I need the semilog plot of XdB and P.
>
>I plotted the formula in Mathematica.
>
>For M = 2,4,8,16 and 32, I get smooth curves, which are correct.
>
>When i go for M=64, there is some error or overflow that causes incorrect
>curve to be displayed.
>

Needs["Graphics`Graphics`"];

P[Xdb_?NumericQ, M_?NumericQ] :=
 
    Module[
      {X=10^(Xdb/10), K=Log[2,M]},
      ((M/2)/(M-1))*Sum[Binomial[M-1, k]*
            (((-1)^(k+1))/(1+k*(1+K*X))),
 
          {k,M-1}]];

Use higher precision

DisplayTogether[
    LinearLogPlot[Evaluate[Table[
          P[Xdb, 2^m], {m,5}]], {Xdb, 0, 20},
      PlotStyle->Table[
          {AbsoluteDashing[{5,6}],
            Hue[(m-1)/8]},{m,5}]],
    LinearLogListPlot[Table[
        {Xdb, N[P[Xdb, 64],50]},
 
        {Xdb, 0, 20,1/2}],
 
      PlotJoined->True,
      PlotStyle->Hue[0]]];

There is very little difference between M=32 and M=64

Bob Hanlon
Chantilly, VA  USA


  • Prev by Date: ridiculous results with DSolve
  • Next by Date: Re: problem with plot
  • Previous by thread: Re: help needed with mathematical calculation
  • Next by thread: RE: help needed with mathematical calculation