You are on page 1of 29

EXERCISE 2

1. Solve the following questions by bisection method with | b0  a0 |  1, secant


method and Newton’s method using   0.0005.
(a) Find the root of f ( x)  cos x  2 x  3 as in Fig. Q1(a).

y
4
2

1 2 3 4 x
-2
-4
-6
Figure Q1(a)

(b) Find the root of 4 x 3  3x 2  2 x  11 over the interval [2,  1] .

(c) Find the least positive root of f ( x)  x cos x 1 as shown in


Figure Q1(c).

y
8
6
4
2

-10 -8 -6 -4 -2 2 4 6 8 10 x
-2
-4
-6
-8
-10
Figure Q1(c)

(d) Find the positive root of f ( x)  x 2  sin x as shown in Figure


Q1(d).

91
y
8
6

-3 -2 -1 1 2 3 x
Figure Q1(d)

(e) Given the graphs of y  sin x and y  e x  3 in the Figure Q1(e).


Find the root of sin x  e x  3.

y
15

10

5
-3 -2 -1
1 2 3 x

Figure Q1(e)

(f) Given the graph of f ( x)  x 3  10x  10 in the Figure Q1(f).


Find the most positive roots of f ( x).

y
30

20

10

-4 -3 -2 -1 1 2 3 4 x

Figure Q1(f)

(g) Graph of f ( x)  3x  sinx  e x over the interval is shown in


Figure Q1(g). Find the least positive root of f ( x).

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

y  e  x on the same plot.


(i) Find the root of y  sin x  ln x by sketching the graph of
y  sin x and y  ln x on the same plot.

2. The velocity, v, of a falling parachutist is given by v 


gm
c
 
1  e ( c / m)t ,
where g = 9.81 m/s2. Given the mass of the parachutist is 70kg, velocity,
v = 40 m/s at time t = 10 s, find the drag coefficient by using the
Bisection method.

3. A particle starts at rest on a smooth inclined plane. At the end of t seconds,


the position of the particle is given by
g
x(t ) 
4w

2
e w t  sin w t , 
where g = 9.81 m/s2 is the constant of gravity. Suppose that particle has
moved x = 0.5m in t = 1s. Find the value of w in the equation by taking
the interval [2,  1] by using secant method.

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.

5. A spherical tank with radius R  5 m is used to hold water from a small


village. The volume of water in it can be computed by the formula
(3R  h)
V   h2
3

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. Solve the system of linear equations below by Gauss elimination


method.

 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. Solve the system of linear equations below by Gauss elimination method


with pivoting.
x 2  6 x3  4 2 x 2  5 x3  7
(a). 8 x1  x2  3x3  1 (b). 5 x1  x2  2 x3   3
x1  9 x2  7 3x1  5x2  10

 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).

x   0.9049 0.9207 0.7937  x  1.7578 0.3031 0.6970 


T T
(c). (d).
x   5.4666 1.7667 5.3000  x   4.8387 1.1613 5.0968
T T
(e). (f).

x   1.750 6.500  7.750 x   10.2574 1.0429 7.0287 4.0215 


T (h). T
(g).
x  1.400 2.600 1.5333 3.1333 x   1.6923 1.3462 2.7308 6.3078
T
(i). (j). T

x   5.2500 1.5000 0.8334  x   0.6353 0.5882 1.8353


T T
(k). (l).
x   0.5424 0.3559 1.6610  x   0.9768 0.5698 0.3372 
T T
(m). (n).

2 (a) x   0.0759 0.7862 0.7977 T (b) x   0.5592 1.6645 2.0658


T

(c) x  1.1875 0.375 0.5313 (d)


T

x   4.6915 0.383 0.0638 1.9521


T

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.

3. Construct Lagrange interpolating polynomials for the following


functions.
f ( x)  sin(ln x), x0  2.0, x1  2.4 and x2  2.6.

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.

5. By using Lagrange interpolation, evaluate f(3) if f (0)  2, f (1)  1 and


