1

Consider the problem $-u''=f$, $u(a)=A$, $u(b)=B$. Everywhere, FEM seems to be introduced by using the case $(a,b,A,B) = (0,1,0,0)$, in which case the term $u'(a)v(a)-u'(b)v(b)$ resulting from integration by parts vanishes. If we divide $[a,b]$ into $a=x_0 < ... < x_n = b$, we'll end up solving an $(n-1)\times (n-1)$ system, fine and dandy.

How do you solve the above problem without convenient boundary conditions? I have tried searching and the few results I find are for higher dimensions, or I simply don't understand the answers. I have looked up several books on the matter and I can't find an answer.

Naively I would form a stiffness matrix $K=(K_{ij})_{i,j=0}^n$ and the load vector $b$ per the "usual" way, then add... something, somehow. In a case with BCs $au'(0) = \kappa_0(u(0)-g_0)$, $-au'(L) = \kappa_L(u(L)-g_L)$ the solution was to add $\kappa_0$ to $K_{00}$, $\kappa_L$ to $K_{nn}$, $\kappa_0 g_0$ to $b_0$ and $\kappa_L g_L$ to $b_n$. I don't know if that's at all applicable (I don't have any information about first derivatives) but those are the only special cases I see covered. On the other hand, $(n+1)\times (n+1)$ doesn't sound right since we know the values at the boundary and so we shouldn't want degrees of freedom there...

I really need help with this, I'd appreciate any advice, thanks.

  • This has been asked in various forms on this site before. This one might be helpful: http://scicomp.stackexchange.com/questions/11531/fem-which-is-the-correct-way-to-impose-dirichlet-b-c?rq=1 – Tyler Olsen Nov 14 '16 at 12:26
  • Thanks. That link references another answer that I looked at but I don't understand it at all, the formulations are completely different from what I've seen. In particular I find no answers that explain the size of the matrix. Why is FEM explained using a particular, neat example, rather than providing an algorithm for the most general case, or most general feasible case? (rhetorical) – Erik Vesterlund Nov 14 '16 at 13:44
  • 2
    Can't help you with the rhetorical except to say that the basic FEM is very well-suited to solve the heat equation, so it's often used as a starting point before teaching more general methods. For understanding boundary conditions, I recommend video lectures by Professor Wolfgang Bangerth. He is the creator/maintainer of the deal.II library, and he knows a thing or two about FEM: http://www.math.colostate.edu/~bangerth/videos.html – Tyler Olsen Nov 14 '16 at 13:58
  • Have you written a FEM system of equations by hand? That way you might understand a little bit more. And there you can apply the boundary conditions that you want... then come back to the programming. – nicoguaro Nov 14 '16 at 17:23
  • @TylerOlsen those videos were great, thanks! nicoguaro: Yes, I have written FEM by hand about a million times now, I haven't done one bit of programming. – Erik Vesterlund Nov 14 '16 at 18:16

0 Answers0