1 / 55

Ordinary Differential Equations

Ordinary Differential Equations. Jyun-Ming Chen. Review Euler’s method 2 nd order methods Midpoint Heun’s Runge-Kutta Method. Systems of ODE Stability Issue. Contents. Review. DE (Differential Equation)

wolfe
Download Presentation

Ordinary Differential Equations

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 Equations Jyun-Ming Chen

  2. Review Euler’s method 2nd order methods Midpoint Heun’s Runge-Kutta Method Systems of ODE Stability Issue Contents

  3. Review • DE (Differential Equation) • An equation specifying the relations among the rate change (derivatives) of variables • ODE (Ordinary DE) vs. PDE (Partial DE) • The number of independent variables involved

  4. Solution of an equation: Solution of DE vs. Solution of Equation f(x) x Review (cont) • Geometrically,

  5. Solution of an differential equation: Geometrically: x t Need additional conditions to specify a solution Review (cont)

  6. Review (cont) • Order of an ODE • The highest derivative in the equation • nth order ODE requires n conditions to specify the solution • IVP (initial value problem): All conditions specified at the same (initial) point • BVP (boundary value problem): otherwise

  7. IVP VS. BVPRevisit Shooting Problem

  8. IVP vs. BVP Physical meaning

  9. Review (cont) • Linearity: • No product nor nonlinear functions of y and its derivatives • nth order linear ODE

  10. Focus of This Chapter • Solve IVP of nth order ODE numerically • e.g.,

  11. ODE (IVP) • First order ODE (canonical form) • Every nth order ODE can be converted to n first order ODEs in the following method:

  12. Example

  13. End of Review

  14. The Canonical Problem This is Euler’s method

  15. Example

  16. y 1 y=e–x x Example (cont)

  17. Error Analysis(Geometric Interpretation) Think in terms of Taylor’s expansion If the true solution were a straight line, then Euler is exact

  18. Error Analysis(From Taylor’s Expansion) Euler’s Euler’s truncation error O(Dx2) per step 1st order method

  19. y Cumulative Error x Remark: Dx Error  But computation time x = 0 x = T Number of steps = T/Dx Cumulative Err. = (T/Dx)  O(Dx2) = O(Dx)

  20. Example (Euler’s)

  21. Methods to Improve Euler Motivated by Geometric Interpretation

  22. Midpoint Method

  23. Example (Midpoint)

  24. Heun’s Method

  25. Example (Heun’s)

  26. Comparison of Euler, Heun, midpoint 1st order: Euler 2nd order: Heun, midpoint “order”: All are special cases of RK (Runge-Kutta) methods Remark

  27. RK Methods

  28. RK Methods (cont)

  29. Taylor’s Expansion

  30. RK 1st Order

  31. RK 2nd Order

  32. RK 2nd Order (cont)

  33. RK 4th Order • Mostly commonly used one • Higher order … more evaluation, but less gain on accuracy

  34. System of ODE • Convert higher order ODE to 1st order ODEs • All methods equally apply, in vector form

  35. Initial Condition c m k x Example (Mass-Spring-Damper System) • Governing Equation • After setting the initial conditions x(0) and x’(0), compute the position and velocity of the mass for any t > 0

  36. Example (cont)

  37. Assume m=1,c=1, k=1 (for ease of computation) Example (cont) set Dt=0.1

  38. Stability: Symptom

  39. Example Problem: Stability (cont) Conditionally stable

  40. Discussion • Different algorithm different stability limit • Check Midpoint Method • Different problem different stability limit • use the previous problem as benchmark

  41. Implicit Method (Backward Euler)

  42. Example • Remark: • Always stable (for this problem) • Truncation error the same as Euler (only improve the stability)

  43. Linear System of ODE with Constant Coefficients

  44. Semi-Implicit Euler • Not guaranteed to be stable, but usually is

  45. Initial Condition c m k x

  46. Initial Condition c m k x

  47. Stability limit Stiff Set of ODE Use the change of variable Get the following solution:

  48. Solving ODE numerically … tracing the integral curve y(x) what’s wrong with uniform step size Uniformly small: waste effort Uniformly large: might miss details Adaptive Stepsize

More Related