instruction
stringlengths
43
28.1k
I'm trying to solve this problem using genetic algorithms and am having difficulty choosing the fitness function. My problem is a little different than the original Traveling Salesman Problem, since the population and maybe also the win unit do not necessarily contain all the cities. So, I have 2 values for each unit: ...
I have an issue of finding the cut sets of large voxel sets. The voxels are assumed connected if they touch by face/edge/vertex (can vary), and ideally what I want is given any two members of the set to find a minimal cut set of voxels that separates them into two components. The sets are 'large', 10^7 upwards, so I'm ...
After doing some research, I've found that most of the literature on operator splitting methods (e.g. Strang Splitting, Fractional Step, etc.) are specifically designed for a standard problem type of the form: $$u'=(A+B)u.$$ In my application, I have a slightly different form: $$Mu'=(A+B)u$$ where $M$ is not the identi...
I have worked out some poor code to achieve the goal of 3D Delauney triangulation(random points in E3), but the time consuming is huge, and when five points are exactly (or nearly due to the round-off error) on one sphere, my code can not handle this situation properly. I use the basic data-structure which is a list of...
I want to approximate the integral: $$ I = \int f(\boldsymbol{x})d\boldsymbol{x} $$ where $\boldsymbol{x}$ is $d$-dimensional. I have a set of non-equally spaced points $\boldsymbol{x}_1, \dots, \boldsymbol{x_n}$, and the corresponding values $f(\boldsymbol{x}_1), \dots, f(\boldsymbol{x_n}$), and I would like to use t...
For 1D derivative we have \begin{equation} F(x) = \frac{\partial f(x)}{\partial x} \end{equation} \begin{equation} f(x)=\sum_{i}f_ie_i(x) \end{equation} \begin{equation} F(x)=\sum_{i}F_ie_i(x) \end{equation} where $e_i(x)$ are the FEM basis functions. We can then apply the Galerkin procedu...
I'm testing Quicksort based on Niklaus Wirth algorithm. I'm checking how much time I need to sort an array. There is interesting thing that for an array consisting elements in these sequence: 1 3 5 7 9 10 8 6 4 2 (example how an array looks like for bigger instance) 0.14 seconds - array with ...
Suppose I have a time-dependent PDE discretized by the Rothe method and FEM, like $$ \int_{\Omega} k^{n+1/2}(u^{n+1}-u^{n}) v \;\mathrm{d}x = F^{n+1/2}(u^{n+1},u^n)[v] \quad \forall v\in V_h^n. $$ What is a good way of quantifying the difference between a transient solution $u^{n} \in V_{h}^{n}$ and a stationary solu...
I was attempting to do a discrete Fourier transform through a computer program on a list of numbers. Before doing that I decided to test it by running through a list of 1000 numbers which I created by summing 20 sine waves which were created by the formula sin(2*pi*integer between 1 and 1000/ desired frequency). Based ...
I have a set of known points/nodes irregularly spaced in N-Dimensional space (N>=2), and I would like a way to generate the Delaunay triangulation of these points, and return the corresponding elements. Are there any existing meshing libraries that will do an N-D Delaunay triangulation? (I am doing this because I want...
Disclaimer In the process of typing up this question, I determine its solution. Since I went through the trouble of typing up the question in its entirety, I will post its answer as well. It may help out others who find themselves in the same predicament. Think of this as a sort of blog-post, if you will. The Goal C...
I want to develop a visual simulation of a propagating 2D wavefunction with an added attractive potential. Basically I have to numerically solve the time-dependent Schrodinger equation (PDE with x,y,t as variables) but, instead of boundary conditions, I want to have an incoming wavefunction of my choice as the initial ...
How to do transpose for trtrs (or tptrs) in blas? I want to solve: XA = B But it seems that trtrs only lets me solve: AX = B Or, using the 'transpose' flag, in trtrs: A'X = B which, rearranging is: (A'X)' = B' X'A = B' So, I can use it to solve XA = B, but I have to first transpose B manually myself, and then, agai...
I'm compiling a blas to use with scalapack. Some blases, such as openblas, are naturally multithreaded, but scalapack uses mpi, so maybe needs a single-threaded blas? My questions then are: does scalapack need a multi-threaded blas? a single-threaded blas? or it will work just fine on either because, for example, i...
I am given a $12 \times 12$ matrix $Q$ that is symmetric, invertible, positive definite and dense. I need to test if $$\det(Q) = \det(12I-Q-J) \; \; (1)$$ where $J$ is the all ones matrix. I am currently doing this with the armadillo library but it turns out to be too slow. The thing is that I need to do this for a tri...
Overview My understanding is that one should use a time step $\Delta t < \frac{h}{v}$ (where h - smallest mesh element, v - velocity) to get an accurate result. But how important is this really for the accuracy of the simulation? Is it as important as having an independent mesh? Is there even such a thing as a time ste...
Hello there and thanks for taking a look at this problem. This problem is related to my previous question and I will therefore use a similar introduction from, Choice of step size using ODEs in matlab. Introduction: I'm currently studying a 2D exciton spinor Bose-Einstein Condensate and am curious about the ground sta...
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? My question is also related to this question: What is the fastest way to calculate the largest eigenvalue of a general ...
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 formula in the following way: $D^-[D^+(U)]$, where $D^-$ and $D^+$ are the backward and forward difference formulas. I...
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 subsequence of it), how can I reconstruct the parameters $a,c,m$ and $x_0$ that produced this sequence? I'm looking for a ge...
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{align*}$$ I want to compute the sensitivity indices of each equation with respect to the parameters $a$, $c$, and $m$. That is, compute $\fr...
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 to the stem the roots get larger in length and diameter. I want to create random 3D domains that represents the network...
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 = 0$ on $\partial\Omega$ has a unique solution in $H^2$ and is well-posed, i.e. for some constant $C$ we have $\|u\|_{H^...
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 function linalg.svd, which I now learned is in fact a LAPACK routine. Comparing this to my own effort of solving the syst...
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 solving the system with Gaussian Elimination, it appears to be both faster and more precise. I'm trying to understand how...
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 can do with Householder reflections is getting it to tridiagonal form. Is there an obvious way to see why it can't be ful...
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 largest magnitude eigenvalue of a symmetric, real, positive matrix, is a positive eigenvalue. However, I'm interested if the...
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 with involve correlations in the data set, which means that we need to keep track of large amounts of data in memory and ana...
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}{\partial t}b=-ab$ $\frac{\partial}{\partial t}c = a$ The initial value of $b$ is a constant ($b(0,x)=b_0$), and I'm only interested i...
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-difference gradient estimates the whole time, from initial roughly-linear slopes to roughly-quadratic valleys near a minim...
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.) However, it's not clear to me how much information I should include with a journal article (or online) to make my computat...
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 its transpose $A^T$. The product $A^TA=G$ yields $$ \left[\begin{array}{ccc}0.750 & -0.334 & -0.417\\ -0.334 & 0.667 & -0.333\\ -0.417 & -0.333 ...
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 direct finite difference analogs? I am modelling gas combustion in porous media. There are several PDEs involved and my ques...
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). Stiffness matrix (static truss) is given in a rearranged block form: $ \begin{bmatrix} K_{uu} & K_{um} & K_{us} \\ ...
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: PetscScalar value_for_matrix; value_for_matrix=some_expression*returns_PetscReal; Is the real value returned by the right hand side put into the r...
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 the extreme eigenvalues rather than the interior ones.
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 to produce a polygon by sampling the polynomial defining the boundary of the domain. How can I produce a boundary that in...
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 dicts along with matplotlib seem to be the way to go with this. Basically, I want to use PetscBagView() or something like it to write a petsc bag ...
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''(0) = u''(1) = 0$. Here $\sigma(x) \geqslant \sigma_{0} > 0$ is parameter. In operator form we can rewrite the differential equation as $Au = f$...
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 option to do this: -mat_view_draw - PetscDraws nonzero structure of matrix, using MatView() and PetscDrawOpenX(). But when I run my program with this optio...
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 variables. This is to keep the variables from being 0 and thus keep the current solution feasible. However, in potentia...
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 entries of $D$ where diagonal matrix $D$ comes from the LDL factorization of $A-aI = LDL^{T}$. Then, by bisection method...
According to this paper, Ideally, a pseudorandom number generator would produce a stream of numbers that: are uniformly distributed, are uncorrelated, never repeats itself, satisfy any statistical test for randomness, are reproduceable (for debugging purposes), are portable (the same on any computer), can be cha...
Please list the Python package (petsc4py, etc...) and the sparse direct solvers it supports. One (community-wiki) answer per package, please.
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 ones in QMR (in much greater quantity) v_tld = r; y = v_tld; rho = norm( y ); w_tld = r; z = w_tld; xi = norm( z ); (and more) Does it make sense to use BLAS Lev...
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 Gradient (for Ax=b), how do I estimate how long it will run for given that I know the matrix dimension? Specifically, I wish to...
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 it does not have all child nodes) it returns 3, not 2: // --- Definition of depth() template<typename DataType> int BST<D...
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 by a subset of these charges)? Are there such tools that are connected to visualization routines, so that these can be ...
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 these $k$ points to a all other points are calculated and stored in $D\in\mathbb{R}^{n\times k}$. Now, given only this dista...
So, we are solving the Biharmonic equation ($\Delta^2 u = f$) on a rectangle by solving the Poisson equation ($\nabla^2 u = f$) two times. We have nice boundary conditions, $u = 0$ and $\Delta u = 0$ on the boundary. We use a 5 point scheme where $\frac{1}{h^2} \delta_x^2u_p + \frac{1}{k^2} \delta_y^2u_p = f_p + \tau_p...
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 question on math.se: How many significant figures are needed in base 2?
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 would like to know if it is possible to either write a web-scraping / mechanize script to evaluates the model and dumps the o...
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 norm of $F$ (from above and below). As $F$ is a black-box, the only way to do so is to test it with unit vectors from $V$ a...
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 simulations of liquid and vapor water?
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, blur and other factors, this detection will never be 100% accurate. I am tuning the detection procedure for high recal...
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 \rho}{\partial t} + \frac{d}{dx}\left(\rho u\right)=0$ For some reason all schemes I can find is for the formulation in Lagr...
I am trying to generate a 2 tuple using maple. Can anyone give me the command to generate this? Thank you very much.
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 & & & d_2\\ & \ddots & \ddots & \ddots & & \vdots\\ & & a_{n-1} & b_{n-1} & c_{n-1} & d_{n-1}\\ & & & a_n & b_n & d_n \end{array} \right]. $$ I called th...
(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: y(t) =~ 1 / (A t + B) Where A and B are coefficients I calculated using linear regression, with R^2 > 0.99. What is the standard way t...
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" gradient reconstruction. I know in theory that by using least squares we search for a solution which minimizes error vector in...
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 them originally. If there was a good open standard for generic data exchange between components of a spatio-temporal mo...
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' preconditioner, the problem is that a 'lu' preconditioner doesn't work in parallel and the corresponding 'asm' doesn't ...
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) which depends on their coordinates. I want to find which configuration of the system minimizes the value of the function. ...
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 is responsible for this?
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 more accurate... I am looking to find the 2nd smallest eigenvector of a lapalcian matrix (known as the "fiedler" vector). I know of course that the smallest...
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 tensor, $f$ the density of volumetric forces, and $\rho$ the mass density. The constituve law is Hook's law from linear elast...
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 and only grab pages once they're used, except it isn't. It appears I'm not the only one bothered by this: http://listengine.tuxfamily.org/lists.tuxfamily.org/eigen/2011/01/msg001...
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, std::complex<>, to represent complex floating-point numbers. In Jack Poulson's answer to a question about default constructors, he points out that he has his own impl...
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$$ where: $A$ is a given $m \times n$ matrix $\beta \in [0,1]$ $X_{k}$ is the $k$th iterate generated by the algorithm, appro...
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 achieveddue to precision loss Current function value: nan Iterations: 1 Function evaluations: 18 Gra...
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 expensive simulations can't quantitatively reproduce the full behavior of water from first principles. Previously, I had be...
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 triangle. He didn't give a set of explicit basis functions just the standard degrees of freedom on the quadrature points. Si...
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 reference for) higher-order formulas on a simplex?
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 the total storage required. Thats about 1E4 x 1E4 = 1E8 elements of double precision which is approximately 0.8 GB of da...
I am working on an assignment where I am determining the temperature distribution of a chip on a substrate. When I decrease the nodal spacing the results change drastically. The smaller the nodal spacing the larger the temperatures i get. However when the nodal spacing is really small as in .00001m the temperature is n...
It was suggested I should try posting this question here from Mathematics Background I'm working on a numerical linear algebra package in C#. I'm trying to implement a variety of "principal pivoting" methods to solve optimization problems (specifically linear complementarity problems, but I think similar schemes are ...
Which is the fastest library for performing delaunay triangulation of sets with millions if 3D points? Are there also GPU versions available? From the other side, having the voronoi tessellation of the same set of points, would help (in terms of performance) for getting the delaunay triangulation?
I am doing research on the structure in the Schur complements and find an interesting phenomenon: Suppose that A is from 5--pt laplacian. If I use nested dissection ordering and multifrontal method to compute the LU factorization and then check the last schur complement block, it has low-rank for the off-diagonal block...
When memory bandwidth limited computations are performed in shared memory environments (e.g. threaded via OpenMP, Pthreads, or TBB), there is a dilemma of how to ensure that the memory is correctly distributed across physical memory, such that each thread mostly accesses memory on a "local" memory bus. Although the int...
I am not an xray crystallographer, but from what I've heard there's often a good deal of guess work and intuition involved in the process of fitting a ball-and-stick molecular model to a crystal-derived electron density map. This guess work tends to introduce a substantial amount of error into the the final set of atom...
I'm writing a petsc code using a sequential matrix type. Since I want it to be easy to parallelize, I put some stuff in the code that is useless now, but will make it easier to parallelize later. One of the things I added was MatGetOwnershipRange() to define the range of iterators that I'm using to build a matrix. The ...
The meta seemed to suggest that career advice is ok . . . so here goes. I have a couple of close friends in the ML and mathematical modeling fields just finishing PhD's and starting out on the job hunt. While both are quite qualified and talented, neither are interested in staying in Academia. Besides personal referr...
Basically the formulation of the problem I'd like to solve is very simple. Given 2 simple polygons (without self-intersections) report all intersecting edge pairs in O(n+k) time, where n - is a total number of edges, k - number of intersections between two polygons. It is very important to stay within mentioned time ha...
I've had a glimpse of Numerical Analysis (majorly, Numerical Methods like root finding, quadratic equations and other preliminary stuff) in my Calculus class but now, I find myself wanting more sophistication in my work. Is there a good book which will help me understand concepts such as stability of algorithms, desig...
I would like to master Inverse PDE Problems particularly with the use of Finite Elements. My problem is I don't know where to start. Should I begin by reading a book on Inverse Problems or on PDE-constrianed Optimization! Could I get some book recommendations and/or route to follow.
Suppose A is a general sparse matrix, and I want to compute the eigenvalues. I do not know how to detect the multiplicity for the eigenvalues. As far as I know, for a special case, finding the polynomial roots by companion matrix method, we can apply RRQR to detect the multiplicity for the roots.
I have a similarity matrix which is symmetric and sparse. How can I parallelize the computation of the eigenvalues of this matrix in MATLAB?
I have a class of matrices $A$ which are created by a domain decomposition method. Each matrix represents several subproblems of equal size, and I know that for some permutation matrix $P$, $PAP^T$ will be a block diagonal system, i.e. $$ A = \begin{bmatrix} A_1 & 0 & 0 \\ 0 & A_2 & 0 \\ 0 & 0 & A_3 \\ \end{bmat...
I have a job which stops unexpectedly with Exit_status=15. What is the most probable error ?
As far as I understand, the order in which non-blocking point-to-point MPI messages (Isend and Irecv) are received is consistent with the order in which they are sent. Are there any techniques for giving certain messages priority over others? For example, we have a multi-level algorithm in which the high resolution so...
Given the system $$Ax=b,$$ where $A\in\mathbb{R}^{n\times n}$, I read that, in case Jacobi iteration is used as a solver, the method will not converge if $b$ has a non-zero component in the null-space of $A$. So, how could one formally state that, provided that $b$ has a non-zero component spanning the null-space of $...
For a general matrix A, there are many properties to describe it: symmetric positive definite or indefinite, condition number, spectrum and so on. I am curious about how these properties affect the solving of matrix A for both direct method and iterative method like multigrid, krylov subspace methods. Thanks.
I have a Hermitian matrix $\mathbf{H}$ which depends on two parameters say $x$ and $y$. When I diagonalize it at two close points $(x_1,y_1)$ and $(x_2,y_2)$ I get two close eigenvalues ($\varepsilon_1$ and $\varepsilon_2$) and two corresponding eigenspaces ($S_1$ and $S_2$) of the same dimension. Note that they are n...
I'm trying to match items. Given a set of $n$ items I can rank on a scale from 0 to 100 of how similar they are to one another. For instance, if item $n_1$ is milk and item $n_2$ is also milk, then the similarity between $n_1$ and $n_2$ would be 100%. If $n_3$ is soda, then the similarity between $n_1$ and $n_3$ would ...
For computing the gradient of a scalar field, one can use the weighted least squares method as described in the paper Revisiting the Least-squares Procedure for Gradient Reconstruction on Unstructured Meshes by Dimitri Mavriplis (pg. 23). My question is: How can I reconstruct a gradient of a vector field? In the paper ...
I am new to programming and I am trying to solve my first big problem and write my first big program. I have looked for open source examples of code to learn from, but so far have only found code in languages I don't fully understand or that does related but still-too-distant things for me to really learn from. I am ha...
Suppose two Gram matrices are given $A, B\in\mathbb{R}^{n\times n}$, such that $$A=XX^T,~~~~~~~~~~~~~B=YY^T,$$ for some $X, Y\in\mathbb{R}^{n\times k}$, $k\ll n$. Also, suppose a Gram matrix based on linear interpolation $X+Y$ is denoted by $C=(X+Y)(X+Y)^T$. I'm aware that $$C=A+B+XY^T+YX^T,$$ but I wonder how I could ...
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 noise (except floating point granularity, say). What would be the best w...
The fact that the back substitution is not done in parallel is not important, because it uses a negligible amount of computer time when N is large, compared to the forward elimination. This is a citation from this book (page 204) when discussing the implementation of parallel solution of linear systems using Gaus...
I'm currently getting very long propagation times when attempting to use the Time Stepping propagators in Petsc 3.2, and in the interest of speeding things up, I'm curious how I can reduce the accuracy (or see what it is in the first place) to speed it up.