Post Reply 
16-Point Gaussian Quadrature
04-09-2021, 05:17 AM (This post was last modified: 04-09-2021 05:18 AM by Gamo.)
Post: #1
16-Point Gaussian Quadrature
Recently I try this program called 16-Point Gaussian Quadrature found
in the HP-11C Solutions Handbook on page 30

So this program do the Integration problem. I have try diffrent problem
and the answer come out very well except one.

This one doesn't give enough accuracy when compare to the
Integration Function on the HP-15C

Here is the problem: ∫ 0 to 2 √4 - X² dx = Pi = 3.141592654

On the HP-11C and HP-15 Equation is

[X²] [4] [X<>] [-] [√]

Answer on HP-11C is 3.141722674
Answer on HP-15C is 3.141592653

So is program provided on the HP-11C Solutions Book only give three
decimal place accuracy or it only happen to certain problem.

Gamo
Find all posts by this user
Quote this message in a reply
04-09-2021, 11:53 AM (This post was last modified: 04-09-2021 01:13 PM by robve.)
Post: #2
RE: 16-Point Gaussian Quadrature
(04-09-2021 05:17 AM)Gamo Wrote:  Here is the problem: ∫ 0 to 2 √4 - X² dx = Pi = 3.141592654

On the HP-11C and HP-15 Equation is

[X²] [4] [X<>] [-] [√]

Answer on HP-11C is 3.141722674
Answer on HP-15C is 3.141592653

This looks right and not bad for 16 points. 16 points will only give you a (rough) approximation of \( \int_0^2 \sqrt{4-x^2}\,dx \).

Gausss 10 point: 3.14209916979661
Gauss Kronrod 21 point: 3.14161975053083

By comparison (edited to add more examples):

Romberg 524289 points (1e-9 error threshold) gives 3.14159265256818
Romberg 16385 points (1e-7 error threshold) gives 3.14159265256818
Tanh-Sinh 56 points (1e-9 error threshold) gives 3.14159265358672
Tanh-Sinh 30 points (1e-7 error threshold) gives 3.14159265358975
Adaptive Simpson 417 points (1e-9 error threshold) gives 3.14159111522653
Adaptive Simpson 153 points (1e-7 error threshold) gives 3.14159111489381

- Rob

"I can count on my friends" -- HP 71B,Prime|Ti VOY200,Nspire CXII CAS|Casio fx-CG50...|Sharp PC-G850,E500,2500,1500,14xx,13xx,12xx...
Visit this user's website Find all posts by this user
Quote this message in a reply
04-09-2021, 04:41 PM
Post: #3
RE: 16-Point Gaussian Quadrature
(04-09-2021 05:17 AM)Gamo Wrote:  Here is the problem: ∫ 0 to 2 √4 - X² dx = Pi = 3.141592654

Both Gaussian and Romberg quadrature are based on fitting the curve to polynomial.
When X ≈ 2, the curve fall off a cliff, which is hard to curve fit by polynomial.

HP-15C does a u-substitution, which in this case, removed the cliff entirely.

int(√(4-x^2), x=0..2.)
= int(4*√(1-x^2), x=0..1.)
= int(24*u*(1-u) * √(1 - (u*u*(3-2*u))^2), u = 0..1.)

Try this u-transformed function, 16-points should converge to pi pretty good.

---

Another way is to avoid the cliff.

y = √(4-x²), x≥0       → x = √(4-y²)

Note the x/y symmetry, instead of integrating from 0 to 2, we can do 0 to √2
With limit = [0,√2], doubled the result over-counted by a square, area = (√2)² = 2

int(√(4-x^2), x=0..2.) = int(√(4-x^2), x=0..√(2.)) * 2 - 2
Find all posts by this user
Quote this message in a reply
04-10-2021, 02:54 AM
Post: #4
RE: 16-Point Gaussian Quadrature
The HP-15C Integration Function is excellent.

I will go back to read more information about this

great integration function in the Advance Functions Handbook.

Gamo
Find all posts by this user
Quote this message in a reply
04-10-2021, 03:50 PM
Post: #5
RE: 16-Point Gaussian Quadrature
(04-09-2021 05:17 AM)Gamo Wrote:  Here is the problem: ∫ 0 to 2 √4 - X² dx = Pi = 3.141592654

I put that exact integral on my last calculus test. :-)

(04-09-2021 04:41 PM)Albert Chan Wrote:  Try this u-transformed function, 16-points should converge to pi pretty good.

The TI-Nspire calculator uses this u-transformation with a 15 point Gauss-Kronrod method.
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)