Most Popular

1500 questions
25
votes
5 answers

Why do equi-spaced points behave badly?

Experiment description: In Lagrange interpolation, the exact equation is sampled at $N$ points (polynomial order $N - 1$) and it is interpolated at 101 points. Here $N$ is varied from 2 to 64. Each time $L_1$, $L_2$ and $L_\infty$ error plots are…
Subodh
  • 1,480
  • 14
  • 31
25
votes
5 answers

Is there software that can autogenerate numerically-accurate floating point C routines from symbolic formulae?

Given a real function of real variables, is there software available that can automatically generate numerically-accurate code to calculate the function over all inputs on a machine equipped with IEEE 754 arithmetic? For example, if the real…
Daniel Trebbien
  • 353
  • 2
  • 5
25
votes
8 answers

Is it possible for user written algorithms to outperform libraries' built-in optimized functions?

I've always had this question in mind (even if it may sound vague), but in my numerical analysis courses we've always learned how to analyze and optimize code. However, since most linear algebra libraries (i.e. LAPACK, BLAS, etc.) have been…
CynthiaZ1998
  • 353
  • 3
  • 7
25
votes
4 answers

When is a high order method useful for computational fluid dynamics simulations?

Many numerical approaches to CFD can be extended to arbitrarily high order (for instance, discontinuous Galerkin methods, WENO methods, spectral differencing, etc.). How should I choose an appropriate order of accuracy for a given problem?
David Ketcheson
  • 16,522
  • 4
  • 54
  • 105
25
votes
10 answers

Are there any embarrassingly parallel tasks that require a CPU rather than GPU?

I am looking for tasks that are unsuitable for GPUs gain significant speedup as more CPU nodes are added don't require large data transfer or inter-thread communication between nodes. Do any problems of this type still exist?
Andrew
  • 259
  • 3
  • 4
25
votes
5 answers

Why are higher-order Runge–Kutta methods not used more often?

I was just curious as to why high-order (i.e. greater than 4) Runge–Kutta methods are almost never discussed/employed (at least to my knowledge). I understand it requires greater computational time per step (e.g. RK14 with 12th-order embedded step),…
Mathews24
  • 578
  • 2
  • 6
  • 13
25
votes
1 answer

Is there a numerical algorithm for finding an asymptotic slope?

I have a series of data points $(x_i,y_i)$ which I expect to (approximately) follow a function $y(x)$ that asymptotes to a line at large $x$. Essentially, $f(x) \equiv y(x) - (ax + b)$ approaches zero as $x \to \infty$, and the same can probably be…
David Z
  • 3,383
  • 2
  • 27
  • 34
25
votes
5 answers

Why should non-convexity be a problem in optimization?

I was very surprised when I started to read something about non-convex optimization in general and I saw statements like this: Many practical problems of importance are non-convex, and most non-convex problems are hard (if not impossible) to…
Prokop Hapala
  • 927
  • 10
  • 17
25
votes
3 answers

Recommendation for Finite Difference Method in Scientific Python

For a project I am working on (in hyperbolic PDEs) I would like to get some rough handle on the behavior by looking at some numerics. I am, however, not a very good programmer. Can you recommend some resources for learning how to effectively code…
Willie Wong
  • 677
  • 2
  • 6
  • 15
25
votes
3 answers

Solving $(G^TA^{-1}G)x = b$ without inverting $A$

I have matrices $A$ and $G$. $A$ is sparse and is $n\times n$ with $n$ very large (can be on the order of several million.) $G$ is an $n\times m$ tall matrix with $m$ rather small ($1 \lt m \lt 1000$) and each column can only have a single $1$ entry…
Costis
  • 1,330
  • 11
  • 18
25
votes
5 answers

When is building a cluster in the cloud cheaper than building one in my lab for MD simulations?

An Amazon EC2 compute cluster costs about \$800-\$1000 (depending on duty cycle) per physical CPU core over the course of 3 years. In our last round of hardware acquisition, my lab picked up 48 cores worth of hardware very similar to that of…
tel
  • 1,380
  • 12
  • 23
25
votes
5 answers

What material should I include with a journal article (or post online) in order to make my computational research reproducible?

Reproducibility has become more and more important in computational science research. (For instance, see this article by Roger Peng in Science; I'm aware of other such articles and web sites also.) However, it's not clear to me how much information…
Geoff Oxberry
  • 30,394
  • 9
  • 64
  • 127
25
votes
4 answers

When should I use C++ expression templates in computational science, and when should I *not* use them?

Suppose that I'm working on a scientific code in C++. In a recent discussion with a colleague, it was argued that expression templates could be a really bad thing, potentially making software compilable only on certain versions of gcc. Supposedly,…
Geoff Oxberry
  • 30,394
  • 9
  • 64
  • 127
25
votes
4 answers

How to incorporate the boundary conditions with the Galerkin method?

I've been reading some resources on the web about Galerkin methods to solve PDEs, but I'm not clear about something. The following is my own account of what I have understood. Consider the following boundary value problem (BVP): $$L[u(x,y)]=0 \quad…
a06e
  • 1,729
  • 15
  • 22
25
votes
4 answers

How to add large exponential terms reliably without overflow errors?

A very common problem in Markov Chain Monte Carlo involves computing probabilities that are sum of large exponential terms, $ e^{a_1} + e^{a_2} + ... $ where the components of $a$ can range from very small to very large. My approach has been to…
cboettig
  • 758
  • 6
  • 12