All Questions

8,385 questions
Filter by
Sorted by
Tagged with
96 views

Numerov method for Schrodinger equation

While learning about numerical methods for solving the Schrödinger equation I came across Numerov's method. I want to get the solution for the harmonic oscillator by alreading giving the eigenvalues. ...
56 views

Testing a block tridiagonal system of equations

In 1D problems, tridiagonal systems of equations are obtained when we use finite-difference or finite-volumes in a structured mesh. A wide solver is the TDMA algorithm here. In two-dimensional ...
488 views

Finite volume a posteriori error estimation

I'm wondering what alternatives there are to a grid convergence study to judge solution accuracy for a given grid resolution when doing steady-state RANS simulations on an automatically generated ...
1k views

Finding eigenvectors and eigenvalues of large matrices in Python's numpy

I am running a PCA analysis on a data set using Python's (v2.7.10) NumPy. I validated that my program works by running the PCA analysis on a smaller dataset and then confirming that I get similar ...
2k views

2D cross section from 3D surface

I am trying to apply the "restoring force surface" method to a dynamic linear system. The idea behind this method is that, knowing acceleration, displacement, velocity and input force it is possible ...
61 views

Nodal and Element Equilibrium in FEM Solution

I am learning FEM from KJ Bathe's textbook and it is mentioned that for a general FEM solution, nodal and element equilibrium is satisfied. The explanation takes steps that I don't understand. At ...
101 views

What is an efficient way to calculate zeros of Bessel functions?

One approach is the brute force method of evaluating at all points at fixed intervals and when it nears zero write value, this can be combined with adaptive step size. Another approach is ...
1k views

implementing higher order derivatives for finite element

I am implementing higher order derivatives for FEM. Example, to solve a Poisson problem, biharmonic or triharmonic PDE one needs first, second or third order derivatives respectively. As usually ...
55 views

Numerical Solution to Rayleigh Plesset Equation in Python

I have been trying to numerically solve the Rayleigh-Plesset equation for a sonoluminescence bubble in Python. You can read about this phenomenon here: https://iopscience.iop.org/article/10.1088/0143-...
3k views

What does “symplectic” mean in reference to numerical integrators, and does SciPy's odeint use them?

In this comment I wrote: ...default SciPy integrator, which I'm assuming only uses symplectic methods. in which I am refering to SciPy's odeint, which uses ...
71 views

Activation function with special conditions in machine learning

I only have a basic understanding of deep learning, but looking through it I had an idea on how to approximate global minima of the NN. However, for it's activation function I am only able to use: ...
360 views

DG local equation, how to interpret mean-averaged test function

In the paper http://www.sciencedirect.com/science/article/pii/S0045782509003521, an HDG element-local equation is described on page 584 equation (4), with one of the equations taking the following ...
96 views

What is the fastest algorithm for computing log determinant of a PSD matrix? (All possible PSD matrices)

I am diving into some literature to understand which is the best algorithm for computing the log-determinant of a PSD matrix. More generally, I am interested in a list of resources to read, which ...
55 views

References to solve system of differential equations which describe the evolution of sandpile surface using the finite element method

I want to solve the following nonlinear system in 1D \begin{cases} \dot{R} + v \frac{\partial R }{\partial x} - \frac{\partial }{\partial x}\left( D \frac{\partial R }{\partial x} \right) -\Gamma =...
64 views

Shooting Method- Boundary value problem starting from -1 to 1

The equation is $\rho \frac{d \bar{u}}{dy} = -\frac{d\bar{p}}{dx} + \mu\frac{d^2\bar{u}}{dy^2}$ with boundary condition $u(-1)=0$ and $u(1)=1$ I am to solve it using fifth order runge-kutta ...
75 views

Numerical solution of zero-potential time-dependent Schrödinger equation in 1D

I want to solve numerically the one-dimensional time-dependent Schrödinger equation $$i \psi_t(x,t)=-\frac{\hbar}{2m} \psi''(x,t)$$ My issue is that I don't have the physical background to understand ...
2k views

Numerical derivative and finite difference coefficients: any update of the Fornberg method?

When one want to compute numerical derivatives, the method presented by Bengt Fornberg here (and reported here) is very convenient (both precise and simple to implement). As the original paper date ...
5k views

Poisson equation finite-difference with pure Neumann boundary conditions

I'm trying to solve a 1D Poisson equation with pure Neumann boundary conditions. I've found many discussions of this problem, e.g. 1) Poisson equation with Neumann boundary conditions 2) Writing the ...
84 views

Solution of thermal analysis using finite element

I want to solve a thermal analysis using finite elements. The governing equation is $$C \frac{dT}{dt}+K T = Q$$. When using backward differencing for time, the resulting equation is quite straight ...
138 views

Ising model simulation offset critical temperature and interal ernergy

I'm writing a code for the Ising model using WHAM (the weighted histogram analysis method)，But it seems to produce critical temperature and internal energy wrong. (newest rewritten code is below) <...
302 views

41 views

How to compute the computational cost and storage of the Full Orthogonalization Method?

About the analysis of Full Orthogonalization Method (FOM) in Prof. Saad's book, wrote as follows: Algorithm 6.4 (FOM): \begin{array}{l} r_0=b-Ax_0,\beta=\|r_0\|_2,v_1 = r_0/\beta\\ Define \quad H_m ...
61 views

