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

CE324 – 2F

Numerical Solutions
to CE Problems

1
UNIVERSITY OF SCIENCE AND TECHNOLOGY OF SOUTHERN PHILIPPINES

Alubijid | Cagayan de Oro | Claveria | Jasaan | Oroquieta | Panaon

Claro M. Recto Avenue, Lapasan 9000 Cagayan de Oro City, Philippines

CE324: Numerical Solutions to CE Problems

Laboratory Activity 4: Curve Fitting and Interpolation


How Well Do the Curve and
Estimation Describe the Data?

Group 5 – BSCE_2F

Tuble Jr, Jerome M


Cadar, Sittie Johanisah
Eboras, Yohan
Gomez, Miguel
Yaba, Rhaiza Mae

Technical Report
No. 4

2
UNIVERSITY OF SCIENCE AND TECHNOLOGY OF SOUTHERN PHILIPPINES

Alubijid | Cagayan de Oro | Claveria | Jasaan | Oroquieta | Panaon

Claro M. Recto Avenue, Lapasan 9000 Cagayan de Oro City, Philippines

INTRODUCTION

One challenge in statistical analysis is finding patterns and correlations


in data and determining how strong these correlations are. Curve fitting
introduces the idea of finding a trend in a data set. It is a way to find a curve
that best fits a given set of data points.

The curve that is fit to the data is typically a mathematical function, such
as a polynomial. The process of curve fitting involves choosing an appropriate
function and then adjusting the parameters of the function to minimize the
difference between the predicted values and the observed data. It can include
interpolation, which is the process of estimating values between data points.

In summary, curve fitting and interpolation are both techniques used to


work with discrete data. Curve fitting is used when dealing with data points
with some inaccuracy or scatter, aiming to capture the general trend. In
contrast, interpolation is used when the data points are known to be very
accurate, allowing for precise estimation between the given data points.

3
UNIVERSITY OF SCIENCE AND TECHNOLOGY OF SOUTHERN PHILIPPINES

Alubijid | Cagayan de Oro | Claveria | Jasaan | Oroquieta | Panaon

Claro M. Recto Avenue, Lapasan 9000 Cagayan de Oro City, Philippines

OBJECTIVES

In this laboratory activity, we aim to learn:

To find the best equations that would fit a series of data points
using polynomial regression and determine the goodness of
the fit.

To get familiar with Lagrange interpolation and determine


the interpolating function for a given set of data.

To compare and contrast curve fitting and interpolation and


determine a better method for solving real-world data.
.
MATERIALS AND EQUIPMENT

1.) Laptop / Desktop PC

2.) Microsoft Excel

3.) Reference Source

4
UNIVERSITY OF SCIENCE AND TECHNOLOGY OF SOUTHERN PHILIPPINES

Alubijid | Cagayan de Oro | Claveria | Jasaan | Oroquieta | Panaon

Claro M. Recto Avenue, Lapasan 9000 Cagayan de Oro City, Philippines

PROBLEM SET

REGRESSION

You are tasked to conduct a tension test in a company you are newly hired
into. In order to determine rubber’s stress-strain behavior, you conducted 16
tests as shown in the table below.

Strain Stress
1. Determine the fourth order polynomial that
0 0
best fits the data points you recorded.
0.4 3.0
(30 points)
0.8 4.5

1.2 5.8 2. Make a plot of the data points you recorded


1.6 5.9 and the curve that corresponds to your
2.0 5.8 polynomial. (20 points)
2.4 6.2

2.8 7.4
3. Find your correlation coefficient? What
3.2 9.6
does your coefficient imply? (10 points)
3.6 15.6

4.0 20.7

4.4 26.7

4.8 31.1

5.2 35.6

5.6 39.3

6.0 41.5

5
UNIVERSITY OF SCIENCE AND TECHNOLOGY OF SOUTHERN PHILIPPINES

Alubijid | Cagayan de Oro | Claveria | Jasaan | Oroquieta | Panaon

Claro M. Recto Avenue, Lapasan 9000 Cagayan de Oro City, Philippines

PROBLEM SET

INTERPOLATION

After doing the Tension Test, your next task is to observe the intensity
of earthquake and its impact to a miniature of your company’s proposed
building. The data you gathered were shown in the table below.

Time (t) 5 6 10 13 15

Vibrating Factor 52 5 -5 -40 10

1. Utilizing Lagrange form, determine the fourth-order


polynomial that passes through the points. (30 points)

2. Use your formulated polynomial to determine the vibration


factor at t = 8s. (10 points)

3. Plot the data points you recorded and your interpolating


curve. (20 points)

6
UNIVERSITY OF SCIENCE AND TECHNOLOGY OF SOUTHERN PHILIPPINES

Alubijid | Cagayan de Oro | Claveria | Jasaan | Oroquieta | Panaon

Claro M. Recto Avenue, Lapasan 9000 Cagayan de Oro City, Philippines

METHODS
REGRESSION
1. Determine the fourth order polynomial that best fits the data points you
recorded.

a.) Determine the order of the given polynomial to be fit, m and the number of data
points, n. Denote the strain and stress variables as the x and y values.
m=4
n=6

b.) Compute the following quantities:


