# Manipulating matrices obtained by NDSolve

For example, Matrix U is obtained by

U[w1_, w2_, w3_]:= NDSolveValue[
{u'[t] == - I H[w1, w2, w3, t] . u[t], u[0] == IdentityMatrix[3]},
u,
{t, 0, 2 Pi}
]


where

H[w1_, w2_, w3_, t_] := {
{0, Cos[w1 t], Cos[w3 t]},
{Cos[w1 t], 0, Cos[w2 t]},
{Cos[w3 t], Cos[w2 t], 0}
}


then a function defined of U[w1,w2,w3][t] would be like:

f[w1_, w2_, w3_, t_] := Tr[U[w1, w2, w3][t] .
{{0, 1/3, 1/3}, {1/3, 0, 1/3}, {1/3, 1/3, 0}} .
ConjugateTranspose[U[w1, w2, w3][t]]]


When I want to do NFourierTransform[f[1, 2, 3, t], t, \[Omega]]

the outcome is just

which is not what I am expecting

• What have you tried, and what problems did you encounter? Dec 18 '21 at 15:28
• An actual use case that does not work for you would be helpful. For instance f[1, 2, 3, 4] seems to work fine for me. A better way to define U (iimho) is U = ParametricNDSolveValue[{u'[t] == -I H[w1, w2, w3, t] . u[t], u[0] == IdentityMatrix[3]}, u, {t, 0, 2 Pi}, {w1, w2, w3}]. ParametricNDSolve was built to handle such things and has certain efficiencies built in. Dec 18 '21 at 15:54
• Question have been edited. I want to do something of f[w1,w2,w3,t] rather than just get the outcome of f[w1,w2,w3,t]. Dec 19 '21 at 1:57
• (1) NFourierTransform[func, t, w] does not evaluate unless w is numeric. (2) The Fourier transform is an integral over the whole real line, but your function ff is not defined over the whole real line. Did you intend the Fourier series? Dec 19 '21 at 2:39
• @Micheal E2 Getting the Fourier series is also great. It is an effective way to do that? Dec 19 '21 at 6:38