12 votes
Accepted

Motivation behind Collocation Method

I would not insist on demanding a geometrical meaning from Galerkin methods in general. There is a connection, but it becomes less meaningful as you extend it further and further. (In a sense, it ...
Christian Clason's user avatar
7 votes
Accepted

Don't we care about the numerical diffusion in the diffusion term?

We have the following problem: $$\frac{\partial u}{\partial t}+v\color{red}{\frac{\partial u}{\partial x}}-\nu\color{blue}{\frac{\partial^2u}{\partial x^2}}=0 \tag{*}$$ The function $u$ may represent ...
HBR's user avatar
  • 1,628
7 votes
Accepted

How do I integrate a function defined over an arbitrary area?

Instead of directly integrating over the area, it is often more convenient to use the divergence theorem to replace the area integral with an integral over the boundary edges. The divergence theorem ...
Bill Greene's user avatar
  • 5,954
7 votes

Why do we have to resort to Higher order schemes for solving the 1-D advection equation/ continuity equation?

There is a difference between the requirements for a hyperbolic pde like $$ u_t + a u_x = 0 $$ and for a purely parabolic pde like $$ u_t = u_{xx} $$ Suppose the solutions are smooth and you ...
cfdlab's user avatar
  • 2,993
6 votes

What is numerical damping in the context of time-dependent FEM solvers?

It is quite straightforward to demonstrate this for implicit Euler (aka backward Euler) on a scalar example. Consider the initial value problem $$\dot{y}(t) = i \alpha y(t), \ y(0) = 1$$ with solution ...
Daniel's user avatar
  • 1,238
6 votes

How to separate text from the paper on a black and white page?

I believe the best approach here is to use a threshold based on the local average brightness of the image. Setting the threshold to be 90% of the mean value of the 11x11 grid surrounding each pixel ...
Doug Lipinski's user avatar
5 votes
Accepted

Finite difference recursion and higher order

Short answer: yes (in exact arithmetic). You'll have to use the centered difference formula evaluated at $x \pm \frac{1}{2}\delta x$, like this: $$ u_x = \frac{u(x + \frac{1}{2}\delta x) - u(x - \...
GoHokies's user avatar
  • 2,166
5 votes

what is the difference between non-conformal and conformal?

The concept of $p$-nonconforming meshes can also apply to continuous FEM, not just DG. For continuous FEM, continuity is enforced by enforcing a single set of degrees of freedom on a face shared ...
Jesse Chan's user avatar
  • 3,102
5 votes

Are FEM or DGFEM methods based on integrals or PDEs?

Basically, you have the following set of derivations: Strong form of the PDE -> Finite differences Integral form of the PDE -> Finite volumes Weak (variational) form of the PDE -> Galerkin methods (...
Wolfgang Bangerth's user avatar
5 votes
Accepted

Building minimization optimization problem for 2nd-order elliptic PDE

For the particular equation you are solving (called the minimal surface equation), the functional you are trying to minimize is $$ J(u) = \int_\Omega \sqrt{1 + |\nabla u|^2} \; dx. $$ You can find ...
Wolfgang Bangerth's user avatar
5 votes
Accepted

Residual norm of PDE discretization: correspondence in the continuous problem?

TLDR If you're using scalar products in FEM/FVM discretizations, use the mass-matrix scalar product, not $\ell_2.$ or If you're solving FEM/FVM systems with Krylov methods, precondition with the ...
Nico Schlömer's user avatar
5 votes
Accepted

Discretization with non-constant matrix containg entries form unknown vector

You can't. Nonlinear systems of equations are in general not solvable exactly. What you need to do is to use a method to solve nonlinear systems, of which there are of course quite a lot: A simple ...
Wolfgang Bangerth's user avatar
5 votes
Accepted

Projection method FVM poisson part, adding source term

The smooth solution turned out to have BC's applied in the following way: Walls and inlet: $\frac{\partial p}{\partial n}=0$ Outlet: $p=0$ Actually thought that we need only one value of P to pin, not ...
2Napasa's user avatar
  • 364
5 votes
Accepted

Time discretisation after splitting a 4th order equation

The introduction of $w$ is just a reformulation of your initial problem. If you use (2), this means that you make the 4th-order diffusion term explicit, which may potentially lead to stability issues. ...
Laurent90's user avatar
  • 1,764
4 votes

Finite difference discretization on a circle

The expressions you are using for eigenvalues and eigenfunctions are wrong (as per Wolfgang Bangerth's comment); therefore the results you are getting are not meaningful at all. There are analytic ...
Anton Menshov's user avatar
  • 8,592
4 votes
Accepted

Why have specialised upwind schemes been developed to solve hyperbolic equations?

To elaborate on Wolfgang's answer: since hyperbolic PDE semi-discretizations with centered differences have purely imaginary eigenvalues, they are only neutrally stable. For linear problems (e.g., ...
David Ketcheson's user avatar
4 votes

Why have specialised upwind schemes been developed to solve hyperbolic equations?

Central differencing schemes are not stable if you have advection dominated problems. There really was no other trivial [1] alternative to developing upwind schemes. [1] There are a few other ...
Wolfgang Bangerth's user avatar
4 votes

Is there Von Neumann stability analysis for 9-point laplacian like we have for the 5-point Laplacian?

There are actually a few different 9 point stencils in use, but they can all be written as a linear combination of the standard and skewed 5 point stencils. Performing the usual von Neumann analysis ...
origimbo's user avatar
  • 2,229
4 votes
Accepted

Flux sign and face normal confusion in finite volume method

When dealing with conservation laws like your case, you can often make use of the divergence theorem (as you did). You can then express the fact that the total mass within your integration region is ...
MPIchael's user avatar
  • 2,621
4 votes
Accepted

Dividing a continuous domain into small squares; how to perform storage and querying?

After doing some quick research, I am convinced that the interviewer was looking for an answer related to one of the data trees. Depending on the application, one might be better than the others, but ...
Abdullah Ali Sivas's user avatar
4 votes
Accepted

Can I use Q0 finite elements when there are gradients involved?

Depends on the details. If you think about the traditional $H^1$ conforming formulation with the bilinear form $(\nabla \phi, \nabla v)$ it obviously cannot work because the stiffness matrix would be ...
knl's user avatar
  • 2,041
3 votes
Accepted

Stability in discretization of a PDE

Analogous equations are considered in different applications e.g. stationary advection equation with right hand side. Looking to your equation through this view, you should try one-sided finite ...
Peter Frolkovič's user avatar
3 votes
Accepted

PDE - Conservative form, conservative methods and discrete conservation

I know this topic well for some class of PDEs, so I try to give you a general answer with one example from applications I am familiar with. 1.) Conservative form of PDE - this notion is used when ...
Peter Frolkovič's user avatar
3 votes
Accepted

upwind schemes for solving inviscid euler equations

Do I definitely need to know the eigenvectors/eigenvalues of the system if I need to use an upwind scheme for such flow? No, it is certainly not necessary to use the full eigenstructure of the system,...
David Ketcheson's user avatar
3 votes

Combining trapezoidal rule with upwind scheme

I would recommend to try a second order accurate upwind scheme. There are many of them. Let me show two of them, I use them for solving nonstationary advection equation when the solution is ...
Peter Frolkovič's user avatar
3 votes

Three steps of pde numerical solution and nonlinear equation

Linearization and discretization can be switched. The linearization then happens in function space, where a Newton method can be employed based on the Fréchet derivative of the differential operator. ...
cos_theta's user avatar
  • 401
3 votes
Accepted

Discontinuous Galerkin FEM : Control points are mid-points of edges instead of nodes

For the discontinuous Galerkin method, the choice of control points is entirely unimportant because they conceptually lie in the interior of the cell (even if they are physically on the boundary of ...
Wolfgang Bangerth's user avatar
3 votes
Accepted

Problems with deriving an equation for a finite-difference scheme given in the journal paper

Initially, the equation (6) is derived from equation (4): $$ F_e\Phi_e-F_w\Phi_w=D_e(\Phi_E-\Phi_P)-D_w(\Phi_P-\Phi_W) $$ under the central differencing approximation $\Phi_e=(\Phi_P+\Phi_E)/2$, $\...
Anton Menshov's user avatar
  • 8,592
3 votes

Discretization Error amplification instead of stagnation to machine precision

Yes. This behavior is to be expected and normal. When you are computing with a small value for $\mathrm dx$ then, to compute the difference quotient, you are subtracting two numbers that are nearly ...
H. Rittich's user avatar
3 votes
Accepted

Discretisation of logarithmic derivative: Deriving the formula

This should be coming from a chain rule (assuming $M$ is a function of $t$, $t_A<t_B$): $$ f(t)=\frac{d \log\big(M(t)\big)}{d \log t} = \frac{d\log\big(M(t)\big)}{dt}t=\frac{dM(t)}{dt}\frac{t}{M(t)...
Anton Menshov's user avatar
  • 8,592

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