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

learn more… | top users | synonyms

1
vote
0answers
21 views

Get symmetric Finite Difference matrix in non Laplacian settings

I would like to solve a system of differential equations $u+\nabla(\nabla\cdot u)=f$ or in more detail $a+\partial_t^2a+\partial_t\partial_xb+\partial_t\partial_yc=f$ ...
1
vote
0answers
22 views

2D Neumann Conditions on Irregular Domain

I would like to model the 2D diffusion equation with Neumann BC's inside the following domain: I would like to use the finite difference method with the discretization implied by the image above, ...
3
votes
1answer
68 views

Numerically solve a PDE in Python with a term calculated by coarse-graining

I'm trying to solve a PDE in Python of the form, $\dfrac{\partial c(\mathbf{x}, t)}{\partial t} = \mathrm{D} \nabla^2 c(\mathbf{x}, t) -\gamma \rho(\mathbf{x}, t) c(\mathbf{x}, t)$ where $c$ ...
1
vote
0answers
84 views

Solve a fourth order differential equation

I want to solve $$ \frac{\partial^2}{\partial t^2}u(z,t) + a\frac{\partial^2}{\partial z^2}u(z,t) + k\frac{\partial^4}{\partial z^4}u(z,t) = 0 $$ with $u(z,0) = 1+0.1e^{-\frac{z^2}{2}}$. I'd like to ...
2
votes
1answer
152 views

Solve a differential equation with finite difference method

I want to solve this equation $$ -\frac{1}{2}f''(x)+2a\ f(x)^3 = f(x)\mu $$ One exact solution (there are a lot of different kinds) of this equation is $f(x) = f_\infty \tanh(\sqrt{2a}f_\infty x) $ ...
2
votes
3answers
106 views

Computing the derivative on a mesh

