Questions tagged [numerics]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
37 views

Intel MKL results differ depending on the underlying hardware architecture [closed]

I think this is a well known problem that when using MKL_CBWR=AUTO, the results may differ across different hardware architecture due to the floating point ...
1 vote
1 answer
57 views

Monotonicity of Errors with Respect to Step Sizes in Numerical Methods for PDEs

Consider a non-linear partial differential equation (PDE) (e.g., Burgers' equation) that is solved numerically using a finite difference method (or a similar approach). Suppose a grid search is ...
1 vote
0 answers
38 views

Using of elastic tangent for structural nonlinear solver

I noticed that some finite element programs, such as Plaxis, do not require the constitutive law to return the consistent tangent, but elastic tangent seems to be sufficient. In my experience, using ...
1 vote
1 answer
111 views

Different Results for Double Pendulum

In this study, (Hidden Fractals in the Dynamics of the Compound Double Pendulum) the authors provide various fliptime fractals (of a double pendulum) for different length combinations. However, when I ...
0 votes
0 answers
45 views

Calculating a 2D Ewald sum for a multipolar expansion

I am attempting to calculate the potential of a particle at the center of an infinite two-dimensional lattice as per the following reference: Reference: Lambin, PH & Senet, P. Ewald Summation of ...
6 votes
2 answers
941 views

Implementation of Monte-Carlo Integration

After reading the Wikipedia page for Monte-Carlo integration, I have understood the basic idea but I am having trouble implementing it for a general case. The integration that I am trying to do is $$ \...
3 votes
1 answer
150 views

Numerical calculation of the Berry connection

I'm doing some numerical calculations involving Hermitian matrices, and derivatives of the eigenvectors. Essentially, I have an n x n, Hermitian matrix H(x), which is dependent on some continuous ...
2 votes
1 answer
70 views

Computing the Fiedler vector of a large, sparse graph

I have a sparse, undirected and unweighted graph $G$ of size $n$, with $n$ on the order of say several million. I would like to compute the Fiedler vector $f$ of $G$, which is the eigenvector ...
2 votes
1 answer
234 views

Why do we use modified pressure in incompressible multiphase solvers with gravity?

The context of my question is two-phase incompressible solvers such as interFoam in OpenFOAM, but I have seen this trick used ...
0 votes
0 answers
24 views

Help in solving Quintessential scalar field using Steep Potential in cosmology

I am attempting to solve the differential equation $\ddot\phi + 3H\dot\phi + \dfrac{dV}{d\phi} = 0.$ For $V(\phi) = V_{0}e^{-\lambda\phi}$, where $V_{0} = 0.7$, $\lambda = 0.1$ and $V'(\phi) = \dfrac{...
2 votes
1 answer
98 views

From Runge-Kutta Butcher tableau to general linear methods matrices?

I am trying to understand how the relationship between Butcher tables for Runge-Kutta methods and their generalization to general linear methods matrices (by Butcher also). Runge-Kutta methods can be ...
1 vote
1 answer
106 views

Numerical method for space fractional derivative in 1 dimension

I am very new to the subject of fractional derivatives which arise while characterizing the anomalous transport of passive scalar in turbulence. I have found an equation of the following form, to ...
0 votes
0 answers
67 views

Best transform of matrix to make it efficient for shift-then-invert?

I am using ARPACK to find the smallest eigenvalue of a matrix. I use the shift and invert method. That is, looking for the largest eigenvalue of $$ (A-\sigma I)^{-1}. $$ However, I do not know $\sigma$...
0 votes
0 answers
52 views

Prof A. Stanoyevitch's finite difference based PDE matlab code

Where can one find Prof A. Stanoyevitch's finite difference based PDE matlab code? They have a book on such a topic but can't find the accompanying code. Is it well received? It's not commonly talked ...
1 vote
0 answers
71 views

Stability of 4-bit matrix multiplication

To use newer accelerators like this, I need to perform matmul in 4-bit precision. How do I tell whether this operation is stable? Wondering if there well common heuristics in terms of properties of ...
4 votes
0 answers
189 views

Why for $A^T A$, it is faster to computer the eigenvalues of its inverse than itself?

I have written the following code in MATLAB. I also observe the same effect in Arnoldi iteration in ARPACK in C. ...
20 votes
9 answers
4k views

C, Julia, Python, Maxima, Mathematica, ChatGPT and numerical errors

I am completely stunned how numerical errors can diverge for so innocent programs. In Python 3.11.7 the program ...
0 votes
1 answer
108 views

Discretization of generalized kinetic term in 2D Poisson partial differential equation

A typical 2D Poisson PDE is given as $$\nabla^2\varphi(x, y)=f(x, y)$$ where the Laplacian term, $\nabla^2\varphi$, can to some degree be interpreted as the kinetic energy (given proper scaling) (...
1 vote
0 answers
70 views

Ways to speed up Lanczos algorithm when we have a very dense cluster of many eigenvalues?

Lanczos algorithm can be used to find the largest/smallest eigenvalues of matrices. I am trying to find a good library in C/C++/Rust for finding the smallest singular value (or eigenvalue). I have ...
0 votes
1 answer
89 views

Prof Lawrence Shampine's hpde matlab code

Where can one find Prof Lawrence Shampine's hpde matlab code? Is it well received? It's not commonly talked about.
3 votes
1 answer
273 views

How to evaluate the points near/at the boundary when using Richardson extrapolation for improved accuracy of a derivative

If we want to improve the accuracy of our numerical estimation of a derivative, we can use Richardson extrapolation. The method is very beneficial when using a centered difference scheme and the ...
0 votes
1 answer
69 views

Why using large bound to supplement inifinity in interior point method can be bad

Here in the documentation of mosek (https://docs.mosek.com/latest/pythonfusion/debugging-numerical.html) we see: Never use a very large number as replacement for infinity . Instead define the ...
2 votes
2 answers
108 views

Gradient descent for solving polynomial equations while encouraging variables to be nonzero

I would like to use gradient descent to "randomly sample" solutions to a set of homogeneous polynomial equations. Because the equations are homogeneous, setting all variables to 0 is a valid ...
13 votes
8 answers
3k views

Real-world applications of eigendecomposition?

Cross-posted on Math.SE Are there real-world applications that call specifically for eigenvalues rather than singular values? I often see eigendecomposition used as "poor-man's SVD" For ...
1 vote
1 answer
88 views

How can you calculate catastrophic cancellation error?

I'm trying to follow the wikipedia page about catastrophic cancellation but I've hit something that just doesn't make sense to me. They say that subtraction can amplify existing approximation errors (...
1 vote
1 answer
115 views

Best finite difference scheme in 2D for the mixed derivative

The are good methods to deduce finite difference schemes for derivatives of functions of one variable. But how to get a good one for the mixed derivative of a function of two variables $u=u(x,y)$, ...
0 votes
0 answers
42 views

2nd-order backward difference approximation for temporal terms of Euler–Bernoulli beam

I am trying to solve the Euler–Bernoulli beam numerically in structural dynamics analysis: $$\frac{\partial^2w(x,t)}{\partial t^2}= \frac {q(x,t)}{\mu(x)}-\frac {1}{\mu(x)}\frac {\partial^2}{\partial ...
2 votes
2 answers
153 views

How to design a sin and an arcsin function such that arcsin(sin(x))=x, where x is a finite precision floating point number

As commonly known for programming on computer, if x is a finite precision floating-point number such as double/float in C language, arcsin(sin(x)) is usually not equal to x due to the numerical issue. ...
0 votes
0 answers
36 views

Numerical Divergence of a Tensor Field in Spherical Coordinates

I want to calculate the divergence of a rank-2 tensor field $$\nabla \cdot T$$ defined on the surface of a sphere in spherical coordinates. As an example, let the field be given as follows : ...
0 votes
1 answer
84 views

shooting method to compute the interface shape

I am trying to use a shooting method to compute the shape of liquid-gas interface given by the following differential equation: $$ \frac{d^2 \theta}{ds^2} = \frac{f(\theta)}{h(h + 3\lambda)} $$ with $\...
-1 votes
1 answer
105 views

What is the name of the theory that combines 3d discretized surfaces and distributed numerical algebra

I've looked into distributed numerical computation work before, but I've realized that 3D applications are all about 3d surfaces and meshes.So I'd like to look into related work on mesh and parallel ...
0 votes
0 answers
34 views

Order of Error - Confusion: Clarifying Constraints on Constants and Determining Order of Error

I'm struggling to determine the order of error when considering the error value denoted by $\text{err}$ in relation to the variable $h$. Specifically, I aim to ascertain the value of $x$ in the ...
1 vote
0 answers
55 views

Finite volume method for a general flux

How to approximate flux 𝐹(𝑢)⋅𝑛 where 𝑛 denotes the unit normal outward when using finite volumes? in my case it's not a conservation law so my question is how can we approximate the final term \...
2 votes
0 answers
57 views

Why the following discrete inequality are equal?

When reviewing papers on the numerical solutions of Partial Differential Equations (PDEs), I observed the following equation: $$ (1-C\tau)||\theta^n||^2 \leq ||\theta^{n-1}||^2 + C\tau (h^{2r+2}), $$ ...
1 vote
1 answer
161 views

How to approximate the flux when using finite volumes?

How to approximate flux $F(u)\cdot n$ where $n$ denotes the unit normal outward when using finite volumes? $$\int_{\sigma} F(u) \cdot \boldsymbol{n}_{K, \sigma} \mathrm{d} \gamma(x)$$
0 votes
0 answers
37 views

Convergence of Modified Crank-Nicolson Scheme

I'm dealing with a particular reaction-diffusion equation having the form $$ c_t = \alpha \nabla^2 c + F(c,x,t). \tag{1}$$ where $F$ is nonlinear. I would like to solve (1) with a finite-difference ...
4 votes
1 answer
135 views

Burger's equation (PDE) does not work with downwind difference?

I'm working on implementing the discretised Burger's equation. I am quite confused as to why it does not work when using a step-function and downwind difference formula. When using a step-function and ...
0 votes
0 answers
97 views

Solving a steady-state PDE

I'm working on trying to solve a steady state PDE in python and I am quite new to python and I am slightly confused on the implementation details. I have an example implementation of solving a non-...
0 votes
1 answer
63 views

How to use a custom OdeSolver in Scipy's solve_ivp

In Scipy's solve_ivp documentation, we see the method argument can be either a string or a user-defined ...
3 votes
1 answer
273 views

Finite difference problem

I have a problem to resolve with the Finite Difference method in $[a,b]$: $$-\frac{d}{dx}(\alpha(x)\frac{du}{dx})= g(x),$$ with $\alpha(x) \in L^{\infty}$ continuous in $]a,c[$ and $]c,b[$ and ...
8 votes
1 answer
221 views

Accurate computation of logbinomial(x,y)

I need to compute the logarithm of the binomial coefficient, $$\log\binom{x}{y} = -\log\mathrm{B}(y + 1, x - y + 1) - \log(x + 1)$$ accurately, where $\mathrm{B}(x,y)$ is the Beta function. I'm aware ...
1 vote
1 answer
207 views

Differential equation for radioactive cooling in fortran

Today I'm trying to evaluate this differential equation for internal energy in a gas in Fortran: $$ \frac{du}{dt} = - \frac{n_H^2}{\rho}\frac{\Lambda}{n_H^2} $$ Where nH is the density of hydrogen in ...
1 vote
1 answer
77 views

Does anyone know how to add a forcing term at the center of a cicular membrane?

I am here once again searching for wisdom, as some of you might notice I asked a related question a few days ago. And now I am struggling to add a forcing term at the center of the membrane, in order ...
2 votes
0 answers
78 views

Numerical integration in Fourier space over 3D grid

I am attempting to implement a model outlined in this paper: General magnetostatic shape–shape interactions Background This model allows the calculation of magnetostatic interaction energies between ...
1 vote
1 answer
89 views

enough conditions to check that a matrix doesn't have Cholesky factorization while factorizing it

I wrote this code to find Cholesky factorization of a symmetric positive definite matrix in MatLab: ...
0 votes
1 answer
60 views

Local truncation error of given implicit 1-step scheme

I'm given the 1-step implicit scheme $$y_{n+1} = y_n + \frac{h}{6}[4f(t_n, y_n) + 2f(t_{n+1}, y_{n+1}) + hf'(t_n, y_n)],$$ where $y'(t) = f(t, y)$, and I'm seeking the scheme's local truncation error. ...
0 votes
1 answer
201 views

Problems on the algebraic theory of sparse matrices

I have finished testing basic large densely parallel matrix multiplication on 4 gpu's ,and have done work on TSLU and TSQR on cpu's based on mpi. I am going to continue working on the theory of ...
0 votes
1 answer
173 views

Solving the wave equation for a circular membrane in polar cordinates

As you see this mode is not right, unless for what i understand And the initial conditions were ...
2 votes
0 answers
67 views

Efficient Algorithm for LU-Factorization of Modified Matrix with Last Column Alteration If We Have Its Not-Modified LU-Factorization

Suppose that we have a $n\times n$ matrix $A$. We have its LU-factorization as $A=LU$ (or $PA=LU$ that $P$ is a permutation matrix). Now assume we change the last column of matrix $A$ and denote the ...
3 votes
0 answers
193 views

Most promising reduced order modeling method

Many players in the field of engineering simulation software are investing on digital twinning and reduced order modeling techniques, meaning that the field bears potential. I was wondering if among ...

1
2 3 4 5
22