0% found this document useful (0 votes)
30 views14 pages

M2 CW Cañete

The document discusses linear and quadratic interpolation methods to find values between given data points. It also covers higher order interpolation and numerical differentiation using forward, central, and backward difference formulas. The trapezoidal rule for numerical integration is analyzed.

Uploaded by

betoniodamien
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views14 pages

M2 CW Cañete

The document discusses linear and quadratic interpolation methods to find values between given data points. It also covers higher order interpolation and numerical differentiation using forward, central, and backward difference formulas. The trapezoidal rule for numerical integration is analyzed.

Uploaded by

betoniodamien
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
You are on page 1/ 14

SURNAME Cañete

FIRST NAME Erikca Marie


STUDENT # 2021101712
PROGRAM/YEAR CE/2

PROBLEM

LINEAR INTERPOLATION
x y
3.1 20.1810
3.2 22.5280
3.3 25.0470
3.4 27.7440
3.5 30.6250
3.6 33.6960
3.34 26.1258
3.57 32.7747
3.22 23.0318
y0+𝜇(y1-y0)
x y 𝑥_0 𝑥_1 𝑦_0
3.34 26.1258 3.3 3.4 25.0470
3.57 32.7747 3.5 3.6 30.6250
3.22 23.0318 3.2 3.3 22.5280

40

35
40

35

30

25

20

15

10

0
3 3.1 3.2 3.3 3.4 3.5 3.6 3.7

QUADRATIC INTERPOLATION

x y
3.1 20.1810
3.2 22.5280
3.3 25.0470
3.4 27.7440
3.5 30.6250
3.6 33.6960 𝑥_0 𝑥_1 𝑥_2
3.34 26.1044 3.2 3.3 3.4
3.57 32.7547 3.4 3.5 3.6
3.22 23.0180 3.1 3.2 3.3

𝑥_0 𝑥_1 𝑥_2 𝑦_0 𝑦_1


1 2 3 4 3

𝑃_2(𝑥)=(4)((𝑥−2)(𝑥−3)/(1−2)(1−3))+(3)((𝑥−1)(𝑥−3)/(2−1)(2−3))+(0)((𝑥−1)(𝑥−2)/(3−1)(3−1))
𝑃_2(𝑥)=(4)((𝑥−2)(𝑥−3)/(1−2)(1−3))+(3)((𝑥−1)(𝑥−3)/(2−1)(2−3))+(0)((𝑥−1)(𝑥−2)/(3−1)(3−1))

𝑃_2(𝑥)=(2𝑥^2−10𝑥+12)+(−3𝑥^2+12𝑥−9)+(0)
𝑃_2(𝑥)=−𝑥^2+2𝑥+3

HIGHER ORDER INTERPOLATION

x y
3.1 20.1810
3.2 22.5280
3.3 25.0470
3.4 27.7440
3.5 30.6250
3.6 33.6960

x y
3.57 32.7544

𝑥_0 𝑥_1 𝑥_2 𝑥_3


x 3.3 3.4 3.5 3.6
y 25.0470 27.7440 30.6250 33.6960
x-x0
x1-x0
𝑦_1 𝜇
27.7440 0.4000
33.6960 0.7000
25.0470 0.2000
𝑦_0 𝑦_1 𝑦_2 𝐿_0(𝑥) 𝐿_1(𝑥)
22.5280 25.0470 27.7440 -0.1200 0.8400
27.7440 30.6250 33.6960 -0.1050 0.5100
20.1810 22.5280 25.0470 -0.0800 0.9600

𝑦_2
0

−2)/(3−1)(3−1))
−2)/(3−1)(3−1))

0.0595 -0.2835 0.6885 0.5355


𝐿_2(𝑥)
0.2800
0.5950
0.1200
SURNAME Cañete
FIRST NAME Erikca Marie
STUDENT # 2021101712
PROGRAM/YEAR CE/2

PROBLEM

a.) Forward Difference Formula


𝑓’(𝑥)≈𝑓(𝑥+ℎ)−𝑓(𝑥)/ℎ=𝐷_ℎ^𝐹(𝑓)

x h x+h fx fx+h
0.523598775598299 0.10000 0.6235987756 0.8660254037844 0.8117821756787
0.523598775598299 0.05000 0.5735987756 0.8660254037844 0.839953512903
0.523598775598299 0.02500 0.5485987756 0.8660254037844 0.8532560869836
0.523598775598299 0.01250 0.5360987756 0.8660254037844 0.8597079091899
0.523598775598299 0.00625 0.5298487756 0.8660254037844 0.8628835096258

h 𝐷_ Error
ℎ^
0.10000 -0.542432281
𝐹 0.042432281
0.05000 -0.521437818 0.021437818
0.02500 -0.510772672 0.010772672
0.01250 -0.505399568 0.005399568
0.00625 -0.502703065 0.002703065

b.) Central Difference Formula


𝑓’(𝑥)≈𝑓(𝑥+ℎ)−𝑓(𝑥)/2ℎ=𝐷_ℎ^𝐶(𝑓)

x h x+h x-h f(x+h)


0.523598775598299 0.10000 0.6235987756 0.42360 0.8117821756787
0.523598775598299 0.05000 0.5735987756 0.47360 0.839953512903
0.523598775598299 0.02500 0.5485987756 0.49860 0.8532560869836
0.523598775598299 0.01250 0.5360987756 0.51110 0.8597079091899
0.523598775598299 0.00625 0.5298487756 0.51735 0.8628835096258

h 𝐷_ Error
ℎ^
0.10000 𝐶 -0.49917 0.000832917
0.05000 -0.49979 0.000208307
0.02500 -0.49995 0.00005
0.01250 -0.49999 0.00001
0.00625 -0.50000 0

c.) Backward Difference Formula


𝑓’(𝑥)≈𝑓(𝑥+ℎ)−𝑓(𝑥)/2ℎ=𝐷_ℎ^𝐶(𝑓)

x h x-h fx fx-h
0.523598775598299 0.10000 0.42360 0.8660254037844 0.9116155923255
0.523598775598299 0.05000 0.47360 0.8660254037844 0.8899326821737
0.523598775598299 0.02500 0.49860 0.8660254037844 0.8782534828983
0.523598775598299 0.01250 0.51110 0.8660254037844 0.8722075836716
0.523598775598299 0.00625 0.51735 0.8660254037844 0.8691334689358

h 𝐷_ Error
0.10000 ℎ^-0.45590 0.044098115
𝐵
0.05000 -0.47815 0.021854432
0.02500 -0.48912 0.010876835
0.01250 -0.49457 0.005425609
0.00625 -0.49729 0.002709576
f e r
-0.5424322810575 0.0424322810575 0.000000
-0.5214378176283 0.0214378176283 1.9793190609826
-0.5107726720347 0.0107726720347 1.9900185914202
-0.5053995675651 0.0053995675651 1.9950990342889
-0.5027030653752 0.0027030653752 1.9975719472499

Ratio
0.000000
1.979319061
1.990018591
1.995099034
1.997571947

f(x-h) C E R
0.9116155923255 -0.49917 0.0008329167659 0.000000000
0.8899326821737 -0.49979 0.0002083072932 3.9985002588935
0.8782534828983 -0.49995 5.2081705754E-05 3.9996250161294
0.8722075836716 -0.49999 1.302073161E-05 3.9999062505447
0.8691334689358 -0.50000 3.2552019764E-06 3.9999765620541

Ratio
0
3.998500259
3.999625016
3.999906251
3.999976562

b e r
-0.45590 0.0440981145892 0.00000000
-0.47815 0.0218544322147 2.0178110397007
-0.48912 0.0108768354462 2.0092638454303
-0.49457 0.0054256090283 2.0047215694023
-0.49729 0.0027095757792 2.0023832033216

Ratio
0.00000000
2.01781104
2.009263845
2.004721569
2.002383203
SURNAME Cañete
FIRST NAME Erikca Marie
STUDENT # 2021101712
PROGRAM/YEAR CE/2

PROBLEM:

a.) Trapezoidal Rule


∫_𝑎^𝑏▒𝑓(𝑥)𝑑𝑥≈ℎ/2 [𝑓(𝑥_0)+2𝑓(𝑥_1)...+2𝑓(𝑥_𝑛−1)+𝑓(𝑥_𝑛−1)+𝑓(𝑥_𝑛)]

with h=𝑏−𝑎/𝑛

i x f(x) wt wt * f(x)
0.0000 0.0000 1.0000 0.5000 0.5000
1.0000 0.4000 0.8621 1.0000 0.8621
2.0000 0.8000 0.6098 1.0000 0.6098
3.0000 1.2000 0.4098 1.0000 0.4098
4.0000 1.6000 0.2809 1.0000 0.2809
5.0000 2.0000 0.2000 1.0000 0.2000
6.0000 2.4000 0.1479 1.0000 0.1479
7.0000 2.8000 0.1131 1.0000 0.1131
8.0000 3.2000 0.0890 1.0000 0.0890
9.0000 3.6000 0.0716 1.0000 0.0716
10.0000 4.0000 0.0588 0.5000 0.0294

a 0.0000 SUM 3.3136


b 4.0000 h 0.4000
f'(a) 0.0000 sum*h 1.3254
f'(b) -0.0277 correction 0.0004
approx 1.3258

b.) Simpson's 1/3 Rule


∫_𝑎^𝑏▒𝑓(𝑥)𝑑𝑥≈ℎ/3 [𝑓(𝑥_0)+4𝑓(𝑥_1)+2𝑓(𝑥_2)+4𝑓(𝑥_3)+2𝑓(𝑥_4)+...+4𝑓(𝑥_𝑛−1)+𝑓(𝑥_𝑛)]

with h=𝑏−𝑎/𝑛

i x f(x) wt wt * f(x)
0.0000 0.0000 1.0000 0.3333333333333 0.3333
1.0000 0.4000 0.8621 1.3333333333333 1.1494
2.0000 0.8000 0.6098 0.6666666666667 0.4065
3.0000 1.2000 0.4098 1.3333333333333 0.5464
4.0000 1.6000 0.2809 0.6666666666667 0.1873
5.0000 2.0000 0.2000 1.3333333333333 0.2667
6.0000 2.4000 0.1479 0.6666666666667 0.0986
7.0000 2.8000 0.1131 1.3333333333333 0.1508
8.0000 3.2000 0.0890 0.6666666666667 0.0593
9.0000 3.6000 0.0716 1.3333333333333 0.0955
10.0000 4.0000 0.0588 0.3333333333333 0.0196

a 0.0000 SUM 3.3135


b 4.0000 h 0.4000
f'''(a) 0.0000 sum*h 1.3254
f'''(b) -0.0172 correction 0.0000
approx 1.3254

You might also like