Manipulate[
Animate[
Show[
Plot[{
(Piecewise[{{Cos[t+10.(z+d)+π/2],z<-d},{Cos[t-10.(z+d)+π/2],z≥-d}}] + Piecewise[{{Cos[t+10.(z-d)+π/2],z<d},{Cos[t-10.(z-d)+π/2],z≥d}}]),
Piecewise[{{4.+Cos[t+10.(z+d)+π/2],z<-d},{4+Cos[t-10.(z+d)+π/2],z≥-d}}],
Piecewise[{{-4.+Cos[t+10.(z-d)+π/2],z<d},{-4+Cos[t-10.(z-d)+π/2],z≥d}}]
}
,{z,-3,3},PlotRange->{-5,5}],
Graphics[{
{
PointSize[0.02],
{Point[{d,-4+Cos[t+π/2]}],Point[{-d,4+Cos[t+π/2]}]}
}
}]
],
{t,0.,∞}]
,{{d,π/4.-π/40.},π/4.-π/20.,π/4.}]

Export do gif

d=π/4.+0.08;

grafy=Table[Show[
Plot[{
(Piecewise[{{Cos[t+10.(z+d)+π/2],z<-d},{Cos[t-10.(z+d)+π/2],z≥-d}}] + Piecewise[{{Cos[t+10.(z-d)+π/2],z<d},{Cos[t-10.(z-d)+π/2],z≥d}}]),
Piecewise[{{4.+Cos[t+10.(z+d)+π/2],z<-d},{4+Cos[t-10.(z+d)+π/2],z≥-d}}],
Piecewise[{{-4.+Cos[t+10.(z-d)+π/2],z<d},{-4+Cos[t-10.(z-d)+π/2],z≥d}}]
}
,{z,-3,3},PlotRange->{-5.1,5.1},AxesLabel->{"z","ψ"}],
Graphics[{
{
PointSize[0.02],
{Point[{d,-4+Cos[t+π/2]}],Point[{-d,4+Cos[t+π/2]}]}
}
}]
],{t,0,2π,π/10}];
d=.

Export["2.1.gif",grafy,"GIF","DisplayDurations"->0.1,"AnimationRepetitions"->∞]