SlideShare uma empresa Scribd logo
1 de 9
Baixar para ler offline
University Of Delaware
Computational Mathematics
MATH426/CISC410
Depths of Despair
Authors:
Alyson Grassi
Ryan Hunte
Melanie Steiger
Yijun Zhou
Due: Monday, December 7, 2015
Contents
1 Introduction 2
2 Mathematical Content 2
2.1 Part 1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2.2 Part 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.3 Part 3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
3 Computational Content 4
3.1 Obtaining the Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3.2 Converting the Data to Kilometers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3.3 Computing the Volume . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
4 Verification of our Solution 7
5 Contributions 8
1
1 Introduction
In numerical computation, we approximate the integrand by an interpolant that we are able to integrate
exactly. This is known as quadrature. Quadrature is the integration of a function of one variable. When
we integrate a function of two variables, it is called cubature. This is precisely what we will be doing to
find the volume of a specific section of the ocean. Using a continuation of the trapezoid formula and build-
ing onto it, we will use our coordinates to create little rectangles R in our ocean patch. By taking the
double integral of these rectangles we are able to discretize each variable, which will result in a decompo-
sition of R in a rectangle with nodes at each corner. Doing this decomposition over the whole area of the
ocean patch and taking the sums of each individual volume will get us the volume of the whole ocean section.
2 Mathematical Content
In the following sections, we will show the required mathematical content that will ultimately allow us to
approximate the volume of water held in a section of the ocean.
2.1 Part 1.
The first part of the Mathematical Content asked us to derive the exact expressions for the interpolant Lij
over the rectangle whose lower left corner is (xi, yj), in terms of h, k, and four values Zij, Zi+1,j, Zi,j+1,
Zi+1,j+1. The steps we took to derive the interpolant are shown below.
There are four constants that need to be determined by the data at the four corners. We define the four
corner constants as a, b, c, and d. Then the accurate interpolation formula can be derived. The expression
is given as follows:
Lij(x, y) = a + bx + cy + dxy (2.1)
We let the four corner coordinates be represented as (xi, yj) where i = 1, 2 and j = 1, 2. Then, we plug these
into equation 2.1 and we end up with the set of four equations below.
L11 = a + bx1 + cy1 + dx1y1
L12 = a + bx1 + cy2 + dx1y2
L21 = a + bx2 + cy1 + dx2y1
L22 = a + bx2 + cy2 + dx2y2
(2.2)
In equation set 2.2, a, b, c, and d are unknown and everything else is known. Therefore, by solving the
above set of equations for a, b, c, and d we obtain results which can be found in the corresponding MATLAB
MuPad Notebook titled “Project3”. (This file will be attached to the submission along with our ocean
function.)
2
2.2 Part 2.
The second part of the Mathematical Content asked us to integrate the interpolant over the rectangle to get
another expression in terms of the same quantities.
The formula to find the volume of an object described by the function f is defined as:
V =
R
f(x, y) dx dy (2.3)
Where R ∈ [x0, xm] × [y0, yn]. Therefore, we can define that for each small rectangular area r, we have that
r ∈ [xi, xi+1] × [yj, yj+1].
Then, we find the volume Vij to be:
Vij =
r
Lij(x, y) dx dy (2.4)
Vij =
r
(a + bx + cy + dxy) dx dy (2.5)
Vij =
xi+1
xi
yj+1
yj
(a + bx + cy + dxy) dx dy (2.6)
Vij =
1
4
(xi+1 − xi) (yi+1 − yi) (4a + 2bxi + 2bxi+1 + 2cyj + 2cyj+1 + dxiyj + dxi+1yj + dxiyj+1 + dxi+1yj+1)
(2.7)
2.3 Part 3.
The third part of the Mathematical Content asked us to show that if the Vij are added up over all i and j,
the result is identical to applying the trapezoid formula in each direction sequentially over the domain (i.e.,
as an iterated integral).
First, we discretize each variable using the space steps h and k, respectively, so that xi = x0 + ih for
i = 0, ..., m, and yi = y0 + jk for j = 0, ..., n. This requires that h = (xm − x0)/m and k = (yn − y0)/n.
After applying this discretization over the entire region R ∈ [x0, xm]×[y0, yn], the formula for the cumulative
volume becomes:
V =
R
f(x, y) dx dy (2.8)
V = Vij dv (2.9)
(2.10)V =
xm
x0
yn
y0
1
4
(xi+1 − xi) (yi+1 − yi) (4a + 2bxi + 2bxi+1 + 2cyj + 2cyj+1 + dxiyj + dxi+1yj
+ dxiyj+1 + dxi+1yj+1) dx dy
3
When we apply the trapezoid formula we obtain:
V =
R
f(x, y) dx dy (2.11)
V = Vij dv (2.12)
(2.13)
V ≈
xm
x0
yn
y0
hk
1
2
f(x0) + f(x1) + f(x2) + L
+ f(xm−1 +
1
2
f(xm)
1
2
f(y0) + f(y1) + f(y2) + L + f(yn−1) +
1
2
f(yn) dx dy
In principle, the two formulas above, 2.10 and 2.13, are identical.
3 Computational Content
In the following section we will explain the details that are needed to acquire the same raw data from the
GeoMapApp and compute our volume result.
3.1 Obtaining the Data
In order to obtain the raw data from the app, we had to first download the GeoMapApp and choose a map
location. Once the location was chosen, we were able to zoom in several times to a part of the ocean. We
made sure that our image only included about 1-2 degrees of latitude.
More specifically, when choosing the world view, we chose the ”Mercator” view. This view gives us a better
distinction between the different oceans. We decided to take data from a section of the Atlantic Ocean
off the coast of Florida. The longitude and latitude coordinates of our section of data were, respectively,
about 073.6°W to 071.6°W and 030.4°N to 031.5°N. Clicking the load grid and grid-lines button provides a
histogram of elevation in the section of ocean, which gives us the z value for every x and y longitude and
latitude coordinates. We then extracted the data and imported it into MATLAB, which gave us 494, 802
data points.
3.2 Converting the Data to Kilometers
In order to convert the raw data into units of kilometers we chose to use a built in MATLAB function called
“deg2km”. We decided to use our own version of Earth’s radius, in kilometers, so that it is the most updated
numerical value. Below is the code we used to convert the x and y vectors of values to kilometers.
R = 6378.1; % radius of earth in kilometers
kmX = deg2km(X( : ) ,R) ;
4
kmY = deg2km(Y( : ) ,R) ;
After we have converted x and y to kilometers, we need to convert z, the depth, into kilometers as well.
When we downloaded the raw data from the GeoMapApp we are given the z data in meters. Therefore, to
convert to kilometers, all we need to do is divide all of the values of z by 1000.
Z = Z./1000;
3.3 Computing the Volume
Our function, ocean(x, y, z), takes the three vectors of data that are exported from the GeoMapApp using
the process we explained in an earlier section (“Obtaining the Data”). We can import the extracted data
using:
data = importdata ( ’ Project3Data2 . xyz ’ ) ;
% extract x , y , z
x = data ( : , 1 ) ;
y = data ( : , 2 ) ;
z = data ( : , 3 ) ;
The above process allows us to test our function in a script file.
Now, we will explain what our function does. Inside of our function, the first things computed are the
dimensions needed in order to convert x, y, and z into matrices.
num = length (x ) ;
n=0;
i f i s e q u a l (x (1) , x (2))
f or i = 1:num
i f x( i )˜= x( i +1)
n = i ; % Y d i r e c t i o n node number
m = f i x (num/n ) ; % X d i r e c t i o n node number
break ;
end
end
e l s e i f i s e q u a l (y (1) , y (2))
f or i =1:num
i f y( i )˜= y( i +1)
m = i ; % X d i r e c t i o n node number
n = f i x (num/m) ; % Y d i r e c t i o n node number
break ;
end
5
end
e l s e
disp ( ’ Your data i s wrong ! ’ )
end
Once the dimensions are determined, we convert the vectors x, y, and z into kilometers using the method
described in the previous section, “Converting the Data to Kilometers”, and then we reshaped the vectors
into matrices.
Z = reshape ( z ( 1 :m∗n ) ,m, n ) ;
X = reshape (x ( 1 :m∗n ) ,m, n ) ;
Y = reshape (y ( 1 :m∗n ) ,m, n ) ;
The final part of our function takes everything we have done so far and implements our mathematical content
to find the volume:
volume = 0;
f or i = 1:m 1
f or j = 1: n 1
x range = X( i +1, j ) X( i , j ) ;
y range = Y( i , j +1) Y( i , j ) ;
z = mean ( [ Z( i , j ) ,Z( i +1, j ) ,Z( i +1, j +1) ,Z( i , j +1)]);
volume = abs ( volume)+x range ∗ y range ∗ z ;
end
end
After running our function ocean with the imported data from the GeoMapApp, we obtain a volume of
1.351236736093395 × 1005
km3
. Below you can see a recreation of our ocean using the data after it has been
converted to kilometers and reshaped:
6
Figure 1: Sea Surface Simulation: volume = 1.35125 × 1005
.
4 Verification of our Solution
To verify our volume function we decided to evaluate the volume of a rectangular prism that closely rep-
resented our data. For the x and y coordinates we took the difference between the largest value and the
smallest vale to represent the length and width of the prism. For the height, we took the absolute value of
the average of all the z values in our data. We have to take the absolute value since all the z values represent
depth, being measured down from sea level, and are therefore negative. Using basic geometry, we multiplied
the length, width, and height to obtain a volume of our simplified ocean. Below is the code that we used to
verify our volume.
% Given raw data x , y , z
% Step 1: convert to kilometers
R = 6378.1; % radius of earth in kilometers
kmX = deg2km(x ( : ) ,R) ;
kmY = deg2km(y ( : ) ,R) ;
kmZ = z ./1000;
% Step 2: find the distance f o r X and Y
x d i s t = max(kmX) min(kmX) ;
y d i s t = max(kmY) min(kmY) ;
% Step 3: find the average Z value
z height = abs (sum(kmZ)/ s i z e (Z , 1 ) ) ;
7
% Step 4: find the volume of a rectangle
volume = x d i s t ∗ y d i s t ∗ z height ;
Implementing this code on the data we found using the GeoMapApp, we obtain a volume of
1.351220950860681 × 105
. Our volume function returns 1.351236736093395 × 1005
when run with our data.
We can automatically check that our two volume results are of the same magnitude using:
o r d e r t e s t = f l o o r ( log10 (v ) ) ;
order ver = f l o o r ( log10 ( volume ) ) ;
i f ( o r d e r t e s t == order ver )
disp ( ’ The order of magnitude i s correct ! ’ )
e l s e
disp ( ’ The order of magnitude i s wrong ! ’ )
end
Therefore, when we run the above code using our value obtain from our volume function (test) and the value
obtained from the verification method (ver) we return “The order of magnitude is correct!”
5 Contributions
In this section we will be explaining what each team member specifically contributed to this project.
Our team members include:
1. Alyson Grassi: Alyson converted the data from degrees into kilometers and worked with Melanie to
determine our verification method. She also, helped to debug the ocean function. She typed and refined
all of the mathematical content from Yijun into LaTeX and organized the paper. Alyson helped to
edit the final paper.
2. Ryan Hunte: Ryan assisted in trying to get the code to run properly. He asked questions to get the
team thinking and trying to solve problems in a different perspective. He wrote the introduction to
the paper and also helped edit the final paper.
3. Melanie Steiger: Melanie retrieved the data from the GeoMapApp and explained the process under
the ’Computational Content’ section. She also worked with Alyson in creating the verification method
and helped debug the ocean function. Melanie helped to edit the final paper.
4. Yijun Zhou: Yijun coded the rough draft of the ocean function and some debugging. Later, she tried
in different ways and edited the function to work properly. She also worked on mathematical content
and wrote up a draft of mathematical content (Part 2). She edited MATLAB MuPad Notebook titled
”Project3”, which makes mathematical derivation more understandable.
8

Mais conteúdo relacionado

Mais procurados

Better Visualization of Trips through Agglomerative Clustering
Better Visualization of  Trips through     Agglomerative ClusteringBetter Visualization of  Trips through     Agglomerative Clustering
Better Visualization of Trips through Agglomerative ClusteringAnbarasan S
 
EENG519FinalProjectReport
EENG519FinalProjectReportEENG519FinalProjectReport
EENG519FinalProjectReportDaniel K
 
Solucionario serway cap 3
Solucionario serway cap 3Solucionario serway cap 3
Solucionario serway cap 3Carlo Magno
 
K Means Clustering Algorithm | K Means Clustering Example | Machine Learning ...
K Means Clustering Algorithm | K Means Clustering Example | Machine Learning ...K Means Clustering Algorithm | K Means Clustering Example | Machine Learning ...
K Means Clustering Algorithm | K Means Clustering Example | Machine Learning ...Simplilearn
 
K MEANS CLUSTERING
K MEANS CLUSTERINGK MEANS CLUSTERING
K MEANS CLUSTERINGsingh7599
 
Particle Physics Report
Particle Physics ReportParticle Physics Report
Particle Physics ReportDrew Silcock
 
Numerical analysis stationary variables
Numerical analysis  stationary variablesNumerical analysis  stationary variables
Numerical analysis stationary variablesSHAMJITH KM
 
SupportVectorRegression
SupportVectorRegressionSupportVectorRegression
SupportVectorRegressionDaniel K
 
L5 determination of natural frequency & mode shape
L5 determination of natural frequency & mode shapeL5 determination of natural frequency & mode shape
L5 determination of natural frequency & mode shapeSam Alalimi
 

Mais procurados (19)

ClusterAnalysis
ClusterAnalysisClusterAnalysis
ClusterAnalysis
 
Better Visualization of Trips through Agglomerative Clustering
Better Visualization of  Trips through     Agglomerative ClusteringBetter Visualization of  Trips through     Agglomerative Clustering
Better Visualization of Trips through Agglomerative Clustering
 
Computer Network Assignment Help
Computer Network Assignment HelpComputer Network Assignment Help
Computer Network Assignment Help
 
Rough K Means - Numerical Example
Rough K Means - Numerical ExampleRough K Means - Numerical Example
Rough K Means - Numerical Example
 
Multi degree of freedom systems
Multi degree of freedom systemsMulti degree of freedom systems
Multi degree of freedom systems
 
EENG519FinalProjectReport
EENG519FinalProjectReportEENG519FinalProjectReport
EENG519FinalProjectReport
 
Solucionario serway cap 3
Solucionario serway cap 3Solucionario serway cap 3
Solucionario serway cap 3
 
K Means Clustering Algorithm | K Means Clustering Example | Machine Learning ...
K Means Clustering Algorithm | K Means Clustering Example | Machine Learning ...K Means Clustering Algorithm | K Means Clustering Example | Machine Learning ...
K Means Clustering Algorithm | K Means Clustering Example | Machine Learning ...
 
K MEANS CLUSTERING
K MEANS CLUSTERINGK MEANS CLUSTERING
K MEANS CLUSTERING
 
Fuzzy c means manual work
Fuzzy c means manual workFuzzy c means manual work
Fuzzy c means manual work
 
Text s1 21
Text s1 21Text s1 21
Text s1 21
 
Algorithm
AlgorithmAlgorithm
Algorithm
 
Particle Physics Report
Particle Physics ReportParticle Physics Report
Particle Physics Report
 
New test123
New test123New test123
New test123
 
Numerical analysis stationary variables
Numerical analysis  stationary variablesNumerical analysis  stationary variables
Numerical analysis stationary variables
 
Group 6 NDE project
Group 6 NDE projectGroup 6 NDE project
Group 6 NDE project
 
SupportVectorRegression
SupportVectorRegressionSupportVectorRegression
SupportVectorRegression
 
L5 determination of natural frequency & mode shape
L5 determination of natural frequency & mode shapeL5 determination of natural frequency & mode shape
L5 determination of natural frequency & mode shape
 
TunUp final presentation
TunUp final presentationTunUp final presentation
TunUp final presentation
 

Destaque (15)

MACardelloConsultant_2
MACardelloConsultant_2MACardelloConsultant_2
MACardelloConsultant_2
 
Commodity Research Report 16 January 2017 Ways2Capital
Commodity Research Report 16 January 2017 Ways2CapitalCommodity Research Report 16 January 2017 Ways2Capital
Commodity Research Report 16 January 2017 Ways2Capital
 
Pawan_Kumar_111
Pawan_Kumar_111Pawan_Kumar_111
Pawan_Kumar_111
 
CAHAYA
CAHAYACAHAYA
CAHAYA
 
Herramientas Open Source
Herramientas Open SourceHerramientas Open Source
Herramientas Open Source
 
Tics
TicsTics
Tics
 
Taller Audiovisual 2
Taller Audiovisual 2Taller Audiovisual 2
Taller Audiovisual 2
 
Diccionario de términos musicales
Diccionario de términos musicalesDiccionario de términos musicales
Diccionario de términos musicales
 
foros y blog
foros y blogforos y blog
foros y blog
 
Gas measurement
Gas measurementGas measurement
Gas measurement
 
Día histórico autobahn criolla - medallero
Día histórico   autobahn criolla - medalleroDía histórico   autobahn criolla - medallero
Día histórico autobahn criolla - medallero
 
Toda medición tecnicas validez y confiabilidad
Toda medición tecnicas validez y confiabilidadToda medición tecnicas validez y confiabilidad
Toda medición tecnicas validez y confiabilidad
 
Cómo hacer fotos con fondo borroso
Cómo hacer fotos con fondo borrosoCómo hacer fotos con fondo borroso
Cómo hacer fotos con fondo borroso
 
Media Forecast 2009
Media Forecast 2009Media Forecast 2009
Media Forecast 2009
 
Artigo niosh
Artigo nioshArtigo niosh
Artigo niosh
 

Semelhante a Math426_Project3-1

Developing Expert Voices
Developing Expert VoicesDeveloping Expert Voices
Developing Expert Voicessuzanne
 
The Day You Finally Use Algebra: A 3D Math Primer
The Day You Finally Use Algebra: A 3D Math PrimerThe Day You Finally Use Algebra: A 3D Math Primer
The Day You Finally Use Algebra: A 3D Math PrimerJanie Clayton
 
Week 3-4 solutions
Week 3-4 solutionsWeek 3-4 solutions
Week 3-4 solutionsBrian Larson
 
The Application of Derivatives
The Application of DerivativesThe Application of Derivatives
The Application of Derivativesdivaprincess09
 
Computer graphic
Computer graphicComputer graphic
Computer graphicnusratema1
 
Automatic Classification Satellite images for weather Monitoring
Automatic Classification Satellite images for weather MonitoringAutomatic Classification Satellite images for weather Monitoring
Automatic Classification Satellite images for weather Monitoringguest7782414
 
Q1Perform the two basic operations of multiplication and divisio.docx
Q1Perform the two basic operations of multiplication and divisio.docxQ1Perform the two basic operations of multiplication and divisio.docx
Q1Perform the two basic operations of multiplication and divisio.docxamrit47
 
Physique et Chimie de la Terre Physics and Chemistry of the .docx
Physique et Chimie de la Terre  Physics and Chemistry of the .docxPhysique et Chimie de la Terre  Physics and Chemistry of the .docx
Physique et Chimie de la Terre Physics and Chemistry of the .docxLacieKlineeb
 
Visualization of general defined space data
Visualization of general defined space dataVisualization of general defined space data
Visualization of general defined space dataijcga
 
3D Math Primer: CocoaConf Chicago
3D Math Primer: CocoaConf Chicago3D Math Primer: CocoaConf Chicago
3D Math Primer: CocoaConf ChicagoJanie Clayton
 
Plotting position and velocity
Plotting position and velocityPlotting position and velocity
Plotting position and velocityabidraza88
 
MA 243 Calculus III Fall 2015 Dr. E. JacobsAssignmentsTh.docx
MA 243 Calculus III Fall 2015 Dr. E. JacobsAssignmentsTh.docxMA 243 Calculus III Fall 2015 Dr. E. JacobsAssignmentsTh.docx
MA 243 Calculus III Fall 2015 Dr. E. JacobsAssignmentsTh.docxinfantsuk
 
Mathematical blog #1
Mathematical blog #1Mathematical blog #1
Mathematical blog #1Steven Pauly
 
Computer Graphics & linear Algebra
Computer Graphics & linear Algebra Computer Graphics & linear Algebra
Computer Graphics & linear Algebra Xad Kuain
 
A Rapid Location Independent Full Tensor Gravity Algorithm
A Rapid Location Independent Full Tensor Gravity AlgorithmA Rapid Location Independent Full Tensor Gravity Algorithm
A Rapid Location Independent Full Tensor Gravity AlgorithmPioneer Natural Resources
 

Semelhante a Math426_Project3-1 (20)

Developing Expert Voices
Developing Expert VoicesDeveloping Expert Voices
Developing Expert Voices
 
The Day You Finally Use Algebra: A 3D Math Primer
The Day You Finally Use Algebra: A 3D Math PrimerThe Day You Finally Use Algebra: A 3D Math Primer
The Day You Finally Use Algebra: A 3D Math Primer
 
1543 integration in mathematics b
1543 integration in mathematics b1543 integration in mathematics b
1543 integration in mathematics b
 
Week 3-4 solutions
Week 3-4 solutionsWeek 3-4 solutions
Week 3-4 solutions
 
The Application of Derivatives
The Application of DerivativesThe Application of Derivatives
The Application of Derivatives
 
Computer graphic
Computer graphicComputer graphic
Computer graphic
 
Automatic Classification Satellite images for weather Monitoring
Automatic Classification Satellite images for weather MonitoringAutomatic Classification Satellite images for weather Monitoring
Automatic Classification Satellite images for weather Monitoring
 
Q1Perform the two basic operations of multiplication and divisio.docx
Q1Perform the two basic operations of multiplication and divisio.docxQ1Perform the two basic operations of multiplication and divisio.docx
Q1Perform the two basic operations of multiplication and divisio.docx
 
Physique et Chimie de la Terre Physics and Chemistry of the .docx
Physique et Chimie de la Terre  Physics and Chemistry of the .docxPhysique et Chimie de la Terre  Physics and Chemistry of the .docx
Physique et Chimie de la Terre Physics and Chemistry of the .docx
 
M112rev
M112revM112rev
M112rev
 
v1chap1.pdf
v1chap1.pdfv1chap1.pdf
v1chap1.pdf
 
Cgm Lab Manual
Cgm Lab ManualCgm Lab Manual
Cgm Lab Manual
 
Visualization of general defined space data
Visualization of general defined space dataVisualization of general defined space data
Visualization of general defined space data
 
3D Math Primer: CocoaConf Chicago
3D Math Primer: CocoaConf Chicago3D Math Primer: CocoaConf Chicago
3D Math Primer: CocoaConf Chicago
 
Plotting position and velocity
Plotting position and velocityPlotting position and velocity
Plotting position and velocity
 
MA 243 Calculus III Fall 2015 Dr. E. JacobsAssignmentsTh.docx
MA 243 Calculus III Fall 2015 Dr. E. JacobsAssignmentsTh.docxMA 243 Calculus III Fall 2015 Dr. E. JacobsAssignmentsTh.docx
MA 243 Calculus III Fall 2015 Dr. E. JacobsAssignmentsTh.docx
 
Mathematical blog #1
Mathematical blog #1Mathematical blog #1
Mathematical blog #1
 
Computer Graphics & linear Algebra
Computer Graphics & linear Algebra Computer Graphics & linear Algebra
Computer Graphics & linear Algebra
 
A Rapid Location Independent Full Tensor Gravity Algorithm
A Rapid Location Independent Full Tensor Gravity AlgorithmA Rapid Location Independent Full Tensor Gravity Algorithm
A Rapid Location Independent Full Tensor Gravity Algorithm
 
Cgm Lab Manual
Cgm Lab ManualCgm Lab Manual
Cgm Lab Manual
 

Math426_Project3-1

  • 1. University Of Delaware Computational Mathematics MATH426/CISC410 Depths of Despair Authors: Alyson Grassi Ryan Hunte Melanie Steiger Yijun Zhou Due: Monday, December 7, 2015
  • 2. Contents 1 Introduction 2 2 Mathematical Content 2 2.1 Part 1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 2.2 Part 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2.3 Part 3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 3 Computational Content 4 3.1 Obtaining the Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 3.2 Converting the Data to Kilometers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 3.3 Computing the Volume . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 4 Verification of our Solution 7 5 Contributions 8 1
  • 3. 1 Introduction In numerical computation, we approximate the integrand by an interpolant that we are able to integrate exactly. This is known as quadrature. Quadrature is the integration of a function of one variable. When we integrate a function of two variables, it is called cubature. This is precisely what we will be doing to find the volume of a specific section of the ocean. Using a continuation of the trapezoid formula and build- ing onto it, we will use our coordinates to create little rectangles R in our ocean patch. By taking the double integral of these rectangles we are able to discretize each variable, which will result in a decompo- sition of R in a rectangle with nodes at each corner. Doing this decomposition over the whole area of the ocean patch and taking the sums of each individual volume will get us the volume of the whole ocean section. 2 Mathematical Content In the following sections, we will show the required mathematical content that will ultimately allow us to approximate the volume of water held in a section of the ocean. 2.1 Part 1. The first part of the Mathematical Content asked us to derive the exact expressions for the interpolant Lij over the rectangle whose lower left corner is (xi, yj), in terms of h, k, and four values Zij, Zi+1,j, Zi,j+1, Zi+1,j+1. The steps we took to derive the interpolant are shown below. There are four constants that need to be determined by the data at the four corners. We define the four corner constants as a, b, c, and d. Then the accurate interpolation formula can be derived. The expression is given as follows: Lij(x, y) = a + bx + cy + dxy (2.1) We let the four corner coordinates be represented as (xi, yj) where i = 1, 2 and j = 1, 2. Then, we plug these into equation 2.1 and we end up with the set of four equations below. L11 = a + bx1 + cy1 + dx1y1 L12 = a + bx1 + cy2 + dx1y2 L21 = a + bx2 + cy1 + dx2y1 L22 = a + bx2 + cy2 + dx2y2 (2.2) In equation set 2.2, a, b, c, and d are unknown and everything else is known. Therefore, by solving the above set of equations for a, b, c, and d we obtain results which can be found in the corresponding MATLAB MuPad Notebook titled “Project3”. (This file will be attached to the submission along with our ocean function.) 2
  • 4. 2.2 Part 2. The second part of the Mathematical Content asked us to integrate the interpolant over the rectangle to get another expression in terms of the same quantities. The formula to find the volume of an object described by the function f is defined as: V = R f(x, y) dx dy (2.3) Where R ∈ [x0, xm] × [y0, yn]. Therefore, we can define that for each small rectangular area r, we have that r ∈ [xi, xi+1] × [yj, yj+1]. Then, we find the volume Vij to be: Vij = r Lij(x, y) dx dy (2.4) Vij = r (a + bx + cy + dxy) dx dy (2.5) Vij = xi+1 xi yj+1 yj (a + bx + cy + dxy) dx dy (2.6) Vij = 1 4 (xi+1 − xi) (yi+1 − yi) (4a + 2bxi + 2bxi+1 + 2cyj + 2cyj+1 + dxiyj + dxi+1yj + dxiyj+1 + dxi+1yj+1) (2.7) 2.3 Part 3. The third part of the Mathematical Content asked us to show that if the Vij are added up over all i and j, the result is identical to applying the trapezoid formula in each direction sequentially over the domain (i.e., as an iterated integral). First, we discretize each variable using the space steps h and k, respectively, so that xi = x0 + ih for i = 0, ..., m, and yi = y0 + jk for j = 0, ..., n. This requires that h = (xm − x0)/m and k = (yn − y0)/n. After applying this discretization over the entire region R ∈ [x0, xm]×[y0, yn], the formula for the cumulative volume becomes: V = R f(x, y) dx dy (2.8) V = Vij dv (2.9) (2.10)V = xm x0 yn y0 1 4 (xi+1 − xi) (yi+1 − yi) (4a + 2bxi + 2bxi+1 + 2cyj + 2cyj+1 + dxiyj + dxi+1yj + dxiyj+1 + dxi+1yj+1) dx dy 3
  • 5. When we apply the trapezoid formula we obtain: V = R f(x, y) dx dy (2.11) V = Vij dv (2.12) (2.13) V ≈ xm x0 yn y0 hk 1 2 f(x0) + f(x1) + f(x2) + L + f(xm−1 + 1 2 f(xm) 1 2 f(y0) + f(y1) + f(y2) + L + f(yn−1) + 1 2 f(yn) dx dy In principle, the two formulas above, 2.10 and 2.13, are identical. 3 Computational Content In the following section we will explain the details that are needed to acquire the same raw data from the GeoMapApp and compute our volume result. 3.1 Obtaining the Data In order to obtain the raw data from the app, we had to first download the GeoMapApp and choose a map location. Once the location was chosen, we were able to zoom in several times to a part of the ocean. We made sure that our image only included about 1-2 degrees of latitude. More specifically, when choosing the world view, we chose the ”Mercator” view. This view gives us a better distinction between the different oceans. We decided to take data from a section of the Atlantic Ocean off the coast of Florida. The longitude and latitude coordinates of our section of data were, respectively, about 073.6°W to 071.6°W and 030.4°N to 031.5°N. Clicking the load grid and grid-lines button provides a histogram of elevation in the section of ocean, which gives us the z value for every x and y longitude and latitude coordinates. We then extracted the data and imported it into MATLAB, which gave us 494, 802 data points. 3.2 Converting the Data to Kilometers In order to convert the raw data into units of kilometers we chose to use a built in MATLAB function called “deg2km”. We decided to use our own version of Earth’s radius, in kilometers, so that it is the most updated numerical value. Below is the code we used to convert the x and y vectors of values to kilometers. R = 6378.1; % radius of earth in kilometers kmX = deg2km(X( : ) ,R) ; 4
  • 6. kmY = deg2km(Y( : ) ,R) ; After we have converted x and y to kilometers, we need to convert z, the depth, into kilometers as well. When we downloaded the raw data from the GeoMapApp we are given the z data in meters. Therefore, to convert to kilometers, all we need to do is divide all of the values of z by 1000. Z = Z./1000; 3.3 Computing the Volume Our function, ocean(x, y, z), takes the three vectors of data that are exported from the GeoMapApp using the process we explained in an earlier section (“Obtaining the Data”). We can import the extracted data using: data = importdata ( ’ Project3Data2 . xyz ’ ) ; % extract x , y , z x = data ( : , 1 ) ; y = data ( : , 2 ) ; z = data ( : , 3 ) ; The above process allows us to test our function in a script file. Now, we will explain what our function does. Inside of our function, the first things computed are the dimensions needed in order to convert x, y, and z into matrices. num = length (x ) ; n=0; i f i s e q u a l (x (1) , x (2)) f or i = 1:num i f x( i )˜= x( i +1) n = i ; % Y d i r e c t i o n node number m = f i x (num/n ) ; % X d i r e c t i o n node number break ; end end e l s e i f i s e q u a l (y (1) , y (2)) f or i =1:num i f y( i )˜= y( i +1) m = i ; % X d i r e c t i o n node number n = f i x (num/m) ; % Y d i r e c t i o n node number break ; end 5
  • 7. end e l s e disp ( ’ Your data i s wrong ! ’ ) end Once the dimensions are determined, we convert the vectors x, y, and z into kilometers using the method described in the previous section, “Converting the Data to Kilometers”, and then we reshaped the vectors into matrices. Z = reshape ( z ( 1 :m∗n ) ,m, n ) ; X = reshape (x ( 1 :m∗n ) ,m, n ) ; Y = reshape (y ( 1 :m∗n ) ,m, n ) ; The final part of our function takes everything we have done so far and implements our mathematical content to find the volume: volume = 0; f or i = 1:m 1 f or j = 1: n 1 x range = X( i +1, j ) X( i , j ) ; y range = Y( i , j +1) Y( i , j ) ; z = mean ( [ Z( i , j ) ,Z( i +1, j ) ,Z( i +1, j +1) ,Z( i , j +1)]); volume = abs ( volume)+x range ∗ y range ∗ z ; end end After running our function ocean with the imported data from the GeoMapApp, we obtain a volume of 1.351236736093395 × 1005 km3 . Below you can see a recreation of our ocean using the data after it has been converted to kilometers and reshaped: 6
  • 8. Figure 1: Sea Surface Simulation: volume = 1.35125 × 1005 . 4 Verification of our Solution To verify our volume function we decided to evaluate the volume of a rectangular prism that closely rep- resented our data. For the x and y coordinates we took the difference between the largest value and the smallest vale to represent the length and width of the prism. For the height, we took the absolute value of the average of all the z values in our data. We have to take the absolute value since all the z values represent depth, being measured down from sea level, and are therefore negative. Using basic geometry, we multiplied the length, width, and height to obtain a volume of our simplified ocean. Below is the code that we used to verify our volume. % Given raw data x , y , z % Step 1: convert to kilometers R = 6378.1; % radius of earth in kilometers kmX = deg2km(x ( : ) ,R) ; kmY = deg2km(y ( : ) ,R) ; kmZ = z ./1000; % Step 2: find the distance f o r X and Y x d i s t = max(kmX) min(kmX) ; y d i s t = max(kmY) min(kmY) ; % Step 3: find the average Z value z height = abs (sum(kmZ)/ s i z e (Z , 1 ) ) ; 7
  • 9. % Step 4: find the volume of a rectangle volume = x d i s t ∗ y d i s t ∗ z height ; Implementing this code on the data we found using the GeoMapApp, we obtain a volume of 1.351220950860681 × 105 . Our volume function returns 1.351236736093395 × 1005 when run with our data. We can automatically check that our two volume results are of the same magnitude using: o r d e r t e s t = f l o o r ( log10 (v ) ) ; order ver = f l o o r ( log10 ( volume ) ) ; i f ( o r d e r t e s t == order ver ) disp ( ’ The order of magnitude i s correct ! ’ ) e l s e disp ( ’ The order of magnitude i s wrong ! ’ ) end Therefore, when we run the above code using our value obtain from our volume function (test) and the value obtained from the verification method (ver) we return “The order of magnitude is correct!” 5 Contributions In this section we will be explaining what each team member specifically contributed to this project. Our team members include: 1. Alyson Grassi: Alyson converted the data from degrees into kilometers and worked with Melanie to determine our verification method. She also, helped to debug the ocean function. She typed and refined all of the mathematical content from Yijun into LaTeX and organized the paper. Alyson helped to edit the final paper. 2. Ryan Hunte: Ryan assisted in trying to get the code to run properly. He asked questions to get the team thinking and trying to solve problems in a different perspective. He wrote the introduction to the paper and also helped edit the final paper. 3. Melanie Steiger: Melanie retrieved the data from the GeoMapApp and explained the process under the ’Computational Content’ section. She also worked with Alyson in creating the verification method and helped debug the ocean function. Melanie helped to edit the final paper. 4. Yijun Zhou: Yijun coded the rough draft of the ocean function and some debugging. Later, she tried in different ways and edited the function to work properly. She also worked on mathematical content and wrote up a draft of mathematical content (Part 2). She edited MATLAB MuPad Notebook titled ”Project3”, which makes mathematical derivation more understandable. 8