Sie sind auf Seite 1von 33

PROBLEM SET 3.

Problem 1

(a)
i 1 2 3
xi 1:2 0:3 1:1
yi = P0 [xi ] 5:76 5:61 3:69
At x = 0:
(0
x2 )P0 [x1 ] + (x1 0)P [x2 ]
P1 [x1 ; x2 ] =
x1 x2
( 0:3)( 5:76) + ( 1:2)( 5:61)
= = 5:64
1:2 0:3

(0 x3 )P0 [x2 ] + (x2 0)P0 [x3 ]


P1 [x2 ; x3 ] =
x2 x3
( 1:1)( 5:61) + 0:3( 3:69)
= = 6:33
0:3 1:1

(0
x3 )P1 [x1 ; x2 ] + (x1 0)P1 [x2 ; x3 ]
P2 [x1 ; x2 ; x3 ] =
x0 x2
( 1:1)( 5:64) + ( 1:2)( 6:33)
= = 6:0 J
1:2 1:1

(b)

(0 x2 )(0 x3 ) ( 0:3)( 1:1)


`1 (0) = = = 0:0957
(x1 x2 )(x1 x3 ) ( 1:2 0:3)( 1:2 1:1)
(0 x1 )(0 x3 ) 1:2( 1:1)
`2 (0) = = = 1:1000
(x2 x1 )(x2 x3 ) [0:3 ( 1:2)] (0:3 1:1)
(0 x1 )(0 x2 ) 1:2( 0:3)
`3 (0) = = = 0:1957
(x3 x1 )(x3 x2 ) [1:1 ( 1:2)] (1:1 0:3)

X
3
P2 (0) = yi `i (0)
i=1
= 5:76(0:0957) + ( 5:61)(1:1000) + ( 3:69)( 0:1957) = 6:0 J

PROBLEM SET 3.1 1


Problem 2

i 1 2 3 4 5 6 7
xi 0 0:5 1 1:5 2 2:5 3
yi 1:8421 2:4694 2:4921 1:9047 0:8509 0:4112 1:5727

(a)

This is inverse interpolation: …nd x where y = 0. Using points 5-7:

(0 y6 )(0 y7 )
`5 (0) =
(y5 y6 )(y5 y7 )
0:4112(1:5727)
= = 0:2114
(0:8509 ( 0:4112))(0:8509 ( 1:5727))
(0 y5 )(0 y7 )
`6 (0) =
(y6 y5 )(y6 y7 )
0:8509(1:5727)
= = 0:9129
( 0:4112 0:8509) ( 0:4112 ( 1:5727))
(0 y5 )(0 y6 )
`7 (0) =
(y7 y5 )(y7 y6 )
0:8509(0:4112)
= = 0:1243
( 1:5727 0:8509) ( 1:5727 ( 0:4112))
X7
xjy=0 = xi `i (0)
i=5
= 2(0:2114) + 2:5(0:9129) + 3( 0:1243) = 2:332 J

2 PROBLEM SET 3.1


(b)

Use points 4-7:

(0 y5 )(0 y6 )(0 y7 )
`4 (0) =
(y4 y5 )(y4 y6 )(y4 y7 )
0:8509(0:4112((1:5727)
=
(1:9047 0:8509) (1:9047 ( 0:4112)) (1:9047 ( 1:5727))
= 0:0648
0 y4 1:9047
`5 (0) = [`5 (0)]3-point = (0:2114) = 0:3821
y5 y4 0:8509 1:9047
0 y4 1:9047
`6 (0) = [`6 (0)]3-point = (0:9129) = 0:7508
y6 y4 0:4112 1:9047
0 y4 1:9129
`7 (0) = [`7 (0)]3-point = ( 0:1243) = 0:0682
y7 y4 1:5727 1:9129
X 7
xjy=0 = xi `i (0)
i=4
= 1:5( 0:0648) + 2(0:3821) + 2:5(0:7508) + 3( 0:0682) = 2:339 J

Problem 3

Interpolationg at x = 0:7679:

(x x2 )P0 [x1 ] + (x1 x)P0 [x2 ]


P1 [x1 ; x2 ] =
x1 x2
(0:7679 0:5)(1:8421) + (0 0:7679)(2:4694)
= = 2:8055
0 0:5
(x x3 )P0 [x2 ] + (x2 x)P0 [x3 ]
P1 [x2 ; x3 ] =
x2 x3
(0:7679 1:0)(2:4694) + (0:5 0:7679)(2:4921)
= = 2:4816
0:5 1:0
(x x4 )P0 [x3 ] + (x3 x)P0 [x4 ]
P1 [x3 ; x4 ] =
x3 x4
(0:7679 1:5)(2:4921) + (1:0 0:7679)(1:9047)
= = 2:7648
1:0 1:5

PROBLEM 3 3
(x x3 )P1 [x1 ; x2 ] + (x1 x)P1 [x2 ; x3 ]
P2 [x1 ; x2 ; x3 ] =
x1 x3
(0:7679 1:0)(2:8055) + (0 0:7679)(2:4816)
= = 2:5568
0 1:0
(x x4 )P1 [x2 ; x3 ] + (x2 x)P1 [x3 ; x4 ]
P2 [x2 ; x3 ; x4 ] =
x2 x4
(0:7679 1:5)(2:4816) + (0:5 0:7679)(2:7648)
= = 2:5575
0:5 1:5

(x x4 )P2 [x1 ; x2 ; x3 ] + (x1 x)P2 [x2 ; x3 ; x4 ]


ymax = P3 [x1 ; x2 ; x3 ; x4 ] =
x1 x4
(0:7679 1:5)(2:5568) + (0 0:7679)(2:5575)
= = 2:5572 J
0 1:5

4 PROBLEM SET 3.1


Problem 4

Interpolating at x = 0:25 :

(x x2 )P0 [x1 ] + (x1 x)P0 [x2 ]


P1 [x1 ; x2 ] =
x1 x2
(0:25 0:5))( 1:0) + (0 0:25 )(1:75)
= = 3:3197
0 0:5
(x x3 )P0 [x2 ] + (x2 x)P0 [x3 ]
P1 [x2 ; x3 ] =
x2 x3
(0:25 1:0)(1:75) + (0:5 0:25 )(4:0)
= = 3:0343
0:5 1:0
(x x4 )P0 [x3 ] + (x3 x)P0 [x4 ]
P1 [x3 ; x4 ] =
x3 x4
(0:25 1:5)4:0) + (1:0 0:25 )(5:75)
= = 3:2489
1:0 1:5
(x x5 )P0 [x4 ] + (x4 x)P0 [x5 ]
P1 [x4 ; x5 ] =
x4 x5
(0:25 2:0)(5:75) + (1:5 0:25 )(7:0)
= 3:9635
1:5 2:0

(x x3 )P1 [x1 ; x2 ] + (x1 x)P1 [x2 ; x3 ]


P2 [x1 ; x2 ; x3 ] =
x1 x3
(0:25 1:0)(3:3197) + (0 0:25 )(3:0343)
= = 3:0955
0 1:0
(x x4 )P1 [x2 ; x3 ] + (x2 x)P1 [x3 ; x4 ]
P2 [x2 ; x3 ; x4 ] =
x2 x4
(0:25 1:5)(3:0343) + (0:5 0:25 )(3:2489)
= = 3:0955
0:5 1:5
(x x5 )P1 [x3 ; x4 ] + (x4 x)P1 [x4 ; x5 ]
P2 [x3 ; x4 ; x5 ] =
x3 x5
(0:25 2:0)(3:2489) + (1:0 0:25 )(3:9635)
= = 3:0955
1:0 2:0

There is no need to go futher. The tabulated function is clearly a quadratic


(interpolating over any three points gives the same result). Hence y(0:25 ) =
3:0955 J

PROBLEM 4 5
Problem 5

Use Newton’s method. The formulas


yi y1 ryi ry2
ryi = r2 yi =
xi x1 xi x2
2 2
r yi r y3 r3 yi r3 y4
r3 yi = r4 yi =
xi x3 xi x4
yield the following tableau:

i xi yi ryi r2 yi r3 yi r4 yi
1 0 0:7854
2 0:5 0:6529 2:8766
3 1:0 1:7390 2:5244 0:7043
4 1:5 2:2071 1:9950 0:8816 0:3546
5 2:0 1:9425 1:3640 1:0084 0:3041 0:1009

The diagonal terms in the tableau are the coe¢ cients of Newton’s polynomial.
We evaluate this polynomial at x = 0:25 with the recurrence relations

P0 (0:25 ) = 0:1009
P1 (0:25 ) = 0:3546 + (0:25 1:5)(0:1009) = 0:4267
P2 (0:25 ) = 0:7043 + (0:25 1:0)( 0:4267) = 0:6127
P3 (0:25 ) = 2:8766 + (0:25 0:5)( 0:6127) = 2:7017
P4 (0:25 ) = yj0:25 = 0:7854 + (0:25 0)(2:7017) = 1:3365 J

At x = 0:5 the recurrence relations are

P0 (0:5 ) = 0:1009
P1 (0:5 ) = 0:3546 + (0:5 1:5)(0:1009) = 0:3475
P2 (0:5 ) = 0:7043 + (0:5 1:0)( 0:3475) = 0:9027
P3 (0:5 ) = 2:8766 + (0:5 0:5)( 0:9027) = 1:9100
P4 (0:5 ) = yj0:5 = 0:7854 + (0:5 0)(1:9100) = 2:2148 J

6 PROBLEM SET 3.1


Problem 6

The divided di¤erence table is

i xi yi ryi r2 yi r3 yi r4 yi r5 yi
1 2 1
2 1 2 1
3 4 59 10 3
4 1 4 5 2 1
5 3 24 5 2 1 0
6 4 53 26 5 1 0 0
The last nonzero diagonal term r3 y4 is the coe¢ cient of the cubic term in
Newton’s polynomial. Therefore, the data points lie on a cubic J.

Problem 7

Constructing the divided di¤erence table:

i xi yi ryi r2 yi r3 yi r4 yi
1 3 0
2 2 5 1
3 1 4 2 1
4 3 12 2 1 0
5 1 0 0 1 0 0
Hence the polynomial is

P2 (x) = a1 + a2 (x x1 ) + a3 (x x1 )(x x2 )
= 0 + [x ( 3)] + [x ( 3)] (x 2)
= (x + 3)(1 + x 2) = (x + 3)(x 1) J

PROBLEM 6 7
Problem 8
i 1 2 3
xi 1 1 3
yi = P0 [xi ] 17 7 15

(x x2 )P0 [x1 ] + (x1 x)P0 [x2 ]


P1 [x1 ; x2 ] =
x1 x2
(x 1)(17) + ( 1 x)( 7)
= = 12x + 5
1 1

(x x3 )P0 [x2 ] + (x2 x)P0 [x3 ]


P1 [x2 ; x3 ] =
x2 x3
(x 3)( 7) + (1 x)( 15)
= = 4x 3
1 3

(x x3 )P1 [x1 ; x2 ] + (x1 x)P1 [x2 ; x3 ]


P2 [x1 ; x2 ; x3 ] =
x1 x3
(x 3)( 12x + 5) + ( 1 x)( 4x 3)
=
1 3
= 2x2 12x + 3 J

Problem 9
i 1 2 3
hi (km) 0 3 6
3
i (kg/m ) 1:225 0:905 0:652

(h h2 )(h h3 ) (h 3)(h 6) (h 3)(h 6)


`1 = = =
(h1 h2 )(h1 h3 ) (0 3)(0 6) 18
(h h1 )(h h3 ) (h 0)(h 6) h(h 6)
`2 = = =
(h2 h1 )(h2 h3 ) (3 0)(3 6) 9
(h h1 )(h h2 ) (h 0)(h 3) h(h 3)
`3 = = =
(h3 h1 )(h3 h2 ) (6 0)(6 3) 18

X
2
(h) = i `i
i=0
(h
3)(h 6) h(h 6) h(h 3)
= 1:225 0:905 + 0:652
18 9 18
= 0:003722h2 0:1178h + 1:225 J

8 PROBLEM SET 3.1


Problem 10
i 1 2 3
xi 0 1 2
yi 0 2 1
For natural spline we have k1 = k3 = 0. The equation for k1 is
6
k1 + 4k2 + k3 = (y1 2y2 + y3 )
h2
6
0 + 4k2 + 0 = 2 [0 2(2) + 1] k2 = 4:5
1
The interpolant in 0 x 1 is

k2 (x x1 )3
f1;2 (x) = (x x1 )(x1 x2 )
6 x1 x2
y1 (x x2 ) y1 (x x1 )
+
x1 x2
4:5 (x 0)3 0 2(x 0)
= (x 0)(0 1) +
6 0 1 0 1
= 0:75x3 + 2:75x J

The interpolant in 1 x 2 is

k2 (x x3 )3
f2;3 (x) = (x x3 )(x2 x3 )
6 x2 x3
y2 (x x3 ) y3 (x x2 )
+
x2 x3
4:5 (x 2)3 2(x 2) (x 1)
= (x 2)(1 2) +
6 1 2 1 2
= 0:75(x 2)3 1:75x + 4:5 J

Check:
0
f1;2 (x) = 3(0:75)x2 + 2:75 = 2:25x2 + 2:75
0
f2;3 (x) = 3(0:75)(x 2)2 1:75 = 2:25(x 2)2 1:75

0
f1;2 (1) = 2:25(1)2 + 2:75 = 0:5
0
f2;3 (1) = 2:25(1 2)2 1:75 = 0:5 O.K.

00
f1;2 (1) = 2:25(2) = 4:5
00
f2;3 (1) = 2:25(2)(1 2) = 4:5 O.K.

PROBLEM 10 9
Problem 11
i 1 2 3 4 5
xi 1 2 3 4 5
yi 13 15 12 9 13
For equally spaced knots, the equations for the curvatures are
6
ki 1 + 4ki + ki+1 = 2 (yi 1 2yi + yi+1 ), i = 2; 3; 4
h
Noting that k1 = k5 and h = 1, we get
4k2 + k3 = 6 [13 2(15) + 12] = 30
k2 + 4k3 + k4 = 6 [15 2(12) + 9] = 0
k3 + 4k4 = 6 [12 2(9) + 13] = 42
Solution of these equations is
k2 = 7:286 k3 = 0:857 k4 = 10:714
The interpolant between knots 2 and 3 is
k3 (x x4 )3
f3;4 (x) = (x x4 )(x3 x4 )
6 x3 x4
k4 (x x3 )3
(x x3 )(x3 x4 )
6 x3 x4
y3 (x x4 ) y4 (x x3 )
+
x3 x4
Hence
0:857 (3:4 4)3
f3;4 (3:4) = (3:4 4)(3 4)
6 3 4
10:714 (3:4 3)3
(3:4 3)(3 4)
6 3 4
12(3:4 4) 9(3:4 3)
+
3 4
= :0 54848 : 59998 4 + 10:8 = 10:255 J

Problem 12

After reordering, the data are


i 1 2 3 4 5
xi 1:0 0:8 0:6 0:4 0:2
yi 1:049 0:266 0:377 0:855 1:150

10 PROBLEM SET 3.1


The equations for the curvatures at the interior knots are (note that the roles
of x and y are interchanged and k1 = k5 = 0):

ki 1 (yi 1 yi ) + 2ki (yi 1 yi+1 ) + ki+1 (yi yi+1 )


xi 1 xi xi xi+1
= 6 , i = 2; 3; 4
yi 1 yi yi yi+1
T
These are simultaneous equations Ak = b, where k = k2 k 3 k4 and
2 3
2 ( 1:049 0:377) 0:266 0:377 0
A = 4 0:266 0:377 2 ( 0:266 0:855) 0:377 0:855 5
0 0:377 0:855 2(0:377 1:150)
2 3
2:852 0: 643 0
= 4 0: 643 2: 242 0: 478 5
0 0: 478 1: 546
2 1:0 0:8 0:8 0:6 3
6 1:049 ( 0:266) 0:266 0:377 7 2 3
6 7 0:3337
6 0:8 0:6 0:6 0:4 7
b = 66
6
7 = 4 0:6442 5
7
6 0:266 0:377 0:377 0:855 7 1:5573
4 0:6 0:4 0:4 0:2 5
0:377 0:855 0:855 1:150
The solution is 2 3 2 3
k2 0: 1069
4 k3 5 = 4 0:0 449 5
k4 0: 9934
The interpolant between knots 2 and 3 is
k2 (y y3 )3
f2;3 (y) = (y y3 )(y2 y3 )
6 (y2 y3 )
k3 (y y2 )3
(y y2 )(y2 y3 )
6 (y2 y3 )
x2 (y y3 ) x3 (y y2 )
+
y2 y3
Evaluating at y = 0:
0:1069 ( 0:377)3
f2;3 (0) = + 0:377( 0:266 0:377)
6 0:266 0:377
!
0:0449 (0:266)3
+ 0:266( 0:266 0:377)
6 0:266 0:377
0:8( 0:377) 0:6(0:266)
+
0:266 0:377
= 0:0028 + 0:0011 + 0:7173 = 0:7212 J

PROBLEM 12 11
Problem 13
i 1 2 3 4
x 0 1 2 3
y 1 1 0:5 0
With evenly spaced knots, the equations for the curvatures are
6
ki 1 + 4ki + ki+1 = (yi 1 2yi + yi+1 ), i = 2; 3
h2
With k1 = k2 , k4 = k3 and h = 1 these equations are

5k2 + k3 = 6(1 2(1) + 0:5) = 3


k2 + 5k3 = 6 [1 2(0:5) + 0] = 0

The solution is k2 = 5=8, k3 = 1=8. The interpolant can now be evaluated


from
ki (x xi+1 )3
fi;i+1 (x) = (x xi+1 )(xi xi+1 )
6 xi xi+1
ki+1 (x xi )3
(x xi )(xi xi+1 )
6 xi xi+1
yi (x xi+1 ) yi+1 (x xi )
+
xi xi+1
Substituting xi xi+1 = 1 and i = 3, this reduces to
k3 k4
f3;4 (x) = (x x4 )3 + (x x4) (x x3 )3 + (x x3 )
6 6
y3 (x x4 ) + y4 (x x3 )

Therefore,

1=8 1=8
f3;4 (2:6) = (2:6 3)3 + (2:6 3) (2:6 2)3 + (2:6 2)
6 6
0:5(2:6 3) + 0
= 0:185 J

12 PROBLEM SET 3.1


Problem 14

This program keeps prompting for x. To break the cycle, press the ’return’
key.
% problem3_1_14
xData = [-2.0 -0.1 -1.5 0.5 -0.6 2.2 1.0 1.8];
yData = [2.2796 1.0025 1.6467 1.0635 1.0920...
2.6291 1.2661 1.9896];
while 1
x = input(’x ==> ’);
if isempty(x); fprintf(’Done’); break; end
y = neville(xData,yData,x)
end

x ==> 1.1
y =
1.3262
x ==> 1.2
y =
1.3938
x ==> 1.3
y =
1.4693
x ==>
Done

Problem 15

Let us try polynomial interpolation over all the data points. Here is a program
that uses Newton’s method (Neville’s method would produce identical results):
% problem3_1_15
xData = [-250 -200 -100 0 100 300];
yData = [0.0163 0.318 0.699 0.870 0.941 1.04];
for T = [200 400]
T
cp = neville(xData,yData,T)
end

>> T =
200

PROBLEM 14 13
cp =
0.9933
T =
400
cp =
0.9860

From the plot of the interpolant we see that the result is credible at T = 200 ;
that is, we accept
cp (200 ) = 0:993 kJ/kg k J
However, the result unacceptable at 400 , where the interpolated value cp =
0:986 clearly strays from the trend of the data. This is another example where
polynomial interpolation should be used for extrapolation with a great deal of
caution.

1.20

1.00

0.80
cp

0.60

0.40

0.20

0.00
-300 -200 -100 0 100 200 300
T

A more believable result at 400 is obtained by straight-line extrapolation based


on the last two given data points (at 100 and 300 ):
400 300
cp (400) = cp (300) + [cp (300) cp (100)]
300 100
1
= 1:04 + (1:04 0:941) = 1:090 kJ/kg K J
2

14 PROBLEM SET 3.1


Problem 16

Polynomial interpolation over more than a few points is generally not rec-
ommended since a high-order interpolant has a tendency to develop spurious
wiggles. The plot of the polynomial interpolant spanning all 7 given data points
is the dashed line in the …gure. Clearly, this interpolant is useless.

10.0

8.0

6.0
y

4.0

2.0

0.0
0.0 0.2 0.4 0.6 0.8 1.0
x

However, interpolant intersecting 4 nearest-neighbour points (solid line in the


…gure) looks good. The 4 nearest points to x = 0:46 are

x 0:1055 0:241 0:582 0:712


y 1:79 2:63 4:39 4:99

We chose Neville’s method for the interpolation over these points:

% problem3_1_16
xData = [0.1055 0.241 0.582 0.712];
yData = [1.79 2.63 4.39 4.99];
x = 0.46
y = neville(xData,yData,x)

>> x =
0.4600
y =
3.8026

PROBLEM 16 15
Problem 17

Since cubic spline resists spurious wiggles, it can be used with relative safety
over numerous data points. This program does cubic spline interpolation on
the logarithms of the data. It prompts for user input of x. In this case, x = Re
and y = cD .
% problem3_1_17
xData = log10([0.2 2 20 200 2000 20000]);
yData = log10([103 13.9 2.72 0.800 0.401 0.433]);
x = [5 50 500 5000];
k = splineCurv(xData,yData);
fprintf(’ Re cD\n’)
for Re = x
cD = 10^splineEval(xData,yData,k,log10(Re));
fprintf(’%8.0f %8.4f\n’,Re,cD)
end

>> Re cD
5 6.9016
50 1.5908
500 0.5574
5000 0.3868

Problem 18

The following program uses Neville’s method.


% problem3_1_18
xData = log10([0.2 2 20 200 2000 20000]);
yData = log10([103 13.9 2.72 0.800 0.401 0.433]);
fprintf(’ Re cD\n’)
start = 1; stop = 4;
for Re = [5 50 500 5000]
cD = neville(xData(start:stop),yData(start:stop),log10(Re));
if stop < 6; start = start + 1; stop = stop + 1; end
fprintf(’%8.0f %8.4f\n’,Re,10^cD)
end

>> Re cD
5 6.9326
50 1.5806

16 PROBLEM SET 3.1


500 0.5627
5000 0.3722

Problem 19

Since there are 7 data points, we could use global cubic spline interpolation
or polynomial interpolation over nearest-neighour data points. The following
program uses the cubic spline.

% problem3_1_19
xData = [0 21.1 37.8 54.4 71.1 87.8 100];
yData = [1.79 1.13 0.696 0.519 0.338 0.321 0.296];
x = [10 30 60 90];
k = splineCurv(xData,yData);
fprintf(’Temperature Viscosity\n’)
for T = x
mu = splineEval(xData,yData,k,T);
fprintf(’%9.0f %13.4f\n’,T,mu)
end

>> Temperature Viscosity


10 1.4750
30 0.8701
60 0.4541
90 0.3195

Problem 20

As we have extrapolation, polynomial interpolation over all the data points


is dangerous. It is more prudent to use a few point at the high end of the
data range. The following is essentially the program used in Problem 14; it
interpolates over three points with Neville’s method:

% problem3_1_20
xData = [6.1 7.625 9.150];
yData = [0.5328 0.4481 0.3741];
h = 10.5
rho = neville(xData,yData,h)

>> h =

PROBLEM 19 17
10.5000
rho =
0.3175

18 PROBLEM SET 3.1


PROBLEM SET 3.2

Problem 1

The equation of the regression line is

f (x) = a + bx = (y xb) + bx

Thus
f (x) = y Q.E.D.

Problem 2
x y x x x(x x) y(x x) f (x) y f (x)
1:0 1:00 1:0 1:00 1:000 1:02 0:02
0:5 0:55 0:5 0:25 0:275 0:52 0:03
0:0 0:00 0:0 0:00 0:000 0:02 0:02
0:5 0:45 0:5 0:25 0:225 0:48 0:03
P 1:0 1:00 1:0 1:00 1:000 0:98 0:02
0:0 0:100 2:50 2:500
1X 1X 0:100
x= x=0 y= y= = 0:02
5 5 5
P
y(x x) 2:500
b = P = = 1:0
x(x x) 2:50
a = y xb = 0:02 0(1:0) = 0:02

The regression line is


f (x) = 0:02 + x J
X
S= [y f (x)]2 = 3(0:02)2 + 2( 0:03)2 = 0:003

The standard deviation is (n + 1 = the number of data points; m = degree of


interpolating polynomial)
r r
S 0:003
= = = 0:0316 J
n m 4 1

PROBLEM SET 3.2 19


Problem 3
x (Stress) y (Strain) x x x(x x) y(x x)
34:5 0:46 51:75 1785 23:81
69:0 0:95 17:25 1190 16:39
103:5 1:48 17:25 1785 25:53
138:0 1:93 51:75 7142 99:88
34:5 0:34 51:75 1785 17:60
69:0 1:02 17:25 1190 17:60
103:5 1:51 17:25 1785 26:05
138:0 2:09 51:75 7142 108:16
34:5 0:73 51:75 1785 37:78
69:0 1:10 17:25 1190 18:98
103:5 1:62 17:25 1785 27:95
P 138:0 2:12 51:75 7142 109:71
1 035:0 15:35 17 854 265:12
P P
x 1035:0 y 15:35
x= = = 86:25 y= = = 1:2792
12 12 12 12
Converting the strain y from mm/m to m/m, we have
P
y(x x) 265:12 10 3
b= P = (MPa) 1 = 1:4849 10 5 (MPa) 1
x(x x) 17 854

The modulus of elasticity is


1 1
E= = 5
MPa = 67350 MPa = 67:34 GPa J
b 1:4849 10

20 PROBLEM SET 3.2


Problem 4

Let x = stress and y = strain.

x y W W 2x W 2y x x W 2 x(x x) W 2 y(x x)
34:5 0:46 1:0 34:5 0:460 51:75 1785 23:81
69:0 0:95 1:0 69:0 0:950 17:25 1190 16:39
103:5 1:48 1:0 103:5 1:480 17:25 1785 25:53
138:0 1:93 1:0 138:0 1:930 51:75 7142 99:88
34:5 0:34 1:0 34:5 0:340 51:75 1785 17:60
69:0 1:02 1:0 69:0 1:020 17:25 1190 17:60
103:5 1:51 1:0 103:5 1:510 17:25 1785 26:05
138:0 2:09 1:0 138:0 2:090 51:75 7142 108:16
34:5 0:73 0:5 8:6 0:183 51:75 446 9:44
69:0 1:10 0:5 17:3 0:275 17:25 298 4:74
103:5 1:62 0:5 25:9 0:405 17:25 445 6:99
P 138:0 2:12 0:5 34:5 0:530 51:75 1785 27:43
776:3 11:173 13 390 204:46
X
W 2 = 8 + 4(0:25) = 9
P 2 P 2
W x 776:3 W y 11:173
x^ = P 2 = = 86:25 y^ = P = = 1:2414
W 9 W 9
Converting the strain y from mm/m to m/m, we have
P 2
W y(x x^) 204:46 10 3
b= P 2 = (MPa) 1 = 1:5270 10 5 (MPa) 1
W x(x x^) 13 390

The modulus of elasticity is


1 1
E= = 5
MPa = 65:49 MPa = 65:49 GPa J
b 1:5270 10

PROBLEM 4 21
Problem 5

In this and the following problems we use MATlAB’s plotting capability to


plot the data points and the …tting function.

% problem3_2_5
xData = 0:0.5:5;
yData =[3.076 2.810 2.588 2.297 1.981 1.912 ...
1.653 1.478 1.399 1.018 0.794];
format short e
c = polynFit(xData,yData,2)
std_deviation = stdDev(c,xData,yData)
y = c(2)*ones(length(xData),1) + c(1)*xData’; % Interpolant
plot(xData,yData,’ko’); hold on; plot(xData,y,’k-’)
xlabel(’x’); ylabel(’y’)

>> c =
-4.3838e-001
3.0056e+000
std_deviation =
7.7499e-002

The equation of the interpolant is y = 3:0056 0:43838x (solid line in the


…gure).

22 PROBLEM SET 3.2


Problem 6

% problem3_2_6
xData = [1310 1810 1175 2360 1960 2020 1755 ...
1595 1470 1430 1110 1785];
yData =[10.2 8.1 11.9 5.5 6.8 6.8 7.7 ...
8.9 9.8 10.2 13.2 7.7];
format short e
c = polynFit(xData,yData,2)
std_deviation = stdDev(c,xData,yData)
y = c(2)*ones(length(xData),1) + c(1)*xData’;
plot(xData,yData,’ko’); hold on; plot(xData,y,’k-’)
xlabel(’x’); ylabel(’y’)

>> c =
-5.8963e-003
1.8619e+001
std_deviation =
5.5966e-001

PROBLEM 6 23
Problem 7

% problem3_2_7
xData = [0 1.525 3.050 4.575 6.100 7.625 9.150];
yData = [1 0.8617 0.7385 0.6292 0.5328 0.4481 0.3741];
format short e
c = polynFit(xData,yData,3)
std_deviation = stdDev(c,xData,yData)
x1 = min(xData); x2 = max(xData); dx = (x2 - x1)/50;
x = x1:dx:x2;
y = c(3)*ones(1,length(x)) + c(2)*x + c(1)*x.^2;
plot(xData,yData,’ko’); hold on; plot(x,y,’k-’)
xlabel(’h’); ylabel(’rho’)

>> c =
2.7632e-003
-9.3447e-002
9.9890e-001
std_deviation =
1.3473e-003

24 PROBLEM SET 3.2


Problem 8

% problem3_2_8
xData = [0 21.1 37.8 54.4 71.1 87.8 100];
yData = [1.79 1.13 0.696 0.519 0.338 0.321 0.296];
format short e
c = polynFit(xData,yData,4)
std_deviation = stdDev(c,xData,yData)
fprintf(’Temperature Viscosity\n’)
for T = [10 30 60 90]
[mu,dmu,ddmu] = evalPoly(c,T);
fprintf(’%6.0f %13.4f\n’,T,mu)
end
% Plotting the data and the fitting function
x1 = min(xData); x2 = max(xData); dx = (x2 - x1)/50;
x = x1:dx:x2;
y = c(4)*ones(1,length(x)) + c(3)*x + c(2)*x.^2 + c(1)*x.^3;
plot(xData,yData,’ko’); hold on; plot(x,y,’k-’)
xlabel(’h’); ylabel(’rho’)

>> c =
-8.4589e-007
3.2857e-004
-3.9321e-002
1.7957e+000
std_deviation =
3.4005e-002
Temperature Viscosity
10 1.4345
30 0.8889
60 0.4366
90 0.3016

PROBLEM 8 25
Problem 9

The program below prompts for the degree of the …tting polynomial until it
receives an empty input (by pressing ’return’).

% problem3_2_9
xData = [1 2.5 3.5 4 1.1 1.8 2.2 3.7];
yData = [6.008 15.722 27.130 33.772 5.257 9.549 ...
11.098 28.828];
format short e
while 1
m = input(’Degree of polynomial ==> ’);
if isempty(m); fprintf(’Done’); break; end
c = polynFit(xData,yData,m+1)
std_deviation = stdDev(c,xData,yData)
% Plotting the data and the fitting function
x1 = min(xData); x2 = max(xData); dx = (x2 - x1)/50;
x = x1:dx:x2;
y = zeros(1,length(x));
for i = 1:m+1
y = y + c(i)*x.^(m-i+1);
end
plot(xData,yData,’ko’); hold on; plot(x,y,’k-’)
label(’x’); ylabel(’y’)
end

26 PROBLEM SET 3.2


Degree of polynomial ==> 1
c =
9.4385e+000
-6.1899e+000
std_deviation =
2.2436e+000
Degree of polynomial ==> 2
c =
2.1081e+000
-1.0689e+000
4.4057e+000
std_deviation =
8.1293e-001
Degree of polynomial ==>
Done

The quadratic is a much better …t.

PROBLEM 9 27
Problem 10

Since we have to do extrapolation, the …tting function should be either straight


line or a quadratic. Let us try both:

% problem3_2_10
xData = [1718 1767 1774 1775 1792 1816 1828 1834 1878 1906];
yData = [0.5 0.8 1.4 2.7 4.5 7.5 12.0 17.0 17.2 23.0];
format short e
while 1
m = input(’Degree of polynomial ==> ’);
if isempty(m); fprintf(’Done’); break; end
c = polynFit(xData,yData,m+1)
std_deviation = stdDev(c,xData,yData)
% Plotting the data and the fitting function
x1 = min(xData); x2 = max(xData); dx = (x2 - x1)/50;
x = x1:dx:x2;
y = zeros(1,length(x));
for i = 1:m+1
y = y + c(i)*x.^(m-i+1);
end
plot(xData,yData,’ko’); hold on; plot(x,y,’k-’)
xlabel(’Year’); ylabel(’Efficiency’)
end

Degree of polynomial ==> 1


c =
1.3769e-001
-2.4039e+002
std_deviation =
2.8552e+000
Degree of polynomial ==> 2
c =
3.3374e-004
-1.0740e+000
8.5852e+002
std_deviation =
2.7684e+000
Degree of polynomial ==>
Done

28 PROBLEM SET 3.2


As the standard devations are about equal, we choose the straight line (always
the safer of the two for extrapolation). Thus the predicted e¢ ciency in year
2000 is 240:39 + 0:13769(2000) = 35:0% J

Problem 11
T T 2 10 3 T 3 10 6 T 4 10 9 k kT kT 2 10 3
79 6:24 0:49 0:04 1:000 79:00 6:24
190 36:10 6:86 1:30 0:932 177:08 33:65
357 127:45 45:50 16:24 0:839 299:52 106:93
524 274:58 143:88 75:39 0:759 397:72 208:40
P 690 476:10 328:51 226:67 0:693 478:17 329:94
1840 920:47 525:24 319:64 4:223 1431:49 685:16
The coe¢ cients a of the quadratic are given by the solution of the equation
2 P P 2 32 3 2 P 3
P5 T
P 2 P 3 T a 1 P k
4 5 4 a2 5 = 4 5
P T2 T
P 3 P 4 T P kT 2
T T T a3 kT
2 32 3 2 3
5 1840 920:47 103 a1 4:223
4 1840 920:47 103 525:24 106 5 4 a2 5 = 4 1431:49 5
920:47 103 525:24 106 319:64 109 a3 685:16 103
The solution is
3 6
a1 = 1:0526 a2 = 0:6807 10 a3 = 0:2310 10

PROBLEM 11 29
Thus the quadratic approximation is

k = 1:0526 0:6807 10 3 T + 0:2310 10 6 T 2 J

Problem 12

f (x) = axb
F (x) = ln f (x) = ln a + b ln x

The residuals are

ri = yi f (xi ) = yi axbi (a)


yi
Ri = ln yi F (xi ) = ln yi ln a b ln xi = ln b ln xi (b)
a
But from Eq. (a)
yi ri = axbi
so that

ln(yi ri ) = ln a + b ln xi
yi ri
b ln xi = ln
a
Substitution into Eq. (b) yields
yi yi ri yi 1
Ri = ln ln = ln = ln
a a yi ri 1 ri =yi

For small ri =yi we can approximate

ri ri
Ri ln 1 + Q.E.D.
yi yi

Problem 13
i 1 2 3 4 5 6
xi 0:5 0:19 0:02 0:20 0:35 0:50
yi 3:558 2:874 1:995 1:040 0:068 0:677
The …tting function is a linear form with
t t
f1 (x) = sin f2 (x) = cos
2 2

30 PROBLEM SET 3.2


The coe¢ cients a and b are given by the solution of the equations
P 2 P P
P i f1 (xi ) f1 (xi )f2 (xi )
iP
2
a f (x )y
= Pi 1 i i (a)
f (x )f
i 1 i 2 i (x ) f
i 2 (x i) b i f2 (xi )yi

i f1 (xi ) f2 (xi ) f12 (xi ) f1 (xi )f2 (xi ) f22 (xi) f1 (xi )y2 f2 (xi )yi
1 0:7071 0:7071 0:5000 0:5000 0:5000 2:5159 2:5159
2 0:2940 0:9558 0:0865 0:2810 0:9135 0:8451 2:7469
3 0:0314 0:9995 0:0010 0:0314 0:9990 0:0627 1:9940
4 0:3090 0:9511 0:0955 0:2939 0:9045 0:3214 0:9891
5 0:5225 0:8526 0:2730 0:4455 0:7270 0:0355 0:0580
6P 0:7071 0:7071 0:5000 0:5000 0:5000 0:4716 0:4716
1:4560 0:4898 4:5440 3:4130 7:8323
Equations (a) are
1:4560 0:4898 a 3:4130
=
0:4898 4:5440 b 7:8323
The solution is
a = 3: 034 b= 2: 051 J

Problem 14
i 1 2 3 4 5
xi 0:5 1:0 1:5 2:0 2:5
yi 0:49 1:60 3:36 6:44 10:16
Rather than …tting y = aebx , we use linear regression to …t ln y = ln a + bx
with the weights Wi = yi .
i zi = ln yi yi2 xi yi2 zi xi x^ yi2 xi (xi x) yi2 zi (xi x)
1 0:7133 0:12 0:17 1:7711 0:213 0:303
2 0:4700 2:56 1:20 1:2711 3:254 1:529
3 1:2119 16:93 13:68 0:7711 13:058 10:551
4 1:8625 82:95 77:25 0:2711 22:487 20:941
5P 2:3185 258:06 239:32 0:2289 59:071 54:781
360:63 331:28 20:059 22:063
X
yi2 = 0:492 + 1:602 + 3:362 + 6:442 + 10:162 = 158:79
i

P 2
y xi 360:63
x^ = Pi i 2 = = 2:2711
i yi 158:79
P 2
y zi 331:28
z^ = Pi i 2 = = 2:0863
i yi 158:79

PROBLEM 14 31
P 2
y zi (xi x) 22:063
b = P i 2i = = 1:0999 J
i yi xi (xi x) 20:059

ln a = z^ b^
x = 2:0863 1:0999(2:2711) = 0:41168
a = e = 0:6625 J
0:41168

Problem 15

i 1 2 3 4 5
x 0:5 1:0 1:5 2:0 2:5
y 0:541 0:398 0:232 0:106 0:052

The …tting function is y = axebx , or y=x = aebx . We linearize the problem by


…tting ln(y=x) = ln a + bx with the weights Wi = yi .

i zi = ln yi =xi yi2 xi yi2 zi xi x^ yi2 xi (xi x) yi2 zi (xi x)


1 0:0788 0:1463 0:0231 0:2993 0:04380 0:00690
2 0:9213 0:1584 0:1459 0:2007 0:03179 0:02929
3 1:8665 0:0807 0:1005 0:7007 0:05657 0:07039
4 2:9375 0:0225 0:0330 1:2007 0:02698 0:03963
5P 3:8728 0:0068 0:0105 1:7007 0:01150 0:01781
0:4147 0:2668 0:08304 0:16402
X
yi2 = 0:5412 + 0:3982 + 0:2322 + 0:1062 + 0:0522 = 0:5188
i

P 2
y xi 0:4147
x^ = Pi i 2 = = 0:7993
i yi 0:5188
P 2
y zi 0:2668
z^ = Pi i 2 = = 0:5143
i yi 0:5188
P 2
y zi (xi x) 0:16402
b = P i 2i = = 1:9752 J
i yi xi (xi x) 0:08304

ln a = z^ b^ x = 0:5143 ( 1:9752)(0:7993) = 1:0645


a = e = e1:0645 = 2:899 J
ln a

Computation of standard deviation:

f (x) = axebx = 2:899xe 1:9752x

32 PROBLEM SET 3.2


i yi f (xi ) [yi f (xi )]2 106
1 0:541 0:53998 1:047
2 0:398 0:40226 18:122
3 0:232 0:22475 52:609
4 0:106 0:11162 21:552
5
P 0:052 0:05197 0:000
103:330
r r
6
S 103:330 10
= = = 5:87 103 J
5 2 3

Problem 16

The …tting function is = aebt (the value of b should come out to be negative).
We linearize the problem by …tting

ln = ln a + bt (a)

with the weights Wi = i . The half-life t1=2 is obtained by substituting = 0:5


into Eq. (a) and solving for t, obtaining

ln 0:5 ln a
t1=2 =
b
% problem3_2_16
x = [0:0.5:5.5];
y = [1 0.994 0.990 0.985 0.979 0.977 ...
0.972 0.969 0.967 0.960 0.956 0.952];
format short e
z = log(y);
xBar = dot(x,y.^2)/dot(y,y);
zBar = dot(z,y.^2)/dot(y,y);
b = dot(y.^2,z.*(x - xBar))/dot(y.^2,x.*(x - xBar));
ln_a = zBar -b*xBar;
half_life = (log(0.5) - ln_a)/b

>> half_life =
7.9996e+001

PROBLEM 16 33

Das könnte Ihnen auch gefallen