30 votes
Accepted

What is the general idea of Nitsche's method in numerical analysis?

Nitsche's method is related to discontinuous Galerkin methods (indeed, as Wolfgang points out, it is a precursor to these methods), and can be derived in a similar fashion. Let's consider the simplest ...
user avatar
12 votes
Accepted

How to efficiently implement Dirichlet boundary conditions in global sparse finite element stiffnes matrices

In deal.II (http://www.dealii.org -- disclaimer: I'm one of the principal authors of that library), we do eliminate whole rows and columns, and it is not too expensive overall. The trick is to use the ...
user avatar
11 votes

Periodic boundary condition for the heat equation in ]0,1[

The best way to do this is (as you said) to just use the definition of periodic boundary conditions and set up your equations correctly from the start using the fact that $u(0)=u(1)$. In fact, even ...
user avatar
10 votes
Accepted

How do I simulate an open end?

The problem you describe, how to prescribe non-reflecting or absorbing boundary conditions when solving partial differential equations (PDE) has been extensively studied. For complex (e.g. nonlinear) ...
user avatar
  • 5,744
10 votes

How to solve a second order differential equation (diffusion) with boundary conditions using Python

I have found that I must keep the value of dt near dx or the results become unstable This behavior you have noticed is known as the Courant–Friedrichs–Lewy (CFL) condition. Indeed, there are ...
user avatar
9 votes
Accepted

FEM: Possible to have boundary conditions "inside" the domain?

The solution of the equation you are looking for is in the space $H^1$ of functions that have one weak derivative, but in 2d and 3d, this does not imply that the solution is in fact continuous. As a ...
user avatar
8 votes
Accepted

Transparent boundary conditions for finite element simulation of TDSE

Kirill's answer is a good method but it is hampered that the fact that you need to tune it to a specific range in energy, so it is not appropriate if you have a broad-band wavepacket you need to ...
user avatar
8 votes
Accepted

Symmetric boundary condition

For the sake of simplicity let me slightly change your notation. Let $u, v, w$ be the components in the $x, y, z$ directions of a true (polar) vector, and $y=0$ the symmetry plane. For a true vector, ...
user avatar
  • 3,789
8 votes
Accepted

Solving Poisson equation with current BC using FEM

It is standard procedure for general case like that. You can enforce condition for electrode by Lagrange multipliers, $$ L(u,\lambda) = \int_\Omega \sigma u_{,i} u_{,i} \, \textrm{d}V - \int_{\...
user avatar
  • 906
7 votes
Accepted

Do the class of PDEs that lack initial conditions have a name?

Such problems (sometimes called lateral Cauchy problems) are in general not well-posed (meaning they either lack a solution, or there are infinitely many of them, or the solution is unstable under ...
user avatar
7 votes

How can an engineering student become a computational scinece expert in a short time

There is no shortcut. Just like there is no shortcut to becoming an "engineering expert in a short time". The thing is that to be an expert in civil engineering, you need to understand load analysis, ...
user avatar
6 votes
Accepted

Advice on numerical solution for 2D hyperbolic PDE with zero flux boundary conditions

Let me give a part of your answer, I would need some more indications from your side to answer you fully. So please read, and write some comments so that I can complete my answer. About notations in ...
user avatar
6 votes

Role of boundary conditions (e.g. periodic) in Poisson equation

I know its been 2 years.. but here is an example from physics to hammer it home. Consider you are solving the Poisson equation: $$\nabla^2\phi =f$$for electrostatic potentials(ϕ) with the right hand ...
user avatar
6 votes
Accepted

Jump condition for elliptic equation in standard finite element method

Preliminary remarks: The natural jump condition is on the normal derivative, not on the full gradient. The fact that the solution is continuous across the interface is part of the formulation of the ...
user avatar
  • 1,246
6 votes
Accepted

How to impose an integral conservation in solving ODEs boundary value problems (BVP)?

You could augment your system of ODEs to include one more equation. If you let \begin{align} I(x) = \int_{a}^{x}(A(s) + B(s) + C(s))\,\mathrm{d}s, \end{align} then $I(a) = 0$, $I(b) = N$, $\dot{I}(x)...
user avatar
6 votes

Do I need to impose boundary conditions in the Jacobian matrix?

There are multiple ways of implementing Dirichlet boundary conditions when using the finite element method. For each unknown $i$ of the system belonging to the Dirichlet boundary, you can zero out ...
user avatar
6 votes
Accepted

Is "tangent stiffness matrix" the same as "stiffness matrix"?

$K u$ equals the internal forces only in the linear case. The tangent stiffness matrix, $K$, in a nonlinear problem is normally used in a Newton-Raphson algorithm to calculate updates to the ...
user avatar
  • 5,744
6 votes

Solving a linear equation system with pure Neumann condition

Pure Neumann problem is unique up to a constant. My two favourite solution strategies: Modifying the equation $-\Delta u = f$ to $-\Delta u + \varepsilon u = f$ for some small $\varepsilon>0$. If ...
user avatar
  • 1,877
6 votes

Scipy OdeInt solver with Neumann boundary conditions

From Ablowitz and Zeppetella we know that the analytical solution reads: \begin{equation} u(x,t)=\frac{1}{1+e^{{(-\frac{5}{6} t+ \frac{\sqrt{6}x}{6}})^2}} \end{equation} Usually, analytical ...
user avatar
6 votes

Absorbing boundary conditions for acoustics in Discontinuous Galerkin

The problem with ABC in the form of derivative operators at the boundary is that the exact ABCs are non-local in space and often in time, which makes them hard to use in numerical simulations. You can ...
user avatar
  • 1,198
6 votes

How do I program periodic boundary conditions?

Typically, you would add "guard cells", that is (for u) u(-1) and u(n+1) with your notation. Before each integration step: u(n+1) = u(0) u(-1) = u(n) and ...
user avatar
6 votes

Computing accurate fluxes with FEM

If $\nabla u$ is of more interest than $u$ itself, it is reasonable to set $\mathbb v := -\sigma \, \nabla u$ and convert your Poisson problem $$ -\nabla \cdot (\sigma \, \nabla u) = f \quad \text{in }...
user avatar
  • 861
6 votes
Accepted

How to apply non zero Dirichlet boundary condition in finite elements?

Consider the fact that your linear system can be broken up into two parts: the equations that correspond to the known Dirichlet dofs, and the equations that correspond to the unknown dofs. For the ...
user avatar
  • 1,522
6 votes
Accepted

FEM current toy problem

The formulation of this problem is tricky. Here is what you have in your original post: Find $h \in L^2(\partial D)$ such that for any $w \in H^{\frac 1 2}(\partial D)$, $$ \int_{\partial D} hw \,...
user avatar
6 votes
Accepted

Traction -> stress; stress->displacement gradient

In short, no. Neumann boundary conditions should be specified in terms of traction. This is clear when you move from a strong-form statement of the boundary value problem to a weak-form. Strong form: ...
user avatar
  • 1,522
5 votes

Transparent boundary conditions for finite element simulation of TDSE

In the literature these boundary conditions go by the name of absorbing boundary conditions (or nonreflecting, open, radiation, invisible, far-field), and this is a well-known topic. One clear ...
user avatar
  • 11.4k
5 votes

GMRES: Making the matrix square without solving for boundaries

It seems that you are referring to the fluxes that occur at the edge of your domain. Since these are typically known quantities enforced by your boundary conditions, there is no need to solve for ...
user avatar
5 votes
Accepted

What are acceptable boundary conditions for porous media flow?

The velocity $\mathbf u$ is in $H^1$, so imposing all or some components of the velocity as boundary conditions is allowed. This includes no-slip or tangential flow boundary conditions. However, from ...
user avatar
5 votes
Accepted

Boundary condition for Pressure in Navier-Stokes equation

When we say that the pressure is only defined "up to a constant", what we mean is this: If $u,p$ is a solution to the Navier-Stokes equations, then $u,p+c$ for any constant $c$ is also a solution. In ...
user avatar
5 votes
Accepted

Is the diffusion equation with Neumann and Dirichlet BCs well-posed?

Yes, the problem with mixed boundary conditions is well posed. What's not clear to me is this: Why do you approximate the derivative via the two-sides approximation? Shouldn't it be enough to just ...
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible