MATH 1080 Spring 2020, second half of semester Notes for the remote teaching 1. Numerical methods for Ordinary Differential Equations (ODEs). DEFINITION 1.1 (ODE of order p). d py d p−1y dy + a + ··· + a + a y = f (t,y,y0,...,y(p−1)). (1.1) dt p p−1 dt p−1 1 dt 0
REMARK 1.1. An ODE of order p can be written as a system of p first-order equations, with the unknowns:
0 00 (p−2) (p−1) y1 = y,,y2 = y , y3 = y ,,..., yp−1 = y ,yp = y , hence satisfying y0 = y 1 2 y0 = y , 2 3 . . y0 = y , p−1 p 0 yp = f (t,y1,y2,...,yp−1) − ap−1yp − ··· − a1y2 − a0y1.
EXAMPLE 1.1 (Logistic equation). y y0 = cy 1 − . (scalar equation) B
EXAMPLE 1.2 (Lotka-Volterra). 0 y1 = c1y1(1 − b1y1 − d2y2) 0 (system of 2 first-order equations) y2 = c2y2(1 − b2y2 − d1y1).
EXAMPLE 1.3 (Vibrating spring / simple harmonic motion). u00(x) + k(x)u0(x) + m(x)u(x) = f (x). (2nd order scalar equation)
n n DEFINITION 1.2 (The Cauchy problem, Initial Value Problem (IVP)). Find y : I → R ,y ∈ C1(R ) such that y0 = f (t,y(t)), t ∈ (0,T] (IVP) y(t0) = y0. n 1 Here I = [t0,T], y0 ∈ R is called ’initial datum’, and y(·) ∈ C (R) satisfying (IVP) is a classical solution. Moreover, if f (t,y(t)) ≡ f (y(t)), the equation/system (IVP) is called ‘autonomous’. DEFINITION 1.3. The equation (IVP) can be considered in ‘integral form’: Z t y(t) = y(t0) + f (s,y(s))ds. (1.2) t0 n and then the solution y(·) ∈ C(R ) is called a ‘mild solution’. DEFINITION 1.4. The function f is globally Lipschitz if n | f (t,y) − f (s,z)| ≤ L |t − s| + |y − z| , ∀(t,y),(s,z) ∈ R × R . (1.3)
THEOREM 1.5 (Existence and uniqueness of IVPs). If f is Lipschitz continuous, then ∃! there exists a unique solution y to the (IVP). 1 1.1. One-step numerical methods. To simplify the presentation, we shall consider first the constant step size (equidistant mesh) case, i.e., T −t ∆t = 0 , (constant time step) N where N ∈ N is the number of subintervals, and ti = t0 + i∆t, for all i = 0 : N. In order to introduce some of the most classical numerical methods for ODEs, let us consider the Initial Value Problem (IVP) in its integral form (1.2). Or equivalently, let us integrate (IVP) on [tn,tn+1] to obtain
Z tn+1 y(tn+1) = y(tn) + f (t,y(t))dt, (1.4) tn and use some of the quadrature (numerical integration) rules to approximate the integral, namely
Z tn+1 f (t,y(t))dt ≈ f (tn,y(tn)) · ∆t (rectangle left) tn Z tn+1 f (t,y(t))dt ≈ f (tn+1,y(tn+1)) · ∆t (rectangle right) tn Z tn+1 t +t t +t f (t,y(t))dt ≈ f n n+1 ,y n n+1 · ∆t (rectangle midpoint rule) tn 2 2 Z tn+1 f (t ,y(t )) + f (t ,y(t )) f (t,y(t))dt ≈ n+1 n+1 n n · ∆t ( trapezoidal rule) tn 2 These approximations then yield the following numerical methods for solving (IVP)
yn+1 = yn + ∆t f (tn,yn) (Forward Euler)
yn+1 = yn + ∆t f (tn+1,yn+1) (Backward Euler) t +t t +t y + y y = y + ∆t f n n+1 ,??? ≈ y + ∆t f n n+1 , n n+1 (implicit midpoint) n+1 n 2 n 2 2 f (t ,y ) + f (t ,y ) y = y + ∆t n+1 n+1 n n (trapezoidal / Crank-Nicolson) n+1 n 2 where yn ≈ y(tn),∀n = 1 : N. NOTATION 1.1. From now on we are going to denote frequently fn := f (tn,yn). DEFINITION 1.6 (One-step numerical method). Let Φ be a functional depending on the unknowns {yn} and the values f (yn). Then the relation
yn+1 = yn + ∆tΦ(yn+1,yn, fn, fn+1) (1.5) is called a one-step numerical method for approximating the Cauchy problem (IVP). Note that the methods above, namely (Forward Euler) (FE), (Backward Euler) (BE), (implicit midpoint), and (trapezoidal / Crank-Nicolson) are all one-step methods. 1.2. Consistency. DEFINITION 1.7 (Local truncation error). The residual obtained by substituting the exact solution y(t) of (IVP), evaluated at the mesh points tn,tn+1, in the numerical method (1.5) ∆tτn(∆t) := y(tn+1) − y(tn) − ∆tΦ y(tn+1),y(tn), f (y(tn)), f (y(tn+1)) (LTE) is called the Local Truncation Error (LTE), and is used to evaluate the approximating qualities of each method, order of ‘consistency’, and serves as an essential tool in time-adaptivity [1]. 2 DEFINITION 1.8 (Order of consistency). A numerical method is ‘consistent with order p’ if
p+1 ∆tτn(∆t) = O(∆t ), i.e., there exist a positive constant C > 0 such that