Most Popular

1500 questions
21
votes
3 answers

What guidelines should I use when searching for good preconditioning methods for a specific problem?

For the solution of large linear systems $Ax=b$ using iterative methods, it is often of interest to introduce preconditioning, e.g. solve instead $M^{-1}(Ax=b)$, where $M$ is here used for left-preconditioning of the system. Typically, we should…
Allan P. Engsig-Karup
  • 3,226
  • 19
  • 31
20
votes
5 answers

What's the fastest software(open source) to solve mixed integer programming problem

I have a mixed integer programming problem. And I am current using GLPK as my solver. But I found that GLPK is good for Linear Programming problem, but for Mixed Integer programming, it requires much longer time, therefore doesn't meet our…
Yu Hao
  • 203
  • 1
  • 2
  • 4
20
votes
3 answers

Strategies for unit testing and test-driven development

I'm a huge advocate of test-driven development in scientific computing. It's utility in practice is just staggering, and really alleviates the classic troubles that code developers know. However, there are inherent difficulties in testing scientific…
Aurelius
  • 2,365
  • 1
  • 15
  • 19
20
votes
4 answers

Do currently available GPUs support double precision floating point arithmetic?

I have run the molecular dynamics (MD) code GROMACS on a Ubuntu Linux cluster consisting of nodes containing 24 Intel Xeon CPUs. My particular point of interest turns out to be somewhat sensitive to floating point arithmetic precision, so I have…
Andrew
  • 711
  • 1
  • 5
  • 12
20
votes
3 answers

Log-log parallel scaling/efficiency plots

A lot of my own work revolves around making algorithms scale better, and one of the preferred ways of showing parallel scaling and/or parallel efficiency is to plot the performance of an algorithm/code over the number of cores, e.g. where the…
Pedro
  • 9,573
  • 1
  • 36
  • 45
20
votes
2 answers

Unstructured quad mesh-generation?

What is the best (scalability and efficiency) algorithms for generating unstructured quad meshes in 2D? Where can I find a good unstructured quad mesh-generator? (open-source preferred)
Allan P. Engsig-Karup
  • 3,226
  • 19
  • 31
20
votes
9 answers

C, Julia, Python, Maxima, Mathematica, ChatGPT and numerical errors

I am completely stunned how numerical errors can diverge for so innocent programs. In Python 3.11.7 the program import math u = 5.0 for i in range(73): u = 6*math.cos(u) print(u) displays $-3.8591995867613633$. In Julia 1.9.2, the program u =…
Smilia
  • 468
  • 3
  • 11
20
votes
3 answers

C++ Best practices for dealing with many constants, variables in scientific codes

I am developing a code to simulate fluid flow with biological substances present in the flow. This involves the standard Navier-Stokes equations coupled to some additional biological models. There are many parameters/constants. I have written…
EssentialAnonymity
  • 599
  • 1
  • 3
  • 16
20
votes
2 answers

Practical example of why it is not good to invert a matrix

I am aware about that inverting a matrix to solve a linear system is not a good idea, since it is not as accurate and as efficient as directly solving the system or using LU, Cholesky or QR decomposition. However, I have not been able to check this…
Manu
  • 459
  • 3
  • 9
20
votes
3 answers

Null-space of a rectangular dense matrix

Given a dense matrix $$A \in R^{m \times n}, m >> n; max(m) \approx 100000 $$ what is the best way to find its null-space basis within some tolerance $\epsilon$? Based on that basis can I then say that certain cols are linearly dependent within…
Alexander
  • 1,111
  • 1
  • 8
  • 15
20
votes
5 answers

How to address numerical non-associativity for parallel reduction?

A parallel reduction assumes that the corresponding operation is associative. This assumption is violated for addition of floating point numbers. You might ask why I care about this. Well, it makes results less reproducible. And it gets worse when…
Thomas Klimpel
  • 2,141
  • 15
  • 35
20
votes
6 answers

How to get started with OpenFOAM for CFD

I'm looking at using OpenFOAM for solving basic internal flows in CFD. What is the best way to get started, and could anyone please point me to a good online reference to go to with any questions I might have once I dive in? I've heard that it is…
prrao
  • 303
  • 1
  • 2
  • 8
20
votes
4 answers

What is the best way to find discontinuities of a black-box function?

It was suggested that this might be a better place for this question than Mathematics Stack Exchange where I asked it before. Suppose one has a black-box function which can be evaluated anywhere (cheaply) on a specified interval $[a,b]$ and has no…
n00b
  • 590
  • 3
  • 11
20
votes
7 answers

How do I write dimensionally agnostic code?

I often find myself writing very similar code for one, two, and three dimensional versions of a given operation/algorithm. Maintaining all of these versions can become tedious. Simple code generation works fairly well, but it seems as thought…
Matthew Emmett
  • 2,076
  • 15
  • 22
20
votes
6 answers

How does one determine the point group of a molecule?

You've managed to finally find out how the atoms are spatially arranged on your newly-discovered molecular entity. Through, say, spectroscopic means, you are now in possession of a bunch of atom coordinates, atom types, bond lengths, bond types, and…
J. M.
  • 3,155
  • 28
  • 37