All Questions

Filter by
Sorted by
Tagged with
10
votes
2answers
2k views

Higher-order numerical integration on a triangle/tetrahedron/simplex

Let $T$ be a triangle and let $f$ be a smooth function on $T$. We can use mid-point quadrature $\int f dx \approx |T|\cdot f(x_M)$, where $x_M$ is the middle-point of $T$. Can you provide me with (a ...
9
votes
3answers
804 views

Construction of $C^1$/$H^2$-conforming finite element basis for triangular or tetrahedral mesh

In the paper Hierarchical Conforming Finite Element Methods for the Biharmonic Equation, P. Oswald claimed Clough-Tocher type elements has $C^1$-continuity while being a cubic polynomial on each ...
29
votes
7answers
2k views

Where do the laws of quantum mechanics break down in simulations?

As someone who holds a BA in physics I was somewhat scandalized when I began working with molecular simulations. It was a bit of a shock to discover that even the most detailed and computationally ...
7
votes
1answer
14k views

scipy.optimize.fmin_bfgs: “Desired error not necessarily achieved due to precision loss”

I am getting the warning in the post subject when attempting to optimize a function in Python with the scipy.optimize.fmin_bfgs function. The complete output: Warning: Desired error not necessarily ...
3
votes
2answers
186 views

How to establish that an iterative method can be applied to large matrices whose size may reach 10^3?

I have an iterative method for computing the Moore-Penrose generalized inverse of matrices, that is $$X_{k+1} = ((I-\beta X_{k}A)^t) + X_{k}$$ with initial approximation: $$X_{0} = \beta AA^t$$ ...
13
votes
2answers
1k views

Why would a computational scientist need to implement their own version of std::complex?

Many of the better-known C++ libraries in computational science such as Eigen, Trilinos, and deal.II use the standard C++ template header library object, ...
6
votes
1answer
1k views

Why does std::complex<> initialize its value to 0 upon default construction?

Doing so strikes me as a waste of time. Consider std::complex<double> *a = new std::complex<double>[1<<28]; This could be near-instantaneous ...
7
votes
1answer
250 views

Forced viscous damping in elastodynamics

I have an 2D elastodynamics problem, that is a problem which is driven by the Cauchy equation: $$\rho\ddot u-\mathrm{div}\sigma=\rho f$$ where $u$ is the displacement, $\sigma$ the Cauchy stress ...
8
votes
3answers
2k views

Compute smallest eigenvectors of a matrix

It appears that matlab's eigs is giving me bad approximations of the smallest eigenvectors of a matrix. I assume I can use some slower methods which would also be ...
2
votes
2answers
43 views

The region of allowed values ​​for solving the equation in Mathematica

In[2]:= Solve[sqrt(2x-9) == sqrt(4x+3), x] Out[2]= {{x -> -6}} But mathematically there is no solution, since sqrt (-21) is not defined. There is a flag that ...
3
votes
2answers
4k views

Problems that can be reduced to the Traveling Salesman Problem

Which search/optimization problems can be reduced to the famous "Traveling Salesman Problem"? For instance, I have a collection of N particles, in 3D, and there is a function (Van der Waals energy) ...
4
votes
1answer
197 views

MatMatMult and KSPSolve for MATMPIDENSE matrices

I'm trying to use MATMPIDENSE matrices to solve a system of type Ax=b, but I have some problems. The KSP documentation says that KSPSolve for dense matrices requires to set a 'gmres' solver and a 'lu' ...
5
votes
1answer
69 views

Are there any open standards for data exchange between components of a spatial model?

I'm just getting into climate research, and am amazed at how much poorly documented legacy code is used. This kind of thing means that models more or less have to be maintained by the people who wrote ...
6
votes
3answers
4k views

How to find QR decomposition of a rectangular matrix in overdetermined linear system solution?

While trying to find cell-centered gradients in finite volume method computation of incompressible fluid flow I get over-determined linear system. This is a well known "cell based least-square" ...
11
votes
2answers
1k views

Reporting curve-fit results in a scientific paper

(I hope this question fits this site; if not, accept my apologies). I ran a certain simulation, and got a time series y(t), t = 0, 1, ... 20. After trying some functions, I found that: ...
5
votes
1answer
1k views

Comparing algorithms for tridiagonal linear systems solution

Below there are two algorithms for solving tridiagonal linear systems of the form $$ \left[ \begin{array}{ccccc|c} b_1 & c_1 & & & &d_1\\ a_2 & b_2 & c_2 & & &...
3
votes
1answer
319 views

Generating a tuple in Maple

I am trying to generate a 2 tuple using maple. Can anyone give me the command to generate this? Thank you very much.
22
votes
2answers
4k views

A good finite difference for the continuity equation

What would be a good finite difference discretization for the following equation: $\frac{\partial \rho}{\partial t} + \nabla \cdot \left(\rho u\right)=0$? We can take the 1D case: $\frac{\partial \...
4
votes
3answers
114 views

Whats wrong with my running time calculation?

I am running a linear algebra iterative method (PCG) for solving Ax=b, the dimension of the matrix is 10000x10000. So, I did 2 preliminary analyses: Memory Analysis The size of the matrix dominates ...
3
votes
1answer
169 views

Recover curves from noisy collection of points

Background: I'm trying to make a system that tracks a number of bubbles in a video I'm implementing the bubble detection in the single image case using the Circular Hough Transform. Due to occlusion,...
8
votes
2answers
1k views

Molecular dynamics simulation of water vapor?

I'm trying to do MD on water vapor. As I know there exists some water models for liquid water, such as SPC,SPC/E,TIP3P, but will they also apply to vapor state of water? And what's the difference of ...
9
votes
2answers
119 views

Estimate Norm of a black-box functional

Let $V$ be a finite-dimensional vector space with norm $\|\cdot\|$ and let $F : V \rightarrow \mathbb R$ be a bounded linear functional. It is only given as black-box. I would like to estimate the ...
4
votes
1answer
69 views

How to use a web-embedded model in a computational workflow?

There is a model embedded in a web browser (Caprio 1998) that I would like to use in an MCMC algorithm. What is the best way to do this? I could implement the model in my favorite language but I ...
7
votes
3answers
327 views

Given large $x \in \mathbb{R}$, How to determine if $2^x$ is an integer?

Given large $x \in \mathbb{R}$, I want to know whether or not $2^x$ is an integer. Is there any fast way to answer the question for $x>2^{500}$? I have also asked a slightly different form of this ...
4
votes
1answer
129 views

Constructing the origin position by transforming distance information

Suppose a set of $n$ points, $n\in M$, is given in some $d-$dimensional space, $X\in\mathbb{R}^{n\times d}$. Among these $n$ points, some $k\in K$ are selected, so $k<n$, and the distances from ...
6
votes
2answers
384 views

Tools for computing an electric field based on location of charges?

I have the positions of a large number of charges (the strengths are known, but are also variables). Are there any tools that will allow me to visualize the electric field induced by these charges (or ...
2
votes
2answers
2k views

Depth of a Binary Search Tree

I wrote a function to search a Binary Search Tree, but I have logic problems: When I insert some values, and I have a tree of 2 levels, and the final level (2 in this case) is not full (full is that ...
4
votes
1answer
172 views

Estimating time for running serial/parallel codes

Assume I am running an iterative method, I have a rough estimate of how many iterations it will need, How do best estimate the time it will run for in serial? For instance, If I have Conjugate ...
8
votes
4answers
4k views

Are DAXPY, DCOPY, DSCAL overkills?

I have implemented CG in FORTRAN by linking it to Intel MKL. When there are statements like: (Refer Wikipedia) p=r; x=x+alpha*p r=r-alpha*Ap; or similar ...
11
votes
4answers
4k views

What are the best Python packages/interfaces to sparse direct solvers?

Please list the Python package (petsc4py, etc...) and the sparse direct solvers it supports. One (community-wiki) answer per package, please.
4
votes
3answers
498 views

Quality Measures for Various Pseudo-Random Number Generators

According to this paper, Ideally, a pseudorandom number generator would produce a stream of numbers that: are uniformly distributed, are uncorrelated, never repeats itself, ...
9
votes
2answers
417 views

Is there a generalization of the Sylvester Inertia Law for the symmetric generalized eigenvalue problem?

I know that in order to solve symmetric eigenvalue problem $Ax = \lambda x$, we can use the Sylvester Inertia Law, that is the number of eigenvalues of $A$ less than $a$ equals the number of negative ...
7
votes
0answers
139 views

Potential Reduction and Primal Path following methods

In both the potential reduction and primal path following interior point methods for linear programming, a barrier function is constructed which contains the terms $-\sum \log x_j$ where $x_j$ are the ...
1
vote
1answer
208 views

Error message when trying to get PETSc to draw to an X terminal by passing -mat_view_draw

I've made a matrix, and now I want to draw it on the screen to make a basic check of correctness. The documentation for MatAssemblyEnd() states that I can pass an ...
11
votes
2answers
4k views

FEM: singularity of the stiffness matrix

I'm solving the differential equation $$ \left( \sigma^{2}(x) u ''(x) \right)'' = f(x), \;\;\; 0 \leqslant x \leqslant 1 $$ with initial conditions $u(0) = u(1) = 0$, $u''(...
3
votes
0answers
156 views

Is there an easy way to read a PetscBag into a python dict?

I'm using a PetscBag to store the input parameters of my program. At some point, I'm going to need to use python to plot these parameters against some output parameters, and ...
7
votes
3answers
216 views

Converting from planar polynomial domain to planar polygon

Let's assume we have a planar domain whose boundary can be described with a polynomial curve (like Bezier curves). Now assume that you want to produce a discretization of the boundary, i.e. you want ...
10
votes
1answer
481 views

How to find the interior eigenvalues by krylov subspace method?

I am wondering how to find the eigenvalues of some sparse matrix in given interval [a, b] by iterative method. To my personal understanding, it is more obvious to use Krylov subspace method to find ...
2
votes
1answer
557 views

Implicitly casting PetscReal to the real part of PetscComplex

The version of Petsc installed on my machine has PetscScalar set to be complex. I am making a matrix which has all real entries. Something like the following code compiles: ...
5
votes
2answers
473 views

What does symmetrize mean? (imposing multifreedom constraints to stiffness matrix)

I have a small FEM implementation program. And I want to add imposing multifreedom constraints (MFC) feature to it. The theory of master-slave method is given here (page 10 for general case). ...
5
votes
1answer
736 views

Finite-difference discretization for a convective term

How does one discretize the classical convective term in a transport equation using finite differences? I know the finite volume schemes out ther i.e. upwind, central differencing etc. Are there ...
11
votes
4answers
2k views

Finding the square root of a Laplacian matrix

Suppose the following matrix $A$ is given $$ \left[\begin{array}{ccc} 0.500 & -0.333 & -0.167\\ -0.500 & 0.667 & -0.167\\ -0.500 & -0.333 & 0.833\end{array}\right]$$ with ...
23
votes
5answers
459 views

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.) ...
6
votes
1answer
256 views

Adaptive h for gradient estimation

Can anyone point me to methods for varying $h$ in gradient estimation for noisy numerical optimization? Some programs have the user give a fixed $h$, which is used for forward-difference or central-...
9
votes
1answer
832 views

Optimal use of Strang splitting (for reaction diffusion equation)

I made a strange observation while computing the solution to a simple 1D reaction diffusion equation: $\frac{\partial}{\partial t}a=\frac{\partial^2}{\partial x^2}a-ab$ $\frac{\partial}{\...
15
votes
3answers
2k views

I/O Strategies for computational problems with large data sets?

My research group focuses on molecular dynamics, which obviously can generate gigabytes of data as part of a single trajectory which must then be analyzed. Several of the problems we're concerned ...
4
votes
0answers
602 views

Perron-Frobenius theorem on general real symmetric matrices

From the Perron-Frobenius theorem, it might be concluded that the spectral radius is the largest eigenvalue for positive matrices, ie, matrices with strictly positive entries. In other words, the ...
16
votes
4answers
2k views

Why can't Householder reflections diagonalize a matrix?

When computing the QR factorization in practice, one uses Householder reflections to zero out the lower portion of a matrix. I know that for computing eigenvalues of symmetric matrices, the best you ...
3
votes
0answers
69 views

Understanding how Numpy does SVD [duplicate]

Possible Duplicate: Understanding how Numpy does SVD I have been using different methods to calculate both the rank of a matrix and the solution of a matrix system of equations. I came across the ...
13
votes
3answers
7k views

Understanding how Numpy does SVD

I have been using different methods to calculate both the rank of a matrix and the solution of a matrix system of equations. I came across the function linalg.svd. Comparing this to my own effort of ...

15 30 50 per page