All Questions

Filter by
Sorted by
Tagged with
0
votes
1answer
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. ...
2
votes
1answer
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 ...
5
votes
1answer
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 ...
1
vote
0answers
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 ...
2
votes
1answer
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 ...
2
votes
0answers
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 ...
2
votes
2answers
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 ...
4
votes
2answers
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 ...
2
votes
1answer
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-...
29
votes
2answers
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 ...
2
votes
1answer
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: ...
10
votes
1answer
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 ...
3
votes
0answers
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 ...
2
votes
0answers
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 =...
0
votes
1answer
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 ...
3
votes
1answer
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 ...
11
votes
5answers
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 ...
6
votes
3answers
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 ...
0
votes
1answer
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 ...
0
votes
0answers
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) <...
9
votes
3answers
302 views

Integrating Lagrange polynomials with many nodes, round-off

Given a set of points $\{x_j\}_{j=1}^n$ in $[-1, 1]$, I would like to compute $$ \int_{-1}^{1} L_i(x)\,\text{d} x $$ exactly. $L_i$ is the Lagrange polynomial with respect to the points $x_j$ with $...
5
votes
2answers
2k views

Minimal surface solution in Python

Note: this question was also posted in StackOverflow and math.stackexchange. I have a set of 3D points defining a 3D contour, as shown below. The points in this contour lie in their best-fit plane ...
4
votes
3answers
140 views

Solving for a vector in a linear system that is both left and right multiplied

I have a linear system where I am given 2 matrices, $A$ and $B$, and 2 vectors, $v$ and $c$, and I need to solve for the vector $x$. $A$ is $n\times n$, $B$ is $n \times n \times n$, and the vectors $...
1
vote
0answers
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 ...
2
votes
1answer
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 (...
5
votes
1answer
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 (...
2
votes
1answer
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 ...
10
votes
3answers
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 ...
0
votes
1answer
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: ...
0
votes
1answer
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 ...
2
votes
1answer
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 ...
1
vote
0answers
24 views

Multibody Systems modeling disadvantages [closed]

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 ...
5
votes
1answer
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 ...
1
vote
0answers
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)$ \begin{equation} \partial_t\psi-\alpha(r)\partial_r\psi-\beta(r)^2\psi-f(t,r)=0 , \end{equation} where I am solving ...
1
vote
1answer
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 ...
0
votes
2answers
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. ...
4
votes
0answers
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 $$...
7
votes
3answers
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$ ...
-1
votes
1answer
180 views

Finite Element - Flux Calculation

I am solving an advection-diffusion equation using the FEM and am having trouble calculating my fluxes. I start with the equation, $$\frac{\partial n}{\partial t} = \frac{\partial j_{n}}{\partial x}\...
7
votes
1answer
545 views

Time discretization of the variational formulation of the Navier-Stokes equation

I've asked this question on mathoverflow too. Let $T>0$ $I:=(0,T]$ $d\in\mathbb N$ $\Lambda\subseteq\mathbb R^d$ be nonempty and open, $$\mathcal V:=\left\{\phi\in C_c^\infty(\Lambda,\mathbb R^d):...
1
vote
0answers
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 ...
0
votes
1answer
198 views

Proving solution existence and uniqueness of the Helmholtz equation with Robin boundary conditions with complex coefficients

I am trying to solve the Helmholtz equation with Robin boundary conditions with complex coefficients and the weak formulation $$ \iint_\limits\Omega\nabla p_0(x,y)\nabla\left(\overline{v(x,y)}\right)...
2
votes
0answers
56 views

How to reproduce the numerical examples in Prof. Saad's Book about Krylov subspace methods?

After reading Prof. Saad' Book, "Iterative methods for Sparse Linear Systems, 2nd version", I want to do the numerical examples about the Krylov subspace methods not only to reproduce the results in ...
2
votes
3answers
554 views

Finite volume piecewise linear 2D advection develops instability

I'm developing a finite volume solver for the simple twodimensional advection equation with constant velocities $u, v$ and constant mesh spaces $\Delta x$: $$ \frac{\partial \rho}{\partial t} + u \...
1
vote
1answer
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 ...
13
votes
1answer
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. ...
1
vote
0answers
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 ...
5
votes
1answer
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 ...
3
votes
1answer
50 views

Estimation of viscosity from critical properties

The above graph represents reduced viscosity as a function of reduced temperature for several values of the ...
3
votes
0answers
67 views

Large-scale optimization of nonlinear equations

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_{...

15 30 50 per page