Introduction to Computer Simulation Continuous Simulation - - PowerPoint PPT Presentation

introduction to computer simulation continuous simulation
SMART_READER_LITE
LIVE PREVIEW

Introduction to Computer Simulation Continuous Simulation - - PowerPoint PPT Presentation

Introduction to Computer Simulation Continuous Simulation Equilibrium, Stability, Attractors Jonathan Thaler Department of Computer Science 1 / 32 Continuous Simulation Predator-Prey Model 2 / 32 Predator-Prey Model Lotka Volterra The


slide-1
SLIDE 1

Introduction to Computer Simulation Continuous Simulation Equilibrium, Stability, Attractors

Jonathan Thaler

Department of Computer Science

1 / 32

slide-2
SLIDE 2

Continuous Simulation Predator-Prey Model

2 / 32

slide-3
SLIDE 3

Predator-Prey Model

Lotka Volterra The Lotka Volterra model describes predator-prey (or herbivore-plant, or parasitoid-host) dynamics in their simplest case: one predator population and

  • ne prey population.

It is characterized by oscillations in the population size of both predator and prey, with the peak of the predator’s oscillation lagging slightly behind the peak

  • f the prey’s oscillation.

3 / 32

slide-4
SLIDE 4

Predator-Prey Model

The model makes several simplifying assumptions: The prey population has unlimited resources and prey only die when eaten up by the predator. Prey is the only source of food for the predator and predators only die because of starvation. Predators can consume infinite quantities of prey. There is no environmental complexity, that is, both populations are moving randomly through a homogeneous environment.

4 / 32

slide-5
SLIDE 5

Predator-Prey Model

The Lotka-Volterra Model is a system

  • f coupled differential equations:

du dt = a · u − α · u · v dv dt = −c · v + γ · u · v

u: stock of prey v: stock of predators a: birth rate of prey γ: birth rate of predators c: death rate of predators α: death rate of prey due to being eaten

5 / 32

slide-6
SLIDE 6

Continuous Simulation What can we say about dynamics of such systems?

6 / 32

slide-7
SLIDE 7

Continuous Simulation

Equilibrium A dynamic system is in equilibrium, if the change rates of a time-dependent variable are and stay 0 from time tg onwards. 0 = dx1

dt = f1(t, x1, x2, ..., xn)

0 = dx2

dt = f2(t, x1, x2, ..., xn)

... 0 = dxn

dt = fn(t, x1, x2, ..., xn)

In this case the system does not change anymore: x1, .., xn stay constant.

7 / 32

slide-8
SLIDE 8

Continuous Simulation

To calculate the equilibrium state of a continuous system, set the differential equations 0 and solve them after the system variable xi. Example 1: Free fall with friction 0 = dv

dt (t) = g − γ m · v(t)

v(t) = m·g

γ (e− γ

m t − 1) = m·g

γ

g = 9.8 m

sec2 , m = 10kg,

γ = 2 kg

sec

v = m·g

γ

= 10·9.8

2

= 49 m

sec

This is the ”limit” of the velocity, in case t → ∞ v(t) = 49 · (e−0.2t − 1)

t→∞

− − − → vfinal = −49 m

sec = −176.4km/h

8 / 32

slide-9
SLIDE 9

Continuous Simulation

Example 2: Lotka-Volterra 0 = du

dt = a · u − α · u · v

0 = dv

dt = −c · v + γ · u · v

Trivial Solution: u = 0 and v = 0 Non-Trivial solution: u = c

γ and

v = a

α

9 / 32

slide-10
SLIDE 10

Continuous Simulation

Figure: Prey u(0) = 50, Predators v(0) = 30 Figure: Prey u(0) = 100, Predators v(0) = 62.5

Lotka-Volterra Non-Equilibrium vs. Equilibrium a = 0.5 α = 0.008 c = 0.8 γ = 0.008 Equilibrium Prey: u = c

γ = 0.8 0.008 = 100

Equilibrium Predators: v = a

α = 0.5 0.008 = 62.5

10 / 32

slide-11
SLIDE 11

Continuous Simulation

The existence of an equilibrium says nothing about ...

  • a. ... whether it can be reached from all initial states.
  • b. ... whether it can be reached from other states (Attractors).
  • c. ... when equilibrium is going to be reached (given it can be reached).

Example a: Lotka-Volterra Equilibrium can be reached by the initial state u(0) = c

γ

and v(0) = a

α but is not an Attractor!

Example c: Free fall with friction: limit velocity is reached after infinite time (aysmptotic convergence).

11 / 32

slide-12
SLIDE 12

Continuous Simulation Properties of Dynamical Systems

Equilibrium (Gleichgewicht) Steady State (Station¨ arer Zustand) Stability Attractor

12 / 32

slide-13
SLIDE 13

Continuous Simulation

Equilibrium All system variables are constant over time, that is all change rates (depending

  • n time) are 0.

13 / 32

slide-14
SLIDE 14

Continuous Simulation

Steady State A system is in a steady state if all system variables are either

  • a. Periodically oscillating
  • b. Constant
  • c. Have a constant random distribution.

A system is also considered to be in a steady state if it has moved away from the initial, non-stationary state.

14 / 32

slide-15
SLIDE 15

Continuous Simulation

Example a: Periodically Oscillating Steady State Standard Lotka-Volterra Model

15 / 32

slide-16
SLIDE 16

Continuous Simulation

