Questions tagged [finite-difference]

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

Filter by
Sorted by
Tagged with
1 vote
1 answer
93 views

Numerical solution of 2D wave equation using Fourier transform and finite differences

This is the $2$-dimensional wave equation $$ u_{tt} = u_{xx} + u_{yy} $$ with initial condition $u(x,y,0)=f(x,y)$ and $u_{t}(x,y,0) = 0$. The inverse Fourier transform used is $$ u(x,y,t) = \iint \hat{...
user avatar
  • 111
1 vote
1 answer
83 views

A question on the Poisson equation with Neumann and periodic boundary conditions on a rectangular region

I am trying to solve the following PDE by using finite difference \begin{eqnarray*} \Delta u&=& f ~~on~~(0,1)\times(0,1)\\ \frac{\partial u}{\partial y}(x,0)&=&0=\frac{\partial u}{\...
user avatar
1 vote
0 answers
70 views

Closed (Robin) boundaries in advection-diffusion equation with FDM

I am solving the equation $$ \frac{\partial \phi}{\partial t} = \frac{\partial}{\partial x} \left( D \frac{\partial \phi}{\partial x} + v\phi \right) $$ using finite differences. I want to include ...
user avatar
1 vote
1 answer
81 views

constructing a symmetric matrix for finite difference

I come across the following operator in a paper $\mathcal{I}\psi = \psi_{xxxx} + (r~\psi_x)_x$, where $\psi=\psi(x)$ and $r=r(x)$. Periodic boundary condition is employed. It claims that the operator $...
user avatar
  • 217
2 votes
0 answers
63 views

How to accelerate the computing of implicit finite difference method for heat conduction between two solids

Edit on May 3rd: I have found the problem. Because the difference of between $k_1$ and $k_2$ is huge, a very small time step need to be chosen so that the right green part can "feel" the ...
user avatar
-2 votes
0 answers
53 views

ADI method for a 2D advection-diffusion equation

I have discretized energy equation (2D advection-diffusion equation) with ADI (Alternating Direction Implicit) method, like: $$\frac{\partial\theta}{\partial t}=\frac{\partial^2\theta}{\partial x^2}+\...
user avatar
2 votes
0 answers
63 views

Numerical scheme for the heat equation on the icosahedral hexagonal grid

I have a predefined grid(like this) that is spawned from a regular icosahedradron. It consists of many hexagons and 12 pentagons (corresponding to icosahedradron vertexes). I can tweak the granularity ...
user avatar
1 vote
0 answers
56 views

Open boundary condition for 1d wave equation with variable wave speed using finite differences

I have implemented a finite difference solver for the 1d wave equation with variable wave speed: $$ u_{tt} = c(x)u_{xx}, \hspace{10mm}c(x) = \dfrac{6 -x^2}{2} \hspace{5mm} $$ on $-2 \leq x \leq 2, t &...
user avatar
-1 votes
1 answer
52 views

The local and average Nusselt number in a square cavity

I am in the process of programming the local & average Nusselt number in a left vertical wall but my Matlab script gives me inappropriate values and it doesn't change with changing of Rayleigh ...
user avatar
0 votes
2 answers
102 views

Eigenvectors of Laplacian

I am studying introduction to Multigrid methods. In all tutorials, authors write that eigenvectors of Laplacian (1D, finite difference) are given as $w_k(x_i) = \sin(k \pi x_i),$ where $x_i$ is a ...
user avatar
0 votes
1 answer
46 views

How can I correctly determine velocity of a point inside a grid after using mixed finite element method to solve Poisson equation?

I am using the mixed finite element method (MFEM) to solve the Poisson equation: $$\Delta h = 0,$$where $h$ denotes hydraulic pressure. The MFEM could determine the normal flux rate, $q_n$, through ...
user avatar
2 votes
1 answer
65 views

Shock Capturing Methods for Shallow Water Equations

I am looking for some help finding a numerical solution to the shallow water equations: $\partial_tu+\partial_x(u^2/2+g\eta)=0$ $\partial_t \eta+\partial_x(u\eta)=0$. where $u$ is the depth averaged ...
user avatar
0 votes
0 answers
39 views

Oscillating eigenvectors for 2d-laplace operator

I am trying to calculate the eigenvectors of a Laplace-operator in 2d, with boundary conditions equal to $u=0$ if $x, y$ are outside of a rectangle defined as $(0.5, 0.5), (1.5, 1.5)$. For that I used ...
user avatar
  • 533
2 votes
0 answers
68 views

solve Ax=b for outrigger A matrix python

I implement Crank-Nicolson 2D finite-difference method. I get a matrix A which is banded with 1 band above and below the main diagonal, but also contains 2 additional bands , further apart from the ...
user avatar
  • 131
3 votes
1 answer
61 views

Requesting for Finite Difference Methods reference in Portuguese or English

Crossposted on Mathematics SE I have been assigned a group project for an introductory Linear Algebra subject on Finite Difference Methods and sparse matrices. Our professor advised we use Gilbert ...
user avatar
  • 33
0 votes
0 answers
18 views

Transparent Boundary Conditions relationship with intermediate BCs in ADI-PR method

I have read some materials about ADI - PR method with the aim to understand how to put boundary conditions in my 2D scheme which solves the Time-Dependent Schrodinger Equation. All the theory I read ...
user avatar
  • 131
0 votes
0 answers
57 views

Transparent Boundary Conditions for Finite Difference ADI PR 2D TDSE solution

I want to put (non-dirichlet) boundary conditions inside the code I wrote to solve the 2dim TDSE using the alternating direction implicit Peaceman - Rachford method. $$ (1 + iB\Delta t/2 ) \psi^{n+1/2}...
user avatar
  • 131
0 votes
0 answers
70 views

Finite difference solver for the 2D Poisson's equation with an integral boundary condition

I wanted to attempt an implementation of a finite-difference-based solver for the 2D elctrostatic Poisson equation when metallic objects are present. Also, I hope to take as input, the location of ...
user avatar
2 votes
1 answer
124 views

Index reduction of a DAE from a PDE system

I have a system of 2 non-linear, coupled PDEs that I would like to transform to a stiff ODE system to solve them using the method of lines. The 2 equations: $$\begin{align} \frac{\partial \phi}{\...
user avatar
0 votes
0 answers
81 views

Weighted Jacobi Not Working on 1D Poisson (Issue with Optimal $\omega$)

I've been trying to learn some numerical linear algebra, and I decided to try to implement the weighted Jacobi method to the 1D Poisson problem $$-u''(x)=f(x),\qquad u(0)=a,\ u(1)=b,$$ where we ...
user avatar
0 votes
0 answers
24 views

Need help in attempting to solve an MHD eigenvalue problem

Background I am attempting to numerically solve the ideal MHD equations in normal mode form for a Harris current sheet. The linearized perturbed MHD equations can be written in a normal mode form: $$ -...
user avatar
  • 101
0 votes
1 answer
50 views

What does it mean for a finite difference method to be conditionally stable? Specifically when solving the diffusion equation

The diffusion equation is ∂u/∂t =∂^2u/∂x^2. Consider using an explicit finite difference method to solve it. What does it mean for that explicit finite difference method to be conditionally stable?
user avatar
  • 1
0 votes
0 answers
46 views

How do I identify negative group speeds?

This question is a continuation of one of my other questions. I've been trying to show that collocated (non-staggered) grids can suffer from negative group speeds in the linearized shallow water ...
user avatar
4 votes
1 answer
106 views

Method to linearize highly nonlinear partial differential equation

I have a set of coupled pdes which I want to solve using finite-difference, of which one is nonlinear. The three linear pdes for quantities $T_f$, $T_s$ and $c$ are convection-diffusion-reaction-like ...
user avatar
  • 51
0 votes
1 answer
63 views

A simple wave for the linear shallow water equations

I'm looking for a simple, right-traveling wave for the linear shallow water equations (1D). My question: what are the initial conditions (velocity $U_0(x)$ and/or average water height, average ...
user avatar
2 votes
0 answers
27 views

Numerical calculation of out-of-time order correlators (OTOCs)

I want to numerically calculate OTOCs for different quantum mechanical systems. Consider the following Hamiltonian $$H=p_x^2+p_y^2+x^2y^2$$ and I want to calculate the following OTOC $$C_T(t)=-\left&...
user avatar
  • 129
0 votes
1 answer
92 views

Implementation of mixed hybrid finite element method

The mixed hybrid finite element method (MHFEM) is based on the mixed finite element method (MFEM). So, I'd recall the implementation of MFEM. The mixed formulation of Poisson equation reads $$\begin{...
user avatar
2 votes
2 answers
70 views

Possible to use Iterative FD methods to solve a transformed non square domain [matlab]?

For the 2-D Poisson equation $$-(u_{xx}+u_{yy}) = f \ \ \text{where} f = 1$$ For boundary conditions $$\frac{\partial u}{\partial n} = 0 \ \text{on AB and AD}$$ $$ u = 0 \ \ \ \text{on BC and CD no-...
user avatar
  • 23
2 votes
1 answer
80 views

Stepping over a rapid oscillation in advection

As a model of a more complex problem, I am studying a linear advection equation with a rapidly oscillating velocity $$ \partial_t u + a \cos(\omega t) \partial_x u = 0 $$ with initial condition $u(x,0)...
user avatar
  • 695
0 votes
1 answer
68 views

Time & Space matlab discretization Finite Differences confusion

I have been trying to solve this equation and write the finite difference scheme in matlab for months, but I still am not successful. Given the KdV Equation $$\tag{1}u_{t} -6uu_x+u_{xxx}=0$$ I have ...
user avatar
  • 23
3 votes
1 answer
108 views

Comparison on adaptive mesh refinement on finite elements and finite differences

My current work requires using (Adaptive Mesh Refinement) AMR to resolve multi scale physics. I have a general question whether finite element is better than finite difference in this aspect or not. I ...
user avatar
  • 109
4 votes
0 answers
50 views

How to troubleshoot numerical instability using finite difference for steady-state non-linear heat conduction equation

I have a problem which I believe is numerical instability when trying to solve a heat conduction equation using finite difference. The short version is that when the parameter $I=80.3$ I get the blue ...
user avatar
2 votes
1 answer
115 views

Mineral dissolution and solute transport around a solid

I am trying to simulate solute transport of acid (HCl) and consequent mineral dissolution around a grain (calcite). The governing equation for transport is the advection-diffusion equation, given as: ...
user avatar
  • 47
3 votes
0 answers
43 views

Appropiate Artificial Boundary Conditions for the radial part of the Klein Gordon equation?

I am trying to simulate the following equation using FDTD $ \left(- \partial^2_t + \partial^2_x + V(x) \right) \psi(x,t) =0 $ subjected to the initial conditions $\psi(x,0) = f(x),~ \partial_t \psi(x,...
user avatar
  • 131
0 votes
1 answer
203 views

1D wave equation using Finite difference method MATLAB

I have the wave equation $$u_{tt} = 4 u_{xx}$$ with the boundary conditions $$u(0,t) = u(L,t) = 0\,,\quad x \leq 0 \leq 2\pi \,,\quad t\geq 0$$ and initial conditions $$\begin{align} &u(x,0)=\...
user avatar
1 vote
0 answers
38 views

Advection diffusion equation using Crank-Nicolson with total flux and Diriclet BCs

I am trying to model the 1D advection-diffusion equation: $${\partial c \over \partial t} = D_c{\partial^2 c \over \partial x^2} -u{\partial c \over \partial x}.$$ With Robin boundary conditions that ...
user avatar
  • 51
1 vote
1 answer
223 views

How to solve heat equation in spherical coordinates with finite differences?

I have a problem dealing with heat transfer which is spherically symmetrical. I was thinking it should be possible to solve this as a 1d problem in spherical coordinates using the radius only. ...
user avatar
  • 111
1 vote
0 answers
70 views

How to apply Neumann boundary conditions in Newton's method [closed]

Suppose that I have a very long and tedious set of differential equations. After discretization, I can get a mapping $f:\mathbb{R}^N \to \mathbb{R}^N$ such that solutions $\phi =(\phi_0,...,\phi_{N-1})...
user avatar
2 votes
0 answers
72 views

Solute transport around a solid obstacle

I am a newbie in CFD and single/multiphase flow and transport in general. As part of my quest to learn, I am trying to model solute transport around a solid object in the center of a 2D domain. The ...
user avatar
  • 47
3 votes
1 answer
72 views

Instability at the boundary of a finite difference simulation of a hyperbolic PDE

I want to simulate the hyperbolic partial differential equation $$W_{tt} + V W_{tx} + k_E V W_x + k W_t = 0,$$ but I am having trouble finding a discrete analog of this equation which is numerically ...
user avatar
0 votes
1 answer
130 views

Computing eigenvalues of Schrodinger equation with spin

I want to solve a 2-dimensional particle in box problem with two electrons in the quantum well.I would like to take into account spin of electrons and Coulomb interactions to compute singlet and ...
user avatar
0 votes
0 answers
69 views

Numerical Partial Differentiation Check

In my computer vision course, we are working on extracting a 3D surface from a chain of 2D images taken under several conditions. This procedure is known as Photometric stereo. Prior to extracting the ...
user avatar
  • 155
1 vote
0 answers
60 views

Good non oscilliatory derivatives for an exsisting grid

I'm calculating the entropy production of a shockwave by utilizing the equations: \begin{equation} \sigma = J'_q\frac{\partial}{\partial x}\left(\frac{1}{T}\right) +\frac{1}{T}\frac{4\eta}{3}\left(\...
user avatar
  • 55
1 vote
0 answers
228 views

How to compute the Eigenvalue and Eigenstates of Quantum well with Effective mass using finite difference method in Python?

I want to compute the eigenvalues and eigenstates of a quantum well with different effective masses of electron in the barrier and in the quantum well. As can be seen [1]: https://github.com/mholtrop/...
user avatar
7 votes
1 answer
389 views

Why is the central difference method dispersing my solution?

I am solving numerically the ODE $\ddot x(t)=-c\dot x(t) -\sin(x(t))+F\cdot \cos(\omega t), \;\dot x(0)=x(0)=0$ for $t\in [0,20\pi]$ on an $N=2000$ dimensional grid. I am working on Python, and I ...
user avatar
4 votes
1 answer
155 views

Computing second derivatives with Neumann boundary condition

I am implementing a finite difference method for a PDE with a Neumann boundary condition. I will simplify my question to a single dimension. Suppose I have a PDE $$\frac{\partial u}{\partial t} = \...
user avatar
1 vote
0 answers
85 views

Attempt on 2d Advection with FDM - With Code

I tried to implement the 2d advection problem with a velocity field, that is not constant in space. My problem is, that the "mass" of my shifted density gets "eroded" or just ...
user avatar
  • 295
0 votes
0 answers
28 views

shifting mass along a vector field

I have a positive matrix $\rho \in \mathbb{R}^{n,n}_+$ as a discrete probability density. Furthermore, I have a tensor $u \in \mathbb{R}^{n,n,2}$ that is constant in time and acts as a vector field. I ...
user avatar
  • 295
2 votes
0 answers
99 views

About the the stability of using an explicit scheme on the heat equation

Before I get to the heat equation I'd like to talk about the advection equation. Descritize that with FD in time and BD in space: \begin{equation} \dfrac{u^{n+1}_i - u^{n}_i}{\Delta t} + v \dfrac{u^{n}...
user avatar
3 votes
1 answer
98 views

Stability analysis simplification for PDE

I have the nonlinear PDE $$\frac{\partial U(z,t)}{\partial t} + A(U)\frac{\partial U(z,t)}{\partial z} + B(U)U(z,t) + C(z,t) = 0,$$ where $A(U)$ and $B(U)$ are guaranteed to be real and positive. I ...
user avatar
  • 33

1
2 3 4 5
16