When I use NDsolve to solve a differential equations, it returns an interpolation function of the discrete result. Because I haven't found another way to do Fourier analysis with an interpolation function, it seems I have to do the Fourier transform with Fourier. In my opinion, the process
$\qquad$ discrete result$\rightarrow$ iterpolation function$\rightarrow$ discrete result
will cause severe loss or distortion of the information. So I want to find a way to directly get the discrete result of a differential equations.
My differential equations is like this:
H = {{1, 0, 0, 0}, {0, 2, 0, 0}, {0, 0, 3, 0}, {0, 0, 0, 4}};
Rho[t_] := Array[Subscript[rho, #1] &, {4}]
t0 = Table[j/10, {j, 1, 10}];
tf[t_] = t + 0.5;
solutionvec =
Table[s =
NDSolve[LogicalExpand[
D[Rho[t], t] == H.Rho[t] && Rho[t0[[j + 1]]] == {1, 0, 0, 0}],
Flatten[Table[Subscript[rho, i], {i, 1, 4}]], {t, t0[[j + 1]],
tf[t0[[j + 1]]]}, MaxStepSize -> 1/100, MaxSteps -> Infinity,
PrecisionGoal -> Infinity, WorkingPrecision -> 30];
{Evaluate[Rho[tf[t0[[j + 1]]]] /. s]}, {j, 0, 9}]
This equations doesn't work, but it can show the thing I'm deal with.
Please help me.



NDSolvedoesn't usually use constant step size for solving ODE, whileFourierassumes uniform sampling, so I don't think directly extracting discrete fromNDSolveis suitable for solving your problem. – xzczd Jul 09 '17 at 11:39NDSolveor it will make me suffer! – Bettertomo Jul 10 '17 at 01:14ResourceFunction["IrregularPeriodogram"]in Wolfram function repository. – xzczd Sep 10 '20 at 06:29