Load vector 1D

Now let us compute the load vector for the one-dimensional case. The load vector is related to the integral of the product of the source function and the trial function. Consider the integral for a single segment with vertices xi,xi+1x_i, x_{i+1}

xixi+1f(x)υdx.\int_{x_i}^{x_{i+1}} f(x) \cdot \upsilon \,dx.
(6.34)

The trial function on the segment has the form υ(x)\upsilon(x) =qiϕi(x)= q_i \cdot \phi_i(x) +qi+1ϕi+1(x)+ q_{i+1} \cdot \phi_{i+1}(x). To evaluate the integral, it is necessary to interpolate the source function f(x)f(x) on the segment [xi,xi+1][x_i, x_{i+1}] by a linear function. Let us represent f(x)f(x) in the form f~(x)\widetilde{f}(x) =e1= e_1 +e2x+ e_2 \cdot x. The coefficients e1e_1 and e2e_2 are determined from the interpolation conditions at the nodes

e1\displaystyle e_1 +e2xi\displaystyle + e_2 \cdot x_i =fi\displaystyle = f_ie1\displaystyle e_1 +e2xi+1\displaystyle + e_2 \cdot x_{i+1} =fi+1\displaystyle = f_{i+1}
(6.35)

Solving this system analogously to (5.8), we obtain

e1\displaystyle e_1 =fixi+1fi+1xixi+1xi\displaystyle = \frac{\displaystyle f_i \cdot x_{i+1} - f_{i+1} \cdot x_i}{\displaystyle x_{i+1} - x_i}e2\displaystyle e_2 =fi+1fixi+1xi\displaystyle = \frac{\displaystyle f_{i+1} - f_i}{\displaystyle x_{i+1} - x_i}
(6.36)

Let us substitute the interpolated source function and the trial function into (6.34). Taking into account (5.7) and (5.8) from the section on hat functions

xixi+1f(x)υdx\displaystyle \int_{x_i}^{x_{i+1}} f(x) \cdot \upsilon \,dx =xixi+1(e1+e2x)[qi(ai+bix)+qi+1(ai+1+bi+1x)]dx.\displaystyle = \int_{x_i}^{x_{i+1}} (e_1 + e_2 \cdot x) \cdot \left[ q_i \cdot (a_i + b_i \cdot x) + q_{i+1} \cdot (a_{i+1} + b_{i+1} \cdot x) \right] \,dx.

Expand the brackets and split the integral into parts

xixi+1f(x)υdx\displaystyle \int_{x_i}^{x_{i+1}} f(x) \cdot \upsilon \,dx =xixi+1[e1(qiai+qi+1ai+1)+e1(qibi+qi+1bi+1)x+e2(qiai+qi+1ai+1)x+e2(qibi+qi+1bi+1)x2]dx\displaystyle = \int_{x_i}^{x_{i+1}} \Big[ e_1 \cdot (q_i \cdot a_i + q_{i+1} \cdot a_{i+1}) + e_1 \cdot (q_i \cdot b_i + q_{i+1} \cdot b_{i+1}) \cdot x + e_2 \cdot (q_i \cdot a_i + q_{i+1} \cdot a_{i+1}) \cdot x + e_2 \cdot (q_i \cdot b_i + q_{i+1} \cdot b_{i+1}) \cdot x^2 \Big] \,dx

Let us compute each of the integrals

xixi+1f(x)υdx\displaystyle \int_{x_i}^{x_{i+1}} f(x) \cdot \upsilon \,dx =e1(qiai+qi+1ai+1)xxixi+1\displaystyle = e_1 \cdot (q_i \cdot a_i + q_{i+1} \cdot a_{i+1}) \cdot x \bigg|_{x_i}^{x_{i+1}} +[e1(qibi+qi+1bi+1)+e2(qiai+qi+1ai+1)]x22xixi+1\displaystyle + \left[ e_1 \cdot (q_i \cdot b_i + q_{i+1} \cdot b_{i+1}) + e_2 \cdot (q_i \cdot a_i + q_{i+1} \cdot a_{i+1}) \right] \cdot \frac{\displaystyle x^2}{\displaystyle 2} \bigg|_{x_i}^{x_{i+1}} +e2(qibi+qi+1bi+1)x33xixi+1\displaystyle + e_2 \cdot (q_i \cdot b_i + q_{i+1} \cdot b_{i+1}) \cdot \frac{\displaystyle x^3}{\displaystyle 3} \bigg|_{x_i}^{x_{i+1}}

Substituting the expressions for e1,e2e_1, e_2 from (6.36) and using the relations (5.8), after simplification we obtain

xixi+1f(x)υdx\displaystyle \int_{x_i}^{x_{i+1}} f(x) \cdot \upsilon \,dx =(fi+fi+1)(xi+1xi)2(qiai+qi+1ai+1)\displaystyle = \frac{\displaystyle (f_i + f_{i+1}) \cdot (x_{i+1} - x_i)}{\displaystyle 2} \cdot (q_i \cdot a_i + q_{i+1} \cdot a_{i+1}) +xi+1xi6[fixi+fi+1xi+1+(fi+fi+1)(xi+xi+1)](qibi+qi+1bi+1)\displaystyle + \frac{\displaystyle x_{i+1} - x_i}{\displaystyle 6} \cdot \left[ f_i \cdot x_i + f_{i+1} \cdot x_{i+1} + (f_i + f_{i+1}) \cdot (x_i + x_{i+1}) \right] \cdot (q_i \cdot b_i + q_{i+1} \cdot b_{i+1})

