Most Popular
1500 questions
40
votes
23 answers
Good examples of "two is easy, three is hard" in computational sciences
I recently encountered a formulation of the meta-phenomenon: "two is easy, three is hard" (phrased this way by Federico Poloni), which can be described, as follows:
When a certain problem is formulated for two entities, it is relatively easy to…
Anton Menshov
- 8,672
- 7
- 38
- 94
40
votes
3 answers
How to choose a method for solving linear equations
To my knowledge, there are 4 ways to solving a system of linear equations (correct me if there are more):
If the system matrix is a full-rank square matrix, you can use Cramer’s Rule;
Compute the inverse or the pseudoinverse of the system…
chaohuang
- 647
- 1
- 6
- 10
38
votes
6 answers
Symbolic software packages for Matrix expressions?
We know that $\mathbf A$ is symmetric and positive-definite. We know that $\mathbf B$ is orthogonal:
Question: is $\mathbf B \cdot\mathbf A \cdot\mathbf B^\top$ symmetric and positive-definite?
Answer: Yes.
Question: Could a computer have told us…
MRocklin
- 3,088
- 20
- 29
38
votes
10 answers
stupid + stupid = brilliant in scientific computing
I'm interested in examples of very effective methods in scientific computing that are the sum or naive combination of very ineffective or bad ones.
Daniel Shapero
- 10,263
- 1
- 28
- 59
38
votes
7 answers
What programming paradigms should I be investing in if I want my code to run on petascale machines in the future?
It's pretty clear from a survey of the top500 that the industry is trending towards an exponential increase in processing cores. The largest supercomputers all use MPI for communication between nodes, though there does not appear to be a clear…
Aron Ahmadia
- 6,951
- 4
- 34
- 54
37
votes
2 answers
why is A*v+B*v faster than (A+B)*v?
$A$ and $B$ are $n \times n$ matrices and $v$ is a vector with $n$ elements. $Av$ has $\approx 2n^2$ flops and $A+B$ has $n^2$ flops. Following this logic, $(A+B)v$ should be faster than $Av+Bv$.
Yet, when I run the following code in matlab
A =…
Sam Christensen
- 525
- 1
- 4
- 8
37
votes
5 answers
Is it possible to have a career in SciComp without contributing to arms research?
I am at an international conference (ICIAM2019) about numerical methods and am surprised by the prevalence of applications directly relatable to arms research.
examples:
One award winner holds his talk about the mathematical problem of radar…
MPIchael
- 2,935
- 10
- 19
37
votes
3 answers
What is the simplest way to do a user-local install of a python package?
I don't want to deal with virtualenv for a local Python installation, I just want to install a few packages locally without dealing with the PYTHONPATH environment variable, how do I do that?
Aron Ahmadia
- 6,951
- 4
- 34
- 54
37
votes
2 answers
When should log1p and expm1 be used?
I have a simple question that is really hard to Google (besides the canonical What Every Computer Scientist Should Know About Floating-Point Arithmetic paper).
When should functions such as log1p or expm1 be used instead of log and exp? When should…
Tim
- 475
- 1
- 4
- 10
36
votes
2 answers
Mathematical Libraries for OpenCL?
I am looking for information from anyone that has tried to use OpenCL in their scientific code. Has anyone tried (recently) ViennaCL? If so, how does it compare to cusp?
What about OCLTools? Does it live up to the promise? If so, would it be a…
Sean Farley
- 1,370
- 12
- 16
36
votes
6 answers
What attributes make a figure "professional-quality"?
I've heard people say that plots produced by ORIGIN tend to look polished and "professional," whereas plots produced by Mathematica do not. However, most plot-creation programs are quite configurable and it stands to reason that with the right…
David Z
- 3,383
- 2
- 27
- 34
35
votes
6 answers
What is the fastest way to calculate the largest eigenvalue of a general matrix?
EDIT: I am testing if any eigenvalues have a magnitude of one or greater.
I need to find the largest absolute eigenvalue of a large sparse, non-symmetric matrix.
I have been using R's eigen() function, which uses the QR algo from either EISPACK or…
power
- 521
- 1
- 4
- 8
35
votes
1 answer
CUDA vs OpenCL as of late 2013
How do CUDA and OpenCL compare to each other as of late 2013 from a programmer's perspective? My group is thinking about trying to make use of GPU computing. Would we be limiting ourself significantly by choosing hardware that only supports OpenCL…
Szabolcs
- 2,620
- 2
- 19
- 34
34
votes
2 answers
Strange oscillation when solving the advection equation by finite-difference with fully closed Neumann boundary conditions (reflection at boundaries)
I am trying to solving the advection equation but have a strange oscillation appearing in the solution when the wave reflects from the boundaries. If anybody has seen this artefact before I would be interested to know the cause and how to avoid…
boyfarrell
- 5,409
- 3
- 35
- 67
34
votes
8 answers
How do I make sure that the results of my simulations and the results in my paper are always in sync?
In one of my papers, I list some numerical results in addition to some figures. What I'd like to do is make sure that the numerical results in my paper always agree with the code. Right now, I just directly copy the numerical results from my…
Geoff Oxberry
- 30,394
- 9
- 64
- 127