HOME

TheInfoList



OR:

In
numerical analysis Numerical analysis is the study of algorithms that use numerical approximation (as opposed to symbolic manipulations) for the problems of mathematical analysis (as distinguished from discrete mathematics). It is the study of numerical methods th ...
and
scientific computing Computational science, also known as scientific computing or scientific computation (SC), is a field in mathematics that uses advanced computing capabilities to understand and solve complex problems. It is an area of science that spans many disc ...
, the trapezoidal rule is a
numerical method In numerical analysis, a numerical method is a mathematical tool designed to solve numerical problems. The implementation of a numerical method with an appropriate convergence check in a programming language is called a numerical algorithm. Mathem ...
to solve
ordinary differential equations In mathematics, an ordinary differential equation (ODE) is a differential equation whose unknown(s) consists of one (or more) function(s) of one variable and involves the derivatives of those functions. The term ''ordinary'' is used in contras ...
derived from the
trapezoidal rule In calculus, the trapezoidal rule (also known as the trapezoid rule or trapezium rule; see Trapezoid for more information on terminology) is a technique for approximating the definite integral. \int_a^b f(x) \, dx. The trapezoidal rule works b ...
for computing integrals. The trapezoidal rule is an implicit second-order method, which can be considered as both a Runge–Kutta method and a
linear multistep method Linear multistep methods are used for the numerical solution of ordinary differential equations. Conceptually, a numerical method starts from an initial point and then takes a short step forward in time to find the next solution point. The proce ...
.


Method

Suppose that we want to solve the differential equation : y' = f(t,y). The trapezoidal rule is given by the formula : y_ = y_n + \tfrac12 h \Big( f(t_n,y_n) + f(t_,y_) \Big), where h = t_ - t_n is the step size. This is an implicit method: the value y_ appears on both sides of the equation, and to actually calculate it, we have to solve an equation which will usually be nonlinear. One possible method for solving this equation is
Newton's method In numerical analysis, Newton's method, also known as the Newton–Raphson method, named after Isaac Newton and Joseph Raphson, is a root-finding algorithm which produces successively better approximations to the roots (or zeroes) of a real ...
. We can use 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 m ...
to get a fairly good estimate for the solution, which can be used as the initial guess of Newton's method. Cutting short, using only the guess from Eulers method is equivalent to performing Heun's method.


Motivation

Integrating the differential equation from t_n to t_ , we find that : y(t_) - y(t_n) = \int_^ f(t,y(t)) \,\mathrmt. The
trapezoidal rule In calculus, the trapezoidal rule (also known as the trapezoid rule or trapezium rule; see Trapezoid for more information on terminology) is a technique for approximating the definite integral. \int_a^b f(x) \, dx. The trapezoidal rule works b ...
states that the integral on the right-hand side can be approximated as : \int_^ f(t,y(t)) \,\mathrmt \approx \tfrac12 h \Big( f(t_n,y(t_n)) + f(t_,y(t_)) \Big). Now combine both formulas and use that y_n \approx y(t_n) and y_ \approx y(t_) to get the trapezoidal rule for solving ordinary differential equations.


Error analysis

It follows from the error analysis of the trapezoidal rule for quadrature that the
local truncation error Truncation errors in numerical integration are of two kinds: * ''local truncation errors'' – the error caused by one iteration, and * ''global truncation errors'' – the cumulative error caused by many iterations. Definitions Suppose we have ...
\tau_n of the trapezoidal rule for solving differential equations can be bounded as: : , \tau_n, \le \tfrac1 h^3 \max_t , y(t), . Thus, the trapezoidal rule is a second-order method. This result can be used to show that the global error is O(h^2) as the step size h tends to zero (see big O notation for the meaning of this).


Stability

The region of absolute stability for the trapezoidal rule is : \. This includes the left-half plane, so the trapezoidal rule is A-stable. The second Dahlquist barrier states that the trapezoidal rule is the most accurate amongst the A-stable linear multistep methods. More precisely, a linear multistep method that is A-stable has at most order two, and the error constant of a second-order A-stable linear multistep method cannot be better than the error constant of the trapezoidal rule. In fact, the region of absolute stability for the trapezoidal rule is precisely the left-half plane. This means that if the trapezoidal rule is applied to the linear test equation ''y = λ''y'', the numerical solution decays to zero if and only if the exact solution does.


Notes


References

* . * .


See also

*
Crank–Nicolson method In numerical analysis, the Crank–Nicolson method is a finite difference method used for numerically solving the heat equation and similar partial differential equations. It is a second-order method in time. It is implicit in time, can be wri ...
{{Numerical integrators Runge–Kutta methods