Questions tagged [numerics]
The numerics tag has no usage guidance.
1,091
questions
41
votes
4
answers
2k
views
Scientific standards for numerical errors
In my field of research the specification of experimental errors is commonly accepted and publications which fail to provide them are highly criticized. At the same time I often find that results of ...
41
votes
3
answers
5k
views
What's the state of the art in parallel ODE methods?
I'm currently looking into parallel methods for ODE integration. There is a lot of new and old literature out there describing a wide range of approaches, but I haven't found any recent surveys or ...
30
votes
4
answers
8k
views
Is half precision supported by modern architecture?
I am new to computer science and I was wondering whether half precision is supported by modern architecture in the same way as single or double precision is. I thought the 2008 revision of IEEE-754 ...
28
votes
3
answers
4k
views
What's the state-of-the-art in highly oscillatory integral computation?
What's the state-of-the-art in the approximation of highly oscillatory integrals in both one dimension and higher dimensions to arbitrary precision?
25
votes
1
answer
10k
views
What are differences between 'a priori' and 'posteriori' error estimate in numerical analysis?
I have learnt about Finite Element Method (also a little on other numerical methods) but I don't know what are exactly definition of these two errors and differences between them?
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
...
19
votes
3
answers
3k
views
Why do we usually not want the eigenvalues of non-symmetric matrices?
I came across this line in a class note I am reading where it discusses finding eigenvalues of matrices.
In reality we don't go all the way with Arnoldi. We stop at a decent value of 𝑘. Then the 𝑘 ...
19
votes
1
answer
534
views
Catastrophic cancellation in logsum
I'm trying to implement the following function in double-precision floating point with low relative error:
$$\mathrm{logsum}(x,y) = \log(\exp(x) + \exp(y))$$
This is used extensively in statistical ...
18
votes
3
answers
10k
views
Efficient computation of the matrix square root inverse
A common problem in statistics is computing the square root inverse of a symmetric positive definite matrix. What would be the most efficient way of computing this?
I came across some literature (...
18
votes
1
answer
2k
views
How to Run MPI-3.0 in shared memory mode like OpenMP
I am parallelizing code to numerically solve a 5 Dimensional population balance model. Currently I have a very good MPICH2 parallelized code in FORTRAN but as we increase parameter values the arrays ...
17
votes
1
answer
17k
views
How should boundary conditions be applied when using finite-volume method?
Following from my previous question I am trying to apply boundary conditions to this non-uniform finite volume mesh,
I would like to apply a Robin type boundary condition to the l.h.s. of the domain (...
17
votes
1
answer
1k
views
How do you debug numerical code, what could be source of this oscillatory error?
Quiet a lot of insight can be gained form experience, I was just wondering if anybody has seen something similar to this before. The plot shows the initial condition (green) for the advection-...
16
votes
2
answers
3k
views
Is it possible to solve nonlinear PDEs without using Newton-Raphson iteration?
I am trying to understand some results and would appreciate some general comments on tackling nonlinear problems.
Fisher's equation (a nonlinear reaction-diffusion PDE),
$$
u_t = du_{xx} + \beta u ...
15
votes
1
answer
6k
views
How to avoid catastrophic cancellation in python function?
I am having trouble implementing a function numerically. It suffers from the fact that at large input values the result is a very large number times a very small number. I am not sure if catastrophic ...
15
votes
1
answer
661
views
Puzzling remark about stability region of fifth-order Runge-Kutta method
I came across a puzzling remark in the paper
P. J. van der Houwen, The development of Runge-Kutta methods for partial differential equations, Appl. Num. Math. 20:261, 1996
On lines 8ff on page 264, ...
15
votes
4
answers
1k
views
Optimal ODE method for fixed number of RHS evaluations
In practice, the runtime of numerically solving an IVP
$$
\dot{x}(t) = f(t, x(t)) \quad \text{ for } t \in [t_0, t_1]
$$
$$
x(t_0) = x_0
$$
is often dominated by the duration of evaluating the right-...
15
votes
3
answers
650
views
Scientific Programming Contests
I regularly compete in so called "Programming Contests", where you solve difficult algorithmic problems with your own code and problem solving skills during a limited time-frame. For referential ...
14
votes
5
answers
7k
views
Scientific computing vs numerical analysis
I'm a double major in computer science and mathematics. I love both subjects. I'm thinking in taking a graduate career, perhaps in scientific computing. What's the real difference between scientific ...
14
votes
1
answer
2k
views
Conserving Energy in Physics Simulation with imperfect Numerical Solver
I am creating a C++ Physics Simulation where I need to move an rigid body through an acting force field.
Problem: simulation does not conserve energy.
Quesiton: abstractly, how is conservation of ...
14
votes
3
answers
2k
views
Why aren't Krylov subspace methods popular in the Machine Learning community compared to Gradient Descent?
Historically, iterative methods for solving relatively simple-structured systems $Ax=b$ with $A$ being a $4\times 4$ matrix or to find the eigenvalues of that matrix assuming in both problems that $A$ ...
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 ...
13
votes
2
answers
8k
views
Which Runge-Kutta method is more accurate: Dormand-Prince or Cash-Karp?
I simply want to know whether the Dormand-Prince Numerical Method
or the Cash-Karp Numerical Method
is more accurate.
13
votes
2
answers
2k
views
Alternatives to von neumann stability analysis for finite difference methods
I'm working on solving the coupled one-dimensional poroelasticity equations (biot's model), given as:
$$-(\lambda+ 2\mu) \frac{\partial^2 u}{\partial x^2} + \frac{\partial p}{\partial x} = 0$$
$$\...
13
votes
2
answers
443
views
Oscillations in singularly perturbed reaction-diffusion problems with finite elements
When FEM-discretizing and solving a reaction-diffusion problem, e.g.,
$$
- \varepsilon \Delta u + u = 1 \text{ on } \Omega\\
u = 0 \text{ on } \partial\Omega
$$
with $0 < \varepsilon \ll 1$ (...
12
votes
3
answers
437
views
How to write integration tests for numeric simulation software?
Just to be more precise, I'll put a worthy example of my typical use case.
Let's say I'm developing a FEM software that produces several temporal solutions and inserts them in an HDF5 file, along with ...
12
votes
2
answers
250
views
numerical integration in many variables
Let $\vec{x} = (x_1, x_2, \dots, x_n) \in [0,1]^n$ and $f(\vec{x}): [0,1]^n \to \mathbb{C}$ be a function in these variables.
Is there a recursive scheme for this iterated integral?
$$\int_{[0,1]^n}...
11
votes
2
answers
8k
views
Use of machine learning in computational fluid dynamics
Background:
I have only built one working numeric solution to 2d Navier-Stokes, for a course. It was a solution for lid-driven cavity flow. The course, however, discussed a number of schemas for ...
11
votes
2
answers
2k
views
Why is RK45 used as the "default" method for non-stiff ODEs rather than a multistep one?
From what I read, the "default" go-to method for non-stiff ODEs is the Dormand-Prince Runge-Kutta pair; for instance, in Matlab docs, "Most of the time, ...
11
votes
5
answers
8k
views
Integral in log-log space
I'm working with functions which, in general, are much smoother and better behaved in log-log space --- so that's where I perform interpolation/extrapolation, etc, and that works very well. Is there ...
11
votes
1
answer
11k
views
Applying the Runge-Kutta method to second order ODEs
How can I replace the Euler method by Runge-Kutta 4th order to determine the free fall motion in not constant gravitional magnitude (eg. free fall from 10 000 km above ground)?
So far I wrote simple ...
11
votes
3
answers
586
views
Regression testing of chaotic numerical models
When we have a numerical model that represents a real physical system, and that exhibits chaos (e.g. fluid dynamics models, climate models), how can we know that the model is performing as it should? ...
11
votes
1
answer
1k
views
Numerical methods for inverting integral transforms?
I'm trying to numerically invert the following integral transform:
$$F(y) = \int_{0}^{\infty} y\exp{\left[-\frac{1}{2}(y^2 + x^2)\right]} I_0\left(xy\right)f(x)\;\mathrm{d}x$$
So for a given $F(y)$ ...
11
votes
3
answers
2k
views
How should non-constant coefficients be treated with finite-volume first order upwind scheme?
Starting with the advection equation in conservation form.
$$
u_t = (a(x)u)_x
$$
where $a(x)$ is a velocity which depend on space, and $u$ is a concentration of a species which is conserved.
...
11
votes
2
answers
533
views
Numerical method for equation solving that works on stochastically computed functions
There are many well known numerical methods for solving equations of the type
$$ f(x) = 0, \quad x \in \mathbb{R}^n,$$
e.g. bisection method, Newton's method, etc.
In my application $f(x)$ is ...
11
votes
1
answer
805
views
scale invariance for line-search and trust region algorithms
In Nocedal & Wright's book on Numerical Optimization, there is a statement in section 2.2 (page 27), "Generally speaking, it is easier to preserve scale invariance for line search algorithms than ...
10
votes
2
answers
1k
views
About faster approximation of log(x)
I had written a code a while ago which attempted to calculate $log(x)$ without using library functions. Yesterday, I was reviewing the old code, and I tried to make it as fast as possible, (and ...
10
votes
2
answers
1k
views
How much regularization to add to make SVD stable?
I've been using Intel MKL's SVD (dgesvd through SciPy) and noticed that results are are significantly different when I change precision between ...
10
votes
4
answers
863
views
Relevance of fixed-point and arbitrary precision computations
I see very few non-floating point computing libraries/packages around. Given the various inaccuracies of floating point representation, the question arises why there aren't at least some fields where ...
10
votes
1
answer
3k
views
Fortran 90/95: Deallocating variables
I understand the crucial importance of freeing memory when certain variables or arrays need to be reused later in the program, or may not be in use for a while. However, in my experience with ...
10
votes
1
answer
167
views
Are there shortcuts for numerically approximating systems of ordinary differential equations when autonomous?
Existing algorithms for solving ODEs handle functions $\frac{dy}{dt} = f(y, t)$, where $y \in \mathbb R^n$. But in many physical systems, the differential equation is autonomous, so $\frac{dy}{dt} = f(...
10
votes
2
answers
282
views
Benchmark problems for eigenvalue reordering algorithms sought
Every real matrix $A$ can be reduce to real Schur form $T = U^T A U$ using an orthogonal similiary transform $U$. Here the matrix $T$ is quasi-triangular form with 1 by 1 or 2 by 2 blocks on the main ...
10
votes
1
answer
662
views
Solving a difficult system of equations numerically
I have a system of $n$ non-linear equations that I want to solve numerically:
$$\mathbf{f}(\mathbf{x})=\mathbf{a}$$
$$\mathbf{f}=(f_1,\dots,f_n)\quad\mathbf{x}=(x_1,\dots,x_n)$$
This system has a ...
9
votes
3
answers
3k
views
More stable algorithm to calculate `sqrt(a^2 + b^2) - abs(a)` in MatLab
Suppose we want to calculate $\sqrt{a^2+b^2}-|a|$ in MatLab. Using sqrt(a^2 + b^2) - abs(a) will have some problems:
If a or <...
9
votes
3
answers
4k
views
Finite Element Method vs Extended Finite Element Method (FEM vs XFEM)
What are main differences between FEM and XFEM? When should we (not) use XFEM intead of FEM and vice versa? In other words, when I meet a new problem, how I can know to use which one of them?
9
votes
2
answers
2k
views
Does the matrix condition number affect accuracy of iterative linear solvers?
I have a rather specific question regarding the condition number. I run FEM simulations which have multiple length scales to them which results in a huge disparity between the largest entries and the ...
9
votes
3
answers
5k
views
Galerkin method: Test functions vs. Basis functions
I'm a novice to finite element and I'm finding quite hard to find the actual difference between Test function(s) and Basis function(s).
I would be glad if somone could explain me that and point out ...
9
votes
5
answers
1k
views
Is Discrete Exterior Calculus currently a focusing point in numerial computing world or simulation in industry,
I am just wondering if Discrete Exterior Calculus, as a new numerical method , is good at numericall solving problems in elasticity, fluids or other physical/real area.
9
votes
1
answer
934
views
How to solve a second order differential equation (diffusion) with boundary conditions using Python
I am having trouble implementing a model from a publication.
Huang, K-L.; Holsen, T.M.; Selman, J.R. Ind. Eng. Chem. Res. 2003, 42, 15, 3620–3625
scihub link: https://sci-hub.se/10.1021/ie030109q
I ...
9
votes
2
answers
3k
views
Help deciding between cubic and quadratic interpolation in line search
I'm performing a line search as part of a quasi-Newton BFGS algorithm. In one step of the line search I use a cubic interpolation to move closer to the local minimizer.
Let $f : R \rightarrow R, f \...