User:Yongtao-Li/HW5.4

=Problem 5.4 Using LIBF with equidistant nodes to solve G1DM1.0/D1=

GIVEN
One dimensional Model 1.0/Data set 1.0 on page 2 of Mtg 9:

where $${a_2}\left( x \right){\text{ =  2 + 3x}}$$,$$f\left( {x,t} \right) = 5x $$

1-D LIBF on page 3 of Mtg 26:

FIND
A) Explain how LIBF are used as CBS

B) Plot all LIBF used

C) Use matlab to integrate and solve the weak form

D) Plot $$ u_m^h\ vs\ u$$ and $$ u_m^h\left(0.5 \right)-u\left(0.5 \right)\ vs\ m$$

SOLUTION
A) Take m=4 for example to explain how LIBF works as CBS.

When m=4, we can write the basis function according to Eq. 5.4.4 (N was denoted as basis function from now on):

According to Eq.5.4.2, we should have CBS when x=1, which means that the last basis function should not equal zero when x=1.

At the same time, when x=1, we have the following values for LIBF based on its own properties:

Since we have the weight function as $$ w\left( x \right) = {c_i}N\left( x \right) $$ and from Eq. 5.4.9 we can choose arbitrary value for c from i=1~3 and make c equal zero for the last term, which absolutely satisfy CBS for which have non-zero value at the essential boundary for the last basis function and equal zero for all the others.

B)-D)Integrate Eq. 5.4.1 by parts over the whole domain, we can have

$$ \left[ {w(x)\left( {(2+3x)\frac} \right)} \right]_{}^{x = 1} - \left[ {w(x)\left( {(2+3x)\frac} \right)} \right]_{x = 0}^{} - \int\limits_0^1 {\frac\left( {(2+3x)\frac} \right)} dx + \int\limits_0^1 {w(x).(2+3x)} dx = 0 $$

Since LIBF satisfies CBS, we have w=0 when x=1, and then the above equation can give us the weak form:

If we use LIBF both as trial solution and weight function, the following matlab codes can solve the weak form for m nodes







The above three images show that whatever the value m equals, LIBF show its property which can be used as CBS, since its values vanish all other nodes except just one node where the natural boundary condition happens.



It is not easy to find out the difference from the approximation solution and exact solution, but the gaps do exist since the error is non-zero.



We can find out when the solution convergence and what is the error at x=0.5. The error is so small which indicates that LIBF, as a global basis function, has advantages solving weak form and obviously can satisfy CBS wherever essential boundary happens.