Questions tagged [finite-difference]

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

The finite difference method is a numerical method for solving differential equations. The derivatives are discretized in space and in time and approximated by "finite differences" (derived from Taylor's Theorem) e.g.: $$ f^{'}(x) = \frac{f(x+h) - f(x)}{h} $$

where h is the distance between discrete grid locations.

The finite difference method can be solved using either explicit or implicit methods. For a more complete description see the Wikipedia page on the Finite difference method

882 questions
9
votes
1 answer

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 reading the dedicated chapter (4.8) in the Wolfgang…
Michael
  • 91
  • 2
8
votes
1 answer

FDTD Poynting Vector

I'm attempting to validate my FDTD code against Meep by calculating the Poynting vector field across a simulation consisting of a monochromatic point source within a box (no boundary conditions (Dirichlet) so everything just bounces off the domain…
3Dave
  • 201
  • 1
  • 8
7
votes
1 answer

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-homogeneous diffusion coefficient $D$ and the…
david guez
  • 159
  • 8
7
votes
2 answers

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 formula in the following way: $D^-[D^+(U)]$,…
Paul
  • 12,045
  • 7
  • 56
  • 129
6
votes
1 answer

Error implementing Robin boundary conditions in toy ODE problem

I am attempting to solve the following ODE problem: $$-u''+ u = x$$ $$u(0) = 0$$ $$u'(1) = -u(1)$$ The exact solution is: $u(x) = e^{-x-1} - e^{x-1} + x$ I have a Dirichlet at $x = 0$ and a Robin condition at $x = 1$. I refer to the exact solution…
bzm3r
  • 669
  • 5
  • 21
5
votes
1 answer

How to design good finite difference schemes?

In principle, I know finite differences. In university, we discussed it and derived consistency and boundary conditions. But I am still left with a big question. How to design a good finite difference scheme? What should I do, that my solution does…
vanCompute
  • 589
  • 1
  • 4
  • 16
4
votes
2 answers

Object-oriented programming on finite difference method

generally, it is natural to use procedural programming approach (PP) to solve a partial differential equation by finite difference method (FDM). That is, one (1) defines matrices to store the properties at nodes and fluxes in between the nodes, (2)…
Chenming Zhang
  • 329
  • 1
  • 8
4
votes
1 answer

Accuracy of Explicit Euler method (finite difference) decreases as Δx decreases, shouldn't it increase?

The price of a commodity can be described by the Schwartz mean reverting SDE $$dS = \alpha(\mu-\log S)Sdt + \sigma S dW, \qquad \begin{array}.W = \text{ Standard Brownian motion} \\ \alpha = \text{ strength of mean reversion}\end{array}$$ From it is…
sound wave
  • 143
  • 1
  • 1
  • 4
4
votes
4 answers

Finite difference for mixed derivatives on nonuniform grid

I need to have a finite difference stencil for the mixed derivative $$f_{xy}$$ on nonuniform grids such as this one: Since I could not find a stencil in the literature, I tried to derive it by my self. As usual I started with a Taylor series…
benno
  • 301
  • 1
  • 9
4
votes
2 answers

Why does multiplying two first derivative finite difference matrices not give the matrix for the second derivative?

The finite difference matrix for the first derivative is $\begin{bmatrix} -1 & 1 & 0 \\ 0 & -1 & 1 \\ 0 & 0 & -1 \end{bmatrix}$. The finite difference matrix for the second derivative is $\begin{bmatrix} -2 & 1 & 0 \\ 1 & -2 & 1 \\ 0 & 1 & -2…
islanss
  • 147
  • 7
4
votes
0 answers

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 assumptions often lead to terrifying equations. I've…
tom
  • 231
  • 2
  • 6
4
votes
2 answers

Finite Difference Error Estimate for an Elliptic PDE with an Oscillatory Coefficient

Suppose I want to solve the PDE: $$-\nabla\cdot\left( a_\epsilon\left(x\right)\nabla u\right)=0 \text{ in } \Omega$$ $$u=g(x) \text{ on }\partial\Omega$$ Here, I assume that $a_\epsilon(x)=a(x,\frac{x}{\epsilon})$ for some $a(x,y)$ such that $a$ is…
Paul
  • 12,045
  • 7
  • 56
  • 129
3
votes
1 answer

Definition of TV in TVD finite difference methods

TVD (total variation diminishing) finite difference methods that produce non-oscillatory solutions are based on the total variation. In LeVeque's book the total variation of a function $q(x)$ is defined as (p.…
3
votes
0 answers

Orthogonal vs general curvilinear coordinates

Solutions to PDEs over irregular domains can be computed using the finite difference method by the introduction of so called body fitted coordinate systems where the coordinate lines are aligned to the domain boundary. The benefit of the idea is…
user44010
  • 207
  • 1
  • 2
3
votes
0 answers

Simplest way to "monotonize" MacCromack method

The MacCormack finite-difference "predictor-corrector" method is well known to generate spurious oscillations near solution discontinuities such as shock waves in gas dynamics equations. Or even in simpler case of scalar advection equation, when…
omican
  • 347
  • 1
  • 9
1
2 3 4