In this method the approximate formula used for
obtaining x_i+1 from x_i is made to coincide with Taylor’s series expansion of
x and x_i+1 up to terms of order (∆t)^n. The Taylor’s series expansion of x(t)
at t+∆t is given by:
The previous equation requires higher-order
derivatives while Runge-Kutta requires only first derivative and not higher
than that. In order to solve the equation
we need to reduce it to two first-order equations. But
before we start to implement R-K method let’s rearrange previous second-order
differential equation:
$$\begin{align}
& m\ddot{x}=F-c\dot{x}-kx \\
& \ddot{x}=\frac{1}{m}\left[ F-c\dot{x}-kx \right]=f\left( x,\dot{x},t \right) \\
\end{align}$$
Now we can define
and then we can write previously rearranged second
order differential equation in the following form.
The following recurrence formula is used to find
values of X(t) at different grid points t_i according to the fourth order
Runge-Kutta method.
$${{\vec{X}}_{i+1}}={{\vec{X}}_{i}}+\frac{1}{6}\left[ {{{\vec{K}}}_{1}}+2{{{\vec{K}}}_{2}}+2{{{\vec{K}}}_{3}}+{{{\vec{K}}}_{4}} \right]$$
Where:
Nema komentara:
Objavi komentar