Introduction to multiscale modeling and simulation. Explicit methods for ODEs : forward Euler. y n+1 = y n + tf(y n ) dy dt = f(y), y(0) = y 0

Similar documents
1. Introduction Systems evolving on widely separated time-scales represent a challenge for numerical simulations. A generic example is

Gillespie s Algorithm and its Approximations. Des Higham Department of Mathematics and Statistics University of Strathclyde

A review of stability and dynamical behaviors of differential equations:

Lecture 12: Detailed balance and Eigenfunction methods

Finite difference methods for the diffusion equation

Lecture 12: Detailed balance and Eigenfunction methods

Introduction to asymptotic techniques for stochastic systems with multiple time-scales

Introduction to multiscale modeling and simulation. Almost every system is multiscale.

Lecture No 1 Introduction to Diffusion equations The heat equat

Last time: Diffusion - Numerical scheme (FD) Heat equation is dissipative, so why not try Forward Euler:

PROBABILITY: LIMIT THEOREMS II, SPRING HOMEWORK PROBLEMS

Homework 4 will be posted tonight, due Wednesday, May 8.

Lecture 1: Pragmatic Introduction to Stochastic Differential Equations

u n 2 4 u n 36 u n 1, n 1.

Numerical Analysis of Differential Equations Numerical Solution of Parabolic Equations

Controlled Diffusions and Hamilton-Jacobi Bellman Equations

Week 9 Generators, duality, change of measure

The first order quasi-linear PDEs

Numerical Methods for ODEs. Lectures for PSU Summer Programs Xiantao Li

Lecture Notes to Accompany. Scientific Computing An Introductory Survey. by Michael T. Heath. Chapter 9

Lecture 5: Single Step Methods

Logistic Map, Euler & Runge-Kutta Method and Lotka-Volterra Equations

Local vs. Nonlocal Diffusions A Tale of Two Laplacians

Scientific Computing: An Introductory Survey

Mathematical Methods for Neurosciences. ENS - Master MVA Paris 6 - Master Maths-Bio ( )

Finite Differences for Differential Equations 28 PART II. Finite Difference Methods for Differential Equations

p 1 ( Y p dp) 1/p ( X p dp) 1 1 p

CS 450 Numerical Analysis. Chapter 9: Initial Value Problems for Ordinary Differential Equations

Xt i Xs i N(0, σ 2 (t s)) and they are independent. This implies that the density function of X t X s is a product of normal density functions:

Diffusion of a density in a static fluid

Katholieke Universiteit Leuven Department of Computer Science

PROBABILITY: LIMIT THEOREMS II, SPRING HOMEWORK PROBLEMS

SPDEs, criticality, and renormalisation

Qualitative behaviour of numerical methods for SDEs and application to homogenization

Nonlinear stability of time-periodic viscous shocks. Margaret Beck Brown University

Stochastic Gradient Descent in Continuous Time

2tdt 1 y = t2 + C y = which implies C = 1 and the solution is y = 1

Chapter 10 Exercises

Stochastic differential equation models in biology Susanne Ditlevsen

Lecture 4: Numerical solution of ordinary differential equations

Weak Convergence of Numerical Methods for Dynamical Systems and Optimal Control, and a relation with Large Deviations for Stochastic Equations

Chapter 3 Second Order Linear Equations

Adaptive timestepping for SDEs with non-globally Lipschitz drift

Differential Equations

Numerical Integration of SDEs: A Short Tutorial

Path integrals for classical Markov processes

Differential equations, comprehensive exam topics and sample questions

Process Modelling. Table of Contents

The integrating factor method (Sect. 1.1)

The second-order 1D wave equation

Additional Homework Problems

B8.3 Mathematical Models for Financial Derivatives. Hilary Term Solution Sheet 2

Numerical Solutions to Partial Differential Equations

x R d, λ R, f smooth enough. Goal: compute ( follow ) equilibrium solutions as λ varies, i.e. compute solutions (x, λ) to 0 = f(x, λ).

MATH 220 solution to homework 5

Lecture 1. Finite difference and finite element methods. Partial differential equations (PDEs) Solving the heat equation numerically

CHAPTER 5: Linear Multistep Methods

Numerical explorations of a forward-backward diffusion equation

Random attractors and the preservation of synchronization in the presence of noise

Introduction LECTURE 1

Introduction to Partial Differential Equation - I. Quick overview

Chapter 18. Remarks on partial differential equations

MATH3203 Lecture 1 Mathematical Modelling and ODEs

Consistency and Convergence

Chapter 3. Finite Difference Methods for Hyperbolic Equations Introduction Linear convection 1-D wave equation

4 Stability analysis of finite-difference methods for ODEs

