User:Johnsy/Advanced Modelling in Biology/Discrete Systems: Difference between revisions

From OpenWetWare
Jump to navigationJump to search
Line 61: Line 61:
:<math>x_{t+2} = ax_{t+1} + bx_t </math>
:<math>x_{t+2} = ax_{t+1} + bx_t </math>


How do we go about solving this system?  First, we let <math>y_t = x_{t+1}</math>.  Then we again solve by guessing for the correct solution.  We have our initial guess again as <math>x_t = Ar^t</math>.
How do we go about solving this system?  We again solve by guessing for the correct solution.  We have our initial guess again as <math>x_t = Ar^t</math>. Substituting into our original equation, we get:


:<math>Ar^{t+2} = aAr^{t+1} + bAr^t</math>
:<math>Ar^{t+2} = aAr^{t+1} + bAr^t</math>
Line 79: Line 79:
We can then solve for ''A'' and ''B'' with our initial conditions.
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, <math>|r_+|, |r_-| < 1</math>.
For the stability of the system, we know that for the system not to blow up to infinity, <math>|r_+|, |r_-| < 1</math>. For this condition to be met, the following condition must be satisfied (can be solve for by setting ''r'' = 1).
 
:<math>b < 1 - a </math>
 
Furthermore, we can generalize this solution for an N-dimensional system:
 
:<math>a_0 x_{t+N} + a_1 x_{t+N-1} + \dots + a_N = 0</math>
 
We again make the guess that our solution is in the form <math>x_t = Ar^t </math>, substitute, and obtain our characteristic polynomial to be:
 
:<math>\alpha_0 r^N + \alpha_1 r^{N-1} + \dots + \alpha_N = 0</math>
 
The roots of our polynomial give the values of ''r'' and they must all satisfy <math>|r| < 1</math> for the entire system to be stable.  With the root of the equation being:  <math>\{r_1^*, \dots, r_N^*\}</math>, our general solution becomes:
 
:<math>x_t = \sum_{i = 1}^N A_i(r_i^*)^t</math>

Revision as of 04:54, 20 May 2008

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.

[math]\displaystyle{ x_{t+1} = rx_t }[/math]

This is the discrete equivalent of the differential equation:

[math]\displaystyle{ \frac{dx}{dt} = rx }[/math]

How do we solve these difference equations?

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

Let us assume that the solution is in the form

[math]\displaystyle{ x_t = A \beta ^t }[/math]

Then substituting into the difference equation, we get

[math]\displaystyle{ A \beta ^{t+1} = rA \beta ^t }[/math]
[math]\displaystyle{ r = \beta }[/math]

And hence the solution to the difference equation is

[math]\displaystyle{ x_t = x_0 r^t }[/math]

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

What are the behaviors of the solution [math]\displaystyle{ x_t = x_0 r^t }[/math]?

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

If r > 1, then xt approaches infinity.
If 0 < r < 1, then xt approaches zero.
If -1 < r < 0, then xt approaches zero in an oscillatory manner.
If r < -1, then xt 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
[math]\displaystyle{ |r| \lt 1 }[/math] Stable
[math]\displaystyle{ |r| \gt 1 }[/math] Unstable
[math]\displaystyle{ |r| = 1 }[/math] Liapunov Stable

Higher Order Difference Equations

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

[math]\displaystyle{ x_{t+2} = ax_{t+1} + bx_t }[/math]

How do we go about solving this system? We again solve by guessing for the correct solution. We have our initial guess again as [math]\displaystyle{ x_t = Ar^t }[/math]. Substituting into our original equation, we get:

[math]\displaystyle{ Ar^{t+2} = aAr^{t+1} + bAr^t }[/math]

The characteristic equation for this system is

[math]\displaystyle{ r^2 - ar - b = 0 }[/math]

Solving for r

[math]\displaystyle{ r_{\pm} = \frac{a \pm \sqrt{a^2+4b}}{2} }[/math]

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

[math]\displaystyle{ x_t = Ar_{+}^t + Br_{-}^t }[/math]

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, [math]\displaystyle{ |r_+|, |r_-| \lt 1 }[/math]. For this condition to be met, the following condition must be satisfied (can be solve for by setting r = 1).

[math]\displaystyle{ b \lt 1 - a }[/math]

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

[math]\displaystyle{ a_0 x_{t+N} + a_1 x_{t+N-1} + \dots + a_N = 0 }[/math]

We again make the guess that our solution is in the form [math]\displaystyle{ x_t = Ar^t }[/math], substitute, and obtain our characteristic polynomial to be:

[math]\displaystyle{ \alpha_0 r^N + \alpha_1 r^{N-1} + \dots + \alpha_N = 0 }[/math]

The roots of our polynomial give the values of r and they must all satisfy [math]\displaystyle{ |r| \lt 1 }[/math] for the entire system to be stable. With the root of the equation being: [math]\displaystyle{ \{r_1^*, \dots, r_N^*\} }[/math], our general solution becomes:

[math]\displaystyle{ x_t = \sum_{i = 1}^N A_i(r_i^*)^t }[/math]