You are on page 1of 32

numerical methods for

differential equations and


applications

Supervisor: Camile Fraga Delfino Kunz

November 6th, 2018


What do we have for today?

• Nonlinear difference equations and systems:


• Steady-state solution
• Stability analysis
Nonlinear Difference Equations

• Mathematical modelling is the art of finding equations


that describes (sufficiently) the process on the real world.
• In order to have good enough approximations, we use the
nonlinear equations.
• Many problems are not sufficiently well described with
only linear equations.
Nonlinear Difference Equations
• Nonlinear difference equations are described like

xn+1 = f (xn , xn−1 , . . .)

where f is a function with nonlinear terms on the


variables xi , i = n − 1, n − 2, . . . .
• Only a few nonlinear difference equations have analytic
solution.
• So instead of finding a general relation for xn at each time
n, the approach is study the steady-state and it’s stability.
• Another possibility is to simulate the solution behavior
computationally and see how it changes along time and
with different parameters.
Nonlinear Difference Equations

As we saw on the last class, for the equation

xn+1 = rxn (1 − xn )

different choices for the parameter r changes drastically the


solution’s behavior.
Consider the initial value equal x0 = 0.1 on every following
graph, and let us see what happens on N = 30 generations for
some values of r ...
Nonlinear Difference Equations

As we saw on the last class, for the equation

xn+1 = rxn (1 − xn )

different choices for the parameter r changes drastically the


solution’s behavior.
Consider the initial value equal x0 = 0.1 on every following
graph, and let us see what happens on N = 30 generations for
some values of r ...
Nonlinear Difference Equations
Nonlinear Difference Equations

Let us now try to answer the question:

Why does it happen?


Nonlinear Difference Equations

Steady State
• The concepts of homeostasis, equilibrium and steady
state relate to the absence of changes in a system.
• The steady-state solutions can be essential to understand
certain populations, for example, there are organisms that
function well in narrow ranges of temperatures, acidity, or
salinity.
• More complex organisms have developed internal
mechanisms for maintaining the body temperatures and
other factors on appropriate constant levels.
Nonlinear Difference Equations

Steady State
• In difference equations’ context, a steady state solution x̄
is defined to be the value that satisfies the relations:

xn+1 = xn = x̄

so that no changes occur from the generation n to n + 1.


• So the function that defines the difference equation
satisfies
x̄ = f (x̄)
Nonlinear Difference Equations
Stability
• We can
define two types of steady state
using the definition of stability.
• See the figure: we have
two steady states; one steady state
is stable, and the other unstable.
• In this curve, balls 1
and 3 are on a steady state: stable
and unstable, respectively. The ball
2 is approximation from a steady
state, it’s position is still changing.
Nonlinear Difference Equations

Stability
• The distinction of such states is relevant for biological
process.
• When a steady state is unstable great changes are about
to happen: a population may crash, or homeostasis may
be disrupted.
• Even if a exact mathematical solution is not easy to
calculate, the qualitative behavior about whether the
change is imminent is important.
Nonlinear Difference Equations
Stability
• Suppose that we have already determined the steady
state x̄ for some equation xn+1 = f (xn ).
• Now let us try to answer the question: given some value
close xn close to x̄, will xn tend toward or away from this
steady state x̄?
• Consider a small perturbation δn of the steady state x̄,
and we start with a solution

xn = x̄ + δn

and then we determine whether δn gets smaller or bigger.


Nonlinear Difference Equations
Stability
• We are going to use first order Taylor polynomial to
approximate the nonlinear difference equation by a linear
function.
• Once we have a linear difference equation, we can apply
the studied on the preview classes.
• Considering that x̄ = f (x̄) and xn = x̄ + δn , the
perturbation δn+1 satisfies:
δn+1 = xn+1 − x̄
= f (xn ) − x̄
= f (x̄ + δn) − x̄
Nonlinear Difference Equations
Stability
• The value of f now will be approximated exploiting the
fact that δn is a small quantity.
• Writing the Taylor series expansion for a suitable function
f,
 df 
f (x̄ + δn ) = f (x̄) + δn + O(δn2 )

dx x̄ | {z }
very small terms

the very small terms can be neglected, at least close to


the steady state.
Nonlinear Difference Equations
Stability
• Using the approximation, the perturbation δn+1 gets

δn+1 = f (x̄ + δn ) − x̄
= f (x̄) + f 0 (x̄)δn − x̄
= f 0 (x̄)δn
= a δn

where a = f 0 (x̄).
• So now we have a linear equation δn+1 = aδn for the
perturbation around the steady state. And we can apply
the linear theory to study it’s behavior.
Nonlinear Difference Equations

• For the steady state be an attractor, the perturbation


δn+1 should be a decreasing function and tend to zero as
n increases.
• It happens when |a| < 1, so we have the following
theorem.

Theorem: condition for stability


A steady state (also called fixed point) is stable if and only if
df
< 1

dx x̄
Nonlinear Difference Equations
Example
Consider the logistic equation xn+1 = rxn (1 − xn ). Observe
that for non negative values for xn we need to impose that
0 < xn < 1. That means that we are dealing with density
distribution of the population.
For determining the steady state we set

x̄ = r x̄(1 − x̄) =⇒ r x̄ 2 − x̄(r − 1) = 0

So that two steady-state are possible:

1
x̄1 = 0 and x̄2 = 1 −
r
Nonlinear Difference Equations

Example
• We know that f 0 (x) = r − 2rx.
• For x̄ = 0, we get f 0 (0) = r . So this steady state is stable
if and only if 0 < r < 1, because r is a positive constant.
But for practical purposes we are not so much interested
on this case, because leads to a trivial solution, that is,
the population gets extincted.
• For x̄ = 1 − 1/r we get f 0 (x̄) = −r + 2. For stability
condition we impose |2 − r | < 1 ⇐⇒ −1 < 2 − r < 1,
which leads to the condition 1 < r < 3 for stability.
Nonlinear Difference Equations
Example
• Making the analysis described on [2], we can have a
graphical analysis for the choice of the parameter r
related to the equation behavior.
• For having positive values for the population’s density we
must require that xn ∈ (0, 1), ∀n. If xn exceeds 1, the
subsequent iterations diverge towards −∞ (which means
the population gets extinct).
• The maximum value of the function f (x) is given by r /4
(at x = 1/2); therefore the equation possesses non-trivial
dynamics behavior only if r < 4.
• On the other hand, all trajectories are attracted to x̄ = 0
if r < 1.
Nonlinear Difference Equations
Example
• Making the analysis described on [2], we can have a
graphical analysis for the choice of the parameter r
related to the equation behavior.
• For having positive values for the population’s density we
must require that xn ∈ (0, 1), ∀n. If xn exceeds 1, the
subsequent iterations diverge towards −∞ (which means
the population gets extinct).
• The maximum value of the function f (x) is given by r /4
(at x = 1/2); therefore the equation possesses non-trivial
dynamics behavior only if r < 4.
• On the other hand, all trajectories are attracted to x̄ = 0
if r < 1.
Nonlinear Difference Equations

Figure 1: [2] The relationship between Xt and Xt+1 for


r1 = a = 2.707 and r2 = b = 3.414. The dashed line indicates the
slope on the steady state. The line Xt+1 = Xt has slope 45o . We
see that for a the slope is less steep than −45o , so it is a stable
steady state; for b the slope is steeper than −45o , so the it is
unstable.
Nonlinear Difference Equations

• So long the slope lies between −45o and 45o , that is,
|f 0 (x̄)| < 1, the steady state x̄ will be at least locally
stable, attracting all trajectories in it’s neighborhood.
• What happens next? What happens, for an example, for
r > 3 in the logistic equation?
• In [2] can be found the development of the theory. As
result we have that for r > 3, some stable steady state
can become unstable, and then two new steady states of
period 2 be born. The system alternates in a stable cycle
of period 2.
Nonlinear Difference Equations

Figure 2: [2] The bifurcation phenomenon, an infinite number of


orbits can occur with period 2n (n → ∞) (here r=a on the logistic
equation)
.
Nonlinear Difference Systems

Steady state
Consider the system of nonlinear equations

xn+1 = f (xn , yn )
yn+1 = g (xn , yn )

Steady state values x̄ and ȳ satisfies

x̄ = f (x̄, ȳ )
ȳ = g (x̄, ȳ )
Nonlinear Difference Systems
Doing a similar approach that we saw before we get the
following linear relation between the perturbation around the
steady state on step time n + 1 and n

δn+1 = Jδn

where δn = (δx n , δy n )T and J is the Jacobian matrix of the


system.
" #
∂f ∂f  
∂x ∂y a11 a12
J(x̄, ȳ ) = ∂g ∂g =
∂x ∂y
a21 a22
x̄,ȳ

For detailed calculation of this result see [1].


Nonlinear Difference Systems
Stability
• So we can use the linear theory for difference systems to
study the stability. Let us remember how to do it for
given steady state X̄ = (x̄, ȳ ).
• Find the eigenvalues through the roots λ1,2 of the
polynomial

det(J − λI ) = 0

• The result is a quadratic equation

λ2 − βλ + γ = 0
Nonlinear Difference Systems

Stability
• Where

β = a11 + a22 = tr (J)


γ = a11 a22 − a12 a21 = det(J)

• For stability we have to determine whether the


eigenvalues are of magnitude smaller than 1.
Nonlinear Difference Equations

Exercise 1 [1]
Consider the following nonlinear difference equation for
population growth:
k xn
xn+1 = b, k > 0
b + xn
a) Does this equation have an steady state?
b) If so, is that steady state stable?
Nonlinear Difference Equations
Exercise 2 [1]
In population dynamics a frequently encountered model for
fish populations is based on an empirical equation called
Ricker equation:

Nn+1 = αNn e −βNn

ln α
a) Show that this equation has a steady state N̄ = .
β
b) Show that the steady state is stable provided that
| 1 − ln α | < 1.
Nonlinear Difference Equations
Exercise 3 [1]
In May (1978), Host-parasitoid system in patchy
environments: a phenomenological model, J.Anim.Ecol., the
following system of equations appear:
a Pn −k
Hn+1 = F Hn 1 +
k
Hn+1
Pn+1 = Hn −
F
Determine the steady states and their stability for this system.
(The parameters F , a, k are positive).
References

1. Edelstein-Keshet, L. Mathematical models in biology.


SIAM, 2005.

2. May, R.M. Simple mathematical models with very


complicated dynamics. Nature 261 459-67, 1976.

You might also like