f (4)  4 .

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?

7. The following table gives certain corresponding values of x and log10 x.


Using Lagrange interpolation, compute the following term, if possible.
(a) log10 (323.5) (b) log10 (353.5)

x 321.0 322.8 324.2 325.0


log10 x 2.507 2.509 2.511 2.512

8. x 0 1 8 27
f (x) 0 1 2 3

Compare the interpolated values at x  0.5, 3.5, and 18 with the


corresponding values of f ( x)  3 x .

9. For a function f , the divided-differences are given by

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

(a) Determine the missing entries in the table above.


(b) Determine the value of f (0.25) .
(c) Your friend, Simon claims that the above data can be used to
estimate f (0.85) . Are you agree with him? Justify your answer.

10. For a function f, the Newton’s interpolatory divided-difference formula


gives the interpolating polynomial
P3 ( x)  1  4x  4x( x  a)  163 x( x  a)(x  b)
on the nodes x0  0 , x1  0.25 , x 2  0.5 and x3  0.75 . Find value of a
and b. Hence, find f (0.75) .

11. Given f ( x)  e  x .
(a) Complete the following table.
x 0 0.25 0.75 1.0
f ( x)  e  x

(b) Hence, find P3 (0.4) by using Newton’s divided-difference


method.
(c) If (0.5, 0.607) is added into the data above, find f (0.4) by using
Newton’s divided-difference method.

12. Given the set of data, as follows.


x 1.0 1.3 1.6
f(x) 0.765 0.620 0.455
(a) Approximate f (1.4) using Lagrange interpolating polynomial.
(b) If f (1.9)  0.282 is added in the data above, approximate f (1.4)
using Newton’s divided-difference method.

13. Construct the polynomial of degree 3 that interpolates to the data at t 0  1


, y0  1, t 0  2 , y1  12 , t 2  4 , y 2  14 and t 3  3 , y3  13 .

14. Given the set of data, as follows.


98
x 1 2 3
f(x) 1.54 1.50 1.42
(a) Find the Newton’s interpolatory divided-difference polynomial.
(b) Estimate f (2.5) and f (2.5).


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.

16. Given the following data.


x -1 0 1 -2 2
f (x) 3 1 -1 -1 3

Show that both the Newton’s divided-difference polynomial below


interpolate the data.
P( x)  3  2( x  1)  ( x  1) x( x  1) and
Q( x)  1  4( x  2)  3( x  2)(x  1)  ( x  2)(x  1) x

17. Show that the following function is a spline function.


 x3  x 2  3x  1, 0  x 1
S ( x)   3
 x  5 x  3x  3, 1  x  2
2

18. Show that the following function is a spline function.


7 8
15 ( x  1)  15 ( x  1), x  [1, 0]
3

 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) .

22. A natural cubic spline S is defined by


 S 0 ( x)  1  B( x  1)  D( x  1) 3 if 1  x  2

S ( x)   3
S1 ( x)  A  B( x  2)  4 ( x  2)  D( x  2) if 2  x  3
2 3

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

Approximate acceleration, a(8.5) by using appropriate formulae.

2. The altitude of a helicopter at three different instants is listed as below:


t , sec 0.2 0.3 0.45
h, m 445.98 471.85 503.46

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

3. The current i of a circuit at time t is given in the table below:


t , 0 1 2.5 4 6 8 10 13
sec
i(t ) 0 - - 4.5647 - 3.7256 - 4.1341
4.7946 0.3316 4.9402 1.3119

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.

4. Given that f ( x)  ex . By taking h  10 k , where k  1, 2, find


approximate values of f (2.2) using
(a) (i) 2-point forward difference formula,
(ii) 2-point backward difference formula,
(iii) 3-point central difference formula,
(b) (i) 3-point forward difference formula,
(ii) 3-point backward difference formula,
(iii) 5-point difference formula.
Do all the computations in 6 decimal places.
101
5. Given that f ( x)  e x . By taking h  10k , where k  1, 2, find
approximate values of f (2.2) using
(a) 3-point central difference formula,
(b) 5-point difference formula.
Do all the computations in 6 decimal places.

6. Given the following set of discrete data:

x 0.2 0.3 0.4 0.5 0.6 0.7


y(x) 0.244 0.405 0.597 0.824 1.093 1.410

By taking h  0.1 , find approximate values of y(0.4) and y (0.4) using


all the appropriate formulas in Table 5.1.

7. Given the following set of discrete data:

x 1.3 1.4 1.5 1.6 1.7 1.8


y(x) 1.418 1.713 2.027 2.358 2.707 3.075

(a) By taking h  0.1, find approximate value of y (1.5) and y(1.5)


using all the appropriate formulas in Table 5.1.
(b) If h  0.2 is taken to find approximate value of y (1.5) and
y(1.5) , which formulas in Table 5.1 is not appropriate.

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

Given that velocity, v  x(t ). By taking h  2 minutes, estimate the


velocity at time t  5 minutes by appropriate difference formulas given in
Table 5.1.

9. The following table gives the velocity, v of an object at various points in


time, t.

Time, t (sec) 1.7 1.8 2.2 2.4


Velocity, v (m / sec) 10.2 11.0 13.2 14.7

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

(a) Trapezoidal rule with 9 subintervals.

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

4. The arc length of a curve y  f (x) on the interval a  x  b is given by


the integral

 
2

b
1 dy
dx dx.
a

Find the arc length of the curve described by the function


y  cos(x) , 1  x  1
using
(a) Trapezoidal rule with 8 subintervals.
1
(b) Simpson’s rule with 8 subintervals.
3
3
(c) Simpson’s rule with 9 intervals.
8


1
5. Find the approximate value for 1  9 x 4 dx , with h = 0.1 using
0

(a) trapezoidal rule, (b) Simpson’s 1/3 rule.


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

(a) the trapezoidal rule, with h = 0.2, 0.1,


104
(b) the 1/3 Simpson’s rule, with h = 0.2, 0.1.
1
[The exact answer, 
1
dx = 1.57079632679 ]
-1
x2 1
1
Find the approximate value for 
4
8. dx and n  10 , n  15
0.25
x
subintervals by using (a) trapezoidal rule, (b) 1/3 Simpson’s rule.
1
[The exact answer, 
4
dx = 3.00000000000 ]
0.25
x

Refer to integral in Q5-Q8, find the approximate value for those integrals by
Simpson’s 3/8 rule, respectively with

9. n  9 subintervals, 10. n  15 subintervals,


11. n  18 subintervals, 12. n  10 , n  15 subintervals.

13. The capacity of a battery is measured by  i dt , where i is the current.


Estimate, using suitable Simpson’s rule, the capacity of a battery whose
current was measured over an 8 hours with the results shown below.
Time, t (hour) 0 1 2 3 4 5 6 7 8
Current, i (A) 25.2 29.0 31.8 36.5 33.7 31.2 29.6 27.3 28.6


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

(a) Approximate the arc length of curve f ( x), as shown in figure


beside, in the interval [0, 1] by using the trapezoidal rule, with a
step size of h  0.1.

105
f (x)
3
2
f ( x)  e  x
1

-1.5 -1 -0.5 0.5 1 1.5 2 x

(b) Approximate the arc length of function f ( x)  sin x in the


interval [0,  / 4] by using the Simpson’s Rule. Divide the interval
into 10 subintervals.

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

According to Kirchoff’s second laws, the current I (in amperes) in the


circuit satisfies the equation
di
L  Ri  E (t ) .
dt
Given E(t )  120, L  3 henrys, R  15 ohms and i  0 when t  0
Solve the first-order differential equation for 0  t  0.05 with t  0.01.

106
If the exact solution is i  8(1  e5t ) , 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.

3 The rate of cooling of a body can be expressed as


dT
 k (T  Ta ) ,
dt
Where T is temperature of the body ( C ), Ta is temperature of the
surrounding medium ( C ), and k is proportionality constant . A man
was found dead from a stabbed wound early in the morning in his house.
Police who came to the scene recorded the body temperature of the
decease at 27 C , the temperature of the house is assumed to be uniform
at 24 C . Let initial temperature of the body be 37 C and k  0.154 .
Estimated how long he had been killed by using
with t  1 and interpolation technique. If the true time is t  9.522
hours, find the absolute errors for both methods.

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 )  10e0.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.

6. The falling parachutist satisfies the following differential equation:


dv c
 g v,
dt m
Where v is the velocity of the parachutist (m/s), t is time (s), g is gravity
accerelation (m/s2), c is drag coefficient (kg/s) and m is the mass of the
parachutist. Given g  9.81, m  80 and c  10 . Estimate the velocity of
the parachutist till time t  5 with t  1 and v0  0 . If the exact solution
t

is v  78.48(1  e ) , find the absolute errors.
8

7 The acceleration of an upward rocket is given by the following differential


equation:
dv uq
 g,
dt m0  qt
where m0 is initial mass of rocket at t  0 (kg ), q is rate at which fuel is
expelled (kg/s ) and u is velocity at which the fuel is being expelled (m/s ).
Given the initial mass of the rocket is 100,000 kg, the rocket expels fuel
at a velocity 1400m/s at a consumption rate of 1500 kg/s and g  9.81
(m/s2 ). Estimate the velocity of the rocket till time t  5 with t  1 and
 m0 
v0  0 . If the exact solution is v(t )  u ln    gt , find the absolute
 m0  qt 
errors.

8 A polluted lake has an initial concentration of a bacteria of 106 parts/m3 ,


while the acceptable level is only 5 105 parts/m3 . The concentration of
the bacteria will reduce as fresh water enters the lake. The differential
equation that governs the concentration C of the pollutant as a function of
time (in weeks) is given by

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 e0.05t , find the absolute
errors. When the lake can reach the acceptable level?

9 Solve y  y  0 , y(0)  3, y(1)  3 by using finite-difference method with


h  0.2.

Given the boundary value problem, y   e x , for 0  x  1 ,


2
10
with the boundary conditions, y(0)  0 and y(1)  0 .
(a) Derive the system of linear equations (in matrix-vector form) using
finite-difference method for this problem by taking h  x  0.25 .
(b) Estimate the values of y(x) at x = 0.25, 0.5, and 0.75 by Thomas
algorithm method (or calculator).

11. Given the boundary-value problem, y  12 x2 , for 1  x  2 , with the


boundary conditions, y(1)  2 and y(2)  17. .
(a) Derive the system of linear equations (in matrix-vector form) using
finite-difference method for this problem by taking h  x  0.2 .
(b) Estimate the values of y(x) at x = 1.2, 1.4, 1.6, and 1.8 by Thomas
algorithm.
1
12 Solve (sin x) y  (1  x 2 ) y  2 xy  , y(1)  1, y(2)  2 by using
1  x2
finite-difference method with h  0.25.

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

9. y1  1.8494, y2  0.6248, y3  0.6248, y4  1.8494 .


10.(a)   2 1 0  y1   0.067 
    
 1  2 1  y 2    0.080 
 0 1  2  y 3   0.110 

y (0.25)  0.118 ,
(b)
y (0.5)  0.170 ,
y (0.75)  0.140 (by calculator)

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(4x), 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.

8. Given the wave equation, utt  4uxx , 0  x  1, 0  t  0.05, with boundary


conditions, u(0, t )  u(1, t )  0, 0  t  0.05

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.

10. A piano string which is fixed at both ends is governed by


 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
 x, 0  x  0.6
 u
u ( x, 0)   3 ( x, 0)  0, 0  x  1.
  ( x  1), 0.6  x  1 t
 2
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.2 and k  t  0.1.

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

You might also like