Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » sci.math.* » sci.math

Topic: plotting an equation with double summations
Replies: 1   Last Post: Apr 3, 2013 5:55 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Herman

Posts: 37
Registered: 11/2/11
plotting an equation with double summations
Posted: Mar 26, 2013 12:45 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Remove[q, qC, IIC]

ass = {d > 1, num > 0, \[CapitalDelta] > 0, t > 0, n >= 0};

q[\[Nu]_, num_, \[CapitalDelta]_, t_] :=
1/num (1 +
2 Exp[-\[Nu]] NSum[
Sin[(\[Pi] d)/num]/((\[Pi] d)/num) Exp[-d \[CapitalDelta]^2]
Cos[(\[Pi] d)/num (2 t + 1)] \[Nu]^(n + d/2)/Sqrt[
n! (n + d)!], {d, 1, 10}, {n, 0, 10}])

AbsoluteTiming[Table[q[2, 4, 0.2, t], {t, 0, 200, 20}]]

Plot[{q[1.0, 4.0, 0.2, t], q[3.0, 4.0, 0.2, t],
q[6.0, 4.0, 0.2, t]}, {t, 2, 6}]

IIC[\[Nu]_, num_, \[CapitalDelta]_] :=
Log[2, num] -
Sum[(q[\[Nu], num, \[CapitalDelta], t]) Log[2,
q[\[Nu], num, \[CapitalDelta], t]], {t, 0, num - 1}];

AbsoluteTiming[Table[IIC[\[Nu], 4, 0.2], {\[Nu], 1, 200, 20}]]

ListPlot[Table[{\[Nu], IIC[\[Nu], 100, 0.2]}, {\[Nu], 1, 100}],
PlotRange -> All, AxesOrigin -> {0, 0}]

-5 down vote favorite
1


Thank you so much for the helpful comments. Now able to manage to plot all the functions.



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.