# 1. Introduction.

dynamical system is a phenomenon that changes with tim, for instance the position of a pendulum, the weather, the amount of predators and prey in a lake, et cetera. The traditional way of describing a dynamical system is to use a linear system of differential equations. In this case we have a pretty simple theory to solve the problem (see for instace part 8).

A more realistic model however often leads to nonlinear systems of differential equations. In this case it is much more complicated to describe the behavios in the long run, but with help of computers and existing theories we can sometimes obtain the solution as an attractor to the system. In many other cases we will instead get bifurcations or chaos. Chaos means that it is hard (or impossible) to determine the long term behavior; small changes in indata gives dramatic changes in the long term behavior. Some attractors can be described as fractals, some particular self similar sets (a small part of the set has the same structure as the whole set). Such attractors are sometimes called strange attractors.

Remark: This fascinating and important part of mathematics is still under rapid development and we can expect many more fundamental discoveries in the future from this research.

Remark: Two important concepts that we will study are stability and bifurcations.

Example: A simple example of attractor that can be illustrated with a pocket calculator is Kaprekar’s constant. Pick a four-digit number p1 where not all four digits are the same. Order the digits in descending order, call this number p1. In the same way we construct the number p1, but now with ascending digits. Now construct the number p2=p1‘-p1. Repeat the procedure. Whatever number we are starting with, we will allways end up with 6174 and then stay there. The number 6174 is an attractor. We illustrate the procedure below:

p1=2873 gives p1‘=8732 and p1”=2378. Then p2=p1‘-p1=6354. We proceed according to
p2‘=6543, p2‘=3456, p3=p2‘-p2=3087.
p3‘=8730, p3‘=0378, p4=p3‘-p3=8352.
p4‘=8532, p4‘=2358, p5=p4‘-p4=6174.
p5‘=7641, p5‘=1467, p6=p5‘-p5=6174.

We realize that we are stuck with 6174. It can be proved that at most seven iterations are needed irrespective of starting number. On this page, the routine is described for numbers with more or fewer digits than four.