# Questions tagged [finite-difference]

Referring to the discretization of derivatives by Finite differences, and its applications to numerical solutions of partial differential equations.

132 questions
110 views

### The numerical solution of a (very ugly) set of integro-diferential equations

I've been having fun playing around with a simple model for reaction in a co-flow fluidized bed (I'm afraid I'm a chemical engineer, not a computer scientist). Unfortunately, simple physical ...
147 views

### Is it generally unstable to use in multidimensional simulations finite difference schemes with higher orders than 2?

I'm part of a team trying to generalize a 1D Advection-Diffussion-Reaction code we inherited by extending it to 2D by using dimensional splitting, i.e. solving advection and diffusion for x and y ...
111 views

### How to choose a stable PML for pseudo-spectral method with strongly varying velocity

My friend was working on this, and he asked me about the stability of PML while applying on pseudo-spectral method, I believe his concern was how to choose the difference(if the difference should be ...
157 views

### A good 2D finite difference for the continuity equation

How could I go about solving the continuity equation below in 2D? $$\frac{\partial \rho}{\partial t} + \nabla \cdot \left(\rho u\right)=0$$ I saw that a similar question was posted here: A good ...
98 views

### How to account for the interface between two different phases in a discretized diffusion model?

I have tried to set up a model for the diffusion of a gas into a liquid. The two media are next to each other and the geometry is spherical because the system should simulate the diffusion out of a ...
126 views

1k views

### Python - calculation time derivative and laplacien by finite differences

I would like to determine a temporal derivative and a Laplacian by the finite differences method to solve the heat equation in a 1-dimensional case. My aim is to get the sources term that is why I ...
82 views

149 views

### matplotlib contourplot for $\log z$ in the Complex Plane $\mathbb{C}$

I tried using Python's matplotlib on the logarithm and here is what I got, a kind of starburst pattern. Since the angle jumps between $\theta = 0$ and $\theta = 2\pi$, contour assumes there is a ...
734 views

81 views

### Can I take advantage of a nearly banded A in AX=b?

I am working on a 1D drift-driffusion problem in a finite-difference (FD) approach. I hade 3 equations per node ($3N$ in total): electron continuity $E_i$, Poisson $P_i$, hole continuity $H_i$. With ...
50 views

### How to implement register blocking for 3D finite-difference stencil computations

I am in need to optimize the performance of the 3D solver that integrates a system of equations for seismic wave propagation. Unsurprisingly, the function that implements the finite-difference stencil ...
64 views

### 2d wave equation with finite differences blowing up

I am (naively) trying to solve the 2d wave equation with finite differences. But the system blows up instantly. For simplicity I set the constant $c=1$, then I am left with $$\Delta u =u_{tt}.$$ I ...
89 views

### Factorize laplacian in terms of first derivative matrix

I am trying to factorize the following Laplacian matrix in terms of $D^TD$, D is the first derivative matrix. The tridiagonal form of the secon derivative matrix using Neumann boundary condition is ...
30 views

### Numerical stability while modeling wave equation in staggered grid

I have modeled a simple wave equation given by: \begin{align} & \begin{cases} u_t = v_x \\ v_t = u_x \end{cases} \end{align} Boundary conditions given on interval $M=[-1,1]$ by: \begin{align} u(...
38 views

### Neumann boundary conditions in the Maccormack scheme

I am trying to solve the viscous Burger equation $$\frac{\partial u}{\partial t} + u\frac{\partial u}{\partial x} = \mu \frac{\partial^2 u}{\partial x^2}$$ with Neumann boundary conditions. I am ...
38 views

### Finite difference Neumann boundary conditions: uneven weighting of edge nodes?

Originally asked this on math.stackexchange, but I figure it's also appropriate here. I'm reading through some finite difference code for a diffusion equation and came across something odd for the ...
59 views

### Finite differenced eigenvalue prob. of inhomogeneous boundary conditions?

I am basically asking about eigenvalue problems of differential equations using some finite difference method (FDM). Usually the system is subject to some boundary conditions (BC), e.g., Dirichlet or ...
152 views

122 views

### Rank deficient Jacobian in discretized periodic solutions to autonomous ODE

I'm trying to numerically find periodic solutions to different systems of autonomous nonlinear ordinary differential equations. I decided to use a finite difference scheme and solve the resulting ...
212 views

### 1 D Diffusion equation FDM with different layers

I'm trying to solve this particular equation $\frac{\partial u}{\partial t} = \frac{\partial}{\partial x} \big[D_{i}(x)\frac{\partial u}{\partial x} \big] + S(x,t)$ where the $i$ index denotes ...
404 views

### What is the difference between SSPRK3 and RK3 time discretization methods?

Here, SSPRK3 refers to third order strong stability preserving Runge-Kutta and RK3 refres to regular third order Runge-Kutta method. The meaning of the method is obvious from the name. However there ...
62 views

### 2nd order differences for modelling a physically discrete phenomenon?

Consider the diffusion of some unknown $R$ on a physically discrete, 1-D ring: x---------x---------x---------x n = 0 1 2 3 We let ...
419 views

### 2D Neumann Conditions on Irregular Domain

I would like to model the 2D diffusion equation with Neumann BC's inside the following egg-shaped domain: I would like to use the finite difference method with the discretization implied by the image ...
396 views

### Solving the Helmholtz equation numerically

I am trying to solve the Helmholtz equation in some complex unbounded 2D domain: $$\left( \frac{\partial^2 \psi}{\partial x^2} + \frac{\partial^2 \psi}{\partial y^2} + E \right) u(x, y) = 0$$ ...
141 views

### Why does my Finite Difference approximation not work?

I am trying to find out the magnitude of the acceleration of my object based on non-uniformly sampled 3D position data. I'm using the standard approximation of the 2nd order derivative on a non-...
838 views

### How to solve singular non symmetric poisson equation with Neumann boundary condtions?

I am trying to solve 2D Poisson equations with Neumann boundary conditions. When the mesh is uniform, Poisson equation is singular and symmetric, so the method listed in Null Space Projection for ...
369 views

### finite volume for diffusion equation with anisotropic (tensor) coefficient

Consider the scalar PDE for $u$ with Dirichlet boundary conditions: $\mathrm{div}(\mathcal{K}\nabla u) = f\; \forall x\; \in \Omega \subset R^2$, $u = 0 \; \forall \; x\;\in \partial\Omega$ ...
I have hjb equation where $V=V(x,t)$ and $u=u(x,t)$ $V_t + \sup(u) [A(x,u)V_x + B(x,u)V_{xx}]=0$ for $x$ in $[0,1]$ and $t$ in $[0,1]$ I have been able to successfuly resolve it numerically having ...