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

4 -2 -3 6 12

-6 7 6.5 -6 -6.5
1 7.5 6.25 5.5 16
-12 22 15.5 -1 17

Normalize Pivot: Divide R1 by 4

1 -0.5 -0.75 1.5 3


-6 7 6.5 -6 -6.5
1 7.5 6.25 5.5 16
-12 22 15.5 -1 17

Eliminate:
1 -0.5 -0.75 1.5 3
0 4 2 3 11.5
0 8 7 4 13
0 16 6.5 17 53

Normalize Pivot : Divide Row 2 by 4

1 -0.5 -0.75 1.5 3


0 1 0.5 0.75 2.875
0 8 7 4 13
0 16 6.5 17 53

Eliminate:
1 0 -0.5 1.875 4.4375
0 1 0.5 0.75 2.875
0 0 3 -2 -10
0 0 -1.5 5 7

Normalize Pivot: Divide Row 3 by 3


1 0 -0.5 1.875 4.4375
0 1 0.5 0.75 2.875
0 0 1 -0.66667 -3.33333
0 0 -1.5 5 7

Eliminate:
1.54166 2.77083
1 0 0 7 3
1.08333 4.54166
0 1 0 3 7
0 0 1 -0.66667 -3.33333
0 0 0 4 2

Normalize Pivot: Divide Row 4 by 4

1.54166 2.77083
1 0 0 7 3
1.08333 4.54166
0 1 0 3 7
0 0 1 -0.66667 -3.33333
0 0 0 1 0.5

Eliminate:
1 0 0 0 2
0 1 0 0 4
0 0 1 0 -3
0 0 0 1 0.5

Conclusion:
x1 = 2
x2 = 4
x3 = -3
x4 = 0.5
x f(x)=y
x0 1 52
x1 2 5
x2 4 -5
x3 5 -40
x4 7 10

Fourth degree:

( x−x 1 ) ( x−x 2 )( x−x3 ) ( x−x 4 )


f ( x )= f ( x0)
( x 0−x 1 ) ( x 0−x 2 )( x0 −x3 ) ( x 0−x 4 )
+ ( x− x0 ) ( x−x 2 ) ( x−x 3 ) ( x−x 4 )
f ( x1 )
( x 1−x 0 )( x 1−x 2 ) ( x 1−x 3 )( x 1−x 4 )
+ ( x −x0 ) ( x−x 1 ) ( x−x 3 ) ( x−x 4 )
f ( x2 )
( x 2−x 0 )( x 2−x 1 ) ( x 2−x 3 )( x2 −x 4 )
+ ( x−x 0 )( x −x1 ) ( x−x 2 ) ( x−x 4 )
f ( x3)
( x 3−x 0 )( x3 −x1 ) ( x 3−x 2 ) ( x3 −x 4 )
+ ( x−x 0 )( x −x1 ) ( x−x 2 ) ( x−x 3 )
f ( x4 )
( x 4−x 0 ) ( x 4 −x1 ) ( x 4 −x2 ) ( x 4 −x 3)
( x−2 ) ( x−4 ) ( x −5 )( x−7 ) ( x−1 )( x−4 ) ( x−5 ) ( x−7 )
f ( x )= ( 52 ) + (5 )
( 1−2 ) (1−4 ) (1−5 ) (1−7 ) ( 2−1 ) ( 2−4 ) ( 2−5 ) ( 2−7 )
+ ( x−1 )( x−2 )( x−5 ) ( x−7 ) ( x−1 )( x−2 ) ( x−4 ) ( x −7 )
(−5 ) + (−40 )
( 4−1 ) ( 4−2 )( 4−5 )( 4−7 ) (5−1 ) (5−2 ) ( 5−4 ) ( 5−7 )
+ ( x−1 )( x−2 )( x−4 ) ( x−5 )
( 10 )
(7−1 ) ( 7−2 )( 7−4 )( 7−5 )

f ( x )=
[ 13 4
18
x −13 x 3+
1495 2
18
x −221 x +
1820
9
+
6 ][
−1 4 17 3 33 2 223
x + x− x+
6 2 6
x−
70
3 ]
+
[ −5 4 25 3 365 2 215
18
x + x−
6 18
x+
6
x−
175
9
5 4 70 3 2
+ x − x +105 x −
3 3 3][
530
x+
280
3 ]
+ [ 1 4 2 3 49 2 13
18
x − x + x − x+
3 18 3
20
9 ]
f ( x )=2 x 4 −30 x 3 +154 x 2−329 x+ 225

b)

f ( x )=2 x 4 −30 x 3 +154 x 2−329 x+ 225

f ( 3 )=2 (3 )4−30 ( 3 )3 +154 (3 )2−329 ( 3 ) +225


f ( 3 )=6
i Xi Yi = f(Xi) (Xi)^2 XiYi
1 0 0.94 0 0
2 10 0.96 100 9.6
3 20 1.00 400 20
4 30 1.05 900 31.5
5 40 1.07 1600 42.8
6 50 1.09 2500 54.5
7 60 1.14 3600 68.4
8 70 1.17 4900 81.9
9 80 1.21 6400 96.8
10 90 1.24 8100 111.6
11 100 1.28 10000 128

∑ 550 12.15 38500 645.1


a) Linear regression in which P is the dependent variable and t as the independent variable,
p=c1 t+ c 0
For slope, use below formula
c 1=n ¿ ¿
11(645.1)−550(12.15)
c 1= =0.0034
11(38500)−(550)2

For intercept, use below formula


c 1=¿ ¿

12.15(38500)−550(645.1)
c 1= =0.9336
11(38500)−(550)2

Therefore, best fit line in predicting Pressure (Y) given its Temperature(X) would be,
^p=c1 t+ c 0
^p=0.0034 t+0.9336
Or same as,
^y =0.0034 x+ 0.9336

b) Data of observed or recorded pressure and its corresponding predicted pressure using
regression line above is shown below,
  Observation Prediction
Xi Yi = f(Xi)  
^y =0.0034x+0.933
0 0.94 6 0.9336
10 0.96 0.9676
20 1.00 1.0016
30 1.05 1.0356
40 1.07 1.0696
50 1.09 1.1036
60 1.14 1.1376
70 1.17 1.1716
80 1.21 1.2056
90 1.24 1.2396
100 1.28 1.2736

Scatterplot of the above data was presented below, which shows the positive linear trend or
correlation between temperature and pressure. Meaning, as temperature increases pressure
also increases. Thus we have calculated positive slope.
1.4
1.2 f(x) = 0.00341818181818182 x + 0.933636363636364
1

Pressure, Y
0.8
0.6
0.4
0.2
0
0 10 20 30 40 50 60 70 80 90 100
Also, we can see Temperature, X below plot of the
actual experimental
data(observation) versus the

Temperature, X Line Fit Plot


1.5 1.5

1 1
Pressure, Y

Predicted Pressure, Y
0.5 0.5 Pressure, Y

0 0
0 10 20 30 40 50 60 70 80 90 100
Temperature, X

approximation(prediction) using the derived regression line, ^y =0.0034 x+ 0.9336.

c) Absolute zero is the temperature at which the gas's pressure equals zero. Therefore, using
regression line equation that we have above, we are to look for temperature value that gives a
pressure equal to zero.

^p=0.0034 t+0.9336
0=0.0034 t+ 0.9336
−0.9336
t= =−274.59 ℃
0.0034

Thus, error would be,


error =observed− predicted=−273.15−(−274.59)=1.44
a) f ( x)= x3 ∧h=1

x f(x)=y
2 8
3 27
4 64

Using two-point Forward difference formula,

f ( x+ h )−f ( x )
f ' ( x )=
h
f (3+ 1 )−f ( 3 ) f ( 4 ) −f ( 3 ) 64−27
f ' ( 3 )= = = =37
1 1 1

Using two-point Backward difference formula,

f ( h ) −f ( x−h )
f ' ( x )=
h
' f (3 )−f ( 3−1 ) f ( 3 )−f ( 2 ) 27−8
f ( 3 )= = = =19
1 1 1

Using two-point Central difference formula,

f ( x+ h )−f ( x−h )
f ' ( x )=
2h

f (3+ 1 )−f ( 3−1 ) f ( 4 )−f ( 2 ) 64−8


f ' ( 3 )= = = =28
2(1) 2 2

b) f ( x)= x3 ∧h=0.25

x f(x)=y
20.79687
2.75 5
3 27
34.32812
3.25 5

Using two-point Forward difference formula,

f ( x+ h )−f ( x )
'
f ( x )=
h
' f (3+ 0.25 )−f ( 3 ) f ( 3.25 )−f ( 3 ) 34.328125−27
f ( 3 )= = = =29.3125
0.25 0.25 0.25

Using two-point Backward difference formula,

' f ( h ) −f ( x−h )
f ( x )=
h

' f (3 )−f ( 3−0.25 ) f ( 3 ) −f ( 2.75 ) 27−20.796875


f ( 3 )= = = =24.8125
0.25 0.25 0.25

Using two-point Central difference formula,

' f ( x+ h )−f ( x−h )


f ( x )=
2h
' f (3+ 0.25 )−f ( 3−0.25 ) f ( 3.25 ) −f ( 2.75 ) 34.328125−20.796875
f ( 3 )= = = =27.0625
2(0.25) 0.50 0.50

Now, using analytic approach:


3
f ( x )=x
' 2
f ( x )=3 x
f ' ( 3 )=3 ( 3 )2
'
f ( 3 )=27

Conclusion: Among the three method, central difference approach gives the most accurate
answer which is 27, that can be proven through analytic or manual solving. Also, I noticed that
the smaller the value of h the more precise are the answers to the correct one.
a) Analytical approach:
dv
mv =−5 v 2 −570000
dx
where, m = 97 000 kg
Therefore,
dv 2
97000 v =−5 v −570000
dx
97000 vdv=(−5 v −570000 ) dx
2

97000 v
dx= dv
−5 v2 ↑−570000
du
Integrate using the rule ∫ =ln (u ):
u
97000 v
∫ dx=∫ −5 v 2 ↑−570000 dv

1 97000 2v
∫ dx= 2 ∙ −5
∫ 2
v +114000
dv

2v
x=−97000∫ 2
dv
v +114000

x=−9700 ln (v 2 +114000)+C
At t=0, initial velocity Vo upon landing is 93 meters per second, thus Xo=0
2
0=−9700 ln((93) +114000)+C
C=113655.6944
Therefore, distance(x) equation of the airplane as a function of velocity(v) is,

x=−9700 ln (v 2 +114000)+113655.6944

Using above equation, the distance travelled by the plane before its speed reduced to x=40
m/s would be,
2
x=−9700 ln (( 40) +114000)+113655.6944=574.14941meters

b) Proving our answer above with different methods,


40
97000 v
x=∫ 2
dv=574.14941
93 −5 v −570000
where,
97000 v
f (x)=
−5 v 2−570000

 Composite Trapezoidal Method


For n=10 sub-intervals,
b−a 40−93
h= = =−5.3
n 10
n x f(x)
0 93 -14.71027077
1 87.7 -13.98111566
2 82.4 -13.23423443
3 77.1 -12.47027686
4 71.8 -11.68996009
5 66.5 -10.89406763
6 61.2 -10.08344782
7 55.9 -9.259011818
8 50.6 -8.421731024
9 45.3 -7.572633978
10 40 -6.712802768

[ ]
n−1
h
I= f ( a ) +2 ∑ f ( a+ih ) + f ( b )
2 i=1

Therefore, applying composite trapezoidal method formula above,

40
97000 v −5.3
x=∫ 2
dv= [ −14.7102707726928+2(−13.9811156574969−13.2342344251698−12
93 −5 v −570000 2
x=574.08549 meters
True error,
Et =true value−approximate value
Et =574.14941−574.08549=0.06392

Absolute relative true error,

|
|ϵ t|= true value
t E
|×100 %

| 0.06392 |× 100 %
|ϵt|= 574.14941
error =0.01 %

For n=20 sub-intervals,

b−a 40−93
h= = =−2.65
n 20
n x f(x)
0 93 -14.71027077
1 90.35 -14.34794694
2 87.7 -13.98111566
3 85.05 -13.60985178
4 82.4 -13.23423443
5 79.75 -12.85434693
6 77.1 -12.47027686
7 74.45 -12.08211594
8 71.8 -11.68996009
9 69.15 -11.2939093
10 66.5 -10.89406763
11 63.85 -10.49054314
12 61.2 -10.08344782
13 58.55 -9.672897508
14 55.9 -9.259011818
15 53.25 -8.841914036
16 50.6 -8.421731024
17 47.95 -7.998593112
18 45.3 -7.572633978
19 42.65 -7.143990531
20 40 -6.712802768

[ ]
n−1
h
I= f ( a ) +2 ∑ f ( a+ih ) + f ( b )
2 i=1

Therefore, applying composite trapezoidal method formula above,

40
97000 v −2.65
x=∫ dv= [ −14.7102707726928+2(−14.3479469428264−13.9811156574969−1
2
93 −5 v −570000 2
x=574.13343 meters

True error,
Et =true value−approximate value
Et =574.14941−574.13343=0.01598

Absolute relative true error,

| E
|ϵ t|= true value
t
|×100 %
| 0.01598 |× 100 %
|ϵt|= 574.14941
error =0.003 %

 Simpson’s 1/3 Rule


For n=10 sub-intervals,
b−a 40−93
h= = =−5.3
n 10
n x f(x)
0 93 -14.71027077
1 87.7 -13.98111566
2 82.4 -13.23423443
3 77.1 -12.47027686
4 71.8 -11.68996009
5 66.5 -10.89406763
6 61.2 -10.08344782
7 55.9 -9.259011818
8 50.6 -8.421731024
9 45.3 -7.572633978
10 40 -6.712802768

[ ]
n−1 n−2
h
I= f ( x o ) +4 ∑ f (x i)+2 ∑ f (x j )+f ( x n )
3 i=1,3,5 j=2 , 4 ,6

Therefore, applying Simpson’s 1/3 Rule formula above,


40
97000 v −5.3
x=∫ dv= [ −14.7102707726928+ 4(−13.9811156574969)+2(−13.2342344251698
2
93 −5 v −570000 3
x=574. 14943 meters
True error,
Et =true value−approximate value
Et =574.14941−574. 14943=0.00002

Absolute relative true error,

| E
|ϵ t|= true value
t
|
×100 %

| 0.00002
|ϵt|= 574.14941 |× 100 %
error ≈ 0 %

For n=20 sub-intervals,


b−a 40−93
h= = =−2.65
n 20
n x f(x)
0 93 -14.71027077
1 90.35 -14.34794694
2 87.7 -13.98111566
3 85.05 -13.60985178
4 82.4 -13.23423443
5 79.75 -12.85434693
6 77.1 -12.47027686
7 74.45 -12.08211594
8 71.8 -11.68996009
9 69.15 -11.2939093
10 66.5 -10.89406763
11 63.85 -10.49054314
12 61.2 -10.08344782
13 58.55 -9.672897508
14 55.9 -9.259011818
15 53.25 -8.841914036
16 50.6 -8.421731024
17 47.95 -7.998593112
18 45.3 -7.572633978
19 42.65 -7.143990531
20 40 -6.712802768

[ ]
n−1 n−2
h
I = f ( x o ) +4 ∑ f (x i)+2 ∑ f (x j)+ f ( x n )
3 i=1,3,5 j=2,4,6

Therefore, applying Simpson’s 1/3 Rule formula above,

40
97000 v −2.65
x=∫ dv= [ −14.7102707726928+ 4(−14.3479469428264)+2(−13.981115657496
2
93 −5 v −570000 3
x=574. 14941meters
True error,
Et =true value−approximate value
Et =574.14941−574.1494 1=0

Absolute relative true error,

| E
|ϵ t|= true value
t
|
×100 %
|
|ϵt|= 574.14941
0
|× 100 %
error =0 %

 Simpson’s 3/8 Rule:


This rule requires multiple of 3 sub-intervals. Therefore, I will first use 1/3 rule for n1 =4 and
then 3/8 rule for n2 =6.
For n=10 sub-intervals,
b−a b−a 40−93
h= = = =−5.3
n n1+ n2 4+6

n x f(x)
0 93 -14.71027077
1 87.7 -13.98111566
2 82.4 -13.23423443
3 77.1 -12.47027686
4 71.8 -11.68996009
5 66.5 -10.89406763
6 61.2 -10.08344782
7 55.9 -9.259011818
8 50.6 -8.421731024
9 45.3 -7.572633978
10 40 -6.712802768

I =I 1+ I 2

Applying Simpson’s 1/3 Rule, for n1 =4 (first 4 segments)

[ ]
n−1 n−2
h
I= f ( x o ) +4 ∑ f (x i)+2 ∑ f (x j)+ f ( x n )
3 i=1,3,5 j=2,4,6

h
I 1= [ f ( x o ) +4 f ( x 1) + 2 f ( x2 ) + 4 f ( x 3 ) + f ( x 4 ) ]
3

(−5.3)
I 1= [−14.7102707726928+4 (−13.9811156574969)+ 2(−13.2342344251698)+ 4(−12.47027685
3

Applying Simpson’s 3/8 Rule, for n2 =6 (last 6 segments)

[ ]
n−2 n−1 n−3
3h
I= f ( x o ) +3 ∑ f (x i)+3 ∑ f ( x i)+2 ∑ f (x i)+ f ( xn )
8 i=1,4,7 i=2,5,8 i=3,6,9

3h
I = [ f ( x 4 ) +3 f ( x 5 ) +3 f ( x 6 ) +2 f ( x 7 ) +3 f ( x8 ) + 3 f ( x 9 ) +f ( x 10 ) ]
8
3 (−5.3)
I 2= [ (−11.6899600890401)+ 3(−10.8940676266496)+ 3(−10.083447817597)+ 2(−9.25901181
8
Therefore,
I =I 1+ I 2=280.32454 +293.82490=574.14944
x=574.1494 4 meters

True error,
Et =true value−approximate value
Et =574.14941−574.14944=−0.00003

Absolute relative true error,

| E
|ϵ t|= true value
t
|
×100 %

| −0.00003 |× 100 %
|ϵt|= 574.14941

error ≈ 0 %

For n=20 sub-intervals,


I will first use 1/3 rule for n1 =14 and then 3/8 rule for n2 =6.

b−a b−a 40−93


h= = = =−2 .65
n n1+ n2 1 4+6

n x f(x)
0 93 -14.71027077
1 90.35 -14.34794694
2 87.7 -13.98111566
3 85.05 -13.60985178
4 82.4 -13.23423443
5 79.75 -12.85434693
6 77.1 -12.47027686
7 74.45 -12.08211594
8 71.8 -11.68996009
9 69.15 -11.2939093
10 66.5 -10.89406763
11 63.85 -10.49054314
12 61.2 -10.08344782
13 58.55 -9.672897508
14 55.9 -9.259011818
15 53.25 -8.841914036
16 50.6 -8.421731024
17 47.95 -7.998593112
18 45.3 -7.572633978
19 42.65 -7.143990531
20 40 -6.712802768

I =I 1+ I 2

Applying Simpson’s 1/3 Rule, for n1 =14 (first 14 segments)

[ ]
n−1 n−2
h
I = f ( x o ) +4 ∑ f (x i)+2 ∑ f (x j)+ f ( x n )
3 i=1,3,5 j=2,4,6

h
I 1=
3
[ f ( x o ) +4 f ( x 1) + 2 f ( x2 ) + 4 f ( x 3 ) +2 f ( x 4 ) +4 f ( x 5 ) +2 f ( x 6 ) +4 f ( x 7 ) +2 f ( x 8 ) +4 f ( x 9 ) +2 f ( x 1 0 ) +4 f ( x 11) +
−2.65
I 1= [−14.7102707726928+4 (−14.3479469428264)+2(−13.9811156574969)+ 4 (−13.609851781
3

Applying Simpson’s 3/8 Rule, for n2 =6 (last 6 segments)

[ ]
n−2 n−1 n−3
3h
I= f ( x o ) +3 ∑ f (x i)+3 ∑ f ( x i)+2 ∑ f (x i)+ f ( xn )
8 i=1,4,7 i=2,5,8 i=3,6,9

3h
I 2=
8
[ f ( x 1 4 ) + 3 f ( x 15 ) +3 f ( x1 6 ) +2 f ( x 1 7 ) +3 f ( x 1 8 ) +3 f ( x 1 9 ) + f ( x20 ) ]
3 (−2.65)
I 2= [ (−9.25901181824755)+3(−8.84191403623361)+3(−8.42173102416636)+2(−7.998593
8
Therefore,
I =I 1+ I 2=447.03904+127.11037=574.1494 1
x=574.1494 1 meters

True error,
Et =true value−approximate value
Et =574.14941−574.1494 1=0

Absolute relative true error,

|
|ϵ t|= true value
t E
|×100 %

|
|ϵt|= 574.14941
0
|× 100 %
error =0 %
a) Solving the general solution of this ordinary differential equation,
dy −0.3 x
=−1.2 y+7 e
dx

dy −0.3 x
+1.2 y=7 e
dx
Integrating factor,
IF=e∫
1.2 dx 1.2 x
=e
Therefore, general solution is
y (IF )=∫ Q(IF )dx +C
)=∫ 7 e
1.2 x −0.3 x 1.2 x
y (e (e ) dx +C
)=7 ∫ ( e )dx +C
1.2 x 0.9 x
y (e
1.2 x 7 0.9 x
y (e )= e +C
0.9
7
y (e 1.2 x )= e0.9 x + C
90
7 −0.3 x
y= e +C e−1.2 x
90
Now, solving its particular solution by substituting initial conditions, y=0 at x=3.
7 −0.3 (0 )
3= e + C e−1.2 (0 )
90
7 263
C=3− =
90 90
Therefore, solution of the ODE is

7 −0.3x 263 −1.2 x


y= e + e
90 90

b) Using Euler’s explicit method, also known as forward Euler’s method, we get the following
approximation values using this formula,
y n+ 1= y n +h × f ( xn , y n )

Where,
−0.3 x
f ( x n , y n )=−1.2 y +7 e
initial conditionsn=0 , x0 =0 , y 0=3 at h=0.5

See table below as reference with attached excel file,

y Absolut
n x Approximatio e
Exact
n Error
0 0 3 3 0
1.67069 3.02930
1 0.5 4 4.7 6
0.93777 3.95470
2 1.0 6 4.892477917 2
0.53263 4.01722
3 1.5 3 4.549854939 2
0.30778 3.74385
4 2.0 3 4.051640506 7
0.18222 3.35926
5 2.5 8 3.541496929 8

For exact values, use derived solution above,


7 −0.3x 263 −1.2 x
y= e + e
90 90
Absolute error,
absolute error=|exact−approximation|

Conclusion: Using Euler’s Explicit method of approximation, I obtained the following values of
Y from x=0 to x=2.5 at an interval of h= 0.5.
x Approximation
0 3
0.5 4.7
1.0 4.892477917
1.5 4.549854939
2.0 4.051640506
2.5 3.541496929

You might also like