Numerical Solutions of ODE and PDE Lesson 1 Introduction Ordinary Differential Equation An ordinary differential equation (ODE) is an equation stating a relationship between a function of a single independent variable and the derivatives of this functions with respect to the independent variable. For example: ψ(t, y, y 0 . . . , y m ) The order of an ODE is the order of the highest order derivative in the differential equation. If no product of the dependent variable y(t) with itself or any of its derivatives occurs, then the equation is called linear, otherwise it is non-linear. Examples are y 00 + y = 0 linear y0 + y2 = 0 nonlinear y 0 + t2 y = 0 linear y 00 + sin(y) = 0 nonlinear The general first order ODE is of the form dy = f (t, y) dt A general solution of an ODE of order m contains m arbitrary constants that can be determined by prescribing m conditions. There are two different classes of of ODE, depending on the type of auxiliary conditions specified. 1-1 Introduction Initial and Boundary Value Problem (IVP & BVP) If all the auxiliary conditions are specified at the same value of the independent variable and the solution is to be marched forward from that initial point, the differential equation together with the specified condition is called an IVP. If the auxiliary conditions are specified at two different values of the independent variable, the end point or at the boundaries of the domain of interest, the differential equation is called boundary value problem. For example: y 00 + P (t, y)y 0 + Q(t, y)y = F (t) y(t0 ) = c1 and y 0 (t0 ) = c2 (IV P ) y 00 + P (t, y)y 0 + Q(t, y)y = F (t) y(t1 ) = d1 and y(t2 ) = d1 (BV P ) Reduction of higher order equations to the system of first order differential equations Suppose that an n-th order equation can be solved for the n-th derivative, i.e., it can be written in the form: y (n) = f (t, y 0 , y 00 , . . . , y n−1 ) This equation can now be written in a system of first order differential equations by a standard change of variables: y1 = y y2 = y 0 y3 = y 00 .. . yn = y n−1 . 1-2 Introduction Then, the resulting first-order system is the following: y10 = y 0 = y2 y20 = y 00 = y3 y30 = y 000 = y4 .. . yn0 = y n = f (t, y2 , y3 , . . . , yn ). In vector form this can simply be written as y0 = f (t, y) where y = [y1 , y2 , . . . , yn ]T and f = [y2 , y3 , . . . yn , f ]T . Let us assume that the initial values for the nth order problem are given as y(t0 ) = y0 , y 0 (t0 ) = y1 , . . . , y n−1 (t0 ) = yn−1 Clearly, it follows y(t0 ) = [y0 , y1 , . . . , yn−1 ]T . Example 1.1 Convert the second order IVP into a system of first order IVP 2y 00 − 5y 0 + y = 0 y(0) = 6; y 0 (0) = −1; Sol: Let y2 = y 0 . y1 = y It follows then y10 = y2 1 5 y20 = − y1 + y2 2 2 and y1 (0) = 6; y2 (0) = −1 1-3 Introduction Remark 1.2 The methods of solution of first order initial value problem may be used to solve the system of first order initial value problems and the nth order initial value problem. Suggested Readings A. Quarteroni, R. Sacco, F. Saleri (2007). Numerical Mathematics. Second Edition. Springer Berlin. M.K. Jain, S.R.K. Iyengar, R.K. Jain (2009). Numerical Mathematics. Fifth Edition. New age international publishers, New Delhi. 1-4 Numerical Solutions of ODE and PDE Lesson 2 Numerical Solutions of IVP Let us consider the following IVP and discuss its existence and uniqueness of solution: dy = f (t, y), y(t0 ) = y0 t ∈ [t0 , b] dt (2.1) Existence and Uniqueness of the Solution of IVP The IVP (2.1) admits a unique solution y(t) if f (t, y) is uniformly Lipschitz continuous, that is, |f (t, y1 ) − f (t, y2 )| ≤ L|y1 − y2 | for any t ∈ [t0 , b] and any y1 and y2 . Here L is called Lipschitz constant. Finding exact solution of a practical problem is hardly possible, therefore numerical solutions are required. Numerical Solutions of IVP The numerical methods produce approximate values of y(t) at certain points along the t coordinate called grids or mesh points. In case of equally spaced grid points we have ti+1 = ti + h, i = 0, 1, . . . , N − 1; where h is called the step size. 2-1 tN = b Numerical Solutions of IVP Figure 2.1: Grid points We shall use the following notation for the the approximation of solution of IVPs un ≈ y(tn ) =: yn . Single or Multi Step Methods: If the method advances the solution from one grid point to the next grid point using only data at the single grid point, that is, un+1 depends only on un , it is called one-step or single step method otherwise it is called multistep method. Explicit and Implicit Methods: A method is called explicit method if un+1 can be computed directly in terms of the previous values uk , k ≤ n, implicit if un+1 depends implicitly on itself through f . Single Step Method A single step method can be written as un+1 = un + hφ(tn , un , fn , h) 2-2 Numerical Solutions of IVP where φ is called an increment function. Figure 2.2: Increment function 2-3 are