1 / 67

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 Implicit Methods Adaptive Stepsize. Contents. Review. DE (Differential Equation)

tatianam
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 Implicit Methods Adaptive Stepsize 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. Ode2: solves 1st and 2nd order ODE Ic1, ic2, bc: setting conditions ‘ do not evaluate Maxima on ODE

  10. Linear ODE • Linearity: • Involves no product nor nonlinear functions of y and its derivatives • nth order linear ODE

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

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

  13. Example

  14. End of Review

  15. The Canonical Problem This is Euler’s method

  16. Example Compare with exact sol:

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

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

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

  20. 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)

  21. Example (Euler’s)

  22. Methods Improving Euler Motivated by Geometric Interpretation

  23. Midpoint Method

  24. Example (Midpoint)

  25. Heun’s Method

  26. Example (Heun’s) Note the result is the same as Midpoint!?

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

  28. RK Methods

  29. RK Methods (cont)

  30. Taylor’s Expansion

  31. RK 1st Order

  32. RK 2nd Order

  33. RK 2nd Order (cont)

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

  35. Classical 4th order RK

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

  37. 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

  38. Example (cont)

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

  40. Stability: Symptom

  41. Symptom: Unstable Spring System Become unstable instantly … Start with this … Cause by stiff (k=4000) springs

  42. Example Problem: Stability (cont) Conditionally stable

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

  44. Review: Numerical Differentiation Taylor’s expansion: Forward difference Backward difference

  45. Numerical Difference (cont) Central difference

  46. Implicit Method (Backward Euler) Forward difference Backward difference

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

  48. Stability limit Stiff Set of ODE Use the change of variable Get the following solution: A stiff equation is a differential equation for which certain numerical methods for solving the equation are numerically unstable, unless the step size is taken to be extremely small

More Related