Computational Methods in Engineering: Numerical Integration Techniques

eso 208a computational methods in engineering n.w
1 / 26
Embed
Share

Explore the fundamentals of numerical integration methods such as rectangular rule, trapezoidal rule, and Simpson's rules in engineering applications. Understand how to approximate functions using polynomials and evaluate integrals using partitioning techniques. Learn key concepts for efficient computational analysis in engineering.

  • Engineering
  • Numerical Integration
  • Computational Methods
  • Polynomials
  • Partitioning

Uploaded on | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. ESO 208A: Computational Methods in Engineering Numerical Integration Abhas Singh Department of Civil Engineering IIT Kanpur Acknowledgements: Profs. Saumyen Guha and Shivam Tripathi (CE)

  2. Numerical Integration ? ? = ? ? ?? ? Partition x as: ? = ? = ?0,?1,?2, ??= ? If f(x) is known, the user or the algorithm will determine the partition or mesh or locations of xi s If tab(f) is known, the location of the nodes are also known apriori General approach: approximate f(x) with one or a piece-wise continuous set of polynomials p(x) and evaluate: ? ? ? = ? ? ?? ? ? ?? ? ?

  3. Numerical Integration: Rectangular Rule fi+1/2 fi+2 ?= ??+1 ?? fn fi fi+1 f1 fi-1 f0 xi+1/2 b = xn x1 a = x0 xi-1 xi+2 xi+1 xi Polynomial p(x) is piecewise constant function: pi(x) = fi+1/2 ??+1 ??+1 ? ? ?? ??+1/2?? = ???+1/2 ?? ??

  4. Numerical Integration: Rectangular Rule fi+1/2 fi+2 ?= ??+1 ?? fn fi fi+1 f1 fi-1 f0 xi+1/2 b = xn x1 a = x0 xi-1 xi+1 xi+2 xi ??+1 ? ? 1 ? ? ?? ???+1/2 ? = ? ? ?? ???+1/2 ?=0 ?? ?

  5. Numerical Integration: Trapezoidal Rule fi+2 ?= ??+1 ?? fn fi fi+1 f1 fi-1 f0 b = xn x1 a = x0 xi-1 xi+1 xi+2 xi Polynomial p(x) is piecewise linear function: ? ?? ??+1 ?? ??+1+? ??+1 ?? ??+1??=??+1 ? ?? ?? ? ? ? ? = ? ??+1 ? ?

  6. Numerical Integration: Trapezoidal Rule ??+1 ??+1 ??+1 ??+1 ? ? ?? =??+1 ? ???? ?? ? ? ?? ? ??+1?? ? ? ?? ?? ?? ?? 2 2 =??+1 ? 2 ?? ? ??+1 2 +?? = ? ? ? 2 2 ? ??+1 ? 1 ? 1 ??+1 2 +?? ? = ? ? ?? = ? ? ?? ? 2 ?=0 ?=0 ? ?? If the mesh is uniform, ? = h for all i: ? ??+1 ? 1 ? 1 ? ?0 2+?? ? = ? ? ?? = ? ? ?? 2+ ?? = ???? ?=0 ?=1 ?=0 ? ??

  7. Numerical Integration: Simpsons Rules fi+2 ?= ??+1 ?? fn fi fi+1 f1 fi-1 f0 b = xn x1 a = x0 xi-1 xi+1 xi+2 xi Polynomial p(x) is piecewise quadratic function: ? ? ? ? ? ??+2 ? ??+1 ?? ??+2 ?? ??+1 ? ??+2 ? ?? ??+1 ??+2 ??+1 ?? ? ?? ??+2 ?? ? ??+1 ??+2 ??+1 = ??+ ??+1+ ??+2

  8. Numerical Integration: Simpsons Rules Polynomial p(x) is piecewise quadratic function: ? ? ? ? ? ??+2 ? ??+1 ?? ??+2 ?? ??+1 ? ?? ? ??+1 ??+2 ?? ??+2 ??+1 ??+2 ??+2 ? ??+2 ? ?? ??+1 ??+2 ??+1 ?? = ??+ ??+1 + ??+2 ? ? ?? ? ? ?? ?? ?? ??+2 ??+2 ? ??+2 ? ??+1 ?? ??+2 ?? ??+1 ? ??+2 ? ?? ??+1 ??+2 ??+1 ?? = ?? ?? + ??+1 ?? ?? ?? ??+2 ? ?? ??+2 ?? ? ??+1 ??+2 ??+1 + ??+2 ?? ?? Assume, ? = ?+1 = h and substitute z = (x xi)

  9. Numerical Integration: Simpsons Rules ??+2 ??+2 ? ? ?? ? ? ?? ?? ?? ??+2 ??+2 ? ??+2 ? ??+1 ?? ??+2 ?? ??+1 ? ??+2 ? ?? ??+1 ??+2 ??+1 ?? = ?? ?? + ??+1 ?? ?? ?? ??+2 ? ?? ??+2 ?? ? ??+1 ??+2 ??+1 + ??+2 ?? ?? Assume, ? = ?+1 = h and substitute z = (x xi) ??+2 ??+2 ? ? ?? ? ? ?? ?? ?? 2 2 2 ?? ? 2 ? ?? ??+1 ? 2 ??? +??+2 = 2 2 2 2 2 ? ??? 0 0 0

  10. Numerical Integration: Simpsons Rules ??+2 ??+2 ? ? ?? ? ? ?? ?? ?? 2 2 ?? ? 2 ? ?? ??+1 = 2 2 2 ? 2 ??? 0 2 0 +??+2 2 2 ? ??? 0 2 3 3 2 3 3 2 2 2 2 2 2 2 3 3 2 2 2 ?? ??+1 2 + 2 22 = 3 2 2 2 +??+2 2 2 = 3??+ 4??+1+ ??+2 This is known as Simpson s 1/3rd Rule

  11. Numerical Integration: Simpsons Rules fi+2 = ??+1 ?? ? fn fi fi+1 f1 fi-1 f0 b = xn x1 a = x0 xi-1 xi+1 xi+2 xi If the mesh is uniform, ? = h for all i: ? ? ? ?? ? 1 ? 2 ? ? = 3?0+ ??+ 4 ??+ 2 ?? = ???? ?=1 ?=??? ?=2 ?=0 ? ?=???? n = 2m, m integer

  12. Numerical Integration: Simpsons Rules Polynomial p(x) is piecewise cubic function: ? ? ? ? ? ??+3 ? ??+2 ? ??+1 ?? ??+3 ?? ??+2 ?? ??+1 ? ?? ? ??+1 ? ??+3 ??+2 ?? ??+2 ??+1 ??+2 ??+3 ? ?? ? ??+1 ? ??+2 ??+3 ?? ??+3 ??+1 ??+3 ??+2 Assume, ? = ?+1 = ?+2= h and substitute z = (x xi) ??+3 ??+3 ? ??+3 ? ??+2 ? ?? ??+1 ??+3 ??+1 ??+2 ??+1 ?? = ??+ ??+1 + ??+2 + ??+3 ? ? ?? ? ? ?? ?? ?? 3 3 ?? ? 3 ? 2 ? ?? +??+1 6 3 2 3 = ? 3 ? 2 ??? 0 0 3 3 ??+2 2 3 ? 3 ? ??? +??+2 6 3 ? 2 ? ??? 0 0

  13. Numerical Integration: Simpsons Rules ??+3 ??+3 ? ? ?? ? ? ?? ?? ?? 3 3 ?? ? 3 ? 2 ? ?? +??+1 6 3 2 3 = ? 3 ? 2 ??? 0 0 3 3 ??+2 2 3 ? 3 ? ??? +??+3 6 3 ? 2 ? ??? 0 0 3 4 4 3 4 4 3 4 4 3 3 3 3 3 3 3 3 3 + 11 23 2 ?? 6 33 = 6 6 3 2 + 6 23 2 3 4 4 3 3 3 + 3 23 2 +??+1 2 3 +??+3 6 3 ??+2 2 3 =3 5 4 2 2 + 2 23 2 3 ??+ 3??+1+ 3??+2+ ??+3 2 8 This is known as Simpson s 3/8th Rule

  14. Numerical Integration: Simpsons Rules fi+2 = ??+1 ?? ? fn fi fi+1 f1 fi-1 f0 b = xn x1 a = x0 xi-1 xi+1 xi+2 xi If the mesh is uniform, ? = h for all i: ? ? ? ?? 3 ? 1 ? 3 ? ? = ?0+ ??+ 3 ??+ ??+1 + 2 ?? = ???? 8 ?=1,4,7,10 ?=3,6,9, ?=0 ? n = 3m, m integer

  15. Numerical Integration Accuracy: How accurate are the numerical integration schemes with respect to the TRUE integral? Truncation Error analysis: local and global Recall: True Value (a) = Approximate Value ? + Error ( ) Is it possible to improve the accuracy? Romberg Integration Quadrature Methods

  16. Numerical Integration: Rectangular Rule ??+1 =??+ ??+1 ? ? ?? ?? ??+1 = ???+1 2 ??+1 2 2 2 ?? Expand f(x) in Taylor s series around xi+1/2: Let us denote yi = xi+1/2 ? ? 2 ? ?? 2 4 = ? ?? + ? ??? ?? + 3 ? ?? + 6 ????? + ? ?? 5 ? ?? 6 ? ?? 720 ? ?? 24 ? ?? 120 ????? + ???? + +

  17. Numerical Integration: Rectangular Rule ? ? 2 3 ? ?? 2 5 ? ?? 6 6 = ? ?? + ? ??? ?? + 4 ????? + ??+1 ? ?? + ? ?? ? ?? 24 ? ?? 120 ? ?? 720 ???? + ????? + + ? ? ?? 0 ?? ??+1 ??+1 ??+1 ? ?? ?? +? ?? ?? + ? ?? 0 2?? = ? ?? ? ?? 2 ?? ?? ?? ??+1 ??+1 +? ?? 3?? +????? 4?? ? ?? 0 ? ?? 6 24 ?? ??+1 ?? ??+1 +???? 120 5?? +????? 6?? + ? ?? ? ?? 720 ?? ??

  18. Numerical Integration: Rectangular Rule ??+1 ? ? ?? 0 ?? ??+1 ??+1 ??+1 ? ?? ?? +? ?? ?? + ? ?? 0 2?? = ? ?? ? ?? 2 ?? ?? ?? ??+1 ??+1 +? ?? 3?? +????? 4?? ? ?? ? ?? 6 24 ?? ??+1 ?? ??+1 0 +???? 120 5?? +????? 6?? + ? ?? ? ?? 720 ?? ?? ??+1 3? ?? 24 5????? 1920 7????? 138240 ? ? ?? = ?? ?? + ? + ? + ? + ??

  19. Numerical Integration: Rectangular Rule ??+1 ? ? ?? ?? = ?? ?? + ? 5????? 1920 3? ?? 24 7????? 138240 + ? + ? + Rectangular rule is O(h3) accurate in a single interval. This is also known as Local Truncation Error. We will derive Global Truncation Error later. First, let us derive Local Truncation Errors for Trapezoidal and Simpson s 1/3rd Rule!

  20. Local Truncation Error: Trapezoidal Rule ? ?? = ? ?? ? 2 3 5 2 4 = ? ?? ? 6 46080????? + ? ??+1 = ? ??+ ? 2? ?? + ? 8? ?? ? ? 384????? ? 48? ?? + 3840???? ? + 2 3 5 2 4 = ? ?? + ? 6 46080????? + ? ??+1 + ? ?? 2 ? ?? =? ??+1 + ? ?? 2? ?? + ? 8? ?? + ? ? 384????? + ? 48? ?? + 3840???? ? + 6 2 4 = ? ?? + ? ? 384????? + ? 384????? ? 8? ?? + ? 8? ?? 46080????? + ? 46080????? + 6 2 4 2

  21. Local Truncation Error: Trapezoidal Rule 6 2 4 ? ? ? 384????? ? ?? =? ??+1+? ?? 8? ?? 46080????? + ?? (1) 2 We earlier showed that, 3? ?? 24 5????? 1920 7????? 138240+ ?? (2) ??+1? ? ?? = ?? ?? + ? + ? + ? ?? Putting ? ?? from eq(1) in eq(2) and combining terms of the same order of h, ??+1 ? ??+1 + ? ?? 2 3? ?? 12 5????? 480 7????? 69120 ? ? ? ? ? ?? = ? + ?? Therefore, the Trapezoidal Rule is O(h3) accurate in a single interval. The Local Truncation Error of both, Rectangular Rule and Trapezoidal Rule is 3rd order. Let us apply these two integration techniques over an interval 2hi or {xi, xi+2} In this case: yi = xi+1

  22. Numerical Integration: Simpsons 1/3rd Rule ??+2 3? ??+1 3 5?????+1 60 7?????+1 1080 ? ? ?? = 2 ?? ??+1 + ? + ? + ? ?? ??+2 ? ? ?? ?? 3? ??+1 3 5?????+1 15 7?????+1 540 2 ? ? ? = ?? ??+2 + ? ?? Weighted sum with weights of 2/3 and 1/3! ??+2 5?????+1 90 ? ? ?? = ? ? ? ??+2 + 4? ??+1 + ? ?? 3 ?? Therefore, the Simpson s 1/3rd Rule is O(h5) accurate in a single interval or the Local Truncation Error of Simpson s 1/3rd Rule is O(h5)

  23. Global Truncation Error: Trapezoidal Rule ??+1 3? ?? 12 5????? 480 7????? 69120 ? ??+1 + ? ?? 2 ? ? ? ? ? ?? = ? + ?? Recall, if the mesh is uniform, ? = h for all i: ? ? 1 ??+1 ? 1 ? 1 ?0 2+?? ?? = ? ? ?? = ? ? ?? 2+ 2? ? + ? ? + 2 ?? ?=0 ? 1 ?=1 ?=1 ? ?? ? ??+1 ? ? ?? = ? ? ?? ?=0 ? ?? ? 1 ? 1 ? 1 ?? 3 5 480 = ? ?? ????? + 2? ? + ? ? + 2 12 ?=1 ?=0 ?=0 Apply, the first mean value theorem of integrals!

  24. Global Truncation Error: Trapezoidal Rule ? ??+1 ? 1 ? 1 ? 1 ? 1 ?? 3 5 480 ? ? ?? = ? ?? ????? + ? ? ?? = 2? ? + ? ? + 2 12 ?=0 ?=1 ?=0 ?=0 ? ?? Applying the first mean value theorem for integrals: ? 1 ? ?? = ?=0 ? 1 ????? = ?=0 ? 1 ? ??+1/2 = ?? ? =? ? ? ? ; ? ?,? ?=0 ? 1 ?????+1/2 = ????? =? ? ???? ; ? ?,? ?=0 ? ? 1 ?? 2 4 480? ? ???? ? ? ?? = 12? ? ? ? 2? ? + ? ? + 2 ?=1 ? Global Truncation Error of the Trapezoidal Rule is O(h2) Similarly, for all the methods, we can derive GTE to be one order less than LTE! Order of a method is referred to by it s GTE!

  25. Romberg Integration ? ? 1 ?? 2 4 480? ? ???? ? ? ?? = 12? ? ? ? ? = 2? ? + ? ? + 2 ?=1 ? ? = ? + ?1 2+ ?2 4+ ?3 6+ ?4 8 2 4+ ?2 2 16+ ?2 4 ? 3 4 ? 2 3 16 ? 2, 15 4 16+ ?3 4 256+ ?3 6 64+ ?4 6 4096+ ?4 8 256+ ? 2= ? + ?1 8 ? 4= ? + ?1 65536+ 2 ? 4 4 ?3 5 6 16 ?4 21 8 64 ? , 2= = ? ?2 4 ? 4 64 ?3 5 6 1024 ?4 21 8 16384 ? 2, 4= = ? ?2 4 ? , 6 64+ ?4 21 8 1024+ 2 ? , 4= = ? + ?3 2,

  26. Numerical Integration: Example 2?5??using 3 points with Trapezoidal, Simpson s 1/3rd. Compare TRUE Evaluate 0 errors. True integral = 26/6 = 10.6667 Trapezoidal (T) and Simpson s 1/3rd Rule (S): ?0= 0, ?0= 0, ?1= 1, ?1= 1, ?2= 2 ?2= 32 ? 1 ? == 2? ? + ? ? + 2 ?? ?=1 =1 ? =1 20 + 32 + 2 1 = 17 ? = 59.4% 30 + 4 1 + 32 = 12 ? = 12.5%

More Related Content