Share Your Experience: Take the 2024 Developer Survey

Tag Info

Is using iterative methods to solve a linear system always superior to inversing the matrix?

First off, there are basically no scenarios where one would ever actually compute and store $A^{-1}$ in memory, even for small problems. An LU factorization offers both superior efficiency and ...
• 2,548
Accepted

Can this finite difference dispersion be eliminated somehow?

It isn't the spike that's causing the dispersion. The scheme you use has a dispersion relationship whereby waves of different frequency travel at different speeds. Every numerical scheme has such a ...
• 55.7k

Stability of Euler forward method

The solution of $\frac{du}{dt} = Au$ is $u(t) = \exp(tA)u(0)$, and explicit Euler approximates $\exp(tA)$ using $\lim_{n\to\infty} \left(I+\frac{t}{n}A\right)^n$. Of course in practice you cannot ...
• 2,162
Accepted

Burger's equation (PDE) does not work with downwind difference?

The qualitative difference between upwind and downwind flux (note that both are first order accurate for twice continuously differentiable solutions) lies in the fact that the upwind flux (in the ...
• 1,083

Finite difference problem

Since this is apparently a homework problem, let's just illustrate the idea on a simple small example. Let's take the domain [0,1], with the discontinuity at $x=0.5$, and assume $\alpha$=1 to the left ...
• 2,545

Factorize laplacian in terms of first derivative matrix

It is sufficient if you consider a $D$ that uses forward or backward differences with reflecting boundaries: D_f = \frac{1}{h}\begin{bmatrix} -1 & 1 & & \\ & \ddots &...
• 2,162
Accepted

Generalized eigenvalue problem for large, potentially ill-conditioned systems

For large systems, any direct solver methods tend to be a dead end as what often starts as a sparse system ends up becoming dense. In fact, just storing all eigenvectors is itself typically impossibly ...
• 1,008
Accepted

Automatic Differentiation In the Presence of Jump Points

Finite differences, when applied to a function from $\mathbb{R}$ to $\mathbb{R}$ with a discontinuity, will do a better job of capturing the nature of the derivative, which is no longer a function but ...
• 56
Accepted

Accepted

Modeling contamination diffusion in a draining container

If you are negleting the fact the the level of the flow gets lower as the bottle drains, then you are implicitly assuming that new water comes into the domain at speed $v$. Since the analyte inflows ...
• 419
Accepted

Modeling contamination diffusion in a draining container, part 2

The condition you need for the top boundary is a Neumann condition, because the contaminant is entering into the domain at a prescribed rate. The condition is obtained be equating the diffusive flow ...
• 419

Automatic Differentiation In the Presence of Jump Points

What you call Automatic Differentiation is apparently a method for evaluating the derivative (gradient) of Ef(x), where E is mathematical expectation, by intechanging the order of differentiation and ...
• 2,232
Accepted

How to address the element face adjacent to boundaries when the finite difference method and marker-and-cell scheme are used to solve the Stokes flow?

The paper is not specifying a Dirichlet $v=0$ at $y=1$, but $u=u_D$ at $y=1$. This could be used as a wall slip condition: for $u_D=0$, you have a no slip boundary wall; that is, the flow tangential ...
• 2,794