I have an interpolating function called rs22 - a solution from NDSolve - which is defined from 0 to about 1 ms. rs22 is a function that reaches a non-zero equilibrium value. (only shown here up to 10ns)
I would like to perform a Fourier transform on this function. I have written down a line of code to do this but it doesn't work at the moment.
Needs["FourierSeries`"](*Yup I have this in my code, thanks for reminding ;)*)
Plot[NFourierTransform[rs22, t, dw,
Method -> {"GlobalAdaptive", Method -> "LevinRule",
"SymbolicProcessing" -> 0}], {dw, -1*^9, 1*^9}, PlotRange -> All,
GridLines -> Automatic]
By definition a Fourier transform integrates from -inf to +inf. Is my interpolating function the problem since it is only defined up to 1ms?
I have also tried using NIntegrate instead but the solution changes with the total integration time which is something I don't want. But then again it seems sensible given the form of the product of the interpolating function and the exponential term: Exp(..)*rs22
xmin = -5*^9; xmax = 5*^9;
dwvec = DeleteCases[Table[dw, {dw, xmin, xmax, (xmax - xmin)/80}]];
output = ParallelTable[
{Δω = dwvec[[j]]
, popint =
NIntegrate[
Exp[I Δω t] rs[2, 2], {t, 0, 1*^-3}
, Method -> {"GlobalAdaptive", Method -> "LevinRule",
"SymbolicProcessing" -> 0}]}
, {j, 1, Length[dwvec]}];
I am at loss as to how to perform this calculation.
NDSolve[]
code the option"ExtrapolationHandler" -> {0 &,"WarningMessage" -> False}
$\endgroup$Piecewise
, something like the Fourier transform ofPiecewise[{{r2ss, 0 < t < 10^-9}}, 0]
, or whatever domain instead of0 < t < 10^-9
is appropriate. (3) Also, at some point, code for generatingrs22
might be needed (it could be a fake one that generates the same kind of problem). $\endgroup$