Finite Element Solution Methods I
Finite Element Solution Methods I MATH 5520
Popular in Course
Popular in Mathematics (M)
verified elite notetaker
This 50 page Class Notes was uploaded by Mary Veum on Thursday September 17, 2015. The Class Notes belongs to MATH 5520 at University of Connecticut taught by Dmitriy Leykekhman in Fall. Since its upload, it has received 35 views. For similar materials see /class/205808/math-5520-university-of-connecticut in Mathematics (M) at University of Connecticut.
Reviews for Finite Element Solution Methods I
Report this Material
What is Karma?
Karma is the currency of StudySoup.
Date Created: 09/17/15
MATH 5520 Numerical Integration 1 Dmitriy Leykekhman Spring 2009 Numerical Integration gt Our goal is to compute Ab 101 dz gt Even if fx can be expressed in terms of elementary functions the antiderivative of fx may not have this property For example 6 12 sin 12 Si quot7 etc as gt All exact techniques of integration taught in Calculus courses are more like exceptions then the rules gt As a general rule on must rely on numerical integration Numerical Integration V V V We want to approximate the integral of a function f by a weighted sum of function values 5 n In the above formula 116 ab are called the nodes of the integration formula and w are called the weights of the integration formula b When we apprOXImate fa fr d1 by 20 we speak of numerical integration or numerical quadrature 20 is called a quadrature formula Numerical Integration Introduce a new variable za bltzeagt Then if z 11 a and if z 51 b furthermore 7 bia 737a and by the change of variable formula Abfrdzflta dz d2 27 1 dz Numerical Integration Thus if we have computed weights and nodes 31 for the numerical integration on an interval 045 then we can use the above identity to approximate the integral of f over any interval an assuming of course that this integral exist by 161 dzfltaziagt dz 1sz ltaltzeagtgtA i0 Numerical Integration That is the weights w and nodes xi for the numerical integration on the interval an are I 7 a A b 7 a 7w z a B 7 a 17 z B 7 a This means it is sufficient to compute weights and nodes for the numerical integration on a certain interval like 01 or 711 often called the reference intervals wz 31 7a Numerical Integration Before we discuss several quadrature methods we summarize some properties of the integral which are important for the development of quadrature rules First we note that b 1dzbiai n Ewibia i0 Otherwise our quadrature formula could not even evaluate the integral ofa constant function exactly Therefore we require Numerical Integration Another property of the integral is b fz20 gtfzd120i then n 2 07 i0 for all functions fx 2 0 377 73 m Numerical Integration gt We also desire our numerical quadrature to be efficient gt Efficiency often depends upon the number of function evaluations gt Typically to evaluate f at xi is more expensive than form a linear combination of function values Interpolatory Quadrature Formulas Basic idea ifpz is some function such that 101 f 1 121 dmab z dz Thus we need a function 101 which close to fx and easy to integrate then Interpolatory Quadrature Formulas Chose nodes 10 11 i i i zn in the interval a b and compute the polynomial Pflzo7 i i i 1 of degree less or equal to n interpolating f at 1011 i i In If we use the approximation fI W Pflzoqunr7 then we obtain an approximation for the integral b b fltzgt dz Pltfizmwzngtltzgt dz lt1 1 These types of quadrature formulas are called interpolatory quadrature formulas Interpolatory Quadrature Formulas It is useful to represent the interpolation polynomial using the Lagrange basis zizj 11in Pltfl1071n1 in H l 2 If we substitute this representation of the interpolation polynomial into 1 then we obtain 1de m ab Pflzoiuznz dz Abi xi dr If 1 b n Zfzia H dz Interpolatory Quadrature Formulas This leads to the quadrature formula 5 n fltzgt dz m Emmi where b n z z wi J dz j01iizj 1139 Midpoint Rule The simplest quadrature formula can be constructed using n 0 and ince 1397 z39 j0 Z J J i we obtain the midpoint rule AbmmmoiwcT Trapezoidal Rule The next quadrature formula is constructed using n 1 and 10 a 1 b It holds that 1 17 bia 1 17a bia a biadx 2 7 Aaibdx 2 This yields the Trapezoidal rule b bia fltzgtdz 2 fafbA Simpson rule The next quadrature formula is constructed using n 2 and 10 a 1 521112 12 Then bzibj2azib bia a aib iaib 6 7 1 17a 17b bia dz4i Asiiasiib 6 bzibj azibdzbia a 7H7 bia 6 i This yields the Simpson rule Aims dz bg ltfa4fbafbgtA Newton Cotes Quadrature Formula If we have equidistant points 11 aih i0uin7 h 7 then the resulting interpolatory quadrature formula is called a closed Newton Cotes quadrature formula a and b are nodes In this case we can use the substitution 1 a sh to compute bn z z 1 nn 8 j 7 j 7 w dzbia7 damp z z Newton Cotes Quadrature Formula If we have equidistant points 11 zoih i0iun7 where b i a hm zoah znbih7 then the resulting interpolatory quadrature formula is called an open Newton Cotes quadrature formula a and b are not nodes Again we can use the substitution 1 a sh to compute bn z z39 1 ns 39 w39 ijdzbiai 7dsi I lt J i J i if Newton Cotes Quadrature Formula Since the interpolation polynomial is uniquely determined the interpolating polynomial for a polynomial pn of degree less or equal to n is the polynomial itself PltFnl 0w a 71mm 10711 This implies that b b n pnzdz Ppnlzo7 i i i znzdz for all polynomials pn of degree less or equal to n If 5 n Pn1dx for all polynomials pn of degree less or equal to n we say that the integration method is exact of degree n Newton Cotes Quadrature Formula One can even show the following result Theorem Exactness of Newton Cotes Formulas Let a g 0 lt lt In g b be given and let wi be the nodes and weights ofa Newton Cotes formula lfn is even then the quadrature formula is exact for polynomials of degree n 1 lfn is odd then the quadrature formula is exact for polynomials of degree n Table of Newton Cotes Quadrature Formulas The weights and nodes for the most popular NewtonCotes formulas are name summarized in the table below n1 13139 error 2 a h3 f2 Trapezoidal rule 3 a 3 h5f45 Simpsons rule 4 g 37 37 h5f45 38rule 5 7E7E7E7E h7 5f55 Milnes rule In the table xi aih i0uln7 h Hr TL wi 131027 a7 37 73 m Topics V VVVVVV Sou rces MATH 5520 Basics of MATLAB Dmitriy Leykekhman Spring 2009 Entering Matrices Basic Operations with Matrices Build in Matrices Build in Scalar and Matrix Functions if while for mfiles Graphics Sparse Matrices Reso u rces There are many good books on Matlab besides the textbook Recent Cleve Moler39s book Experiments with MATLAB has many fun problems and is also available online Good introduction is Matlab primer The MATHWORKS has a lot of useful information Reso u rces There are many good books on Matlab besides the textbook Recent Cleve Moler39s book Experiments with MATLAB has many fun problems and is also available online Good introduction is Matlab primer The MATHWORKS has a lot of useful information In addition books by Andrew Knight BASICS OF MATLAB and Beyond an by DJ Nigham and NJ Nigham MATLAB Guide are pretty useful Entering Matrices Matlab is standing for matrix laboratory and was basically designed for operations with matrices We will essentially only work with matrices A scalar is 1by1 matrix Entering Matrices Matlab is standing for matrix laboratory and was basically designed for operations with matrices We will essentially only work with matrices A scalar is 1by1 matrix Matrices can be introduced into MATLAB in several different ways gt Entered by an explicit list of elements gt Generated by builtin statements and functions gt Loaded from external data files or applications Basic Matrix Operations The following are the basic matrix operations in MATLAB gt addition 7 subtraction 6 multiplication power conjugate transpose left division gt gt gt gt gt gt right division Matrix Building Functions Matrices can also be build from the functions VVVVVVVVV eye identity matrix zeros matrix of zeros ones matrix of ones diag create or extract diagonals triu upper triangular part of a matrix tril lower triangular part of a matrix rand randomly generated matrix hilb Hilbert matrix magic magic square General syntax for for loop for variable expression statement statement end Examples General syntax for for loop for variable expression statement statement end Examples As a general rule try to avoid such loops while General syntax for while loop while expression statement statement end Examples General syntax for if statement if expression statements elseif expression statement else expression statement end Examples Relations lt less than gt greater than lt less than or equal gt greater than or equal equal N not equal amp and lor VVVVVVVVV N not Scalar functions Certain MATLAB functions operate essentially on scalars but operate elementwise when applied to a matrix sin asin exp abs round COS acas log natural log qut floor tan atan rem remainder Sign VVVVVVVVVVVVVVV ceil I l Vector functions Certain MATLAB functions operate essentially on scalars but operate elementwise when applied to a matriXOther MATLAB functions operate essentially on a vector row or column but act on an mbyn matrix m 2 2 in a columnbycolumn fashion to produce a row vector containing the results of their application to each column max min sum pTod median mean all any VVVVVVVV Matrix functions Much of MATLAB39S power comes from its matrix functions VVVVVVVVVVVVVVVVV eig eigenvalues and eigenvectors chol cholesky factorization svd singular value decomposition inv inverse lu LU factorization qquot QR factorization hess hessenberg form schuT schur decomposition T I Ef reduced row echelon form ezpm matrix exponential sqrtm matrix square root poly characteristic polynomial def determinant size size norm 1norm 2norm Fnorm 1norm cond condition number in the 2norm Tank rank Graphics functions MATLAB can produce planar plots of curves 3D plots of curves 3D mesh surface plots and 3D faceted surface plots The primary commands for these facilities are gt plot gt polar gt plat gt mesh gt surf There are others Sparse Matrices In many applications like solving systems of PDEs most elements of the resulting matrices are zeros sparse MATLAB has ability to store and manipulate sparse matrices For almost any matrix function there is a corresponding sparse matrix function Most useful are V VVVVVVVVV V There are other commands cf Primer speye sparse identity matrix sparse create sparse matrix convert full matrix to sparse spanes replace nonzero entries with ones spdiags sparse matrix formed from diagonals sprandn sparse random matrix full convert sparse matrix to full matrix spy visualize sparsity structure nnz number of nonzero entries nzmax amount of storage allocated for nonzero entries issparse true if matrix is sparse spalloc allocate memory for nonzero entries MATH 5520 Numerical Integration 2 Dmitriy Leykekhman Spring 2009 gt Gauss Quadrature gt Composite Quadrature Formulas gt MATLAB39s Functions as 3 73 m Gauss Quadrature gt Idea of the Gauss Quadrature is to choose nodes 10 zn and the weights we wn such that the formula 5 n 101 dz m is exact for a polynomial of maximum degree gt Lemma There is no choice of nodes 10 In and weights we wn such that b n PNI Li ZwiPNIi for all polynomials pN of degree less or equal to N ifN gt 2n 1 gt The above lemma give an upper bound on the maximum degree Gauss Quadrature Example Let39s determine the weights we and wl and the nodes 10 and x1 such that 1 wopltzogt w1pltz1gt pltzgt dz 71 holds for polynomials of degree 3 or less This seems possible since we have 4 parameters to choose we 10110 and exactly 4 numbers are needed in order to define uniquely a polynomial of degree 3 Gauss Quadrature Example Let39s force the formula to be exact for 1 z z2 and zg This gives us 1 w1w21dz2 71 1 w1z1w2z2 z dz 0 71 1 2 w1z w2z z2 dz 7 1 3 1 w1z 10ng z3 dz 01 71 a nonlinear system of 4 equations with for unknowns Usually we need a nonlinear solver to solve nonlinear systems but in this example we can solve it analytically to obtain w110217 I1 12 1 1 E W I l Table of Gauss Legendre Quadrature Formulas The weights and nodes for the first 3 Gauss Legendre formulas on 711 xi wi exact for pN 1 1 7W7W 11 N73 V o O861136311594052575 034785484513745385737 O339981043584856264 065214515486254614262 0339981043584856264 065214515486254614262 0861136311594052575 034785484513745385737 clw clw ll 01 a 767 Composite Quadrature Formulas Let a 0 lt 1 lt lt In b be a partition of an Then Ab mm fame Now we can approximate ffzdz by approximating each integral 11 fzdx by a low degree quadrature formula Ez1 w 11 F0 and 5 mil 1 nil in a i0 wt i0 j0 733 73 m Composite Midpoint Rule Example 5 n71 I I a 95 Ii1 10f Composite Trapezoidal Rule Example 7 b 1 7 El fzdr m 11f1i1 The function values fzlf12uifzn1 appear twice in the summation This has to be utilized in the implementation of the composite Trapezoidal rule 5 I1 7 0 a m 2 fzo n71 Z 21 71 u i1 W xn Composite Simpsons Rule Example 5 n71 I 7 I I I IVE W Z Iz16 731 a 4fIz12 11 fawn 039 i0 Notice that the function values fzlf12iufzn1 appear twice in the summation This has to be utilized in the implementation of the composite Simpson rule MAT LAB s quad trapz MATLAB has several build in functions for numerical integration We will mention a couple quad and trapz You can get more information by typing gtgthe1p quad gtgt help trapz MATLAB S quad The syntax for quad QUAD Numerically evaluate integral adaptive Simpson quadrature Q QUADFUNAB tries to approximate the integral of scalarvalued function FUN from A to B to within an error of 1e6 using recursive adaptive Simpson quadrature FUN is a function handle The function YFUNX should accept a vector argument X and return a vector result Y the integrand evaluated at each element of X Example For example we want to approximate 10 712 e dzi 0 gtgt quad expx 2 010 Then produces gtgt 0886226046613606 If we need 10 digits of accuracy then gtgt quad expx 2 O101e10 produces more accurate answer gtgt 0886226925457492