Questions tagged [finite-difference]
Referring to the discretization of derivatives by Finite differences, and its applications to numerical solutions of partial differential equations.
892
questions
34
votes
2
answers
6k
views
Strange oscillation when solving the advection equation by finite-difference with fully closed Neumann boundary conditions (reflection at boundaries)
I am trying to solving the advection equation but have a strange oscillation appearing in the solution when the wave reflects from the boundaries. If anybody has seen this artefact before I would be ...
30
votes
6
answers
23k
views
How can I numerically differentiate an unevenly sampled function?
Standard finite difference formulas are usable to numerically compute a derivative under the expectation that you have function values $f(x_k)$ at evenly spaced points, so that $h \equiv x_{k+1} - x_k$...
25
votes
5
answers
3k
views
Why do equi-spaced points behave badly?
Experiment description:
In Lagrange interpolation, the exact equation is sampled at $N$ points (polynomial order $N - 1$) and it is interpolated at 101 points. Here $N$ is varied from 2 to 64. Each ...
25
votes
3
answers
16k
views
Recommendation for Finite Difference Method in Scientific Python
For a project I am working on (in hyperbolic PDEs) I would like to get some rough handle on the behavior by looking at some numerics. I am, however, not a very good programmer.
Can you recommend ...
22
votes
2
answers
6k
views
A good finite difference for the continuity equation
What would be a good finite difference discretization for the following equation:
$\frac{\partial \rho}{\partial t} + \nabla \cdot \left(\rho u\right)=0$?
We can take the 1D case:
$\frac{\partial \...
19
votes
2
answers
24k
views
Writing the Poisson equation finite-difference matrix with Neumann boundary conditions
I am interested in solving the Poisson equation using the finite-difference approach. I would like to better understand how to write the matrix equation with Neumann boundary conditions. Would someone ...
18
votes
6
answers
2k
views
How to reorder variables to produce a banded matrix of minimum bandwidth?
I'm trying to solve a 2D Poisson equation by finite differences. In the process, I obtain a sparse matrix with only $5$ variables in each equation. For example, if the variables were $U$, then the ...
16
votes
4
answers
8k
views
uniform vs. non-uniform grid
It is probably a student level question but I can't exactly make it cleat to myself. Why is it more accurate to use non-uniform grids in the numerical methods? I am thinking in the context of some ...
15
votes
2
answers
8k
views
Implicit finite difference schemes for advection equation
There are numerous FD schemes for the advection equation $\frac{\partial T}{\partial t}+u\frac{\partial T}{\partial x}=0$ discuss in the web. For instance here:
http://farside.ph.utexas.edu/teaching/...
15
votes
3
answers
3k
views
How to deal with curved boundary condition when using finite difference method?
I'm trying to learn about numerically solving PDE by myself.
I've been beginning with finite difference method(FDM) for some time because I heard that FDM
is the fundament of numerous numerical ...
15
votes
4
answers
2k
views
Illustrative examples of mimetic finite difference methods
As much as I try to find a concise explanation on the internet, I can't seem to grasp the concept of a mimetic finite difference, or how it even relates to standard finite differences. It would be ...
14
votes
3
answers
9k
views
Boundary conditions for the advection equation discretized by a finite difference method
I am trying to find some resources to help explain how to choose boundary conditions when using finite difference methods to solve PDEs.
The books and notes which I currently have access to all say ...
13
votes
3
answers
7k
views
How to impose boundary conditions in finite difference methods
I have a problem when I want to use the high order center difference approximation:
$$\left(\frac{-u_{i+2,j}+16u_{i+1,j}-30u_{i,j}+16u_{i-1,j}-u_{i-2,j}}{12}\right)$$
for the Poisson equation
$$(...
13
votes
2
answers
2k
views
Alternatives to von neumann stability analysis for finite difference methods
I'm working on solving the coupled one-dimensional poroelasticity equations (biot's model), given as:
$$-(\lambda+ 2\mu) \frac{\partial^2 u}{\partial x^2} + \frac{\partial p}{\partial x} = 0$$
$$\...
13
votes
3
answers
1k
views
What are the basic principles behind generating a moving mesh?
I am interested in implementing an moving mesh for an advection-diffusion problem. Adaptive Moving Mesh Methods gives a good example of how to do this for Burger's equation in 1D using finite-...