Gauss Quadrature ppt1 (1) Edited

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 22

Gaussian Quadrature

PRESENTED BY –
Sanoj kushwaha
Sakshi hansaria
Sandeep kumar
Table of Contents -

 Introduction to gaussian quadrature methods.


 Derivation of Gauss Quadrature formula for 1 point, 2 points.
 Flowchart for program of Gauss quadrature.
 Algorithm of the Program.
 Code of Gauss quadrature.
 Output of program and analytical verification.
Introduction to Gaussian
quadrature:-

In numerical analysis, a quadrature rule is an


approximation of the definite integral of a function, usually
stated as a weighted sum of function values at specified
points within the domain of integration.
Method:-

 General formula for gauss quadrature rule is given as –

This formula is exact for polynomials upto degree( 2n −


1 ) and constracted by the suitable choice of the
arguments xi and corresponding weights wi for i = 1,
…, n.
Derivation of Gauss Quadrature
Formula
Derivation 1 point formula -
Derivation 1 point formula
continued...
Derivation 2 point formula -
Derivation 2 point formula
continued...
Derivation 2 point formula
continued...
Gaussian quadrature formula for any
general interval [a,b] :-

What if -1<x<1 not in range?


How can we use gaussian quadrature for this integral ∫ab f(t) dt.
Substitute, t =( b-a)x+(a+b) In above formula
2
Now when t=a x = -1
t=b x=1

We get,
1
∫a f(t) dt=(b-a) ∫-1f(((b-a)x+(a+b))/2) dx
b

2
START

DEFINE f(x)

FLOWCHART DEFINE required variables

Take the values of weights


and x from a file which is
already created
Do
CALCULATE int1,int2,int3 i=
1,
n
DISPLAY INTEGRATION int1,int2,int3

STOP
FLOWCHART

1
1
STAR
T 2
i=1

Enter which False PRINT THE SUM


point formula
to use(n) i<=n

True END

CALL FUNCTION

j=1 s=s+c(i)*f(x(I))

j<=
n

Read values
i=i+1
of x and c
from file 2

j=j+1

1
ALGORITHM

• Start the program.


• Define data type of variables used in the program.
• Ask the user to enter which point formula they want to be
used to evaluate the integral.
• Take input of weights and abscissas from a file.
• Calculate the required sum.
• Print the output .
• End the program.

• Define the function used in program externally.


• End the function.
Calculation -
Code
OUTPUT
THANK YOU!

You might also like