2
$\begingroup$

I have encountered a piece of code that performs a physics simulation of a moving projectile. I'm trying to understand what the mathematical basis is for a bit that looks like this:

$$ d_1 = f(x) $$ $$ d_2 = f(x + \frac{d_1}{2}) $$ $$ d_3 = f(x + \frac{d_2}{2}) $$ $$ d_4 = f(x + d_3) $$ $$ d = \frac{d_1 + 2 \cdot d_2 + 2 \cdot d_3 + d_4}{6} $$

What is the name of this mathematical concept? It's obviously some sort of weighted average. The code uses real-world measured values, so it might be related to probability. This type of thing is hard to Google.

$\endgroup$
1
  • $\begingroup$ It reminds me of a numerical ODE solver. It's similar to, but not quite the same as, a fourth-order Runge-Kutta method. $\endgroup$ Commented Feb 28, 2013 at 7:11

1 Answer 1

5
$\begingroup$

It's precisely the fourth-order Runge-Kutta method applied to the ordinary differential equation $\dfrac{\mathrm dx}{\mathrm dt}=f(x)$ with step size $h=1$.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .