instruction
stringlengths
43
28.1k
Question: I have problems with sidelobes when computing the convolution of two radially symmetric functions. I wonder whether I should just switch from second order to fourth order and refine the grid aggressively, or whether there are more appropriate methods for computing this convolution. I have radially symmetric...
I need help plotting the Heaviside function: Real analysis often involves constructing bizarre functions which are intuitively correct, but ultimately wrong. See the great book Counterexamples in Analysis. I wrote a numpy script to plot the function $\displaystyle \sum_{n=1}^\infty \frac{1}{n^2} H\left(x - \frac{1}{...
Previously, I have calculated energy spectrum for 3D DNS data obtained for isotropic turbulence which is equally spaced in all three directions and then to compute the energy spectrum, one performs Fourier transform and then accumulates energy located in different wavenumber bins and then gets the ($k^{-5/3}$) slope an...
I am looking for an algorithm that I can apply for a random tessellation of polygons with different areas. The algorithm can relax the geometry of the polygons to a condition that all of them would have the same area! Someone should have faced this problem. The simplest case is that all the polygons have the same numbe...
I want to impose symmetry plane boundary condition for a solid mechanics problem. I googled around and found out that in many places people say to "forbid displacemnts out of symmentry plane and forbid rotations about any axis lying in this plane if you have rotational degrees of freedom". If I have only disps degrees...
I am wondering if the Thomas algorithm is the fastest way (provably?) to solve a symmetric diagonally dominate sparse tridiagonal system in terms of algorithmic complexity (not looking for implementation packages like LAPACK etc). I know that both the Thomas algorithm and multigrid are $O(n)$ complexity, but maybe the ...
I am going through this example problem (picture below) and working it out myself. The problem is that I do not get the same mass matrix (M) as the example problem. I am able to get the same stiffness matrix (K). I used the same process of obtaining the stiffness matrix, which uses the connectivity array, but do not...
I am trying to solve a small QP problem in CPLEX. The problem has several linear constraints. The optimiser runs and finds a solution which satisfies these constraints and CPLEX returns a success code. However the value of the objective function given by this solution is greater than that for the solution if I just su...
We am currently working on a project related to computational optimization, in which I have tasked myself with calculating the most efficient solution to one of the game's levels. Link to the flash game: http://trackmill.com/virus-2/ The hexagon grid is randomized in color, and the player starts out in one of the corne...
I wrote a script that plots the results of the "drunken lamppost" problem in MATLAB. Now I need to create a road-width from -3 to +3, length from 0 to infinity but the drunk can walk just ahead. It means that when he reaches the road's edge MATLAB will automatically stop plotting. My code is here: r=[0 0]; for t= 0...
I am submitting jobs to Open Science Grid from a glidein-wms enabled submit hosts such as osg-xsede. I'd like to stage some data on SE nearest to osg-xsede submit host, then distribute data to various SEs available at each destination clusters (more or less as a cache), and access the data on each SE from the worker no...
I have a mathematical program with a constraint involving a maximum function. More specifically, the constraint is: $y = \max\{a_i x_i:1 \leq i \leq n\}$ where $a_i$ are constants and $x_i$ are binary variables. Can we express this constraint as a linear constraint?
Which one is better: FORTRAN or Python? And I guess that in both cases you need Gnuplot, am I right? I'm working on a Windows machine at the moment. I'd like to use it to get numerical solutions for physics-problems, including Monte-Carlo simulations, numerical integration and differentiation, molecular dynamics, etc. ...
I have dense complex matrices $M(z)$ in which each element $M_{ij} = M_{ij}(z)$ depends on a complex parameter $z$. I need to find $z$ such that the matrix $M$ gets singular, i.e. I am looking for null vectors $\vec v$ which satisfy $M(z) \vec k = \vec 0$. So far, I use a Newton method. As the wanted $M(z)$ is singular...
I am trying to simulate a moving airfoil with constant speed (Mach=0.755, aoa=1.25). I solve Euler equations with Roe's method. I have two boundary conditions: Farfield Slip wall (airfoil) For all faces I gave face velocities as: vbx = -Mach cos (aoa) vby = -Mach sin (aoa) At the farfield, I set (rho,u,v,p) = (1, 0, ...
The problem comes from the need to estimate the error propagation of the spectral norm computation of a square matrix $A$ of which I know the components' $A_{ij}$ absolute error. The fundamental step of the computation of the spectral norm $||A||_2$ is the computation of the largest eigenvalue of the matrix $A^TA$. In...
My problem deals with a large $n \times m$ matrix from which I extract and store several square $k \times k$ submatrices. The original matrix may be very large, and I may need to store many thousands of different $k \times k$ submatrices. All I need to store is two list of integers, the indices for both rows and column...
I would like to import (or parse ??) a WRL/VRML file format in python in order to work the data with Matplotlib. Is there any way of converting this file format into plottable numpy arrays ? I attached a photo a WRL file visualized with the FreeWRL viewer
I know the Neumann B.C. is implicit in FEM language. However, I have seen at least two ways to impose Dirichlet B.C. e.g. for the following problem 1D, $$\nabla^2 u + \nabla u= 0, u_{left}= 1, u_{right}=0$$ 1) set first and last row of assembled "A" to "0" at left hand side, set A(1,1)=1,A(end,end)=1, and specify the b...
I have used FEA for a couple of years now, but using it and using it correctly are two different things, safety factor is not the solution to everything. I have the feeling I won't be using it right unless I have a clear answer to that question: I am aware elements must be close to their ideal shape (based on the Jacob...
I'm trying to work out an as-general-as-possible 2D Laplace example for Finite Element Analysis. Starting from $\Delta u = 0$ for an unknown $u(x,y)$, I multiply both sides (well, in practice only the left-hand side) by an arbitrary test function $\varphi(x,y)$ and subsequently integrate over the domain $\Omega$. Then,...
Recently I started to get interested in GPU-computing. I am considering buying a GPU and am inclined to buy an NVIDIA GPU since this allows for coding in both OpenCL and CUDA. But is NVIDIA really the best brand and if so, what type of GPU should I consider buying. I am not looking for a high-end GPU, but for good valu...
I am trying to solve Boltzmann eqn: $\frac{e}{m}\tau\vec{E}_x\cdot \nabla_\vec{v}{f(\vec{v})}=f(\vec{v})-f_0(\vec{v})$ where $f_0(v)=\exp{\frac{-m \vec{v}^2}{T}}$ and $\vec{v}=\{\vec{v}_x,\vec{v}_y\}$ (i.e., $\vec{v}$ is in 2D.) For simplicity, let's assume $\vec{v}_y=0$. Assume $\tau$ and $T$ are constants. Th...
I want to write mathematical optimization software. At university, they taught me how to use AMPL+CPLEX/SCIP/MINOS/Couenne etc.. and that was good enough. But I cannot afford the cost of AMPL for my personal use and I don't want to have any limitation in the size of the problem. Is there any real free alternative to A...
I've been reading Larson and Bengzon's recent book on finite element methods, which has been good for getting an understanding of basic theory and computational procedures. The finite element book by Brenner and Scott has been recommended strongly by a number of people as a book for understanding more of the theory beh...
I am currently solving a Non Linear modell in GAMS and I am interested in a sensitivity analysis of the results. When working with a linear program I am able to look at the marginal values for the constraints (a marginal value of 100 means that if the constraint is relaxed by one unit then my objective will increase wi...
I am trying to find out the magnitude of the acceleration of my object based on non-uniformly sampled 3D position data. I'm using the standard approximation of the 2nd order derivative on a non-uniform grid (see e.g. here, page 121): $$ f'' \approx 2 \cdot\frac{h^+ f_0 - (h^- + h^+) f_1 + h^- f_2}{h^+ h^- (h^+ + h^-)}...
We use Armadillo a lot in our code but there are places where we prefer to use MKL directly from Vector Math Library. We have cx_vec i.e. vector of doubles. But the exp function of armadillo uses std::exp which is not great so we started using MKL for it. The problem comes when converting cx_vec into MKL_Complex16 arra...
I'm trying to implement PageRank. I'm reading the description here: http://nlp.stanford.edu/IR-book/html/htmledition/markov-chains-1.html Everything is very clear to me, however I'm concerned about the construction of the matrix $P$. I find that constructing $P$ the naive way would be very expensive. For example: to i...
I will have to solve a large linear system. I'm now looking for a solver that works "matrix-free" (So that I just have to specify a matrix-vector product, but not the matrix). As far as I understand (I'm not an expert.) LAPACK does not provide this option. Can you recommend any libraries? Or is my approach to implement...
I'm following the book here to compute PageRank: http://nlp.stanford.edu/IR-book/html/htmledition/markov-chains-1.html I built the transition matrix P as indicated in the book. Then I computed the PageRank scores by raising the transition matrix P to higher powers, as said in the book. To make sure my computations are ...
The Problem Domain I have a number of network-connected PCs. I want to be able to simulate and replicate the same simple fluid dynamics simulation (E.g. Navier-Stokes), in real-time, between them. That is to say, the same body of fluid will be simulated at the same time in isolation on each PC. They will all have the s...
I have to solve for x in b = A*x, where a is sparse. This works fine with Matlab's mldivide: x = A \ b. Since I will have to use an iterative algorithm for very large A, I'm currently testing Matlab's iterative algorithms, bicgstab in particular: [L, U] = ilu(A, struct('type', 'ilutp', 'droptol', 0.0000001, 'udiag', 0)...
I want to solve the Poisson equation for a 2D polar system: $$\Delta_r f(r) = u(r)$$ with the Laplace operator: $ \Delta_r f(r) = \frac{1}{r}\frac{\partial}{\partial r} \left[r \frac{\partial}{\partial r} f(r) \right] $ I have $u(r)$ given as a vector for a non-uniform (quasi-logarithmic) grid. Any ideas how to solve ...
I am not a biologist. But highly motivated by the recent advancements and problems in modern biology. I have been shortlisted for a PhD(computational biology programme at IMSc, Madras) interview in first week of June. My background is electronics and communication engineering. But prior biology knowledge is not requir...
In one step of image evaluations I need to apply a gaussian blur to pixel data. I do this by folding each pixel with a gaussian folding matrix. This is no problem unless I try to do this with pixels at the border of the image since for example on the left border I can't include the pixels to the left in my folding calc...
Could someone tell, please, has someone constructed finite difference mixed derivatives on quadrilateral (non-orthogonal) grids, already? Without using aconformal mapping to an orthogonal grid. I mean we have the mixed differential operator and try to represent it through a difference relation. I searched with the help...
[ question reposted from https://math.stackexchange.com/questions/786612/solving-a-linearly-constrained-sparse-linear-least-squares-problem ] Given the system of equations $Ax=b$, subject to $Cx\le d$ where $A$ is an $n\times m$ matrix (with $n>m$) and is very large and sparse. As an example $A$ can have $3126250\times...
I try to solve a system of coupled PDEs using FEM. Unfortunately, the originating matrix has very poor condition. After days of double checking and thinking, I suspect the following reason: Given a PDE a * Laplacian(u) + b * u = 0 For FEM, one has to calculate two operator matrices, one for Laplacian(u) and one for u....
This is a bit of a long shot, but I was hoping somebody might have some insight (not sure of a better forum than here but open to suggestions). I have implemented the optical flow algorithm from the paper An Improved Algorithm for TV-L1 Optical Flow. I've tried to stick to exactly the same parameters as the article exp...
I have a choice of two options, analysing and implementing Lattice Boltzmann methods or traditional Navier Stokes based methods. I'm a CFD newbie and I have a rough idea (though not rigorous enough to produce a code) from my fluid mechanics classes about Finite Volume, Finite Element and Finite Difference methods. I am...
I noticed that Python does not have a good datatype for rational numbers, certainly not for algebraic numbers like $\tfrac{1 + \sqrt{2}}{3}$ or the real root of $x^3 - 5x + 7$. They have the fractions data type and I was able to hack a solution to my particular problem from there using elaborate arrangements of matric...
I have a geometry and a finite element method where there are a couple internal interfaces across which I want to enforce some fairly simple jump conditions. One recommendation I've gotten has been to align the mesh with the interfaces and generate zero thickness elements along the interfaces, so that every nodal point...
I asked the same question on mo.se and it was suggested that scicomp would be a better forum for it. So here it is: I am writing code for solving linear equations of the form $$A_{n\times n}\cdot x=1_n$$ where $n$ is on the order of $10^6$ and $A$ is a symmetric matrix with approx $10^3$ nonzero entries in each row. T...
Suppose am solving the heat conduction equation in 1d with Dirichlet boundary conditions. The thermal conductivity $k$ is a non constant function. So $-(k(x)u'(x))' = f(x)$ The value of $k$ enters the discretization only through its values at the faces of the control volume $k_{i+1/2}, \; k_{i-1/2}$, and not at the ce...
In this paper, the theory behind the isotropic-nematic phase transition is discussed. Furthermore, an algorithm is given to calculate some properties of this phase transition. I have written a program in C which gives me the free energy, pressure, chemical potential and nematic order parameter for a given concentratio...
I would like links to resources which provide codes for scripting (preferably in python) for high performance computing. I'm looking for sample codes and examples which can, (1) automatically create various input files based on the ranges provided for input values or by performing combinatorics of input values (ex: ato...
The code below basically illustrates my problem. It is a test code for a pendulum. I solve it using a method suggested on https://stackoverflow.com/questions/12926393/using-adaptive-step-sizes-with-scipy-integrate-ode). Now I want to plot points at a range of evenly spaced times to show the fact the dynamic nature of t...
Jacobian-Free Newton-Krylov (JFNK) methods, and Krylov methods in general, can be very useful because they don't require explicit storage or construction of a matrix, only the results of matrix-vector products. If you do actually form the sparse system, there's many preconditioners out there for you. What is available ...
I am writing my undergrad thesis on the harmonic oscillator on a lattice. So far I have implemented the Metropolis Monte Carlo algorithm to generate trajectories $x_j$ for $0 \leq j < N$, where $N$ is the number of time lattice divisions. I get a pretty good histogram for $|\psi(x)|^2$ and it matches the expectation fr...
There are several libraries to (iteratively) solve large sparse linear equation systems in parallel on a number of CPUs. Our parallel cluster also has attached powerful GPUs, but so far, I did not find any solver that can use CPUs and GPUs in parallel to solve a sparse linear equation system. MAIN QUESTION: Are there a...
Is there a C++/C implementation of the Appell series? GSL and Boost do not seem to have this function.
I am trying to reconstruct a 3D surface given the normals of the unknown surface. Reading through this paper on section 4 they say [...] denote the surface by $z(x,y)$. The directions of the normals are given by $n(x,y) = (p,q,-1)^T$, with $p = z_x$ and $q = z_y$ which denote the partial derivatives of $z$ with respec...
I'm looking for software recommendations for an electrostatic simulation: I have a 3d object of uniform, high conductivity, separated from its environment by a high-resistance skin. Inside that object is a dipole, and I want to calculate the strength of the dipole's generated electric field on the surface of the object...
I have a distance matrix (square, symmetrical, non-negative, dense). I want to split the objects into two well-connected groups. Mathematically speaking, I want to group (re-arrange) the rows/columns so that when the matrix is viewed as a 2x2 block-diagonal matrix, the diagonal blocks are "close to zero". Again: Given ...
Is there a way to achieve "one cancels the other" semantics (http://www.investopedia.com/terms/o/oco.asp) for qsub jobs submitted to Sun Grid Engine? That is, I submit two (or more) jobs and when one of them runs it cancels the others? Two examples... Say I can run for 4 hours on N ranks or 2 hours on 2N ranks. If both...
I am trying to implement the algorithm presented in this paper which tries to recover a matrix that represent a less noisier dataset of the intensities of the pixels of a set of images. In this case the noise comes from the specularities and shadows of the material of the objects in the images. I have little (or no) ex...
Is it possible to use test and trial functions from two different function spaces (defined over two different meshes) in a single weak form? Under what conditions can I do this (eg., each term in the form has functions belonging to only one of the spaces)? Essentially, I need this to model heat transfer in a block with...
After realizing that Gauss-Seidel is extremely slow for my simulation, i wanted to try GMRES and luckily found the C++ code here without diving into the theory. The size of the matrix in my case is nxn where n=50,000. However, I even cannot initialize the matrix to zero because the computer freezes while initializing i...
In methods like gmres or bicgstab it could be attractive to use another Krylov method as a preconditioner. After all they are easy to implement in a matrix-free way and in a parallel environment. For example, one could use a few (let say ~5) iterations of unpreconditioned bigcstab as a precontioner for gmres, or any ot...
How do we define the matrix for GMRES, if we do not want to solve the boundary elements but only the interior ones. I am using pentagonal elements so in a row there are 6 elements (cell itself + 5 fluxes) which means that in a row boundary elements are also accounted. But I need to make the matrix square according to t...
I have the following non-linear equation: where $w0=0.25,w0=0.5,w0=0.75$. I have to prove that if $k$ is a root, then also $−k$ is a root and that there exists only one $k∈(0,1)$ root, but my MATLAB code doesn't return any solution. Using wolframalpha I have computed the derivative of w0 and obtained, the constants w0...
I'm looking for a good way to partition a large, fairly high-dimensional dataset in order to perform fast kNN searches not just in the full $N$-dimensional space, but also in lower-dimensional subspaces of that space. For example, consider a point $p$ in a 3-dimensional space, $\{X, Y, Z\}$. On the one hand, I want to ...
I have a little bit of problem figuring out the relation between Fourier series and Least Squares. As far as I understand, LS is a way of minimizing the quadratic error between a measured value $y_i$ and a linear combination of functions evaluated at points $x_i$. So, in order to solve for least squares we have to have...
Say I have a vector field with non-zero curl, therefore the potential function depends on the path I choose to integrate. In this paper the authors proposed to project the vector field into a gradient field of Fourier basis functions in order to make the potential function independent of the path of integration. I unde...
Could you tell me please how to obtain separate values of "pi" depending on the value of N (code below)? For example If I write "pi1" I will get a value of "pi" for N(1) where N(1)=100. If I write "pi2" I will get "pi" for N(2)=1000 etc. I need it to compare the calculation time and the accuracy. My CODE is: R=1; N=...
This may very well be a silly question but I'm trying to cement my understanding of the material in the SICP (http://goo.gl/QXrbtV). My intuition (common sense) says yes, but wondering from a theoretical point of view if this always holds true.
I am trying to implement a simple FEM approach, using p1 triangular elements, for solving the diffusion equation with variable nodal diffusivities and I was wondering how to incorporate the variable nodal diffusivities when computing the element stiffness matrices. I would really appreciate if someone could point me in...
$\displaystyle \frac{\partial u}{\partial t}=\alpha(x,t)\cdot \frac{\partial^2 u}{\partial x^2}+b(x,t)$ $u(x,0)=f(x)$ Initial condition $u_x(0,t)=0$ 2nd type Boundary condition $u_x(1,t)=0$ 2nd type Boundary condition There is my code in Maple for the 1st type B.C. And I really do not know, what I should change in this...
Is it possible to call an external linear solver from Abaqus and/or Ansys? This solver (which is supplied by me) would get the sparse matrix A and the right hand side vector b as inputs, and would return the solution x (with A x = b) to the program. Ideally, Abaqus/Ansys would also inform the solver about the desired a...
I have two coupled nonlinear partial differential equations of the form: $ \begin{align} \dot{u} -f(u,u',u'',v,v',v'')=0 \\ \dot{v} -g(u,u',u'',v,v',v'')=0 \end{align} $ The boundary conditions are such that I know $u$ at time $t=0$ and $v$ at time $t=-\infty$. I also know the values of both functions at the two bounda...
I have a pdb file and I would like to make a pqr one. In GROMACS, I use editconf -mead to produce the pqr file, with topol.top taken from pdb2gmx and use it to produce pdb file, then use pdb2pqr. Which one is the better? First 10 lines of PQR made from GROMACS ATOM 1 N PRO A 1 0.63000 39.63000 17.25000 -0.2...
A small nonlinear equation system (sizes around 12 ✕ 12) needs to be solved repeatedly (millions of times); each time with some variation in parameters/coefficients (although the equation set is always the same). Most solvers are not very optimized for small systems like this, only achieving higher "GFlops" when using ...
I am curently using R package nleqslv for solving a non-linear system of equations with 300 variables. I need to scale this to the system with ~50k variables and naturally this does not scale very well, since the jacobian then takes up to ~30G of RAM, and I do not have access to a machine with such amount of RAM. The j...
I want to add hydrogens to some linear polymer molecules (polyethylenes). I know some working methods like using PyMOL internal function h_add. This method works, but hydrogens are added at distances from the backbone carbon atoms that vary from 1.07 to 1.1 Ångstroms. I need to control the hydrogen distances from the b...
As my experience with CFD grows, I start to gain the feeling that turbomacinery is kind of special in CFD: there are special tools tailor for it. For example, ANSYS has TurboGrid or Vista TF for turbomachinery design. And OpenFOAM has special working group for turbomachinery. I wish to know what makes turbomacinery so ...
I want to solve a poisson problem on two domains,(interface problem: Let $\Omega $ be a square, $\Omega=\Omega1 \cup \Omega2$ and let $\Omega1$ be a circle inside the square. $\Gamma$ is the boundary of circle. $$\Delta u_1=f_1 ~~in ~~\Omega1$$ $$\Delta u_2=f_2 ~~in ~~\Omega2$$ $$u_2=g~~on ~~\partial \Omega$$ $$u_2-u_...
I am trying to solve the Helmholtz equation in some complex unbounded 2D domain: $$\left( \frac{\partial^2 \psi}{\partial x^2} + \frac{\partial^2 \psi}{\partial y^2} + E \right) u(x, y) = 0$$ However, to start with, I tried doing that in the simplified domain $\Omega = [-\infty, \infty] \times [0, H]$, that is, just a ...
Consider the following: I would like to solve a differential equation in Fortran (with a Runge-Kutta routine), e.g. x'=-a*x, where a is a constant. I then want to solve this for different a. I now would like to write the code such that it can be applied to other problems. But in general I do not know what additional in...
The Fast Marching Method is a way of solving the Eikonal Equation on a discrete grid, essentially just computing a wavefront speading out from initial points, IE: The idea is that we want to compute the time at which a wavefront, moving across a field with a velocity function $F(x, y)$, reaches each point in a grid, I...
I need an accurate implementation (for use in C/C++) of the logarithm of the incomplete Beta function: $$\log \mathrm{B}(x,y;\alpha,\beta) = \log \int_x^y t^{\alpha-1}(1-t)^{\beta-1}\mathrm{d}t$$ with domain $\alpha,\beta>0$, $0\le x\le y \le 1$. I need this to avoid overflows with very large values of the incomplete B...
I like to have a list just like in Python, but for Fortran. I know that there is a generic list type. But here I would have to define a type for each data I would like into the list, e.g. one for Real*8, one for Complex*16,Dimension(:,:) and so on. I would like to put data into the list for which I do not have to defin...
In the technical report on Galahad[1], the authors state, in the context of general nonlinear programming problems, To our minds, there had never really been much doubt that SQP [sequential quadratic programming] methods would be more successful [than Augmented Lagrangian methods] in the long term... What could be th...
Reading through Tim Davis' book Direct Methods For Sparse Linear Systems, he says that matlab can use a supernodal Cholesky decomposition but never uses a multifrontal Cholesky decomposition. At least when using the backslash operator. By contrast, HSL MA57, used in many optimization codes, is a sparse symmetric indefi...
Is there a common / good way to represent graphs in Matlab and operate on them? I need to read in an image as a graph and use several algorithms of graph-theory like minimal cut.
I am trying to find the solution for the M variables in the following system. \begin{equation} 0 = C_{b} M^{b}_{x} - M^{a}_{x} k_{2a} + M^{a}_{y} \left(\omega - \omega_{a}\right)\\ 0 = C_{a} M^{a}_{x} - M^{b}_{x} k_{2b} + M^{b}_{y} \left(\omega - \omega_{b}\right)\\ 0 = C_{b} M^{b}_{y} + M^{a}_{x} \left(- \omega + \ome...
A consistency notion in constraint programming: Let $P = (X, D, C)$ be a CSP. Given a set of variables $Y \subseteq X$ with $|Y| = k -1$, a locally consistent instantiation $I$ on $Y$ is $k$-consistent iff for any $k$th variable $x_{i_{k}} \in X \setminus Y$ there exists a value $v_{i_{k}} \in D(x_{i_{k}})$ such that $...
To get a numerical evaluation of the first (K) and second (E) complete elliptic integrals: $$K(k)=\int_0^1\frac{dt}{(1-t^2)^{1/2}(1-k^2t^2)^{1/2}}, \ \ \ \ \ E(k)=\int_0^1\frac{(1-k^2t^2)^{1/2}}{(1-t^2)^{1/2}}dt$$ in a left neighbourhood of the point $k=1$. What numerical methods do you recommend to get a "good" approx...
I have to solve the problem $$\min_x 1^Tx+\frac{\lambda}{2}\|\Omega\mu-x\|_2^2+\frac{\beta}{2}\|x-\bar{\gamma}\|_2^2\quad\text{w.r.t.}\quad Px-c=0,\ \ x\geq0$$ and in order to do that with Matlab I am currently using fmincon like that: FMinValue = @(x) sum(x) + lambda * sum((Omega*mu - x).^2) / 2 + beta * su...
I'm performing a line search as part of a quasi-Newton BFGS algorithm. In one step of the line search I use a cubic interpolation to move closer to the local minimizer. Let $f : R \rightarrow R, f \in C^1$ be the function of interest. I want to find an $x^*$ such that $f'(x^*) \approx 0$. Let $f(x_k)$, $f'(x_k)$, $f(x_...
Given a triangle mesh $\mathcal{T}$ with vertices $V=\{\mathbf{v}_i\}_{i=1}^n$ in $\mathbb{R}^3$ and triangles $T_{ijk}=[\mathbf{v}_i, \mathbf{v}_j, \mathbf{v}_k]$. For each vertex $\mathbf{v}_i$, I have a scalar value $f_v(\mathbf{v}_i)=U_i$. For each edge $\mathbf{e}_j$, connecting vertices $\mathbf{v}_a$ and $\mathb...
I'm given a stream of acceleration data with timestamps. The sampling is non-uniform. Apart from Euler, is there a way to integrate the acceleration into velocity? Something more accurate or of higher order? I can store some past acceleration data, but I'd like to output the velocity as quickly as possible, as new data...
Let $\mathbf{1}\in\mathbb{R}^d$ be a vector with all elements equal to $1$. Define: $$\mathbf{D} = \mathrm{diag}(\mathbf{1}^\top,\mathbf{1}^\top,\ldots,\mathbf{1}^\top) = \begin{bmatrix} 1 \cdots 1 & & \\ & 1\cdots 1 & \\ & & 1\cdots 1 \end{bmatrix} \in\mathbb{R}^{d\times d^2}$$ I would like to compute $\mathbf...
I want to simulate tidal features in a large body of water using was smooth particle hydrodynamics. For a system composed of an incompressible fluid, what general scale of problem can be tackled with an home computer? That is, how large of a body of water can I accurately represent using Smooth Particle Hydrodynamics?...
I've been looking through the other answers, and I haven't found a good answer yet. I'll describe the simulation I am running, and then the problems. The program simulates particles undergoing Brownian dynamic motion (thermal motion) alternating with stochastic processes (kinetic Monte-Carlo). When I move to OpenMP ...
It is necessary for me to produce triangular mesh on a sphere membrane. I use MATLAB pdetool or delaunay for produce mesh. How could I do this?
Not really much more to say; Of several computers available for use, these are two of the larger ones; one has 2x E5-2670, and the other has 4x E5-4640. The problems we're looking at essentially boil down to large matrix diagonalisation problems (i.e. i have been dealing with 125K rank matrices, and in the past have lo...
Essentially this is the problem: $\hat{F}(\omega) = \int_0^{\infty} f(s)e^{-i\omega s}ds$ The function $f$ is in general complex valued. I know this looks like the fourier transform but I don't want to view it that way. So in my implementation $f(s)$ and $\omega$ are going to be numpy vectors representing the sampled v...
We all know the problem that computation time explodes when simulating systems with big matrices. I got just this problem, but I have the advantage that I know that my matrices are symmetric. My question is thus: Do you know a way to decrease computation time if I know that my matrices are symmetry? What I want in par...
First we have Discretization of the Transport Equation $$ \frac{\partial \rho \phi}{\partial t} + \nabla(\rho U \phi) - \nabla (\rho \Gamma_\phi \nabla \phi) = S_\phi (\phi) $$ In Finite Volume Method it looks like: $$ \int_t^{t+\Delta t} \left[ \frac{\partial}{\partial t} \int_{V_p} \rho \phi dV + \int_{V_p} \nabla \c...