# Questions tagged [finite-difference-method]

Tag for the usage of "FiniteDifference" Method embedded in NDSolve and implementation of finite difference method (fdm) in mathematica.

61 questions
Filter by
Sorted by
Tagged with
0answers
134 views

2answers
171 views

### Solving linear coupled PDEs by FDM

I am trying to solve some linear, coupled PDEs for perturbative analysis (first order in time, 3rd order in space), for which I then plan to take the global spatial maxima of their magnitudes and plot ...
1answer
216 views

### Solution of Burgers equation with some initial data

Consider the Burgers equation $$\partial_t u + \partial_x\left(u^2/2 \right) = 0, \quad u(0, x) = u_0(x).$$ eq = D[u[t, x], t] + D[u[t,x]^2/2, x] == 0 How ...
3answers
439 views

### New things and limitations in Version 12 numerical differential equation solver?

This question is intended to be a place to summarize users' exemplary experience in solving differential equation with the NDSolve family in MMA’s latest version 12....
2answers
384 views

2answers
304 views

### Why ODE's naive finite difference matrix works well for different boundary conditions

We know finite difference method (FDM) can replace $y''(x)$ as $\frac{1}{h^2}[y(x+h)+y(x-h)-2y(x)]$ or so. The naive way to write down the matrix of the differential operator is like the following, ...
0answers
323 views

### Derivative of list of points: DifferentiatorFilter versus DerivativeFilter

I need to calculate the derivative from a list of experimental points. Mathematica has two functions which seem to do this: DifferentiatorFilter and DerivativeFilter. Which one is better for ...
0answers
66 views

### Optimizing finding the offset diagonals for a 2D Finite Difference Method

It is possible to collapse a conventional 2D PDE (in our case the Schrödinger equation) into one dimension by having each set of points be taken as a one dimensional list of $n$ lattice points and the ...
1answer
287 views

### 2D inhomogeneous biharmonic equation with wedged edge

I'm solving bending of rectangular plate while, boundary conditions are I have found similar problem solved: datavoreconsulting.com/programming-tips/numerically-solving-pdes-mathematica-finite-...
0answers
406 views

### NDSolveFiniteDifferenceDerivative how does it work? [closed]

I'm referring to Paritosh Mokhasi's blog post, where he uses, along with some other things, the...let's call it a function (?)... NDSolveFiniteDifferenceDerivative. I was able to use it exactly the ...
0answers
192 views

### Solving nonlinear diffusion equation by NDSolve

I have checked all issues regarding to solving nonlinear PDE numerically. I however try to solve following equation via NDSolve function and get some troubles. And this is my code for above-...
2answers
152 views

### NDSolve problem

