SlideShare a Scribd company logo
3
Most read
7
Most read
PRACTICAL
Name- Saloni Singhal
M.Sc. (Statistics) II-Sem.
Roll No: 2046398
Course- MATH-409 L
Numerical Analysis Lab
Submitted To: Dr. S.C. Pandey
OBJECTIVE
1. Create an M-file to implement
Simpson’s Three-Eighth Rule
Theory
Simpson’s 3/8 (Simpson’s second) rule corresponds
to using third-order polynomials to fit four points.
Integration over the four points simplifies to
Error in Trapezoidal
Rule
Local Error
Global Error
Global Error O(h4)is sum total of all n/3 local error and
is of an order less than Local error O(h5)
Script File
a=input('Enter lower limit: ');
b=input('Enter upper limit: ');
n=input('Enter total no of subintervals: ');
if rem(n,3)
error('subintervals should be of third multiple')
end
h=(b-a)/n
for i=0:n
X(i+1)=a+1*h;
end
X
Y=exp(X)
ans=Y(1)+Y(n+1);
for j=2:3:n-1
ans=ans+(3*Y(j));
end
for k=3:3:n
ans=ans+(3+Y(k));
end
for l=4:3:n
ans=ans+(2*Y(l));
end
I=(3*h/8)*ans
syms x
f=exp(x)
true=int(f,a,b)
true
e=abs(I-true);
fprintf('Error is %f',e)
Output
Conclusion
• As in Simpson’s 1/3 and 3/8 rule, the even segment-odd-point formulas
have truncation errors that are the same order as formulas adding one more
point. For this reason, the even-segment odd-point formulas are usually the
methods of preference
• the error term is of same order but smaller than Simpson’s 1/3 rule and thus
provides more accurate result. It converges to estimated integral value more
quickly.
• 3/8ths rule is used for uniformly sampled function integration. Suppose we
have a function at equally spaced points. If the number of points is odd,
then the composite Simpson's rule works fine. If the number of points is
even, then one solution is to use the 3/8ths rule. For example, if the user
passed 6 samples, then we use Simpson's for the first three points, and
3/8ths for the last 4 (the middle point is common to both). This preserves
the order of accuracy without putting an arbitrary constraint on the number
Comparison of three
methods
F(x) Y=Exp(x)
h, a, b 30, -1, 5
Trapezoidal Rule I= 148.47 err=0.1173
Simpson 1/3 I=140.7802 err= 7.2650
Simpson 3/8 I=175.6348 err=28.5894
True value=148.045279661
I=Integrated Value by the Rule
Caveats
• The number of subintervals should be a multiple of 3
• When calculated manually, this formula is more complicated

More Related Content

PPTX
Simpson One-Third
PPT
Calc 4.6
PPTX
PDF
Efficient Accuracy: A Study on Numerical Integration.
PDF
Error analysis in numerical integration
PDF
Overviewing the techniques of Numerical Integration.pdf
PPTX
Algorithm Assignment Help
PPTX
Compiler Design - Ambiguous grammar, LMD & RMD, Infix & Postfix, Implementati...
Simpson One-Third
Calc 4.6
Efficient Accuracy: A Study on Numerical Integration.
Error analysis in numerical integration
Overviewing the techniques of Numerical Integration.pdf
Algorithm Assignment Help
Compiler Design - Ambiguous grammar, LMD & RMD, Infix & Postfix, Implementati...

Similar to Simpson's Three-Eighth Method (20)

