instruction
stringlengths
43
28.1k
I have large arrays of data organized so that it can be processed efficiently using array processing libraries. However, there are times when I only need to process slices of the arrays where a slice might be an arbitrary, non-contiguous subset defined by a select set of index values. For example result = someArrayPro...
A simulation I'm doing requires me to calculate the partial trace of a large density matrix. I am trying to calculate it using tools from numpy, but my code seems to be having some problems. For background, let me explain the arrays I am interested in a little more, and the way I'm defining the partial trace. Then, I w...
I'd like to build a system in Python, consisting of (broadly speaking) objects which are internally described with (not necessarily just linear) equations, that I can connect with each other - similar to what can be done in OpenModelica. Is there anything like this already available or do I have to use OpenModelica for...
I am trying to understand the mathematical side of an algorithm, which approximates the solution of coulomb's law. Their approach is to balance the two elements with the biggest positive/negative error. Trying to understand the stability conditions of the algorithm, I am searching if there is an iterative solver with a...
I have two sets of large positive numbers $a_1,\ldots,a_n$ and $b_1,\ldots,b_n$. By 'large' I mean of the order of $10^{10}$. I want to calculate the ratio $$R = \frac{a_1 - a_2 + \cdots +(-1)^{n+1}a_n}{b_1 - b_2 + \cdots +(-1)^{n+1}b_n}.$$ It is already known that the exact value of $R$ is between $0$ and $1$. Each of...
I need to have a finite difference stencil for the mixed derivative $$f_{xy}$$ on nonuniform grids such as this one: Since I could not find a stencil in the literature, I tried to derive it by my self. As usual I started with a Taylor series expansion: $(I)\qquad f(x+b,y+d)\approx f + b f_x+d f_y +\frac{b^2}{2}f_{xx}...
Can we use the von Neumann stability analysis to investigate the stability of the discrete form of the following problem? $$u_t+\frac{\partial(x^2u)}{\partial x}=S(u,x)\ .$$ Please give some hint how to use this analysis in the above problem.
A naïve approach to solving stochastic differential equations (SDEs) would be: take a regular multi-step Runge–Kutta method, use a sufficiently fine discretisation of the underlying Wiener process, make each step of the Runge–Kutta method analogous to an Euler–Maruyama. Now, this fails on multiple levels and I unders...
I'm trying to reproduce the work in computing turbulent energy spectrum from isotropic turbulence flow field in a box but I have a hard time understanding James' answer about the binning part. Would you be so kind as to try to explain it to me ? Many thanks !
I'm trying to solve the linear advection equation $$u_{t} = cu_{x}, \\ x \in [x_{0}, x_{e}], \quad t \in (0, T], \quad c \in \mathbb{R} \\ u(x,0) = f(x)$$ Note that for $c > 0$, the solution is a left travelling wave so requires a boundary condition on the left, while $c < 0$ is a right travelling wave so requires a bo...
I want to develop a distributed algorithm with MPI which have load balancing capability. But there is a situation that I'm not very clear about, which is, when the number of tasks is less than the number of processors available, I need to detect that and terminate those processors whose ranks (actually rank + 1) are gr...
I am trying to plot a reference solution for the 1D wave equation using python. The above link states the following: For a rod fixed at the right end and free at the left end and subjected to a hammer blow at the left end at $t = 0$ s where the hammer blow induces a constant velocity $V_0$ to occur from $x<a<L$, the di...
I like to represent the following numbers in a data structure, like in trees or list but with one parent node and possibly many child nodes 1.3.1.1.0 1.3.1.1.1 1.3.1.1.2 1.3.1.2.0 1.3.1.2.1 1.3.1.3.0 ... Which data structure allow me to store and search the given values?
Consider the equation $$\frac{\partial}{\partial t}v(t,x)=\frac{\partial}{\partial x}v(t,x)$$, for $t,x\in\mathbb{R}$. I'd like to solve this equation forward in space and backward in time, updating in space given the initial condition in space: $v(t,0)=f(t)$. Now, we can discretise in time and take the backward differ...
Consider one dimensional hyperbolic pde $$u_t+f'(u)u_x=0$$ For the above problem ,CFL condition is $\Delta t\leq \dfrac{\Delta x}{|f'(u)|}.$ But if we include the source term $,S(u,t),$ which depend upon $u$ and $t$ in above equation i.e. $$u_t+f'(u)u_x=S(u,t)$$ What is the influence of $S(u, t)$ in the CFL condit...
Let A be a n×n positive-definite Hermitian matrix. I already have the QR decomposition of A. Is there an efficient way to utilize this knowledge to speed up the Cholesky decomposition of A?
I work in Molecular dynamics of biomolecules. I am familiar with the software NAMD. We use NAMD in our CPU cluster with the aid of mpirun. Without GPUs can I implement large scale deep learning? Is there any scalable software out there like NAMD, but for Machine learning and deep learning? Is there any Machine Learni...
There is a problem I want to solve. The function is: \begin{align} &\underset{a,b,\textbf{vec}}{\text{minimize} \text{ }\text{ }\text{ }\text{ } } f=\sum_{i=1}^{b}(\textbf{vec}_i)^{a}\\ &\text{subject to } \text{ }\text{ } f \geq F, \text{ } \sum_{i=1}^b \textbf{vec}_i = D, \text{ } a\leq N, b \leq D, \{\textbf{vec}...
I'm using LAPACK zgeev routine to get eigenvalues and eigenvectors of a symmetric matrix in C++. Problem is zgeev is being called in a loop but it sorts eigenvalues (and eigenvectors) differently sometimes. For example, this is the eigenvalues from the first round of loop: (-1.29007e-5 - 5.207e-6*i) (1.28782e-5 + 7.40...
I'm working on a project that requires unknown image elements to be filled in, and am using a simple inpainting algorithm, which I would like to understand better. It works by repeatedly convolving a 3x3 filter (in 2D) with the image. The center point of the filter has coefficient zero (of course!), while the corners h...
I'm using LAPACK zgeev to calculate eigenvectors of a symmetric complex matrix of high dimensions ($n \approx 2000$). I need these eigenvectors to satisfy $$\sum_{m=1}^{n} \frac{\lvert m \rangle \langle \overline m \lvert}{\langle \overline m\lvert m \rangle} = I_n$$ Where $\lvert m\rangle$ is an eigenvector and $\lan...
I want to write a simple simulation for heat conduction in a unstructured triangular mesh. I already made it work for a structured rectangular grid with the ADI method, but now I need more complex geometries. With $d_x=\frac{\kappa \Delta t}{(\Delta x)^2}$ and $d_y=\frac{\kappa \Delta t}{(\Delta y)^2}$ you can say: $$d...
To improve the time efficiency of my code, I'd like to test a lower precision for real number, using e.g. half precision (2 bytes). However, I'm not sure if I can do that in Fortran. After playing with the intrinsic SELECTED_REAL_KIND procedure, it seems that gfortran can only deal with 4, 8, 10 or 16 bytes precisions....
I am getting this strange error with paraview 5.4. For example, if I load one of the example visualisations: and if I export it as eps or pdf, then the color legend is place in the bottom left corner: This does not happen for jpg or png files. Anybody know how to fix this? Thanks
I'm solving 2D Euler's equations in Cartesian coordinates: $$ \frac{\partial U}{\partial t} + \frac{\partial F}{\partial x} + \frac{\partial G}{\partial y} = 0, \qquad U = \left( \begin{array}{c} \rho \\ \rho u \\ \rho v \\ e \end{array} \right), \quad F = \left( \begin{array}{c} \rho u \\ p+\rho u^2 \\ \rho uv \\ (e+...
I am solving a 1d Shock tube problem of compressible fluid obeying Euler equations(Hyperbolic pde). I am trying to simulate it using Finite Volume Method using Roe's Scheme. Half of the tube contains highly compressed fluid and other half is not compressed with density ratio of ~1000. Euler Equation: $$ ∂Q/∂t + ∂F/∂x =...
I am solving a non linear second order implicit initial value problem using finite difference method, but my results do not converge. Please guide me with an example, how we can apply finite difference method with big accuracy. The problem is $$(A+By(t)-C(-y'(t))^-1/3)y''(t)=-(By'(t)^2+C),\qquad y(t=0)=0,$$ using fdm, ...
I've a read a paper about investing where they used a dynamic programming approach to solve a finite horizon problem, i.e. $$\max_{x_t} E[u(W_T)] $$ where $u$ is a utility function and $W_T$ denotes the terminal wealth. The Bellman equation can then be written as $$ V_t(W_t) = \max_{x_t}E[V_{t+1}(W_{t+1})|W_t]$$ with...
I'm trying to solve a very simple advection PDE $\frac{\partial u}{\partial t}+c\frac{\partial u}{\partial x}=0$ where $c<0$. I have been able to implement a simple Modelica code to solve the equation and it works just fine for $c>0$ with the exact same boundary conditions, though. So my question is why my code is no...
I am trying to use backwards finite difference method to numerically solve a pair of partial differential equations: $\frac{\partial \left(pv\right)}{\partial x}+\frac{\partial p}{\partial t}=0$ $\frac{\partial \left(pv^2\right)}{\partial x}+\frac{\partial \left(pv\right)}{\partial t}+c\frac{\partial p}{\partial x}=0$...
I'm trying to solve the heat equation in FiPy and right now it works, but I have one problem: The material I have to simulate has different diffusion coefficients in the x and y direction (due to its fibre layerd structure). I know, that you can make your diffusion coefficient dependent to a variable in FiPy. My grid i...
I have a 9 systems of nonlinear ODEs to solve. I want to determine the endemic equilibrium points. How do I go about it? I tried manual calculation but it becomes cumbersome. Can software be used for this purpose?
I'm measuring the integral of a quantity which, mathematically, requires the computation of a dilogarithm function. $$\operatorname{Li}_2(be^{ax})$$ where $b$ and $a$ (are real and) can be positive or negative. Dilogarithm has very nice properties that enable us to compute its value efficiently, For $|z|<1$, the follow...
I have been looking into simple ways of calculating numerically the total fluid stress tensor $ \pi_{ij}$ if the flow field is known in every $ x,y,z $ point. Applying the fluid stress equation (see below) isn't really straightforward since it requires an analytical velocity field. I understand this question might be "...
I am computing the inverse of a complex matrix. I execute ZGETRF but U(2,2) = 0. When I compute ZGETRI, the inverse is determined. Can I trust this inverse?
I have the same problem as in this question. But can someone elaborate on the answer? The poster says that: Solving this system of 4 ODE's with rk4 will solve for all your state variables simultaneously. position and velocity do not need to be handled seperately (and shouldn't be). How is this actually implemented? T...
I have written Poisson solvers using two different methods: A classic Jacobi scheme and one using the multigrid solver Hypre. I made up a couple of test cases ensuring the validity of those solvers. For both cases the domain is defined as $(x,y) \in [-1,1]^2$ with periodic boundary conditions. Also, the grids first and...
I am trying to estimate the FD stencil for boundary as mentioned in this paper (section 4.1) using MATLAB. The stencil order (6th) is higher than the one mentioned in paper (4th). $$ f_1' +\alpha f_2' = \frac{1}{h} (c_1f_1 + c_2f_2 + c_3f_3 +c_4f_4+ c_5f_5 + c_6 f_6 + c_7 f_7 )$$ Each term of both sides is expanded us...
In order to integrate a two dimensional function of the form $$\int_{1}^\infty \int_{-\sqrt{x^2-1}}^{\sqrt{x^2-1}} e^{-x} \rm{d}y \rm{d}x,$$ I have been attempting to use the following code (written in C++) taken mostly from the Numerical Recipes book which calls a gaussian quadrature routine for the integration: sta...
The water height $h$ and 2d velocity field $(u,w)$ are "extrapolated to non-fluid-cells, i.e., setting $h$ equal to the value in the nearest fluid cell." [Bridson] I'm using finite differences. Looking at the course notes, this extrapolation seems involved: tracking the zero level set surface $\phi$ (using signe...
I am trying to solve Stokes problem using Finite element method. My question is how to impose that total pressure over the surface is zero to remove the constant pressure mode?
I would like to perform a decane/water(tip4p) interface simulation using GROMACS to analyse the fluctuation of the interface over a long period of time (50ps - 1ns). Though I have a rough idea on how to perform it, I still am unsure about how to create a initial configuration which looks like the figure give below (A....
Assume I have two functions $f$ and $g$, with derivatives of $g$ at point $x$ and derivatives of $f$ at point $g(x)$ available. What is the fastest way of computing derivatives of $f \circ g (x)$ ?
I have a PDE (coming from a Bellman equation with $z$ under brownian motion). Let $z \in [0,\infty)$ and $t \in [0,T]$. To sketch the equation: $$ (r - g(t)) v(t,z) = \pi(t,z) + (\gamma - g(t))v_z(t,z) + \frac{\sigma^2}{2}v_{zz}(t,z) + v_t(t,z) $$ with a terminal condition $v(T,z)$ and ugly nonlinear boundary condit...
Are there any high performance integer BLAS libraries that implement matrix multiplication i.e. i32gemm and i64gemm ? I need to use them for a cryptographic application and can tolerate overflows, i.e. I don't require the kernel to do any wraparound checks. The difference between a Igemm and an Fgemm is that the latter...
I'm prototyping a system that finds the 3D pose of a object in a video sequence. For this I minimize a error function involving the rotation and translation of the object as parameters and two sets of points (polluted with gaussian noise but no outliers) as data. I have tried to parameterize the rotation matrix both us...
Suppose I have a multi-dimensional vector space $X$, and a collection of $n$ vectors $\{x_i\}_{i=1}^n \subset X$, which are not evenly "spaced-out" in $X$. I am searching for $m<<n$ of these $x_i$ that are good representatives of $X$, or in other words, they are roughly equi-distant to each other. How can I find these ...
Considering that COMSOL forum is dead and CFD-online is not responsive, I'm gonna try asking my question here: I have done a 2D simulation in COMSOL multiphysics. I have two independent variables x and t and two dependent variable u1 and u2. Comsol gives me 2D projections of the 3D graphs u1(x,t) and u2(x,t) as below:...
I have $n$ points that form a grid with empty space and I need to find an algorithm that would calculate the total distance of those points with time complexity lower than $O(n^2)$. a grid with $n=5$ could be represented as a matrix: $$ \begin{matrix} 0 & 0 & 1 \\ 1 & 0 & 1 \\ 0 & 1 & 1 ...
Problem I would like to solve a nonlinear integro-differential equations on a 2D square domain $\Omega$ subject to Neumann boundary conditions using finite differences: $$\frac{\partial u}{\partial t} = f(u) + \int_\Omega G(x'-x)\left[u(x')-u(x)\right] dx'.$$ The variable $u(x,t)$ depends on space and time, $f$ is a no...
I need to diagonalize such kind of matrix during research: it's n-by-n, with it's upper-left (n-1)-by-(n-1) corner be diagonal while the nth row & column are dense. It's observed that the self adjoint eigensolver is not quite efficient as a solution when n is greater than roughly 2000 and there is no existing eigensolv...
These are the discretized drift diffusion equations as taken from the book "Analysis and Simulation of Semiconductor Devices". The electron continuity equation is: $$((\Delta_{j-1}^y+\Delta_j^y)/2\Delta_i^x).D_{i+1/2,j}^n.B((\varphi_{i+1,j}-\varphi_{i,j})/V_T).n_{i+1,j} + ((\Delta_{j-1}^y+\Delta_j^y)/2\Delta_{i-1}^x)....
I'm trying to implement Dinur-Nissim algorithm and am stuck at how to solve the set of linear inequalities with multiple unknowns and a large number of equations along with constraints. Example: \begin{align} 0.2 \leq c_4 \leq 0.66\\ 0.66 \leq c_3 \leq 1.56\\ 0.96 \leq c_3 + c4 \leq 2.26\\ \end{align} Constraints: $$0...
I have this dataset, and I am using y = (a * x^n) / (b + x^n) Hill function as the model, where a is the limit of the Hill curve, b is the point at which a/2 is reached (for n = 1) and n is the cooperativity or steepness of the curve. Currently, I am storing all X,y values, computing the parameters from scipy.optimize....
I want to simulate a simple 3D diffusion (e.g., an ink released from one side of a vessel) using SciPy. There are some tutorials for one-dimensional diffusion. Although the ink goes in one direction, it will not be straight. I appreciate if you can help me to consider the spread of the ink along with other dimensions t...
Suppose I am given a vector $v^0\in\mathbb{R}^n$ and integers $k,\ell\in\mathbb{Z}$. Assuming $k$ is close to zero (e.g. $0\leq k\leq5$), is there an algorithm for solving the following integer optimization problem? $$ \boxed{ \begin{array}{rl} \min_v & \|v-v^0\|_2\\ \mathrm{s.t.} & v_i\in\{-k,\ldots,0,\ldots,k\}\ \fo...
I'm interested in modeling the electromagnetic fields radiated from an accelerated charge, but do not want to reinvent stuff if possible. I suspect there are software packages already out there which allows a person to provide the incoming accelerating field or trajectory of the charge, and is returned an array of valu...
I want to compute the difference $\Delta f(x_1,x_2) = f(x_1)-f(x_2)$ of a smooth function $f(x)$ at two points $x_1$ and $x_2$ which are close to each other. The magnitude of the expected result, $|\Delta f(x_1,x_2)|$, is often small compared to $|f(x_1)|$ and $|f(x_2)|$ and several significant digits are lost if I eva...
I am trying to calculate the singular value decomposition of this matrix using numpy.linalg.svd . However, reconstructing the matrix from the SVD gives a poor reconstruction - in particular, the first row and second column are far smaller in the reconstruction than in the original matrix. u, w, vt = np.linalg.svd(M) np...
I would like to volumetrically render 3D scalar data in Paraview, and I'm not sure if my inability to do so is incorrect usage of VTK or Paraview. I have built a *.vtu VTK unstructured grid file containing 2 cells consisting of 10 PolyVertex objects with scalar data associated with each point. These are meant to repres...
Thank you all 1.) I am trying to solve the lid-driven cavity problem for an incompressible Stokes and Navier Stokes equations using the general "Mixed" finite element method. Dirichlet boundary conditions are specified everywhere on the boundary. When I try to solve these systems of equations, my matrix showing is that...
I am looking for different approaches to extract 3D polylines out of Point Clouds. We are able to create these point clouds out of different data sources of real world surveys (LIDAR, RADAR, etc...) and to classify points (as metallic in common soil for example). What I am looking for is academic work/papers on algori...
I'm trying to implement finite-difference WENO method to progressively complex equations and systems. At the moment I'm successful with singular scalar equations (constant advection and Burgers), and trying to advance to 1D system of Euler equations. I've read that there are two approaches to apply WENO to systems of c...
What data structure (or C++ library implementing it) is most suitable for efficient high dimensional histogramming? I have an application where I need to compute something similar to a histogram in a high dimensional space ($d=10..20$). Even with a large linear bin size, there would be too many bins in total. However, ...
Let's say that I have a FEM code which yields the following problem: $$ \mathbf{A}\mathbf{x} = \mathbf{b}. $$ In order to solve this more efficiently with an iterative method, I would like to precondition it, $$ \mathbf{BAx} = \mathbf{Bb}, $$ using domain decomposition. This is a common application for domain decomposi...
I tried to used f2py, Cython and Numba to make a simple loop structure be faster in python. Python implementation: def Python(A): B = 0.0 for i in range(100): for j in range(100): for k in range(100): for l in range(100): B = B + A[i,j,k,l] return B Numa ...
I'm trying to apply finite-difference characteristic-wise WENO method to 1D Euler equations: $$ U_t + F(U)_x = 0, \; \;\text{where} \;\; U = (\rho, \rho u, e) \;\; \text{and} \;\;F(U) = (\rho u, \rho u^2+p, (e+p)u) $$ Physical values are set at grid points $x_j$, so we need to approximate fluxes at mid-points $x_{j\pm ...
I was using scipy.integrate.odeint function , the ode is $$\frac{y\ dx - x\ dy}{(x+y)^2} + dy = dx$$ with solution $$y^2 - x^2 - y = c (x + y)\ .$$ Solving it via odeint from scipy.integrate import odeint import numpy as np import matplotlib.pyplot as plt def dy_dx(y, x): return ((x+y)**2 - y)/((x+y)**2 - x) xs = np...
I would like to solve a system of second-order differential equations to describe the dynamics of a system of particles. Two Newton-like forces are responsible for the motion of each particle $i$: A force acting on each particle due to other particles $f_{i,j}$ and a stochastic term of noise $f_{\mathrm{noise}}$. The f...
I am looking for libraries for solving large scale linear system (10e5) of equations using parallelization and shared memory. 1. Sparse, complex symmetric, SPD. 2. Suitable for higher order FEM ,DGFEM using Domain decomposition. 3. Suitable for iterative solvers with built in preconditioners. 4. Suitable for C++ an...
Given a set of ODE's $ \dot{z} = f(z) $ (or discrete time $ z_{t+1} = f(z_t) $), is there a way to numerically find constants of motion? For $ f(z_t) \approx M z_t $, diagonalizing the matrix $ M $ and finding eigenvalues equal to 1 works, but this only finds linear combinations of $ z $ that are constant. I would like...
When applying the classical formula for the angle between two vectors: $$\alpha = \arccos \frac{\mathbf{v_1} \cdot \mathbf{v_2}}{\|\mathbf{v_1}\| \|\mathbf{v_2}\|}$$ one finds that, for very small/acute angles, there is a loss of precision and the result is not accurate. As explained in this Stack Overflow answer, one ...
How to determine if a PDE is structure-preserving (energy,mass conserved)? Are there some standards in judging the preserving-structure? Or rather, how to derive the formulation of energy-preserved form of a PDE? I am new to this field, I am long for receiving some references (some books, representative papers or s...
I tried to simulate soliton propagation by solving the nonlinear Schrödinger equation using the split-step Fourier method. The following is an example of the Matlab code copied from a textbook. alpha = 0; beta_2 = 1; gamma = 1; A = N*sech(T); % initial pulse shape L = max(size(A)); delta_omega = 1/L/delta_T*2*pi; om...
Is it possible to solve an equation with only a single derivative such as: $$\frac{\partial U(x,t)}{\partial t} = A - BU(x,t)$$ with finite difference methods? I ask as I am trying to solve the below equation using a finite difference method. $$\frac{\partial \vec{m}(x,t)}{\partial t} = -\frac{\partial \vec{j}_{m}}{\p...
I want to trace electrostatic field lines emerging from 2D surfaces in 3D space. Eventually I want to find their intersection with an (uncharged) mesh. The charge distribution $\sigma(x), x \in \Gamma \subset \mathbb{R}^3$ is defined by requiring a constant potential $\phi(x) = \phi_\Gamma\ \forall x\in\Gamma$. For the...
I have a 2d distribution of moving points with known trajectories represented in a 640x480 image. Here is the initial state: I have to find the minimum number of rectangles with fixed dimensions (35x42 pixels) that are able to cover all my input data, minimizing also the overlapping areas for each step. So far I tried...
It has been discussed that Intel MKL can exhibit irreproducible behavior under certain conditions. In fact, this is a known thing and described by Intel as Conditional Numerical Reproducibility. A colleague has recently encountered this issue while trying to find the eigenvalues of a matrix and he realized that the fun...
For a Bounday Element Method problem I require the solution of a system of linear equations with multiple right-hand sides. Though this is a dense system, I still want to do it via Petsc in parallel. Would the best way to do this be through something such as -ksp_type preonly -pc_type lu -pc_factor_mat_solver_package m...
I am trying to solve Lid driven square cavity flow problem of Stokes equation using finite element method. I have boundary conditions for velocity as zeros on every boundary but u=1 on top boundary. can you please help me with the boundary conditions of stream function and how to obtain ? especially on top boundary. I ...
After successful implementation of characteristic-wise finite-difference WENO method to 1D Euler equations, I'm moving to 2D equations on cartesian grid: $$ \frac{\partial U}{\partial t} + \frac{\partial F(U)}{\partial x} + \frac{\partial G(U)}{\partial y} = 0 $$ where $$ U = \left( \begin{array}{c} \rho \\ \rho u \\ \...
I can't seem to find a good algorithm for the one-to-exactly-two assignment problem. Good algorithms are known for the classical assignment problem, where N tasks need to be assigned to to M agents in a one-to-one correspondence. In my case of the one-to-exactly-two assignment problem, I have N tasks and M agents. Howe...
I have data for a random variable and I wish to test whether it conforms to the Tracy-Widom distribution. However, the T-W distribution is hard to compute. Is there a readly available table of its values I can just download?
I am a newbie in finite difference methods, so I apologize in advance if the question is trivial. I am trying to solve the advenction equation, i.e. $\frac{\partial \phi(x,t)}{\partial t} + v \frac{\partial \phi(x,t)}{\partial x}=0$, where $v$ is a velocity, with the finite difference method. The system is of course al...
I want to solve the following optimization problem: $$\min_{A,B,X} \|Y-AX\|_F^2 + \lambda_1 \|Z-BX\|_F^2+ \lambda_2 \|B\|_F^2$$ $$s.t ~~x_{ij}~ \geq 0$$ in which, $Y$ and $Z$ are data matrices and are $d \times n$ and $l \times n$ (the corresponding columns of $Y$ and $Z$ are data samples), and $A,B,X$ are the paramet...
I have two arrays $f(z)$ and $z$ both indexed by k and I want to solve $\frac{df}{dz}=\mu(1-f)$ to find $\mu(z)$ What would be the best numerical method to solve this equation?
I want to use FEM to solve a 2D eigenvalue problem for the biharmonic equation \begin{align} &K \psi= \lambda M \psi\\ &\psi=\nabla \psi\cdot \hat{n}=0\quad \text{on boundaries} \end{align} where $K$ is the stiffness matrix corresponding to $$K_{ij} = \int_{A} \nabla^2 \psi_i \nabla^2 \psi_j \mathrm{d}A$$ and $M$ is t...
Is there an algorithm that can determine the interaction laws between particles (or point-like objects) based on their motion? A simple case: an algorithm that determines the gravitational interaction from nothing but the motion of the planets in the solar system. Without a lookup table of particle interactions.
I have small scale dense least squares problem with box constraints $$\mbox{argmin}||Ax - b||^2 \quad $$ $$\mbox{subject to} \quad l_i \leq x_i \leq u_i,$$ Number of variables is about 10-50, several hundreds in worst case. Number of constraints is equal to number of variables. So i can factorize $A$ and/or $A^TA$. Als...
It is conventional wisdom that programmers should use std::hypot whenever one implements an expression of the form $r = \sqrt{x^2 + y^2}$ In my example, my expression is $r = \sqrt{1 + c^2}$, where $0 \le c \le 1, c \in \Re$. My first instinct is to reach for hypot() to implement - I am interested in both double and f...
Given a 2D irregular spaced data like shown in the figure, I would like to know how to find derivatives at '*' by interpolating the values at 'o'. Does lagrange 2D interpolation work at irregular spaced data
I'm a novice to finite element and I'm finding quite hard to find the actual difference between Test function(s) and Basis function(s). I would be glad if somone could explain me that and point out how can they differ from one another and in which cases its useful that they differ (or not).
In the course of trying to implement algorithms for Voronoi and Laguerre diagrams, I realized I needed to verify if my implementation is working correctly using a point (or circle) configuration with a known Voronoi (or power) diagram. I have not been successful in looking for datasets with known diagrams. Does anyone ...
I need to do a matching on a hypergraph. I read that in the case of a hypergraph there is no adjacency matrix. How do I represent edges then?
Let $p$ be a polynomial with floating-point coefficients and let $a$ be a floating-point value. Is there a method for accurately evaluating the sign of $p(a)$ in floating-point arithmetic? I don't care about the actual value $f(a)$, only about its sign. But I want the exact sign. If it helps, we can assume that $ 0 \le...
I wanted to find and plot the eigenvalues of large (around $1000\times1000$) matrices. But discovered when using the eig function in matlab, it gives complex eigenvalues when it shouldn't. For example, in the code below I have a Tridiagonal Toeplitz matrix, which should have all real eigenvalues. But it seems eig is un...
I'm simulating a nano particle and wish to calculate the activation energy of the reaction where an atom is displaced from one point on the lattice to a neighboring void( might be at higher energy than initial). Calculating this activation energy using energy difference will require me to calculate the complete trajec...
I am interested in reading about the analysis (existence, uniqueness, error estimates) of elliptic problems solved with a Mixed method that uses the Raviart Thomas elements (so far so good, easy to find) but with the presence of hanging nodes, (I haven't found anything). I have a paper from 2002 that claims this tha...
I'm working with python vtkDelaunay3D package for a special purpose. I have set some points but I do not know how can I measure euclidean distance between points with this package. Is there anyone who knows measuring euclidean distance between points with this package in python?
I am curious of whether optimisation algorithms (whatever simplex, active-set quadratic programming, interior point sequential etc.) can fail due to numerical errors and how to avoid them. But I cannot find related literature online. It seems people mostly study the numerical stability of various matrix factorisation m...