Numerical Integration: Discrete Riemann Integrals and Trapezoid Rule

preview_player
Показать описание
In this video, I show how to approximate definite integrals to find the area under a curve using discrete numerical methods. In particular, I discuss approximations to the Riemann integral, including left and right rectangle rules, trapezoidal integration, and Simpson's rule based on spline interpolation. Importantly, we discuss the error of each method, compute them in Python and Matlab, and relate these techniques to other intuitive numerical schemes. All with pictures.

@eigensteve on Twitter

This video was produced at the University of Washington

%%% CHAPTERS %%%
0:00 Numerical integration: Discrete Riemann integrals
10:53 Trapezoidal integration
18:42 Simpson's integration rule
22:56 Python code example
26:34 Matlab code example
Рекомендации по теме
Комментарии
Автор

Very thanks for this excellent lecture, steve...❤

HomeWorks:
In times 15:39 and 22:19 to 22:48: Driving the error of the four numerical integration schemes by using the Taylor series expansion of f(x):
1- Integration error of the Right-sided rectangle
2- Integration error of the Left-sided rectangle integration
3- Integration error of the Trapezoidal Rule integration
4- Integration error of the Simpson Rule integration

P.S. :
1- In time 3:10: the number of points is equal to N+1. Indeed as you mentioned, N is the number of divisions.
2- the Links to the lectures for calculating the error of numerical time integrations mentioned in time 15:22.

hoseinzahedifar
Автор

Just to clarify @3:09, the number of points is N+1, the number of "boxes" is N.

DerekWoolverton
Автор

(24:42) This graph shows right- and left-sided (and mid-sided) rectangles at the same time ;) (because there is a scaling error by one delta_x).

diemaschinedieviereckigeei
Автор

Really nice lecture. In some parts of Germany, we do this stuff already in school, just without Taylor`s series. I would also like to know if we can use the FFT for integrals. For the stuff, I do I usually need F, f, f', f'' and rarely f''. We usually can measure f to f'' fast and F slow to compensate for the error.
We also had a neat discussion if you need integrals or derivatives for machine learning control, or if the algorithm will embed them if you provide enough data points. Might be interesting to hear your point.

MrHaggyy
Автор

Let width of a word be 2, 3. Differentiate the dimensions of the word. Integrate it to the measurement of electron in the brain. Maxima and minima of f(x, y) where x is time, y is length of the light which can be a higher order differentiation. We can get energy liberated I think.

nisitreddy
Автор

this is rad, its funny how the difficulty of numerical integration and differentiation swap places when doing things analytically

fungouslobster
Автор

Atoms of brain has magnetic field, that means it has storing capacity, the intensity of image is related to previous memories and it causes the amount of blood flowing in our brain, which effects the health and locomotion of body

nisitreddy
Автор

Professor is it possible to study data science at your university and get the same diploma ?

hassanlaqrabti
Автор

Professor Steve, I believe the delta x as defined according to the declared variables would be (b - a)/(N - 2), because N is 1 unit bigger than the actual number of points (because the counting starts at 0, and not 1), and the number of intervals defined between these points is 1 unit smaller than the actual number of points.

saraiva
Автор

I keep seeing learning rates of 10e-5 used in neural networks training. Now things clicked in place.

alexz
Автор

The python code for plotting the ‘stairs’ for the larger value of delta X is incorrect. The points of the stairs do not intersect the sin(xc) function. The reason for this is that the ‘edges’ variable is defined by adding an extra element to the np.linespace. While this satisfies the plt.stairs requirement that the edges contain one more element than the ‘values’ array, it changes all the step values between an and b, causing the stairs to misalign. A better way to add the extra element to ‘edges’ is to simply append the value ‘b’ to the end of ‘xc’.

TheEicio