instruction
stringlengths
43
28.1k
I have a 2d numpy array, with shape (100,3) a = np.random((100,3)) and I want to call a function fun: b = fun(a) This function is currently defined: @np.vectorize def fun(r): if r <= 0.0: return 0.0 else: return min(2.0/(1.0 + r), 2.0*r/(1.0 + r)) and this works fun. But I would like to express this in a...
I am working with a code that solves diffusion/reaction equations on a 2D unstructured mesh. Due to the stiffness of some of the processes, I start with time steps near 1e-13, and end with a final time in the millisecond range with time steps near 1e-8. The issue appears in that the problem is also, what I would lik...
Is there a general survey on the basic algorithms for the compressed sparse rows format (like transposition, multiplication, addition, ...)? While it is not hard to write effective algorithms for that, I am not aware of any comprehensive piece of writing on these algorithmic tasks. This does not defy that many librarie...
please how can I write gradient numerically? I have an eq. $\dfrac{\partial X}{\partial t}=\nabla^2 X + u\nabla X$ I wonder how write this in 3D. Many thanks for any idea... I can find how to solve the "pure" heat eq. but so I don't know..
I am trying to solve a particular system of non linear equations written as $F(x) = 0$ in an efficient way. More specifically, $$F(x) = (I - \gamma A)x - g(x) + C$$ where $\gamma$ is a scalarconstant, $C$ is a vector constant, $A$ is a constant matrix, and $g$ is a non-linear function of $R^n \rightarrow R^n$. I am usi...
I have a numerical problem in which I need to find the values $\lambda$ for which the determinant of a matrix $A_\lambda$ is zero. (The solutions $\lambda$ will give the eigenvalues of an operator...) For that I learnt that it is better to look for the singularities of the function $\lambda \mapsto \log(|det(A_\lambda)...
please can I ask a bit stupid question? Let say I need to solve an equation in a form $\frac{\partial X}{\partial t}=\sum_k M_k * X_{n-k}$ How can I do the discrete convolution numerically? I will say I will expand X into series (FFT) and then, please? I have a layer of free surfaces on the top and bottom and from the ...
I need to solve the same sparse linear system (300x300 to 1000x1000) with many right hand sides (300 to 1000). In addition to this first problem, I would also like to solve different systems, but with the same non-zero elements (just different values), that is many sparse systems with constant sparsity pattern. My matr...
I would like to find $x$ which minimizes the following equation: $\frac{x^HAx}{x^HBx} + \frac{x^HCx}{x^HDx}$ where A, B, C, D are positive-definite. $x$ is not a very large vector (<1000 elements in size.) The problem is easily solvable as a generalized eigenvalue problem when A or C=0, but I am not sure what the best ...
I'm a physics undergrad, looking for a good introductory book on computational science, and numerical methods. Mostly I'm looking for applied books. (Simply because... in a theoretical book, if I can't see why I'm studying it, it's easy to lose motivation!) Background I have the following background: Strong backgroun...
please can I ask, how one can make from function sine series (Fourier transform) with MKL? I can do "normal" exponential FFT with MKL (Lapack of course), how can I say that I want only sine series? Many thanks
I have a convex optimization problem that is essentially a linear objective function over some linear constraints and also a semidefinite matrix in the following form: $ M= \left[ {\begin{array}{cc} a & \sqrt{u} \\ \sqrt{u} & b \\ \end{array} } \right] ...
In a numerical computation, I am required to take a multi-dimensional FFT on a distributed-memory cluster. The data is currently distributed using a distributed array in PETSc (DMDA). I initial looked at the distributed version of FFTW. However, the layout of my data does not conform to the layout used by FFTW. Theref...
I solve such a problem. Lets have a function $Y=\sum_{k=-\infty}^\infty i\hat Y e^{ik\pi y}$ and then I have a function which is defined as $X=\sum_{k=-\infty}^\infty ik^2\hat Y e^{ik\pi y}$. I know the $Y$. The $i$ is imaginary unit. How can I compute the $X$? I think I do the FFT on $Y$ and obtain thus the $\hat Y...
In order to compute the sum of a power series, we can use for loop, while loop or the analytic formula. I am wondering what is difference between those algorithms and how to improve the robustness of this question?
In http://en.wikipedia.org/wiki/Floating_point#Addition_and_subtraction, it gives an example about cancellation problem in float-point numbers, see I don't understand why it is written : The best representation of this difference is e = -1; s=4.877000, which differs more than 20%..... In this example, it uses IEEE 75...
I am trying to figure out how to write a proper job file for the Sun Grid Engine so I can run a parallel computation using Mathematica on multiple nodes. Unfortunately almost all tutorials on the topic assume using MPI, which is not the case here. In order to get this working, I need to find the answer to a few very s...
please can I ask a bit stupid question? I have a complex matrix A as a set of equations. I wanted to find the solution of Ax=b where b is vector of right-hand side. So I have called zgetrf on A (does LU factorization) and then zgetrs on A and b (solves linear system of LU matrix) from Lapack/MKL. But this ends up with...
Consider the following optimization problem: $Min \qquad C^TX$ S.t.: $\qquad AX=0;$ $x_ix_j=x_kx_t$$\quad $for some $i\neq j\neq k\neq t$ $X=(x_1,x_2,...x_n)$ and $\quad x_j\geq 0\;\; j=1,2,...,n$ Here $C=(c_1,c_2,...,c_n), c_i\geq 0$ and $A$ is the adjacency matrix. -Is this problem convex? -Can it be solved in p...
I've been working on a finite element code on unstructured methods, which I've parallelized using the Schur complement method. Here's a summary of how I did it: Assign each triangle of the mesh to a domain For each node, determine which domain it is in or whether it is on the artificial boundary Send each processor it...
I am trying to find the required specifications of a RF trap, in which a proton can be confined.(trap dimensions, voltage frequency and amplitude used, etc). I have to solve the equations of motion numerically because the potential doesn't have a closed form for this specific geometry and equations of motion can not be...
I need to solve Ax=b, but I realize that even if it is sparse, storing the matrix coefficients of my problem will take too much memory. So now I'm considering using a matrix-free method, because the same coefficients appear a lot of time in the matrix, so I could use my own private storage scheme (and increase cache ef...
On an uniform mesh of positions in space $\ (x_i,y_j,z_k)$: $$\ x_i = x_0 + i\Delta x,\quad i=0,\ldots,n_x$$ $$\ y_j = y_0 + j\Delta y,\quad j=0,\ldots,n_y$$ $$\ z_k = z_0 + k\Delta z,\quad k=0,\ldots,n_z$$ I have a velocity function: $V(x_i,y_j,z_k)$. Given a start position $(x_s,y_s,z_s)$ I can calculate the time it ...
Consider the following optimization problem: $Min\;\;\; CX$ $AX\geq b$ $x_ix_j= x_s x_t\;\;\; i\neq j \neq s\neq t$ $x_j\geq 0;$ Where $A$ is the adjacency matrix and $C$ is a constant vector. How can one check the feasibility of this optimization problem in an efficient way?
Suppose I'm solving $$\frac{d}{dx}\left(K(x)\frac{du}{dx}\right)=f \text{ in }\Omega,$$ $$u=g \text{ on } \partial\Omega$$where $K(x)$ is smooth and $$ f(x) = \left\{ \begin{array}{ll} 0 & \quad x \neq x_0 \\ 1 & \quad x =x_0 \end{array} \right. $$ I tried solving this prob...
Consider the following optimization problem: Min$_{x}$ $\qquad \sum_{(i,j,t,s)\in I_r}||x_ix_j-x_tx_s||^2$ S.t.: $\qquad x\in \mathcal{C} ;$ where $x=(x_1,x_2,...x_n)$ and $\quad x_j\geq 0\;\; j=1,2,...,n$ Here, $\mathcal{C}$ is a convex set and $I_r$ is a polynomial sized index set. Can this problem be solved in p...
If I want to do a very accurate simulation of a molecular system (e.g. 2 hydrogen atoms), then I'll want to use something like diffusion Monte Carlo to determine the energies of these atoms in different configurations. For example, if I want to create a bonding potential like the harmonic $$E = K(r - r_0)^2$$ or Morse ...
I am working with Modified Nodal Admittance representation of circuits. I am doing Model Order Reduction using PRIMA on MATLAB. I am considering these circuits as Descriptor State-Space systems. I have been working with this for quite a while. It is a guaranteed passivity preserving algorithm. However, for some circu...
I am using MATLAB to solve a problem that involves solving $\mathbf{A} \mathbf{x}=\mathbf{b}$ at every timestep, where $\mathbf{b}$ changes with time. Right now, I am accomplishing this using MATLAB's mldivide: x = A\b I have the flexibility to make as many precomputations as needed, so I am wondering if there is a f...
I've spent far too much time coding and debugging multigrid. While I clearly can't post all of my code as it would be silly to ask someone to go through all that code, is there anything I should pay special attention to? Note: I'm posting this because I don't want people to have to waste the time I had. This may not be...
This question may be too broad. But I really want to know some concrete explanations. I often find various commutations appear here and there, which concerns the application order of two operators. For examples, between exterior calculus of the differential forms and discretization, optimization-then-discretization ...
I have a collection of computational models that could be described as asynchronous cellular automata. These models resemble the Ising model, but are slightly more complicated. It seems as if such models would benefit from being run on a GPU rather than a CPU. Unfortunately it isn't quite straightforward to parallelise...
I have a 3D point cloud representing ad object. I use a 3D cylinder to fit this object in the point cloud, so I check if each point is inside the cylinder and, if it is, then I assign a weight to that point. So, at the end I have an estimate of how many points fall inside the cylinder and what is the weight of the fitt...
I need to compute the (Moore-Penrose) pseudoinverse of fixed-size 3x3 matrices. I would prefer to have a simple method without bringing in the industrial strength machinery of Lapack. Are there any simple methods to do this? Edit: I should add two notes: first, I am prioritizing robustness and simplicity over speed. Se...
The FEM is usually used with a weak form of PDE. But for the non-divergence form elliptic operator $$ -a_1(x,y) \frac{\partial^2}{\partial x^2} - a_2(x,y) \frac{\partial^2}{\partial y^2} $$ or another non-divergence form $$ -\frac{\partial^2}{\partial x^2}a_1(x,y)\cdot - \frac{\partial^2}{\partial y^2} a_2(x,y)\cdot...
This wikibook states that the output of MATLAB's FFT corresponds with the wavenumbers ordered as: $$k=\left\{0,1,...,\frac{n}{2},-\frac{n}{2}+1,-\frac{n}{2}+2,...,-1\right\}$$ However, in the example codes on the same page, the wavenumbers are coded as k = [0:n/2-1 0 -n/2+1:-1]; which is the same as the first, but wit...
I am struggling with DG methods for 2 phase flow through porous media. I managed to get the global pressure, total flux equations to work with an unconditionally stable mixed FE DG formulation as described here: http://math.aalto.fi/reports/a531.ps but the saturation equation is giving me problems. Basically I tried LD...
I'm having trouble understanding how to code 2-D Poisson's Equation with Dirichlet boundary conditions. What I have thus far is Constructed square mesh with triangular elements Assembled stiffness matrix. The function for this also gives the area of each element (all same, since square). Use Gaussian Quadrature to con...
I am porting an existing code from MATLAB to C++ and have a linear system to solve $xA=b$ (rather than the more typical form $Ax=b$) The matrix $A$ is dense, and of general form, but is no larger than 1000x1000. So in MATLAB, the solution is found by the mrdivide(b,A) function or the forward-slash notation x = b/A; How...
I'm trying to understand how to compute the value of Pi by means of the Monte Carlo simulation. I have a circle inside a square where the sides of the square are tangent to the circle. As data I have the number of random points and the ratio between the lenght of one side of the square and the diameter. $$\displaystyle...
I have to estimate a parameter (K), but I don't know how I can do it. I think by a regression model (minimum least square?), but I'm not sure. The system is: dX1/dt = f(t)*X2*X1 dX2/dt = -K*f(t)*X2*X1 where: X1 and X2 are the state variables, f(t) is a time varying function and K is the parameter that I want to estima...
Say we are given a congruence relation$~\sim$ in a dataset with $n$ elements. I am looking for an algorithm for optimally sorting the $n$ elements into $m$ clusters according to given congruence relations. For instance if the data contains ${a,b,c,d,e,f,g,h}$, and: $$a\sim b,\ d\sim b,\ e \sim h,\ f \sim c$$ The data s...
Having a matrix $\mathbf{A} \in \mathcal{C}^{m\times n}$ I solve following least-squares problem $$Re(\mathbf{A}^H \mathbf{A})x=Re(\mathbf{A}^H\mathbf{b}).$$ If the matrix $\mathbf{A}$ was a real matrix, the solution to the equation above could have been written as $$\mathbf{x} = \sum_{i=1}^{rank(\mathbf{A})} \frac{\ma...
When using the Hexpress grid generator one gets hexahedral cells, possibly with hanging nodes. Because of a smoothing step, the hanging nodes can be shifted: they are not necessarily on the straight line that connects the corners, as shown below. With FVM one would triangulate the face with 5 nodes in order to approxi...
I have downloaded and unzipped PETSc from PETSc Website in my home directory (OS is CentOS 6.3 64bit ) and followed given commands on Installation page "./configure --with-cc=gcc --with-fc=gfortran --download-f-blas-lapack --download-mpich" and "make all test". There was no error throughout the process. Is it install...
I writing some robust geometric algorithms using quantization + integer arithmetic for evaluating exact predicates. However, since BlueGene's integer support is so terrible, it occurred to me that the use of integer math may (weirdly) kill the portability of the library in terms of performance. How worried should I be...
I'm currently running a CFD simulation for an internal flow and need to compare my computed results to experimental data. The experimental data is saved as a comma separated file with columns for x,y,z coordinates and pressure. The computed data is saved in Ensight format on an unstructured 3D mesh. As an example, I ha...
My question can be rephrased as "FEM library like deal.II but for simplex elements". Our scientific group works with very complicated 3D geometries, so usually we prefer tetrahedral meshes for our models. And we use Gmsh to build such grids. Programming language that we use is C++. We have never used third-party FEM li...
I frequently need to solve linear systems with sparse matrices of moderate dimension (say a few thousand). These matrices are composed entirely of small dense blocks (typically 5-10 in dimension), and the overall block structure is sparse (with a pattern like in a PDE spatial discretization). Currently I am just feedin...
I am going ahead with asking what might appear as a debugging question. But,I am looking for something conceptual that I might have missed, and this question is somewhat related to my previous question: NVE MD simulation of inert gas: Problem maintaining equilibrium, although a different issue now. If the moderators de...
I am interested in solving the Poisson equation using the finite-difference approach. I would like to better understand how to write the matrix equation with Neumann boundary conditions. Would someone review the following, is it correct? The finite-difference matrix The Poisson equation, $$ \frac{\partial^2u(x)}{\parti...
Given two square matrices, $A$ and $B$, I need to calculate the product $tr(A^{-1}B)\times detA$. The catch is that $A$ is singular --- more precisely, it depends on some parameter $t$, such that it's non-singular at any finite $t$ and only becomes singular in the limit $t\to 0$ --- which is exactly the limit I need to...
I want to solve a nonlinear optimization problem $$\underset{\mathbf{x}\in \mathbb{R}^n}{\operatorname{argmin}} f(\mathbf{x})$$ subject to a support constraint $$\mathbf{x}=[x_1,\cdots,x_n]^T, \quad x_1=x_2=\cdots=x_i=0,\quad x_j=x_{j+1}=\cdots=x_n=0 \quad (1<i<j<n)$$ Is there any algorithm or library able to solve thi...
For your information, the original equation comes from here. Note: You DON'T have to read the paper. I will make the question as self-contained as possible. The central equation to solve is equation (16), which is of the form (my question extends to other system of PDE with similar form): $\dfrac{\partial f_n(x;\tau)}{...
I have to solve generalized eigenvalue problems $Ax = \lambda Bx$ where $A$ and $B$ are both tridiagonal, $B$ is symmetric positive definite and real, but $A$ is only complex symmetric (not definite or Hermitian). Furthermore, I need the full eigendecomposition. I am currently just calling Lapack's ZGGEV generalized ei...
Hello if anyone can offer insight on how to solve my problem that would be great! I am looking to calculate the area of intersection between a 3D volume and a 2D plane. 3D volume: defined by 6 points (will always be a 3D wedge resembling a thick triangle) 2D plane: defined by 3 points any suggestions? are there any op...
I have just installed a Nvidia GT660 graphic card on my desktop and, after some struggle, I manage to interface it with R. I have been playing with several R packages that use GPUs, especially gputools, and I was comparing the time taken by my GPU and CPU to perform some basic operations: inverting matrices (CPU fast...
I'm interesting in numerically simulating (with my own code, not an off-the-shelf package) the motion of a single electrically charged particle in a magnetic field. The field will vary in time and space but probably not fast compared to the cyclotron frequency or the Larmor radius. There are many well known methods for...
Consider $n$ integer-valued and independent random variables $e_1, e_2, \dots, e_n$ with known distribution functions $m_1, m_2, \dots, m_n$. Let's denote with $E^{1..n}$ the random variable given by the sum of $e_1, e_2, \dots e_n$, that is $E^{1..n} = \displaystyle\sum_i{e_i}$. The PDF of $E^{1..n}$, $m^{1..n}$, is ...
I am currently trying to link a program against the Intel MKL 11.0 library instead of using NetLIB or OpenBLAS. Doing this I recognized the following error which I can not explain to my self at the moment. Consider the following C code example computing a complex scalar product using zdotc: #include <stdio.h> #include ...
I am looking for a modern version or an alternative to the DRESOL package for differential matrix Riccati equations. The main issue that the original package uses single-precision type float which seems to be not accurate enough for my purposes. Available Matlab alternatives are also appreciated. Thank you!
I want to solve a system of differential equations using ode45 , for (many) parameters in MATLAB to investigate the behavior of solutions with coefficients of the equation .I want to find the parameters for which the solution absolute value doesn't get larger than some given number . The script has a for loop and solv...
I have multiple sets of measured data that can easily be visualized using a scatter plot (red and black points in the figure). If my measurements were perfect, the red and black points should lie on a single curve. However they are not, thus I would like to "average"/fit the data points in such a way that I obtain the ...
I wanted to compare the speeds of the GMRES implementations in the CUSP and the PETSc libraries. The matrix (A) used for testing was a 3d Laplacian matrix obtained by using the 7 point stencil on a 20x20x20 grid => the matrix is of size 8000 x 8000. This is a banded matrix with 7 diagonals. The RHS (b) was obtained by...
I am a physicist who is trying to model the current-voltage characteristics of a superconductor-superconductor junction. The equation for this model is: \begin{align} I(V) = \frac{1}{eR_{\mathrm{n-n}}}\int_{-\infty}^{\infty}\frac{|E|}{[E^{2} - \Delta_{1}^{2}]^{1/2}}\frac{|E + eV|}{[(E + eV)^{2} - \Delta_{2}^{2}]^{1/2}}...
I have a 3D finite-difference formulation (for time-harmonic Maxwell using a standard Yee cell grid.) A "perfect electrical conductor" condition can be implemented by enforcing the desired electric field components to 0. (This can also be approximated by making the effective $\epsilon_r$ have a really large imaginary p...
I am not very familiar with the common discretization schemes for PDEs. I know that Crank-Nicolson is popular scheme for discretizing the diffusion equation. Is also a good choice for the advection term? I am interesting in solving the Reaction-Diffusion-Advection equation, $\frac{\partial u}{\partial t} + \nabla \cdot...
I have the following problem in $x \in \mathbb C^{205}$ $$\displaystyle\min_{x}x^HAx$$ subject to the following constraints $$x^HBx = 1$$ $$x^HC_ix = 0$$ for $i \in \{0,1,\dots,203\}$, where $A$ and $B$ are complex $205 \times 205$ matrices and can be assumed to be positive definite. The $C_i$'s are rank-$1$ matrices (...
Computational Science people: I originally posted this question at Math Stack Exchange and someone commented that I might get "much better" answers here: I am a novice at numerical methods and Matlab. I am attempting to evaluate the following sum of two triple integrals (it can obviously be written more simply, but yo...
I see very few non-floating point computing libraries/packages around. Given the various inaccuracies of floating point representation, the question arises why there aren't at least some fields where this increased accuracy might be worth the intricacies of working with fixed-point. Are there any MAJOR difficulties in ...
please can you help me with my problem with Stokes flow written using Marker and cell method (MAC)? I need only to solve the eq. of continuity + momentum eq. for a given condition (steady state). I don't understand how to do the things on boundaries (lets say I want to have v=0 on boundaries), how to fill the matrix - ...
Given a square grid of size $n\times n$ and $m$ symbols (say for example, alphabets A, B, C...), having $N(i)$ number of $i$th symbol; $\sum_{i=1}^{m}N(i) = n\times n$. Is there any computationally tractable algorithm that can be used to distribute the symbols uniformly inside the grid? Uniform distribution here could ...
I solve the Lyapunov equations : $$ A W_C E^T + E W_C A^T + B B^T = 0 $$ $$ A^T W_O E^T + E W_O A + C^T C = 0 $$ to obtain $ W_C $ and $W_O$. My aim is to get the left and right eigenspaces of $W_C W_O$. This is basically for model order reduction through balanced truncation. Currently I am explicitly generating $W_C$ ...
Say I have a function $f : \mathbf{R}^3 \to \mathbf{R}$ that I wish to integrate over a tetrahedron $T \subset \mathbf{R}^3$. If $f$ was arbitrary, Gauss quadrature would be a good solution, but I happen to know that $f$ is harmonic. How much can Gauss quadrature be accelerated using this information? For example, if...
I know that this question might be very specific and maybe nobody will know the answer, but this is probably the only community where I could find an answer: So, as part of my master's project, I am currently writing a multigrid code for Poisson's equation in order to calculate particle interactions in a molecular dyna...
Question: What methods are available to accurately and efficiently calculate the sparsity structure of a finite element matrix? Info: I'm working on a Poisson Pressure Equation solver, using Galerkin's method with a quadratic Lagrange basis, written in C, and using PETSc for sparse matrix storage and KSP routines. To ...
I am trying to solving the advection equation but have a strange oscillation appearing in the solution when the wave reflects from the boundaries. If anybody has seen this artefact before I would be interested to know the cause and how to avoid it! This is an animated gif, open in separate window to view the animation ...
Consider the following robust optimization problem: min c'x s.t.: $Ax\geq b \;\;\forall (A,b)\in \mathcal{U}$. Why can the robust counterpart of the problem be written in this form? $min_x{\{ max_{(A,b)} Ax\geq b\}}$? How does it work principally? Does it mean that I have to, for a fixed $x$ value, maximize the cons...
There is a lot of info about how to use the sparsity pattern of A in order to solve $Ax = b$. However I can't find much about using the sparsity pattern of b. Let me take a concrete example: Let us assume A is a large $N \times N$ matrix ($N > 10^6$) with a known sparsity pattern. Now let us assume I want to solve repe...
CS Beta people: I have been doing some multiple integrals with a combination of symbolic and numerical integration (because symbolic answers have not always been possible). I have been using Mathematica to do the symbolic integration, cut-and-pasting the results into Matlab, and then using quad or dblquad in Matlab. ...
I don't understand the different behaviour of the advection-diffusion equation when I apply different boundary conditions. My motivation is the simulation of a real physical quantity (particle density) under diffusion and advection. Particle density should be conserved in the interior unless it flows out from the edges...
This might be a silly question, but I know very little about the theoretical properties finite elements, so here goes. Suppose you were to solve the Helmholtz equation (let's say in 2D) with a spatially varying wave speed using finite elements. For reference the equation is $$ [\nabla^2 + k^2(\vec{r})]\psi(\vec{r}) = f...
I am simulating incompressible flow over a cylinder at Reynold number of 500. I am solving navier stokes equation using pressure correction method. My solution becomes unstable after certain time (approximately 5s). I have tried refining my mesh, stepsize (0.05) (making sure my CFL < 1, even though I am using implicit ...
My question is not related to any particular problem, rather, I am looking at the equations of the form $$u_t+c(t,x)u_x=0$$ and attempt to solve it numerically. According to http://en.wikipedia.org/wiki/Flux_limiter I can apply Flux limiter method, say with Van Leer limiter function, and obtain a numerical method for t...
I'm working on a 2D fluid sim using vortex particles/"vortons" as described in Fluid Simulation for Video Games. Which I think is the same things as the "discrete vortex method". Basically you represent the fluid with a collection of particles with defined vorticity, and calculate the fluid velocity at a point by sum...
I'm working on an API for simulation of port-Hamiltonian systems. As far as I understand it, a Hamiltonian system is symplectic if it is power conserving, and so including resistive elements would thus destroy the symplectic nature. My question is, if I add an extra state variable, the dissipated heat, along with its a...
Is there a reasonably cheap method to solve the large, dense, low rank assignment problem $\max_\pi \sum_i A_{\pi i,i}$, where $\pi$ runs over all permutations.of $1:n$? Here $A$ is an $n\times n$ matrix of low rank $r$. Typical sizes would be $n=10000~~$ (possibly much larger), $r=15$.
I'm looking at finding a solution to the following problem, but I'm having trouble formulating it sensibly, and then finding an appropriate algorithm to solve it. Consider a list of items placed in a shopping bag: 1, 2, 3, 4... Each item can be part of one or more promotions: A, B, C, D We wish to apply the set of prom...
We need to compute covariance matrices with sizes ranging from $10000\times10000$ to $100000\times100000$. We have access to GPUs and clusters, we wonder what is the best parallel approach for speeding up these computations.
Let us assume I have an A-stable numerical scheme. I believe that given any linear equation $y' = Ay$, it means that the numerical scheme applied to this equation is stable (and therefore convergent since it is consistent) if the eigenvalues of A have a negative real part. My question is then, does this result extend t...
Following on from my previous equation I'm would like to apply open boundary condition to the advection-diffusion equation (with reaction term), $$ \frac{\partial \phi}{\partial t} = \frac{\partial}{\partial x}\left( D\frac{\partial \phi}{\partial x} + \boldsymbol{v(x)} \phi \right) + S(x,t) .$$ I define "open" as mean...
I wish to implement the following expression in Python: $$ x_i = \sum_{j=1}^{i-1}k_{i-j,j}a_{i-j}a_j, $$ where $x$ and $y$ are numpy arrays of size $n$, and $k$ is a numpy array of size $n\times n$. The size $n$ might be up to about 10000, and the function is part of an inner loop that will be evaluated many times, so ...
I have been reading about convex optimization. We have: minimize $f(x)$ s.t. $h(x) = 0$, $g(x) \le 0$, $x \in X$ It's Lagrangian dual is: maximize $\phi(\lambda,\mu)$ s.t. $\mu \ge 0$, where $\phi(\lambda,\mu) = \inf[f(x) + \lambda' h(x) + \mu 'g(x)]$ I don't understand why $\mu$ must be greater than zero. Can ...
I want to evaluate the sum $$\sum_{k=1}^\infty \left(\frac{i+1}{\sqrt{2}}\right)^k\cdot k^{-\alpha}$$ where $i=\sqrt{-1}$ and $\alpha\in[\frac{3}{4},1]$ with 8 digits accuracy. If I am willing to expend up to a second of CPU time per calculation, how should I proceed? Suppose I want a really fast scheme for the evaluat...
I have this confusion about Armijo rule used in line search. I was reading back tracking line search but didn't get what this Armijo rule is all about. Can anyone elaborate what Armijo rule is? The wikipedia doesn't seem to explain well. Thanks
Is there an algorithm to rearrange a matrix into block diagonal form, given that the matrix is block diagonal in nature but randomized with an unwise choice of basis? In particular, are there any python modules for this?
I am looking for easily to understand example of level set method used to track phases interfaces. I would like to solve it using FEM because my solution is based on the FEM solution of second Fick law. Initialization step is straight forward - it just distance of each node from the interface. But I have problem with s...
I was reading this paper http://www.ist.temple.edu/~vucetic/documents/wang11kdd.pdf related to adaptive multi-hyperplane machine for non linear classification In that paper, they have mentioned about multiclass SVM, with multiple weights for each class. The loss for any classification is $l(x_n,y_n) = max_{i\epsilon y...
I was going through this lecture related to convex optimization. It was proved that logdet function is concave. However, I didn't get the derivation at a part I didn't get how the step marked in red in the given picture was derived. Which property was used
It looks like MATLAB and Mathematica is often used for post-processing and data visualization of 3D vector data. Now consider you are simulating 3D objects and get out gradient fields etc., is there a software or library one can use to change perspective of this 3D visualized vector data like it usual in CAD tools, so...