instruction
stringlengths
43
28.1k
Spectral decomposition of symmetric matrix $A_{n\times n}$, specifically, $n=3$ find the orthogonal matrix $Q$ and diagonal matrix $\Lambda$ such that: $A=Q\Lambda Q^T$ How to implement such decomposition in Eigen C++? or any other C++ implementations?
In the attached image, I want to understand how to arrive at the equation 2.5.1, i.e. the variational expression. The problem is defined as best as it could and the further derivation follows smoothly. The complete derivation is as shown in the image below: I am interested in how the eq 2.1.1 leads to eq 2.5.1 ... ...
I have two 50000 x 50000 binary matrices A and B for solving A*x=lambda*B*x eigenvalue problem. These matrices are sparse. I am trying to solve using PETSC and SLEPC. My memory requirement shoots off like more than 200 GB of RAM ! I used mpirun in 16 cores and 96GB RAM with swap of 130GB. Is there a way to solve this...
Typically Chebyshev interpolation from $-1$ to $1$ with angle from $0$ to $\pi$: $\xi_j=\cos \left ({\pi j \over N}\right )$ $x_j=(1+\xi_j) * {L \over 2}$ $w$: $w_0=\pi/(2N)$ $w_{1,...,N-1}=\pi/(N)$ $w_N=\pi/(2N)$ I appear to have a need in the same with angle from $0$ to $\pi/2$ only, while solving a collocation ...
Let $A$ be an $M \times N$ sparse matrix stored in compressed column format, in a C-like programming environment. I am interested in the best solution to get a sub-matrix of $A$. In MATLAB notation, this would read: A_sub = A(i:i+m-1, j:j+n-1) where $A_{sub}$ is again a sparse matrix, but this time being $m \times n$....
It is well known that for certain linear systems Jacobi and Gauss-Seidel iterative methods have the same convergence behavior, e.g. Stein-Rosenberg Theorem. I am wondering if similar results exist for nonlinear iterations, where at step $k$ the Jacobi iterations on, say $\mathbb{R}^n$, are defined as $$x_i^{k+1}=F_i(x_...
I have an $n \times n$ unsymmetric matrix $A$ that results from the discretization of an ill-posed Poisson problem, and thus is rank-deficient with null space of dimension one. I want to compute just the smallest singular triplet \begin{equation*} (u_n,\sigma_n,v_n) \end{equation*} where \begin{equation*} u_n^T A ...
Where can I find documentation for the P*GEMR2D routines in Fortran? I've found: Scalapack UG Undocumented related source Unanswered forum post
my question is simple, in openfoam we have the function foamToVTK which creates vtk files for each timestep of the solution. Now I have a huge VTK tar file (has atleast 100 timesteps), i have system 0 and constant folders can we convert those vtk files back to time folders?
I am generating random weight as per e.g. below. The I generate a set of 3 values say 100, 250, 300 and I multiple them with the weights below Initial population. 1. 0.1 0.7 0.2 2. 0.4 0.5 0.1 3. 0.3 0.5 0.2 4. 0.6 0.1 0.3 5 0.3 0.3 0.4 6. 0.2 0.2 0.6 Multiplication of weight 1. 0.1*100 + 0.7*250 + 0.2*300 = 2...
Suppose I want to set up an experiment to measure the performance of some numerical code on a desktop machine running Linux/Windows/MacOS. What kind of environment should I arrange in order to get correct timings? More precisely, what applications/services should be closed? what priority the considered process should ...
I am looking for a 2D static problem (i.e. planar stress/strain) with known analytical solution. The purpose for that is to verify my self-written code in matlab for solving 2D static problems. Any references would be welcome.
Quadrature-free DG method using nodal Lagrangian basis are computationally very efficient. I have seen many papers using this method for linear PDE but almost no literature for non-linear PDE like compressible Euler equations. The book of Hesthaven & Warburton discusses this and talks of errors in quadrature-free metho...
I'm trying to use immersed boundary method for the 3D flow problem (Navier-Stokes equations), but I'm maybe misunderstood something in this method. Main principles I took from this book. I use the continuous forcing approach and the quasi-rigid immersed boundary, i.e. the boundary force computed from this equation , wh...
I have this problem $H_i(x_1,x_2,\dots, x_N) = a_{ijk} x_j x_k + b_{ij} x_j + c_i = 0 \quad 1\leq i \leq N$ And I need to show that applying Newton-Raphson can fail to find even one real solution of this system for any N. Well if I apply Newton-Raphon, first I calculate the gradient: $\frac{\partial H_i}{\partial x_l}...
Suppose $f$ is a infinite continuously differentiable map: $R^n\to R$, and $x,x_0 \in R^n$, then we have the following second order Taylor expansion of $f(x)$ at $x_0$: $$f(x)\approx f(x_0)+(x-x_0)^T\nabla f(x_0)+\dfrac{(x-x_0)^T \nabla^2f(x_0)(x-x_0)}{2} $$ What is the next iterm? Do I need to use tensor? what is a s...
If I use scalapack and pblas, and the code is run in serial (1x1 blacs process grid), how well does scalapack and pblas revert to the performance of lapack/blas? I am particularly interested in the pzhegvx and pzheevx routines with $n \approx 1000$ and the pzgemm and pzherk routines with $m,n \approx 1000$ and $k \appr...
I'm looking for an algorithm to solve the underdetermined system of linear equations $$\mathbf{A}\,\mathbf{x} = \mathbf{b}$$ with $\mathbf{A} \in \mathbb{R}^{n\times n}$, $\mathbf{b} \in \mathbb{R}^{n\times 1}$ and $rank(\mathbf{A}) < n$. Clearly, there exists an infinite number of solution vectors $\mathbf{x}$ (or...
I'm acquiring data which looks like this: Theoretically it should be possible to fit it with a Lissajous curve, which is typically defined in the following way: $x = A \sin(a t + \delta)$, and $y = B \sin(b t)$. However, neither the cftools or optimization toolbox seem ready to do this or at least I do not know how to ...
I have a set of dates, position angles ($\theta$) and angular separations ($\rho$) for visual binary star. For example: 1994.3132 57.0 0.097 1996.1783 73.4 0.051 2006.1938 182.0 0.126 2009.2597 192.9 0.152 etc. What are algorithms to calculate orbital elements and to plot the orbit of the binary star? Ar...
I want to solve the Schrodinger via the Numerov Method but I had some troubles. I'm programing in C++, so here is my code: #include<cstdlib> #include<iostream> #include<cmath> using namespace std; double x_min=-4.0 , x_max=4.0; int N=2000; double r=(x_max-x_min)/(1.0*N); double d=2.0; double p=0.4829; ...
If the analytical form global minimum value of a nonconvex $C^{\infty} f:R^n\to R$ is already known, will it be easier to find its global minimizer $x^*\in R^n$?
I am looping an array using MPI. The problem is, i think that some processes are moving onto their next iteration before other precesses have finished theirs. This is causing me problems because data calculated by each process at each iteration is needed in the next. Is their a way that i can pause the processes at the...
Is there any reason why SciPy's integrate.odeint() should become less precise when the number of equations increase? I'm trying to solve these two sets of differential equations: $\frac{dy_1}{dx} = x^2$ — (1) $\frac{dy_2}{dx} = x^3$ and, $\frac{dy_1}{dx} = x^2$ — (2) Since the two equations in (1) are uncouple...
In multiple view geometry of computer vision, there is a geometric error called Sampson error which is very useful in the nonlinear estimation of fundamental matrix. Can this Sampson error be generalize to multiple view cases so as to use it for multiple focal tensor estimation?
I am looking at a problem of constrained minimization, where the function to be minimized contains the Heaviside function, and as such is not twice continuously differentiable. My question is what effect would the use of a twice continuously differentiable approximation to the Heaviside function have on the accuracy an...
In one sentence (thanks to @Brian Borchers), I want to minimize the function f(x, y, ...), with gradient g(x, y, ...), subject to constraints that aren't given explicitly, but are defined by situations where the routines that compute f and g return an error. The domain for f isn't linear and it is not simple to change ...
I'm looking at speeding up matrix-vector products but everything I read is about how to do it for very large matrices. My case, the matrices are small but the number of times it must be done is very large. What methods, if any, are there to optimize this? Would it be faster to construct a really big diagonal block mat...
I would like to farm out solving systems of ODEs onto GPUs, in a 'trivially parallelisable' setting. For example, doing a sensitivity analysis with 512 different parameter sets. Ideally I want to do ODE solving with a smart adaptive timestep solver like CVODE, rather than a fixed timestep like Forward Euler, but runnin...
I'm trying to perform a trasient simulation of a subsonin flow over a flat plate in CFD++. I want to impose a ramp profile on the velocity at the inlet, like for instance a smooth step, and look at the evolution of the boundary layer over the plate due to this acceleration. I want to perform this simulation without pre...
Would anyone please explain me what is the mathematical algorithm to solve a IVP system of ODE with a time-dependent parameter. e.g. dy1/dt = a1(t) * y2 -b1(t)* y3 -c1(t) y1; dy2/dt = a2(t) * y1 -b2(t)* y1 -c2(t) y3; dy3/dt = a3(t) * y2 -b3(t)* y3 -c3(t) y1; y(0)=c; My idea so far is that for fixed time-step...
I am looking for a computationally cheap way to compute $x$ such that $$(L L^T + \mu^2 I)x = y$$ where $L \in \mathbb{R}^{n \times n}$ is a lower triangular definite positive matrix (with some very small eigenvalues), $y \in \mathbb{R}^n$ and $\mu \in \mathbb{R}$ are known. If it is necessary, I can assume that $$\mu \...
I have a problem in physics formulated via an ODE. Now I like to solve it numerically using Pythons scipy.integrate and the therein complex_ode. I figured out how and it works but now I like to optimize my code and I ran into a question: I need a massive amount of grid points so that the solution converges. So I tried...
I have a large cubic eigenvalue problem: $$\left(\mathbf{A}_0 + \lambda\mathbf{A}_1 + \lambda^2\mathbf{A}_2 + \lambda^3\mathbf{A}_3\right)\mathbf{x} = 0.$$ I could solve this by converting to a linear eigenvalue problem but it would result in a system $3^2$ as large: $$\begin{bmatrix} -\mathbf{A}_0 & 0 & 0 \\ 0 & \math...
When I learned about SOR, it was mostly given as one of the first examples of iterative methods, and then later the iterative methods that I would end up using would be Krylov subspace methods. Are any of the iterative methods like Gauss-Seidel and SOR ever used in practice? Do you know of any real packages that use th...
I have a system of reactions that are governed by differential equations. They are reacting inside of a volume with known dimensions i.e lbh. I don't have any other information on their position inside that volume. I simply know there are 200 of A, 300 of B etc. when molecules pass out of this volume they no longer rea...
I am seeking to understand DDM's and their application to Maxwell's equations, though I am settling for the scalar Helmholtz as a baby step. Unfortunately I have hit a conceptual snag that I could use help with. My model problem is a 2D rectangle [-1,1]x[-1/2,1/2] split at x = 0 into left/right domains ($\Omega_L$ and ...
I am currently trying to calculate the geographic distance between two regions as I want to correlate it with their similarity of another aspect (e.g., similarity in word usage). Currently, I have used a simple approach of determining the geographic center point of each region (a region corresponds to a province/state ...
Let's say we want to solve $Ax=b$ ($A$ symmetric positive /semi/definite) with the conjugate residual/gradient method. $A$ comes from FEM where the mesh is being refined. The exact solution is $x_*$ and the approximate solution after $m$ iterations is $x_m$. Say that the initial guess is $x_0=0$. We have that $$\vareps...
I have a very large(up to 9 000 000) VectorXi vector defined in Eigen C++ which is read from a data file. The vector consists of 0, 1, 2, ...n segments with randomized lengths like below: [0 0 ... 0 1 1 1 ... 1 2 2 ...2 3 ... 3 ... k k ... k k+1 k+1 ... k+1 .... n n ...n] I need to count the lengths of each segement a...
I have a C++ program/model that in some parts already use IPOPT (with ADOL-C and ColPack) to solve some pretty large nonlinear problems. Now in another part of the program, I need to solve a large amount (tens of thousands) of small quadratic problems. I'd like to have your suggestion if you think it should be more eff...
OK, I have a FORTRAN code which numerically integrates equations of motion for large data sets of initial conditions. I run this program in my PC and it requires about 1 day of computations per data set. So, I was wandering if there is any site with super-fast PCs (or better a grid of processors) in which I could uploa...
Is there a truncated SVD algorithm that computes the singular values one at a time? My problem: I would like to compute the first $k$ singular values (and singular vectors) of a large dense matrix $M$, but I don't know what an appropriate value of $k$ would be. $M$ is large, so for efficiency reasons, I would rather no...
I'm currently writing up my PhD thesis. I spent a significant fraction of my PhD cleaning up and extending existing scientific code, applying software engineering best practices which were previously not used, and would like to write about this in my thesis. Rather than simply saying "I added unit tests", I want to be ...
I apologize if this question in a more general form has been asked before. I have a tridiagonal Toeplitz matrix $K$, whose eigenvalues and eigenvectors are known analytically for any dimension $N$ [1]. Specifically, in the notation of Section 2.2 of this paper, the matrix I wish to diagonalise is such that $a_1 = a_2$ ...
I have a nxn covariance matrix (so, real, symmetric, dense, nxn). 'n' may be very very very big! I'd like to solve complete eigenvalue (+eigenvectors) problem for this matrix. Could somebody tell me what the fastest algorithm to do it? P.S. I'd like to make GPGPU implementation using OpenCL. Typical sizes is 10000x1000...
I would like to numerically integrate a smooth function (to be precise, I am computing differential entropies of Gaussian mixtures of the form $\int f(x) \log(1/f(x)) dx$). Is there any software package or library that gives me the exact answer up to X digits (and potentially more), where X can be rather large? The GSL...
Consider one initial boundary value problem for sphere. $$\frac{\partial u}{\partial t}=\operatorname{div}A\nabla u +f$$ Here is explicit numerical scheme (we consider that it is stable): $$\frac{u^{n+1}_{i,j,k}-u^{n}_{i,j,k}}{\Delta t}=A_{i,j,k}{\frac{\partial u}{\partial r}}_{i,j,k,+/-}^{n}+B_{i,j,k}{\frac{\partial u...
I'm trying to solve the Convection-Diffusion-Reaction (CDR) equation on a rectangular domain, using cylindrical coordinates and Finite Difference Methods (FDM) (this approximates a flow reactor). Specifically, I want to solve $D ( \frac{\partial^2 u}{\partial r^2} + \frac{1}{r}\frac{\partial u}{\partial r} ) - v(r) \f...
I'm trying to find some theory to help me explicitly express the inverse of a matrix (or a close approximation of the inverse). My matrix has the following properties: invertible positive definite symmetric all diagonal entries $> 0$ all off diagonal entries $\le 0$ sum across any row or column is nonnegative and fur...
Please help me with any/all of the cases below. In the following cases, the named method and basis set are not suitable for the chemical systems. Why aren't they? Could you suggest a suitable method/basis set? (i). MP2/6-31G(d) for the calculation of reaction energy of the reaction below (H2C: should be calculated in t...
Could anyone recommend a method for the following least-squares problem: find $R \in \mathbb{R}^{3 \times 3}$ that minimizes: $\sum\limits_{i=0}^N (Rx_i - b_i)^2 \rightarrow \min$, where $R$ is a unitary (rotation) matrix. I could get an approximate solution by minimizing $\sum\limits_{i=0}^N (Ax_i - b_i)^2 \rightarro...
I know the number of solutions to the equation $$x_1+x_2+x_3+...+x_k=n$$ is given by $\binom{n+k-1}{k-1}$. Is there an algorithm to actually find all the solutions to this equation, without having to brute force?
I have an expression of the form: $ACA^{'}$ where $C$ is an invertible, symmetric and positive definite matrix. I'm trying to figure out if the expression above is invertible. The $C$ matrix is $n \times n$ and the $A$ matrix is $k \times n$. Every row of A has exactly one entry =1 and one entry =-1, all other entr...
I have a nasty non-linear partial differential equation. I wonder if there exists a method that would allow me to examine what numerical errors (like numerical diffusion or dispersion) are introduced by different approximation schemes. Name of the method or a link to a paper would be great. EDIT: Equation $$ \frac{\par...
I would like to ask you for your help. I have 2D box. I know how to do an 2D cut line and compute an average value of someting over this line. (in Results -> Data Sets -> Cut Line 2D and then Results->Derived Values->Line Average and choose Cut Line 2D 1). But I would need to know this average value for many of such p...
I have a quadratic programming problem with constraints of the general form: Minimize w.r.t. x: f(x) = (1/2) x^T * Q * x + c^T * x subject to one or more constraints of the following form: A * x <= b (inequality constraint) E * x = d (equality constraint) My problem is that I want to have an inequality constraint li...
I'm looking for a simple method to find a linear transform that minimizes $$ \text{argmin}_T F(T): T \in \mathbb{R}^{m \times n} ,\ T \ge 0 ,\ T \mathbb{1} = c \mathbb{1} ,\ \mathbb{1}^T T = \mathbb{1} $$ i.e. over $m \times n$ matrices $\ge 0$ with row sums all the same and column sums all 1. (If there's a standar...
I have a vtk file which has a bunch of points, I would like to delete a few points because, those distort my geometry (basic geometry clean up), is there a way I can do it in paraview? I just want to delete those points , that is it. I haven't found a way to do it.
Is there a way to approximate the convolution of Beta variables? Specifically, I am trying to find an approximation to $g(x_0)$: $$g(x_0) = \int \delta(x_0-\sum_{i=1}^{n} a_i x_i) \prod_{i=1}^{n} f(\alpha_i,\beta_i;x_i)\mathrm{d}x_i$$ where $\delta(x)$ is the Dirac delta function and $$f(\alpha_i,\beta_i;x_i)=\frac{x_i...
I'm solving a nonlinear constrained optimization with constraint of following form: $$\mathbf{A}^T\mathbf{A}-\mathbf{I}=\mathbf{0}, \mathbf{B}^T\mathbf{B}-\mathbf{I}=\mathbf{0}$$ where $\mathbf{A}$ and $\mathbf{B}$ are matrices that I'm solving for. Usually the initial guess of $\mathbf{A}$ and $\mathbf{B}$ are diagona...
I want to use Quasi Monte Carlo to try and improve the convergence of a simulation I am running. The random numbers are simply to produce the observation errors for a standard linear regression model, which is then estimated using a number of different regression techniques. This is done repeatedly to estimate the mean...
There is PDE: $$\frac{\partial u(r,\varphi,\psi,t)}{\partial t}=\operatorname{div}A(r,\varphi,\psi)\nabla u +f(r,\varphi,\psi,t) $$ We solve numerically IBVP for the ball $B_{1}(0)\subset \mathbb{R}^3$ using the numerical scheme of this PDE. Numerical scheme is the following: $$\frac{u^{n+1}_{i,j,k}-u^{n}_{i,j,k}}{\Del...
In FEA simulation of simple beams (3D solid and shell/plate), I have taken a simple geometry: A long beam in the y direction a concentrated load applied on the plane of symmetry There is a pin or roller joint at some point between the symmetry plane and end of the beam: load a b ...
I am implementing a fluid simulator as my numerical methods course project and I have to compute pressure at each simulation step. Basically, that means solving an equation $Ap = b$, where $A$ is a sparse matrix: all its entries are zero except: Its main diagonal Diagonals before and after main diagonal For some $k$, ...
I read the paper called Laplacian Surface Editing, but I'm confused about how does the author solve the formula (4). The paper says that 'Solving this quadratic minimization problem results in a sparse linear system of equations', so I have tried to use the quadprog function in matlab, but when the size of the nodes is...
I am looking at a few reaction-diffusion equations of the form $\frac{dP}{dt} = D\left(\frac{d^2P}{dr^2} + \frac{2}{r}\frac{dP}{dr}\right) - a(P)$ I know the initial conditions and the boundary value at one end. I also know the function steadily falls and eventually hits zero at the second unknown boundary. To model t...
Consider the following optimization problem: $\text{max}_{p} \quad ||p||^2 \\ s.t: x\geq 0\\ p\in D$ where $D$ is a convex set. Is this problem $\mathcal{NP}$-hard?
Let $A$ be a real, symmetric, positive definite matrix. It has at least 500 rows, possibly much more. I compute its Cholesky decomposition, which allows me to calculate $det(A)$ $A^{-1}X$ for some vector/matrix $X$ $A^{-1}$ (I am aware of the warnings here) Unfortunately, this operation needs to be performed a lot of...
I will be interfacing our fluid dynamics code with an optimizer. I expect the optimization process to take 3-4 days for any decent decrease. But I will want to have a look at the intermediate results for trends and to make sure that things does not blow up, both at the optimizer level and at the fluid dynamics level. ...
This question is a specialization of full rank update to cholesky decomposition, to which I hope to get a more positive answer. When calculating the minus log of the multivariate normal distribution, the most difficult part is evaluating $$f(\epsilon,\Sigma) \equiv \epsilon^\top \Sigma^{-1} \epsilon + \log \det \Sigma$...
I would like to minimize the following quadratic form: $$ f(\mathbf{\theta}) = (\mathbf{y} - \mathbf{\mu}(\mathbf{\theta}))^T \mathbf{\Sigma}({\mathbf{\theta}})^{-1} (\mathbf{y} - \mathbf{\mu}(\mathbf{\theta})), $$ wrt $\mathbf{\theta}$. $\mathbf{y}$ is $d$-dimensional, while $\mathbf{\theta}$ is $p$-dimensional. Gener...
Given a forward-in-time approximation I have the coupled equations: $$ \frac{T^{(n+1)} - T^{(n)}}{\Delta t} = x T^{(n)} - y h^{(n)} \\ \frac{h^{(n+1)} - h^{(n)}}{\Delta t} = -z h^{(n)} - \alpha T^{(n)} $$ where $x, y, z$ and $\alpha$ are constants, I see from my simulation that the solution is damping. But how can I us...
I am trying to create a simulation to help visualize how different chemical components flow through a network of pipes with associated valves, pumps, and chemical inputs. In this simulation, the pipes will be represented in 1D and the pump flow rates and valve states will ideally be able to be changed by the user durin...
I'm numerically inverting an integral transform using a method suggested by a scicomp user from an earlier question. The problem is as follows: I wish to estimate $f(x)$ for a given $F(y)$, both of which are expressed as a linear combination of some set of orthogonal basdis functions $\phi_n$: $$ f(x) = \sum_{i}^{M} c_...
I've an equation like this to solve with the crank-nicolson method $$U_t -\frac{y}{2} U_x + \frac{x}{2}U_y = 0,$$ where $x$ and $y$ are: [-2,5:2,5] and the time $T$ is from $0$ to $2\pi$. Is there anyone who can help me? I have to solve it in a matlab code. thanks everyone. I'm sorry for my english.
I'm looking for a library that is either in R or easily wrappable with R, that can do the following things: construct and subset N-dimensional arrays perform operations such as min, max, sum, sd along any dimension is fast and ideally has a BLAS backend And (this is important), is able to define multilevel-masks alon...
comp! I'm trying to solve the advection-reaction problem $ dg/dt = dg/dx + x\cdot g \qquad on~~x \in \Omega = (-\infty, +\infty)$ supplemented with the boundary conditions $ \lim_{\lvert x \rvert \to\infty} g(x, t) = 0.0$ and subject to the constraint $g(x=0, t) = 1$. It seems to me that a non-trivial steady state sol...
This topic is used in spectral methods, for collocation grid. Literature mentions Chebyshev interpolation on a grid (defined by $\xi_j = cos(\pi \cdot j/N)$, $x_j = (\xi_j+1) L/2$, $j=0,...,N$) includes 2 steps 1/ Calculation of Chebyshev coefficients (sum over all points $x$) $c_n = \sum_{j=0}^N f(x_j) \cdot T_n (\x...
In this simple benchmark describing the flow around a disc in the plane with stationary bc, for low Reynolds numbers the solution is stationary and for higher RN it is periodic in time. Is there a theory saying, by which RN periodicity disappears and the solution(s) become(s) completely chaotic (if it happens at all)?
Given a standard advection equation, we write the update as $$ q_i^{n+1}=q_i^n+\frac{\Delta t}{\Delta x}\left(F_i^{n+1/2}-F_{i+1}^{n+1/2}\right) $$ with $F_i^{n+1/2}=F\left(q_i^n,\,q_i^*\right)$ and $q^*_i$ a predicted value, other variables take their normal meaning. It is possible to reconstruct what numeric value $F...
I'm modeling mass transport in a flow reactor. The flow reactor is a tube, which allows me to use cylindrical symmetry in solving the Convection-Diffusion-Reaction (CDR) Equation, which governs the mass transport. The equation that I'm solving is: $D ( \frac{\partial^2 u}{\partial r^2} + \frac{1}{r}\frac{\partial u}{\p...
I have a program that generates mesh for given 3d models. The generated mesh must use quadrangle elements. It is required to add "shell elements generation capabilities". The requirement is as follows: The mesh generator must have the ability to mesh "shell elements". Shell elements are two-dimensional elements that...
What is the best way to compute: $$ Y = D X $$ where $D \in \mathbb{R}^{m\times m}$ is diagonal and $X \in \mathbb{C}^{m \times n}$ is general. I am mostly interested in these two cases: $m >> n$, $m > 10^7$ $n >> m$, $m < 10^4$ Options I can think of four not-obviously-flawed ways of doing this: loops, forall, lo...
I am working on a project that I need to add a regularization into the NNLS algorithm. Is there a way to add the Tikhonov regularization into the NNLS implementation of scipy [1]? [2] talks about it, but does not show any implementation. Sklearn has an implementation, but it is not applied to nnls. [1] http://docs.scip...
I have a nxn covariance matrix (so, real, symmetric, dense, nxn... I mean positive semi-definite). 'n' may be very very very big! I'd like to solve partial (3 largest) eigenvalue (+eigenvectors) problem for this matrix. Could somebody tell me what the fastest algorithm to do it? Is it power iteration method (because it...
I have the following quadratic program $$\begin{array}{ll} \text{minimize} & f(x) = \frac{1}{2} x^T D x + c^T x\\ \text{subject to} & x_{\text{lower}} < x < x_{\text{upper}}\end{array}$$ where matrix $D$ is symmetric negative definite! I have no problems with using symmetric positive definite matrices for $D$. I use JO...
I just started studying FEM in a more structured basis compared to what I used to do during my undergraduate courses. I am doing this because, despite the fact that I can use the "FEM" in commercial (and other non-commercial) software, I would like to really understand the underground techniques that support the method...
Within Fenics what ordering is used for storing vectors as upper triangular matrices? Th:e question really is I define a green Lagrange strain tensor in the following way: V = VectorFunctionSpace(mesh, "Lagrange", 1) u = Function(V) I = Identity(V.cell().d) # Identity tensor F = I + grad(u) # Deformatio...
Take sparse approximate inverse preconditioner $M \approx A^{-1}$ given by solution of $$\underset{M \in S}{\mbox{min}} \; ||I - AM||_F,$$ where $S$ is a set of sparse matrices and $||.||_F$ is the Frobenius norm (see [1] for details). I am wondering which specific characteristics of the matrix would make this precondi...
I'm attempting to validate my FDTD code against Meep by calculating the Poynting vector field across a simulation consisting of a monochromatic point source within a box (no boundary conditions (Dirichlet) so everything just bounces off the domain boundaries. In this case, the simulation is 2D TMz (point source in $E{z...
I am working on a project that I need to add a regularization into the NNLS algorithm. Is there a way to add the Tikhonov regularization into the NNLS implementation of scipy [1]? [2] talks about it, but does not show any implementation. Sklearn has an implementation, but it is not applied to nnls. [1] http://docs.scip...
I know that the Tikhonov regularization of a linear system has an analytical solution given by: \begin{equation} \hat{\mathbf{x}} = \mathrm{arg\;min}\left( \left| \mathbf{Ax} - \mathbf{b} \right|^{2} + \left| \mathbf{\Gamma x} \right|^{2} \right) = \left( \mathbf{A}^{\top}\mathbf{A} + \mathbf{\Gamma}^{\top}\mathbf{\Gam...
I'm a newbie at modelling and optimization of LPs. My research problem concerns assigning tasks/jobs to virtual machines in a data centre depending on the least energy cost incurred. As you can imagine this is a very large problem. My primary question is: Which algorithm (interior point, genetic algorithm....etc) woul...
I have question connected with finite volume method. Consider equation $$\frac{\partial u}{\partial t}=\operatorname{div}A\nabla u +f . \quad x\in \overline{B}_{1} (0)\subset \mathbb{R}^3 -\text{unit ball with its boundary}$$ I solved IBVP for this equation with a help of finite volume method, for grid I took uniform s...
The non-linear Poisson equation in one-dimension, $$ 0 = \frac{\partial^2u}{\partial x^2} - f(u) $$ can be discretised as to give, $$ u_{j-1} -2u_{j} + u_{j+1} = h^2 f(u_j) $$ where $h$ is the step size of the mesh. Is there any advantage (in general or not) to write the non-linear source term as the average value of ...
[Edited to simplify the question] I am trying to associate the eigenvalues $E$ of a matrix $H$ to the original rows of the matrix. Moreover, it would be trivial to sort the eigenvalues in ascending order, however this throws away some of the information. For my purpose the matrix is a Hamiltonian where the different ro...
I would like to normalize a quantum mechanical multi-particle wave function numerically, and since the result is a multidimensional integral I thought Monte Carlo methods might be appropriate. So, I'm looking for $\mathcal{N}$ where $\psi=\frac{1}{\sqrt{\mathcal{N}}}\tilde{\psi}$ and $\psi$ and $\tilde{\psi}$ are the n...
I have a set of points (2D space), and for every point there's a label (like city names on a map). I want to find a real-time algorithm that allows labels to avoid overlapping, moving them from their original position if necessary. I've heard about simulated annealing algorithm, but I can't find a good source to learn ...
I have a question which I think should be pretty simple. I have written a subroutine in Fortran which will compute the Gradient at a point of the form subroutine get_gradient(xyz, Grad) where xyz is a 3x1 array and Grad is also a 3x1 array. The gradient method is a fourth order accurate method where the step is chosen ...