I am running Mathematica 11.
There is a wonderful 27 year old book called Exploring Mathematics with Mathematica link to amazon, which does a lot of interesting mathematical stuff with version 2 of Mathematica.
One of the things it demonstrates is that as you nest Sin
more and more deeply you get a nearly square wave. For example, here's what happens if you nest to a level of 1000
It is then claimed that if you use Do
to make a sequence of plots you will get an animation of the changes from the sine wave to the nearly square wave. However, when I copy the book's code to do this absolutely nothing happens. I don't even get a sequence of plots, let alone an animation.
So something must have changed between version 2 and version 11 so that Do
no longer can be used to make animations. Moreover, apparently Mathematica does not guarantee backward compatibility.
Can someone explain why Do
no longer works the way it apparently did?
MapAt[ListAnimate, #, {2, 1}] &@Reap@Do[ Sow@Plot[Nest[Sin, x, n], {x, -2 Pi, 2 Pi}, PlotRange -> {-1, 1}, PlotLabel -> n], {n, 1, 50}]
$\endgroup$Do
toListAnimate@Table
or changeDo
toAnimate
and change{n,1,50}
to{n,1,50,1}
. $\endgroup$