# Questions tagged [finite-difference-method]

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

89 questions
Filter by
Sorted by
Tagged with
0answers
30 views

### Solving a system of nonlinear ODE error [closed]

I find out that when I'm trying to solve a system of nonlinear 2nd order ODE numerically with NDSolve with that code: ...
1answer
257 views

### Stable fluids code for electromagnetic mixture application

This code has been translated from the original Jos Stam code and improved with some Mathematica functions. It solves problem of viscous incompressible flow with electromagnetic force in a rectangle ...
0answers
38 views

### Defining general recurrence expression and extracting coefficient

I'm new to Mathematica and I wish to solve a difference equation which is defined by the relation: $y_{i-1}-2y_{i} +y_{i+1} = f(x_i,y_i),\\y_0 = a, y_n = b.$. Where $x_i$ is given for all $i$. I want ...
1answer
76 views

### How to calculate fractional differences of a timeseries?

I have a timeseries I am looking to transform with fractional differences per the following description: The idea being to retain the essence of stationarity of, say, a log transformed integer series ...
1answer
100 views

### Solving the Stefan Problem with WhenEvent

The formulation of the problem: I tried to solve it with MOL and the method of V.R. Voller: The script: ...
1answer
88 views

...
1answer
76 views

### Solving System of Equations

I want to solve a huge system of equations which is generated using the Finite-Difference-Method. The Problem with that system is that it is badly conditioned and so ...
3answers
502 views

### Time dependent Schrödinger equation in 2D

I have the following Schrödinger equation in $2D$: \begin{cases} \partial_t \Psi(x,t) = V(x,t) \Psi(x,t) \quad x \in [-10,10]^2\\ \Psi(x,0)=\exp( \frac{1}{2} (-x^2+y^2)) \end{cases} where the ...
2answers
209 views

2answers
294 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
437 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
507 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
747 views

2answers
398 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
921 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 ...