170 likes | 180 Views
Learn about quadrature rules, trapezoidal rule, composite midpoint rule, Simpson rule, Gauss quadrature, degree of exactness, and more. Understand numerical methods for integrating functions efficiently.
E N D
Quadrature rules Tommaso MarcatoETH Zurich, Institut für Chemie- und BioingenieurwissenschaftenETH Hönggerberg / HCI E120 – ZürichE-Mail: tommaso.marcato@chem.ethz.chhttps://shihlab.ethz.ch/education/Snm/numerics Tommaso Marcato/ Numerical Methods for Chemical Engineers / Numerical Quadrature
Quadrature methods Single Step Trapezoidal Rule Composite Trapezoidal Rule Tommaso Marcato/ Numerical Methods for Chemical Engineers / Numerical Quadrature
Composite Midpoint Rule Constant function for each step xn-1 b a x1 x2 Tommaso Marcato/ Numerical Methods for Chemical Engineers / Numerical Quadrature
Composite Trapezoidal rule Linear function for each step xn-1 b a x1 x2 Tommaso Marcato/ Numerical Methods for Chemical Engineers / Numerical Quadrature
Composite Simpson rule The interval is split up and the areas are integrals of quadratic functions Parabola through f(a), f(x1), f(x2) b xn-1 a x1 x2 Tommaso Marcato/ Numerical Methods for Chemical Engineers / Numerical Quadrature
Gauss Quadrature Depending on the polynomial order n nodes xj and weights wj are used To approximate the area under a function. n = 3 Tommaso Marcato/ Numerical Methods for Chemical Engineers / Numerical Quadrature
Degree of exactness • Trapezoids are areas under linear functions • Linear functions are approximated exactly; q = 1 • Simpson uses the area under quadratic functions • Polynomials up to order three are approximated exactly! q = 3 • Even degree interpolation polynomials get one degree of exactness for free • Example Tommaso Marcato/ Numerical Methods for Chemical Engineers / Numerical Quadrature
Degree of exactness vs. order of accuracy • When a non-exact result is obtained, the error is proportional to the step size to a certain power s, the order of accuracy • It can be shown that s = q + 1 for sufficiently smooth f Tommaso Marcato/ Numerical Methods for Chemical Engineers / Numerical Quadrature
Solution of Nonlinear Functions Michael SokolovETH Zurich, Institut für Chemie- und BioingenieurwissenschaftenETH Hönggerberg / HCI F135 – ZürichE-Mail: michael.sokolov@chem.ethz.chhttp://www.morbidelli-group.ethz.ch/education/index Tommaso Marcato/ Numerical Methods for Chemical Engineers / Numerical Quadrature
Zero of a Nonlinear Function • Problem definition: • Find the solution of the equation f(x) = 0for scalar valued f and x; Look for the solution either in • An interval, generally –∞ < x < ∞ • In the uncertainty interval [a, b], where f(a)f(b) < 0 • Types of algorithms available: • Bisection method • Substitution methods • Methods based on function approximation • Assumptions: • In the defined intervals, at least one solution exists • We are looking for one solution, not all of them Tommaso Marcato/ Numerical Methods for Chemical Engineers / Numerical Quadrature
Fixed point iterations • Fixed point iterations generally have the form • A fixed point of F is a point x*, where • A fixed point iteration is called consistent with a non-linear equation f(x), if Tommaso Marcato/ Numerical Methods for Chemical Engineers / Numerical Quadrature
Convergence order of fixed point iterations • For any (converging) fixed point iteration, we can write • whereC is the rate of convergence and p is the convergence order • If we take the logarithm on both sides, we get • Which we can use to fit an average p • The equationsforp and Cfromthelecturegivemoreprecisesolutions (also seeExercise 2, assignment 2) Tommaso Marcato/ Numerical Methods for Chemical Engineers / Numerical Quadrature
Assignment 1: Quadrature method comparison Tommaso Marcato/ Numerical Methods for Chemical Engineers / Numerical Quadrature
Assignment 1: Quadrature method comparison Tommaso Marcato/ Numerical Methods for Chemical Engineers / Numerical Quadrature
Assignment 1: Quadrature method comparison Tommaso Marcato/ Numerical Methods for Chemical Engineers / Numerical Quadrature
Assignment 2: Fixed pointiteration 2. 3. 4. Tommaso Marcato/ Numerical Methods for Chemical Engineers / Numerical Quadrature
Assignment 2: Fixed pointiteration 5. Tommaso Marcato/ Numerical Methods for Chemical Engineers / Numerical Quadrature