To come in
Sewerage and drainpipes portal
  • Dried fruit sweets "Energy koloboks"
  • Raspberry grated with sugar: tasty and healthy
  • Alexey Pleshcheev: biography
  • How to preserve apple juice
  • Cabbage salad with carrots like in a dining room - the best recipes from childhood
  • An even complexion without foundation!
  • Simpson's method for computation. Start in science

    Simpson's method for computation. Start in science

    To find a definite integral by the trapezoid method, the area of \u200b\u200ba curvilinear trapezoid is also divided into n rectangular trapezoids with heights h and bases y 1, y 2, y 3, .. y n, where n is the number of the rectangular trapezoid. The integral will be numerically equal to the sum of the areas of rectangular trapezoids (Figure 4).

    Figure: 4

    n - number of partitions

    The error of the trapezoid formula is estimated by the number

    The error in the formula for trapeziums decreases with growth faster than the error in the formula for rectangles. Therefore, the trapezoidal formula is more accurate than the rectangle method.

    Simpson's formula

    If for each pair of segments we construct a polynomial of the second degree, then integrate it on the segment and use the additivity property of the integral, then we obtain the Simpson formula.

    In Simpson's method for calculating a definite integral, the entire integration interval is divided into subintervals of equal length h \u003d (b-a) / n. The number of split segments is an even number. Then, on each pair of adjacent subintervals, the integrand f (x) is replaced by a second-degree Lagrange polynomial (Figure 5).

    Figure: five The function y \u003d f (x) on the segment is replaced by a polynomial of the 2nd order

    Consider the integrand on a segment. We replace this integrand with the second-degree Lagrange interpolation polynomial, which coincides with y \u003d at the points:

    Let's integrate on the segment:

    Let's introduce a change of variables:

    Given the replacement formulas,


    After performing the integration, we get the Simpson formula:

    The value obtained for the integral coincides with the area of \u200b\u200bthe curvilinear trapezoid bounded by the axis, straight lines, and a parabola passing through the points.

    In the parabola formula, the value of the function f (x) at odd points of the partition x 1, x 3, ..., x 2n-1 has a coefficient of 4, at even points x 2, x 4, ..., x 2n-2 - a coefficient 2 and at two boundary points x 0 \u003d a, x n \u003d b - coefficient 1.

    The geometric meaning of Simpson's formula: the area of \u200b\u200ba curvilinear trapezoid under the graph of the function f (x) on a segment is approximately replaced by the sum of the areas of figures lying under the parabolas.

    If the function f (x) has a fourth-order continuous derivative, then the absolute value of the error of the Simpson formula is at most

    where M is the largest value on the segment. Since n 4 grows faster than n 2, the error of the Simpson formula decreases with increasing n much faster than the error of the trapezoid formula.

    We calculate the integral

    This integral is easy to calculate:

    We take n equal to 10, h \u003d 0.1, calculate the values \u200b\u200bof the integrand at the points of the partition, as well as half-integer points.

    According to the formula of the middle rectangles, we get I straight \u003d 0.785606 (the error is 0.027%), according to the trapezoid formula I trap \u003d 0.784981 (the error is about 0.054. When using the method of right and left rectangles, the error is more than 3%.

    To compare the accuracy of the approximate formulas, we calculate again the integral

    but now by Simpson's formula for n \u003d 4. We split the segment into four equal parts by points x 0 \u003d 0, x 1 \u003d 1/4, x 2 \u003d 1/2, x 3 \u003d 3/4, x 4 \u003d 1 and calculate the approximate values \u200b\u200bof the function f (x) \u003d 1 / ( 1 + x) at these points: y 0 \u003d 1.0000, y 1 \u003d 0.8000, y 2 \u003d 0.6667, y 3 \u003d 0.5714, y 4 \u003d 0.5000.

    Using Simpson's formula, we get

    Let us estimate the error of the obtained result. For the integrand f (x) \u003d 1 / (1 + x) we have: f (4) (x) \u003d 24 / (1 + x) 5, whence it follows that on the segment. Therefore, we can take М \u003d 24, and the error of the result does not exceed the value 24 / (2880 4 4) \u003d 0.0004. Comparing the approximate value with the exact one, we conclude that the absolute error of the result obtained by the Simpson formula is less than 0.00011. This is in accordance with the above error estimate and, in addition, indicates that Simpson's formula is much more accurate than the trapezoidal formula. Therefore, the Simpson's formula for the approximate calculation of definite integrals is used more often than the trapezoidal formula.

    In this method, it is proposed to approximate the integrand on a partial segment by a parabola passing through the points
    (x j, f(x j)), where j = i-1; i-0.5; i, that is, the integrand is approximated by the second-degree Lagrange interpolation polynomial:

    After integrating, we get:

    That's what it is simpson's formula or the formula of parabolas. On the segment
    [a, b] Simpson's formula takes the form

    A graphical representation of the Simpson method is shown in Fig. 2.4.

    Figure: 10.4.Simpson Method

    Let's get rid of fractional indices in expression (2.16) by renaming the variables:

    Then Simpson's formula takes the form

    The error of formula (2.18) is estimated by the following expression:

    where h n = b - a,. Thus, the error of the Simpson formula is proportional to O(h 4).

    Comment.It should be noted that, in the Simpson formula, the interval of integration is necessarily divided into even number of intervals.

    10.5. Calculation of definite integrals by methods
    Monte Carlo

    The methods discussed earlier are called deterministic , that is, devoid of the element of chance.

    Monte Carlo methods (MCM) are numerical methods for solving mathematical problems by simulating random variables. MMK allows you to successfully solve mathematical problems due to probabilistic processes. Moreover, when solving problems that are not associated with any probabilities, one can artificially come up with a probabilistic model (and even more than one) that allows solving these problems. Consider the calculation of the definite integral

    When calculating this integral by the rectangle formula, the interval [ a, b] split into N equal intervals, in the middle of which the values \u200b\u200bof the integrand were calculated. By calculating the values \u200b\u200bof the function at random nodes, you can get a more accurate result:

    Here γ i is a random number uniformly distributed over the interval
    ... The error in calculating the integral MCM ~, which is much larger than that of the previously studied deterministic methods.

    In fig. 2.5 shows a graphical implementation of the Monte Carlo method for calculating a single integral with random nodes (2.21) and (2.22).


    (2.23)

    Figure: 10.6.Integration by the Monte Carlo method (2nd case)

    As seen in Fig. 2.6, the integral curve lies in the unit square, and if we are able to obtain pairs of random numbers uniformly distributed over the interval, then the obtained values \u200b\u200b(γ 1, γ 2) can be interpreted as the coordinates of the point in the unit square. Then, if a sufficient number of these pairs of numbers have been obtained, we can approximately assume that
    ... Here SIs the number of pairs of points that fall under the curve, and N - the total number of pairs of numbers.

    Example 2.1. Calculate the following integral:

    The task was solved by various methods. The results are summarized in table. 2.1.

    Table 2.1

    Comment.The choice of the tabular integral allowed us to compare the error of each method and find out the effect of the number of partitions on the accuracy of calculations.

    11 AN APPROXIMATE SOLUTION OF NONLINEAR
    AND TRANSCENDENT EQUATIONS

    The problem arises of the numerical calculation of a definite integral, which can be solved using formulas called quadrature formulas.

    Let us recall the simplest formulas for numerical integration.

    Let's calculate the approximate numerical value. We divide the interval of integration [a, b] into n equal parts by division points
    called nodes of the quadrature formula. Let the nodes know the values
    :


    The quantity

    called the integration interval or step. Note that in the practice of calculations, the number i is chosen small, usually it is not more than 10-20. On a partial interval

    the integrand is replaced by the interpolation polynomial


    which on the considered interval approximately represents the function f (x).

    a) Keep only one first term in the interpolation polynomial, then


    The resulting square formula

    called the rectangle formula.

    b) Keep the first two terms in the interpolation polynomial, then

    (2)

    Formula (2) is called the trapezoidal formula.

    c) Integration interval
    split into an even number 2n equal parts, and the integration step h will be equal to ... On the interval
    of length 2h, we replace the integrand with an interpolation polynomial of degree two, i.e., keep the first three terms in the polynomial:

    The resulting quadrature formula is called Simpson's formula

    (3)

    Formulas (1), (2) and (3) have a simple geometric meaning. In the rectangle formula, the integrand f (x) on the interval
    is replaced by a straight line segment y \u003d yk parallel to the abscissa axis, and in the trapezoid formula - by a straight line segment
    and the area of \u200b\u200ba rectangle and a rectilinear trapezoid is calculated, respectively, which are then summed up. In Simpson's formula, the function f (x) on the interval
    of length 2h is replaced by a square trinomial - a parabola
    the area of \u200b\u200bthe curvilinear parabolic trapezoid is calculated, then the areas are summed up.

    CONCLUSION

    At the end of the work, I would like to note a number of features of the application of the methods discussed above. Each method for an approximate solution of a definite integral has its own advantages and disadvantages, depending on the task at hand, specific methods should be used.

    Variable replacement methodis one of the main methods for calculating indefinite integrals. Even in cases where we integrate by some other method, we often have to resort to changing variables in intermediate calculations. The success of the integration depends to a large extent on whether we can find such a successful change of variables that would simplify the given integral.

    In essence, the study of integration methods is reduced to finding out what kind of change of variable should be done for one form or another of the integrand.

    In this way, integration of any rational fraction is reduced to the integration of a polynomial and a few simple fractions.

    The integral of any rational function can be expressed in terms of elementary functions in a finite form, namely:

      through logarithms - in the case of the simplest fractions of type 1;

      in terms of rational functions - in the case of the simplest fractions of type 2

      through logarithms and arctangents - in the case of the simplest fractions of type 3

      through rational functions and arctangents - in the case of the simplest fractions of type 4. Universal trigonometric substitution always rationalizes the integrand, but often it leads to very cumbersome rational fractions, for which, in particular, it is almost impossible to find the roots of the denominator. Therefore, whenever possible, partial substitutions are used, which also rationalize the integrand and lead to less complex fractions.

    Newton-Leibniz formula is a general approach to finding definite integrals.

    As for the techniques for calculating definite integrals, they practically do not differ from all those techniques and methods.

    Similarly apply substitution methods (change of variable), method of integration by parts, the same methods of finding antiderivatives for trigonometric, irrational and transcendental functions. The only feature is that when applying these techniques, it is necessary to extend the transformation not only to the integrand, but also to the limits of integration. When replacing the variable of integration, do not forget to change the limits of integration accordingly.

    Well from the theorem, the continuity condition for the function is a sufficient condition for the function to be integrable. But this does not mean that a definite integral exists only for continuous functions. The class of integrable functions is much broader. So, for example, there is a definite integral of functions that have a finite number of discontinuity points.

    Calculation of a definite integral of a continuous function using the Newton-Leibniz formula is reduced to finding an antiderivative, which always exists, but is not always an elementary function or a function for which tables have been drawn up that make it possible to obtain the value of the integral. In numerous applications, the function to be integrated is given in a tabular manner, and the Newton - Leibniz formula is not directly applicable.

    If you want the most accurate result, ideal simpson's method.

    From the above, we can draw the following conclusion that the integral is used in such sciences as physics, geometry, mathematics and other sciences. Using the integral, the work of the force is calculated, the coordinates of the center of mass, the path traveled by the material point, are found. In geometry, it is used to calculate the volume of a body, find the arc length of a curve, etc.

    Formula

    The Simpson's formula is the integral of a second-degree interpolation polynomial on an interval:

    where, and are the values \u200b\u200bof the function at the corresponding points (at the ends of the segment and in its middle).

    Error

    Provided that the function on the segment has a fourth derivative, the error, according to the formula found by Giuseppe Peano, is:

    Due to the fact that the value is often unknown, the following inequality is used to estimate the error:

    Runge-Kutta method representation

    Simpson's formula can be represented as a table of the Runge-Kutta method as follows:

    Compound formula (Cotes formula)

    For a more accurate calculation of the integral, the interval is divided into segments of the same length and the Simpson formula is applied on each of them. The value of the original integral is the sum of the results of integration on all segments.

    where is the step size, and are the integration nodes, the boundaries of the elementary segments on which the Simpson formula is applied. Usually, for a uniform grid, this formula is written in other notation (the segment is divided into nodes) in the form

    Also, the formula can be written using only the known values \u200b\u200bof the function, that is, the values \u200b\u200bin the nodes:

    where means that the index changes from one in increments of two. Pay attention to the doubling of the coefficient before the sum. This is due to the fact that in this case the role of intermediate nodes is played by the initial integration nodes.

    The total error when integrating over a segment with a step (in this case, in particular,) is determined by the formula:

    .

    If it is impossible to estimate the error using the maximum of the fourth derivative (for example, it does not exist on a given segment, or tends to infinity), you can use a more rough estimate:

    .

    Notes

    Literature

    • Kostomarov D.P., Favorsky A.P. "Introductory lectures on numerical methods"
    • Petrov I.B., Lobanov A.I. Lectures on computational mathematics

    Wikimedia Foundation. 2010.

    • Western Union
    • Patagonian parrot

    See what "Simpson's Formula" is in other dictionaries:

      SIMPSON'S FORMULA - (formula of parabolas) a formula for the approximate calculation of definite integrals (quadrature formula), Named for T. Simpson (1743) ... Big Encyclopedic Dictionary

      SIMPSON'S FORMULA - (formula of parabolas), the formula for the approximate calculation is determined. integrals (quadrature formula), having the form where А \u003d (b а) / 2n, fk \u003d f (a + kh), k \u003d 0, 1, 2, ..., 2n. Named for T. Simpson (1743) ...

      Simpson's formula - a formula for the approximate calculation of definite integrals, having the form:, where h \u003d (b a) / 2n; fi, \u003d f (a + ih), i \u003d 0, 1, 2, ..., 2n. S. f. sometimes called the formula of parabolas, since the derivation of this formula is based on ... ... Great Soviet Encyclopedia

      Simpson's formula - a formula of parabolas, a formula for the approximate calculation of definite integrals (quadrature formula), having the form, where h \u003d (b – a) / 2n, fk \u003d f (a + kh), k \u003d 0, 1, 2, ..., 2n. Named for T. Simpson (1743). * * * SIMPSON FORMULA SIMPSON ... ... encyclopedic Dictionary

      Formula of rectangles

      Trapezium formula - A definite integral as the area of \u200b\u200ba figure Numerical integration (historical name: quadrature) calculation of the value of a definite integral (usually approximate), based on the fact that the value of the integral is numerically equal to the area ... ... Wikipedia

      SIMPSON'S FORMULA is a special case of Newton Cotes' quadrature formula, in which three nodes are taken: Let the interval [a, b] be divided into particle intervals, i \u003d 0, 1, 2, ..., n 1, of length h \u003d (b a) / n, while n is considered an even number, and to calculate the integral ... Encyclopedia of Mathematics

      Simpson's formula - ... Wikipedia

      Simpson Method - Simpson's formula refers to numerical integration techniques. It was named after the British mathematician Thomas Simpson (1710 1761). Consider a segment. Let the values \u200b\u200bof the real function f (x) be known at the points a, (a + b) / 2, b. ... ... Wikipedia

      SQUARE FORMULA is the formula for the approximate calculation of the definition. integrals over the values \u200b\u200bof the integrand at a finite number of points. Examples of K. f. rectangles formula, trapezoidal formula, Simpson's formula ... Natural science. encyclopedic Dictionary

    If you were looking for only the Simpson method on this page, then I strongly recommend that you first read the beginning of the lesson and look at at least the first example. For the reason that many ideas and techniques will be similar to the trapezoid method.

    Again, let's start with the general formula
    Consider a definite integral, where is a function that is continuous on a segment. Let's divide the segment into even quantity equal segments. An even number of segments is denoted by.

    In practice, the segments can be:
    two:
    four:
    eight:
    ten:
    twenty:
    I don't remember any other options.

    Attention!The number is understood as a SINGLE NUMBER. I.e, CAN'T reduce, for example, by two, getting. Recording only meansthat the number of segments even... And there is no talk of any abbreviations

    So, our partition looks like this:

    The terms are similar to those of the trapezoid method:
    The points are called knots.

    Simpson's formula for the approximate calculation of a definite integral has the following form:
    Where:
    - the length of each of the small segments, or step;
    - the values \u200b\u200bof the integrand in points.

    Detailing this pile, I will analyze the formula in more detail:
    - the sum of the first and last values \u200b\u200bof the integrand;
    - the sum of members with even indexes are multiplied by 2;
    - the sum of members with odd indices are multiplied by 4.

    Example 4

    Calculate the approximate definite integral by Simpson's formula to the nearest 0.001. Start splitting with two line segments

    The integral, by the way, is again unbearable.

    Decision: I immediately draw attention to the type of task - it is necessary to calculate a certain integral with a certain precision... What this means has already been commented at the beginning of the article, as well as on specific examples of the previous paragraph. As with the trapezoidal method, there is a formula that will immediately allow you to determine the required number of segments ("en" value) to guarantee the required accuracy. True, one has to find the fourth derivative and solve the extremal problem. Those who understood what I mean and appreciated the amount of work smiled. However, there is no laughing matter here, finding the fourth derivative from such an integrand will no longer be a mega-botan, but a clinical psychopath. Therefore, in practice, a simplified method for estimating the error is almost always used.

    We start to decide. If we have two segments of the partition, then the nodes will be one more:. And Simpson's formula takes on a very compact form:

    Let's calculate the partitioning step:

    Let's fill in the calculation table:


    Once again, I comment on how the table is filled:

    In the top line we write the "counter" of indices

    In the second line, we first write the lower limit of integration, and then add the step sequentially.

    In the third line we enter the values \u200b\u200bof the integrand. For example, if, then. How many decimal places to leave?Indeed, the condition again says nothing about it. The principle is the same as in the trapezium method, we look at the required accuracy: 0.001. And add an additional 2-3 digits. That is, you need to round up to 5-6 decimal places.

    As a result:

    The primary result is received. Now doubling number of segments up to four:. Simpson's formula for this partition takes the following form:

    Let's calculate the partitioning step:

    Let's fill in the calculation table:


    In this way:

    We estimate the error:

    The error is greater than the required accuracy: , so it is necessary to double the number of segments again:.

    Simpson's formula is growing by leaps and bounds:

    Let's calculate the step:

    And again, fill in the calculation table:

    In this way:

    Note that here it is advisable to describe the calculations in more detail, since Simpson's formula is quite cumbersome, and if you immediately boom:
    , then this booze will look like hack. And with a more detailed note, the teacher will have the good impression that you have diligently erased the calculator keys for a good hour. Detailed calculations for "difficult" cases are present in my calculator.

    We estimate the error:

    The error is less than the required accuracy: ... It remains to take the most accurate approximation, round it to three decimal places and write down:

    Answer: accurate to 0.001

    Example 5

    Calculate the approximate integral by Simpson's formula to within 0.0001. Start splitting with two line segments

    This is an example for a stand alone solution. An approximate sample of the final "short" design of the solution and the answer at the end of the lesson.

    In the final part of the lesson, let's look at a couple of common examples.

    Example 6

    Calculate the approximate value of a definite integral using the Simpson formula, dividing the integration segment into 10 parts. Calculation accuracy 0.001.

    This integral is taken, however, it is not so easy for a beginner to crack it, the corresponding solution method is considered in example 5 of the lesson Complex integrals... In problems of approximate computation, the integral does not have to be non-trivial! Curious students can calculate it accurately and estimate the error relative to the approximate value.

    Decision: Pay attention to the wording of the task: "The accuracy of calculations is 0.001". The semantic nuance of this wording suggests that the results need only be rounded to the third decimal place, and not achieve such accuracy. Thus, when you are offered to solve a problem on the trapezium method, the Simpson method, always carefully delve into the condition! Haste, as you know, is needed when hunting fleas.

    We use the Simpson formula:

    For ten segments of the partition, the step is

    Let's fill in the calculation table:

    It is more rational to make the table two-story, so that you do not have to "small" and everything legibly fits on the notebook sheet.

    Calculations, we are not lazy, we describe in more detail:

    Answer:

    And once again I emphasize that there is no question of accuracy here. In fact, the answer may not be, but, relatively speaking,. In this regard, the answer does not need to mechanically attribute the "duty" ending: "with an accuracy of 0.001"

    Example 7

    Calculate the approximate value of a definite integral using the Simpson formula by dividing the integration segment into 10 parts. All calculations should be performed with an accuracy of the third decimal place.

    A rough version of finishing and the answer at the end of the lesson, which has come to an end.

    Other methods are also used for the approximate calculation of a definite integral. In particular, the theory power series with a standard task Approximate calculation of a definite integral by expanding the integrand in a series... But this is already the material of the second year.

    And now it's time to reveal the terrible secret of integral calculus. I have already created more than a dozen lessons on integrals, and this is, so to speak, theory and classics of the topic. In practice, in particular, in engineering calculations, it is almost impossible to bring objects of the real world closer with standard mathematical functions. Impossible perfectly accurate calculate area, volume, density, for example, asphalt pavement. Error, even from the tenth, even from the hundredth decimal place - but it will still be... That is why, according to approximate calculation methods, hundreds of weighty bricks have been written and serious software for approximate calculations has been created. The classical theory of integral calculus is actually used much less frequently. But, by the way, without her - also nowhere!

    This tutorial is not a record volume, but it took me an unusually long time to create it. I corrected the material and rewrote the structure of the article several times, as new nuances and subtleties were constantly drawn. I hope the work was not in vain, and it turned out quite logical and affordable.

    Good luck to you!

    Solutions and Answers:

    Example 3:Decision: We divide the segment of integration into 4 parts:
    Then the trapezoid formula takes the following form:

    Let's calculate the step:
    Let's fill in the calculation table: