Professional Documents
Culture Documents
Group - 5 Laboratory 4
Group - 5 Laboratory 4
Numerical Solutions
to CE Problems
1
UNIVERSITY OF SCIENCE AND TECHNOLOGY OF SOUTHERN PHILIPPINES
Group 5 – BSCE_2F
Technical Report
No. 4
2
UNIVERSITY OF SCIENCE AND TECHNOLOGY OF SOUTHERN PHILIPPINES
INTRODUCTION
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.
3
UNIVERSITY OF SCIENCE AND TECHNOLOGY OF SOUTHERN PHILIPPINES
OBJECTIVES
To find the best equations that would fit a series of data points
using polynomial regression and determine the goodness of
the fit.
4
UNIVERSITY OF SCIENCE AND TECHNOLOGY OF SOUTHERN 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
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
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
6
UNIVERSITY OF SCIENCE AND TECHNOLOGY OF SOUTHERN 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
∑ 𝑦𝑖 = 𝑦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
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
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
\
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
METHODS
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
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
12
UNIVERSITY OF SCIENCE AND TECHNOLOGY OF SOUTHERN PHILIPPINES
METHODS
∑(𝑦𝑖 − 𝑎0 − 𝑎1 𝑥 − 𝑎2 𝑥 2 − 𝑎3 𝑥 3 − 𝑎4 𝑥 4 ) = 6.612154433
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
METHODS
INTERPOLATION
1. Utilizing Lagrange form, determine the fourth-order polynomial that passes
through the points.
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 )
3. Plot the data points you recorded and your interpolating curve.
14
UNIVERSITY OF SCIENCE AND TECHNOLOGY OF SOUTHERN 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
ȳ = 16.16875
a0 = -0.27462356052
a1 = 12.87805301274
a2 = -10.19272506691
a3 = 3.11856340771
a4 = -0.26438997001
r = 0.998904634
2. Make a plot of the data points you recorded and the curve that corresponds to
your polynomial.
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
3019.894375 − 6.612154433
𝑟= √
3019.894375
𝒓 = 𝟎. 𝟗𝟗𝟖𝟗𝟎𝟒𝟔𝟑𝟒𝟐
INTERPOLATION
(𝑡 − 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)
17
UNIVERSITY OF SCIENCE AND TECHNOLOGY OF SOUTHERN PHILIPPINES
3. Plot the data points you recorded and your interpolating curve.
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
DISCUSSION
19
UNIVERSITY OF SCIENCE AND TECHNOLOGY OF SOUTHERN PHILIPPINES
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
CONCLUSION
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
22