Further transformations taking into account (5.8) lead to the final result

xixi+1f(x)υdx\displaystyle \int_{x_i}^{x_{i+1}} f(x) \cdot \upsilon \,dx =xi+1xi6[qi(2fi+fi+1)+qi+1(fi+2fi+1)].\displaystyle = \frac{\displaystyle x_{i+1} - x_i}{\displaystyle 6} \cdot \left[ q_i \cdot (2 \cdot f_i + f_{i+1}) + q_{i+1} \cdot (f_i + 2 \cdot f_{i+1}) \right].

Expand and regroup the terms

xixi+1f(x)υdx\displaystyle \int_{x_i}^{x_{i+1}} f(x) \cdot \upsilon \,dx =l(i)(i+1)[2fi+fi+16qi+fi+2fi+16qi+1],\displaystyle = l_{(i)(i+1)} \cdot \left[ \frac{\displaystyle 2 \cdot f_i + f_{i+1}}{\displaystyle 6} \cdot q_i + \frac{\displaystyle f_i + 2 \cdot f_{i+1}}{\displaystyle 6} \cdot q_{i+1} \right],

where l(i)(i+1)l_{(i)(i+1)} =xi+1= x_{i+1} xi- x_i is the length of the segment.

We introduce the notation for the elements of the local load vector of the segment

ri=l(i)(i+1)6(2fi+fi+1)ri+1=l(i)(i+1)6(fi+2fi+1)\begin{split} &r_i = \frac{\displaystyle l_{(i)(i+1)}}{\displaystyle 6} \cdot (2 \cdot f_i + f_{i+1})\\ &r_{i+1} = \frac{\displaystyle l_{(i)(i+1)}}{\displaystyle 6} \cdot (f_i + 2 \cdot f_{i+1}) \end{split}
(6.37)

Thus, the local load vector for a one-dimensional element has the form

R=[riri+1]=l(i)(i+1)6[2fi+fi+1fi+2fi+1].\begin{gathered}\mathbf{R} = \begin{bmatrix} r_i\\ r_{i+1} \end{bmatrix} = \frac{\displaystyle l_{(i)(i+1)}}{\displaystyle 6} \begin{bmatrix} 2 \cdot f_i + f_{i+1}\\ f_i + 2 \cdot f_{i+1} \end{bmatrix}.\end{gathered}
(6.38)

The global load vector R\mathbf{R} is obtained by summing the contributions from all segments of the mesh using assembly: the elements of the local vectors are added to the corresponding elements of the global vector according to the global numbering of the nodes. The dimension of the global load vector equals NN, where NN is the total number of nodes in the mesh. It is important to note that for interior nodes the contributions from two adjacent elements are summed, as a result of which the element of the global load vector for an interior node jj takes the form

Rj\displaystyle R_j =l(j1)(j)6(fj1+2fj)\displaystyle = \frac{\displaystyle l_{(j-1)(j)}}{\displaystyle 6} \cdot (f_{j-1} + 2 \cdot f_j) +l(j)(j+1)6(2fj+fj+1),\displaystyle + \frac{\displaystyle l_{(j)(j+1)}}{\displaystyle 6} \cdot (2 \cdot f_j + f_{j+1}),
(6.39)

where l(j1)(j)l_{(j-1)(j)} =xj= x_j xj1- x_{j-1} and l(j)(j+1)l_{(j)(j+1)} =xj+1= x_{j+1} xj- x_j are the lengths of the adjacent segments. For boundary nodes the element contributions are assembled in the same way, but the corresponding components of the system may be modified when boundary conditions are imposed.

For example, for a mesh with nodes 0,1,,i,i0, 1, \ldots, i, i +1,,N+1, \ldots, N the global load vector, assembled from the local contributions by rule (6.39) for interior nodes, takes the form (before boundary conditions are applied)

R\displaystyle \mathbf{R} =[l(0)(1)6(2f0+f1)l(0)(1)6(f0+2f1)+l(1)(2)6(2f1+f2)l(i1)(i)6(fi1+2fi)+l(i)(i+1)6(2fi+fi+1)l(i)(i+1)6(fi+2fi+1)+l(i+1)(i+2)6(2fi+1+fi+2)l(N1)(N)6(fN1+2fN)].\displaystyle = \begin{bmatrix} \frac{\displaystyle l_{(0)(1)}}{\displaystyle 6} \cdot (2 \cdot f_0 + f_1)\\ \frac{\displaystyle l_{(0)(1)}}{\displaystyle 6} \cdot (f_0 + 2 \cdot f_1) + \frac{\displaystyle l_{(1)(2)}}{\displaystyle 6} \cdot (2 \cdot f_1 + f_2)\\ \vdots\\ \frac{\displaystyle l_{(i-1)(i)}}{\displaystyle 6} \cdot (f_{i-1} + 2 \cdot f_i) + \frac{\displaystyle l_{(i)(i+1)}}{\displaystyle 6} \cdot (2 \cdot f_i + f_{i+1})\\ \frac{\displaystyle l_{(i)(i+1)}}{\displaystyle 6} \cdot (f_i + 2 \cdot f_{i+1}) + \frac{\displaystyle l_{(i+1)(i+2)}}{\displaystyle 6} \cdot (2 \cdot f_{i+1} + f_{i+2})\\ \vdots\\ \frac{\displaystyle l_{(N-1)(N)}}{\displaystyle 6} \cdot (f_{N-1} + 2 \cdot f_N) \end{bmatrix}.