# TFPIE2012: Recursion Schemes of Scientific Models

## The Recursion Schemes of Scientific Models

By: Baltasar Trancón y Widemann

### Visual Demonstrations

The following diagrams can be produced from the Literate Haskell code (provided some not quite hassle-free Haskell packages are installed, sorry).

• Direct Modelling with Trajectories.
Trajectories of the logistic map with different initial states and parameter values are plotted for 100 steps, showing six classes of behaviour. From top-left to bottom-right:
1. Stable limit points that attract the initial state, either one-sided ([itex]r<2[/itex]) or with overshooting ([itex]r>2[/itex]). These correspond to the initial branch of the logistic map's bifurcation diagram.
2. Stable periodic solution of period length 2 that attracts the initial state; corresponds to the first bifurcation at [itex]r=3[/itex].
3. Stable periodic solution of period length 2 that attracts the initial state; more difficult to find in the bifurcation diagram in a small window of orderly behaviour among chaos.
4. Stable periodic solution of period length 4 that attracts the initial state; corresponds to the second bifurcation at [itex]r \approx 3.45[/itex].
5. Chaotic behaviour at [itex]r = 4[/itex], ranging over the whole domain. Illustrates one of the defining properties of chaos: orbits (points connected by a trajectory) are dense.
6. Chaotic behaviour at [itex]r = 4[/itex], starting from a tiny neighbourhood of an unstable limit point. Illustrates another defining property of chaos: near trajectories diverge exponentially.
The initial state is 0.35 in all cases except the last, where it is 0.7500000000001.
• Direct Modelling with Intervals.
The same six situations as above, but now with an interval of potential initial states. Note that periodic solutions are either self-focussing or self-dispersing, for one-sided and overshooting convergence, respectively. Note also how quickly the state becomes completely indeterminate when chaos emerges. The initial intervals are [0.3, 0.4] in all cases except the last, where it is [0.75, 0.7500000000001].
• Direct Modelling with Distributions.
Trajectories of continuous state distribution are plotted for 5 steps as differently coloured cdf graphs. Colours range over the rainbow, in order of increasing wavelength. The initial distribution is uniform on the whole domain in all cases except the last, where it is uniform on the middle third only. The distributions appear to converge in all cases. For [itex]r = 4[/itex] (bottom row), the limiting distribution has been studied thoroughly: it is the Beta(1/2, 1/2) distribution. Note that the initial distribution hardly matters in this case; it converges quickly and almost surely.
• Inverse Modelling with Observations.
Successively narrowed intervals are plotted. They are obtained by iterating the inference step for the observation the next state is in the upper half 20 times, starting with a completely indeterminate state. Four types of behaviour appear, from top-left to bottom-right:
1. The inference fails after one step, because there is no such state.
2. The inference stagnates, because the observation is not unique.
3. The inference converges slowly.
4. The inference converges quickly.
• Inverse Modelling with Input.
Backwards trajectories for the logistic map with [itex]r=4[/itex] are plotted for 100 steps. In the forward mode, the map is completely chaotic for this parameter value, i.e., periodic of all lengths exist, but are unstable. In the backwards mode, these solutions become stable such that most initial states are attracted to them. By the simple expedient of driving the reverse map with a periodic stream of binary input of the desired period length, convergence towards a solution of that period length is effected. Running forwards from a state obtained by this procedure, the appearance of a periodic trajectory is produced. Of course, it will break down eventually because of chaos, but the longer the backwards search procedure, the longer the appearance can be maintained. Simple cases of length 1 and 3 are shown, as well as for 5 and 17. Those are virtually impossible to construct in the forward mode.