∑ 𝑥𝑖 = 𝑥1 + 𝑥2 + 𝑥3 + 𝑥4 + 𝑥5 + 𝑥6 + 𝑥7 + 𝑥8 + 𝑥9 + 𝑥10 +
𝑥11 + 𝑥12 + 𝑥13 + 𝑥14 + 𝑥15 + 𝑥16
∑ 𝑥𝑖 = 0 + 0.4 + 0.8 + 1.2 + 1.6 + 2.0 + 2.4 + 2.8 + 3.2 + 3.6 + 4.0 + 4.4 +
4.8 + 5.2 + 5.6 + 6.0
∑ 𝑥𝑖 = 48

∑ 𝑦𝑖 = 𝑦1 + 𝑦 + 𝑦3 + 𝑦4 + 𝑦5 + 𝑦6 + 𝑦7 + 𝑦8 + 𝑦9 + 𝑦10 +
𝑦11 + 𝑦12 + 𝑦13 + 𝑦14 + 𝑦15 + 𝑦16
∑ 𝑦𝑖 = 0 + 3.0 + 4.5 + 5.8 + 5.9 + 5.8 + 6.2 + 7.4 + 9.6 + 15.6 + 20.7 +
26.7 + 31.1 + 35.6 + 39.3 + 41.5
∑ 𝑦𝑖 = 258.7

∑ 𝑥𝑖 2 = 𝑥1 2 + 𝑥2 2 + 𝑥3 2 + 𝑥4 2 + 𝑥5 2 + 𝑥6 2 + 𝑥7 2 + 𝑥8 2 + 𝑥9 2 + 𝑥10 2 +
𝑥11 2 + 𝑥12 2 + 𝑥13 2 + 𝑥14 2 + 𝑥15 2 + 𝑥16 2
2
∑ 𝑥𝑖 = 0 + 0.16 + 0.64 + 1.44 + 2.56 + 4.0 + 5.76 + 7.84 + 10.24 +
12.96 + 16.0 + 19.36 + 23.04 + 27.04 + 31.36 + 36.0
∑ 𝑥𝑖 2 = 198.4

7
UNIVERSITY OF SCIENCE AND TECHNOLOGY OF SOUTHERN PHILIPPINES

Alubijid | Cagayan de Oro | Claveria | Jasaan | Oroquieta | Panaon

Claro M. Recto Avenue, Lapasan 9000 Cagayan de Oro City, Philippines

METHODS

∑ 𝑥𝑖 3 = 𝑥1 3 + 𝑥2 3 + 𝑥3 3 + 𝑥4 3 + 𝑥5 3 + 𝑥6 3 + 𝑥7 3 + 𝑥8 3 + 𝑥9 3 + 𝑥10 3 +
𝑥11 3 + 𝑥12 3 + 𝑥13 3 + 𝑥14 3 + 𝑥15 3 + 𝑥16 3
∑ 𝑥𝑖 3 = 0 + 0.064 + 0.512 + 1.728 + 4.096 + 8.0 + 13.824 + 21.952 +
32.768 + 46.656 + 64.0 + 85.184 + 110.592 + 140.608 + 175.616 +
216.0
∑ 𝑥𝑖 3 = 921.60

∑ 𝑥𝑖 4 = 𝑥1 4 + 𝑥2 4 + 𝑥3 4 + 𝑥4 4 + 𝑥5 4 + 𝑥6 4 + 𝑥7 4 + 𝑥8 4 + 𝑥9 4 + 𝑥10 4 +
𝑥11 4 + 𝑥12 4 + 𝑥13 4 + 𝑥14 4 + 𝑥15 4 + 𝑥16 4
4
∑ 𝑥𝑖 = 0 + 0.0256 + 0.4096 + 2.0736 + 6.5536 + 16.0 + 33.1776 +
61.4656 + 104.8576 + 167.9616 + 256.0 + 374.8096 + 530.8416 +
731.1616 + 983.4496 + 1296.0
4
∑ 𝑥𝑖 = 4564 . 7872

∑ 𝑥𝑖 5 = 𝑥1 5 + 𝑥2 5 + 𝑥3 5 + 𝑥4 5 + 𝑥5 5 + 𝑥6 5 + 𝑥7 5 + 𝑥8 5 + 𝑥9 5 + 𝑥10 5 +
𝑥11 5 + 𝑥12 5 + 𝑥13 5 + 𝑥14 5 + 𝑥15 5 + 𝑥16 5
∑ 𝑥𝑖 5 = 0 + 0.01024 + 0.32768 + 2.48832 + 10.48576 + 32.0 + 79.62624 +
172.10368 + 335.54432 + 604.66176 + 1024.0 + 1649.16224 +
2548.03968 + 3802.04032 + 5507.31776 + 7776.0
5
∑ 𝑥𝑖 = 23543.808

∑ 𝑥𝑖 6 = 𝑥1 6 + 𝑥2 6 + 𝑥3 6 + 𝑥4 6 + 𝑥5 6 + 𝑥6 6 + 𝑥7 6 + 𝑥8 6 + 𝑥9 6 + 𝑥10 6 +
𝑥11 6 + 𝑥12 6 + 𝑥13 6 + 𝑥14 6 + 𝑥15 6 + 𝑥16 6
∑ 𝑥𝑖 6 = 0 + 0.004096 + 0.262144 + 2.985984 + 16.777216 + 64.0 +
191.102976 + 481.890304 + 1037.741824 + 2176.782336 +
4096.0 + 7256.313856 + 12230.59046 + 19770.60966 +
30840.97946 + 46656.0
6
∑ 𝑥𝑖 = 124858.0403

8
UNIVERSITY OF SCIENCE AND TECHNOLOGY OF SOUTHERN PHILIPPINES

Alubijid | Cagayan de Oro | Claveria | Jasaan | Oroquieta | Panaon

Claro M. Recto Avenue, Lapasan 9000 Cagayan de Oro City, Philippines

METHODS

∑ 𝑥𝑖 7 = 𝑥1 7 + 𝑥2 7 + 𝑥3 7 + 𝑥4 7 + 𝑥5 7 + 𝑥6 7 + 𝑥7 7 + 𝑥8 7 + 𝑥9 7 + 𝑥10 7 +
𝑥11 7 + 𝑥12 7 + 𝑥13 7 + 𝑥14 7 + 𝑥15 7 + 𝑥16 7
∑ 𝑥𝑖 7 = 0 + 0.0016384 + 0.2097152 + 3.5831808 + 26.8435456 + 128.08 +
458.6471424 + 1349.292851 + 2425.019983 + 7836.41641 + 16384 +
31927.78097 + 58706.83423 + 102807.1703 + 172709.485 + 279936
∑ 𝑥𝑖 7 = 675710.2387

∑ 𝑥𝑖 8 = 𝑥1 8 + 𝑥2 8 + 𝑥3 8 + 𝑥4 8 + 𝑥5 8 + 𝑥6 8 + 𝑥7 8 + 𝑥8 8 + 𝑥9 8 + 𝑥10 8 +
𝑥11 8 + 𝑥12 8 + 𝑥13 8 + 𝑥14 8 + 𝑥15 8 + 𝑥16 8
∑ 𝑥𝑖 8 = 0 + 0.00065536 + 0.16777216 + 4.29981696 + 42.94967296 + 256 +
1100.753142 + 3778.019983 + 10995.11628 + 28211.09907 + 65536 +
140482.2363 + 281792.8043 + 534597.2853 + 967173.1157 + 1679616
∑ 𝑥𝑖 8 = 3713585.848

∑ 𝑥𝑖 𝑦𝑖 = [(𝑥1 )(𝑦1 )] + [(𝑥2 )(𝑦2 )] + [(𝑥3 )(𝑦3 )] + [(𝑥4 )(𝑦4 )] + [(𝑥5 )(𝑦5 )] +
[(𝑥6 )(𝑦6 )] + [(𝑥7 )(𝑦7 )] + [(𝑥8 )(𝑦8 )] + [(𝑥9 )(𝑦9 )] + [(𝑥10)(𝑦10 )] +
[(𝑥11 )(𝑦11 )] + [(𝑥12 )(𝑦12 )] + [(𝑥13 )(𝑦13 )] + [(𝑥14 )(𝑦14 )] +
[(𝑥15 )(𝑦15 )] + [(𝑥16 )(𝑦16 )]
∑ 𝑥𝑖 𝑦𝑖 = 1159.04

∑ 𝑥𝑖 2 𝑦𝑖 = [(𝑥1 )2 (𝑦1 )] + [(𝑥2 )2 (𝑦2 )] + [(𝑥3 )2 (𝑦3 )] + [(𝑥4 )2 (𝑦4 )] + [(𝑥5 )2 (𝑦5 )] +
[(𝑥6 )2 (𝑦6 )] + [(𝑥7 )2 (𝑦7 )] + [(𝑥8 )2 (𝑦8 )] + [(𝑥9 )2 (𝑦9 )] + [(𝑥10 )2 (𝑦10 )] +
[(𝑥11 )2 (𝑦11 )] + [(𝑥12 )2 (𝑦12 )] + [(𝑥13 )2(𝑦13 )] + [(𝑥14 )2 (𝑦14 )] +
[(𝑥15 )2 (𝑦15 )] + [(𝑥16 )2 (𝑦16 )]
∑ 𝑥𝑖 2 𝑦𝑖 = 5697.952

9
\

UNIVERSITY OF SCIENCE AND TECHNOLOGY OF SOUTHERN PHILIPPINES

Alubijid | Cagayan de Oro | Claveria | Jasaan | Oroquieta | Panaon

Claro M. Recto Avenue, Lapasan 9000 Cagayan de Oro City, Philippines

METHODS

∑ 𝑥𝑖 3 𝑦𝑖 = [(𝑥1 )3 (𝑦1 )] + [(𝑥2 )3 (𝑦2 )] + [(𝑥3 )3 (𝑦3 )] + [(𝑥4 )3 (𝑦4 )] + [(𝑥5 )3 (𝑦5 )] +
[(𝑥6 )3 (𝑦6 )] + [(𝑥7 )3 (𝑦7 )] + [(𝑥8 )3 (𝑦8 )] + [(𝑥9 )3 (𝑦9 )] + [(𝑥10 )3 (𝑦10 )] +
[(𝑥11 )3 (𝑦11 )] + [(𝑥12 )3 (𝑦12 )] + [(𝑥13 )3(𝑦13 )] + [(𝑥14 )3 (𝑦14 )] +
[(𝑥15 )3 (𝑦15 )] + [(𝑥16 )3 (𝑦16 )]
∑ 𝑥𝑖 3 𝑦𝑖 = 29283.6224

∑ 𝑥𝑖 4 𝑦𝑖 = [(𝑥1 )4 (𝑦1 )] + [(𝑥2 )4 (𝑦2 )] + [(𝑥3 )4 (𝑦3 )] + [(𝑥4 )4 (𝑦4 )] + [(𝑥5 )4 (𝑦5 )] +
[(𝑥6 )4 (𝑦6 )] + [(𝑥7 )4 (𝑦7 )] + [(𝑥8 )4 (𝑦8 )] + [(𝑥9 )4 (𝑦9 )] + [(𝑥10 )4 (𝑦10 )] +
[(𝑥11 )4 (𝑦11 )] + [(𝑥12 )4 (𝑦12 )] + [(𝑥13 )4(𝑦13 )] + [(𝑥14 )4 (𝑦14 )] +
[(𝑥15 )4 (𝑦15 )] + [(𝑥16 )4 (𝑦16 )]
∑ 𝑥𝑖 4 𝑦𝑖 = 154711.5059

c.) Use the acquired quantities in substituting values in the quartic polynomial
regression formula.

𝑦 = 𝑎0 + 𝑎1 𝑥 + 𝑎2 𝑥 2 + 𝑎3 𝑥 3 + 𝑎4 𝑥 4

𝑛𝑎0 + (∑ 𝑥𝑖 ) 𝑎1 + (∑ 𝑥𝑖 2 ) 𝑎2 + (∑ 𝑥𝑖 3 ) 𝑎3 + (∑ 𝑥𝑖 4 ) 𝑎4 = ∑ 𝑦𝑖

(∑ 𝑥𝑖 ) 𝑎0 + (∑ 𝑥𝑖 2 ) 𝑎1 + (∑ 𝑥𝑖 3 ) 𝑎2 + (∑ 𝑥𝑖 4 ) 𝑎3 + (∑ 𝑥𝑖 5 ) 𝑎4 = ∑ 𝑥𝑖 𝑦𝑖

(∑ 𝑥𝑖 2 ) 𝑎0 + (∑ 𝑥𝑖 3 ) 𝑎1 + (∑ 𝑥𝑖 4 ) 𝑎2 + (∑ 𝑥𝑖 5 ) 𝑎3 + (∑ 𝑥𝑖 6 ) 𝑎4 = ∑ 𝑥𝑖 2 𝑦𝑖

(∑ 𝑥𝑖 3 ) 𝑎0 + (∑ 𝑥𝑖 4 ) 𝑎1 + (∑ 𝑥𝑖 5 ) 𝑎2 + (∑ 𝑥𝑖 6 ) 𝑎3 + (∑ 𝑥𝑖 7 ) 𝑎4 = ∑ 𝑥𝑖 3 𝑦𝑖

(∑ 𝑥𝑖 4 ) 𝑎0 + (∑ 𝑥𝑖 5 ) 𝑎1 + (∑ 𝑥𝑖 6 ) 𝑎2 + (∑ 𝑥𝑖 7 ) 𝑎3 + (∑ 𝑥𝑖 8 ) 𝑎4 = ∑ 𝑥𝑖 4 𝑦𝑖

10
UNIVERSITY OF SCIENCE AND TECHNOLOGY OF SOUTHERN PHILIPPINES

Alubijid | Cagayan de Oro | Claveria | Jasaan | Oroquieta | Panaon

Claro M. Recto Avenue, Lapasan 9000 Cagayan de Oro City, Philippines

METHODS

16𝑎0 + 48𝑎1 + (198.4)𝑎2 + (921.6)𝑎3 + (4564.7872)𝑎4 = 258.7


48𝑎0 + (198.4)𝑎1 + (921.6)𝑎2 + (4564.7872)𝑎3 + (23543.808)𝑎4 = 1159.04
(198.4)𝑎0 + (921.6)𝑎1 + (4564.7872)𝑎2 + (23543.808)𝑎3 + (124858.0403)𝑎4 = 5697.952
(921.6)𝑎0 + (4564.7872)𝑎1 + (23543.808)𝑎2 + (124858.0403)𝑎3 + (675710.2387)𝑎4 = 29283.6224
(4564.7872)𝑎0 + (23543.808)𝑎1 + (124858.0403)𝑎2 + (675710.2387)𝑎3 + (3713585.848)𝑎4
= 154711.5059

d.) Express the system of equations in matrix form, then solve for the unknown middle
column by means of matrices. The resulting values represent the polynomial
coefficients for the quartic equation.

𝑎0 = −0.27462356052
𝑎1 = 12.87805301274
𝑎2 = −10.192725006691
𝑎3 = 3.11856340771
𝑎4 = −0.264438997001

11
UNIVERSITY OF SCIENCE AND TECHNOLOGY OF SOUTHERN PHILIPPINES

Alubijid | Cagayan de Oro | Claveria | Jasaan | Oroquieta | Panaon

Claro M. Recto Avenue, Lapasan 9000 Cagayan de Oro City, Philippines

METHODS

e.) Substitute the resulting values as polynomial coefficients to the general form of the quartic
equation.

