
I am going to solve
$$-u''=-1-10\delta (x-0.2)$$
$$u(0)=u(1)=0$$
by finite element method in 1D.
The exact solution that I got is
$$u(x) = \left\{ {\begin{array}{*{20}{c}}
{\frac{{{x^2}}}{2} - \frac{{17}}{2}x~~~~~~~~~~if~~~x \in [0,0.2]} \\
{\frac{{{x^2}}}{2} + \frac{3}{2}x - 2~~~~~if ~~~~x \in [0.2,1]} \\
\end{array}} \right.$$
and I put $f(x)=-1-10*dirac(x-0.2)$ in my matlab code.
The problem is the solution of the finite element problem is exactly the same as of the solution of equation $-u''=-1$.
2026-03-25 22:23:51.1774477431
solution of poisson problem with finite element method in 1D
1k Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
1
The simplest way to implement Dirac loading for linear elements is to simply put a node at $x=0.2$ and add $-10$ to your load vector at the respective slot.
Here is an example code using Python, NumPy and spfem, see last 8 lines or so. You can easily do the same thing in Matlab.
The solution looks like this:
The rationale for this is the following. The load vector corresponds to the linear form
$$-\int_0^1 v \,dx - \int_0^1 10 \delta(x-0.2) v \,dx = -\int_0^1 v\,dx - 10 v(0.2).$$
If you put $i$'th node at $x=0.2$ then the $i$'th element of the load vector is
$$f_i = -\int_0^1 \phi_i \,dx - 10.$$
Thus, the contribution from the Dirac loading is just $-10$.