Most Popular

1500 questions
8
votes
3 answers

How to estimate the impact of small scale on large scale in fluid dynamics?

Assuming that a direct numerical simulation is performed, what is a good method for estimate the impact of small scale on large scale in fluid dynamics ? For example is it pertinent to compare two run with different grid size or two run with…
ucsky
  • 419
  • 3
  • 10
8
votes
3 answers

random number generation from cython

I want to make my python program fast by using cython, but my inner loop is still making slow python calls to the random number generator! Several years ago this same issue was raised by someone on sage-support and there seemed to be no good…
none
  • 508
  • 1
  • 5
  • 7
8
votes
1 answer

Demonstrating that the time step size is small enough in a code with automatic step size selection

I recently inherited a large body of legacy code that solves a very stiff, transient problem. I would like to demonstrate that the spatial and temporal step sizes are small enough that the qualitative nature of the computed solution would not…
Godric Seer
  • 4,637
  • 2
  • 23
  • 38
8
votes
1 answer

How to calculate the geodesic curvature of a discrete 3D curve?

I have coordinates of a set of points that form a closed loop that lies in a 3D surface. I know the equation of the surface and I can calculate it's surface normal at any point. I found that for a unit speed curve $\alpha(t)$ I can calculate the…
Amit Singh
  • 85
  • 5
8
votes
1 answer

Sudden drops in matrix multiplication performance

I've been reading about implementing dense matrix multiplication when the matrix doesn't fit in cache. One of the graphs I've seen (slide 9 from these slides) shows sudden drops in performance using the naive algorithm. This drops are to around 50%…
cjordan1
  • 805
  • 6
  • 16
8
votes
1 answer

Finding the $i$-th largest eigenvalue of a matrix

Given a large matrix $A$ with eigenvalues $\sigma_1\ge \sigma_2 \ge \dotsc $, I want to determine only a subset of these values, say $\sigma_5,\sigma_8$ and $\sigma_{19}$. Is there an algorithm that can do this, or is finding the top 19 eigenvalues…
dexter04
  • 183
  • 4
8
votes
3 answers

Minimum image convention for triclinic unit cell

The minimum image convention (MIC), see for example a short note of W. Smith, is often used in molecular dynamics or monte carlo simulations of periodic systems with an orthorhombic unit cell. For this special case, it is rather trivial to implement…
8
votes
1 answer

Size of jump for piecewise discontinuous approximations

If one has a sufficiently smooth function $u$ that is approximated by a piecewise constant function $u_h=\Pi^0_h u$ on a mesh of cell size $h$ (where $\Pi^0_h$ is the $L_2$ projection onto the constants on each cell), then it is not hard to see…
Wolfgang Bangerth
  • 55,373
  • 59
  • 119
8
votes
5 answers

Iterative solution to a nonlinear equation

I appologize in advance if this question is silly. I need to compute the root of \begin{equation} u -f(u) =0 \end{equation} Where $u$ is a real vector and $f(u)$ is a real-vector valued function. I started with Newton's method (which worked), but…
Gabriel Landi
  • 390
  • 1
  • 7
8
votes
1 answer

How to find a good preconditioner to the system $(A^T A + \lambda I) x = A^T b$?

The system in the title has a damper factor $\lambda > 0$ and the matrix $A$ is sparse and rectangular, with a structure I can exploit to solve matrix vector products very fast. My current solver, LSMR, is trying to solve the normal equations $(A^TA…
Integral
  • 181
  • 4
8
votes
0 answers

Good C++ optimization library for BFGS

To implement maximum likelihood estimators, I am looking for a good C++ optimization library that plays nicely with Eigen's matrix objects. Eigen has some capability of interfacing of its own but if anyone here has experience of using Eigen with an…
Hirek
  • 183
  • 1
  • 6
8
votes
1 answer

What algorithm does (or did?) Excel use for Bessel functions that is discontinuous at x=8?

Writing this comment reminded me of something I noticed years ago about evaluating Bessel functions of the first kind $J_n(x)$ in Excel. (BESSELJ) I don't use Excel now but at the time I'd checked MacOS and Windows computers with several different…
uhoh
  • 1,048
  • 1
  • 10
  • 17
8
votes
1 answer

Accurate and efficient computation of the inverse Langevin function

The Langevin function $\mathcal{L}(x) = \mathrm{coth}(x) - \frac{1}{x}$ occurs in computations related to elastomers and paramagnetic materials. It is easily computed accurately and with high performance as long as the issue of subtractive…
njuffa
  • 1,865
  • 16
  • 21
8
votes
1 answer

What scientific problems can be simulated that couldn’t be simulated 10 years ago?

What scientific problems can be simulated with computers that couldn’t be simulated 10 years ago? I’m particularly interested in cutting-edge scientific simulations, which wouldn’t have been possible (due to computational constraints, or lack of…
Neil
  • 181
  • 2
8
votes
1 answer

What are these oscillations?

I have a function $g(x)$ defined numerically that is sort of in between a Gaussian and a Lorentzian. It decays much slower than a Gaussian, but still faster than a simple inverse power. I need to calculate its Fourier transform $f(t)\equiv…
Arturo don Juan
  • 489
  • 2
  • 8