Finite Elements

  • Common choice for the bases are the hat functions from Chapter 5.
  • Hat functions only nonzero at two adjacent intervals
  • Integration is local
  • Second-order accuracy still maintained if coefficient functions replaced with interval endpoint average
  • spatially localized contributions to the matrices = finite element method

Demo 10.6.4

c = x -> x^2;
q = x -> 4;
f = x -> sin(pi*x);
x,u = FNC.fem(c,q,f,0,1,50);
plot(x,u,label="",
    xaxis=(L"x"),yaxis=(L"u"),title="Solution by finite elements")