I am trying to solve numerically this differential equation s := NDSolve[{y''[x] + ω[x]*y[x] - 1/(y[x])^3 == 0, y == 1, y' == 0.3}, y, {x, 0, 10}] where <...
1answer
155 views

### Eigenvalues of 3D Laplacian on a spherical segment

To study the change in Laplacian eigenvalues on a spherical segment, I constructed a table of spherical segments using the code from here. I discretized the output using ...
0answers
120 views

### Coupled parabolic differential equations with time delay

Is it possible for NDSolve to solve delay partial differential equations with simple Neumann boundary conditions? An example I have is as below: ...
1answer
562 views

### Heat equation with nonlinear boundary condition involving time-derivative

The governing equation is shown as follows: I first try to employ the NDSolve, but it seems that Mathematica can not handle the fourth boundary condition. ...
3answers
303 views

### What is the best way to track the gradient to a local minimum?

Given a function of multiple variables, and some initial conditions, I would like an efficient way to track the gradient to the local minimum of that function. Two options spring to mind — to either ...
0answers
284 views

### Poisson equation with numerical right hand side

I run into the following problem. Linear Poisson equation works OK, eg, ...
1answer
283 views

### Laplace equation in a gapped rectangular domain with finite difference method

I have a situation that is shown by this picture: For this situation I have this code. ...
1answer
589 views

### Free Convective Heat Transfer of Non-Newtonian Power Law Fluids from a Vertical Plate

I am trying to solve a set of PDEs mentioned in this paper with NDSolve but facing quite a few issues. The PDE system is: ...
0answers
344 views

### Robin conditions using Finite Difference [closed]

I'm trying to solve the drift-diffusion equation $$\frac{\partial\rho}{\partial t} = \frac{\partial^2 \rho}{\partial x^2} + \frac{\partial \rho}{\partial x} \rho(x,t)$$ using a finite difference ...
1answer
215 views

### Why do I get this nonsensical result for NDSolve with a delay-differential-algebraic system?

I have the following delay-differential-algebraic system: \begin{align} c(t) =& \kappa\min (1, \tfrac{\beta}{\alpha} a(t)), \tag{1a}\\ a(t) =& \left\{ \begin{array}{lcl} \frac{\alpha}{\...
0answers
283 views

### FDM - Fluid Flow tutorial

I was reading a very nice post: http://blog.wolfram.com/2013/07/09/using-mathematica-to-simulate-and-visualize-fluid-flow-in-a-box/ But i am stuck for hours at the point where the author writes: <...
0answers
154 views

### Solving lengthy higher order pde using finite difference

I am attempting to solve a very massive pde (latex expression given below). I have done some work with finite difference before for relatively simple equations (like heat diffusion or the wave ...
2answers
508 views

### Updating a parameter each time step within a Finite Difference scheme?

So I am solving a PDE for a function $h(\theta,t)$ via finite difference scheme. The PDE has a function $Q$ in it, which I wish to update each time step depending on where $h$ lies. Firstly, let us ...
2answers
911 views

### Finite difference method not converging to correct steady state or conserving area?

I am working with the following PDE, which is an advection-diffusion type equation. It describes the movement of a fluid-fluid interface inside an annulus of inner radius $R_1$ and outer $R_2$ under ...
0answers
135 views

### Speeding up solving nonlinear Schroedinger equation in 3D with NDSolve with periodic boundary conditions

I have a question on speeding up solving nonlinear Schroedinger equation in 3D with NDSolve with periodic boundary conditions. I build the ODE system with NDSolve...
1answer
178 views

### Kernel crashes when computing finite difference mixed derivative with respect to y & z but works fine when computing with respect to x & y or x & z?

Bug introduced in 8.0.4 or earlier, fixed in 11.0.0. I am using Mathematica 10.4.0 on Ubuntu 16.04. I am trying to solve a set of differential equations using finite difference method on an NxNxN ...
1answer
512 views

### NDSolveFiniteDifferenceDerivative gives wrong result when the precision is not MachinePrecision

Bug introduced in 8 or earlier and persisting through 11.0.1 or later I want to get a pseudospectral differentiation matrix by NDSolveFiniteDifferenceDerivative. ...
1answer
307 views

### Finite Difference - heat generation in a square (square within a square)

I am trying to develop a code that will allow me to solve the following problem. Lets say that I have a square block, inside that square block I have a smaller square box thats at a certain ...
1answer
172 views

### FiniteDifferenceDerivative of complex function in 2D--bug?

I want to compute partial derivatives of complex functions via finite difference approximation on two dimensional grid using NDsolveFiniteDifferenceDerivative ...
1answer
741 views

### Partial differential equation, Finite difference Method

For my research project I am trying to solve following partial differential equation in Mathematica (V[r]*ψ[u, v])/4 + Derivative[1, 1][ψ][u, v] == 0 with ...
0answers
349 views

### How to derive finite-difference scheme automatically on a quite general stencil

Info This question is a generalization of the following one Derivation of numerical scheme for linear transport equation on a variable stencil. Statement of a problem Linear scalar hyperbolic (...
1answer
199 views

### Finite Difference equations - slow computations

The following code I have written runs very slow, in fact, so slow that it does not finish computation. ...
1answer
644 views

### How to vary finite difference approximation order in NDSolve at boundaries

According to here, NDSolve, when using the method of lines, creates partial derivatives in the spacial coordinate (lets talk just about one spacial coordinate for ...
1answer
336 views

### Poisson PDE in a rectangular domain

I found a solution for this problem, but this is in Scilab and I never use Scilab. Can anyone can help me to translate it in Mathematica? Here is the Link:http://imechanica.org/files/TorqueR.pdf I ...