# Questions tagged [finite-difference]

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

613 questions
Filter by
Sorted by
Tagged with
4k 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 ...
2k 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 ...
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 \... 5answers 14k 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$... 3answers 12k 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 ... 4answers 5k 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 ... 2answers 6k 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/... 4answers 1k 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 ... 2answers 17k 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 ... 4answers 6k 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 ... 3answers 6k 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 $$(... 4answers 1k 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 ... 3answers 2k 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 ... 2answers 1k 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\... 3answers 790 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-... 5answers 2k views ### Numerical derivative and finite difference coefficients: any update of the Fornberg method? When one want to compute numerical derivatives, the method presented by Bengt Fornberg here (and reported here) is very convenient (both precise and simple to implement). As the original paper date ... 6answers 5k views ### Finite differences on domains with irregular boundaries Can anybody help me to find the books on numerical solutions(finite difference and Crank–Nicolson methods) of Poisson and diffusion equations including examples on irregular geometry, such as a domain ... 2answers 890 views ### How do you improve the accuracy of a finite difference method for finding the eigensystem of a singular linear ODE I am attempting to solve an equation of the type:$ \left( -\tfrac{\partial^2}{\partial x^2} - f\left(x\right) \right) \psi(x) = \lambda \psi(x) $Where$f(x)$has a simple pole at$0$, for the ... 1answer 1k views ### Optimal transport warping implementation in Matlab I am implementing the paper "Optimal Mass Transport for Registration and Warping", my goal being to put it online as I just cannot find any eulerian mass transportation code online and this would be ... 2answers 2k views ### Solid mechanics with finite differences: How to handle “corner nodes”? I have a question concerning coding boundary conditions for solid mechanics (linear elasticity). In the special case I have to use finite differences (3D). I am very new to this topic, so perhaps some ... 2answers 712 views ### Finite difference scheme for “wave equation”, method of characteristics Consider the following problem $$W_{uv} = F$$ where the forcing term can depend on$u,v$(see Edit 1 below for the formulation), and$W$and its first derivatives. This is a 1+1 dimensional wave ... 2answers 930 views ### Is the maximum/minimum principle of the heat equation maintained by the Crank-Nicolson discretization? I'm using the Crank-Nicolson finite difference scheme to solve a 1D heat equation. I'm wondering if the maximum/minimum principle of the heat equation (i.e. that the maximum/minimum occurs at the ... 2answers 7k views ### Use of machine learning in computational fluid dynamics Background: I have only built one working numeric solution to 2d Navier-Stokes, for a course. It was a solution for lid-driven cavity flow. The course, however, discussed a number of schemas for ... 4answers 1k views ### When we use Bernstein polynomials in application When it is preferable to use Bernstein polynomials to approximate a continuous function instead of using the only following preliminary Numerical Analysis methods: "Lagrange Polynomials", "Simple ... 5answers 652 views ### How can I derive a bound on the spurious oscillations in the numerical solution of the 1D advection equation? Suppose I had the following periodic 1D advection problem:$\frac{\partial u}{\partial t} + c\frac{\partial u}{\partial x} = 0$in$\Omega=[0,1]u(0,t)=u(1,t)u(x,0)=g(x)$where$g(x)$has a ... 1answer 6k views ### How to approximate the condition number of a large matrix? How do I approximate the condition number of a large matrix$G$, if$G$is a combination of Fourier transforms$F$(non-uniform or uniform), finite differences$R$, and diagonal matrices$S? The ... 1answer 4k views ### Are there any numerical advantages in solving symmetric matrix compared to matrices without symmetry? I'm applying finite-difference method to a system of 3 coupled equations. Two of the equations are not coupled, however the third equation couples to both the other two. I noticed that by changing the ... 2answers 1k views ### What does the Von Neumann's stability analysis tell us about non-linear finite difference equations? I am reading a paper  where they solve the following non-linear equation \begin{equation} u_t + u_x + uu_x - u_{xxt} = 0 \end{equation} using finite difference methods. They also analyse the ... 1answer 513 views ### Nonlinear wave equation - Finite element or finite difference I would like to know the which is more advantageous when it comes to solving nonlinear hyperbolic equations, Finite Element or Finite difference methods? Which method will be better in capturing ... 3answers 209 views ### Stability criterion for waves in anisotropic solids The equations of motion for an elastic solid are given by \begin{align} &\nabla \cdot \boldsymbol{\sigma} + \mathbf{f} = \rho \ddot{\mathbf{u}}\\ &\boldsymbol{\sigma} = \mathbb{C}\... 1answer 1k views ### Shortley-Weller finite difference method can you give me a link for a good and simple explanation of the Shortley-Weller finite-difference scheme? I tried to google it but all I get is (inaccessible) academic publications. I also tried ... 1answer 2k views ### Automatically generating finite difference matrices for systems of PDEs Suppose that you have a system of PDEs to solve. At least for simplicity, let's assume it's time independent, quasi-linear (linear in its derivatives) solved on a rectangular grid in (x,y) space, and ... 1answer 2k views ### Finite difference coordinate transformation for spherical polar coordinates I have part of a problem that is described by the momentum conservation equation: \frac{\partial \rho}{\partial t} + \frac{1}{\sin\theta} \frac{\partial}{\partial \theta}(\rho u \sin \theta) =0 ... 1answer 8k views ### Matlab solution for implicit finite difference heat equation with kinetic reactions I am trying to model heat conduction within a wood cylinder using implicit finite difference methods. The general heat equation that I'm using for cylindrical and spherical shapes is: Where p is the ... 1answer 533 views ### Finite difference scheme for compressible nonisothermal flow in porous media My challenge is to solve the following system of equations, which describe gas combustion in porous media: 1) Continuity \varepsilon \frac{\partial \rho_g}{\partial t} +\frac{\partial}{\partial x} \... 3answers 1k views ### Laplacian eigenmodes on a semi-circular region with finite-difference method The computation of eigenmodes of a semi-circular membrane reduces to the following eigenvalue problem\nabla^2u=k^2u\;,$$where the region of interest is a semi-circle defined by r\in[0,1] and \... 3answers 801 views ### analyze stability on a nonuniform grid Assume you have a stability constraint between the space distance in time and space, for example, with an explicit Euler method for u_t=u_{xx} we know \tau\leq h^2/2. That is, one can do stability ... 2answers 225 views ### How can I obtain a one dimensional finite difference formula for U_{xx} with unevenly spaced nodes? I know that if I had evenly spaced points, I can use U_{xx}\approx \frac{U_{i-1}-2U_{i}+U_{i+1}}{dx^2}. But if my gridpoints are unevenly spaced, I assume that I can obtain the finite difference ... 4answers 1k views ### Finite Difference Method Stability The diffusion equation is: \frac{\partial T}{\partial t} = \alpha \left( \frac{\partial^2 T}{\partial x^2} \right) An explicit finite difference approach can be used to solve this, forward in ... 1answer 199 views ### Non-hermitian discretizations in quantum mechanics Consider the Schroedinger equation$$\left(-\frac12\frac{\partial^2}{\partial x^2} + V(x) \right) \psi(x) = E \psi(x)$$The usual way to solve it is to introduce a discretization of \psi(x). This ... 2answers 2k views ### discrete definitions of curl \nabla \times F? I have some data defined in an array (an image) and I need to find the curl of a certain function. Wikipedia has an integral definition of curl that I like, maybe it can be discrete.$$ \nabla \... 2answers 1k views ### Convergence/stagnation of BiCGStab(l) I am solving 3D time-harmonic Maxwell FDFD problems (which result in huge sparse linear systems) using BiCGStab(l). I have tried out a bunch of different methods and for my specific use case, it seems ... 3answers 743 views ### Largest eigenvalue of FD discrete Laplacian Is there good approximation for largest (in magnitude) eigenvalue for discrete Laplacian (\nabla^2$) obtained from nonuniform structured grid (like that)? Of course, one can always use general ... 1answer 5k views ### Schroedinger/Diffusion equation with Crank-Nicolson in Python/SciPy I tried to make the question as detailed as possible. I have an extremely simple solver written for the Schroedinger equation but with imaginary time, which transforms it basically into the diffusion ... 1answer 208 views ### finite difference : why should we solve linear equation at each step I'm trying to simulate the growth of a brain tumor using a 3d reaction-diffusion model$ \partial_{t}u = \nabla.{(D\nabla{u}) } + ku.(1-u)$, knowing the initial distribution of tumor$u^0$, the non-... 1answer 575 views ### Finite difference recursion and higher order This may be a trivial question, but I've always wondered... For the classical, central finite difference schemes, if I'm interested in determining the second derivative, does applying the first ... 2answers 6k views ### 2nd order centered finite-difference approximation of$u_{xy}$The problem is to find a 2nd order finite difference approximation of the partial derivative uxy, where u is a function of x and y. Page 5 of this pdf I found does a centered difference approximation ... 1answer 558 views ### Conservative finite-difference expression for the advection equation Following on from the earlier question I am trying to derive a finite-difference scheme for the advection equation which is conservative. It was suggested that for advection equation with variable ... 1answer 475 views ### Linearized implicit time stepping Consider the general FD implicit time stepping scheme$\frac{x_{t+1} - x_t}{\Delta t} = f(x_{t+1})$, where$x$is the vector variable of interest and$f\$ is some function, generally non-linear. ...
In this question, I suggested that the Couran-Friedrichs-Lewy (CFL) condition for the wave equation in polar coordinates reads $$C = 2c\frac{\Delta t}{\Delta r \Delta \phi} \leq C_\max \enspace ,$$ ...