introduction to computer simulation continuous simulation
play

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


  1. Introduction to Computer Simulation Continuous Simulation Equilibrium, Stability, Attractors Jonathan Thaler Department of Computer Science 1 / 32

  2. Continuous Simulation Predator-Prey Model 2 / 32

  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 one 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 of the prey’s oscillation. 3 / 32

  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

  5. Predator-Prey Model The Lotka-Volterra Model is a system of coupled differential equations : d u d t = a · u − α · u · v d v d t = − 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

  6. Continuous Simulation What can we say about dynamics of such systems? 6 / 32

  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 t g onwards. 0 = d x 1 d t = f 1 ( t, x 1 , x 2 , ..., x n ) 0 = d x 2 d t = f 2 ( t, x 1 , x 2 , ..., x n ) ... 0 = d x n d t = f n ( t, x 1 , x 2 , ..., x n ) In this case the system does not change anymore: x 1 , .., x n stay constant. 7 / 32

  8. Continuous Simulation To calculate the equilibrium state of a continuous system, set the differential equations 0 and solve them after the system variable x i . Example 1 : Free fall with friction m t − 1) = m · g v ( t ) = m · g γ ( e − γ 0 = d v d t ( t ) = g − γ m · v ( t ) γ g = 9 . 8 m sec 2 , m = 10 kg , v = m · g = 10 · 9 . 8 = 49 m γ = 2 kg γ 2 sec sec t →∞ v ( t ) = 49 · ( e − 0 . 2 t − 1) This is the ”limit” of the − − − → velocity, in case t → ∞ v final = − 49 m sec = − 176 . 4 km/h 8 / 32

  9. Continuous Simulation Example 2 : Lotka-Volterra 0 = d u Trivial Solution: u = 0 and v = 0 d t = a · u − α · u · v Non-Trivial solution: u = c γ and 0 = d v d t = − c · v + γ · u · v v = a α 9 / 32

  10. Continuous Simulation Lotka-Volterra Non-Equilibrium vs. Equilibrium a = 0 . 5 α = 0 . 008 Figure: Prey u (0) = 50 , Predators v (0) = 30 c = 0 . 8 γ = 0 . 008 Equilibrium Prey: u = c 0 . 8 γ = 0 . 008 = 100 Equilibrium Predators: v = a 0 . 5 α = 0 . 008 = 62 . 5 Figure: Prey u (0) = 100 , Predators v (0) = 62 . 5 10 / 32

  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

  12. Continuous Simulation Properties of Dynamical Systems Equilibrium (Gleichgewicht) Steady State (Station¨ arer Zustand) Stability Attractor 12 / 32

  13. Continuous Simulation Equilibrium All system variables are constant over time , that is all change rates (depending on time) are 0. 13 / 32

  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

  15. Continuous Simulation Example a: Periodically Oscillating Steady State Standard Lotka-Volterra Model 15 / 32

  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

  17. Continuous Simulation Example b: Constant Steady State Bass Diffusion with Demand Cycle (Phase 4) 17 / 32

  18. Continuous Simulation Example b: Constant Steady State Lotka-Volterra Model with Niche (Lotka-Volterra Excersise Part 1) 18 / 32

  19. Continuous Simulation Example c: Constant random distribution (in Discrete Simulation) 19 / 32

  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

  21. Continuous Simulation Stability with an Attractor 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. Figure: Injecting 30 Prey at t=30 21 / 32

  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

  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

  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

  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

  26. Continuous Simulation Checking properties of Dynamical Systems 26 / 32

  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

  28. Continuous Simulation Jacobi Matrix The Jacobi Matrix of a differentiable function R n → R m contains all first-order partial derivatives and has dimension m x n . It is used for approximating or minimising multidimensional functions. d x 1  ∂f 1 ∂f 1 ∂f 1  d t = f 1 ( t, x 1 , x 2 , ..., x n ) ... ∂x 1 ∂x 2 ∂x n ∂f 2 ∂f 2 ∂f 2 d x 2   d t = f 2 ( t, x 1 , x 2 , ..., x n ) ...   ∂x 1 ∂x 2 ∂x n B =     ... ... ... ... ...     ∂f n ∂f n ∂f n d x n ... d t = f n ( t, x 1 , x 2 , ..., x n ) ∂x 1 ∂x 2 ∂x n 28 / 32

  29. Continuous Simulation 1. Calculate Jacobi Matrix for Lotka-Volterra System   ∂f 1 ∂f 1 f 1 ( u, v ) = d u ∂u = a − α · v ∂v = − α · v d t = a · u − α · u · v B =  ∂f 2 ∂f 2  ∂u = γ · v ∂v = − c + γ · u f 2 ( u, v ) = d v d t = − c · v + γ · u · v 2. Compute Equilibrium State of Lotka-Volterra System v ∞ = a α and u ∞ = c γ 3. Subsitute v ∞ and u ∞ into Jacobi Matrix   − α · c 0 γ B ( u ∞ , v ∞ ) = γ · a   0 α 29 / 32

  30. Continuous Simulation 4. Compute Eigenvalues of the Jacobi Matrix   − α · c 0 � x 1 � γ  · B ( u ∞ , v ∞ ) = = γ · a  0 x 2 α � x 1 � λ · x 2 − α · c γ · x 2 = λ · x 1 γ · a α · x 1 = λ · x 2 λ 2 = − a · c λ 1 , 2 = ±√− a · c 30 / 32

  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

  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

Recommend


More recommend