Ordinary Differential Equations - Examples & Applications

This section provides practical examples of numerical methods for solving ordinary differential equations (ODEs), including single-step methods (Euler, Heun, RK), multistep methods, systems of ODEs, and boundary-value/eigenvalue problems.

Euler's Method

Euler's method is the simplest one-step method for solving ODEs. It uses the slope at the beginning of the interval to predict the value at the end of the interval.

Basic: Euler's Method

Use Euler's method to numerically integrate y=2x3+12x220x+8.5y' = -2x^3 + 12x^2 - 20x + 8.5 from x=0x = 0 to x=0.5x = 0.5 with a step size of h=0.5h = 0.5. The initial condition at x=0x = 0 is y=1y = 1. The exact solution at x=0.5x = 0.5 is 3.218753.21875.

Step-by-Step Solution

0 of 3 Steps Completed
1

Heun's Method (Predictor-Corrector)

Heun's method improves upon Euler's method by determining an average slope for the interval, evaluating the derivative at both the beginning and the predicted end of the interval.

Intermediate: Heun's Method without Iteration

Use Heun's method to integrate y=2x3+12x220x+8.5y' = -2x^3 + 12x^2 - 20x + 8.5 from x=0x = 0 to x=0.5x = 0.5 using h=0.5h = 0.5. Initial condition: y(0)=1y(0) = 1. True value is 3.218753.21875.

Step-by-Step Solution

0 of 4 Steps Completed
1

Runge-Kutta Methods

Runge-Kutta (RK) methods achieve the accuracy of higher-order Taylor series approaches without requiring the calculation of higher derivatives. The fourth-order RK method is the most widely used.

Advanced: Fourth-Order Runge-Kutta (RK4)

Use the classic fourth-order Runge-Kutta method to integrate y=4e0.8x0.5yy' = 4e^{0.8x} - 0.5y from x=0x = 0 to x=0.5x = 0.5 using h=0.5h = 0.5. Initial condition: y(0)=2y(0) = 2. The true value is 3.7515213.751521.

Step-by-Step Solution

0 of 6 Steps Completed
1

Multistep Methods

Unlike one-step methods (like RK) that only use information from the immediate previous point, multistep methods (like Adams-Bashforth) use information from several previous points to predict the next point.

Advanced: Non-Self-Starting Heun's Method

Assume you have solved an ODE for the first few steps using RK4 and have the points (x0,y0),(x1,y1),(x2,y2)(x_0, y_0), (x_1, y_1), (x_2, y_2). Formulate the predictor equation for y3y_3 using the open multistep method (Adams-Bashforth) combined with Heun's approach.

Step-by-Step Solution

0 of 1 Steps Completed
1

Systems of ODEs

To solve higher-order ODEs, they are first converted into a system of first-order ODEs.

Intermediate: Converting a 2nd-Order ODE

Convert the second-order unforced damped spring-mass equation md2xdt2+cdxdt+kx=0m \frac{d^2x}{dt^2} + c \frac{dx}{dt} + kx = 0 into a system of first-order ODEs.

Step-by-Step Solution

0 of 2 Steps Completed
1

Stiffness

Stiff ODEs involve rapidly changing components coupled with slowly changing ones. Standard explicit methods require extremely small step sizes to remain stable, making implicit methods necessary.

Case Study: A Stiff ODE

Consider the equation dydt=1000y+30002000et\frac{dy}{dt} = -1000y + 3000 - 2000e^{-t}. Analyze why this is a stiff equation and the implications for using an explicit method like Euler's method.

Step-by-Step Solution

0 of 2 Steps Completed
1

Boundary-Value Problems

Boundary-value problems (BVPs) involve conditions specified at different values of the independent variable (usually the boundaries of the domain), unlike initial-value problems where all conditions are known at t=0t=0.

Advanced: Finite Difference Method for a BVP

A 10 m10 \text{ m} long heated rod is described by d2Tdx2+h(TaT)=0\frac{d^2T}{dx^2} + h'(T_a - T) = 0. Given h=0.01 m2h' = 0.01 \text{ m}^{-2}, ambient temperature Ta=20CT_a = 20^\circ\text{C}, T(0)=40CT(0) = 40^\circ\text{C}, and T(10)=200CT(10) = 200^\circ\text{C}. Use the finite difference method with a step size Δx=2 m\Delta x = 2 \text{ m} to set up the linear equations for the interior nodes.

Step-by-Step Solution

0 of 3 Steps Completed
1

Eigenvalue Problems

Eigenvalue problems are a special class of boundary-value problems where the solution involves determining the characteristic roots (eigenvalues) that allow non-trivial solutions to exist.

Advanced: Polynomial Method for Eigenvalues

Find the eigenvalues of the matrix:
A=[105510]A = \begin{bmatrix} 10 & -5 \\ -5 & 10 \end{bmatrix}

Step-by-Step Solution

0 of 2 Steps Completed
1