1 / 95

ORDINARY DIFFERENTIAL EQUATIONS Student Notes

ORDINARY DIFFERENTIAL EQUATIONS Student Notes. ENGR 351 Numerical Methods for Engineers Southern Illinois University Carbondale College of Engineering Dr. L.R. Chevalier Dr. B.A. DeVantier. Photo Credit: Mr. Jeffrey Burdick. Ordinary Differential Equations… where to use them.

eavan
Download Presentation

ORDINARY DIFFERENTIAL EQUATIONS Student Notes

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ORDINARY DIFFERENTIAL EQUATIONSStudent Notes ENGR 351 Numerical Methods for Engineers Southern Illinois University Carbondale College of Engineering Dr. L.R. Chevalier Dr. B.A. DeVantier

  2. Photo Credit: Mr. Jeffrey Burdick

  3. Ordinary Differential Equations…where to use them The dissolution (solubilization) of a contaminant into groundwater is governed by the equation: where kl is a lumped mass transfer coefficient and Cs is the maximum solubility of the contaminant into the water (a constant). Given C(0)=2 mg/L, Cs = 500 mg/L and kl= 0.1 day-1, estimate C(0.5) and C(1.0) using a numerical method for ODE’s.

  4. Ordinary Differential Equations…where to use them A mass balance for a chemical in a completely mixed reactor can be written as: where V is the volume (10 m3), c is concentration (g/m3), F is the feed rate (200 g/min), Q is the flow rate (1 m3/min), and k is reaction rate (0.1 m3/g/min). If c(0)=0, solve the ODE for c(0.5) and c(1.0)

  5. Ordinary Differential Equations…where to use them Before coming to an exam Friday afternoon, Mr. Jones forgot to place 24 cans of a refreshing beverage in the refrigerator. His guests are arriving in 5 minutes. So, of course he puts the beverage in the refrigerator immediately. The cans are initially at 75, and the refrigerator is at a constant temperature of 40.

  6. Ordinary Differential Equations…where to use them The rate of cooling is proportional to the difference in the temperature between the beverage and the surrounding air, as expressed by the following equation with k = 0.1/min. Use a numerical method to determine the temperature of the beverage after 5 minutes and 10 minutes.

  7. Ordinary Differential Equations • A differential equation defines a relationship between an unknown function and one or more of its derivatives • Physical problems using differential equations • electrical circuits • heat transfer • motion • contaminant transport

  8. Ordinary Differential Equations • The derivatives are of the dependent variable with respect to the independent variable • First order differential equation with y as the dependent variable and x as the independent variable would be: • dy/dx = f(x,y)

  9. Ordinary Differential Equations • A second order differential equation would have the form: } does not necessarily have to include all of these variables

  10. Ordinary Differential Equations • An ordinary differential equation is one with a single independent variable. • Thus, the previous two equations are ordinary differential equations • The following is not:

  11. Ordinary Differential Equations • The analytical solution of ordinary differential equation as well as partial differential equations is called the “closed form solution” • This solution requires that the constants of integration be evaluated using prescribed values of the independent variable(s).

  12. Ordinary Differential Equations • An ordinary differential equation of order n requires that n conditions be specified. • Boundary conditions • Initial conditions consider this beam where the deflection is zero at the boundaries x= 0 and x = L These are boundary conditions

  13. P a yo In some cases, the specific behavior of a system(s) is known at a particular time. Consider how the deflection of a beam at x = a is shown at time t =0 to be equal to yo. Being interested in the response for t > 0, this is called the initial condition.

  14. Ordinary Differential Equations • At best, only a few differential equations can be solved analytically in a closed form. • Solutions of most practical engineering problems involving differential equations require the use of numerical methods.

  15. Scope of Lectures on ODE • One Step Methods • Euler’s Method • Heun’s Method • Improved Polygon • Runge Kutta • Systems of ODE • Boundary Value Problems

  16. Specific Study Objectives • Understand the visual representation of Euler’s, Heun’s and the improved polygon methods • Understand the difference between local and global truncation errors • Know the general form of the Runge-Kutta methods • Understand the derivation of the second-order RK method and how it relates to the Taylor series expansion

  17. Specific Study Objectives • Realize that there are an infinite number of possible versions for second- and higher-order RK methods • Know how to apply any of the RK methods to systems of equations • Understand the difference between initial value and boundary value problems

  18. Review of Analytical Solution At this point lets consider initial conditions. y(0)=1 and y(0)=2

  19. What we see are different values of C for the two different initial conditions. The resulting equations are:

  20. One Step Methods • Focus is on solving ODE in the form y xi, yi x

  21. One Step Methods • Focus is on solving ODE in the form y xi, yi x

  22. One Step Methods • Focus is on solving ODE in the form h y xi, yi x This is the same as saying: new value = old value + slope x step size

  23. One Step Methods • Focus is on solving ODE in the form y yi slope = f = dy/dx This is the same as saying: new value = old value + (dy/dx)(h) where h is the step size x h

  24. One Step Methods • Focus is on solving ODE in the form y yi+1 yi slope = f = dy/dx This is the same as saying: new value = old value + (dy/dx)(h) where h is the step size x h

  25. Euler’s Method • The first derivative provides a direct estimate of the slope at xi • The equation is applied iteratively, or one step at a time, over small distance in order to reduce the error • Hence this is often referred to as Euler’s One-Step Method

  26. Example For the initial condition y(1)=1, determine y for h = 0.1 analytically and using Euler’s method given: STRATEGY

  27. Strategy • Determine the analytical solution based on the initial conditions y(1) = 1 • i.e. x=1, y=1 • Determine xi+1 = xi + h • Recognize that f(x,y) = f = 4x2 • yi+1 = yi + 4(xi)2h • Recognize the meaning of “one-step” • yi+1 = yi + 4(xi)2h • yi+2 = yi+1 + 4(xi+1)2h • yi+3 = yi+2 + 4(xi+2)2h…..and so on

  28. Error Analysis of Euler’s Method • Truncation error - caused by the nature of the techniques employed to approximate values of y • local truncation error (from Taylor Series) • propagated truncation error • sum of the two = global truncation error • Round off error - caused by the limited number of significant digits that can be retained by a computer or calculator

  29. Higher Order Taylor Series Methods • This is simple enough to implement with polynomials • Not so trivial with more complicated ODE • In particular, ODE that are functions of both dependent and independent variables require chain-rule differentiation • Alternative one-step methods are needed

  30. Modification of Euler’s Methods • A fundamental error in Euler’s method is that the derivative at the beginning of the interval is assumed to apply across the entire interval • Two simple modifications will be demonstrated graphically in order to give insight on the different strategies that can be employed • These modification actually belong to a larger class of solution techniques called Runge-Kutta which we will explore and apply later

  31. Heun’s Method • Determine the derivative for the interval • the initial point • end point • Use the average to obtain an improved estimate of the slope for the entire interval

  32. y Take the slope at xi Project to get f(xi+1 ) based on the step size h h x xixi+1

  33. y Use this “average” slope to predict yi+1 x xixi+1 {

  34. y Use this “average” slope to predict yi+1 x xixi+1 {

  35. y y x xixi+1 Euler’s x xi xi+1 Heun’s

  36. y x xi xi+1

  37. Improved Polygon Method • Another modification of Euler’s Method • Uses Euler’s to predict a value of y at the midpoint of the interval • This predicted value is used to estimate the slope at the midpoint

  38. Improved Polygon Method • We then assume that this slope represents a valid approximation of the average slope for the entire interval • Use this slope to extrapolate linearly from xi to xi+1 using Euler’s algorithm

  39. y f(xi) x xi

  40. y h/2 h x xixi+1/2 xi+1

  41. y h/2 x xixi+1/2

  42. y f(xi+1/2) x xixi+1/2

  43. y f’(xi+1/2) x xixi+1/2

  44. y Extend your slope now to get f(x i+1) h x xixi+1/2 xi+1

  45. y f(xi+1) x xixi+1/2xi+1

  46. Runge-Kutta Methods Both Heun’s and the Improved Polygon Method have been introduced graphically. However, the algorithms used are not as straight forward as they can be. Let’s review the Runge-Kutta Methods. Choices in values of variable will give us these methods and more. It is recommend that you use this algorithm on your homework.

  47. Runge-Kutta Methods • RK methods achieve the accuracy of a Taylor series approach without requiring the calculation of a higher derivative • Many variations exist but all can be cast in the generalized form: { f is called the incremental function

  48. , Incremental Functioncan be interpreted as a representative slope over the interval

  49. NOTE: k’s are recurrence relationships, that is k1 appears in the equation for k2 which appears in the equation for k3 This recurrence makes RK methods efficient for computer calculations

More Related