help needed with mathematical calculation
- To: mathgroup at smc.vnet.net
- Subject: [mg33336] help needed with mathematical calculation
- From: "Salman Durrani" <dsalman at itee.uq.edu.au>
- Date: Sat, 16 Mar 2002 01:40:15 -0500 (EST)
- Organization: The University of Queensland, Australia
- Sender: owner-wri-mathgroup at wolfram.com
Hi
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.
I know my formula is correct and i am implementing it correctly ( from
results for M=2,4,8,16 and 32)
However I need the result for M =64.
I would be grateful if anybody can point out how to get the correct plot for
M=64.
( plot for M=64 should follow the same trend as M =32)
The mathematica code is given below
Thanks
Salman
% ---------------------------------------
\!\(\(ansOUT = {};\)\[IndentingNewLine]
\(For[a = 0, a <= 20,
a += 1, \[IndentingNewLine]x = 10\^\(a\/10\); \[IndentingNewLine]M =
32; \[IndentingNewLine]K =
Log[2, M]; \[IndentingNewLine]p = \(M/2\)\/\(M - 1\)\ Sum[
Binomial[M - 1,
n]\ \((\(-1\))\)\^\(n + 1\)\/\(1 + n + n\ K\ x\)\ , {n, 1,
M - 1}]; \[IndentingNewLine]AppendTo[
ansOUT, {a, N[p]}];\[IndentingNewLine]];\)\[IndentingNewLine]
\(<< Graphics`Graphics`;\)\[IndentingNewLine]
\(one =
LinearLogListPlot[
ansOUT, \[IndentingNewLine]Axes -> False,
\[IndentingNewLine]Frame ->
True, \[IndentingNewLine]PlotJoined ->
True, \[IndentingNewLine]PlotRange ->
All, \[IndentingNewLine]PlotStyle -> {AbsoluteThickness[1.5],
RGBColor[1, 0, 0]}\[IndentingNewLine]];\)\)
% --------------------------------------------------