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

learn more… | top users | synonyms

0
votes
0answers
11 views

Am I using cyclic reduction to parallelize this algorithm?

I am attempting to implement a modified anisotropic-diffusion filter on the GPU. The methodology I describe here including the equations and code listing are taken from this paper . The author of ...
2
votes
0answers
41 views

Laplacian discretization for parametric curves

I know how to compute the discrete Laplacian of a graph and of a mesh (the Laplace-Beltrami operator). Is there an analogous definition for the computation of the Laplacian of a parametric curve ? ...
5
votes
2answers
86 views

How to impose boundary conditions on eigenfunction problems?

I am trying to solve for the eigenfunctions of a (1D) differential operator using finite differences: $$A \, f(x) = \lambda f(x)$$ Here is an example in Python where $A = \partial_x^4$: ...
2
votes
1answer
42 views

Modified diffusion equation and unstabilities

I am trying to simulate the phase separation of a binary mixture. If the free energy F is known as a function of the concentration $c$, the dynamical equation is: $ \frac{\partial c(x,t)}{\partial ...
1
vote
0answers
76 views

eigs routine in octave

I am using octave and observed a problem with the eigs-routine for non symmetric matrices. Using GNU octave version 3.8.1 the code below gives significant difference of eigenvalues although same ...
0
votes
0answers
34 views

How to compute convergence rate for FVM in matlab?

I have implemented a finite volume scheme using Lax-Friedrichs flux and using Roe's linearization. I want to compute the order of convergence vs. the space-step $h$. I have computed a solution with a ...
0
votes
0answers
58 views

CFL condition and Lax-Friedrich numerical flux

I got confused when trying to implement a scheme using Lax-Friedrichs numerical flux for a system of equations in 1D. According to my notes Lax-Friedrichs numerical flux is $$f_{LF}(u_l,u_r) = ...
1
vote
1answer
59 views

methods for a peculiar BVP system

Consider the following system defined on the open interval (-1, 1): $y_1' = c y_3 \\ y_2' = c y_4 \\ y_3' = -f(y_1, y_2)y_2 \\ y_4' = f(y_1, y_2)y_1 $ given $ y_3(-1) = 0 = y_3(1) \\ ...
1
vote
1answer
47 views

Solving first-order ODE with Dirichlet b.c. using CDS -> singular matrix

I decided to solve using finite differences one of the simplest differential equations which has an analytic solution, notably $\frac{du(x)}{dx}=2x$. The equation is first-order ODE with quadratic ...
2
votes
0answers
41 views

2nd order differences for modelling a physically discrete phenomenon?

Consider the diffusion of some unknown $R$ on a physically discrete, 1-D ring: x---------x---------x---------x n = 0 1 2 3 We let ...
0
votes
1answer
73 views

Implement Robin Boundary Condition

This is a follow up to this question. I have a nonlinear BVP on $x=0$ to $L$: $$ (T^2)\frac{\partial^2 T}{\partial x^2} + T \left( \frac{\partial T}{\partial x}\right)^2 + Q = 0 $$ to which I apply a ...
3
votes
2answers
93 views

Neumann Boundary Condition at r=0 in Polar Coordinates (Numerical BCs)

I have asked a question in this regard earlier. I am trying to solve the following equation in Polar Co-ordinates: $$ u_t - (u_{rr} + \frac{1}{r} * u_r + \frac{1}{\theta} * u_{\theta\theta} + bu) = ...
0
votes
0answers
64 views

Finite Difference in Polar Co-ordinates

Background Please note that I am duplicating the question on scicomp. I have already asked this in math. I am trying to come up with a scheme in Polar Co-ordinates for the following PDE: PDE I am ...
2
votes
1answer
136 views

Solving a Nonlinear BVP using Finite Difference Method

I am trying to write a code to solve a nonlinear BVP using the Finite Difference Method. The BVP is: $(T^2)\frac{\partial^2 T}{\partial x^2} + T \left( \frac{\partial T}{\partial x}\right)^2 + Q = 0$ ...
0
votes
0answers
44 views

What is a reasonable manufactured solution to test finite difference method? [duplicate]

What is a reasonable manufactured solution to test the following equation against its finite difference approximation? I want it to look like a Cosine function about $0$, rotated about $Z$ axis ...
1
vote
1answer
82 views

Solve steady state reaction-diffusion/Helmholtz equation numerically

I am solving a problem of the form: $\frac{\partial u(x,y,t)}{\partial t} = \nabla^2 u(x,y,t) - f(x,y,t)u(x,y,t) - \kappa(x,y,t)$ At the moment, I am solving this at each time step by assuming a ...
1
vote
0answers
39 views

Finding a scalar field in order to generate a solenoidal vector from a given vector

I am working on generating a (complex) solenoidal vector field $\mathbf{A}$ from a prescribed (complex) vector $\mathbf{a}$ and the gradient of a scalar, $b$, such that $$\mathbf{A} = \mathbf{a} + ...
0
votes
1answer
87 views

Computing multiple numerical derivatives at once

Lets say I have a function $f(X) = f(x_1,...,x_N)$ to be integrated. But unlike time discrete methods, my integrator uses quantisation to advance time, that is if $|x - q| > dQ$, with $q$ being the ...
-1
votes
1answer
38 views

Can you give some information for rothe method [closed]

I want to learn a numerical method for PDEs other than finite difference method. After some research on internet i have found Rothe method and it looks interesting to me. Unfortunately, i couldn't ...
1
vote
3answers
110 views

Solve diffusion equation with linear source term

I would like to solve numerically the diffusion equation, where the sink term depends linearly on the field, and there is field-independent sink: $\frac{\partial^2 u(x)}{\partial x^2} =f(x)u(x) - ...
0
votes
2answers
80 views

Numerical Solution of non-linear diffusion equation using Finite Differencing

I'm trying to solve the following non-linear diffusion equation: $$ \frac{\partial}{\partial t} u(x,t)= \frac{\partial^{2}}{\partial x^{2}}u(x,t)^{3}$$ $$ -1\leq x \leq1, t \geq 0 $$ with the boundary ...
3
votes
1answer
112 views

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 ...
0
votes
1answer
83 views

Neumann boundary problem

I'm writing a solver for a differential equation with two neumann boundaries (u'(0)=u'(1)=0) and I can't figure out how to determine how to solve the problem. What will my boundaries be and how do I ...
2
votes
0answers
91 views

Finite Volume/difference scheme for 2d continuity equation

I am trying to solve the following 2D continuity equation on the rectangular domain [0,1]x[0,1] using the finite volume method. $\rho_t + \nabla \cdot (\rho v) = 0$ where the velocity $v =(v1,v2)$ is ...
-2
votes
1answer
102 views

explain the difference between 1D Poisson solvers

I compared 2 methods for 1 dimensional Poisson equation solution. One is finite-difference method, "Successive Overrelaxation" from http://www.cs.berkeley.edu/~demmel/cs267/lecture24/lecture24.html; ...
4
votes
2answers
192 views

How can I prove numerical diffusion in upwind scheme for transport equation

I was just implementing the upwind scheme for a linear transport equation $u_t + cu_x = 0$ where $c=0.5$ and I saw that the solution was indeed advected but over time it starts to diffuse. Can anyone ...
2
votes
2answers
73 views

Infinite Function Value on Dirichlet Boundary

I have been working on a multigrid solution to a non-homogeneous Dirichlet boundary value problem. However, the function goes to infinity on the boundary. This causes numerical overflow errors to be ...
3
votes
2answers
69 views

How does constraint resolution affect the stability/accuracy of numerical integration?

I understand some basic analysis techniques (local truncation error, global error, zero-stable, absolute stable, etc.) of numerical integration. But I find it hard to apply these techniques in ...
4
votes
2answers
317 views

Crank-Nicolson method for solving nonlinear parabolic PDEs

Is the Crank-Nicolson method appropriate for solving a system of nonlinear parabolic PDEs like $\partial u/\partial t - a\Delta u + u^4 = 0$ ? I tried to apply this method for solving such system but ...
2
votes
1answer
209 views

Finite differences scheme for 2D advection equation

I'm trying to study with a finite difference method the 2D advection equation with a space-dependant flow. Taking a function $f(x,y,t)$ solution of the equation : $$ ...
4
votes
1answer
78 views

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 ...
3
votes
1answer
102 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$ ...
2
votes
0answers
85 views

2D Neumann Conditions on Irregular Domain

I would like to model the 2D diffusion equation with Neumann BC's inside the following egg-shaped domain: I would like to use the finite difference method with the discretization implied by the ...
3
votes
1answer
125 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$ ...
0
votes
1answer
130 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
161 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
110 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
98 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
128 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
199 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
125 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
73 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
377 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
291 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
180 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
231 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
75 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 ...
2
votes
1answer
448 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
260 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
112 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 ...