How to divide points on a 3D complex surface into two regions based on a closed curve defined on this surface?

My problem seems simple but I can't find an algorithm that will do that for me for any 3D complex surface. I have a really complex shape 3D surface and a closed curve on it defined by some points (...
75 views

How do I globally change the precision of a piece of code in Python to debug it?

I am solving a system of non-linear equations using the Newton-Raphson method in Python. This involves using the solve(Ax,b) function (...
666 views

Local truncation error of Dufort Frankel Scheme

The scheme is given by $$\frac{v_m^{n+1}-v_m^{n-1}}{2k} + b\frac{v_m^{n+1}+v_m^{n-1}-v_{m-1}^n-v_{m+1}^n}{h^2} = 0$$ where $v_m^n$ is the numerical solution at the $m^\text{th}$ spatial coordinate ...
326 views

Should benchmarkings be done at all? What is the point?

I am reading a paper which compares algorithm A versus algorithm B. It shows that algorithm A is faster than algorithm B via benchmarking that shows the CPU time. What is the point of this? Any ...
124 views

Elliptic PDE finite volume method with Dirichlet boundary condition

I want to discretize the following equation using a Finite Volume Method $$\nabla \cdot (a(x)\nabla u)=f(x)\\x\in \Omega \subset \mathbb{R}^2 \\u_{|\partial\Omega}=g$$ I'm using Voronoi cells here: ...
227 views

How to make a less diffusive code to solve 2D advection equation?

I would like to solve the following differential equation numerically in 2D, $$\frac{\partial z^-}{\partial t}+(\vec{B}\cdot\vec{\nabla})z^-=0,$$ see Wikipedia if you are curious about what the ...
135 views

Incorporating a potential barrier in a wave-packet simulation (Fourier Transform method)

I'm trying to simulate the scattering of a wave-packet at a potential barrier in Python. I'm using a Fourier Transform method (not sure if its the same as the Split-Step method), where I apply Fourier ...
24 views

Multibody Systems modeling is a very systematic approach usually results in large sparse Jacbian matrix. I am working to model a system consisting of 11 bodies and 63 constraint equations as soon as i ...
108 views

Block-matrix: optimal fill-in reduction for LU factorization

Consider a square $N \times N$ block-matrix $\mathbf{A}$, where each $n \times n$ block $\mathbf{A}_{ii}$ is either a dense block or a zero-block. So, $N$ denotes the number of blocks, $n$ denotes the ...
53 views

Stably solve transport equation with source term

I am trying to solve a transport equation of the form for the variable $\psi(t,r)$ $$\partial_t\psi-\alpha(r)\partial_r\psi-\beta(r)^2\psi-f(t,r)=0 ,$$ where I am solving ...
117 views

How suitable is multigrid method for time-dependent PDEs?

For elliptic PDEs (Poisson-type), the multigrid method is very sufficient, but how about time-dependent problems (i.e parabolic or hyperbolic PDEs)? Is it efficient to solve such problems using a ...
284 views

Boundary conditions for streamlines in enclosed flow

I am trying to solve Lid driven square cavity flow problem of Stokes equation using finite element method. I have boundary conditions for velocity as zeros on every boundary but u=1 on top boundary. ...
39 views

Nonlinear least squares optimized Jacobian calculation

I have a nonlinear least squares problem, in which I am trying to minimize residuals which can be divided into four classes: $$\min_x ||\epsilon(x)||^2 + ||\xi(x)||^2 + ||\delta(x)||^2 + ||s(x)||^2$$...
889 views

Nearest positive semidefinite matrix to a symmetric matrix in the spectral norm

So I have a symmetric matrix $A$ and I would like to solve the optimization problem, $$\hspace{2.5mm}\text{Minimize}\;\; \|A-S\|_2$$ $$\hspace{-5mm}\text{Subject to}\;\; S\geq0.$$ $A$ is given and $S$ ...
180 views

23 views

How to simulate a PDF using data samples like this?

I know two methods to simulate a PDF from random data samples using MATLAB : 1) Using a histogram where I use this command histogram(data,'Normalization','pdf'), it gives PDF like bins. 2) Another ...
198 views

85 views

Numerical bottlenecks

On a desktop scale computer, what are the most important bottlenecks (RAM vs. CPU, single vs. multithread) for numerical calculations? I'm specifically most interested in exact diagonalization and ...
313 views

What are the major differences between GMRES and FOM?

I am reading Professor Saad's "Iterative Methods for Sparse Linear Systems" (2nd edition). The basic algorithm for FOM is given on page 166 and the basic algorithm for GMRES is given on page 172. ...
78 views

Immersed boundary method in FEniCS?

I have looked at the FEniCS tutorials and documentation but I cannot find any mention to the possibility of implementing an immersed boundary method (IBM) for fluid dynamics. In particular, I want ...
461 views

Why MATLAB chooses the Householder in its built-in function gmres.m?

Recently, I have studied how to construct an orthonormal basis for Krylov subspace to solve $Ax=b$, where $A\in \mathbb{R}^{n\times n}$ is nonsingular. As we know, there are usually 4 ways to ...
I'm looking to find a computationally efficient solution to a large system of nonlinear equations. I'm trying to maximize the following function:  f(\vec{x}) = \sum_i^N C_i (x_i-A_i)x_i^{\epsilon_{...