NC Lab12
NC Lab12
2. Introduction:
Simpson’s 1/3 Rule:
Simpson’s 1/3 Rule is a method for numerical integration that provides a more accurate estimate for
the area under a curve by fitting parabolic segments instead of straight lines or rectangles. It is
especially effective for integrals of smooth functions. The basic principle involves dividing the
integration interval into an even number of subintervals (N), ensuring the use of parabolic
interpolation.
3. MATLAB Implementation:
Tasks
Task 1:
Find the area of an equation using Simpson’s 1/3 Rule.
For N=10
Code:
clc
clear all
close all
a = 0;
b = 10;
N = 10; % N must be even
h = (b - a) / N;
x = a:h:b;
y = 1 ./ (1 + (x.^2)); % Define the function
Conclusions:
- We have learned how to determine the area of an equation using Simpson’s 1/3 Rule.
- We have also implemented and verified the results using MATLAB.
2. Introduction:
Simpson’s 3/8 Rule:
Simpson’s 3/8 Rule is another method of numerical integration that provides a higher-order
approximation for the area under a curve by fitting cubic polynomials over three consecutive
subintervals. This method divides the integration range into multiple intervals, ensuring that
the number of subintervals (N) is a multiple of 3.
3. MATLAB Implementation:
Tasks
Task 1:
Find the area of an equation using Simpson’s 3/8 Rule.
For N=12
Code:
clc
clear all
close all
a = 0;
b = 10;
N = 12; % N must be a multiple of 3
h = (b - a) / N;
x = a:h:b;
y = 1 ./ (1 + (x.^2)); % Define the function
Conclusions:
- We have learned how to determine the area of an equation using Simpson’s 3/8 Rule.
- We have also implemented and verified the results using MATLAB.