# Questions tagged [finite-difference-method]

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

107 questions
Filter by
Sorted by
Tagged with
358 views

### Numerical solution for a non-linear Fractional Differential Equation (FDE)

As shown below, a neat explicit expression is obtained for F=2, however an exact solution is not present for 1< F < 2. How do we obtain numerical values for F = 1.5 (for instance)? There have ...
• 3,036
45 views

### Two small problems on the FiniteDifferenceDerivative in the tutorial?

In the tutorial for FiniteDifferenceDerivative of pseudospectral approximation, there is a nice example. I just show a snapshot The following line should define $11$ discrete wavenumbers over a ...
250 views

### Error in Attempting Moving Boundary Fluid System

Recently I was attempting to solve a moving boundary fluid system on mathematica, which I have managed to convert into a coupled PDE-ODE system based on this helpful reference over here. The equations ...
• 173
52 views

### How to use Manipulate for Finite Differences

I want to improve my code using the command Manipulate and being able to see the calculus of averages as the indexes l and u are moved. I did a simple example of a 4x4 matrix with the boundary ...
93 views

### Is it possible to solve a differential equation with a user-defined variable mesh in NDSolve?

For some differential equations, its solution may evolve to a cusp, for example, singular behavior. One may want to introduce additional mesh points near the cusp to accurately follow the solution ...
113 views

### Mathematica doesn't solve linear system of equations that emerges from finite difference method [closed]

I want to solve the ODE $$u''(x)+u(x)=e^{-x^2}$$ $$u(0)=u(10)=0$$ using finite difference method. I divide the interval $[0,10]$ uniformly by $x_i=0+ih$ using step size $h=\frac{10}{11}$. By ... 92 views

### Solving for Coefficients in a System of Linear Equations Using Mathematica

I'm currently using Matlab to solve a two-dimensional PDE in a rectangular domain using finite differences. Without going into too much detail (although I'd be happy to if necessary), I have the ...
• 221
373 views

### 3D stable fluids algorithm to simulate transition from laminar to turbulent flow

This algorithm is 3D extension of our 2D algorithm published on this page and here. We suppose that with this code we can simulate transition from laminar to turbulent flow. In this example we compute ...
• 35.3k
605 views

### Numerical solutions of active 1D wave equations

I would like to solve the following PDE with finite difference method. The PDE is from the following paper, (https://arxiv.org/pdf/1911.11823.pdf). I would like to implement the algorithm for the left ...
• 61
162 views

### Finite difference method for solving coupled differential equations

I am trying to solve the following coupled differential equations: $\dot{c}_{1}(t)=-\int_0^t \alpha_{1}(t,s)c_{1}(s)+\beta_{1}(t,s)c_{2}(s)\,ds-\frac{i}{\hbar}\lambda c_2(t)e^{+i(\omega_1-\omega_2) t}$...
35 views

### Mean error of finite differences derivative

I wrote a module that computes the 4-th order finite difference derivative of a function at $N$ equidistant points of an interval and the difference between the exact and numerical value at those ...
• 199
28 views

### NDSolve SetDelayed error

I'm trying to calculate the first derivative of a function at a number of points using the 4-th order finite difference matrix, and then multiplying it with the function values at that point. I wrote ...
• 199
142 views

### How to solve Coupled a Parabolic and Elliptic PDE in NDSolve?

I want to solve a mixed PDE Parabolic-Elliptic system in 3-dimension (rectangular coordinate), as shown below: The respective code version with parameters value, boundary and initial conditions is, <...
• 1,120
422 views

• 401
1 vote
86 views

### How do I code an L2 Norm for a Finite Difference Scheme?

I have to compute the L2 norm of a Finite Difference Scheme applied to a second order differential equation. I set up the code to perform the Scheme with n = 20 and n = 200, and my input is ...
• 25