Most Popular
1500 questions
14
votes
1 answer
What are the relative benefits of using Adams-Moulton over Adams-Bashforth algorithm?
I am solving a system of two coupled PDE's in two spatial dimensions and in time computationally. Since the function evaluations are expensive, I would like to use a multistep method (initialised using Runge-Kutta 4-5).
The Adams-Bashforth method…
SimonSciComp
- 311
- 2
- 9
14
votes
2 answers
How useful is PETSc for Dense Matrices?
Wherever I have seen, PETSc tutorial/documents etc. say that it is useful for linear algebra and usually specifies that sparse systems will benefit. What about dense matrices? I am concerned about solving $Ax=b$ for dense $A$.
I have written my own…
Inquest
- 3,394
- 3
- 26
- 44
14
votes
0 answers
Sequential approach to solving coupled PDEs
I'm dealing with a coupled system of three transient, non-linear convection-diffusion equations. Let's just say to simplify the problem that they take the following form:
$$
-\nabla\cdot(D_{1}(u_{2},u_{3})\nabla u_{1}) =…
Justin Dong
- 937
- 6
- 14
14
votes
2 answers
Regarding automatic differentiation, is source-code-transformation (STC) more efficient than operator-overloading (OO)?
We are working on a Bayesian model for a space-time process, and are using a No-U-Turn sampler (NUTS) that requires a model for the log-probability and it's gradient with respect to the model parameters. More succinctly, we have fairly complicated…
Matthew Emmett
- 2,076
- 15
- 22
13
votes
4 answers
FLOP counting for library functions
When evaluating the number of FLOPs in a simple function, one can often just go down the expression tallying basic arithmetic operators. However, in the case of mathematical statements involving even division, one cannot do this and expect to be…
Peter Brune
- 1,675
- 12
- 20
13
votes
2 answers
Automatic generation of integration points and weights for triangles and tetrahedra
Usually one would consult a paper or book to find integration points and weights for unit triangle and tetrahedra. I am looking for a method to automatically compute such points and weights. The following Mathematica code example computes…
user530
13
votes
3 answers
Computing slightly oscillatory series to high precision?
Suppose I have the following interesting function:
$$ f(x) = \sum_{k\geq1} \frac{\cos k x}{k^2(2-\cos kx)}. $$
It has some unpleasant properties, like its derivative not being continous at rational multiples of $\pi$. I suspect a closed form does…
Kirill
- 11,438
- 2
- 27
- 51
13
votes
5 answers
Compute $(e^x-1)/x$ near $x = 0$
The function $f \colon x \mapsto (e^x-1)/x$ has singularity near $x = 0$. That singularity can be lifted, though: for $x = 1$, one should have $f(x) = 1$, since
$$
e^x = \sum_{k=0} \frac{x^k}{k!}
$$
and thus
$$
(e^x - 1)/x = \sum_{k=1}…
anonymous
- 233
- 1
- 5
13
votes
3 answers
Is there any benefit to compiling LAPACK from source versus installing the prebuilt package from Ubuntu?
I know that ATLAS is able to optimize itself for the machine it is compiled on and thus maximum benefits are found by compiling from source. Is there any benefit to compiling LAPACK from source? It would be much easier to just install the prebuilt…
OSE
- 397
- 2
- 10
13
votes
3 answers
What are the basic principles behind generating a moving mesh?
I am interested in implementing an moving mesh for an advection-diffusion problem. Adaptive Moving Mesh Methods gives a good example of how to do this for Burger's equation in 1D using finite-difference. Would someone be able to offer a worked…
boyfarrell
- 5,409
- 3
- 35
- 67
13
votes
1 answer
CFD: Does order of time stepping scheme affect steady state solution? If yes why?
I am trying to solve Ideal MHD equation using semi discrete methods, ENO spatial reconstructions and TVD RK time stepping. I am getting different steady state solutions with different temporal order. Is it correct?
0b1100001
- 531
- 2
- 10
13
votes
2 answers
Does the "cofactor technique" for inverting a matrix have any practical significance?
The title is the question. This technique involves using the "matrix of cofactors", or "adjugate matrix", and gives explicit formulae for the components of the inverse of a square matrix. It is not easy to do by hand for a matrix bigger than, say,…
Stefan Smith
- 515
- 3
- 13
13
votes
2 answers
Which preconditioners (and solver) in PETSc for indefinite symmetric systems should I use?
My system is a symmetric FE problem with lagrange multipliers (e.g. incompressible Stokes' flow):
\begin{pmatrix}A & B^T \\ B & C\end{pmatrix}
where $C = 0$ is the typical case (I have even made sure that the equations are numbered so that the…
Mikael Öhman
- 1,008
- 4
- 10
13
votes
2 answers
Oscillations in singularly perturbed reaction-diffusion problems with finite elements
When FEM-discretizing and solving a reaction-diffusion problem, e.g.,
$$
- \varepsilon \Delta u + u = 1 \text{ on } \Omega\\
u = 0 \text{ on } \partial\Omega
$$
with $0 < \varepsilon \ll 1$ (singular perturbation), the solution of the discrete…
Nico Schlömer
- 3,126
- 17
- 36
13
votes
4 answers
Testing suites for numerical applications in C++?
Recently, I've been pushing my group to include more testing when writing their code. There were several major bugs that took a lot longer to catch than probably speaking was necessary, because we didn't have a good testing regime in place.
However,…
aeismail
- 3,523
- 1
- 18
- 31