### Create a StudySoup account

#### Be part of our community, it's free to join!

Already have a StudySoup account? Login here

# Class Note for COSC 3361 at UH

### View Full Document

## 14

## 0

## Popular in Course

## Popular in Department

This 23 page Class Notes was uploaded by an elite notetaker on Friday February 6, 2015. The Class Notes belongs to a course at University of Houston taught by a professor in Fall. Since its upload, it has received 14 views.

## Reviews for Class Note for COSC 3361 at UH

### What is Karma?

#### Karma is the currency of StudySoup.

#### You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!

Date Created: 02/06/15

0080 3361 Numerical Analysis Numerical Integration and Differentiation Ill Gauss Quadrature and Adaptive Quadrature Edgar Gabriel Fall 2005 0080 3361 Numerical Analysis Edgar Gabriel C Summary of the last lecture I For approximating an integral value one can determine the approximating polynomial of degree n The according integral is then Ifxdxz Ipxdx j fxilixdx 24qu 21 0 i0 For equally spaced pointsx0x1xnthe formula 21 is called the NewtonCotes formula The NewtonCotes formula produce exact results for f being a polynomial of degree at most n 0080 3361 Numerical Analysis Edgar Gabriel C J Summary of the last lecture ll Two ways of calculating the coefficients A in the NewtonCotes formula have been presented Using the Lagrange form of the interpolating polynomial Using the method of undetermined coefficients k A Name 1 1 l l Trapezoid rule 2 2 2 1 g 1 Simpsons rule 6 6 6 3 1 g g 1 38th rule 8 8 s s 4 l 32 g g 7 Milne 90 90 90 90 90 0080 3361 Numerical Analysis Edgar Gabriel C J Change of intervals I A formula derived for a certain interval can easily be adapted to any other interval by making a change of variable eg using the substitution xabat jfomub mjfoH4b mnm and for the approximation foyub mjfoH b mom zw miAJmw mm 0080 3361 Numerical Analysis Edgar Gabriel C J Change of intervals ll Even more generally b ad 6H fltdt If 206126 with 1 b a ad bc t xix d C d C 0080 3361 Numerical Analysis Edgar Gabriel C S Quadrature Formulas General quadrature formulas are described by b n l fxdx zZaim a i0 Basic steps to solve an integral using a quadrature formula Determinethe knots ti Construct the interpolating polynomial Determinethe coefficients at 0080 3361 Numerical Analysis Edgar Gabriel C J Composite Formulas I Apd ngaimege mtmnnmaonmrnm Meh eNaB For equidistant points xi aih with h b xi xi l ifxdx 2k Tfxdx i1 XH mce IfOde s06 xi 1Zajfxi 1xi xi 1tj ajfxi 1 11 Thus MHZ foodx thiajfxl1htj i1 XH i1 jO 0080 3361 Numerical Analysis Edgar Gabriel C J Error estimates I Truncation error for the composite Formula b k rt emlthgt i fltxgtdx hZZajfltxil mj i1 jO Assuming that instead of the exact values fxi1htjwe can only calculate f with fOCH m1 1111quot 3 8f 0080 3361 Numerical Analysis Edgar Gabriel C J Error estimates ll The error is then n ajfiLJ39 O 6h M ffxdx h 1 j 3 II S M j fxdx h ajfxi1htj i0 l H m H n k trunc k n hZ ajfxi1htj hZZaj Lj i1 jO i1 jO eroundo 0080 3361 Numerical Analysis Edgar Gabriel C J Error estimates Ill Since a NewtonCotes formula is exact for all polynomials of degree at most n all methods of order gt 1 have to integrate pt c exactly Thus 1 k k Iptdtzczzajc Zaj1 101 0 i0 i0 Using 91 we can rewrite the roundoff error a k n k n emundo S hZZajfxi 1 htj hZZajfi 1j i1 jO i1 jO s hgfiiiaji 102 i1 jO 0080 3361 Numerical Analysis Edgar Gabriel C J Error estimates IV If all values for a are positive k k Zlajl2aj1 111 jO jO and emndo S hngf b a8f If not all values of ai are positive equation 111 is not correct Roundoff error is magnified by the process Calculation is not stable 0080 3361 Numerical Analysis Edgar Gabriel C J Conclusions All NewtonCotes formulas with purely positive coefficients a are numerically stable This is only the case for the algorithms of degree k 7 and k 9 Algorithms fork 8 or k 210 have some negative coefficients a and are therefore not stable 0080 3361 Numerical Analysis Edgar Gabriel C J Generalized quadrature formulas NewtonCotes For the formula of degree n we had n coefficients which had to be determined The choice of nodes t were done a priori The equations to determine the coefficients were set up such that the formula produces exact results for all polynomials of degree at most 17 Other definitions for the coefficients might be useful as well eg Cbhebyshev s quadrature formulas l fltxgtdxziarltrigt 01 M 0080 3361 Numerical Analysis Edgar Gabriel C J Gaussian quadrature formulas I Gaussian quadrature Determine the knots such that the resulting formulas of degree n is exact for all polynomials of degree 2n1 Introduce a weight function wx such that b n l fxwxdx z Zeami 141 a i0 Furthermore let q be a nonzero polynomial of degree n1 that is worthogonal to H Thus for any polynomial of degree n we have lqxpxwxdx 0 0080 3361 Numerical Analysis Edgar Gabriel C J Gaussian quadrature formulas ll Using the zeros of qx formula 141 will be exact for all polynomials of degree 2n1 The polynomials qx with the desired behaviour are called Legendre polynomials All zeros are simple roots Zeros of these functions are well documented for many degrees n After determining the zeros of the Legendre Polynomials of degree n determine the coefficients a using eg the method of undetermined coefficients 0080 3361 Numerical Analysis Edgar Gabriel C J Example Determine the Gaussian quadrature rule when ab1 1 WX1 and n2 The orthogonal polynomials are 3 q0x 1 q1x x q2x x2 q3x X3 X The roots of q3x are gig Thus 1 l fltxgtdxzaoflt 011f002f gt Using the method of undetermined coefficients one obtains 8 5 a0 051 052 0080 3361 Numerical Analysis Edgar Gabriel C J Coefficients of the Gaussian Quadrature fornu as All coefficients and zeros are transformed to the interval 01 k ai ti Degree 1 2 1 l 2 2 1 1 1i amp 4 2 2 2 6 6 3 3 3 3 LE 1 15 6 18 18 18 210 2 3 0080 3361 Numerical Analysis Edgar Gabriel C J Adaptive Quadrature Given a function f interval ab required accuracy 5 If a given method will not be sufficiently accurate on the given interval divide the interval into two equal parts Repeat this procedure until desired accuracy has been reached Problem how to estimate the error of the quadrature algorithm used 0080 3361 Numerical Analysis Edgar Gabriel C J Adaptive Quadrature ll Example Simpson s rule b a ab 6 fa4f 2 Sab l fxdx gtfltbgtEltaJagt with the error term being Ema itltb agt215flt4gtltcfgt 90 or slightly rewritten jfxdxSuvvu25f4 191 0080 3361 Numerical Analysis Edgar Gabriel C J Adaptive Quadrature III When subdividing into two subdomains jfxdx jfxdxjfxdx u 14 iw 5 4 Suw 90W u2f 52 i 5 4 SWv 90W W2f 53 5 Mjf 4gt f 4gt i 201 SuwSwv i 22 90 0080 3361 Numerical Analysis Edgar Gabriel C J Adaptive Quadrature IV With f W f 4gt 2f 4gt 3 equation 201 becomes l fxdx Sltuwgtsltwvgt v u5f 4gt 211 Note each subdomain has to fulfill the local error term given by 6i S 805139 xi 1Vu 212 Note WW usually not available Assumption over a small interval f 4gt c Thus 1mg flt4gt 1 213 0080 3361 Numerical Analysis Edgar Gabriel C J Adaptive Quadrature V Using 21 3 the term WW can be eliminated by multiplying 211 by 1615 gt 221 multiplying 191 by 115 gt 222 subtracting 222 from 221 This leads to Ifxdx a Su w Swv Suw Swv Suv 223 Error estimate 0080 3361 Numerical Analysis Edgar Gabriel C J Adaptive Quadrature Algorithm 39 Given f a b s hb a2 lh2 Calculate fafalfahfahlfb Calculate Sab Saah Sahb Calculate error term ell5SaahSahb Sltabl Compare e with the local error term as defined in 212 If accuracy not satisfactory start the same procedure twice by setting aa bah aah bb 0080 3361 Numerical Analysis Edgar Gabriel C J

