Most Popular

1500 questions
10
votes
2 answers

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 correct). Here's my attempt so far: const double ee =…
sarker306
  • 213
  • 1
  • 8
10
votes
2 answers

Higher-order numerical integration on a triangle/tetrahedron/simplex

Let $T$ be a triangle and let $f$ be a smooth function on $T$. We can use mid-point quadrature $\int f dx \approx |T|\cdot f(x_M)$, where $x_M$ is the middle-point of $T$. Can you provide me with (a reference for) higher-order formulas on a simplex?
shuhalo
  • 3,660
  • 1
  • 20
  • 31
10
votes
2 answers

scipy.optimize.fmin_bfgs: "Desired error not necessarily achieved due to precision loss"

I am getting the warning in the post subject when attempting to optimize a function in Python with the scipy.optimize.fmin_bfgs function. The complete output: Warning: Desired error not necessarily achieveddue to precision loss Current…
ACEG
  • 203
  • 1
  • 2
  • 6
10
votes
1 answer

What iterative method can effectively solve a linear system with this kind of spectrum

I have a linear system with matrix which eigenvalues are uniformly distributed on the unit circle like this: Is it possible to solve this kind of system effectively by iterative method, maybe with some preconditioner?
faleichik
  • 1,832
  • 13
  • 23
10
votes
1 answer

Order of operations, numerical algorithms

I have read that (1) Ill conditioned operations should be performed before well conditioned ones. As an example, one should calculate $xz-yz$ as $(x-y)z$ since subtraction is ill conditioned while multiplication isn't. However, a first-order…
Bananach
  • 799
  • 3
  • 13
10
votes
3 answers

How to sample points in hyperbolic space?

Hyperbolic space in the Poincaré upper half space model looks like ordinary $\Bbb R^n$ but with the notion of angle and distance distorted in a relatively simple way. In Euclidean space I can sample a random point uniformly in a ball in several…
doetoe
  • 593
  • 2
  • 13
10
votes
4 answers

Are DAXPY, DCOPY, DSCAL overkills?

I have implemented CG in FORTRAN by linking it to Intel MKL. When there are statements like: (Refer Wikipedia) p=r; x=x+alpha*p r=r-alpha*Ap; or similar ones in QMR (in much greater quantity) v_tld = r; y = v_tld; rho = norm( y ); w_tld = r; z…
Inquest
  • 3,394
  • 3
  • 26
  • 44
10
votes
1 answer

Can the method of lines be used to discretize all PDEs?

I have found that the method of lines is a very natural way to think about the discretization of PDE's. Therefore I always default to that mindset when presented with a new set of equations. I have never seen a PDE where this would not work. What…
Godric Seer
  • 4,637
  • 2
  • 23
  • 38
10
votes
1 answer

How to find the interior eigenvalues by krylov subspace method?

I am wondering how to find the eigenvalues of some sparse matrix in given interval [a, b] by iterative method. To my personal understanding, it is more obvious to use Krylov subspace method to find the extreme eigenvalues rather than the interior…
Willowbrook
  • 601
  • 3
  • 10
10
votes
2 answers

Finite elements $W^{1,\infty}$ error estimates

Are there finite element method setups that provide error estimates in the $W^{1,\infty}$ norm (i.e., bounds on $\|u'_h - u'\|_\infty$)? Which families of elements can be used for implementing them? (Crossposted from MathOverflow, where it…
Federico Poloni
  • 11,344
  • 1
  • 31
  • 59
10
votes
2 answers

What about this simple error estimate for linear PDE?

Let $\Omega$ be a convex polygonally bounded Lipschitz domain in $\mathbb R^2$, let $f \in L^2(\Omega)$. Then the solution of the Dirichlet problem $\Delta u = f$ in $\Omega$, $\operatorname{trace} u = 0$ on $\partial\Omega$ has a unique solution in…
shuhalo
  • 3,660
  • 1
  • 20
  • 31
10
votes
1 answer

How can I determine the initial values of pseudo-random number generator if the sequence is given?

Suppose I knew that a random number sequence was generated by a linear congruential generator. That is, $x_{n+1}=(aX_n+c) \bmod m$ If I am given the entire period (or at least a large contiguous subsequence of it), how can I reconstruct the…
Paul
  • 12,045
  • 7
  • 56
  • 129
10
votes
4 answers

Nonlinear least squares with box constraints

What are recommended ways of doing nonlinear least squares, min $\sum err_i(p)^2$, with box constraints $lo_j <= p_j <= hi_j$ ? It seems to me (fools rush in) that one could make the box constraints quadratic, and minimize $$ \sum_i err_i(p)^2 + C *…
denis
  • 932
  • 5
  • 16
10
votes
3 answers

Numerical integration of compactly supported function on a triangle

as the title suggests I'm trying to compute the integral of a compactly supported function (Wendland's quintic polynomial) on a triangle. Notice, that the center of the function is somewhere in 3-D space. I integrate this function on an arbitrary,…
Azrael3000
  • 307
  • 1
  • 8
10
votes
5 answers

Symbolic solution of a system of 7 nonlinear equations

I've got a system of ordinary differential equations - 7 equations, and ~30 parameters governing their behavior as part of a mathematical model of disease transmission. I'd like to find the steady states for those equations Changing dx/dt = rest of…
Fomite
  • 2,383
  • 1
  • 18
  • 25