Hello
In the flowing code, I plot the function X by using the result of the NDSolve.
The result I get have frequency noise " see the figure "
what I went to do is taking the time-averaged for X , it should be nearly zero but how I can do that in Mathematica ?
Clear[t]
z = 0;
r = 0.7071;
s = 4.2758;
y = 2.2758;
system = {u'[t] == 2.2758*v[t],
v'[t] == - 2.2758*u[t] - 2*s*E^(-(r^2) - ((t^2*(1.177^2))/(13.8)^2))*Cos[k*z - y*t]*w[t],
w'[t] == 2*s*E^(-(r^2) - (t^2*(1.177^2))/(13.8)^2)*Cos[k*z - y*t]*v[t]};
initialvalues = {u[-20] == 0, v[-20] == 0, w[-20] == -1};
sol = NDSolve[Join[system, initialvalues], {u[t], v[t], w[t]}, {t, -20, 20}];
X = (- 2*s*u[t]*r)*E^(-(r^2) - (t^2*(1.177^2))/(13.8)^2)*Cos[k*z - y*t];
P1 = Plot[Evaluate[X /. sol], {t, -20, 20}, Frame -> True, FrameLabel -> {"t", "X"}, FrameTicks -> All]


