Numerical MethodUnit 710 min read
Numerical ODEs: Euler, Taylor, RK, Multistep & Error Analysis
Unit 7 of Numerical Method covers solving first-order and higher-order ODEs using Euler’s method, Taylor series, Runge-Kutta (RK2/RK4), multistep methods (Adams-Bashforth), error analysis (local/global truncation error), and stability considerations. Includes derivations, worked examples, and comparisons of methods.
Key Concepts & Methods
1. Classification of ODEs
Ordinary Differential Equations (ODEs) are classified based on:
- Order: Highest derivative present (e.g., is 1st-order, is 2nd-order).
- Linearity: Linear ODEs have dependent variable and its derivatives to the first power (e.g., ). Nonlinear ODEs include terms like , , or .
- Initial Value Problems (IVPs): Specified with initial conditions (e.g., ).
- Boundary Value Problems (BVPs): Specified with boundary conditions (e.g., , ).
2. Single-Step Methods
Single-step methods compute using only the previous point . Key methods:
A. Euler’s Method
Definition: Approximates the solution of using the tangent line at : where is the step size.
Derivation:
- Taylor expansion of around :
- Euler’s method truncates after the first two terms, ignoring higher-order derivatives.
Worked Example: Solve , using Euler’s method with to approximate .
| Step | ||||
|---|---|---|---|---|
| 0 | 0.0 | 1.0 | ||
| 1 | 0.1 | 1.1 | ||
| 2 | 0.2 | 1.23 | ||
| 3 | 0.3 | 1.393 | ||
| 4 | 0.4 | 1.5923 | — | — |
Approximate .
Error Analysis:
- Local Truncation Error (LTE): Error introduced in one step, proportional to for Euler’s method.
- Global Truncation Error (GTE): Accumulated error over steps, proportional to (i.e., ).
Advantages/Disadvantages:
| Advantages | Disadvantages |
|---|---|
| Simple to implement | Low accuracy () |
| Low computational cost | Sensitive to step size |
| Works for any | May diverge for stiff equations |
B. Taylor Series Method
Definition: Uses higher-order Taylor expansions to improve accuracy. For , the -th order method is: Derivatives are computed using .
Worked Example: Solve , using the first four terms of Taylor’s series to approximate with .
Compute derivatives:
Apply Taylor expansion at : Substitute : Exact solution: . With , , so (exact).
Error Analysis:
- LTE: for 4th-order Taylor method.
- GTE: .
Advantages/Disadvantages:
| Advantages | Disadvantages |
|---|---|
| Higher accuracy than Euler | Requires computation of higher derivatives |
| No iteration needed | Derivatives may be complex/non-existent |
C. Runge-Kutta Methods (RK2, RK4)
Definition: Weighted averages of slopes to improve accuracy without computing higher derivatives.
RK2 (Heun’s Method):
RK4:
Worked Example (RK4): Solve with , to estimate .
Rewrite as . Compute first:
Repeat for using and .
Error Analysis:
- RK2: LTE , GTE .
- RK4: LTE , GTE .
Comparison Table:
| Method | Order | LTE | GTE | Steps per Evaluation | Stability |
|---|---|---|---|---|---|
| Euler | 1 | 1 | Poor | ||
| Taylor (4th) | 4 | 1 | Good | ||
| RK2 | 2 | 2 | Moderate | ||
| RK4 | 4 | 4 | Good |
3. Multistep Methods
Use multiple previous points to compute . Example: Adams-Bashforth methods.
Adams-Bashforth 2-step (AB2):
Requires a starting value (e.g., from RK4).
Advantages/Disadvantages:
| Advantages | Disadvantages |
|---|---|
| Higher accuracy than single-step | Requires initial values |
| Fewer function evaluations | Less stable for large |
4. Higher-Order ODEs
Convert to a system of first-order ODEs. For example: Let , then:
Example: Solve , , using RK4.
Convert to:
5. Error Analysis & Stability
- Local Truncation Error (LTE): Error per step (e.g., for Euler).
- Global Truncation Error (GTE): Accumulated error over steps (e.g., for Euler).
- Stability: A method is stable if errors do not grow unboundedly. Euler’s method is conditionally stable (requires small for stiff equations).
- Consistency: A method is consistent if LTE as .
- Convergence: A consistent method converges if GTE as .
Stiff Equations: ODEs with widely varying solution scales (e.g., , where ). Implicit methods (e.g., backward Euler) are preferred for stability.
6. Choosing a Method
| Criteria | Recommended Method |
|---|---|
| Speed | Euler (if low accuracy is acceptable) |
| Accuracy | RK4 or Taylor series |
| Stiff problems | Backward Euler or implicit RK |
| Low computational cost | Adams-Bashforth (multistep) |
Exam Tip
What Examiners Look For
Derivations:
- Always derive formulas (e.g., Euler’s method, RK4) from Taylor expansions.
- Show intermediate steps for derivatives in Taylor’s method.
Worked Examples:
- Euler/Taylor/RK4: Compute tables step-by-step. Label columns clearly (e.g., , , ).
- Error bounds: State LTE/GTE orders (e.g., "Euler’s method has LTE ").
- Initial conditions: Verify matches the given IC.
Comparisons:
- Compare methods in a table (order, error, stability, steps).
- Discuss trade-offs (e.g., RK4 is accurate but computationally expensive).
Stability & Convergence:
- Define stability and mention stiff equations.
- For RK4, state that it is stable for non-stiff problems.
Common Pitfalls:
- Euler’s method: Forgetting to update or misapplying .
- RK4: Incorrectly computing (wrong arguments).
- Taylor series: Skipping derivative calculations or misapplying .
- Higher-order ODEs: Forgetting to convert to a system of first-order ODEs.
Exam Questions:
- Direct computation: Solve using a specific method (e.g., "Use RK4 to estimate ").
- Derivation: Prove the formula for a method (e.g., "Derive the RK2 formula").
- Error analysis: Discuss LTE/GTE for a given method.
- Comparison: "Which method would you use for a stiff equation? Why?"
Sample Exam Questions & Answers
| Question Type | Key Steps to Score Full Marks |
|---|---|
| Solve using Euler’s method | 1. Write the formula. 2. Compute at each step. 3. Update . 4. State LTE/GTE. |
| Derive RK4 | 1. Write Taylor expansion up to . 2. Express in terms of . 3. Combine coefficients. |
| Compare Euler vs. RK4 | Table with order, LTE, GTE, stability, and computational cost. |
| Stability discussion | Define stability. Mention stiff equations. Recommend implicit methods. |
Quick Revision Checklist
- Can you derive Euler’s method from Taylor expansion?
- Do you know the RK4 coefficients by heart?
- Can you convert a 2nd-order ODE to a system of 1st-order ODEs?
- What is the difference between LTE and GTE?
- Which method is best for stiff equations? Why?
flowchart TD
A[First-Order ODE: y' = f(x,y)] --> B[Single-Step Methods]
A --> C[Multistep Methods]
B --> B1[Euler: O(h)]
B --> B2[Taylor: O(h^k)]
B --> B3[RK2: O(h^3)]
B --> B4[RK4: O(h^5)]
C --> C1[Adams-Bashforth: O(h^3)]
C --> C2[Adams-Moulton: O(h^5)]
B1 --> D[Low Accuracy\nHigh Speed]
B4 --> E[High Accuracy\nHigh Cost]
C1 --> F[Moderate Accuracy\nRequires Startup]
G[Higher-Order ODEs] --> H[Convert to System\nSolve as IVP]Based on the TU BSc CSIT syllabus for Numerical Method (CSC212), unit 7.
Discussion
Loading…