8. Harmonic oscillator

Using exponential function, the growth of the organism population can be described. But there is a big limitation to this model, which is that the number of individuals is constantly increasing. While unsupervised growth can be seen for some limited time at the start of the process, it must stop after a while. In this chapter, we look at another population curve model that describes this behavior. This so-called harmonic oscillator, however, has applications mainly in physics, which we'll get to in the next chapter.

Let's see another significant equation here: the harmonic oscillator equation. It's the second equation and the last equation that we imagine here. But the goal of naked algebra is to show that these two equations are enough to describe a large class of phenomena that we can describe in life. The exponential equation describes unbridled growth (or decline), as wild as life itself. Unfortunately, however, it is so out of control that it has no limit. As an antidote, the harmonic oscillator describes a bound development that is calm, rocking, harmonious. It can also be used to describe small displacements from stability.

That's roughly the nature of the two equations that you're going to see here. From their description, you can sense the potential breadth of their use. As far as describing transition phenomena, between stability and unfettered, or if we want more precision in the description, we would need different differential equations. There is certainly a lot of literature on this, but it is beyond the scope of this text.

Introducing the problem

Let's imagine that our population of organisms has gotten out of the primordial fluke and has evolved enough to resemble, say, today's rabbits. Let's say in some time it gets to some stable point, which is $n(t) = N$, where $N$ is some very large number of individuals.

For example, the reason for population stagnation may be that there is a finite amount of food in the environment, so that individuals survive just enough to feed off the environment. That leaves the population at a constant level, and we're not seeing a very interesting development. One day, however, there may be a small misfortune: some rabbits get poisoned, leaving room for new ones. As we expect, the vacancy will quickly begin to fill with newborn individuals, but let's try to describe this development mathematically using the methods we previously imagined.

Oscillation

First, let's think about how population development can be done qualitatively. In the beginning, rabbits are scarce, so they have an abundance of food. They eat more than enough of it, and it makes them reproduce. Nearly every couple will have offspring, so when the cubs are born, what happens all of a sudden is that the population becomes overfed. There won't be enough food for everyone, because rabbits are suddenly plentiful, so some of the rabbits die. At the same time, however, the survivors are not multiplying much, as they barely have enough food to feed themselves. We end up in a state where we have few rabbits and an abundance of food and the situation can repeat itself.

So the rabbit population will oscillate, or periodically move above and below the optimal number. For an idea of what such a plot might look like, we present an illustration chart.





Compiling a Differential Equation

On the graph above, we see that the $n(t)$ function oscillates around a certain large $N$. So it is practical not to describe the $n(t)$ function itself, but the $m(t)\equiv n(t)-N$ function, which expresses the deviation of the number of rabbits from the stable number. Now let's try to shore up our knowledge of the $m(t)$ oscillation with a mathematical basis: differential analysis.

$$\begin{align*} m'(t+\Delta t) \doteq m'(t) + \Delta t \cdot m''(t) \,. \end{align*}$$

The question is how to express $m(t)$. We know that the second derivative in general will depend on time, but it will also depend on the variation of individuals $m(t)$: if $m(t)=0$, then $n(t)=N$ and we are in a stable state with $m(t)=0$. When $m(t)>0$, fertility declines, and therefore $m(t)<0$. Opposite $m(t)<0$ means $m(t)>0$. Estimating general dependence would be difficult, but we can recall the assumption that rabbit numbers are little off balance. If so, we can estimate that $m(t)$ depends on $m(t)$ in the simplest way possible: linearly. In other words, it applies $$m''(t) = - k m(t)\,,$$

where $k$ is some constant of proportion and minus occurs here because when an individual's deviation is positive, it decreases.

Another argument for linearity may also be that it is often observed in real systems.

There is no greater systemic reason for assuming linear dependency than that it is in some sense a simple dependency. Intuitively, we can support the choice of linear dependency with the following argument: One assumption was that $m(t)$ was small. If instead of a linear dependency, for example, the dependency was $m^2(t)$, it would pay $m(t) \approx 0$, because a small number multiplied by a small number is an even smaller number (e.g. one thousandth times one thousandth is one millionth). That wouldn't be a very interesting development.

Harmonic oscillator equation

We'll try to guess the solution to this equation again, because the systematic solution of differential equations is beyond our capabilities. Try as a solution, for example, any polynomial, ${P(x)}$. Let the degree of this polynomial be $\mathrm{st}P(x)=n$. So let's try to put the solution into the equation: $$ P''(x) = -k P(x)\,.$$

However, we see that the degree of the left side is either $n-2$, or $0$, and the degree of the right side is $n$. So it only offers $P(x) $0, but that's not a very interesting solution. We see further that no other (final) polynomial can be the solution.

We can try the exponential function $E(x) = e^{ax}$, where $a$ is some parameter. First, we're going to assume two derivatives: $$\begin{align*} E'(x) &= \frac{\mathrm{d} e^{ax}}{\mathrm{d} ax} \frac{\mathrm{d} ax}{\mathrm{d} x} = e^{ax} a\,,\\ E''(x) &= a \frac{\mathrm{d} e^{ax}}{\mathrm{d} x} = a^2 e^{ax} \,. \end{align*}$$

We put a harmonic oscillator into the equation and we get: $$\begin{align*} E''(t) &= -kE(t)\\ a^2 e^{at} &= -k e^{at}\\ a^2 &= -k \,. \end{align*}$$

In fact, you can define the number $i$, for which it pays $i^2=-1$. Using it, we could make the exponential the solution to our equation. The problem is that $i$ does not belong to well-known real numbers, but to so-called complex numbers, which we will not represent here.

We see that our solution will only work if $a^2=-k$. But no real number meets that condition, so we hit a dead end again.

For the third time, let's try $\sin (and x)$, where $a$ is the parameter. The sine function, together with the cosine, was mentioned in the derivative appendix Living geometries, where we also derived their derivatives. Subsequently, we mentioned sine and cosine in the fourth chapter of Naked Algebra about coordinates. Recall the derivative: $$\begin{align*} (\sin(x))' = \cos (x) \,,\\ (\cos(x))' = -\sin (x) \,. \end{align*}$$

Next, using the compound function derivative rule, we have: $$\begin{align*} \frac{\mathrm{d}\sin(ax)}{\mathrm{d}x}&= \frac{\mathrm{d}\sin(ax)}{\mathrm{d} ax} \frac{\mathrm{d}ax}{\mathrm{d}x}= \cos(ax) a \,,\\ \frac{\mathrm{d}\cos(ax)}{\mathrm{d}x}&= \frac{\mathrm{d}\cos(ax)}{\mathrm{d} ax}\frac{\mathrm{d}ax}{\mathrm{d}x}= -\sin(ax) a \,. \end{align*}$$

We can substitute: $$\begin{align*} (\sin(at))'' &= -k \sin(at) \\ (a\cos(at))' &= -k \sin(at) \\ -a^2\sin(at) &= -k \sin(at) \\ a &= \sqrt{k} \,. \end{align*}$$

It is certainly possible to select such $a$ to $a=\sqrt{k}$, which is why we have found one possible solution!

Solution ambiguity

The $A$ factor allows us to make $m(t)=0$ a solution as well.

$$m(t) = A\sin (\sqrt{k}\, t + \varphi) \,.$$

To get only one solution, we have to add some additional initial conditions. For example, we can require that $m(0)=0$ and that $\mathrm{max} (m(t)) = 1$. Then we only get $m(t) = \sin(\sqrt{k}\, t)$.

In the general case, the differential equations require $n$-th order of $n$ of initial terms to give us a one-size-fits-all solution. The existence of these conditions of existence is related to the existence of integration constants: we can imagine that to get a solution, we have to integrate the $n$-times equation, and from that we get $n$ of integration constants. To figure out their value, we need $n$ of additional terms.

The existence of initial conditions may bring us extra work, but it is good that they exist. Thanks to them, we can use one differential equation to describe a variety of similar phenomena at once, just setting the initial conditions appropriately.

Model Entitlement

So we were able to create a model describing population fluctuations around a stable number. The question is, why didn't we come up with the same solution as exponential growth of primordial organisms? Indeed, if we took their population and removed a piece, they would return to a stable number after exponentially as they originally came there.

<< Previous chapter >> Next chapter