The Problems with Simulations

Published: April 28, 2025

Introduction

In modern times, when almost everyone has access to extremely powerful computational tools, numerical analysis seems more and more convincing. In this post, I will attempt to discuss its limitations, especially when considering practical scenarios.

Types of Problems

Modeling Errors

Modeling errors appear when the model is not well understood, when the processes governing the problem are analyzed in a simplified form, or when the domain is poorly selected. Sometimes, additional important factors are simply not accounted for. This might be the most critical error type — it can drastically change the simulation outcome.

While it is usually impossible to perfectly describe any model, it might still be possible to limit how much the results are affected. Let's consider a theoretical model for the Wirtz pump I developed — it assumed a static, frictionless setup! Of course, the friction of liquid is minimal, but still real. Considering rotation would have allowed a more dynamic and realistic approach, especially for pumps that aren't fully capillary. Due to these simplifications, the initial model proved to be quite inaccurate.

Numerical Errors

Two main types of numerical errors are usually considered:

1. Round-off Error

The round-off error arises when an algorithm with finite precision evaluates an arithmetic expression. Let's take \( \frac{1}{3} \) as an example. To us, it's obviously \( 0.\overline{3} \), but to an algorithm, due to limited precision, it might be represented as \( 0.333333 \). Calculating the difference, we get \( 0.00000003\overline{3} \) — tiny, but significant when scaled up.

A tragic real-world example is the failure of a Patriot missile system during the Gulf War, resulting in the deaths of 28 Americans. The system miscalculated the distance to an incoming Scud missile by over 500 meters. The cause? Time tracking every 0.1 seconds stored in a 24-bit register, which couldn't perfectly represent 0.1 in binary.

The stored approximation was:

$$ E = \frac{1}{10} - \frac{209715}{2097152} = 9.537 \times 10^{-8} $$

After about 100 hours of continuous operation, the time error accumulated to:

$$ \Delta t = E \times t = 0.3433 \text{ seconds} $$

This slight timing offset was enough to miscalculate the missile's position and miss the interception entirely.

2. Truncation Error

Truncation error appears when algorithms approximate mathematical functions. A classic example is the Maclaurin series for \( e^x \):

$$ e^x = 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \dotsc $$

Approximating \( e^x \) using only the first four terms can cause large errors. The more terms we include, the smaller the error — but it never becomes exactly zero.

Another example involves numerical integration:

$$ \int_0^2 x^2 \, dx $$

The exact solution is:

$$ \int x^2 \, dx = \frac{x^3}{3} + C $$ $$ \left. \frac{x^3}{3} \right|_0^2 = \frac{8}{3} $$

Using a left-hand Riemann sum with two rectangles:

$$ f(0) \times 1 + f(1) \times 1 = (0^2) \times 1 + (1^2) \times 1 = 1 $$

The resulting truncation error is:

$$ E = \frac{8}{3} - 1 = \frac{5}{3} $$

— clearly quite large.

Experimental Errors

When measuring real-world phenomena, it is impossible to obtain perfectly exact results. There is always some measurement uncertainty. Noise, environmental influences, and human mistakes all introduce small but real variations into the data.

For example, when measuring an object's weight on a very precise scale, uncertainties arise from air currents, electromagnetic noise, gravitational variations, and even thermal radiation — not just from the instrument itself.

Summary

While it might never be possible to eliminate all errors, we can — and should — minimize them as much as possible. I think the limitations of numerical simulations are a fascinating topic, with much left to explore and improve.