Professional Documents
Culture Documents
Project Report
Project Report
c···®···d
PROJECT REPORT
NUMBERING METHODS
Topic 1: Using Simpson’s method to measure area of a province
Semester: 231
Group: 01
0
Table of Contents
PART I: THEOREM...........................................................................2
1.1. Introduction to Simpson method...................................................................................2
Reference:..........................................................................................15
1
PART I: THEOREM
The basic idea behind Simpson's rule is to divide the interval of integration into
smaller subintervals and approximate the function within each subinterval using
quadratic polynomials. The integral over each subinterval is then calculated by
integrating the quadratic polynomial. The results from all the subintervals are then
combined to obtain the final estimate of the integral.
The integral over each subinterval is then calculated using the quadratic
polynomial. Simpson's rule approximates the integral as the sum of the integrals over
all the subintervals. Mathematically, the integral using Simpson's rule can be
expressed as:
Δx
∫ [ a , b ] f ( x ) dx ≈
3
[ f ( a )+ 4 f ( a+ Δx )+ 2 f ( a+2 Δx ) +…+ 4 f ( b− Δx ) + f ( b ) ]
by ( b−a )
Where Δx is the width of each subinterval, given , where n is the number of
n
subintervals.
2
Assume that we subdivide the interval [a , b] into n=2 m subintervals. On each two
consecutive intervals, we use a curved trapezoid. Then this is the picture:
That is
Here
n
m=
2
3
Understanding the features of a province requires calculating its area. Simpson's
1/3 Rule is a dependable and effective solution for this activity.
1. Precision: Taking into account the land's smoothness and curvature, Simpson's
1/3 Rule yields exact findings.
3. Efficiency: By splitting the region and applying interpolation, the rule decreases
processing effort while preserving accuracy.
Cubic splines are a technique for generating a smooth curve that goes through a
set of points. The goal is to divide the curve into smaller parts and then fit a cubic
polynomial to each one.
The main idea is to make the final curve continuous and visually appealing.
Cubic splines impose the following criteria to do this:
1. Interpolation: The curve goes across each of the data points provided. This
guarantees that the produced curve represents the original data properly.
4
2. Continuity: There are no sudden shifts or discontinuities in the curve. This
implies that when neighbouring portions of the curve meet, they join
seamlessly.
3. Differentiability: The curve's derivatives are well-defined. This guarantees that
the curve is not just smooth but also Visually and statistically smooth, allowing
for additional analysis or calculations.
Cubic splines can meet these constraints by fitting cubic polynomials to each
segment. The cubic polynomials are sufficiently flexible to capture the curve's local
behaviour, and the constraints ensure that the segments blend together flawlessly.
Once the coefficients are determined, the cubic spline may be evaluated at any
desired position on the curve to yield the associated value.
5
1.2.1. Natural Cubic Spline
6
1.2.2. Clamped Cubic Spline
7
PART II: CALCULATION – MATLAB CODE
2.1. Procedure
Below is our team procedure of taking data:
1. We first take Bac Ninh province ID (1902690) from a geometry website called
OpenStreetMap1.Duplicate the layer in case the original layer has a problem, it can
still be fixed.
2. Then we access the website Polygon creation2, to download the polygon data of
Bac Ninh province.
3. We choose the poly data (as shown in the image) .
1
https://www.openstreetmap.org/
2
https:// Polygon creation (openstreetmap.fr)
8
2.2. Directions to solve the problem
The formula has the following form:
w
Area= ( y + 4 ( y odd ) +2 ( y even )− y last ) ( 1 )
3 first
When:
1. Use Google Earth to collect coordinates of Bac Ninh province with 2 upper and
lower contours.
2. Use a Cubic Spline to interpolate the function to approximate the upper and
lower boundaries, set the above functions as f ( x ) and g ( x ), respectively. Then
build the function y=h ( x ) =f ( x )−g ( x ) to correspond to each value of x i, we get
the value of y i as shown.
3. Divide the area to be calculated into 1645 segments from there we have:
x 1645 −x 1
w=
1645
9
2.2. MATLAB Code
clc;
clear;
file = 'bacninh.xlsx';
data = xlsread(file);
%
min_n1 = min(x1);
min_n2 = min(x2);
max_n1 = max(x1);
max_n2 = max(x2);
%
n = max(min_n1,min_n2); %starting point of the area
m = min(max_n1,max_n2); %ending point of the area
% Take the absolute value of the area under the curve of g(x)
10
area_g = abs(area_g);
11
title('Interpolated Functions');
xlabel('x');
ylabel('y');
legend('f(x)', 'g(x)');
grid on;
12
2.4. The Results
The Interpolation mapping
13
The Command Window
14
REFERENCE:
[1] Burden, Richard L., J. Douglas Faires, and Annette M. Burden. Numerical
analysis. Cengage learning, 2015.
15