Numerical Solutions of ODE and PDE Introduction • For simple differential equations, it is possible to find closed form solutions • Example: • The more general equation is approached in a similar spirit, in the sense that usually there is a general solution dependent on a constant. • For a first-order linear equation Method of Integrating factors can be used. • If a(t)=λ • Multiplying by 𝑒 −𝜆𝑡 • The general solution of the first-order equation normally depends on an arbitrary integration constant. • To single out a particular solution, we need to specify an additional condition. • Usually such a condition is taken to be of the form • For a general right-side function it is usually not possible to solve the initial value problem analytically. • One such example is for the equation • In such a case, numerical methods are the only plausible way to compute solutions. • Moreover, even when a differential equation can be solved analytically, the solution formula, usually involves integrations of general functions. • The integrals mostly have to be evaluated numerically. Multistep Methods • Reformulate the differential equation by integrating over [tn, tn+1] • To evaluate the integral we approximate g(t) by using polynomial interpolation and then integrate the interpolating polynomial. • By using a polynomial of degree q at points (tn+1,tn,tn-1, …,tn-q+1) • From the theory of polynomial interpolation and using first order interpolator • Incorporating this into the ODE problem equation • Dropping the final term • Example: Solve the following ODE Euler’s Method • As before, Y (t) denotes the true solution of the initial value problem with the initial value Y0: • Numerical methods for solving this will find an approximate solution y(t) at a discrete set of nodes, • For simplicity the points are equally spaced • To derive Euler’s method, consider the standard derivative approximation from beginning calculus, • Applying this to the problem at tn • Euler’s method is defined by taking this to be exact: • Example: The true solution of the problem • is • Euler’s method is given by • Example: solve • whose true solution is • Euler’s method for this differential equation is • Error analysis of Euler’s method • We begin by applying Taylor’s theorem to approximating Y(tn+1), • Since • The final term is called the truncation error for Euler’s method • By subtracting the Euler’s approximation formulation • The error has two parts • The truncation error that is introduced at each tn+1 • The propagated error • Reading assignment • Stability • Round off error accumulation SYSTEMS OF DIFFERENTIAL EQUATIONS • A general form of m first-order differential equation is • We seek the functions Y1(t), . . . , Ym(t) on some interval t0 ≤ t ≤ b. • An efficient representation is • Example: the following problem can be written as Higher order Differential Equations • In practice most problems involve higher order equations. • An example is solving the second-order equation that results from Newton’s second law of motion • This can be reformulated as a system of first-order equations, by setting • Then • A general differential equation of order m can be written as • It is reformulated as a system of m first-order equations by introducing • Then the equivalent initial value problem for a system of first-order equations is • Example: The initial value problem • Is reformulated as NUMERICAL METHODS FOR SYSTEMS • The derivation of the Euler’s method for a system of equations is done similarly as the case of a first order differential equation by using the Taylor’s expansion • In this formula, the matrix-vector notation is used that was introduced for the case of system of differential equations. • Higher order differential equations are also solved in a similar manner by converting them into a system of first order differential equations.