2. Make a plot of the data points you recorded and the curve that corresponds to
your polynomial

a.) Use excel data points feature.

3. Find your correlation coefficient? What does your coefficient imply?

a.) Compute for its error analysis.


2 2 2 2 2 2
∑ 𝑦𝑖 ∑ 𝑦𝑖 ∑ 𝑦𝑖 ∑ 𝑦𝑖 ∑ 𝑦𝑖 ∑ 𝑦𝑖
∑ (𝑦𝑖 − ) = (𝑦1 − ) + (𝑦2 − ) + (𝑦3 − ) + (𝑦4 − ) + (𝑦5 − )
𝑛 𝑛 𝑛 𝑛 𝑛 𝑛
∑ 𝑦𝑖
2
∑ 𝑦𝑖
2
∑ 𝑦𝑖
2
∑ 𝑦𝑖 2 ∑ 𝑦𝑖 2
+ (𝑦6 − ) + (𝑦7 − ) + (𝑦8 − ) + (𝑦9 − ) + (𝑦10 − )
𝑛 𝑛 𝑛 𝑛 𝑛
∑ 𝑦𝑖 2 ∑ 𝑦𝑖 2 ∑ 𝑦𝑖 2 ∑ 𝑦𝑖 2 ∑ 𝑦𝑖 2
+ (𝑦11 − ) + (𝑦12 − ) + (𝑦13 − ) + (𝑦14 − ) + (𝑦15 − )
𝑛 𝑛 𝑛 𝑛 𝑛
∑ 𝑦𝑖 2
+ (𝑦16 − )
𝑛
2
∑ 𝑦𝑖
∑ (𝑦𝑖 − ) = 3019.894375
𝑛

12
UNIVERSITY OF SCIENCE AND TECHNOLOGY OF SOUTHERN PHILIPPINES

Alubijid | Cagayan de Oro | Claveria | Jasaan | Oroquieta | Panaon

Claro M. Recto Avenue, Lapasan 9000 Cagayan de Oro City, Philippines

METHODS

∑(𝑦𝑖 − 𝑎0 − 𝑎1 𝑥 − 𝑎2 𝑥 2 − 𝑎3 𝑥 3 − 𝑎4 𝑥 4 ) = 0.0754181 + 0.192353564 + 0.242935761 + 0.209622515


+ 0.387114549 + 0.137752368 + 0.003819631 + 0.463456147 + 2.037554748
+ 0.269379288 + 0.411890309 + 1.180571738 + 0.019214129 + 0.439749927
+ 0.3069563 + 0.234365358

∑(𝑦𝑖 − 𝑎0 − 𝑎1 𝑥 − 𝑎2 𝑥 2 − 𝑎3 𝑥 3 − 𝑎4 𝑥 4 ) = 6.612154433

b.) Solve for its coefficient of determination.

c.) Solve for its correlation coefficient by finding the square root of the coefficient of
determination.
3019.894375 − 6.612154433
𝑟= √
3019.894375
𝑟 = 0.998904634

13
UNIVERSITY OF SCIENCE AND TECHNOLOGY OF SOUTHERN PHILIPPINES

Alubijid | Cagayan de Oro | Claveria | Jasaan | Oroquieta | Panaon

Claro M. Recto Avenue, Lapasan 9000 Cagayan de Oro City, Philippines

METHODS
INTERPOLATION
1. Utilizing Lagrange form, determine the fourth-order polynomial that passes
through the points.

a.) Determine the order of the given polynomial.


m = n-1= 5-1= 4

b.) Solve using the Lagrange interpolation formula for 4th-order polynomial.
(𝑥 − 𝑥1 )(𝑥 − 𝑥2 )(𝑥 − 𝑥3 )(𝑥 − 𝑥4 ) (𝑥 − 𝑥0 )(𝑥 − 𝑥2 )(𝑥 − 𝑥3 )(𝑥 − 𝑥4 )
𝑓(𝑥) = (𝑦0 ) + (𝑦1 )
(𝑥0 − 𝑥1 )(𝑥0 − 𝑥2 )(𝑥0 − 𝑥3 )(𝑥0 − 𝑥4 ) (𝑥1 − 𝑥0 )(𝑥1 − 𝑥2 )(𝑥1 − 𝑥3 )(𝑥1 − 𝑥4 )
(𝑥 − 𝑥0 )(𝑥 − 𝑥1 )(𝑥 − 𝑥3 )(𝑥 − 𝑥4 ) (𝑥 − 𝑥0 )(𝑥 − 𝑥1 )(𝑥 − 𝑥2 )(𝑥 − 𝑥4 )
+ (𝑦2 ) + (𝑦3 )
(𝑥2 − 𝑥0 )(𝑥2 − 𝑥1 )(𝑥2 − 𝑥3 )(𝑥2 − 𝑥4 ) (𝑥3 − 𝑥0 )(𝑥3 − 𝑥1 )(𝑥3 − 𝑥2 )(𝑥3 − 𝑥4 )
(𝑥 − 𝑥0 )(𝑥 − 𝑥1 )(𝑥 − 𝑥2 )(𝑥 − 𝑥3 )
+ (𝑦4 )
(𝑥4 − 𝑥0 )(𝑥4 − 𝑥1 )(𝑥4 − 𝑥2 )(𝑥4 − 𝑥3 )

