149 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
1
vote
1
answer
88
views
Iterative solvers with right-preconditioning: inconsistency between applying the preconditioner to the matrix, or to x
Summary
Using the Eigen library, I see significantly different numbers of BiCGStab iterations when I solve Ax = b with a right-preconditioner, i.e., [A M^(-1)] Mx = b, (a) by precomputing A M^(-1) ...
-1
votes
2
answers
190
views
Is there a faster method to compute these distance-based sums over a nonuniform grid of cells?
I'm attempting to implement an algorithm to compute an array of values. Unfortunately, I've found the literal implementation of that algorithm to be too slow for my use case. I suspect there's an ...
1
vote
0
answers
64
views
multivariate Fox-H numerical computation
I have some troubles in numerically calculating PDF below:
SNR of particular system model
This PDF is the expression of SNR of practical RIS-aided system: https://ieeexplore.ieee.org/document/9387559 (...
1
vote
2
answers
136
views
How many digits can I rely on?
Context
I am trying to improve my ability to recognize the number of correct decimal digits after performing short calculations involving floating-point numbers. In particular, I find it challenging ...
1
vote
1
answer
286
views
Associating B-Spline Coefficients to Control Points
From the seminal paper by Hughes I learnt that any B-Spline curve (or surface) can be described by a linear combination of B-Spline basis and control points, i.e.
C(x) = \sum_{i=1}^n N_{i,p} B_i
...
0
votes
0
answers
47
views
Vectorization of power law fitting
I am moving a code base to run using PyTorch tensor on GPU. For loops are terrible on GPU especially for small-sized data. I am trying to vectorize the function below, i.e. to have no for loops.
I ...
0
votes
3
answers
130
views
OpenMP parallelization is highly inefficient
I'm trying to numerically solve a 2-D Poisson equation with around a 200x200 grid. I'm trying to implement the diagonal method to enable parallelism:
#include <math.h>
#include <omp.h>
#...
0
votes
0
answers
161
views
NumPy np.linalg.solve give two different solution on different machines
I am studying computer science at the moment. We have the following exercise:
Execute LU decomposition given a matrix A and vector b using NumPy. We had to derive L and U by hand and came up the ...
0
votes
0
answers
166
views
How to calculate the Automatic differentiation of an arbitrary function in python
I'm using the mpmath library to compute a self defined function f(x) and needed to compute its higher order derivatives.
I found the Automatic differentiation on Wikipedia and found it useful.
# ...
0
votes
0
answers
26
views
Is it necessary to parallelize the nested function in python?
Computing higher order derivatives is a nested function and can be quite consuming. I tried to use the parallel programming to speed up the nested function.
from concurrent.futures import ...
1
vote
1
answer
406
views
How to tell how small `h` is the in the finite difference?
I'm doing a project required to compute the precise(up to a certain precession N) numerical derivatives of a function.
The usual approach was to use the finite difference types of algorithms, i.e.
(f(...
0
votes
1
answer
54
views
How to improve sub-matrix-vector multiplication c code
I have C code for generic-sub-matrix-vector (gesubmv) multiplication that computes
y(rinds) = A(rinds, cinds)*x(cinds) + y(rinds), where rinds and cinds are vectors of row and column (not necessarily ...
0
votes
1
answer
248
views
Numeric calculation of nullspace with Sympy is slow
I want to obtain the bases for kernel (nullspace) of a matrix using the Row Reduced Echelon Form (RREF).
Although scipy has the function to calculate nullspace, it does not give me sparse vectors ...
-1
votes
2
answers
716
views
How to solve a double integral with any code? [closed]
I have an double integral:
Because exp(−x^2) is a non-integrable function, I have tried to solve this using the quadgk function in MATLAB, but I don't get a good result. Changing the integral's ...
0
votes
1
answer
161
views
Multiprocessing in python for numerical simulation with large objects
I am trying to put together a numerical simulation (specifically, Beta cell dynamics) based on Betram et al. 2007 (https://www.sciencedirect.com/science/article/pii/S0006349507709621). The model ...