instruction
stringlengths
43
28.1k
I'm dealing with a set of points which are already placed on the 2D hull boundary: a convex polygon. I know this for sure. However, the point set is not ordered, and I need the polygon points to be ordered counter-clockwise. I'm aware of all the 2D algorithms for convex hull generation from the books/literature, but I...
Suppose I am solving a pde with a solution known with a finite-difference method. I can represent it as $A_hu_h=f$ for some approximating matrix $A_h$. And I define the discrete norm in which I will analyze the convergence to be $$||e||^2=h\sum e_i^2$$. I have the estimate for the error $$||e||\leq C ||\tau||$$ for $\t...
I'm working from ex2.c of PETSc's example codes. On line 65, the code specifies: MatMPIAIJSetPreallocation(A,5,PETSC_NULL,5,PETSC_NULL); I looked up the documentation for MatMPIAIJSetPreallocation(), and understand that its purpose is to allocate memory for the matrix in a compressed sparse row format in parallel...
Many algorithms used in scientific computing have a different inherent structure than algorithms commonly considered in less math-intensive forms of software engineering. In particular, individual mathematical algorithms tend to be highly complex, often involving hundreds or thousands of lines of code, yet nonetheless ...
What is the best known algorithm for exactly solving a large sparse system of linear equations? The system I'm working on is not symmetric, not positive definite and integer. The only benefit is being sparse. I also need to point out that the matrix is not square. The dimension is m×n and it is not generally either und...
Suppose I have a sparse stochastic matrix $M$ (with thousands or millions of stochastic column vectors), possibly encoding some links in a web graph. Now I split it into two matrices: $D$ containing only the diagonal entries of $M$, and $R$ containing the remaining entries of $M$. What would be a fast way to compute $D...
As stated in the title, I encountered a proof with the final statement of the form "the eigenvalues of A are then $\{\lambda_1+c, \lambda_2, \dots, \lambda_n \},$ counting algebraic multiplicity. What does "Counting algebraic multiplicity" mean in general? I'll then try to apply the "general" to my specific problem.
I want to solve the following expression (used to obtain an analytic solution to a current distribution inside a workpiece): $$a_{mn} = -\frac{\frac{4}{ab} \int_0^a \int_0^b f(x',y')\sin(px')\sin(qy')\mathrm{d}x'\mathrm{d}y'}{t\sinh(tc)}$$ Here. $a$,$b$ are scalar constants and $p = \frac{m\pi}{a}$, $q = \frac{n\pi}{b}...
Suppose I have a symmetric linear operator $A:\mathbb{R}^k \rightarrow \mathbb{R}^k$ where $k$ is "small" (eg., $k=100$), and I want to find it's first few eigenvectors, (eg., $10$ eigenvectors). If we had a matrix representation of $A$ this would be a standard problem in dense numerical linear algebra. However, the ca...
Assume you have a stability constraint between the space distance in time and space, for example, with an explicit Euler method for $u_t=u_{xx}$ we know $\tau\leq h^2/2$. That is, one can do stability analysis for a uniform grid, obtain a constraint and then take the minimum over a nonuniform grid for the spacing to se...
This question is not very deep. Suppose I have a small rectangular matrix $A$, with number of rows and columns between $50$-$100$, respectively. Given a right-hand side $b$, I want to solve the least-squares problem $Ax = b$, i.e., I want to find $x$ with norm-minimal residual $r = b - Ax$ and $x$ having minimum norm a...
I want to invert a 10X10 antisymmetric matrix in Python around 10,000 - 20,000 times. Is there a faster way to do it other than to use the built-in inverse function in Python? Thanks.
I'm very new to GPGPU programming so please forgive me if the question is not particularly appropriate. From what I understand GPU programming is a very intricate piece of engineering work when compared to usual CPU programming. One has to be very careful about divergence issues, tiling, pinned memory allocation, and h...
I have been reading a book by Thomee and he considers the case of $u_t=(au_x)_x$, for the case of $a$ possibly being discontinuous. Then he says that the problems with convergence might occur, and thus to fix that one can smooth the coefficient $a$ and restore convergence rate. Please correct me if I am wrong but disc...
I am trying to solve complex valued Poisson equation $$(C + \nabla. D \nabla )u = f \text{ ;where C, D, u and f are complex numbers.} $$ I am breaking this eqn into real valued problem, which is of the form $$ \underbrace{\begin{pmatrix} C_r + \nabla. D_r \nabla & -C_i - \nabla. D_i \nabla \\ C_i + \nabla. D_i \na...
Recently, I saw this question: how to measure the error of a finite difference method I am student of simulation sciences and unfortunately, for me, it's totally unclear, what norm to use in what context. Quite often, we use the Euclidian norm or the L2 norm, but why does one choose different norms, what's their meanin...
The following MATLAB function produces the Eigenvalues and Eigenvectors of matrix X. [V,D] = eig(X) produces a diagonal matrix D of eigenvalues and a full matrix V whose columns are the corresponding eigenvectors so that X*V = V*D. My questions are: Does this mean that the first (or principal or dominant) eigenvector...
I have been reading a recent paper. In it, the authors performed molecular dynamics (MD) simulations of parallel-plate supercapacitors, in which liquid resides between the parallel-plate electrodes. To simplify the situation, let us suppose that the liquid between the electrodes is argon liquid. The system has a "sla...
The journal Association for Computing Machinery Transactions on Mathematical Software (ACM TOMS) publishes many articles on numerical algorithms that include software implementations. According to their editorial policy, submission of an algorithm paper includes the source code for an implementation of the algorithm de...
Assume the optimal value of a primal problem is bounded. Is the following statement true? If the primal problem is bounded, then its dual problem is bounded as well.
Consider a min cost flow problem in a directed graph $G=(V, E)$ as follows: (*) Min $\sum {c_{ij}f_{ij}}$ s.t.: $\sum_{j\in out(i)}{f_{ij}} - \sum_{j\in in(i)}{f_{ji}} =b(i)$ for each $i\in V$ $f_{ij} \geq 0$ $in(i)$ and $out(i)$ are the set of arcs coming into node i and going out of node i, respectively...
I'm using Richard Hartley's rectification algorithm to rectify a pair of images before performing stereo disparity computation. The problem is I'm observing shearing in one of the rectified images and it's causing problems on disparity computation. Consider these two input images (the points pairs were produced using S...
I have a MPI computation with the following structure: each processor has a large region of read-only memory divided into chunks. During a compute epoch, each processor performs a (different) number of steps of the form: Gather several chunks of data different processors. Do some computation and store the results. D...
The comments on the accepted answer of my previous question here have left me with a more general question about accurately capturing shockwaves in fluid calculations. For the sake of having an example, let's say we have a standing shockwave with a pressure or density ratio of 10:1 measured at two points one unit lengt...
I was wondering whether there is a fast and efficient method to find the number of non zeros in advance for sparse matrix multiplication operation assuming both matrices are in CSC or CSR format. I know there is one in smmp package but I need something that is already implemented in C or C++. Any help will be apprecia...
Suppose I have N different airplanes traveling on a two dimensional rectangular plane of size 400km x 400km (i.e. it is as if all planes travel at the same altitude). Assume each airplane has a randomly generated starting and ending points. Also, assume that the airplanes can have different speeds. We assume that tw...
I have part of a problem that is described by the momentum conservation equation: $\frac{\partial \rho}{\partial t} + \frac{1}{\sin\theta} \frac{\partial}{\partial \theta}(\rho u \sin \theta) =0$ Where $u=f(\theta)$ and $ \rho = f(\theta,t) $ (constant velocity). Naively one could apply one of the solutions listed he...
The Journal of Computational Physics has been an important outlet for computational science in the past, and I have published there before. For the benefit of those (like me) who have signed the Elsevier boycott, what non-Elsevier journals would be appropriate places to publish articles that could have been submitted ...
I've seen a lot of publications in Computational Physics journals use different metrics for the performance of their code. Especially for GPGPU code, there seems to be a great variety of timing results people publish. In particular, I've seen: Comparisons of (essentially) running time on the GPU and CPU versions and r...
I have a bunch of MPI processes exchanging request messages back and forth. Processes do not know which other processes will send them messages, or how many. Given this situation, I want an efficient way to know whether all other processes consider themselves done sending messages. This would be accomplished perfectl...
I have troubles imagining how to compute a volume and centroid of an n-dimesional convex polytope. For a polygon (especially for convex polygon) the area and centroid are described in (wiki) by $$ A= \frac{1}{2} \sum \limits_{i=0}^n (x_iy_{i+1}-x_{i+1}y_i) $$ For k-dimensional case the volume (Volume) is $$ \int\limi...
Is there any hope in solving the following linear system efficiently with an iterative method? $A \in \mathbb{R}^{n \times n}, x \in \mathbb{R}^n, b \in \mathbb{R}^n \text{, with } n > 10^6$ $Ax=b$ with $ A=(\Delta - K) $, where $\Delta$ is a very sparse matrix with a few diagonals, arising from the discretization of t...
I am solving Turing's reaction-diffusion system with following C++ code. It is too slow: for 128x128 pixel texture, acceptable number of iterations is 200 – which results in 2.5 seconds of delay. I need 400 iterations to obtain interesting image – but 5 seconds of waiting is too much. Also, size of the texture should b...
I have an MPI application that needs to asynchronously respond to both incoming messages and request completions inside a dedicated communication thread. The obvious way to do this is a busy wait that alternately calls MPI_Iprobe and MPI_Testsome. Should I be worried about performance if I do this? Is it better to j...
Newton's method for solving nonlinear equations is known to converge quadratically when the starting guess is "sufficiently close" to the solution. What is "sufficiently close"? Is there literature about the structure of this basin of attraction?
I would like to use patchAverage to obtain the average pressure on an object that consists of multiple patches (due to different boundary conditions), however patchAverage only averages over single patches. As long as the constituent patches aren't shared with other objects, I could simply take the area-weighted averag...
I am investigating the accuracy and stability properties of a non-symmetric discretization of a Poisson problem. The problem originates from a ghost fluid discretization of the projection step of a fractional step Navier-Stokes solver. In this type of approach, grid points away from the geometry surface are discretized...
I'd like to know if there is an algorithm that given a set o points and an angle computes the convex-hull if the angle is $\alpha = 0$ and given an $\alpha > 0$ computes an envelope that follows more closely the "perimeter". And if there is a definition of a non intersecting perimeter of a set of points, in this case ...
I want to have an estimation, that my solution has an error, let's say less than 1e-8. Usually, I stop the Gauss-Seidel algorithm, when the residual is "small enough" and this is already the problem. How do I know when the residual is small enough, because even when the residual is small, the solution may still have to...
Suppose $A$ is a real symmetric matrix and its eigenvalue decomposition $V \Lambda V^T$ is given. It is easy to see what happens with the eigenvalues of the sum $A + cI$ where $c$ is a scalar constant (see this question). Can we draw any conclusion in the general case $A + D$ where $D$ is an arbitrary diagonal matrix? ...
In the worst case complexity analysis of all the polynomial algorithms in linear programming such as ellipsoid method and interior point method, there is an assumption that the input data must be integer. Using this assumption, then they bound the bitlength of input data by $L$. Now, the question is as follows: Q: How ...
For solving a very sparse LP: {min $cx$: s.t.: $A_{m \times n}x=b$ , $x\geq 0$}, which one of the following algorithms is faster? Logarithmic barrier method Other variants of the interior point method Simplex method What is the best worst case complexity? In general, which algorithm performs well in practice for sp...
I am familiar with the Courant-Friedrich-Lewy Condition in as far as it applies to the stability of explicit finite difference schemes for standard parabolic and hyperbolic PDEs. However, when solving the Navier-Stokes Equations, the non-linearity of the PDEs make it difficult to derive a CFL condition analytically. ...
I am trying to write an implementation of a color quantization algorithm in order to find an image's dominant colors (say 5) and then find contrasting colors based on the colors found in the image. I've tried implementing a k-means algorithm but the result ends up differently every time. What do you suggest? I need hel...
I work on non-graded quadtree grids where the entire grid is a hierarchy of cells specified using a quadtree data structure, where, in general, there is no constraint regarding the relative size of neighboring cells (or any cells for that matter). My library is mainly based on finite difference schemes that sample the...
Given $d$-dimensional coordinates residing in a matrix $X\in\mathbb{R}^{n\times d}$, the Euclidean distance between items $i$ and $j$ is denoted as $g_{ij}$. Let $c\in\mathbb{R}^d$ denote the centroid of the configuration $X$. Is it possible to establish a relation between $$\sum_{i,\, j} g_{ij}^2,$$ and $$\sum_{i=1}^n...
Suppose I have a matrix $A$ of size $n_1 \times n_2 \times n_3$ Now, I have another matrix $B$ of size $n_1 \times n_2 \times n_3 \times N$ where $N<n_3$ I'd like to create the following matrix $C = [A(m,l,B(m,l,k,:))]_{1 \le m \le n_1, 1 \le l \le n_2, 1 \le k \le n_3}$. What is the most efficient way of doing this w...
I am seeking for an efficient algorithm to compute a multivariate polynomial of a fixed structure, but different coefficients and evaluation points. The question is the same as this one, which apparently did not draw much attention. I am working in MATLAB, so "efficient" probably in this situation means to vectorize as...
I am working on a paper part of which is the application of validation rules to find how many principal components give us the least generalization error. The concept goes more or less like this: "Given that the dimension of the model is reduced, we reset our window size to 60 days to avoid overfitting problem. After ...
For a given centered configuration of points $X\in\mathbb{R}^{n\times 3}$, the covariance matrix is denoted by $S=\frac{1}{n}X^TX$. Recall that the 2D PCA solution is obtained by $Y=X\cdot U$, where $U\in\mathbb{R}^{3\times 2}$ is a matrix of orthonormal eigenvectors of $S$ associated with its 2 dominant eigenvalues $\...
The Heat equation is discretized in space with FV (or FEM), and a semi-discrete equation is obtained (system of ODEs). This approach, known as the method of lines, allows to easily switch from one temporal discretization to another, without code duplication. In particular, you can reuse any time integrator for ODEs wit...
I found R function ridge.cv very useful. I would like to implement the equivalent function in MATLAB. As a starting point, I used MATLAB function b0 = ridge(y,X,k,scale), however it gives completely different results. Why does this might happen? What value should I set for variable "scale" (1 or 0 and what's their diff...
I am dealing with optimization of functions for which I do not have derivatives available, and the optimization is not constrained. I am searching for a high quality GNU Public License-compatible optimization library compatible with the C++ language. So far I have managed to find OPT++. Can someone recommend this or ...
Recently, I came across an optimization problem with binary decision variables which was constrained with a set of first-order differential equations (resulting from a continuous-time Markov chain model). The objective function is the sum of a partial set of probabilities which are obtained via the set of first-order d...
I have a complex surface (real dimension 2) in $\mathbb{C}^2$ with coordinates $(z,w)$ given explicitely: for any $\xi \in \mathbb{C}$ I know points $w(\xi)$ of intersection of surface with complex line $z = \xi$. I have to draw it's projection on fixed 3d plane. Please help me with algorithm.
I know there are "superfast" $O(n \log^p n)$ algorithms for solving Toeplitz linear systems. Is it possible to compute all eigenvalues of such a matrix with the same complexity?
I'm installing PETSc for complex numbers with the C99 standard. I'd like to have it installed using a higher precision than the default (double, I presume) since that will most likely make the LU preconditioner run better. I've tried several different commands that I could google, but it doesn't work. I've searched the...
In order to achieve a 2D representation $X\in\mathbb{R}^{n\times 2}$ of some high-dimensional data residing in $Y\in\mathbb{R}^{n\times k}$, I use PCA:$$X=Y\cdot U,$$where $U\in\mathbb{R}^{k\times 2}$ contains eigenvectors of $Y^TY$ corresponding to its dominant eigenvalues. However, in case there are multiple occurren...
I have a linear programming problem min $c^T x$ $Ax\leq b$ However, in my problem, $A$ contains also some variables $y$, e.g. $$A = \begin{pmatrix} y_1 & 4 \\ 3 & y_2 \end{pmatrix}$$ I want to find a value of $y$ such that the solution $x$ of the LP, for that fixed choice of $y$, is positive. This question is differe...
I want to access a GPU on a computer remotely, and share this GPU with different desktops. I envision this sort of access as being similar to using a VNC. Is it possible to do something like what I've just described, and if so, how would I go about doing it?
I don't want to deal with virtualenv for a local Python installation, I just want to install a few packages locally without dealing with the PYTHONPATH environment variable, how do I do that?
I am beginning my graduate studies in engineering and will be working on computational science projects. I noticed that there has been some discussion about the advantages and disadvantages of implementing your own algorithms here. Is the cost-benefit analysis of implementing your own algorithms versus using libraries ...
Say I would like to generate a pseudo-random number, which only contains the digits 1, 4, 7 (this is arbitrary). My first guess would be to create and array "147" and create random numbers in the range [0..2] and use these numbers as an index into this array to concatenate a number in a loop. I wonder if there is a mor...
For example I consider a heat equation that I want to solve numerically : $$u_t=u_{xx},$$ In order to have a uniqueness on a computational bounded domain I have to have boundary condition specified for both $x_{min}$ and $x_{max}$. Ideally I can specify the value of the function, if it is not known I can specify the va...
Reading an implementation of the golden section search, I came across the following termination test: $$| a - d | < \varepsilon ( |b| + |c| )$$ where $a < b < c < d$ are four points at which the function has been probed and $\varepsilon$ is a user-provided tolerance. Why is this a good termination criterion? If I take ...
Suppose a matrix $A\in\mathbb{R}^{n\times n}$ is given. Faced with a proof for $$x^TAx>0,$$ for a non-zero vector $x\in\mathbb{R}^{n}$, I was thinking to use the information of the spectrum of $A$ (note that the proof of the above is the proof of positive definiteness of $A$). Namely, it is known that the spectrum of $...
I am looking for an efficient method to compute $$\sum_{i=1}^\left|B\right|\left|Ax_i-b_i\right|^2\rightarrow min$$ under the condition $$\forall i, x_i\ge 0,$$ where $A$ is an n-by-m matrix and $B$ is a set of n-dimensional vectors. Only $B$, $n$ and $m$ are given. In other words the goal is to find $A$ so that the su...
The thing I dislike most about MPI is dealing with datatypes (i.e. data maps/masks) because they don't fit that nicely with object oriented C++. boost::mpi only supports MPI 1.1, however, from their website: boost::mpi is a C++ friendly interface to the standard Message Passing Interface… Boost.MPI can build MPI data ...
We are comparing the performance of various numerical methods that can be used to solve the Schrodinger's Equation for the Hydrogen Atom interacting with a strong laser pulse (too strong to use perturbation methods). When using discretization schemes for the radial part, it seems like most (all) people put the atom in ...
I need to write MATLAB program (or use an existing one) to obtain Fourier series coefficients. Let's say the series is going to approximate a 1D curve. The boundary conditions are: value of the curve's function in a few places curve's first derivative known in a few places maximum allowed value of curve's second deri...
I have a non-symmetric matrix, where the non-symmetry only appears at a subset of points. This arises due to the particular manner on which boundary conditions are applied in a Cartesian grid method. I'm looking for a way to factor the matrix into the product of a symmetric sparse matrix and a diagonal matrix with a lo...
I am looking for existing software or scripts to generate spiral graphs from cyclical (time) data, as presented by Webber and Muller. The graphs shown in the paper look like a great means of visualizing and identifying periodicity in cyclical data, but I haven't been able to Google up any existing solutions for creati...
There seem to be two main kinds of test function for no-derivative optimizers: one-liners like the Rosenbrock function ff., with start points sets of real data points, with an interpolator Is it possible to compare say 10d Rosenbrock with any real 10d problems ? One could compare in various ways: describe the struc...
Currently, I have some experience with classical molecular dynamics simulations, and I've had undergraduate course in quantum mechanics (the course was "analytical" one, no approaches to computer simulations were covered, so I'm familiar with Schroedinger equation, but not with Liouville's equation). I've tried reading...
Below is my own approach to implement the Least Squares Regression algorithm in MATLAB. Could you please take a look and tell me if it makes sense; if it does exactly what is supposed to do? EDIT: Please, pay attention to the commented commands as well. function [MSE_train_mean,MSE_train_std,MSE_test_mean,MSE_test_std,...
I have got a large sparse matrix $A \in \mathbb R^{n \times n}$ and I want to find non-trivial elements in the kernel/nullspace of this matrix. How can this be done? I would like to learn more about a particular method that seems to be folklore. Most people that I have talked to regard this problem as an instance of an...
Finding the roots of a complex polynomial is in general extremely numerically unstable, as discussed in (1). According to Pan ((2), (3)), this produces a cubic complexity lower bound, and he presents a near-optimal algorithm which is quasilinear in arithmetic and quasicubic in boolean (control flow) complexity. His a...
Algorithms for edit distance give a measure of the distance between two strings. Question: which of these measures would be most relevant to detect two different persons names which are actually the same? (different because of a mispelling). The trick is that it should minimize false positives. Example: Obaama Obama =>...
I am trying to find some resources to help explain how to choose boundary conditions when using finite difference methods to solve PDEs. The books and notes which I currently have access to all say similar things: The general rules governing stability in the presence of boundaries are far too complicated for an introd...
I have a system of equations $$ S_{m}(\xi) +P_{m}(\xi)=f(\xi) $$ where $\xi$ can be choosen arbitrary in some domain in $\mathbb{C}$, $f$ is known, $P_m$ is a polynomial of degree at most $m$. Here $S_{m}$ is a generic function from $\mathbb{C}$ to $\mathbb{C}$ but for me it is sufficient to know it's values in onl...
Ignoring eigenvectors, the shifted QR algorithm for computing eigenvalues in the symmetric tridiagional case costs $O(n)$ per iteration, converges globally, and converges cubically near the end. What is its worst case complexity (which presumably depends on the desired error)?
I am producing 1d and 2d images using Matlab right now for comparison of accuracy against a given model. I need to compare my methods with the standard Gaussian .wfn model and I am going to do that by analyzing the density of a molecule as well as the laplacian. I am interested in producing 2-D images of differences in...
I've been working in R but sometimes switching to python. I'd like a more inter-language portable way of storing a large array than a csv file. (The particular csv file I'm dealing with is about 10^6 rows by 10^3 columns, but only about 1% of the entries are non-zero.) Processing a large csv file everytime I start up R...
I would like to visualize simulation results, obtained using the discontinuous Galerkin (DG) approach, within ParaView. Similarly to finite volume methods, the problem domain is divided into cube-shaped cells ("elements"). As opposed to finite volume methods, within each cell there is not just one value for the solutio...
Leafing through a few textbooks, I've noticed that the problem of initially bracketing a minimum during a line search tends be an afterthought (at least in my undergraduate texts). Are there well-established techniques or best practices for this type of problem, or are solutions typically application dependent? Can any...
Lapack contains a driver routine to solve dense generalized Hermitian positive definite eigenvalue problems of the form $Ax=\lambda Bx$, where $A$ and $B$ are both Hermitian, and $B$ is positive definite. I am wondering if there is a method (either code or a modification of zhegv) when $B$ is indefinite (specifically, ...
Given a symmetric matrix $A\in\mathbb{R}^{n\times n}$ with positive entries and zero diagonal, is it always possible to construct a high-dimensional configuration in Euclidean space, such that these coordinates give rise to distances from $A$? (high-dimensional configuration implies dimensionality at most $n-1$) If thi...
I have calculated estimates of the daily supply of empty trucks and daily demand for empty trucks at the US postal code level. I would like to optimize the routing of supply to demand to minimize the total distance travelled. I would use that result to calculate the average repositioning miles required for a unit of de...
I trying to detecting whether a data set of time series has a global change in frequencies. Calculating the average (or median) pairwise coherence, I feel, misses the point because I am trying to get a measure of network (i.e. multivariate, more than pairwise) coherence. I found a group[1] that uses the relative magnit...
I need to create a scoring model out of estimated conditional probability functions for two events, A and B. Let 0.5 be the threshold value. Ideally, the probability is in the interval $[0,0.5)$ for A and in the interval $[0.5,1]$ for B. However, my probabilities are estimated with errors. Therefore, for a certain numb...
I appologize in advance if this question is silly. I need to compute the root of \begin{equation} u -f(u) =0 \end{equation} Where $u$ is a real vector and $f(u)$ is a real-vector valued function. I started with Newton's method (which worked), but then realized a much simpler method would be an iterative solution \beg...
I am trying to iterate the following equation $$ x_{k}(n+1)=x_k (n)-\epsilon (x_{k+1}(n)-2x_k(n) +x_{k-1}(n))+\sqrt{\epsilon}\; \eta_{k}(n) $$ where $n$ denotes which time step I'm on and $k$ is the location on the string with periodic boundary conditions, $\epsilon$ is the size of the time step and $\eta$ is a random ...
Consider a vector $\mathbf{g} \in \mathbb{R}^{m}$ and a matrix $\mathbf{A} \equiv \mathbf{A(g)} \in \mathcal{M}_{p\times q} [\mathbb{R}]$, a function of $\mathbf{g}$. Furthermore, let $\mathbf{S} \in \mathcal{M}_{p \times r} [\mathbb{R}]$, independent of $\mathbf{g}$. Is it a way to calculate $\displaystyle \frac{\par...
I want to minimize a complicated objective function, and I'm not sure if it is convex. Is there a nice algorithm that attempts to prove that it is not convex? Of course the algorithm could fail to prove this, in which case I would not know if it is convex or not, and this is OK; I just want to try to rule out convexi...
The minimum image convention (MIC), see for example a short note of W. Smith, is often used in molecular dynamics or monte carlo simulations of periodic systems with an orthorhombic unit cell. For this special case, it is rather trivial to implement the MIC correctly. How does one apply the MIC to systems with a more g...
I am trying to build a Runge-Kutta code to integrate the equations of motion for a simple harmonic oscillator. However, when I run the code, I only see first order improvement in the error as I decrease the step size. What could be causing this issue? Here I start with the second order equation x''+x=0 and introduce a ...
I have the following Problem: I know the range within the results of a division must lie. [ quotientrange ] Additionally, the quotient should not exceed a certain number of fractions. I know, that both dividend and divisor must consist of a certain set of digits. Dividend and divisor are further restricted by a range....
I have an optimization problem that has a linear objective function. The constraints are of the form: $(Ax \leq b) \wedge (Cx \nless d)$. In other words, I have: \begin{align} \min &f^T x \notag \\ \text{s.t.} &Ax \leq b \\ &Cx \nless d\\ \end{align} One way to solve the problem would be to decompose the constraint ...
I have an iterative sequence for optimizing an EM (Expectation Maximization) algorithm based loss function $L(X)$ with $t$ being the iteration number as: $X_t=ABX_{t-1}+CX_{t-1}+X_{t-1}$ where $A$ is a diagonal matrix, $B$ and $C$ are positive semi-definite matrices. Also the diagonal entries in $A$ are the inverse of...
I am currently trying to code the CA-CG method within the PETSc framework. A mandatory step in this process is the implementation of the "matrix powers kernel" algorithm for a generic sparse matrix. This requires the computation of the index set obtained exploring the graph associated with the sparse matrix for s-steps...