Weak form
∫ u′v′ dx = ∫ f v dx for all v with v(0) = v(1) = 0
Multiply by v and integrate by parts.
The weak form of (or ) with on the boundary is for every test function in the finite-element space . Choosing and from piecewise linear "hat" functions gives a matrix system.
This page is easier if you are comfortable with:
Multiplying by and integrating by parts (integration by parts) moves one derivative onto , so only first derivatives appear; this is the setting of the Lax–Milgram theorem, which guarantees a solution. On with two elements of size the single interior hat function has , so for the load is and , , which equals the exact .
With four elements () the matrix is and the load is at each node, giving , again the exact values. For with two elements, the load is , so , equal to the exact at . In 1D the nodal values are exact; in higher dimensions they are approximate.
The matrix has the same structure as the one from the five-point stencil, and solves Poisson's equation; the weak form is the Euler–Lagrange form of an energy minimisation (the Euler–Lagrange equation).
The weak form turns a differential equation into integrals that can be solved with simple piecewise functions.
The finite-element nodal values equal the exact values here.
These examples are worked by hand, step by step, so you can compare your own working.
Solve , with two elements ().
With four elements find the middle value from .
Solve with two elements; the load at the node is 0.25.
A few situations come up again and again. Knowing them saves time and helps you spot answers that cannot be right.
∫ u′v′ dx = ∫ f v dx for all v with v(0) = v(1) = 0
Multiply by v and integrate by parts.
K_ii = 2/h = 8, K_i,i±1 = −1/h = −4
Hat functions.
F_i = h = 0.25
Integral of a hat.
u(0.25) = 0.09375, u(0.5) = 0.125
Exact at the nodes: x(1 − x)/2.
For −u″ = f with u(0) = u(1) = 0, the weak form is ∫₀¹ u′v′ dx = ∫₀¹ fv dx. With piecewise-linear hat functions on a uniform mesh of width h, the stiffness matrix has 2/h on the diagonal and −1/h off it, and the load is hf for f = 1.
Find K_ii and K_i,i+1 for h = 0.25.
Find F_i for f = 1 and h = 0.25.
Check row 1 with u = (0.09375, 0.125, 0.09375): 8u₁ − 4u₂.
Compare u(0.5) with the exact x(1 − x)/2.
K_ii = 2h ✗
K_ii = 2/h ✓
Derivative squared gives 1/h.
including v(0) and v(1) ✗
test functions vanish there ✓
Dirichlet conditions.
keeping u″ ✗
integrate by parts to u′v′ ✓
That reduces smoothness.
F_i = f ✗
F_i = hf ✓
Integral of the hat.
Try each one on paper, then open the answer. Use the solver above to see the full working.
4
-2
0.1
10
0.09375
0.25
Unlimited fresh questions with instant marking. Choose a level, work it out on paper, then type your answer.
Solve: …
The integral equation obtained by multiplying by a test function and integrating by parts.
K_ij = ∫ φᵢ′φⱼ′ dx.
2/h on the diagonal, −1/h off it.
hf = h at each node.
integration by parts.
five-point Laplacian stencil.
More in Numerical methods and optimisation and the formula sheets.