### BOOM! Enjoy Your Free Notes!

We've added these Notes to your profile, click here to view them now.

### You're already Subscribed!

Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'

## Why people love StudySoup

#### "I was shooting for a perfect 4.0 GPA this semester. Having StudySoup as a study aid was critical to helping me achieve my goal...and I nailed it!"

#### "I bought an awesome study guide, which helped me get an A in my Math 34B class this quarter!"

#### "Knowing I can count on the Elite Notetaker in my class allows me to focus on what the professor is saying instead of just scribbling notes the whole time and falling behind."

#### "Their 'Elite Notetakers' are making over $1,200/month in sales by creating high quality content that helps their classmates in a time of need."

### Refund Policy

#### STUDYSOUP CANCELLATION POLICY

All subscriptions to StudySoup are paid in full at the time of subscribing. To change your credit card information or to cancel your subscription, go to "Edit Settings". All credit card information will be available there. If you should decide to cancel your subscription, it will continue to be valid until the next payment period, as all payments for the current period were made in advance. For special circumstances, please email support@studysoup.com

#### STUDYSOUP REFUND POLICY

StudySoup has more than 1 million course-specific study resources to help students study smarter. If you’re having trouble finding what you’re looking for, our customer support team can help you find what you need! Feel free to contact them here: support@studysoup.com

Recurring Subscriptions: If you have canceled your recurring subscription on the day of renewal and have not downloaded any documents, you may request a refund by submitting an email to support@studysoup.com

Satisfaction Guarantee: If you’re not satisfied with your subscription, you can contact us for further help. Contact must be made within 3 business days of your subscription purchase and your refund request will be subject for review.

Please Note: Refunds can never be provided more than 30 days after the initial purchase date regardless of your activity on the site.