Finite elements in one dimension
Most problems have complex domains.
Boundary conditions crucial.
Little “structure” to problem.
What use is “structure” in the grid?
Use unstructured grids.
Use Finite Elements.
Use shape or indicator functions
\[ N_A(x) = \begin{cases} 1 & x = x_A \\ 0 & x = x_j, \quad j \ne A \end{cases} \]
as basis,
\[ \phi = \sum_A c_A(t) N_A(x) \, . \]
Many possibilities; linear case shown.
Focus on time independent case
\[ 0 = \partial_{xx} \psi + S \quad \psi(0) = 0 \quad \partial_x \psi_{x=1} = 0 \, . \]
Switch to weak form: multiply by smooth \(w(x)\), integrate:
\[ \begin{split} 0 = \left[ w(x) \partial_x \psi(x) \right]_0^1 - \int_0^1 \partial_x \psi(x) \partial_x w(x) \, \text{d}x + \\ \int_0^1 w(x) S(x) \, \text{d}x. \end{split} \]
Use basis functions for \(w, \psi, S\): linear system!
Use the basis functions: \[ \begin{aligned} && 0 & = - \int_0^1 \partial_x \psi(x) \partial_x w(x) \, \text{d}x + \int_0^1 w(x) S(x) \, \text{d}x \\ \to && & -\sum_{A, B} \psi_A w_B \int_0^1 \partial_x N_A(x) \partial_x N_B(x) + \sum_{B} w_B \int_0^1 N_B(x) S(x) \, . \end{aligned} \]
The weight function is arbitrary: \[ \begin{aligned} 0 &= \sum_B w_B \left\{ K_{AB} \psi_A - F_B \right\} \, , \\ K_{AB} &= \int_0^1 \partial_x N_A(x) \partial_x N_B(x) \, , & F_B &= \int_0^1 N_B(x) S(x) \, . \end{aligned} \]
\(K\) mass or stiffness matrix, \(F\) force vector.
\[ \begin{aligned} N_A(x) & = \begin{cases} (x - x_{A-1}) / \Delta x & x_{A-1} \le x \le x_A \\ (x_{A+1} - x) / \Delta x & x_{A} \le x \le x_{A+1} \\ 0 & \text{otherwise} \end{cases} \\ \partial_x N_A(x) &= \begin{cases} 1 / \Delta x & x_{A-1} \le x \le x_A \\ -1 / \Delta x & x_{A} \le x \le x_{A+1} \\ 0 & \text{otherwise} \end{cases} \\ K_{AB} &= \int_0^1 \partial_x N_A(x) \partial_x N_B(x) \\ & \sim \frac{1}{\Delta x} \begin{pmatrix} 2 & -1 & 0 \\ -1 & 2 & -1 \\ 0 & -1 & 1 \end{pmatrix} \end{aligned} \]
Source \(S = 2\).
Exact solution \(\psi = 2x - x^2\).
Force vector \(F_B = \Delta x \, (2, 2, \dots, 1)^T\).