Group Abstract Group Abstract

Message Boards Message Boards

0
|
3.5K Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

How do I do a ListDensityPlot of several lists at the same time?

Posted 3 years ago

I want to do a discrete dispersion graph of a field E(k,t). Basically I have a function epa (E(x,t)) calculated at each xpa (several postions) at each time instant(tpa). Afterwards I calculate the discrete fourrier of xpa and tpa and epa.

Then I put them in the format data2={fxpa,ftpa,fepa} for each time iteration. This is a matrix where each cell has the format{fxpa,ftpa,fepa}. Then I do the ListDensityPlot and nothing happens.

Here is a snipet the code for 50 time iterations

four = Compile[{{xp, _Real, 2}, {tp, _Real, 2}, {ep, _Real, 
     2}, {np, _Integer}, {ns, _Integer}},
   Block[{data},
    data = Table[{0., 0., 0.}, {ti, ns}, {i, np}];
    Do[data[[ti]] = Transpose[{xp[[ti]], tp[[ti]], ep[[ti]]}], {ti, 
      ns}]; data]
   , CompilationTarget -> "C", RuntimeOptions -> "Speed"];

    ftpa = ParallelTable[0., {ti, nsteps}, {i, nparticles}];;
    Do[ftpa[[n]] += 2.*Pi*(n - 1)/dt, {n, nsteps}];

    fepa = Abs[Fourier[epa]];
    fxpa = Abs[Fourier[xpa]];
data2 = four[fxpa, ftpa, fepa, nparticles, 50];
ListDensityPlot[data2, PlotRange -> All]
POSTED BY: Diogo Carvalho
Posted 3 years ago

What are the values of nsteps, nparticles, epa, xpa? Have you looked at the values in data2? What do you mean by "and nothing happens"?

POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard