# Questions tagged [finite-difference]

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

744 questions
Filter by
Sorted by
Tagged with
131 views

### Why $\alpha I +A$ can improve the condition nubmer of a SPD matrix $A$?

For Poisson equation with Dirichlet boundary conditions in 2 dimension: $$-\Delta u=f,$$ using FDM (centered difference) or FEM discretization, we can obtain a SPD system of linear equations as ...
191 views

### How suitable is multigrid method for time-dependent PDEs?

For elliptic PDEs (Poisson-type), the multigrid method is very sufficient, but how about time-dependent problems (i.e parabolic or hyperbolic PDEs)? Is it efficient to solve such problems using a ...
60 views

### Can the standard multigrid performance be used for time-dependent PDEs?

Consider a time dependent pde(i.e u(x,t)).I know when only space-coarsening is used the standard multigrid performance can be applied but what if instead we use only time-coarsening?Can we apply the ...
155 views

### Simulating advection - diffusion problem in a network of 1D pipe

I'm interested in solving the following advection-diffusion system in a 1D network of pipes. $$\frac{\partial C}{\partial t} = D\frac{\partial ^2 C}{\partial x^2} - v\frac{\partial C}{\partial x}$$ ...
76 views

### Solving a system of PDEs with no-flux boundary conditions (finite difference discretization)

I am interested in solving a system of linear PDEs with the finite difference method and I'm having trouble to solve the no-flux boundary condition correctly. \begin{align} \frac{\partial n}{\partial ...
72 views

### Solving diffusion equation using finite difference method

I am solving an 1-dimensional diffusion equation with Neumann boundary condition at outlet and constant concentration, C, at the inlet. In the end, I want to observe how the concentration diffuses ...
1k views

### Lattice Boltzmann methods vs Navier stokes/ other eulerian methods for *water* simulation

Note, there is already a question here, however the answers don't answer the original question, let alone specific considerations when dealing with nearly in-compressible fluids (water). Another ...
67 views

118 views

### Confusion about Zabusky and Kruskal's stepper for the KdV equation

In Zabusky and Kruskal's paper about solitons, they derive the following update for the Korteweg de Vries equation (their footnote 6): \begin{align*} u_{i}^{j+1} = u_{i}^{j-1} - \frac{1}{3} \frac{k}{...
30 views

110 views

107 views

### What method of Finite difference is this?