c.) Substitute the values available in the table and simplify.

2. Use your formulated polynomial to determine the vibration factor at t = 8s.

a.) Substitute the given value to the Lagrange interpolation formula.


(8 − 𝑡1 )(8 − 𝑡2 )(8 − 𝑡3 )(8 − 𝑡4 ) (8 − 𝑡0 )(8 − 𝑡2 )(8 − 𝑡3 )(8 − 𝑡4 ) (8 − 𝑡0 )(8 − 𝑡1 )(8 − 𝑡3 )(8 − 𝑡4 )
𝑓(8) = (𝑦0 ) + (𝑦1 ) + (𝑦2 )
(𝑡0 − 𝑡1 )(𝑡0 − 𝑡2 )(𝑡0 − 𝑡3 )(𝑡0 − 𝑡4 ) (𝑡1 − 𝑡0 )(𝑡1 − 𝑡2 )(𝑡1 − 𝑡3 )(𝑡1 − 𝑡4 ) (𝑡2 − 𝑡0 )(𝑡2 − 𝑡1 )(𝑡2 − 𝑡3 )(𝑡2 − 𝑡4 )
(8 − 𝑡0 )(8 − 𝑡1 )(8 − 𝑡2 )(8 − 𝑡4 ) (8 − 𝑡0 )(8 − 𝑡1 )(8 − 𝑡2 )(8 − 𝑡3 )
+ (𝑦3 ) + (𝑦4 )
(𝑡3 − 𝑡0 )(𝑡3 − 𝑡1 )(𝑡3 − 𝑡2 )(𝑡3 − 𝑡4 ) (𝑡4 − 𝑡0 )(𝑡4 − 𝑡1 )(𝑡4 − 𝑡2 )(𝑡4 − 𝑡3 )

3. Plot the data points you recorded and your interpolating curve.

14
UNIVERSITY OF SCIENCE AND TECHNOLOGY OF SOUTHERN PHILIPPINES

Alubijid | Cagayan de Oro | Claveria | Jasaan | Oroquieta | Panaon

Claro M. Recto Avenue, Lapasan 9000 Cagayan de Oro City, Philippines

RESULTS

REGRESSION
1. Determine the fourth order polynomial that best fits the data points you
recorded.
i xi yi x i2 x i3 x i4 x i5 x i6 x i7 x i8
1 0 0 0 0 0 0 0 0 0
2 0.4 3 0.16 0.064 0.0256 0.01024 0.004096 0.0016384 0.00065536
3 0.8 4.5 0.64 0.512 0.4096 0.32768 0.262144 0.2097152 0.16777216
4 1.2 5.8 1.44 1.728 2.0736 2.48832 2.985984 3.5831808 4.29981696
5 1.6 5.9 2.56 4.096 6.5536 10.48576 16.777216 26.8435456 42.94967296
6 2.0 5.8 4 8 16 32 64 128 256
7 2.4 6.2 5.76 13.824 33.1776 79.62624 191.102976 458.6471424 1100.753142
8 2.8 7.4 7.84 21.952 61.4656 172.10368 481.890304 1349.292851 3778.019983
9 3.2 9.6 10.24 32.768 104.8576 335.54432 1073.741824 3435.973837 10995.11628
10 3.6 15.6 12.96 46.656 167.9616 604.66176 2176.782336 7836.41641 28211.09907
11 4.0 20.7 16 64 256 1024 4096 16384 65536
12 4.4 26.7 19.36 85.184 374.8096 1649.16224 7256.313856 31927.78097 140482.2363
13 4.8 31.1 23.04 110.592 530.8416 2548.03968 12230.59046 58706.83423 281792.8043
14 5.2 35.6 27.04 140.608 731.1616 3802.04032 19770.60966 102807.1703 534597.2853
15
x i y i5.6 39.3 2
xi yi 31.36
x i 3 y 175.616
i
983.4496
x i4y i 5507.31776 30840.97946
(y i -ȳ) 2
(y 172709.485
i -a 0 -a 1 x-a 2 x 2
-a 967173.1157
3 4 2
3 x -a 4 x )
16 6.0 41.5 36 216 1296 7776 46656 279936 1679616
0 48 258.7 0 198.4 0 921.6 0
4564.7872 23543.808261.4284766
124858.0403 675710.2387 0.07541813713585.848
1.2 0.48 0.192 0.0768 173.4159766 0.192353564
3.6 2.88 2.304 1.8432 136.1597266 0.242935761
6.96 8.352 10.0224 12.02688 107.5109766 0.209622515
9.44 15.104 24.1664 38.66624 105.4472266 0.387114549
11.6 23.2 46.4 92.8 107.5109766 0.137752368
14.88 35.712 85.7088 205.70112 99.37597656 0.003819631
20.72 58.016 162.4448 454.84544 76.89097656 0.463456147
30.72 98.304 314.5728 1006.63296 43.14847656 2.037554748
56.16 202.176 727.8336 2620.20096 0.323476563 0.269379288
82.8 331.2 1324.8 5299.2 20.53222656 0.411890309
117.48 516.912 2274.4128 10007.41632 110.9072266 1.180571738
149.28 716.544 3439.4112 16509.17376 222.9422266 0.019214129
185.12 962.624 5005.6448 26029.35296 377.5734766 0.439749927
220.08 1232.448 6901.7088 38649.56928 535.0547266 0.3069563
249 1494 8964 53784 641.6722266 0.234365358
1159.04 5697.952 29283.6224 154711.5059 3019.894375 6.612154433

15
UNIVERSITY OF SCIENCE AND TECHNOLOGY OF SOUTHERN PHILIPPINES

Alubijid | Cagayan de Oro | Claveria | Jasaan | Oroquieta | Panaon

Claro M. Recto Avenue, Lapasan 9000 Cagayan de Oro City, Philippines

ȳ = 16.16875
a0 = -0.27462356052
a1 = 12.87805301274
a2 = -10.19272506691
a3 = 3.11856340771
a4 = -0.26438997001
r = 0.998904634

𝑦 = 𝑎𝑜 + 𝑎1𝑥 + 𝑎2𝑥2 + 𝑎3𝑥3 + 𝑎4𝑥4

𝑦 = −0.275 + 12.878𝑥 − 10.193𝑥2 + 3.119𝑥3 − 0.264𝑥4

2. Make a plot of the data points you recorded and the curve that corresponds to
your polynomial.

Plotting the data points


45

40

35
y = -0.2644x4 + 3.1185x3 - 10.193x2 + 12.878x - 0.2746
30

25

20

15

10

-5

16
UNIVERSITY OF SCIENCE AND TECHNOLOGY OF SOUTHERN PHILIPPINES

Alubijid | Cagayan de Oro | Claveria | Jasaan | Oroquieta | Panaon

Claro M. Recto Avenue, Lapasan 9000 Cagayan de Oro City, Philippines

3. Find your correlation coefficient? What does your coefficient imply?

3019.894375 − 6.612154433
𝑟= √
3019.894375

𝒓 = 𝟎. 𝟗𝟗𝟖𝟗𝟎𝟒𝟔𝟑𝟒𝟐

INTERPOLATION

1. Utilizing Lagrange form, determine the fourth-order polynomial that passes


through the points.
(𝑡 − 6)(𝑡 − 10)(𝑡 − 13)(𝑡 − 15) (𝑡 − 5)(𝑡 − 10)(𝑡 − 13)(𝑡 − 15) (𝑡 − 5)(𝑡 − 6)(𝑡 − 13)(𝑡 − 15)
𝑓(𝑡) = (52) + (5) + (−5)
(5 − 6)(5 − 10)(5 − 13)(5 − 15) (6 − 5)(6 − 10)(6 − 13)(6 − 15) (10 − 5)(10 − 6)(10 − 13)(10 − 15)
(𝑡 − 5)(𝑡 − 6)(𝑡 − 10)(𝑡 − 15) (𝑡 − 5)(𝑡 − 6)(𝑡 − 10)(𝑡 − 13)
+ (−40) + (10)
(13 − 5)(13 − 6)(13 − 10)(13 − 15) (15 − 5)(15 − 6)(15 − 10)(15 − 13)

(𝑡 − 6)(𝑡 − 10)(𝑡 − 13)(𝑡 − 15) (𝑡 − 5)(𝑡 − 10)(𝑡 − 13)(𝑡 − 15) (𝑡 − 5)(𝑡 − 6)(𝑡 − 13)(𝑡 − 15)
𝑓(𝑡) = (52) + (5) + (−5)
(−1)(−5)(−8)(−10) (1)(−4)(−7)(−9) (5)(4)(−3)(−5)
(𝑡 − 5)(𝑡 − 6)(𝑡 − 10)(𝑡 − 15) (𝑡 − 5)(𝑡 − 6)(𝑡 − 10)(𝑡 − 13)
+ (−40) + (10)
(8)(7)(3)(−2) (10)(9)(5)(2)

(𝑡 − 6)(𝑥 − 10)(𝑡 − 13)(𝑡 − 15) (𝑡 − 5)(𝑡 − 10)(𝑡 − 13)(𝑡 − 15)


𝑓(𝑡) = (52) + (5)
400 −252
(𝑡 − 5)(𝑡 − 6)(𝑡 − 13)(𝑡 − 15) (𝑡 − 5)(𝑡 − 6)(𝑡 − 10)(𝑡 − 15) (𝑡 − 5)(𝑡 − 6)(𝑡 − 10)(𝑡 − 13)
+ (−5) + (−40) + (10)
300 −336 900

𝟏𝟒𝟎𝟗𝒕𝟒 − 𝟓𝟓𝟗𝟒𝟔𝒕𝟑 + 𝟖𝟎𝟔𝟖𝟐𝟕𝒕𝟐 − 𝟓𝟎𝟐𝟓𝟓𝟓𝟎𝒕 + 𝟏𝟏𝟑𝟗𝟕𝟑𝟎𝟎


𝒇(𝒕) =
𝟔𝟑𝟎𝟎

17
UNIVERSITY OF SCIENCE AND TECHNOLOGY OF SOUTHERN PHILIPPINES

Alubijid | Cagayan de Oro | Claveria | Jasaan | Oroquieta | Panaon

Claro M. Recto Avenue, Lapasan 9000 Cagayan de Oro City, Philippines

2. Use your formulated polynomial to determine the vibration factor at t = 8s.