PDF
13 Amortized Analysis
PPTX
NACA Regula Falsi Method
PDF
3 chapter2 algorithm_analysispart2
DOCX
Numerical Integration Project Report
PPTX
Numerical integration for engineering students.pptx
PPT
PatternMatching2.pptnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
PPTX
Error analysis
PDF
Lessonpart 2 lesson 3 Sample space events.pdf
PPTX
The Complexity Of Primality Testing
PPTX
Lesson3 part one Sample space events.pptx
PPTX
A07-derivarive-how to finde some values of
PPTX
Materi Integral Numerik MEtode Numerik UNntk Mahsiswa Teknik Elektro
PDF
Lesson3 chapter 3Sample space events.pptx.pdf
PDF
Lessonthree Sample space events.pptx.pdf
PPTX
Chapter08.pptx
PPTX
Python notes for students to learn and develop
PDF
Integration
PPT
12 13 h2_measurement_ppt
DOCX
error 2.pdf101316, 6(46 PM01_errorPage 1 of 5http.docx
13 Amortized Analysis
NACA Regula Falsi Method
3 chapter2 algorithm_analysispart2
Numerical Integration Project Report
Numerical integration for engineering students.pptx
PatternMatching2.pptnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
Error analysis
Lessonpart 2 lesson 3 Sample space events.pdf
The Complexity Of Primality Testing
Lesson3 part one Sample space events.pptx
A07-derivarive-how to finde some values of
Materi Integral Numerik MEtode Numerik UNntk Mahsiswa Teknik Elektro
Lesson3 chapter 3Sample space events.pptx.pdf
Lessonthree Sample space events.pptx.pdf
Chapter08.pptx
Python notes for students to learn and develop
Integration
12 13 h2_measurement_ppt
error 2.pdf101316, 6(46 PM01_errorPage 1 of 5http.docx
Ad

More from Saloni Singhal (20)

PPTX
Finite Difference Method
PPTX
Runge Kutta Method
PPTX
Euler Method
PPTX
Trapezoidal Rule
PPTX
Newton Forward Interpolation
PPTX
Newton Backward Interpolation
PPTX
Lagrange Interpolation
PPTX
Forward & Backward Differenece Table
PPTX
Bisection Method
PPTX
Newton's Raphson method
PPTX
Fixed Point Interation
PPTX
Power Method
PPTX
Eigen Show
PPTX
Inverse Power Method
PPTX
Convergence Analysis
PPTX
MARLAB codes for Gauss Seidel
PPTX
MATLAB Codes for Jacobi method
PPTX
L-U Decomposition
PPTX
Gauss Elimination (without pivot).pptx
PPTX
Gauss Elimination (With Partial Pivot)
Finite Difference Method
Runge Kutta Method
Euler Method
Trapezoidal Rule
Newton Forward Interpolation
Newton Backward Interpolation
Lagrange Interpolation
Forward & Backward Differenece Table
Bisection Method
Newton's Raphson method
Fixed Point Interation
Power Method
Eigen Show
Inverse Power Method
Convergence Analysis
MARLAB codes for Gauss Seidel
MATLAB Codes for Jacobi method
L-U Decomposition
Gauss Elimination (without pivot).pptx
Gauss Elimination (With Partial Pivot)
Ad

Recently uploaded (20)

PDF
168300704-gasification-ppt.pdfhghhhsjsjhsuxush
PPTX
Acceptance and paychological effects of mandatory extra coach I classes.pptx
PPTX
Introduction to Firewall Analytics - Interfirewall and Transfirewall.pptx
PPTX
MODULE 8 - DISASTER risk PREPAREDNESS.pptx
PPTX
Introduction to Knowledge Engineering Part 1
PPTX
iec ppt-1 pptx icmr ppt on rehabilitation.pptx
PPTX
Business Ppt On Nestle.pptx huunnnhhgfvu
PDF
Galatica Smart Energy Infrastructure Startup Pitch Deck
PDF
.pdf is not working space design for the following data for the following dat...
PPTX
1_Introduction to advance data techniques.pptx
PDF
Foundation of Data Science unit number two notes
PPTX
mbdjdhjjodule 5-1 rhfhhfjtjjhafbrhfnfbbfnb
PDF
22.Patil - Early prediction of Alzheimer’s disease using convolutional neural...
PPTX
Introduction-to-Cloud-ComputingFinal.pptx
PPTX
climate analysis of Dhaka ,Banglades.pptx
PPTX
Business Acumen Training GuidePresentation.pptx
PDF
“Getting Started with Data Analytics Using R – Concepts, Tools & Case Studies”
PPT
ISS -ESG Data flows What is ESG and HowHow
PPTX
Computer network topology notes for revision
PPTX
Data_Analytics_and_PowerBI_Presentation.pptx
168300704-gasification-ppt.pdfhghhhsjsjhsuxush
Acceptance and paychological effects of mandatory extra coach I classes.pptx
Introduction to Firewall Analytics - Interfirewall and Transfirewall.pptx
MODULE 8 - DISASTER risk PREPAREDNESS.pptx
Introduction to Knowledge Engineering Part 1
iec ppt-1 pptx icmr ppt on rehabilitation.pptx
Business Ppt On Nestle.pptx huunnnhhgfvu
Galatica Smart Energy Infrastructure Startup Pitch Deck
.pdf is not working space design for the following data for the following dat...
1_Introduction to advance data techniques.pptx
Foundation of Data Science unit number two notes
mbdjdhjjodule 5-1 rhfhhfjtjjhafbrhfnfbbfnb
22.Patil - Early prediction of Alzheimer’s disease using convolutional neural...
Introduction-to-Cloud-ComputingFinal.pptx
climate analysis of Dhaka ,Banglades.pptx
Business Acumen Training GuidePresentation.pptx
“Getting Started with Data Analytics Using R – Concepts, Tools & Case Studies”
ISS -ESG Data flows What is ESG and HowHow
Computer network topology notes for revision
Data_Analytics_and_PowerBI_Presentation.pptx

Simpson's Three-Eighth Method

  • 1. PRACTICAL Name- Saloni Singhal M.Sc. (Statistics) II-Sem. Roll No: 2046398 Course- MATH-409 L Numerical Analysis Lab Submitted To: Dr. S.C. Pandey
  • 2. OBJECTIVE 1. Create an M-file to implement Simpson’s Three-Eighth Rule
  • 3. Theory Simpson’s 3/8 (Simpson’s second) rule corresponds to using third-order polynomials to fit four points. Integration over the four points simplifies to
  • 4. Error in Trapezoidal Rule Local Error Global Error Global Error O(h4)is sum total of all n/3 local error and is of an order less than Local error O(h5)
  • 5. Script File a=input('Enter lower limit: '); b=input('Enter upper limit: '); n=input('Enter total no of subintervals: '); if rem(n,3) error('subintervals should be of third multiple') end h=(b-a)/n for i=0:n X(i+1)=a+1*h; end X Y=exp(X) ans=Y(1)+Y(n+1); for j=2:3:n-1 ans=ans+(3*Y(j)); end for k=3:3:n ans=ans+(3+Y(k)); end for l=4:3:n ans=ans+(2*Y(l)); end I=(3*h/8)*ans syms x f=exp(x) true=int(f,a,b) true e=abs(I-true); fprintf('Error is %f',e)
  • 7. Conclusion • As in Simpson’s 1/3 and 3/8 rule, the even segment-odd-point formulas have truncation errors that are the same order as formulas adding one more point. For this reason, the even-segment odd-point formulas are usually the methods of preference • the error term is of same order but smaller than Simpson’s 1/3 rule and thus provides more accurate result. It converges to estimated integral value more quickly. • 3/8ths rule is used for uniformly sampled function integration. Suppose we have a function at equally spaced points. If the number of points is odd, then the composite Simpson's rule works fine. If the number of points is even, then one solution is to use the 3/8ths rule. For example, if the user passed 6 samples, then we use Simpson's for the first three points, and 3/8ths for the last 4 (the middle point is common to both). This preserves the order of accuracy without putting an arbitrary constraint on the number
  • 8. Comparison of three methods F(x) Y=Exp(x) h, a, b 30, -1, 5 Trapezoidal Rule I= 148.47 err=0.1173 Simpson 1/3 I=140.7802 err= 7.2650 Simpson 3/8 I=175.6348 err=28.5894 True value=148.045279661 I=Integrated Value by the Rule
  • 9. Caveats • The number of subintervals should be a multiple of 3 • When calculated manually, this formula is more complicated