Added rungen kutta to documentation
authorsaiam
Mon, 08 Dec 2008 23:44:45 +0000
changeset 331 65e104a2db8f
parent 330 dcc47278e5ab
child 332 78657bf06302
Added rungen kutta to documentation
doc/kishna.tex
--- a/doc/kishna.tex	Mon Dec 08 23:42:40 2008 +0000
+++ b/doc/kishna.tex	Mon Dec 08 23:44:45 2008 +0000
@@ -2,6 +2,7 @@
 
 \usepackage[utf8]{inputenc}
 \usepackage[english]{babel}
+\usepackage{amsmath}
 \usepackage{listings} % For listing code
 
 % Fancy headers
@@ -160,8 +161,26 @@
 our game the Runge-Kutta method is used to calculate positions and
 velocities of physics objects when we apply forces to them.
 
-% TODO: Here we could write the runge kutta method mathematically
-% (copy paste from wikipedia or something)
+The mathematical formulation of the Runge-Kutta method:
+If we have an initial value problem of the form
+\begin{equation}
+y' = f(t, y), \quad y(t_0) = y_0.
+\end{equation}
+The we can describe the RK4 method for this problem by equations
+\begin{align}
+y_{n+1} &= y_n + \tfrac{1}{6}h\left(k_1 + 2k_2 + 2k_3 + k_4 \right) \\
+t_{n+1} &= t_n + h \\
+\end{align}
+where $y_{n+1}$ is the RK4 approximation of $y(t_{n+1})$, and
+\begin{align}
+k_1 &= f(t_n, y_n) \\
+k_2 &= f(t_n + \tfrac{1}{2}h, y_n + \tfrac{1}{2}h k_1) \\
+k_3 &= f(t_n + \tfrac{1}{2}h, y_n + \tfrac{1}{2}h k_2) \\
+k_4 &= f(t_n + h, y_n + h k_3) \\
+\end{align}
+The next value $(y_n+1)$ is determined by the present value $(y_n)$,
+the product of the interval $(h)$ and an estimated slope that is
+defined as $\frac{1}{6}h\left(k_1+2k_2+2k_3+k_4\right)$.
 
 something network related?