1409𝑡 4 − 55946𝑡 3 + 806827𝑡 2 − 5025550𝑡 + 11397300
𝑓(𝑡) =
6300

1409(8)4 − 55946(8)3 + 806827(8)2 − 5025550(8) + 11397300


𝑓(8) =
6300

𝒇(𝟖) = −𝟔. 𝟖𝟔𝟔𝟔𝟔𝟔𝟔𝟔𝟕

3. Plot the data points you recorded and your interpolating curve.

Plotting the data points


60 𝑓(𝑥)=(52) (𝑥−6)(𝑥−10)(𝑥−13)(𝑥−15)/((400))+(5) (𝑥−5)(𝑥−10)(𝑥−13)(𝑥−15)/((−252))+(−5) (𝑥−5)(𝑥−6)(𝑥−13)(𝑥−15)/((300))+(−40)
(𝑥−5)(𝑥−6)(𝑥−10)(𝑥−15)/((−336))+(10)((𝑥−5)(𝑥−6)(𝑥−10)(𝑥−13))/((900))

50

40

30

20

10

0
0 2 4 6 8 10 12 14 16
-10

-20

18
UNIVERSITY OF SCIENCE AND TECHNOLOGY OF SOUTHERN PHILIPPINES

Alubijid | Cagayan de Oro | Claveria | Jasaan | Oroquieta | Panaon

Claro M. Recto Avenue, Lapasan 9000 Cagayan de Oro City, Philippines

DISCUSSION

For the purpose of this activity, polynomial regression and interpolation


techniques were employed to analyze and interpret the given data. Through
rigorous experimentation and analysis, we obtained distinct results and
findings from implementing both methods, highlighting their strengths,
limitations, and real-world applicability.

In regression, the degree of the polynomial, 4, was chosen to fit the


regression model. Table 1 in Regression shows the construction of the data
frame that contains the data, respectively. These values can be used to
substitute for solving the linear equations. Consequently, the unknown values
are acquired to determine the polynomial coefficients of the quartic equation,
which helps determine the rubber stress-strain behavior. These unknown
values are -0.2644, 3.1185, -10.193, 12.878, and -0.2746. On the other hand,
Table 2 shows the computations for the error analysis, having an overall error
of 6.612154433.

19
UNIVERSITY OF SCIENCE AND TECHNOLOGY OF SOUTHERN PHILIPPINES

Alubijid | Cagayan de Oro | Claveria | Jasaan | Oroquieta | Panaon

Claro M. Recto Avenue, Lapasan 9000 Cagayan de Oro City, Philippines

The outcomes of our polynomial regression analysis were insightful. It has a


correlation coefficient of 0.9989046342, a crucial indicator of the model's goodness
of fit, which shows a strong relationship between the strain and stress variables. It is
an indication that the strain is directly proportional to the stress applied. As stress
increases, the strain on the material also increases. We observed that the quartic
regression equation yielded the best fit for our data, effectively capturing the
underlying trends and patterns. This outcome reaffirms the utility of polynomial
regression in understanding complex relationships within our dataset.

In interpolation, the Lagrange form to solve for the given data provided
compelling results. Since we had a fourth-order polynomial, we had 5 x and y values.
It has been considered appropriate to estimate using Lagrange interpolation to obtain
the result directly. Considering the given time, 8 seconds, the vibrating factor equals
-6.866666667. By using a consistent trend across a set of data points, these plotted
values on the graph represent the intensity of the earthquake and its impact on a
miniature of your company's proposed building over time.

20
UNIVERSITY OF SCIENCE AND TECHNOLOGY OF SOUTHERN PHILIPPINES

Alubijid | Cagayan de Oro | Claveria | Jasaan | Oroquieta | Panaon

Claro M. Recto Avenue, Lapasan 9000 Cagayan de Oro City, Philippines

CONCLUSION

The overarching objectives were to ascertain the best-fitting equations,


evaluate the quality of fits, and draw insightful comparisons between curve
fitting and interpolation. This laboratory activity addressed what to learn in
regression and interpolation. It was proven that polynomial regression could
best fit high-order polynomials. Its correlation coefficient indicated that the
regression model shows a positive correlation. It is an indication that the strain
is directly proportional to the stress applied. However, it could be crucial to
solve for polynomial regression at times as it can overfit given a too-high-order
polynomial.

On the other hand, Lagrange polynomials are easy to compute, yet they
are difficult to work with. If new interpolation points are added, all Lagrange
polynomials must be recomputed. This could then lead to inaccuracies and
instability in the estimations. Still, this method gave us compelling results for
solving the vibration factor concerning its time.

21
UNIVERSITY OF SCIENCE AND TECHNOLOGY OF SOUTHERN PHILIPPINES

Alubijid | Cagayan de Oro | Claveria | Jasaan | Oroquieta | Panaon

Claro M. Recto Avenue, Lapasan 9000 Cagayan de Oro City, Philippines

The comparison between regression and interpolation unveiled distinctive


attributes of each method. Polynomial regression, while proficient at capturing
trends, was susceptible to overfitting when high-degree polynomials were employed.
In contrast, while less complex in calculations, interpolation was prone to
inaccuracies if there were newly added points. But as for this laboratory activity,
these two methods demonstrated effective results in solving for tension test and
vibration factor.

22

You might also like