<< Предыдущая стр. 52(из 67 стр.)ОГЛАВЛЕНИЕ Следующая >>
w( x) [ ( a0 + a1 x + В· В· В· + an xn ) в€’f ( x) ] dx = 0 for all w.
0
Now, suppose that w is also a polynomial of the order n:
w( x) = b0 + b1 x + В· В· В· + bn xn .
This may also be written in an alternative format:
w( x) = bT p ,
в€ј в€ј
257 Exercises

with
вЋЎ вЋ¤ вЋЎ вЋ¤
b0 1
вЋў вЋҐ вЋў вЋҐ
b1 x
вЋў вЋҐ вЋў вЋҐ
b=вЋў p=вЋў
вЋҐ, вЋҐ.
. .
вЋЈ вЋ¦ вЋЈ вЋ¦
в€ј . .
в€ј
. .
xn
bn

Likewise h( x) can be written as

h( x) = aT p ,
в€ј в€ј

with
вЋЎ вЋ¤
a0
вЋў вЋҐ
a1
вЋў вЋҐ
a=вЋў вЋҐ.
.
вЋЈ вЋ¦
в€ј .
.
an

Use of these expressions yields
1
w( x) [h( x) в€’f ( x) ] dx
0
1 1
= b pp a dx в€’ bT p f ( x) dx = 0.
T T
в€ј в€ј в€ј
в€јв€ј в€ј
0 0

Notice that both a and b are arrays with polynomial coefп¬Ѓcients indepen-
в€ј в€ј
dent of x, while p is an array with known functions of the coordinate x.
в€ј
Therefore, this equation may also be written as
1 1
pp dx a = b
T T T
b p f ( x) dx .
в€ј в€ј в€ј
в€јв€ј в€ј
0 0

The integral expression on the left-hand side is a matrix:
1
K= ppT dx,
в€јв€ј
0

while the integral on the right-hand side is a column:
1
f= p f ( x) dx.
в€ј в€ј
0

The equation must be satisп¬Ѓed for all b hence, with the use of the above
в€ј
matrix-array notation it follows that:

K a = f.
в€ј в€ј
Numerical solution of one-dimensional diffusion equation
258

(a) Suppose that w( x) and h( x) are both п¬Ѓrst-order polynomials.
вЂ“ Show that in that case
1
1 2
K= .
1 1
2 3
If f ( x) = 3, show that
вЂ“

3
f= .
3
в€ј
2

вЂ“ Compute the coefп¬Ѓcients of the polynomial h( x) collected in a.
в€ј
Explain the results. (Hint: it is recommended to use MATLAB
for this purpose.)
(b) If w( x) and h( x) are both polynomials of the order n, show that
вЋЎ вЋ¤
В· В· В· n+1
1 1
1 2
вЋў1 вЋҐ
вЋў2 В· В· В· n+2 вЋҐ
1 1
вЋў вЋҐ
3
K=вЋў . . вЋҐ.
. .
вЋў. .вЋҐ
. .
вЋЈ. .вЋ¦
. .
В· В· В· 2n+1
1 1 1
n+1 n+2
(c) Let f ( x) be such that
f ( x) = 1 for 0 в‰¤ x в‰¤ 0.5,
f ( x) = 0 for 0.5 < x в‰¤ 1.
вЂ“ Show that in this case
вЋЎ вЋ¤
1
2
вЋў вЋҐ
вЋў вЋҐ
1 12
1
2( 2)
p f ( x) dx = вЋў вЋҐ.
f= вЋў вЋҐ
.
.
в€ј в€ј
вЋЈ вЋ¦
.
0
1 1 n+1
n+1 ( 2 )
вЂ“ Use MATLAB to п¬Ѓnd the polynomial approximation h( x) of f ( x)
for n = 2, n = 3, etc. up to n = 10. Plot the original function
f ( x) as well as the polynomial approximation h( x). Hint: use the
function polyval. If the MATLAB array a represents a and n в€ј
denotes the order of the polynomial, then to plot the function h( x)
you may use
x=0:0.01:1; plot(x,polyval(a(n+1:-1:1),x))
Investigate the condition number of the matrix K with increasing
вЂ“
n. Hint: use the MATLAB function cond. What does this condi-
tion number mean and what does this imply with respect to the
coefп¬Ѓcients of h( x), collected in a?
в€ј
259 Exercises

14.2 Consider the differential equation
du d du
u+ + + f = 0,
c
dx dx dx
on the domain a в‰¤ x в‰¤ b.
Derive the weak form of this differential equation, and explain what steps
are taken.
14.3 Let f ( x) be a function on the domain 0 в‰¤ x в‰¤ 1. Let f ( x) be known at
n points, denoted by xi , homogeneously distributed on the above domain.
Hence the distance x between two subsequent points equals
1
x= .
nв€’1
A polynomial fh ( x) of order n в€’ 1 can be constructed through these points,
which generally will form an approximation of f ( x):

fh ( x) = a0 + a1 x + В· В· В· + anв€’1 xnв€’1 .

(a) Show that the coefп¬Ѓcients of ai can be found by solving
вЋЎ вЋ¤вЋЎ вЋ¤вЋЎ вЋ¤
nв€’1
1 x1 x1 В· В· В· x1
2 f1
a0
вЋў 1 x x2 В· В· В· xnв€’1 вЋҐ вЋў a вЋҐ вЋў f вЋҐ
вЋў вЋҐвЋў 1вЋҐ вЋў2 вЋҐ
2
вЋў nв€’1 вЋҐ вЋў вЋҐвЋў вЋҐ
2 2
вЋў 1 x3 x3 В· В· В· x3 вЋҐ вЋў a2 вЋҐ = вЋў f3 вЋҐ,
2
вЋў вЋҐвЋў вЋҐвЋў вЋҐ
вЋў. . . вЋҐвЋў . вЋҐ вЋў . вЋҐ
. . . вЋ¦вЋЈ . вЋ¦ вЋЈ .
.. . .
вЋЈ. . вЋ¦
. .
. . .
В·В·В·
2 nв€’1 anв€’1 fn
1 xn xn xn

where fi = f ( xi ).
(b) Use this to п¬Ѓnd a polynomial approximation for different values of n
to the function:

f ( x) = 1 for 0 в‰¤ x в‰¤ 0.5,
f ( x) = 0 for 0.5 < x в‰¤ 1.

Compare the results to those obtained using the weighted residuals
formulation in Exercise 14.1(c). Explain the differences.
14.4 Consider the domain в€’1 в‰¤ x в‰¤ 1. Assume that the function u is known
at x1 = в€’1, x2 = 0 and x3 = 1, say u1 , u2 and u3 respectively. The
polynomial approximation of u, denoted by uh is written as

uh = a0 + a1 x + a2 x2 .

(a) Determine the coefп¬Ѓcients a0 , a1 and a2 to be expressed as a function
of u1 , u2 and u3 .
Numerical solution of one-dimensional diffusion equation
260

(b) If the polynomial uh is written in terms of the shape functions Ni :
n
uh = Ni ( x) ui ,
i=1

then determine Ni , i = 1, 2, 3 as a function of x.
(c) Sketch the shape functions Ni .
(d) Is it possible that the shape function Ni = 1 at x = xi ? Explain.
(e) Is it possible that the shape function Ni = 0 at x = xj with j = i?
Explain.
14.5 Consider the differential equation
d du
=1
c
dx dx
on the domain 0 в‰¤ x в‰¤ h1 + h2 . At both ends of this domain u is set to
zero. Consider the element distribution as depicted in the п¬Ѓgure below.

u1 u3 u2

(a) Derive the weak formulation of this problem.
(b) The elements employed have linear shape functions stored in array
N ( x). Express these shape functions in terms of x and the element
в€ј
lengths h1 and h2 .
(c) Show that the coefп¬Ѓcient matrix of an element is given by
dN dN T
Ke = в€ј
c в€ј dx.
dx dx
e

(d) Demonstrate that the coefп¬Ѓcient matrix of element e is given by

в€’1
c 1
Ke = ,
в€’1 1
he

if c is a constant.
 << Предыдущая стр. 52(из 67 стр.)ОГЛАВЛЕНИЕ Следующая >>