All Questions

Filter by
Sorted by
Tagged with
11
votes
2answers
5k 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
483 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
559 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
474 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
738 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
836 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
604 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 ...
10
votes
2answers
292 views

What about this simple error estimate for linear PDE?

Let $\Omega$ be a convex polygonally bounded Lipschitz domain in $\mathbb R^2$, let $f \in L^2(\Omega)$. Then the solution of the Dirichlet problem $\Delta u = f$ in $\Omega$, $\operatorname{trace} u ...
13
votes
4answers
326 views

How to create a random 3D domain representing a plant's root structure?

I would like to model laminar flow of water from roots to the stem of a plant. At the very end of the roots, the tubes vary from millimeter to centimeter scale in diameter and length. As we get closer ...
6
votes
3answers
138 views

How can I compute the sensitivity index of an expression with a modulus operator in it?

I have a set of equations of the form: $$\begin{align*} x_1&=(ax_0+c) \bmod (m)\\ x_2&=(ax_1+c) \bmod (m)\\ x_3&=(ax_2+c) \bmod (m)\\ &\vdots\\ x_{n}&=(ax_{n-1}+c) \bmod (m) \end{...
10
votes
1answer
777 views

How can I determine the initial values of pseudo-random number generator if the sequence is given?

Suppose I knew that a random number sequence was generated by a linear congruential generator. That is, $x_{n+1}=(aX_n+c) \bmod m$ If I am given the entire period (or at least a large contiguous ...
7
votes
2answers
224 views

How can I obtain a one dimensional finite difference formula for $U_{xx}$ with unevenly spaced nodes?

I know that if I had evenly spaced points, I can use $U_{xx}\approx \frac{U_{i-1}-2U_{i}+U_{i+1}}{dx^2}$. But if my gridpoints are unevenly spaced, I assume that I can obtain the finite difference ...
6
votes
2answers
243 views

Is it possible to ignore/discard part of a matrix when finding eigenvalues?

I have have multiple large matrices for which I need to find the largest absolute eigenvalue. I know that there is a large submatrix that does not vary. Is it possible to ignore/discard the submatrix? ...
5
votes
2answers
789 views

Matlab: Solving $u_t = f(u) u_{xx} + g(u) u_x + h(u) u$

I am trying to solve the following equation numerically: $$\dfrac{\partial u}{\partial t}=\dfrac 3 x\dfrac \partial{\partial x}\left(\sqrt x \frac \partial {\partial x}(\nu(u,u^2,\cdots,u^k)u\sqrt x)\...
2
votes
1answer
223 views

Proof continuation for rigid transformation on PCA solution

Suppose a matrix $X\in\mathbb{R}^{n\times 3}$ is given as a Principal Component Analysis (PCA) projection from some high dimensional space. The 2D PCA solution on X, say $Y\in\mathbb{R}^{n\times 2}$ ...
2
votes
2answers
1k views

Contiguous prime numbers with MPI (Want more ideas for an efficient algorithm)

I am a programmer. I am working with Message Passing Interface (MPI) in C. I do a program that consist on finding the contiguous prime from 1 to 10,000,000. I already do it! but I do it with trial ...
8
votes
2answers
574 views

How many Fourier magnitudes do I have to calculate before an FFT becomes more efficient than a DFT?

I need to compute only a small number of low frequency Fourier components of a complex 2-dimensional array. I'll be computing the same Fourier components over and over again as the input array changes....
6
votes
1answer
1k views

How does a Sparse Direct Solver know about dimensionality of a problem being solved?

It is claimed that the time and memory complexities of sparse direct solver are $O(N^2)$ and $O(N^{4/3})$ for 3D problems and $O(N^{1.5})$ and $O(N \log N)$ for 2D, respectively. But how does a ...
7
votes
1answer
228 views

Online resources for reviewing graphics cards for GPGPU

Can anyone recommend a site that maintains up-to-date reviews of graphics cards for GPGPU use? Most benchmarks focus on gaming performance, whereas I am interested in the performance of scientific ...
7
votes
3answers
727 views

Largest eigenvalue of FD discrete Laplacian

Is there good approximation for largest (in magnitude) eigenvalue for discrete Laplacian ($\nabla^2$) obtained from nonuniform structured grid (like that)? Of course, one can always use general ...
5
votes
1answer
1k views

Drawing isocontour data of 3d discrete volume with mayavi2

I'm trying to visualize the propagation of heat in a discrete sphere surface. The sphere is hollow, only the voxels of the boundary have value. Visualization in matlab using isosurface shows correct ...
7
votes
3answers
8k views

Gershgorin Circle Theorem to estimate the eigenvalues

In order to estimate the eigenvalues of a real symmetric $n\times n$ matrix, I intend to use the Gershgorin Circle Theorem. Unfortunately, the examples one might find on the internet are a bit ...
6
votes
2answers
723 views

Using algebraically smallest eigenvalues to find smallest in magnitude eigenvalues

I have a symmetric indefinite matrix, $H$. I also have a routine that can compute the algebraically smallest eigenvalues of a symmetric indefinite matrix. I would like to compute the eigenvalues with ...
8
votes
4answers
1k views

Generating Symmetric Positive Definite Matrices using indices

I was trying to run test cases for CG and I need to generate: symmetric positive definite matrices of size > 10,000 FULL DENSE Using only matrix indices and if necessary 1 vector (Like $A(i,j) = \...
1
vote
1answer
671 views

Gradient descent to stationary, or accumulation point

I recently came across the notion of an accumulation point as a result of a certain gradient descent variation. The following definition was found: An accumulation point $P$ is such that there are an ...
4
votes
1answer
321 views

Convert ODE into discrete probabilistic model

how can I turn an ODE equation into a discrete probabilistic model? I take for example the Verhulst equation for the growth of a population. $$\frac{dP}{dt} = rP(1-P/K)$$ I was thinking to simulate ...
2
votes
2answers
952 views

Mesh domain decompositions / mesh partitioning

I have some experience with mpmetis from METIS. It is pretty good software which offers unstructured mesh grid partitioning. But obtained results always minimize edgecuts or total communication volume....
11
votes
4answers
6k views

solving coupled ODEs with initial-value and final-value constraints

The essence of my question is the following: I have a system of two ODEs. One has an initial-value constraint and the other has a final-value constraint. This can be thought of as a single system with ...
11
votes
2answers
5k views

How does the computational cost of an mpi_allgather operation compare with a gather/scatter operation?

I'm working on a problem that can be parallelized by using a single mpi_allgather operation or one mpi_scatter and one mpi_gather operation. These operations are called within a while loop, so they ...
11
votes
2answers
3k views

What is the corresponding LAPACK function behind Matlab [Q,R,E]=qr(A)?

I currently trying to cheaply compute a good rank estimate for a matrix $A$. Therefore I compute a columnt pivoting QR decompostion using [Q,R,E]=qr(A) in ...
4
votes
1answer
159 views

reverse-lookup Digital Object Identifier given table of citations? [closed]

I asked this question on stackoverflow a few weeks ago, but have not gotten a useable answer, even after a colleague added a 150pt bounty. Is it possible to query the doi for each record in a table ...
19
votes
6answers
945 views

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 ...
5
votes
2answers
327 views

Linear regression with quadratic constraints

What methods are suggested to solve problems of the form $\min || {A} x - y ||_k$, subject to $x^T P x \leq c$, and/or $x^T Q x = d$?
7
votes
0answers
151 views

Fast algorithms to solve Markov Decision Processes

In my master thesis I used an Algorithm called Approximative Dynamic Programming [1] to solve equations of the form $$ \max_{\pi}\mathbb{E}^{\pi}\left\{\sum_{t=0}^{T}\gamma^tC_t^{\pi}(S_t,A_t^{\pi}(...
1
vote
3answers
244 views

Unique coordinates (solutions) in a single Gauss-Seidel iteration

I managed to reduce certain computational problem to the Gauss-Seidel solution of the following linear system: $$Ax=Ly,$$ where $A, L\in\mathbb{R}^{n\times n}$ are weighted Laplacian matrices (...
10
votes
4answers
3k views

Nonlinear least squares with box constraints

What are recommended ways of doing nonlinear least squares, min $\sum err_i(p)^2$, with box constraints $lo_j <= p_j <= hi_j$ ? It seems to me (fools rush in) that one could make the box ...
17
votes
6answers
3k views

To what extent is generic and meta-programming using C++ templates useful in computational science?

The C++ language provides generic programming and metaprogramming through templates. These techniques have found their way into many large-scale scientific computing packages (e.g., MPQC, LAMMPS, CGAL,...
1
vote
1answer
901 views

Multidimensional Minimization: GNU GSL C++ error code 27 for - iteration is not making progress towards solution

I am trying to find the minimum of the function using GNU scientific library, package Multidimensional Minimization. The method I am using is Broyden-Fletcher-Goldfarb-Shanno (BFGS) algorithm which is ...
0
votes
1answer
915 views

A Comparison between GMRES, QMR and LU for Dense Matrices

As I see it, there are 3 ways to solve unstructured dense system of equations: GMRES, QMR and LU. Has anyone done a comparison for these three? As far as I know, LU is the preferred choice and it is ...
3
votes
3answers
2k views

What modern OOP features should a computational scientist use? [closed]

Many computational scientists that I know of, including myself for example, are not computer scientists. As such they are often not very well aware more advanced techniques in OOP. On the other hand, ...
15
votes
3answers
2k views

Why isn't my Matrix-Vector Multiplication Scaling?

Sorry for the long post but I wanted to include everything that I thought was relevant in the first go. What I want I am implementing a parallel version of Krylov Subspace Methods for Dense Matrices....

15 30 50 per page