x n+1 = x n f(x n) f (x n ), n 0.

Interest Rate Models:

Boundary conditions. Diffusion 2: Boundary conditions, long time behavior

Problem set 7 Math 207A, Fall 2011 Solutions

BENG 221 Mathematical Methods in Bioengineering. Fall 2017 Midterm

Modelling Interactions Between Weather and Climate

TMS165/MSA350 Stochastic Calculus, Lecture on Applications

Lecture 10: Singular Perturbations and Averaging 1

DUBLIN CITY UNIVERSITY

MATH 131P: PRACTICE FINAL SOLUTIONS DECEMBER 12, 2012

Stochastic differential equations in neuroscience

Computing on Virtual Slow Manifolds of Fast Stochastic Systems.

Models and Simulation

Ordinary Differential Equation Theory

Ordinary Differential Equations: Initial Value problems (IVP)

Lecture 4: Numerical Solution of SDEs, Itô Taylor Series, Gaussian Process Approximations

10.34: Numerical Methods Applied to Chemical Engineering. Lecture 19: Differential Algebraic Equations

9 More on the 1D Heat Equation

Chapter Two: Numerical Methods for Elliptic PDEs. 1 Finite Difference Methods for Elliptic PDEs

DYNAMICAL SYSTEMS

Numerical methods in molecular dynamics and multiscale problems

Applied Mathematics Masters Examination Fall 2016, August 18, 1 4 pm.

Practice Problems For Test 3

Finite Difference and Finite Element Methods

LECTURE 19: SEPARATION OF VARIABLES, HEAT CONDUCTION IN A ROD

Uncertainty quantification and systemic risk

APPLICATIONS OF FD APPROXIMATIONS FOR SOLVING ORDINARY DIFFERENTIAL EQUATIONS

Fast-slow systems with chaotic noise

Stochastic Mode Reduction in Large Deterministic Systems

A Lévy-Fokker-Planck equation: entropies and convergence to equilibrium

Lecture 19: Heat conduction with distributed sources/sinks

5 Applying the Fokker-Planck equation

Approximation of random dynamical systems with discrete time by stochastic differential equations: I. Theory

A brief introduction to ordinary differential equations

Transcription:

Introduction to multiscale modeling and simulation Lecture 5 Numerical methods for ODEs, SDEs and PDEs The need for multiscale methods Two generic frameworks for multiscale computation Explicit methods for ODEs : forward Euler We consider an initial value problem dy dt = f(y), y(0) = y 0 An analytical solution y(t) cannot be obtained, so we resort to numerical methods. y n y(t n ) t n = n t The simplest method of this type is forward Euler y n+ = y n + tf(y n )

Consistency of the forward Euler method Forward Euler method is given by y n+ = y n + tf(y n ) Let us fill in the exact solution and Taylor expand y(t n+ ) y(t n )+ tf(y(t n )) + t 2 y (t n ) 2 Thus, in one step, we make an error of O( t 2 ) n = t / t To get at a given time t, we must take steps The global error is then O( t), i.e. first order Higher-order methods can be developed (see a dedicated course) Stability of the forward Euler method Consistency shows that the method converges for t 0 What happens for finite t? Look at stability of the method! Consider the test equation y = λy Re(λ) < 0 Solutions of the forward Euler scheme need to tend to 0 for y n+ = y n ( + λ t) t Im(λ t) λ R : t<2/ λ -2 - Re(λ t) -

Possibly unphysical behavior of forward Euler Just because a numerical method is stable, does not imply desired behavior! y n+ = y n ( + λ t) =ρy n λ R : t<2/ λ Exact solution : y(t n )=exp( λn t) y 0 Numerical approximation : y n =(+λ t) n y 0 = ρ n y 0 amplification factor 0.75 ( + λ t) > 0 ( + λ t) < 0 0.5 y(t) 0.5 y(t) 0.25 0 0 0 2 3 4 t 0.5 0 2 4 6 8 0 t Forward Euler for a two-scale test equation Consider a linear system with two time scales dx dt = λx dy dt = y λ / λ R This system has eigenvalues and. Consider Then, forward Euler is stable if both λ t <2 t/ < 2 So, for 0, we have the condition t <2

Forward Euler does not always represent fast modes well y(t) 0.75 0.5 0.25 x n+ = x n ( + λ t) =ρ λ x n y n+ = y n ( t/) =ρ y n t = /2 When t = O(), time-scales of fast equation are changed! - Im(ρ) Re(ρ) 0 0.5 0 0.5.5 2 t t =.8 Fast decaying modes may become slowly decaying, but oscillatory! - Im(ρ) y(t) 0 0.5 - Re(ρ) 0 0.5.5 2 t - Slow modes are unaffected by the time step Im(ρ) x n+ = x n ( + λ t) =ρ λ x n y n+ = y n ( t/) =ρ y n Im(ρ) - Re(ρ) - Re(ρ) - - 2.5 t = /2 2.5 t =.8 x(t) x(t) 0.5 0.5 0 0 0.5.5 2 t 0 0 0.5.5 2 t