I am reviewing Numerical Recipes method on solving ODEs via relaxation (Chapter 18.3 in the 3rd edition) and they chose a finite difference method I am unfamiliar with (Equation 18.3.2): \begin{...
122 views

### Interpolating the gradient of a cylindrically symmetric potential field that's 'supposed to' obey the Laplace equation?

The script below tries to implement a Jacobi iterative relaxation of a potential field for an electrostatic lens. It's hot-off-the-press and I've just started to debug and look for things to test it ...
40 views

### Dealing with spurious oscillations in particle tracking methods

I work on modelling high intensity discharge xenon-filled lamps. The model governing the discharge is quite complex and sadly includes fluid dynamics. After some time, I managed to implement a finite-...
97 views

### Finite difference methods

I am currently applying the finite difference method to the solution of the diffusion equation. I think that a problem has occurred, and is as follows, my explicit method is the most accurate when ...
47 views

### Neumann boundary conditions on arbitrary surface for finite difference diffusion

I am facing the following problem, formulated in practical terms: I have a region $\Omega$ in two or three dimensions, represented as a binary mask, and an initial density $u_0$ within that region ...
230 views

### Second derivative using Fornberg finite difference method

I have some discrete data, non-equispaced in $x$, $y=f(x)$. I want to use a numerical finite difference method to calculate the second derivatives of $y$, at some point. I am using the Fornberg ...
62 views

### How to determine the order of convergence of the Euler-Maruyama method?

This question is originally posted in Quant.StackExchange but has been unanswered for some time so I ask in here. To make this simple let us consider the Geometric Brownian Motions (GBM). My ...
114 views

255 views

### Numerically solving a non-linear PDE

I have this non-linear partial differential equation. $$\frac{\partial C}{\partial t}=\left(\frac{\partial C}{\partial x}\right)^2+C\frac{\partial^2 C}{\partial x^2}$$ I want to use the finite ...
132 views

### Double mach reflection at a inclined wedge

I am running into a strange problem when solving the 2D compressible Euler equations on a inclined wedge. To elaborate, my top boundary condition seems to emitting some type of instability. I have ...
84 views

### Numerical Stability of a Generalized Spatial Discretization Scheme

After reading the matrix stability chapter (10) of Hirsch , I decided to dive in the reference list of the chapter. One of the papers , which is cited as reference shows an very interesting ...
105 views

84 views

### Numerical methods for the continuity equation with Sobolev vector field

Consider the continuity equation $$\partial_t \rho(x,t) + \operatorname{div} (b(x,t) \rho(x,t)) = 0, \qquad t \in [0,T], \quad x \in \mathbb R^N,$$ with $b \in L^1((0,T), W^{1,p}(\mathbb R^N))$. ...
142 views

### How to obtain linear tridiagonal system from PDE

I'm trying to re-solve the governing equations in hydraulic fracturing modeling as instructed step by step in a paper. After (A-9), the author stated that by substituting A-6, A-8 and A-9 into ...
645 views

### CFL equation for non-linear equation

I am trying to solve numerically (obviously) inviscid Burgers' equation with the finite difference method. The equation is the following: $$\displaystyle \partial_t u + u \, \partial_x u = 0$$ ...
148 views

### Good C, C++ library for efficient grid search / tuples, ideally with bindings to Eigen

I have a $q$-dimensional grid, known at run, not compile-time, that has $50$ points in each direction and hence $50^3$ combinations that I would like to first build and then call a function with each ...
The theta-method is a popular solution for solving time-transient PDEs (or ODEs), which consists of solving the general equation for each time step: $$\frac{u^{n+1} - u^{n}}{\Delta t} + (\theta f(u^{... 0answers 383 views ### High-accuracy numerical differentiation I have a 200 \times 200 matrix representing the values taken by a function over an equally spaced grid. I would like to perform derivatives on it. I am interested in its gradient (i.e. its ... 1answer 94 views ### Error for the finite differences scheme -- Advection equation Consider the advection equation (1D in space)$$ \frac{\partial u}{\partial t} + V\, \frac{\partial u}{\partial x}=0 and we solve it numerically on [0,1]\times [0,1]\ni (t,x) using a forward ... 1answer 190 views ### Approximation Error in a Finite Difference Approximation of the Square of Derivative First Part: (First-order derivative) Assuming f is an infinitely differential function everywhere, the Taylor series of f(x + h) at x is \begin{align}\tag{1} f(x + h) = f(x) + hf'(x) + \frac{1}... 0answers 60 views ### Oscillations when solving parabolic heat equation with FTCS I'm wondering if someone could help me out, or point me in a direction of how I can understand the following oscillations that occur when I solve the Porous Medium Equationu_t = u_{xx}^{m+1}$$... 0answers 89 views ### Numerical solution to N-dimensional diffusion on simplex? Assume I have a system of at least (but generally only) N+1 points in an N-dimensional space (N > 3 is possible). At each of these points x_i, i=1,...,N+1 I know an initial potential/... 2answers 401 views ### Non-linear Boundary Value Problem. How to compute the Jacobian? Consider a Boundary Value Problem:$$ \delta u''+u(u'-1) =0 \Leftrightarrow u''=\frac{-u(u'-1)}{\delta}=:f(t,u',u), \\ u(0)=a, u(1)=b $$\delta,a,b are known parameters. I want to implement Newton'... 1answer 641 views ### How to make a less diffusive code to solve 2D advection equation? I would like to solve the following differential equation numerically in 2D,$$\frac{\partial z^-}{\partial t}+(\vec{B}\cdot\vec{\nabla})z^-=0, see Wikipedia if you are curious about what the ...
I have implemented an Adams Bashforth 4 method to solve an Initial Value Problem for an ODE and I am testing it against the test equation: $y'=\lambda y$ with $y(0)=1$ with the exact solution: \$y(t)=...