# User:Johnsy/Advanced Modelling in Biology/Discrete Systems

### From OpenWetWare

## Contents |

## Discrete Systems

Discrete systems are systems with non-continuous outputs with the result for each time step being determined by the previous time step. The equivalent to differential equations (continuous systems) in discrete system are known as **difference equations** such as the one shown below. Since the difference equation tells us about the next time step, it is known as a **1st order difference equation**.

This is the discrete equivalent of the differential equation:

Discrete systems are found in nature, for example in biology where reproduction occurs at discrete time steps. Also, sampling at discrete time intervals of a continuous system gives us discreteness.

### How do we solve these difference equations?

1) By guessing (**ansatz** - German for "guess")

Let us assume that the solution is in the form

Then substituting into the difference equation, we get

And hence the solution to the difference equation is

2) **Z-transform** - the discrete equivalent to the Laplace transform, an organized way to find solutions

### What are the behaviors of the solution ?

There are 4 different regimes, depending on the value of *r*.

- If
*r*> 1, then x_{t}approaches infinity. - If 0 <
*r*< 1, then x_{t}approaches zero. - If -1 <
*r*< 0, then x_{t}approaches zero in an oscillatory manner. - If
*r*< -1, then x_{t}approaches infinity in an oscillatory manner.

Remember that if we have non-linear systems, it is difficult to obtain the global stability analysis of the problem, however, we can see from the above different behaviors that we can generalize it into stable and unstable behaviors as shown in the table below.

Stability Analysis

r States
| Stability |
---|---|

Stable | |

Unstable | |

Liapunov Stable |

What does **Liapunov stability** imply? The fixed point is neither stable (goes towards the fixed point) nor unstable (goes away from the fixed point), but the trajectory is bounded. This is similar to a limit cycle or a center in continuous differential equations.

### Higher Order Difference Equations

A second order difference equations would tell us about the state of the system two time steps away, for example:

How do we go about solving this system? We again solve by guessing for the correct solution. We have our initial guess again as *x*_{t} = *A**r*^{t}. Substituting into our original equation, we get:

The characteristic equation for this system is

Solving for *r*

Hence, our general solution will be the sum of all possible solutions, just like in second order differential equations

We can then solve for *A* and *B* with our initial conditions.

For the stability of the system, we know that for the system not to blow up to infinity, | *r*_{ + } | , | *r*_{ − } | < 1. For this condition to be met, the following condition must be satisfied (can be solve for by setting *r* = 1).

Furthermore, we can generalize this solution for an N-dimensional system:

We again make the guess that our solution is in the form *x*_{t} = *A**r*^{t}, substitute, and obtain our characteristic polynomial to be:

The roots of our polynomial give the values of *r* and they must all satisfy | *r* | < 1 for the entire system to be stable. With the root of the equation being: , our general solution becomes:

Solving these difference equations is non-trivial and computationally difficult. There are criteria (see Schur or Jury) to check to see if the parameters will lead to a stable conditions (which check to see if the roots are within the unit circle). We can only solve by hand to a maximum of 4 dimensions. With higher order dimensions, a computer becomes necessary to establish the roots of the equation.

### Fourier Analysis and Linear Discrete Time Analysis

We can first motivate this by an example. Let us consider a single sinusoid in the time domain.

Is it possible to write this function in terms of a difference equation? Consider the time steps t and t+1 for a sinusoidal function:

If we now add and we obtain:

Hence we can conclude that:

We can see that a sinusoid function in the time domain can be expressed in terms of a second order difference equation. In general, if we have a sum of N sinusoidal waves making up our function, we can write this as a difference equations with 2N terms. In mathematical terms, this can be expressed as:

Recall that the first equation above is just the **Fourier transform** of a function in time domain. Hence, for any function in the time domain, this can be written as either a series of sinusoids using Fourier transform or as a difference equation with two terms to each Fourier term. We can also see that the coefficients obtained from performing the Fourier transform are directly related to the coefficients of the difference equation that is generated.

The process of going from the time domain to the difference equation is known as **Linear Discrete Time Analysis**, since we can see that we obtain a linear difference equation from a sinusoidal function. This is analogous to getting a linear second order differential equation when we are considering the same sinusoid when we do continuous differentiation.

### Cobweb Analysis

### Logistic Map

Let us now consider the logistic map equation as an example of how linear stability analysis is preformed on difference equations/systems.

Where 0 < r < 4 are the boundaries set.

First, to find the fixed points, we set *x*_{t + 1} = *x*_{t} to obtain the two fixed points:

For linear stability analysis, we need that

Now evaluating at the fixed points

Hence, the stability of the fixed point is stable if 0 < *r* < 1 (recall that we are bounded between 0 < r < 4 for our system). The stability of the fixed point is stable for 1 < *r* < 3.

After *r* = 3, we see that the system is unstable and that there are no fixed points. In fact, we will oscillate between fixed points and observe what is known as **period doubling** in our system. How do we calculate these fixed points analytically? If we have a period 2 oscillation, that means that

And from our function, we know that

And by substitution

In general, to solve for *p* period solutions, we want that

And we can solve

Returning back to our period-2 oscillations, we substitute our logistic equation into the *x*_{t + 2} equation

We now set this equal to *x*_{t} and solve for the fixed points. As it can be seen that both our initial fixed points are fixed points of this system with two further fixed points being added. The two new fixed points are the points around which the system oscillates.

The bifurcations occur when the looking at the difference plot and seeing when you get more crossings on the graph. As the value of *r* is increased, the bifurcations occur more closely. After a certain value of *r*, you can get a point where there are no period solutions exist and this is the point where chaos emerges. Within the chaotic region, numerical analysis has yielded **windows of periodicity** such as period-3 oscillations, but quickly become chaotic again as *r* is changed.

With the analysis above, we can easily see that a fixed point is actually a period-1 solution to our system.