Skip to main content

Questions tagged [finite-difference]

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

3 votes
1 answer
769 views

Solving Poisson's Equation with Periodic Boundary Conditions

So, I've been attempting to design a simple solver for a problem of finding the gravitational potential of a system using Poisson's equation (let's call the potential phi, $\phi$). The goal is that I ...
TheAkashain's user avatar
2 votes
0 answers
111 views

Efficient heat diffusion implementation with varying coefficients

I have the following heat diffusion equation: \begin{alignat}{3} \partial_t u(t, \vec{x}) &= g(\vec{x})\Delta u(t,\vec{x}), &\quad& \vec{x} \in\Omega, \, t\in(0,\infty],\\ \partial_n u(t,\...
lightxbulb's user avatar
  • 2,267
3 votes
1 answer
391 views

Generalized eigenvalue problem for large, potentially ill-conditioned systems

Say that I have a generalized eigenvalue problem of the form $$Ax=\lambda Bx.$$ Using MATLAB, some naive ways that one may solve this is by either directly inverting $B$ then applying the ...
user45844's user avatar
1 vote
0 answers
79 views

Can I apply the product rule for the following finite difference discretization

I would like to know if the following discretization is correct. Here D is the dispersion, C is the concentration. Both D and C are varying with space. Here n+1 represents the unknown time level. I ...
Jaywalker's user avatar
1 vote
1 answer
107 views

Isolating decaying solutions to nonlinear second-order ode

I need to solve a nonlinear ODE of the form $$ \frac{d^2 y}{dx^2} + \frac{1}{x}\frac{dy}{dx}-\frac{1}{x^2}\sin(y)\cos(y)+\frac{2}{\alpha}\frac{\sin^2(y)}{x}-\sin(y)=0 $$ numerically, subject to the ...
Ali Shakir's user avatar
0 votes
0 answers
30 views

Parallel Block-Structured class abstraction for FDM

I’m currently developing a FDM/FVM (using contravariant coordinates) code using Fortran and Co-Arrays (SIMD, in general), and so far I have all sparse matrix (BiCGStab, working on AMG) solvers and ...
Kbzon's user avatar
  • 251
1 vote
1 answer
366 views

Crank Nicolson Method with closed boundary conditions

I want to simulate 1D diffusion with a constant diffusion coefficient using the Crank-Nicolson method. $$\frac{\partial u (x,t)}{\partial t} = D \frac{\partial^2 u(x,t)}{\partial x^2}.$$ I take an ...
Jbag1212's user avatar
  • 111
0 votes
1 answer
67 views

Oscillation in non-linear porous flow solved by finite difference

I am trying to solve numerically the flow of a gas through a porous, spherically symmetric body. The non-dimensional equations read: $$ \frac{\partial\rho}{\partial t}+\tau\frac{1}{r^2}\frac{\partial}{...
MaximeMaurice's user avatar
6 votes
1 answer
161 views

Numerical artefacts in solution of spherical heat equation using FDM

I was attempting to solve the diffusion equation for a solid sphere using a naive FDM scheme. The governing PDE for the scalar concentration field $u(r,t)$ is $$ u_t = r^{-2}(r^2 \alpha u_r)_r, \quad ...
IPribec's user avatar
  • 617
11 votes
1 answer
1k views

Is using iterative methods to solve a linear system always superior to inversing the matrix?

I have a silly question. Is it always more computationally efficient to use iterative methods to solve for some matrix $A$, $Ax=b$, where $x$ and $b$ change but $A$ stays constant, compared to ...
Touko Puro's user avatar
0 votes
1 answer
46 views

How to address the element face adjacent to boundaries when the finite difference method and marker-and-cell scheme are used to solve the Stokes flow?

The Stokes equations are $$-\Delta \mathbf u + \nabla p = f \text{, in }\Omega,$$ and $$ -\nabla \cdot \mathbf u = g, \text{ in } \Omega$$ where $\mathbf u = \left( u, v \right)$ is the flow ...
Tingchang Yin's user avatar
1 vote
1 answer
153 views

how to solve a coupled nonlinear partial differential equations(Boundary Value Problem)

So far, I have been looking into linear and nonlinear differential equations(Boundary value problem) that look like the following: $\frac{d^2 \theta}{dz^2} + \sin(\theta) = 0$ I am now familiar with ...
Hari Sam's user avatar
3 votes
0 answers
207 views

Python code of explicit method of a nonlinear a BVP

I am trying to have a Python code for the following nonlinear BVP: $$\frac{\partial N}{\partial t}=\frac{\partial^2 N}{\partial x^2}+N(1-N)-\sigma N$$ $$N(0,x)=\sin(2\pi x)$$ $$N(t,0)=0 \hspace{3mm}N(...
Peachy April's user avatar
1 vote
1 answer
77 views

Once Lyapunov exponents have converged, can they diverge again?

I know the strength of attraction for a single attractor might vary from place to place. Say, if I calculated the Lyapunov exponents for a small portion of the attractor and they have already ...
Axel Wang's user avatar
  • 197
2 votes
1 answer
118 views

How to numerically solve differential equations involving sines, cosines and inverses of the unknown function?

I'm very new to finite difference method and I am just introduced to methods of solving differential equation using finite difference method via sparse matrix method. I find that the main idea is to ...
Hari Sam's user avatar

15 30 50 per page
1
3 4
5
6 7
60