I numerically solved a wave equation and want to fourier transform the solution uwave1(t,x,z) at a particular instant of time t and position z. The code is as follows:
\[CapitalOmega] = Region[Rectangle[{-20, -20}, {20, 20}]];
\[Rho][x_] := (\[Rho]0 - \[Rho]max) (Sech[x])^2 + \[Rho]max;
\[Rho]0 = 10;
\[Rho]max = 1;
CA[x_] := 1/(B0/Sqrt[\[Rho][0] \[Mu]0])*B0/Sqrt[\[Rho][x] \[Mu]0];
uwave1 = NDSolveValue[{1/(CA[x])^2 D[u[t, x, z], {t, 2}] -
D[u[t, x, z], {x, 2}] - D[u[t, x, z], {z, 2}] == 0,
u[0, x, z] == x*Exp[-(x)^2], Derivative[1, 0, 0][u][0, x, z] == 0,
DirichletCondition[u[t, x, z] == 0, True]},
u, {t, 0, 4 \[Pi]}, {x, z} \[Element] \[CapitalOmega], Method -> {
"PDEDiscretization" -> {"MethodOfLines",
"SpatialDiscretization" -> {"FiniteElement",
"MeshOptions" -> {"MaxCellMeasure" -> 0.2},
"InterpolationOrder" -> {u -> 2}}}}]
and this gives us a solution uwave1(t,x,z), which i hope to fourier transform and plot like this:
Plot[NFourierTransform[uwave1[0, x, 1], x, k], {k, -20, 20},
PlotRange -> All]
but this code gives an empty graph, what went wrong?
ReIm
$\endgroup$NFourierTransform
is the proper tool here. Check outPeriodogram
,Fourier
etc. $\endgroup$