All courses › Numerical Methods

Numerical Methods: free practice, theory and problems

Many practical engineering equations, such as arising from pipe friction, beam stresses or equilibrium points in a process, have no simple formula for the solution. Numerical methods find an approximate root by guessing, checking and gradually improving the guess. The goal is always the same: a number where , within a given tolerance.

3 parts43 problems12 concepts explainedPractice examFree
Start practising for free →

Contents

  1. Solving equations
  2. Interpolation and integration
  3. Differential equations and stability

1. Solving equations

What is it about?

Many practical engineering equations, such as f(x)=0f(x) = 0 arising from pipe friction, beam stresses or equilibrium points in a process, have no simple formula for the solution. Numerical methods find an approximate root by guessing, checking and gradually improving the guess. The goal is always the same: a number x∗x^* where f(x∗)≈0f(x^*) \approx 0, within a given tolerance.

Concepts and formulas

How to solve the problems

  1. Check what is given: an interval (bisection), a function and one starting point with the derivative (Newton), two starting points (secant), or a g(x)g(x) (fixed point).
  2. Evaluate ff (and f′f' if needed) at the required points.
  3. Use the correct update formula and find the next value.
  4. Repeat until the change is smaller than the tolerance, or the desired number of steps is reached.

Example

Find a root of f(x)=x2−3f(x) = x^2 - 3 with Newton's method, starting from x0=2x_0 = 2.

  1. f(x)=x2−3f(x) = x^2-3 and f′(x)=2xf'(x)=2x.
  2. Step 1: x1=x0−f(x0)f′(x0)=2−4−34=2−0.25=1.75x_1 = x_0 - \dfrac{f(x_0)}{f'(x_0)} = 2 - \dfrac{4-3}{4} = 2 - 0.25 = 1.75.
  3. Step 2: f(1.75)=1.752−3=0.0625f(1.75)=1.75^2-3=0.0625 and f′(1.75)=3.5f'(1.75)=3.5, so x2=1.75−0.0625/3.5≈1.7321x_2 = 1.75 - 0.0625/3.5 \approx 1.7321.

The answer quickly approaches 3≈1.7321\sqrt3 \approx 1.7321, typical for quadratic convergence.

Common mistakes

Bisection is the slowest method but always safe. Newton is the fastest, but needs a good starting guess and the derivative.

Concepts in this part

Practise solving equations in the app →

2. Interpolation and integration

What is it about?

Often you only have a few known points – from a table, a sensor or a calculation – and need a value between them, or the area under a curve you cannot integrate by hand. Interpolation builds a function that passes exactly through the known points, while numerical integration approximates a definite integral by summing the area of simple shapes (rectangles, trapezoids, parabolas).

Concepts and formulas

How to solve the problems

  1. Check what is asked for: an in-between value (interpolation) or an area/integral (quadrature).
  2. For interpolation: set up the right formula (linear for 2 points, Lagrange/quadratic for 3).
  3. For integration: find hh, evaluate the function at every point, and use the correct weighted sum.
  4. Check whether the method is exact for that type of function (e.g. Simpson is exact for a cubic polynomial).

Example

Interpolate quadratically through (0,0)(0,0), (1,1)(1,1) and (2,4)(2,4) (i.e. y=x2y=x^2). Find yy at x=1.5x=1.5 with Lagrange's formula.

L0=(x−1)(x−2)(0−1)(0−2),  L1=(x−0)(x−2)(1−0)(1−2),  L2=(x−0)(x−1)(2−0)(2−1)L_0=\dfrac{(x-1)(x-2)}{(0-1)(0-2)},\ \ L_1=\dfrac{(x-0)(x-2)}{(1-0)(1-2)},\ \ L_2=\dfrac{(x-0)(x-1)}{(2-0)(2-1)}

At x=1.5x=1.5: L0=−0.125L_0=-0.125, L1=0.75L_1=0.75 and L2=0.375L_2=0.375. Then y=0⋅L0+1⋅L1+4⋅L2=0.75+1.5=2.25y = 0\cdot L_0 + 1\cdot L_1 + 4\cdot L_2 = 0.75+1.5 = 2.25, exactly like 1.521.5^2.

Common mistakes

More, evenly spaced points generally improve interpolation and integration – but a high degree with evenly spaced points can cause oscillations (Runge's phenomenon). Simpson's rule is almost always better than the trapezoidal rule for the same number of points.

Concepts in this part

Practise interpolation and integration in the app →

3. Differential equations and stability

What is it about?

Many physical processes (cooling, electrical circuits, chemical reactions, mechanical vibrations) are described by differential equations with no simple formula for the solution. Numerical solvers build the solution step by step: given yy at time tt, they compute an approximation of yy at t+ht+h. As an engineer you use this to simulate systems over time, for example the temperature in an engine or the current in a circuit.

Concepts and formulas

How to solve the problems

  1. Identify f(t,y)f(t,y), the initial value and the step size hh.
  2. Choose the right method based on what the problem asks for (Euler, Heun, RK4 or implicit).
  3. Compute one step at a time, using the result of the previous step as the starting point for the next.
  4. For stability: form ∣1+hλ∣|1+h\lambda| (explicit Euler) and compare it with 1.

Example

Solve y′=−2yy'=-2y, y(0)=5y(0)=5, with one step of Heun's method and h=0.5h=0.5.

  1. f(t,y)=−2yf(t,y)=-2y, so f(t0,y0)=−2⋅5=−10f(t_0,y_0)=-2\cdot5=-10.
  2. Predictor: yp=5+0.5⋅(−10)=0y_p = 5 + 0.5\cdot(-10) = 0.
  3. Corrector: f(t1,yp)=−2⋅0=0f(t_1,y_p)=-2\cdot 0=0, so y1=5+0.52(−10+0)=5−2.5=2.5y_1 = 5 + \dfrac{0.5}{2}(-10+0) = 5-2.5=2.5.

For comparison, explicit Euler gives y1=5+0.5⋅(−10)=0y_1=5+0.5\cdot(-10)=0 – Heun's method is more accurate because it uses the average of two slopes.

Common mistakes

Higher order means more accuracy per step – but implicit methods win on stability, not accuracy, and are therefore best for stiff problems.

Concepts in this part

Practise differential equations and stability in the app →

Example problems with solutions

Here are some of the problems in numerical Methods. In the app, calculation problems get new numbers every time, so you can practise until it sticks – and take a graded practice exam before the real one.

Solving equations: By how much is the uncertainty reduced in each step of the bisection method?

Answer: It is halved

The method is robust but slow (linear convergence).

Interpolation and integration: Which polynomials does Simpson's rule integrate exactly?

Answer: Up to degree 3

It is based on parabolas but gets one degree "for free".

Differential equations and stability: What is the order of the explicit Euler method?

Answer: 1

Global error O(h)O(h).

Solving equations: What is the order of convergence of Newton's method near a simple root?

Answer: Quadratic

The number of correct digits roughly doubles with each step.

Practise all the problems →

Matches these university courses

The content covers the syllabus found in engineering degrees, for example: