Professional Documents
Culture Documents
y
4
2
1 2 3 4 x
-2
-4
-6
Figure Q1(a)
y
8
6
4
2
-10 -8 -6 -4 -2 2 4 6 8 10 x
-2
-4
-6
-8
-10
Figure Q1(c)
91
y
8
6
-3 -2 -1 1 2 3 x
Figure Q1(d)
y
15
10
5
-3 -2 -1
1 2 3 x
Figure Q1(e)
y
30
20
10
-4 -3 -2 -1 1 2 3 4 x
Figure Q1(f)
92
y
-3 -2 -1 1 2 3 x
-2
-4
-6
-8
-10
Figure Q1(g)
(h) Find the root of x e x by sketching the graph of y x 2 and
2
4. The equation that gives the depth ' x ' to which a ball is submerged
we use x = 1
underwater is given by x3 0.0048x2 0.028 0. Use the Newton-
method to find the depth ' x ' to which the ball is submerged under water.
93
where V , h and R are volume of water, depth of water and radius of tank,
respectively. What is the depth of water in the tank if the volume of water
is 500 m3? Use the bisection method to solve this problem for the depth
between 11 meter and 12 meter. Iterate until bi ai 0.0005.
where V , h and R are volume of water, depth of water and radius of tank,
respectively. What is the depth of water in the tank so that the volume of
water in it is 500 m3? Use the bisection method to solve this problem on the
depth between 11 meter and 12 meter. Iterate until bi ai 0.0005.
ANSWER 2……………………………………………………………………..
1(a)(i) 1.5237 (ii) 1.5236 (iii)1.5236
1(b) -1.5598 1(c) 4.9172
1(d) (i) & (ii) 0.877 (iii) 0.8767
1(e) 1.3818 1(f) 2.4236
1(g)(i) 0.3604 (ii) 0.3605 (iii) 0.3604
1(h)0.7035
1(i)(i) 2.2188 (ii) 2.2191 (iii) 2.2191
2. 15.2140
3. -1.9612
4. 0.3053
5. 11.1803
.................................................................................................................................
EXERCISES 3
1 2 3 x1 1 4 1 1 x1 3
(a). 0 5 6 x 2 1 (b). 3 7 2 x2 2
7 0 9 x 2 1 3 5 x3 1
3
2 x1 5x2 x3 2 2 x1 5x2 2
(c). 3x1 2 x2 7 x3 1 (d). 3x1 2 x2 7 x3 1
3x1 x2 x3 1 x2 x3 1
x1 2 x2 9 1 1 0 x1 6
(e). 6 x1 6 x2 8 x3 1 (f). 3 2 2 x2 2
3x2 x3 0 0 8 3 x3 6
94
2 1 0 x1 3 1 6 0 0 x1 4
(g). 3 2 1 x 2 0 (h). 5 2 7 0 x 2 0
0 3 2 x 4
0 2 3 8 x3 9
3
0 3 4 x 4 5
0
4 1 0 0 x1 3 1 2 0 0 x1 1
1 4 0 0 x2 9 2 9 1 0 x2 6
(i). (j).
0 0 4 1 x3 3 0 1 9 4 x3 2
0 x 11 0 3 x 4 8
0 1 4 4 0 4
2 x1 x2 9 5 x1 2 x2 2
(k). 2 x1 8 x2 3x3 1 (l). 2 x2 5 x2 2 x3 2
x 2 3 x3 1 2 x2 5 x3 8
8 x1 x2 3 x3 1 4 1 1 x1 3
(m). x1 9 x2 x3 1 (n). 1 7 3 x 2 2
3 x3 x2 3 x3 3 1 3 5 x 1
3
2 x2 8 x3 5 0 0 3 4 x1 8
(c). 3x1 4 x2 2 x3 1 2 9 1 0 x2 6
(d).
6 x1 3x 2 6 0 1 9 4 x3 8
2 0 x 4 9
1 0
3.
V2
i2
R1 R3
V1 i1
R4
R2 i3 R5
V395
The analysis of the voltage, V for the electrical circuit shown in figure given above
can be expressed in the following three equations:
R1 ( i1 i2 ) R2 ( i1 i3 ) V1
R3 i2 R4 ( i2 i3 ) R1 ( i2 i1 ) V2
R5 i3 R4 ( i3 i2 ) R2 ( i3 i1 ) V3
where R is the resistance and i is the current. If R1 = 20, R2 = 10, R3 = 25, R4
= 10, R5 = 30, V1 = 0, V2 = 0 and V3 = 200,
Solve the system of linear equations above for i1 , i2 and i3 by Gauss elimination
method.
ANSWER 3
1
x 0.8749 0.750 0.4583 x 0.7322 0.0109 0.0601
T T
(a). (b).
3. i1 3, i 2 2 , i 3 5
EXERCISES 4
1. Given a table generated by the function f ( x) cos x.
3
x 0 4 2 4
f (x ) 1 0.7071 0 -0.7071 -1
Approximate f by quadratic approximation. Calculate the absolute
8
error.
96
2. Given the table below generated by function f ( x) x2 .
x 2 3 4 5 6 7 8 9 10
f (x ) 4 9 16 25 36 49 64 81 100
Approximate f (5.5) for the third, fourth, fifth and sixth data. Calculate
the absolute error.
4. Let P3 ( x) be the Lagrange interpolating polynomial for the data (0, 0),
(0.5, y), (1, 3) and (2, 2). Find y if the coefficient of x 3 in P3 ( x) is 6.
6. Show that the polynomial of degree 2 that interpolates at the data points
(0, 1), (1, 2) and (4, 2) is P2 ( x) 0.25x 2 1.25x 1. What is the
degree of the interpolating polynomial if two data points are added to the
original set of data points?
8. x 0 1 8 27
f (x) 0 1 2 3
97
x0 0.0 f ( x0 ) ?
f 0[1] ?
x1 0.4 f ( x1 ) ? f 0[ 2] 50 7
f1[1] 10
x 2 0.7 f ( x2 ) 6
11. Given f ( x) e x .
(a) Complete the following table.
x 0 0.25 0.75 1.0
f ( x) e x
3
(c) Estimate f ( x) dx.
1
15. With a suitable method, find interpolating polynomial for the values given
in the table below.
i 0 1 2 3
xi 1 2 4 6
f ( xi ) 5 12 18 31
Hence, estimate f (7) if f (8) 39 is added in the set data.
7 13 8 58
S ( x) (1 x) 3 x 3 (1 x) x, x [0,1]
15 15 15 15
13 (2 x) 3 58 (2 x) 2 x 2, x [1, 2]
15 15
19. Find the value of k so that the function S (x) is a spline cubic function.
x 3 x 2 kx 1, 0 x 1
S ( x) 3
x (k 2) x kx 3, 1 x 2
2
99
20. Given the following data.
x 4 9 16
f (x) 2 3 4
Estimate f (7) and f (14) from
(a) Newton’s interpolatory divided-difference polynomial.
(b) Natural cubic spline function.
21. Consider the data points (0, 4), (1, 1), (2, 2) and the natural cubic spline.
S 0 ( x) 4 b0 x x 3 --- equation (1)
S1 ( x) 1 b1 ( x 1) 3( x 1) 2 ( x 1) 3 --- equation (2)
(a) Verify that S 0(0) 0 and S1(2) 0.
(b) Use S 0 (1) 1 and solve for b0 in the equation (1).
(c) Use S1 (2) 2 and solve for b1 in the equation (2).
(d) Use the value obtained for b0 and b1 to verify that
S 0 (1) S1 (1) and S 0(1) S1(1) .
If S interpolates the data (1, 1), (2, 1) and (3, 0), find B and D.
ANSWERS 4……………………………………………………………………..
1. (a) 0.9053 1. b (i) 0.6435 1. b (ii) 0.6262
2. (a) 30.25 2. b (i) 5.5 2. b (ii).. 5.4949 2. b (iii) 0.0051
3. P2 ( x) 0.129 x 0.890 x 0.624
2 8. x 0.5 3.5 18
4. 4.250 5. 2 6. 4 P 3(x) 0.534 2.411 -3.036
7. (a) 2.507 (b) Not possible since x = 353.5 f(x) 0.794 1.518 2.261
is not in the interval, 321.0 x 325.0 . Error 0.260 0.893 5.297
9. (a) f ( x0 ) 1 , f ( x1 ) 3 , f 0 5
[1] (50 35t 10t 2 t 3 )
13. P(t )
(b) 1.982 24
(c) No. Out of interval [0, 0.7] 14. (a) P2 ( x) 0.02 x 2 0.02 x 1.54
10. a 0.25 , b 0.5 , f (0.75) 6 (b) 1.465, -0.08 (c) 2.987
11. (a) 1.000, 0.779, 0.472, 0.368 15. Newton’s divided-difference,
(b) 0.670 (c) 0.671 P3 ( x) 5 7( x 1) 1.333( x 1)( x 2)
12. (a) 0.567 (b) 0.567 0.442( x 1)( x 2)( x 4)
37.880
100
19. 3
20. (a) 2.629, 3.762 (b) 2.626, 3.745 21. (b) b0 4 (c) b1 1
22. B 0.25 , D 0.25
EXERCISE 5
1. The velocity of a car at time t is given in the table below:
t 1 1.5 3 4 6 7 8 8.5 9 9.5
v(t ) 50 60 55 70 85 80 60 70 75 50
dh
Determine the rate of climb, at t 0.30 seconds using
dt
(a) 2-point forward finite-difference
(b) 2-point backward finite-difference
di
Given the voltage drop across an inductor is VL L , where L is
dt
inductance (henry). if L 3, evaluate the voltage drop across the inductor
at time t 8 by using appropriate formulae.
8. The table below gives the values of distance traveled by a car at various
times from a tollgate at highway.
Time, t (minute) 3 5 7 9 11
Distance traveled, x (km) 4.6 8.030 11.966 16.885 19.904
102
dv
By selecting a suitable value of step size, h, find the acceleration, a ,
dt
of the object at t 2.0 seconds by appropriate difference formula(s) given
in Table 5.1.
ANSWER 5
1. 2-point backward: 20, 2 –point forward: 10, 3-point central: 15, 3-point central:
40
2. (a) 210.733 2. (b) 258.7
3. 2-point backward: 12.9987, 2 –point forward: -7.5563, 3-point central: 2.7212,
3-point central- 26.6267
4. (a) (i) 9.491690, 9.070289 7(b) 1st derivative 3-point forward &
(ii) 8.588436, 8.980038 backward difference, 5-point
(iii) 9.040063, 9.025164 difference formulas; 2nd
(b) (i) 8.992565, 9.024710 derivatives 5-point difference
(ii) 8.997085, 9.024715 formula
(iii) 9.024983, 9.025013 8. 1.968, 1.715, 1.842, 1.722
5 (a) 9.032537, 9.025088 km/min; 1st derivative 3-point
(b) 9.025003, 9.025013 backward difference, 5-point
6. 2.270, 1.920, 2.095, 2.060, 2.075, difference formulas are not
2.086; 3.500, 3.475 appropriate
7. (a) 3.310, 3.140, 3.225, 3,220, 9. h = 0.2; All the formula in Table
3.235, 3.226; 1.700, 1.675 5.1 is not appropriate except 1st
derivative 3-point central
difference which give answer 5.5
m/sec2
EXERCISE 6
sin( x ) dx
2
1. Approximate with 12 subintervals by
4
(a) Trapezoidal rule.
1
(b) Simpson’s rule.
3
3
(c) Simpson’s rule.
8
1
dx
2. Approximate
0
1 x 4
by
103
1
(b) Simpson’s rule with 10 subintervals.
3
3
(c) Simpson’s rule with 9 intervals.
8
2 2
e
x2
3. Approximate dx by
3
(a) Trapezoidal rule with 10 subintervals.
1
(b) Simpson’s rule with 10 subintervals.
3
3
(c) Simpson’s rule with 15 intervals.
8
2
b
1 dy
dx dx.
a
1
5. Find the approximate value for 1 9 x 4 dx , with h = 0.1 using
0
1
[The exact answer, 1 9 x 4 dx = 1.547865469019 ]
0
6
6. Find the approximate value for 2 sin( 2 x ) dx and n 10
1
subintervals by using
(a) trapezoidal rule, (b) 1/3 Simpson’s rule.
1
1
7. Find the approximate value for dx using
x2 1 -1
Refer to integral in Q5-Q8, find the approximate value for those integrals by
Simpson’s 3/8 rule, respectively with
14. Find the area under the cosine curve from 0 to using Simpson’s rule by
2
taking step size h . Then, calculate the relative error with the exact
18
solution.
15. The arc length of curve y f (x) over the interval a x b is given by
Arc length 1 [ f ( x)]2 dx
b
105
f (x)
3
2
f ( x) e x
1
ANSWER 6………………………………………………………………………
1. (a) 1.2613 1. (b) 1.4097 1. (c) 1.3189
2. (a) 0.9263 2. (b) 0.9270 2. (c) 0.9270
3. (a) 2.4399 3. (b) 2.4460 3. (c) 2.4461
4. (a) 2.2514 4. (b) 2.2477 4. (c) 2.2477
5. (a) 1.5526 (b) 1.5479 9. 1.5479 10. 12.2013 11. 1.7628
6. (a) 12.1934 (b) 12.2011 12. not appropriate, 3.0038 13. 246.6667
7. (a) 1.7604, 1.7622 14. Use Simpson’s 3/8 rule; 1.000, 0
(b) 1.7628, 1.7627 15. (a) 1.1932 (b) Use Simpson’s 1/3 rule;
8. (a) 3.0419, 3.0195 0.9607
(b) 3.0076, not appropriate
EXERCISE 7
Solve questions 1-8 below by the Euler’s method and RK4 method.
1 A simple RL-electrical circuit consists of a constant reristance R (in
ohms), a constant inductance L (in hengry) and an electromotive force
E (t ) (in volts).
R
E
L
106
If the exact solution is i 8(1 e5t ) , find the absolute errors at each
iteration.
2 The RC-circuit below can be modeled as
sin100t V R=5
C= 0.1 F
di i
R E '(t ) .
dt C
.
Given E(t ) sin100t , R 5 ohms, C 0.1 F and i 0 when t 0.
Solve the differential equation for 0 t 0.05 with t 0.01. If the
10 500 10 2t
exact solution is i cos100t sin100t e , find the
2501 2501 2501
absolute errors at each iteration.
4 The equation of motion of a car with mass m (kg) moving with velocity v
(m/s) and resistance c (N s/m) is given by
dv
m cv, v(0) 10 m/s,
dt
with m 3000 kg, c 90 N s/m. Estimate the velocity of the car till
time t 5 s with t 1 s. If the exact solution is v(t ) 10e0.03t , find the
absolute errors.
107
5 An object of mass m moving in a viscous medium with resistive force
that is proportional to velocity Rv satisfies the differential equation
below:
dv
Rv,
m
dt
where m 2 kg, R 1.2 N s/m, and initial velocity is 100 m/s. Estimate
the velocity of the object for 0 t 0.05 with t 0.01 . If the exact
R
t
solution is v v0 e m
, find the absolute errors.
108
dC
0.05C 0, C (0) 106
dt
Estimate the concentration of the pollutant after 15 weeks. Take a step
size of 1 weeks. If the exact solution is C(t ) 106 e0.05t , find the absolute
errors. When the lake can reach the acceptable level?
ANSWERS 7
1. Euler’s method
k t i Exact |Error|
0 0 0 0.0000 0.0000
1 0.01 0.4000 0.3902 0.0098
2 0.02 0.7800 0.7613 0.0187
3 0.03 1.1410 1.1143 0.0267
4 0.04 1.4840 1.4502 0.0338
5 0.05 1.8098 1.7696 0.0402
1 RK4
109
j tj ij k1 k2 k3 k4 Exact |Error|
0 0 0 0.4000 0.3900 0.3903 0.3805 0.0000 0.0000
1 0.01 0.3902 0.3805 0.3710 0.3712 0.3619 0.3902 0.0000
2 0.02 0.7613 0.3619 0.3529 0.3531 0.3443 0.7613 0.0000
3 0.03 1.1143 0.3443 0.3357 0.3359 0.3275 1.1143 0.0000
4 0.04 1.4501 0.3275 0.3193 0.3195 0.3115 1.4502 0.0001
5 0.05 1.7695 0.3115 0.3037 0.3039 0.2963 1.7696 0.0001
2 Euler’s method
k t i Exact |Error|
0 0 0 0.0000 0.0000
1 0.01 0.2000 0.1665 0.0335
2 0.02 0.3041 0.1763 0.1278
3 0.03 0.2147 0.0205 0.1943
4 0.04 0.0125 -0.1576 0.1701
5 0.05 -0.1185 -0.1942 0.0757
2 RK4
j t i k1 k2 k3 k4 Exact |Error|
0 0 0 0.2000 0.1735 0.1738 0.1046 0.0000 0.0000
1 0.01 0.1665 0.1047 0.0098 0.0107 -0.0868 0.1665 0.0001
2 0.02 0.1763 -0.0868 -0.1629 -0.1621 -0.1983 0.1763 0.0000
3 0.03 0.0205 -0.1984 -0.1857 -0.1858 -0.1274 0.0205 0.0000
4 0.04 -0.1576 -0.1276 -0.0377 -0.0386 0.0607 -0.1576 0.0000
5 0.05 -0.1942 0.0606 0.1450 0.1442 0.1930 -0.1942 0.0000
3 Euler’s Method
i t T
0 0 37
1 1 34.9980
2 2 33.3043
3 3 31.8714
4 4 30.6592
5 5 29.6337
6 6 28.7661
7 7 28.0321
8 8 27.4112
9 9 26.8859
110
i 0 1
T 27.4112 26.8859
t 8 9
L 0.2172 0.7828
Time 8.7828
|error| 0.7392
3 RK4
i t T k1 k2 k3 k4
0 0 37.0000 -2.0020 -1.8478 -1.8597 -1.7156
1 1 35.1446 -1.7163 -1.5841 -1.5943 -1.4707
2 2 33.5540 -1.4713 -1.3580 -1.3668 -1.2608
3 3 32.1904 -1.2613 -1.1642 -1.1717 -1.0809
4 4 31.0214 -1.0813 -0.9980 -1.0044 -0.9266
5 5 30.0193 -0.9270 -0.8556 -0.8611 -0.7944
6 6 29.1602 -0.7947 -0.7335 -0.7382 -0.6810
7 7 28.4237 -0.6812 -0.6288 -0.6328 -0.5838
8 8 27.7923 -0.5840 -0.5390 -0.5425 -0.5005
9 9 27.2511 -0.5007 -0.4621 -0.4651 -0.4290
10 10 26.7871 -0.4292 -0.3962 -0.3987 -0.3678
i 0 1
T 27.2511 26.7871
t 9 10
L 0.4588 0.5412
Time 9.5412
|error| 0.0192
4 Euler
i t v Exact |Error|
0 0 10 10.0000 0
1 1 9.7000 9.7045 0.0045
2 2 9.4090 9.4176 0.0086
3 3 9.1267 9.1393 0.0126
4 4 8.8529 8.8692 0.0163
5 5 8.5873 8.6071 0.0198
4 RK4 Method
i t v k1 k2 k3 k4 Exact |Error|
111
0 0 10 -0.3000 -0.2955 -0.2956 -0.2911 10 0.0000
1 1 9.7045 -0.2911 -0.2868 -0.2868 -0.2825 9.7045 0.0000
2 2 9.4177 -0.2825 -0.2783 -0.2784 -0.2742 9.4176 0.0001
3 3 9.1394 -0.2742 -0.2701 -0.2701 -0.2661 9.1393 0.0001
4 4 8.8693 -0.2661 -0.2621 -0.2621 -0.2582 8.8692 0.0001
5 5 8.6072 -0.2582 -0.2543 -0.2544 -0.2506 8.6071 0.0001
5 Euler’s Method
i t v Exact |Error|
0 0 100 100 0
1 0.01 99.4000 99.4018 0.0018
2 0.02 98.8036 98.8072 0.0036
3 0.03 98.2108 98.2161 0.0053
4 0.04 97.6215 97.6286 0.0071
5 0.05 97.0358 97.0446 0.0088
5 RK4 Method
i t v k1 k2 k3 k4 Exact |Error|
0 0 100 -0.6000 -0.5982 -0.5982 -0.5964 100 0.0000
1 0.01 99.4018 -0.5964 -0.5946 -0.5946 -0.5928 99.4018 0.0000
2 0.02 98.8072 -0.5928 -0.5911 -0.5911 -0.5893 98.8072 0.0000
3 0.03 98.2161 -0.5893 -0.5875 -0.5875 -0.5858 98.2161 0.0000
4 0.04 97.6286 -0.5858 -0.5840 -0.5840 -0.5823 97.6286 0.0000
5 0.05 97.0446 -0.5823 -0.5805 -0.5805 -0.5788 97.0446 0.0000
6 Euler’s Method
i t v Exact |Error|
0 0 0 0 0
1 1 9.81 9.2216 0.5884
2 2 18.3938 17.3597 1.0341
3 3 25.9046 24.5415 1.3631
4 4 32.4765 30.8795 1.5970
5 5 38.2269 36.4727 1.7542
6 RK4 Method
i t v k1 k2 k3 k4 Exact |Error|
112
0 0 0 9.8100 9.1969 9.2352 8.6556 0 0.0000
1 1 9.2216 8.6573 8.1162 8.1500 7.6386 9.2216 0.0000
2 2 17.3597 7.6400 7.1625 7.1924 6.7410 17.3597 0.0000
3 3 24.5415 6.7423 6.3209 6.3473 5.9489 24.5415 0.0000
4 4 30.8794 5.9501 5.5782 5.6014 5.2499 30.8795 0.0001
5 5 36.4726 5.2509 4.9227 4.9433 4.6330 36.4727 0.0001
7 Euler’s Method
i t v Exact |Error|
0 0 0 0 0
1 1 11.19 11.3491 0.1591
2 2 22.6998 23.0229 0.3231
3 3 34.5393 35.0315 0.4922
4 4 46.7188 47.3856 0.6668
5 5 59.2492 60.0962 0.8470
113
7 RK4 Method
i t v k1 k2 k3 k4 Exact |Error|
0 0 0 11.19 11.3487 11.3487 11.5098 0.0000 0.0000
1 1 11.3491 11.5098 11.6734 11.6734 11.8395 11.3491 0.0000
2 2 23.0229 11.8395 12.0082 12.0082 12.1795 23.0229 0.0000
3 3 35.0315 12.1795 12.3536 12.3536 12.5304 35.0315 0.0000
4 4 47.3856 12.5304 12.7101 12.7101 12.8927 47.3856 0.0000
5 5 60.0962 12.8927 13.0783 13.0783 13.2669 60.0962 0.0000
8 Euler’s Method
i t C Exact |Error|
0 0 1000000 1000000 0
1 1 950000.0000 951229.4245 1229.4245
2 2 902500.0000 904837.4180 2337.4180
3 3 857375.0000 860707.9764 3332.9764
4 4 814506.2500 818730.7531 4224.5031
5 5 773780.9375 778800.7831 5019.8456
6 6 735091.8906 740818.2207 5726.3301
7 7 698337.2961 704688.0897 6350.7936
8 8 663420.4313 670320.0460 6899.6147
9 9 630249.4097 637628.1516 7378.7419
10 10 598736.9392 606530.6597 7793.7205
11 11 568800.0922 576949.8104 8149.7182
12 12 540360.0876 548811.6361 8451.5485
13 13 513342.0832 522045.7768 8703.6936
14 14 487674.9790 496585.3038 8910.3248
15 15 463291.2301 472366.5527 9075.3226
13.5 week
8. RK4 Method
i t C k1 k2 k3 k4
0 0 1000000 -50000.0000 -48750.0000 -48781.2500 -47560.9375
1 1 951229.4271 -47561.4714 -46372.4346 -46402.1605 -45241.3633
2 2 904837.423 -45241.8712 -44110.8244 -44139.1005 -43034.9161
3 3 860707.9835 -43035.3992 -41959.5142 -41986.4113 -40936.0786
4 4 818730.7620 -40936.5381 -39913.1246 -39938.7100 -38939.6026
5 5 778800.7937 -38940.0397 -37966.5387 -37990.8762 -37040.4959
6 6 740818.2328 -37040.9116 -36114.8889 -36138.0394 -35234.0097
7 7 704688.1032 -35234.4052 -34353.5450 -34375.5665 -33515.6268
8 8 670320.0607 -33516.0030 -32678.1030 -32699.0505 -31881.0505
9 9 637628.1673 -31881.4084 -31084.3732 -31104.2990 -30326.1934
10 10 606530.6763 -30326.5338 -29568.3705 -29587.3246 -28847.1676
11 11 576949.8277 -28847.4914 -28126.3041 -28144.3338 -27440.2747
12 12 548811.6541 -27440.5827 -26754.5681 -26771.7185 -26101.9968
13 13 522045.7953 -26102.2898 -25449.7325 -25466.0465 -24828.9874
14 14 496585.3228 -24829.2661 -24208.5345 -24224.0528 -23618.0635
114
15 15 472366.5721 -23618.3286 -23027.8704 -23042.6318 -22466.1970
Exact |Error|
1000000 0.0000
951229.4245 0.0026
904837.4180 0.0050
860707.9764 0.0071
818730.7531 0.0089
778800.7831 0.0106
740818.2207 0.0121
704688.0897 0.0135
670320.0460 0.0147
637628.1516 0.0157
606530.6597 0.0166
576949.8104 0.0173
548811.6361 0.0180
522045.7768 0.0185
496585.3038 0.0190
472366.5527 0.0194
13.9 week
11.(a) 2 1 0 0 y1 1.309
1 2 1 0 y 2 0.941
0 1 2 1 y 3 1.229
0 1 2 y 4 15.445
0
(b) y (0.2) 3.081 , y (0.4) 4.851 ,
y (0.6) 7.563 , and y (0.8) 11.504
12. y1 0.708, y2 0.292, y3 0.2657, y2 1.0027
EXERCISE 8
u u 2
1. Given the heat equation, , 0 x 1, t 0 with the boundary
t x 2
conditions, u(0, t ) 20t 2 and u(1, t ) 10t for t 0 and the initial condition,
u( x,0) x(1 x) for 0 x 1, Solve the heat equation by taking x h 0.25
and t k 0.01 until t 0.03 by using the explicit finite-difference method,
115
u u 2
2. Given the heat equation, , 0 x 1, t 0 with the boundary
t x 2
conditions, u(0, t ) 0 and u(1, t ) 5 for t 0 and the initial condition,
u( x,0) 5x for 0 x 1. Solve the heat equation by taking x h 0.1 and
t k 0.0001 until t 0.0002 by using the explicit finite-difference method.
u u 2
3. Given the heat equation, , 0 x 1, t 0 with the boundary
t x 2
conditions, u(0, t ) u(1, t ) 0 for t 0 and the initial condition,
u( x,0) sin x for 0 x 1. Find the approximate solution to the heat
equation for x = 0 to 1 and t ≤ 0.04 only. Take x h 0.2 and t k 0.02
by using the explicit finite-difference method.
4. One end A of an insulated metal bar AB of length 4m is kept at 0°C, while the
other end B is maintained at 10°C until a steady state of temperature along the
bar is achieved. At t 0, the end B is suddenly reduced to 0°C and kept at the
temperature. Use the explicit and implicit finite-difference method to solve the
u u 2
heat equation by taking x h 1 and k t 0.2 until t 0.4
t x 2
only.
u u 2
5. Given the heat equation , 0 x 1, t 0 with the boundary
t x 2
conditions, u(0, t ) u(1, t ) 0, for t 0 and the initial condition,
2 x, 0 x 0.5,
u ( x, 0)
2(1 x), 0.5 x 1,
for 0 x 1. By using the explicit, solve the heat equation by taking
x h 0.25 and t k 0.02 until t 0.04.
2u 2u
6. Given the wave equation, , 0 x 1, t 0, with the boundary
t 2 x 2
conditions, u(0, t ) u(1, t ) 0, t 0, and the initial conditions,
u( x,0) sin(4x), u t ( x,0) 0, for 0 x 1. By taking h x 0.2 and
k t 0.1, solve for u up to level 2 only using the explicit finite-difference
method.
2u 2u
7. Given the wave equation, 2 2 , 0 x 1, 0 t 0.5, with the boundary
t x
conditions, u(0, t ) u(1, t ) 0, 0 t 0.5 and the initial conditions,
u( x,0) sin(x), u t ( x,0) 0, for 0 x 1. By taking h x 0.2 and
k t 0.1, solve for u using the explicit finite-difference method.
116
5x 3
2 for 0 x ,
5
and initial conditions, u ( x,0)
15 15x for 3 x 1,
4 5
u t ( x,0) 0, for 0 x 1 .
By taking h x 0.2 and k t 0.01, solve for u using the explicit finite-
difference method.
9. A vibrating string of unit length is fixed at both ends and is subjected to the
initial conditions
u
u ( x, 0) x(1 x), ( x, 0) 0, 0 x 1.
t
Solve the governing equation
2u 2u
, 0 x 1, t 0,
t 2 x 2
for 0 t 0.05 with h x 0.25 and k t 0.01 by using the explicit
finite-difference method.
11. An elastic string which is fixed at both ends is governed by the wave equation
2u 2 u
2
c , 0 x 1, t 0,
t 2 x 2
with c 1, where u( x, t ) is the displacement of the string. The initial
conditions are given by
u
u ( x, 0) sin 3 ( x), ( x, 0) 0, 0 x 1.
t
Determine the variation of the displacement of the string by using the explicit
finite-difference method for 0 t 0.5 using h x 0.25 and k t 0.1.
ANSWERS 9
1.
t
0.03 0.018 0.1376 0.1936 0.1790 0.3
117
0.02 0.008 0.1510 0.2100 0.1667 0.2
0.01 0.002 0.1675 0.23 0.1675 0.1
0 0 0.1875 0.25 0.1875 0
0 0.25 0.5 0.75 1 x
2.
t
0.0002 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
0.0001 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
0 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 x
3.
t
0.04 0 0.3848 0.6226 0.6226 0.3848 0
0.02 0 0.4756 0.7695 0.7695 0.4756 0
0 0 0.5878 0.9511 0.9511 0.5878 0
0 0.2 0.4 0.6 0.8 1 x
4.
t
0.4 0 6.8000 9.2000 6.8000 0
0.2 0 8.0000 10.0000 8.0000 0
0 0 10 10 10 0
0 1 2 3 4 x
5.
t
0.04 0 0.3976 0.5648 0.3976 0
0.02 0 0.5000 0.6800 0.5000 0
0 0 0.5 1.0000 0.5 0
0 0.25 0.5 0.75 1 x
6
t
0.2 0 -0.2351 0.3804 -0.3804 0.2351 0
0.1 0 0.3220 -0.5210 0.5210 -0.3220 0
0 0 0.5878 -0.9511 0.9511 -0.5878 0
0 0.2 0.4 0.6 0.8 1 x
7
t
0.5 0 0.0117 0.0186 0.0186 0.0117 0
0.4 0 0.1905 0.3080 0.3080 0.1905 0
0.3 0 0.3511 0.5680 0.5680 0.3511 0
0.2 0 0.4782 0.7738 0.7738 0.4782 0
0.1 0 0.5597 0.9057 0.9057 0.5597 0
0 0 0.5878 0.9511 0.9511 0.5878 0
0 0.2 0.4 0.6 0.8 1 x
118
t
0.05 0 0.5000 0.9971 1.3500 0.7471 0
0.04 0 0.5000 0.9988 1.4026 0.7488 0
0.03 0 0.5000 0.9996 1.4446 0.7496 0
0.02 0 0.5000 0.9999 1.4752 0.7499 0
0.01 0 0.5000 1.0000 1.4938 0.7500 0
0 0 0.5 1 1.5 0.75 0
0 0.2 0.4 0.6 0.8 1 x
9
t
0.05 0 0.1850 0.2475 0.1850 0
0.04 0 0.1859 0.2484 0.1859 0
0.03 0 0.1866 0.2491 0.1866 0
0.02 0 0.1871 0.2496 0.1871 0
0.01 0 0.1874 0.2499 0.1874 0
0 0 0.1875 0.25 0.1875 0
0 0.25 0.5 0.75 1 x
10
t
0.5 0 0.1153 0.0329 -0.0417 -0.0593 0
0.4 0 0.1746 0.1979 0.0572 0.0989 0
0.3 0 0.1961 0.3219 0.2017 0.2219 0
0.2 0 0.2000 0.3844 0.3813 0.2844 0
0.1 0 0.2000 0.4000 0.5375 0.3000 0
0 0 0.2 0.4 0.6 0.3 0
0 0.2 0.4 0.6 0.8 1 x
11
t
0.5 0 0.1593 -0.1746 0.1593 0
0.4 0 0.3531 0.0026 0.3531 0
0.3 0 0.4343 0.2920 0.4343 0
0.2 0 0.4232 0.6269 0.4232 0
0.1 0 0.3770 0.8966 0.3770 0
0 0 0.3536 1 0.3536 0
0 0.25 0.5 0.75 1 x
119