Stiffness Consider a slow-fast system du = u u 2 +2 dt du 2 = dt (u3 u 2 ) Quickly relaxes to du dt = u u 3 +2 u 2 = u 3 A discrepancy between t - the (large) time step that can be taken to obtain required accuracy u u 2 - the (small) time step for that is needed for stability δt = O() Alternative approach : Implicit methods for ODEs dy dt = f(y), y(0) = y 0 An alternative to forward Euler is backward Euler y n+ = y n + tf(y n+ ) Now, the solution y n+ is found as the solution of a nonlinear system (more work per time-step!) Method is still first order accurate y(t n+ ) y(t n ) t = f(y(t n+ )) + O( t)

Stability of the backward Euler method Again consider the test equation y = λy Then, backward Euler gives y n+ = y n + tλy n+ ( λ t) y n+ = y n y n+ = λ t yn When Re(λ) < 0 ρ = λ t yn < Im(λ t) 2 - Re(λ t) When Re(λ) ρ 0 Explicit methods for SDEs : Euler-Maruyama We consider an initial value problem dy = g(y)dt + β(y)dw, y(0) = y 0 Discretizing in time gives y n+ = y n + g(y n ) t + β(y n ) W The Brownian increments W have mean zero and variance The scheme then can be written as t y n+ = y n + g(y n ) t + β(y n ) tξ n, ξ n N(0, )

Consistency of the Euler-Maruyama method We will only state some results without proof. Order of consistency depends on how the error is defined. Strong convergence... -... tells something about the expectation of the error y n y(t n ) = O( t /2 ) -... measures convergence of individual trajectories Weak convergence... -... tells something about the error in expectations y n y(t n ) = O( t) -... measures convergence in a distribution sense Stability of the Euler-Maruyama method () As for consistency, stability can be defined in different ways. Consider a linear test equation dy = λy dt + µy dw Method is stable if solutions tends to 0 for t Mean-square stability lim y(t) 2 =0 t Asymptotic stability lim y(t) =0, a.s. t

Stability of the Euler-Maruyama method (2) Stability can crucially depend on the type of test equation considered. Consider for instance an Ornstein-Uhlenbeck process dy = λy dt + µdw, Re(λ) < 0 The previous definitions are useless here, since the process itself approximates a normal distribution for t. We define the numerical method to be stable if its solution also approaches a normal distribution for t. One can show that the Euler-Maruyama scheme for the SDE is stable for a given time step t, if and only if the forward Euler method is stable for the deterministic part. Euler-Maruyama for a two-scale test equation Consider a fast Ornstein-Uhlenbeck process dy = ydt+ 2 dw At the macroscopic level, equivalent to (see lecture 4) dµ dt = µ dσ dt = 2 Σ+2 µ = y Σ= (y µ) 2 It is easy to show that (exercise!) Euler-Maruyama gives us µ n+ = t µ n Σ n+ = 2 t + t2 2 Σ n

Euler-Maruyama may affect time-scale separation Effect of Euler-Maruyama on mean and variance µ n+ = t µ n As for the deterministic case, choosing behavior : t Σ n+ = 2 t + t2 2 Σ n + 2 t t = O() significantly affects the - : very quick relaxation to equilibrium distribution t 2 - : very slow (oscillatory) relaxation to equilibrium distribution Implicit Euler doesn t capture invariant distribution Consider a stochastic version of implicit Euler y n+ = y n + g(y n+ ) t + β(y n ) W Apply this method to the fast Ornstein-Uhlenbeck process dy = 2 ydt+ dw This gives + 2 t t y n+ = y n + ξn Then (do as an exercise! ) lim n yn =0 lim n (y n ) 2 = + t/(2)

Explicit methods for PDEs Method of lines semi-discretization + forward Euler Consider an advection-diffusion equation t u(x, t)+c x u(x, t) =D xx u(x, t) Discretize the spatial derivatives with finite differences du(x i,t) dt + c u(x i,t) u(x i,t) x Results in a coupled system of ODEs du dt = Au, A = tridiag Apply forward Euler to this system of ODEs u n+ =(I + A t)u n = D u(x i+,t) 2u(x i,t)+u(x i,t) x 2 c x + D x 2, c x 2 D x 2, D x 2 Stability of forward Euler for PDE discretization Consider the method-of-lines system, and define the spectrum of A du dt = Au, σ(a) ={λ i} N i= Forward Euler is stable if the stability criterion is satisfied for all eigenvalues +λ i t < For pure diffusion D>0,c=0, this leads to For pure advection D =0,c>0, this leads to t x2 2D t x c

