# Does this curve tend to a square wave?

I have put some Mathematica code here: http://pastebin.com/cY6r7skS

that uses this algorithm:

$$y1 = Sin[x];$$ $$y2 = Sin[y1];$$ $$y3 = Sin[y1 + y2];$$ $$y4 = Sin[y1 + y2 + y3];$$ $$y5 = Sin[y1 + y2 + y3 + y4];$$ $$y6 = Sin[y1 + y2 + y3 + y4 + y5];$$ $$y7 = Sin[y1 + y2 + y3 + y4 + y5 + y6];$$ $$y8 = Sin[y1 + y2 + y3 + y4 + y5 + y6 + y7];$$ $$y9 = Sin[y1 + y2 + y3 + y4 + y5 + y6 + y7 + y8];$$ $$y10 = Sin[y1 + y2 + y3 + y4 + y5 + y6 + y7 + y8 + y9];$$ $$y11 = Sin[y1 + y2 + y3 + y4 + y5 + y6 + y7 + y8 + y9 + y10];$$ $$y12 = Sin[y1 + y2 + y3 + y4 + y5 + y6 + y7 + y8 + y9 + y10 + y11];$$ $$y = y1 + y2 + y3 + y4 + y5 + y6 + y7 + y8 + y9 + y10 + y11 + y12;$$

where $y$ is the purple curve in this image:

The blue curves are $y1$, $y2$, $y3$, $y4$, $y5$, $y6$... and so on.

Does the purple curve $y$ tend to a square wave?

This question builds upon the answer to this previous question.

Edit: The partial sums:

$$y1$$ $$y1 + y2$$ $$y1 + y2 + y3$$ $$y1 + y2 + y3 + y4$$ $$y1 + y2 + y3 + y4 + y5$$ $$y1 + y2 + y3 + y4 + y5 + y6$$ ... and so on, look like this when plotted:

For more images see: link to question on dsp stackexchange

-
It looks as if it converged pointwise to zero... – Eckhard Jan 12 '13 at 12:58
What does that mean? Pointwise to zero, what is pointwise? – Mats Granvik Jan 12 '13 at 13:02
My comment was referring to the behaviour of $y_n$. The partial sums do indeed seem to converge to a square wave. – Eckhard Jan 12 '13 at 13:42

$$z_{n+1}=z_n + \sin(z_n)$$
It's readily seen that the fixed points are $z = k \, \pi$, and that these are attractors only for odd $k$. Further, convergence is guaranteed in each interval (eg, if $z_0\in (0,2\pi)$ then $z_{\infty}=\pi$).
Then, the original sequence $x=\sin(z)$ converges pointwise to zero.
As for its partial sums: the same analysis shows that they are confined to the interval $[0,1]$ in the domain intervals $[0,2 \pi]$, $[4\pi,6 \pi]$,$[8\pi,10 \pi]$ ... , and $[-1,0]$ elsewhere. That's just what gives the dim visual ilussion of a "square wave", if one superposes all partial sums. But it does not converge to a square wave, and each partial sum does not resembles a square wave at all.
What do you mean by your comment about the partial sums? Aren't the partial sums just the $z_n$, which as you mentioned do converge towards the square wave? – Johan Feb 19 '13 at 15:47