Midpoint Method
   HOME

TheInfoList



OR:

In
numerical analysis Numerical analysis is the study of algorithms that use numerical approximation (as opposed to symbolic computation, symbolic manipulations) for the problems of mathematical analysis (as distinguished from discrete mathematics). It is the study of ...
, a branch of
applied mathematics Applied mathematics is the application of mathematical methods by different fields such as physics, engineering, medicine, biology, finance, business, computer science, and industry. Thus, applied mathematics is a combination of mathematical s ...
, the midpoint method is a one-step method for numerically solving the
differential equation In mathematics, a differential equation is an equation that relates one or more unknown functions and their derivatives. In applications, the functions generally represent physical quantities, the derivatives represent their rates of change, an ...
, : y'(t) = f(t, y(t)), \quad y(t_0) = y_0 . The explicit midpoint method is given by the formula the implicit midpoint method by for n=0, 1, 2, \dots Here, h is the ''step size'' — a small positive number, t_n=t_0 + n h, and y_n is the computed approximate value of y(t_n). The explicit midpoint method is sometimes also known as the modified Euler method, the implicit method is the most simple
collocation method In mathematics, a collocation method is a method for the numerical solution of ordinary differential equations, partial differential equations and integral equations. The idea is to choose a finite-dimensional space of candidate solutions (usually ...
, and, applied to Hamiltonian dynamics, a
symplectic integrator In mathematics, a symplectic integrator (SI) is a numerical integration scheme for Hamiltonian systems. Symplectic integrators form the subclass of geometric integrators which, by definition, are canonical transformations. They are widely used in n ...
. Note that the modified Euler method can refer to
Heun's method In mathematics and computational science, Heun's method may refer to the improved or modified Euler's method (that is, the explicit trapezoidal rule), or a similar two-stage Runge–Kutta method. It is named after Karl Heun and is a numerical p ...
, for further clarity see
List of Runge–Kutta methods Runge–Kutta methods are methods for the numerical solution of the ordinary differential equation :\frac = f(t, y). Explicit Runge–Kutta methods take the form :\begin y_ &= y_n + h \sum_^s b_i k_i \\ k_1 &= f(t_n, y_n), \\ k_2 &= f(t_n+c_2h ...
. The name of the method comes from the fact that in the formula above, the function f giving the slope of the solution is evaluated at t = t_n + h/2= \tfrac, the midpoint between t_n at which the value of y(t) is known and t_ at which the value of y(t) needs to be found. A geometric interpretation may give a better intuitive understanding of the method (see figure at right). In the basic
Euler's method In mathematics and computational science, the Euler method (also called forward Euler method) is a first-order numerical procedure for solving ordinary differential equations (ODEs) with a given initial value. It is the most basic explicit met ...
, the tangent of the curve at (t_n, y_n) is computed using f(t_n, y_n). The next value y_ is found where the tangent intersects the vertical line t=t_. However, if the second derivative is only positive between t_n and t_, or only negative (as in the diagram), the curve will increasingly veer away from the tangent, leading to larger errors as h increases. The diagram illustrates that the tangent at the midpoint (upper, green line segment) would most likely give a more accurate approximation of the curve in that interval. However, this midpoint tangent could not be accurately calculated because we do not know the curve (that is what is to be calculated). Instead, this tangent is estimated by using the original Euler's method to estimate the value of y(t) at the midpoint, then computing the slope of the tangent with f(). Finally, the improved tangent is used to calculate the value of y_ from y_n. This last step is represented by the red chord in the diagram. Note that the red chord is not exactly parallel to the green segment (the true tangent), due to the error in estimating the value of y(t) at the midpoint. The local error at each step of the midpoint method is of order O\left(h^3\right), giving a global error of order O\left(h^2\right). Thus, while more computationally intensive than Euler's method, the midpoint method's error generally decreases faster as h \to 0. The methods are examples of a class of higher-order methods known as
Runge–Kutta methods In numerical analysis, the Runge–Kutta methods ( ) are a family of implicit and explicit iterative methods, which include the Euler method, used in temporal discretization for the approximate solutions of simultaneous nonlinear equations. The ...
.


Derivation of the midpoint method

The midpoint method is a refinement of the Euler's method : y_ = y_n + hf(t_n,y_n),\, and is derived in a similar manner. The key to deriving Euler's method is the approximate equality which is obtained from the slope formula and keeping in mind that y' = f(t, y). For the midpoint methods, one replaces (3) with the more accurate : y'\left(t+\frac\right) \approx \frac when instead of (2) we find One cannot use this equation to find y(t+h) as one does not know y at t+h/2. The solution is then to use a
Taylor series In mathematics, the Taylor series or Taylor expansion of a function is an infinite sum of terms that are expressed in terms of the function's derivatives at a single point. For most common functions, the function and the sum of its Taylor serie ...
expansion exactly as if using the
Euler method In mathematics and computational science, the Euler method (also called forward Euler method) is a first-order numerical procedure for solving ordinary differential equations (ODEs) with a given initial value. It is the most basic explicit met ...
to solve for y(t+h/2): :y\left(t + \frac\right) \approx y(t) + \fracy'(t)=y(t) + \fracf(t, y(t)), which, when plugged in (4), gives us :y(t + h) \approx y(t) + hf\left(t + \frac, y(t) + \fracf(t, y(t))\right) and the explicit midpoint method (1e). The implicit method (1i) is obtained by approximating the value at the half step t+h/2 by the midpoint of the line segment from y(t) to y(t+h) :y\left(t+\frac h2\right)\approx \frac12\bigl(y(t)+y(t+h)\bigr) and thus :\frac\approx y'\left(t+\frac h2\right)\approx k=f\left(t+\frac h2,\frac12\bigl(y(t)+y(t+h)\bigr)\right) Inserting the approximation y_n+h\,k for y(t_n+h) results in the implicit Runge-Kutta method :\begin k&=f\left(t_n+\frac h2,y_n+\frac h2 k\right)\\ y_&=y_n+h\,k \end which contains the implicit Euler method with step size h/2 as its first part. Because of the time symmetry of the implicit method, all terms of even degree in h of the local error cancel, so that the local error is automatically of order \mathcal O(h^3). Replacing the implicit with the explicit Euler method in the determination of k results again in the explicit midpoint method.


See also

*
Rectangle method In mathematics, a Riemann sum is a certain kind of approximation of an integral by a finite sum. It is named after nineteenth century German mathematician Bernhard Riemann. One very common application is approximating the area of functions or lin ...
*
Heun's method In mathematics and computational science, Heun's method may refer to the improved or modified Euler's method (that is, the explicit trapezoidal rule), or a similar two-stage Runge–Kutta method. It is named after Karl Heun and is a numerical p ...
*
Leapfrog integration In numerical analysis, leapfrog integration is a method for numerically integrating differential equations of the form \ddot x = \frac = A(x), or equivalently of the form \dot v = \frac = A(x), \;\dot x = \frac = v, particularly in the case of a d ...
and
Verlet integration Verlet integration () is a numerical method used to integrate Newton's equations of motion. It is frequently used to calculate trajectories of particles in molecular dynamics simulations and computer graphics. The algorithm was first used in 1791 ...


Notes


References

* * . * {{Numerical integrators Numerical differential equations Runge–Kutta methods