I have a 2-D mesh of triangles and I have a scalar function $f(x,y)$ defined at all the vertices of this mesh. I want to accurately estimate $\frac{\partial f}{\partial x}$ and $\frac{\partial ...
3
votes
1answer
69 views

Books and references on implementing finite difference codes for PDEs

Are there any good books or references on implementing finite difference methods for PDEs? Specifically, I'm looking for something comparable to Gockenbach's book Understanding and Implementing the ...
3
votes
2answers
111 views

Finding shortest path in a time/distance map

I get a distance map output after using a Fast Marching Method. The PDE involved is the Eikonal equation which take the form : $$\begin{cases} c(x).|\nabla u| =1\\ u(x) =\phi(x) ...
4
votes
2answers
138 views

Projection Method: Boundary condition on intermediate velocity field

I'm trying to solve variable density and viscosity Navier-Stokes equation using lagged pressure projection method. I'm solving for cavity problem as a test case now (once I get projection right, I ...
3
votes
0answers
94 views

Efficient assembly of finite element matrix(coupled equations case)

I noticed this post, where spalloc and sparse are recommanded for efficient assembly in Matlab. I personally use sparse assembling for simple cases. However, when it comes to the case of coupled PDE, ...
3
votes
1answer
60 views

ODE boundary value problem relaxation method reference request

This is a somewhat basic question, I guess. Take the ODE boundary value problem $$ \frac1\lambda y''-y'=0, \qquad y(0) = 0, \quad y(1) = 1, $$ with the solution $$ y(x) = ...
4
votes
3answers
158 views

Discrete Poisson Equation with Pure Neumann Boundary Conditions

I'm trying to implement the Helmholtz-Hodge Decomposition in 2D, which states that a vector field is composed by a rotational free component, a divergence free component and a harmonic component. ...
1
vote
1answer
148 views

Python - calculation time derivative and laplacien by finite differences

I would like to determine a temporal derivitive and a Laplacian by the finite differences method to solve the heat equation in a 1-dimensional case. My aim is to get the sources term that is why I ...
5
votes
2answers
114 views

Advice on numerical solution for 2D hyperbolic PDE with zero flux boundary conditions

I would like to numerically solve a hyperbolic PDE of the form $\frac{\partial\theta_t}{\partial t}(x,y)+\frac{\partial\left[\theta_t \gamma_t^x\right]}{\partial x}(x,y)+\frac{\partial\left[\theta_t ...
6
votes
3answers
206 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 ...
1
vote
1answer
59 views

Coupled PDE: a confusion in boundary condition setup

I have a coupled PDE problem(Poisson-Schrondinger system), i.e. first I need to solve an eigenvalue problem (Schrodinger problem discretized by Galerkin method) $$Ax=\lambda x, ~~~A=A(u)$$ the ...
1
vote
0answers
202 views

Poisson equation with Neumann boundary conditions

I'm trying to solve the Poisson equation with pure Neumann boundary conditions, $$ \nabla^2\phi = \rho \quad in \quad \Omega\\ \mathbf{\nabla}\phi \cdot \mathbf{n} = 0 \quad on \quad \partial \Omega ...
4
votes
1answer
227 views

Finite differences vs. elements: Accuracy and implementation

I am trying to solve the 2D Poisson equation numerically: $ \frac{\partial ^2 \phi}{\partial x^2} + \frac{\partial ^2 \phi}{\partial y^2} = 1 $ with the Dirichlet boundary condition $\phi = 0$. I ...
2
votes
2answers
99 views

Finite element: handle discontinuity/abrupt interface

I am using Galerkin's method to set up some pde solver for my problems(1D/2D) at hand. Some abrupt material interfaces do exist, so far, what I did regarding this is simply: 1) no element across the ...
1
vote
0answers
33 views

characterising attractors for master equations

I have a master equation for $(x,y,z)$ with the constraint $x+y+z=N$. $x$ can be regarded as the number of animal of a certain species in the whole system. In other words, I have a differential ...
2
votes
0answers
155 views

Solving the Helmholtz equation numerically

I am trying to solve the Helmholtz equation in some complex unbounded 2D domain: $$\left( \frac{\partial^2 \psi}{\partial x^2} + \frac{\partial^2 \psi}{\partial y^2} + E \right) u(x, y) = 0$$ ...
3
votes
1answer
193 views

Comparison of Lattice Boltzmann Method vs Traditional Navier-Stokes based Methods

I have a choice of two options, analysing and implementing Lattice Boltzmann methods or traditional Navier Stokes based methods. I'm a CFD newbie and I have a rough idea (though not rigorous enough to ...
1
vote
0answers
48 views

Finite difference mixed derivatives on quadrilateral (non-orthogonal) grids

Could someone tell, please, has someone constructed finite difference mixed derivatives on quadrilateral (non-orthogonal) grids, already? Without using aconformal mapping to an orthogonal grid. I mean ...
0
votes
0answers
17 views

dynamics of bending of flexible kvazi-1D object simulated using smooth basiset

Do you know a about method which use smooth basiset (like spline, $\sin, \cos$ ) rather than finite element method for simulation of bending of some flexible 1D object ( canteliver, bow, stiff rope, ...
2
votes
0answers
97 views

Why does my Finite Difference approximation not work?

I am trying to find out the magnitude of the acceleration of my object based on non-uniformly sampled 3D position data. I'm using the standard approximation of the 2nd order derivative on a ...
2
votes
1answer
143 views

FEM: which is the correct way to impose Dirichlet B.C

I know the Neumann B.C. is implicit in FEM language. However, I have seen at least two ways to impose Dirichlet B.C. e.g. for the following problem 1D, $$\nabla^2 u + \nabla u= 0, u_{left}= 1, ...
0
votes
0answers
136 views

How to solve singular non symmetric poisson equation with Neumann boundary condtions?

I am trying to solve 2D Poisson equations with Neumann boundary conditions. When the mesh is uniform, Poisson equation is singular and symmetric, so the method listed in Null Space Projection for ...
1
vote
0answers
105 views

finite volume for diffusion equation with anisotropic (tensor) coefficient

Consider the scalar PDE for $u$ with Dirichlet boundary conditions: $\mathrm{div}(\mathcal{K}\nabla u) = f\; \forall x\; \in \Omega \subset R^2$, $u = 0 \; \forall \; x\;\in \partial\Omega$ ...
3
votes
2answers
154 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 ...
1
vote
0answers
91 views

Assembling sparse matrix in PETSC for Poisson equation

I am a novice at PETSC, and I have been trying to write an FVM code for steady heat conduction in 2D using PETSC (square, regular grid, Dirichlet boundaries) Since the large matrix , say A, will be ...
1
vote
1answer
46 views

Stiff Equations - What to plot as a qualitative or quantitative measure of stiffness

On a recommendation from Mathematica.SE, I am posting this on Computational Science.SE: I am trying to quantify stiffness of an ODE by relating it to the fine-ness with which NDSolve treats it's ...
0
votes
1answer
142 views

Solving the convection-diffusion equation using finite differences at high Peclet numbers

I am trying to solve the 2D convection-diffusion equation, which in non-dimensional variables can be expressed for my problem as: $\frac{\partial c}{\partial t} = \lambda^2\frac{\partial^2c}{\partial ...
3
votes
1answer
176 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 ...
3
votes
1answer
399 views

Free open source C/C++ library to solve 2d Poisson equation using the finite difference method

I have been writing some code in C for particle-in-cell simulation. One of the steps of the PIC algorithm requires to solve (numerically) Poisson's equation $$ \Delta \varphi = - 4 \pi \rho. $$ ...
3
votes
2answers
450 views

Developing finite volume (FVM) code in C . General advice

I need to develop a FVM code in C (The multiscale FVM method for heterogeneous media). I know that: Only uniform rectangular grids will be considered (2d now, later 3d) Sparse systems will be large ...
1
vote
1answer
85 views

Implicit finite difference scheme for LWR-v PDE

I want to discretize the LWR(Lighthill-Whitham-Richards)-v partial differential equation (as shown in 1) $$ \frac{\partial u}{\partial t} + \frac{\partial R(u)}{\partial x} = 0 \quad \text{i.e.,} ...
1
vote
1answer
71 views

large symmetric positive band matrix

I use gpbsv command from Intel MKL to solve symmetric positive band system. But unfortunately when the system is large I get an error Access violating writing location in VisualStudio. Could someone ...
1
vote
0answers
127 views

Derivation of a Higher Order Compact Alternating Direction Implicit Method

I dont understand how this Higher Order Compact ADI scheme, which is fourth order in time and space, for the wave equation is derived: I go through the following Using Tylor's expansion $u(t+h,x,y)$ ...
0
votes
0answers
63 views

Exchange the position of two particles using Matlab

need to exchange the position of two particles in order to test the symmetry of the wave-function $\psi(x_1,x_2)$ using Matlab. Can anyone tell me if there is a certain command I have to use? and if ...
6
votes
0answers
76 views

Implementation of convection scheme given by normalized variable diagram

In finite difference and finite volume methods, convection schemes (upwind, central, quick, ...) are usually shown in a normalized variable diagram. The diagram gives the normalized face variable as a ...
5
votes
0answers
164 views

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 ...
1
vote
2answers
310 views

Reconstructing fluxes

Given a standard advection equation, we write the update as $$ q_i^{n+1}=q_i^n+\frac{\Delta t}{\Delta x}\left(F_i^{n+1/2}-F_{i+1}^{n+1/2}\right) $$ with $F_i^{n+1/2}=F\left(q_i^n,\,q_i^*\right)$ and ...
2
votes
1answer
91 views

Finite Differencing of a Strange Advection-Reaction Problem

comp! I'm trying to solve the advection-reaction problem $ dg/dt = dg/dx + x\cdot g \qquad on~~x \in \Omega = (-\infty, +\infty)$ supplemented with the boundary conditions $ \lim_{\lvert x \rvert ...
3
votes
1answer
265 views

How to solve the advection equation in 2 dimension using the Crank-Nicolson method?

I've an equation like this to solve with the crank-nicolson method $$U_t -\frac{y}{2} U_x + \frac{x}{2}U_y = 0,$$ where $x$ and $y$ are: [-2,5:2,5] and the time ...
2
votes
1answer
113 views

One finite difference scheme

There is PDE: $$\frac{\partial u(r,\varphi,\psi,t)}{\partial t}=\operatorname{div}A(r,\varphi,\psi)\nabla u +f(r,\varphi,\psi,t) $$ We solve numerically IBVP for the ball $B_{1}(0)\subset ...
3
votes
1answer
168 views

Problem in Discretizing Convection-Diffusion-Reaction equation

I'm trying to solve the Convection-Diffusion-Reaction (CDR) equation on a rectangular domain, using cylindrical coordinates and Finite Difference Methods (FDM) (this approximates a flow reactor). ...
1
vote
0answers
57 views

Stability question (finite difference): dealing with corner nodes

Consider one initial boundary value problem for sphere. $$\frac{\partial u}{\partial t}=\operatorname{div}A\nabla u +f$$ Here is explicit numerical scheme (we consider that it is stable): ...
2
votes
1answer
84 views

variational formulation

I would like to minimize: $$J = \int_{\Omega} \|\nabla u - \nabla g\|^2 + \lambda \|\frac{\partial u}{\partial t} + \nabla u.v||^2 ~\text{dx dy dt}$$ where $u(x,y,t)$ is the unknown function, the ...
4
votes
3answers
655 views

Conservation of Mass in 1D Advection-Diffusion Equation

My long-term goal is to numerically solve the 1D advection-diffusion equation of the form: $$\frac{\partial u}{\partial t}=\frac{\partial }{\partial x}\left( v(x,t) u+D\frac{\partial u}{\partial ...
2
votes
1answer
253 views

Partial derivatives of a 3D array in Matlab

I'm interested in taking some partial derivatives of a 3 dimensional array in Matlab - say $A(i,j,k)$ approximates $f(x_i,y_j,z_k)$. I need to approximate things like $\partial_{xy}f$, ...