5 Solution Of Ordinary Differential Equations

Numerical Method · Unit 5 · 8 hrs

Solution of Ordinary Differential Equations

Exam-focused notes for Solution of Ordinary Differential Equations (Numerical Method, CSC212): what the TU syllabus asks and how it has actually been tested, with 12 solved past questions from this unit.

What this unit covers

  • Review of differential equations
  • Initial value problem
  • Taylor series method
  • Picard's method
  • Euler's method and its accuracy
  • Heun's method
  • Runge-Kutta methods
  • Solving System of ordinary differential equations
  • Solution of the higher order equations
  • Boundary value problems
  • Shooting method and its algorithm

Review of differential equations

20815 marks

What is differential equation? Differentiate between ODE and PDE with example. [5]

An equation which uses differential calculus to express relationship between variables is known as a differential equation. In other words, a differential equation is an equation that contains one or more derivatives of a dependent variable with respect to ...

Full solved answer →

Runge-Kutta methods

20815 marks

Solve $\frac{dy}{dx} = \frac{x}{y}$, $y(0) = 1$, at $x = 0.4$ using Runge-Kutta's 4th order method. [5]

$$\frac{dy}{dx} = f(x,y) = \frac{x}{y}, \quad y0 = 1 \text{ at } x0 = 0, \quad \text{find } y(0.4)$$ Step size: $h = 0.4$ (single step). $$k1 = h f(x0, y0)$$ $$k2 = h f\left(x0+\tfrac{h}{2}, y0+\tfrac{k1}{2}\right)$$ $$k3 = h f\left(x0+\tfrac{h}{2}, y0+\tfr...

Full solved answer →
20795 marks

Solve the following differential equation for $0 \leq x \leq 1$ taking $h = 0.5$ using Runge Kutta 4th order method.

$$y'(x) + y = 3x \quad \text{with} \quad y(0) = 2$$

[5]

- ODE: $y'(x) + y = 3x \Rightarrow y' = f(x,y) = 3x - y$ - Initial condition: $y(0) = 2$ - Step size: $h = 0.5$ - Interval: $0 \le x \le 1$ - Number of steps: 2 (from $x=0$ to $x=1$) $$k1 = h\,f(xn, yn), \quad k2 = h\,f\left(xn+\tfrac{h}{2}, yn+\tfrac{k1}{2...

Full solved answer →
20755 marks

From the following differential equation estimate y(1) using RK 4th order method.

$$\frac{dy}{dx} + 2x^2y = 4 \quad \text{with} \quad y(0) = 1$$

[Take $h = 0.5$] [5]

- ODE: $\dfrac{dy}{dx} + 2x^2 y = 4 \Rightarrow \dfrac{dy}{dx} = 4 - 2x^2 y = f(x,y)$ - Initial condition: $x0 = 0,\ y0 = 1$ - Step size: $h = 0.5$ - Target: $y(1)$ → requires 2 steps ($0 \to 0.5 \to 1.0$) RK4 formulas: $$y{n+1} = yn + \tfrac{h}{6}(k1 + 2k2...

Full solved answer →

Taylor series method

20805 marks

Approximate the solution of $y' = 3x^2$, $y(1) = 1$ using Taylor's series method using first four terms. Approximate the value of $y(2)$.

$$y' = 3x^2, \quad y(1) = 1$$

[5]

- ODE: $y' = 3x^2$ - Initial condition: $y(1) = 1$, so $x0 = 1$, $y0 = 1$ - Target: $y(2)$ using first four terms of Taylor's series - Step: $h = x - x0 = 2 - 1 = 1$ $$y(x) = y(x0) + (x-x0)\frac{y'(x0)}{1!} + (x-x0)^2\frac{y''(x0)}{2!} + (x-x0)^3\frac{y'''(...

Full solved answer →

Heun's method

20805 marks

Write down the program for solving ordinary differential equation using Heun's method. [5]

Heun's method is a predictor-corrector method (also called the improved Euler's method) for solving ODEs of the form: $$\frac{dy}{dx} = f(x, y), \quad y(x0) = y0$$ The core formula is: $$y{n+1} = yn + \frac{h}{2}(m1 + m2)$$ Where: - $m1 = f(xn,\ yn)$ (slope...

Full solved answer →
20795 marks

Write down the program for solving ordinary differential equation using Heun's method. [5]

Heun's method is a predictor-corrector method (also called the improved Euler's method) for solving ODEs of the form: $$\frac{dy}{dx} = f(x, y), \quad y(x0) = y0$$ The formula is: $$y{n+1} = yn + \frac{h}{2}(m1 + m2)$$ Where: - $m1 = f(xn, yn)$ (slope at th...

Full solved answer →
20785 marks

Solve the following differential equation for $1 \leq x \leq 2$, taking $h = 0.25$ using Heun’s method. $y'(x) + x^2y = 3x$, with $y(1) = 1$. [5]

- ODE: $y'(x) + x^2 y = 3x$, so $y'(x) = 3x - x^2 y = f(x,y)$ - Initial condition: $y(1) = 1$ - Step size: $h = 0.25$ - Interval: $1 \le x \le 2$ - Number of steps: $(2-1)/0.25 = 4$ $$y{i+1} = yi + \frac{h}{2}(m1 + m2)$$ where $m1 = f(xi, yi)$ and $m2 = f(x...

Full solved answer →

Solution of the higher order equations

207810 marks

Higher-Order Differential Equations

A higher-order differential equation is a differential equation in which the highest derivative of the dependent variable is of order two or more. The given equation $$\frac{d^2y}{dx^2} + 3\frac{dy}{dx} + 5y = 0$$ is a second-order ODE (highest derivative i...

Full solved answer →

Euler's method and its accuracy

20775 marks

Approximate the solution of $y' = 2x + y$, $y(0) = 1$ using Euler's method with step size 0.1. Approximate the value of $y(0.4)$. [5]

- ODE: $y' = f(x,y) = 2x + y$ - Initial condition: $y(0) = 1$, so $x0 = 0$, $y0 = 1$ - Step size: $h = 0.1$ - Target: $y(0.4)$ (requires 4 steps) $$y{n+1} = yn + h \cdot f(xn, yn), \qquad f(xn,yn) = 2xn + yn$$ Step 1: $x0 = 0,\ y0 = 1$ $$f(0, 1) = 2(0) + 1 ...

Full solved answer →

Shooting method and its algorithm

20775 marks

How boundary value problems differs from initial value problems? Discuss shooting method for solving boundary value problem. [5]

Aspect Initial Value Problem (IVP) Boundary Value Problem (BVP) --------- Conditions All conditions are specified at a single point (initial point) Conditions are specified at two or more different points (boundaries) Solution approach Can be solved by marc...

Full solved answer →
207510 marks

What is initial value problem and boundary value problem? Write an algorithm and program to solve the boundary value problem using shooting method.[10]

An Initial Value Problem is a differential equation in which all the conditions (values of the dependent variable and its derivatives) are specified at a single point (the initial point). General Form: Here, the value of y is known at x = x₀. The solution i...

Full solved answer →