David Ketcheson
  • Member for 10 years, 1 month
  • Last seen this week
Is it common not to use libraries for standard numerical algorithms, and why?
Accepted answer
49 votes

I used to implement everything myself, but lately have begun using libraries much more. I think there are several very important advantages of using a library, beyond just the issue of whether you ...

View answer
Why is local conservation important when solving PDEs?
Accepted answer
31 votes

In the solution of nonlinear hyperbolic PDEs, discontinuities ("shocks") appear even when the initial condition is smooth. In the presence of discontinuities, the notion of solution can only be ...

View answer
Strange oscillation when solving the advection equation by finite-difference with fully closed Neumann boundary conditions (reflection at boundaries)
Accepted answer
28 votes

The equation you're solving does not permit right-going solutions, so there is no such thing as a reflecting boundary condition for this equation. If you consider the characteristics, you'll realize ...

View answer
How can I numerically differentiate an unevenly sampled function?
Accepted answer
27 votes

J.M's comment is right: you can find an interpolating polynomial and differentiate it. There are other ways of deriving such formulas; typically, they all lead to solving a van der Monde system for ...

View answer
What are criteria to choose between finite-differences and finite-elements
25 votes

This question may be too broad to have a meaningful answer. Most people who answer will only be familiar with some subset of all the kinds of FD and FE discretizations that may be used. Note that ...

View answer
Is it possible to use Octave to learn MATLAB programming?
Accepted answer
24 votes

Disclaimer: I sometimes get annoyed when somebody tries to tell me what they think I ought to do rather than answering the question I asked. But I'm going to take a risk and suggest an alternative to ...

View answer
Puzzling remark about stability region of fifth-order Runge-Kutta method
Accepted answer
22 votes

van der Houwen's statement is correct, but it is not a statement about all fifth-order Runge-Kutta methods. The "Taylor polynomials" he is referring to are (as you seem to know) just the polynomials ...

View answer
Why are higher-order Runge–Kutta methods not used more often?
Accepted answer
19 votes

There are thousands of papers and hundreds of codes out there using Runge-Kutta methods of fifth order or higher. Note that the most commonly used explicit integrator in MATLAB is ODE45, which ...

View answer
Constructing explicit Runge Kutta methods of order 9 and higher
Accepted answer
16 votes

Bounds That is still true. In Butcher's book, page 196, it says the following: In a 1985 paper, Butcher showed that you need 11 stages to get order 8, and this is sharp. For order 10, Hairer derived ...

View answer
Is Crank-Nicolson a stable discretization scheme for Reaction-Diffusion-Advection (convection) equation?
Accepted answer
15 votes

This is a well-framed question and a very useful thing to understand. Korrok is correct to refer you to von Neumann analysis and LeVeque's book. I can add a bit more to that. I'd like to write a ...

View answer
How to determine if a numerical solution to a PDE is converging to a continuum solution?
Accepted answer
15 votes

There are two main classes of solutions to be discussed in this regard. "Sufficiently" Smooth Solutions In Strang's classical paper it is shown that the Lax equivalence theorem (i.e., the idea that ...

View answer
Implicit finite difference schemes for advection equation
Accepted answer
15 votes

It's quite common in computational fluid dynamics to use implicit schemes similar to what you propose. The ones I know of are based on compact finite difference formulas (not simply on replacing $n$ ...

View answer
State of the Mac OS in Scientific Computing and HPC
14 votes

@Geoff gives a good answer, but I think it's worth providing an alternative perspective. I do everything on Macs -- in OS X, not a Linux VM -- including lots of scientific code development. I mostly ...

View answer
How can the gravitational n-body problem be solved in parallel?
14 votes

Look at the fast multipole method. It is highly scalable and $O(n)$. It allows trading off between precision and cost. Here's an example where it is run at 42 Tflops on a GPU cluster.

View answer
Which methods can ensure that physical quantities remain positive throughout a PDE simulation?
Accepted answer
14 votes

The most common method is to reset negative values to some small, positive number. Of course, this is not a mathematically sound solution. A better general approach that may work and is easy, is to ...

View answer
How should I study creating and programming HPC systems?
Accepted answer
13 votes

Check out HPC University. In particular, the resources section, which includes things like an Introduction to OpenMP Debugging Serial and Parallel Codes Introduction to the Open Science Grid and ...

View answer
What is "good" parallel scaling?
Accepted answer
12 votes

Good is a relative term, and it will depend on the nature of the problem, the nature of the algorithm, and properties of the hardware involved. The only absolute reference point is ideal scaling (100%...

View answer
Solving a least squares problem with linear constraints in Python
Accepted answer
11 votes

I wrote a full answer (below the line) before discovering CVXPY, which (like CVX for MATLAB) does all the hard stuff for you and has a very short example almost identical to yours here. You only need ...

View answer
Why do planets move at the wrong speed in my solar system model?
11 votes

This is expected behavior with the Verlet algorithm. It is a symplectic integrator, which means that it will preserve quadratic invariants to within roundoff error -- thus the form planetary orbits ...

View answer
Are there tasks in machine learning which require double precision floating points?
11 votes

I am not an expert in machine learning, but I can outline the considerations that are relevant. The numerical calculations in machine learning are generally linear algebra -- either solving linear ...

View answer
Is the shooting method the only general numerical method for solving nonlinear boundary value ODEs?
Accepted answer
11 votes

Is the shooting method the only general numerical method for solving BVP of nonlinear ODE(s)? No. Most other methods consist of three parts: Discretization. This may be done with finite ...

View answer
Is there a way to reduce aberration in computations of planets' trajectories?
11 votes

To get something that looks realistic for planetary orbits, you shouldn't use the forward or backward Euler methods. These will cause your planets to spiral outward or inward. You should use a ...

View answer
Open-access journals in Computational Science
11 votes

The boycott of Elsevier should not be mistaken as a push for open access journals. The phrase "open access" does not appear in any of the reasons given for the boycott at http://thecostofknowledge....

View answer
What are possible methods to solve compressible Euler equations
Accepted answer
11 votes

The principal numerical difficulty in solving a nonlinear first-order system of hyperbolic PDEs like the Euler equations (for compressible, inviscid flow) is that discontinuities (shock waves) appear ...

View answer
Where can I find a good reference for the stability properties of several methods of solving parabolic PDEs?
10 votes

Very short answer: for a comprehensive reference, you can't beat Hairer and Wanner volume II. Short answer: Here are some MATLAB scripts to plot the stability region of a linear multistep or Runge-...

View answer
What is currently the "top" research in computational science?
10 votes

This is not an answer to your question. But if a student came to me asking this question, I would ask him or her to read these articles: You and your research (Hamming) How to choose a good ...

View answer
Numerical methods for discontinuous r.s. ODEs
10 votes

The most significant reference I know of is David Stewart's thesis, which is more than 20 years old: High Accuracy Numerical Methods for Ordinary Differential Equations with Discontinuous Right-...

View answer
Which numerical methods preserve time reversal symmetry?
Accepted answer
9 votes

What one usually wants in this situation is to preserve a discrete analog of time symmetry: namely, if the time discretization is applied to solve first forward and then backward in time, the initial ...

View answer
How to code in Matlab: If an argument is empty, then default to "x" value?
9 votes

You can do this in a way that isn't as prone to breaking when the order of the arguments changes using inputParser(), which also allows you to validate the arguments. One example is here (just look ...

View answer
Is there an efficient algorithm for matrix-valued continued fractions?
Accepted answer
9 votes

The following two methods are given in Functions of Matrices: Theory and Computation by Nicholas Higham, on page 81. These formulas evaluate $$r(X) = b_0 + \frac{a_1 X}{b_1+\frac{a_2 X}{b_2+\cdots + ...

View answer
1
2 3 4 5 6