Overview of the lecture Numerical methods for ODEs, SDEs, and PDEs Multiscale challenges Computational frameworks : - equation-free methods - heterogeneous multiscale methods Challenge for multiscale ODEs We have a multiscale ODE dx dt dy dt = f(x, y) = g(x, y) lim t ϕt ξ(y) =η(ξ) g(ξ,η(ξ)) = 0 Explicit methods have time-step limitation δt = O() We know that a macroscopic model exists when dx dt = F 0(X) =f(x, η(x)) 0 For this macroscopic model, we have t = O()

Challenge for multiscale SDEs We have a multiscale SDE dx = f(x, y)dt dy = g(x, y)dt + β(x, y)dw lim ρ ξ(y, t) =ρ ξ (y) t Implicit methods don t work; explicit methods have a time-step restriction We know that a macroscopic model exists when dx dt = F (X) = δt = O() For this macroscopic model, we have t = O() 0 f(x, y)dµ X (y) = f(x, y)ρ X (y)dy Challenge for PDE homogenization problems We have a PDE with heterogeneous coefficient t u (x, t) x A x x u (x, t)) = f(x) Explicit methods have a time-step restriction δt = O(δx 2 )=O( 2 ) We know that a macroscopic model exists for 0 t U(x, t) x Ā x U(x, t) = f(x) For this macroscopic model, we have t = O( x 2 )=O()

Challenge for kinetic equations We have a kinetic equation for the phase-space density t f (x, v, t)+ v xf (x, v, t) = f f 2 Explicit discretization has a time-step restriction δt = O( 2 ) We know that a macroscopic model exists when 0 ρ ρ : t ρ = D xx ρ For this macroscopic model, we have t = O( x 2 ) 25 Challenge for Monte Carlo simulation of SDEs This is a slightly different setting : we do not impose an infinite time-scale separation here. We have an SDE for behavior of an individual particle (here: FENE model) dx = ux 2ζ F (X) dt + σ 2 dw t, F(X) = ζ X X 2 /b Direct Monte Carlo simulation requires an ensemble of M particles, with time step δt. We assume an approximate macroscopic model exists in terms of some macroscopic state variables U i = f i (X) du dt = H(U, u) τ p = T (U)

Overview of the lecture Numerical methods for ODEs, SDEs, and PDEs Multiscale challenges Computational frameworks : - equation-free methods - heterogeneous multiscale methods Equation-free multiscale framework Generic strategy for the development of multiscale methods Coarse time-stepper as a building block for efficient algorithms Microscopic level model known simulation code available Macroscopic level only state variables corresponding evolution law unknown Simulatie Lifting Restrictie t* t* +!t Kevrekidis et al., 2000 -... / Kevrekidis & S, Annual Review on Physical Chemistry 60:32-344, 2009 28

Coarse projective integration t* t* + "t t* +!t Extrapolate macroscopic state forward in time using an estimated time derivative Resembles a forward Euler method for just the macroscopic state variables 29 Related strategy: heterogeneous multiscale methods Postulate a general form for the unknown macroscopic equation Supplement this equation with an estimation of missing macroscopic quantities from a microscopic simulation - Initialization of the microscopic model from a given macroscopic state - Estimation of a macroscopic quantity from microscopic data This formulation has advantages from a numerical analysis viewpoint E, Engquist, Vanden-Eijnden, et al., 2003 -... 30

Bifurcation analysis Consider a system that depends on a number of physical parameters dx dt = F (X; λ) Find asymptotic states (equilibria, periodic solutions,...) F (X; λ) =0 Solutions are located on branches (X(s),λ(s)) Multiple solutions possible for the same parameter value Stability can change along a branch 3 Equation-free bifurcation analysis U(t) U(t + τ) =Φ τ (U(t)) Time-stepper is a black box Compute directly macroscopic steady states and their stability U Φ τ (U )=0 Use iterative methods (like Newton-Krylov) Matrix-vector products Φ τ (Ū) DΦ τ Ū (Ū) v Φ τ (Ū + v) Ū + v 32

Goals for the remaining lectures The equation-free and heterogeneous multiscale frameworks provide a common algorithmic structure to design and analyze multiscale methods. For each concrete problem, specific methods can be constructed : - Lifting and restriction operators need to be developed - Accuracy, stability, efficiency need to be examined We will discuss numerical techniques for each of the model problems. We will also look into alternative techniques and relate them to the generic frameworks of this course. 33