Example a: Periodically Oscillating Steady State Some systems arrive at the same stationary state from many intial states: Lotka-Volterra Model with Niche and Marker (Lotka-Volterra Exercise Part 2)

Figure: Prey u(0) = 50, Predators v(0) = 30 Figure: Prey u(0) = 100, Predators v(0) = 100

16 / 32

slide-17
SLIDE 17

Continuous Simulation

Example b: Constant Steady State Bass Diffusion with Demand Cycle (Phase 4)

17 / 32

slide-18
SLIDE 18

Continuous Simulation

Example b: Constant Steady State Lotka-Volterra Model with Niche (Lotka-Volterra Excersise Part 1)

18 / 32

slide-19
SLIDE 19

Continuous Simulation

Example c: Constant random distribution (in Discrete Simulation)

19 / 32

slide-20
SLIDE 20

Continuous Simulation

Stability & Attractor A system in a steady state is stable if it returns to the steady state given small disturbances and interferences. A stable constant or oscillating steady state is also known as Attractor. A system is stable if it reaches the steady state from all states.

20 / 32

slide-21
SLIDE 21

Continuous Simulation

Stability with an Attractor

Figure: Injecting 30 Prey at t=30

When creating a disturbance in the system, the system will show a stable system reaction. Disturbance in Lotka-Volterra Model with Niche and Marker: injecting 30 Prey into the system.

21 / 32

slide-22
SLIDE 22

Continuous Simulation

Stability, no Attractor Standard Lotka-Volterra When injecting 30 new Prey at t = 10 we see a stable system reaction. When injecting at different time, we would see different system reaction.

22 / 32

slide-23
SLIDE 23

Continuous Simulation

Stability, no Attractor Standard Lotka-Volterra

Figure: Injecting 30 Prey at t = 5 Figure: Injecting 30 Prey at t = 7

23 / 32

slide-24
SLIDE 24

Continuous Simulation

We are dealing with two types of stability:

  • 1. Stable system with attractors: system is approaching the original steady state.
  • 2. Stable system without attractors: system transitions through a disturbance into a

new stationary / stable state. A stable system with attractors is conservative. A stable system without attrac- tors is extremely adaptable. What do you think is the better option?

24 / 32

slide-25
SLIDE 25

Continuous Simulation

Instability Equilibirum states can be unstable. Dynamic Systems as a whole can be unstable. Lotka-Volterra Model with Niche but without Marker (Lotka-Volterra Exercise Part 2)

25 / 32

slide-26
SLIDE 26

Continuous Simulation Checking properties of Dynamical Systems

26 / 32

slide-27
SLIDE 27

Continuous Simulation

  • 1. Empirically / Simulation

Steady State, Equilibrium through visual analysis time- and phase plots. Attractor, stability: parameter variation, programming a steady state detector Stability: create disturbances using events.

  • 2. Mathematically

The system dynamic can be characterised with the eigenvalues of the Jacobi Matrix. Depending on the nature of the eigenvalues (real, imaginary) it is possible to decide whether the system has a stationary state, is unstable, is oscillating, oscil- lating with dampening,...

27 / 32

slide-28
SLIDE 28

Continuous Simulation

Jacobi Matrix The Jacobi Matrix of a differentiable function Rn → Rm contains all first-order partial derivatives and has dimension m x n. It is used for approximating or minimising multidimensional functions.

dx1 dt = f1(t, x1, x2, ..., xn) dx2 dt = f2(t, x1, x2, ..., xn)

...

dxn dt = fn(t, x1, x2, ..., xn)

B =       

∂f1 ∂x1 ∂f1 ∂x2

...

∂f1 ∂xn ∂f2 ∂x1 ∂f2 ∂x2

...

∂f2 ∂xn

... ... ... ...

∂fn ∂x1 ∂fn ∂x2

...

∂fn ∂xn

      

28 / 32

slide-29
SLIDE 29

Continuous Simulation

  • 1. Calculate Jacobi Matrix for Lotka-Volterra System

f1(u, v) = du

dt = a · u − α · u · v

f2(u, v) = dv

dt = −c · v + γ · u · v

B =  

∂f1 ∂u = a − α · v ∂f1 ∂v = −α · v ∂f2 ∂u = γ · v ∂f2 ∂v = −c + γ · u

 

  • 2. Compute Equilibrium State of Lotka-Volterra System

v∞ = a

α and u∞ = c γ

  • 3. Subsitute v∞ and u∞ into Jacobi Matrix

B(u∞, v∞) =   − α·c

γ γ·a α

 

29 / 32

slide-30
SLIDE 30

Continuous Simulation

  • 4. Compute Eigenvalues of the Jacobi Matrix

B(u∞, v∞) =   − α·c

γ γ·a α

  · x1 x2

  • =

λ · x1 x2

  • − α·c

γ · x2 = λ · x1 γ·a α · x1 = λ · x2

λ2 = −a · c λ1,2 = ±√−a · c

30 / 32

slide-31
SLIDE 31

Continuous Simulation

Solution with stationary state (Attractor) Real with λ1 < 0 and λ2 < 0 Unstable Solution Real with λ1 > 0 or λ2 > 0. Stationary Oscillation Complex solution with Re(λ1 = 0, λ2 = 0) (Lotka-Volterra).

31 / 32

slide-32
SLIDE 32

Continuous Simulation

Unstable Oscillation Complex solution with Re(λ1 > 0, λ2 > 0) Dampening Oscillation (Attractor) Complex solution with Re(λ1 < 0, λ2 < 0)

32 / 32