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]