# Questions tagged [finite-difference]

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

893 questions
Filter by
Sorted by
Tagged with
55 views

### FDTD boundary condition that replicates an infinitely thin mirror

I'm currently running a 1-D FDTD simulation where I want to model a dielectric mirror (with an anti-reflection coating on one side but let's keep it simple for now). For my purposes, the mirror can be ...
1 vote
173 views

116 views

### Are there necessary conditions for SOR algorithm to converge when used for 2D discrete Poisson problem, with PBC, besides solvability condition?

I am trying to solve a 2D poisson problem that is supposed to represent diffusion of chemicals on a grid: $\nabla^2 R_{ij}=f_{ij}$. I am discretizing the problem with the standard central ...
425 views

### Implementing Dirichlet BC for the Advection-Diffusion equation using a second-order Upwind Scheme finite difference discretization

i am implementing a Matlab code to solve the following equation numerically : $$(\frac{\partial c}{\partial t} =-D_{e} \frac{\partial^2 c}{\partial z^2} +U_{z}\frac{\partial c}{\partial z})$$ with ...
143 views

### "Cleanest, most professional" approach to implement a finite differences scheme in dimension greater than two

Coding a finite difference algorithm in 1D does not require a complex mesh. In higher dimensions, you would need a mesh and its connectivity graph to compute the differential operators. Finite ...
1 vote
218 views

### Numerically solving the Advection-diffusion equation with no-flux boundary condition leads to violation of mass conservation

I am trying to solve numerically the advection-diffusion equation of the following form $$\frac{\partial C}{\partial t}=\alpha\frac{\partial^2 C}{\partial x^2}+\beta \frac{\partial C}{\partial x}$$ ...
221 views

104 views

So I'm trying to use the Lax-Friedrichs method to solve the inviscid burgers' equation with initial condition $$u(x,0) = \sin(x)$$, using $$u_m^{n+1} = \frac{1}{2}(u_{m+1}^n + u_{m-1}^n) - \frac{\... 0 votes 0 answers 40 views ### Convergence of Modified Crank-Nicolson Scheme I'm dealing with a particular reaction-diffusion equation having the form$$ c_t = \alpha \nabla^2 c + F(c,x,t). \tag{1}$$where F is nonlinear. I would like to solve (1) with a finite-difference ... 4 votes 1 answer 149 views ### Burger's equation (PDE) does not work with downwind difference? I'm working on implementing the discretised Burger's equation. I am quite confused as to why it does not work when using a step-function and downwind difference formula. When using a step-function and ... 0 votes 1 answer 87 views ### My toy Laplace equation solver using finite-difference is unstable and I'm not sure why I am trying to solve the variable-coefficient Laplace equation$$\partial(\epsilon\partial u) = (\partial\epsilon)(\partial u) + \epsilon\partial^2 u = 0$$using a finite difference scheme:$$\left(\...
111 views

I'm working on trying to solve a steady state PDE in python and I am quite new to python and I am slightly confused on the implementation details. I have an example implementation of solving a non-...
280 views

### Finite difference problem

I have a problem to resolve with the Finite Difference method in $[a,b]$: $$-\frac{d}{dx}(\alpha(x)\frac{du}{dx})= g(x),$$ with $\alpha(x) \in L^{\infty}$ continuous in $]a,c[$ and $]c,b[$ and ...