All Questions

Filter by
Sorted by
Tagged with
0
votes
0answers
3k views

Stationary solution converge but time dependent doesn't

I've coupled a COMSOL model for fluid dynamics with a very simple pde that model the transport of humidity in air. When I solve it for the stationary case, the solution converge easily, but when I ...
5
votes
2answers
615 views

Efficient computation of Markov chain transition probability matrix

Consider a continuous Markov chain $X=(X_t)$ on a finite state space and let $Q$ be the (given) transition rate matrix. This matrix is very sparse, with non-zero values on 3 diagonals only (so from ...
3
votes
1answer
711 views

How to do local FFT on huge 3D vector data cell mesh and visualize it spatially?

Simulation type: I'm running a simulation with the OOMMF micromagnetics package http://math.nist.gov/oommf/ where are magnet is represented by a mesh of 3 million cells, it gets excited by a ...
5
votes
3answers
191 views

Under which conditions is better OMP_NUM_THREADS = 4 or 2 for multithread two-core CPU?

I am running my Fortran 95 numerical codes, whose structure is most times easily parallelized by little more than simply adding the corresponding OpenMP instruction before some critical DO sentences, ...
1
vote
0answers
85 views

How to create synthetic data from known weights

I'm doing some machine learning where I have lots of data and through optimization I'm trying to learn the weights for the model. I'd like to check that my learning actually works correctly. For that ...
3
votes
1answer
121 views

explicitly forming coarse matrices with polynomial smoothing AMG

I've been reading about the algebraic multigrid algorithm and came across polynomial smoothers in this paper. It's my understanding that usually the coarse-level matrices $A_H = I_h^HA_hI_H^h$ are ...
15
votes
3answers
6k views

Fortran: Best way to time sections of your code?

Sometimes while optimizing code it is required to time certain portions of the code, I have been using the following for years but was wondering if there is a simpler/better way to do it? ...
10
votes
2answers
248 views

Solving a linear system with matrix arguments

We're all familiar with the many computational methods to solve the standard linear system $$ Ax=b. $$However, I'm curious if there are any "standard" computational methods for solving a more ...
9
votes
1answer
7k views

How to approximate the condition number of a large matrix?

How do I approximate the condition number of a large matrix $G$, if $G$ is a combination of Fourier transforms $F$ (non-uniform or uniform), finite differences $R$, and diagonal matrices $S$? The ...
0
votes
2answers
153 views

Analytical form of the minimum of a function with absolute values

I would like to find the analytical form of the point which minimizes the following function: $$ f(x_T) = \frac{1}{T} a_1 (x_T-x_0)^2 + a_2 |x_T-x_0| + T a_3 + \sum_{i=1}^M p_i \left[b_{1i} (x_T - ...
2
votes
1answer
128 views

Trying to generate a wave function basis set

For a little project I'm working on, I am trying to generate a wavefunction basis set I can use in Quantum Monte Carlo (DMC to be specific). Preferably, it would be a linear combination of Slater ...
10
votes
1answer
704 views

What is the impact of C++11 move semantics in the context of scientific computing?

C++11 introduces move semantics which can, for example, improve code performance in situations where C++03 would need to perform a copy construction or copy assignment. This article reports that ...
1
vote
4answers
456 views

Ground state eigenvector different for different eigen solvers (differs by negative sign in the elements). Does it matter?

Here is some code that hopefully clearly illustrates what I'm doing: ...
3
votes
2answers
886 views

Finding A and X such that AX = 0, X is positive non-zero, and A is sparse

I apologize if this is a naive question. I'm trying to create some boostrap data for a system of linear, ordinary differential equations at steady state. Since the equations represent the ...
4
votes
1answer
6k views

Differences between “least square”, “mean square” and “least mean square”?

I was wondering what differences are between the terminology: "least square (LS)" "mean square (MS)" and "least mean square (LMS)"? I get confused when reading in Spall's Introduction to Stochastic ...
1
vote
0answers
219 views

Sign or cardinality constraint when solving for sparse signal

I'm currently learning about using linear and semidefinite programming to find sparse solutions to problems. In particular, finding sparse solutions where the sampling functions are sinusoidal (...
12
votes
3answers
4k views

Optimize an unknown function which can be evaluated only?

Given an unknown function $f:\mathbb R^d \to \mathbb R$, we can evaluate its value at any point in its domain, but we don't have its expression. In other words, $f$ is like a black box to us. What is ...
7
votes
2answers
239 views

Which is easier to solve, regularized minimization, or constrained minimization?

Following regularized minimization problem $$\min f(x) + \lambda g(x)$$ where $\lambda>0$, and following constrained minimization problem $$ \min f(x) $$ s.t. $$ g(x) \leq \epsilon $$ where $\...
13
votes
3answers
536 views

Confusion about compressed sensing problem

I read some references including this. I am kind of confused what optimization problem compressed sensing builds and tries to solve. Is it $$\begin{array}{ll} \text{minimize} & \|x\|_1\\ \text{...
3
votes
1answer
192 views

Mathematical way to represent a image kernel?

How can I represent the calculation in this image mathematically? For example, with the discrete convolution (and Fourier Transform?), $$(f * g)[n]\ \stackrel{\mathrm{def}}{=}\ \sum_{m=-\infty}^\...
0
votes
1answer
553 views

ZGETRF and ZGETRS from MKL - zgetrf fails and still zgetrs works?

I have a large system of equations $$Ax=b$$ and I know matrix $A$ and right-hand side vector $b$. I'm using MKL to solve this system. The matrices are complex. I have used the general solver ...
1
vote
1answer
126 views

DIST strings - Monte Carlo Simulation

I recently read something that talks about DIST distribution strings. It appears to be a way to take a long string of previously generated numbers and somehow compress them into a string that can ...
0
votes
1answer
93 views

Unique Partition of a Graph

Given an undirected graph, is it possible to find a criteria that leads to a unique partition of the nodes? The graph is not weighted.
2
votes
1answer
1k views

Cplex C++ Interface: How to add many constraints quickly?

I noticed that adding constraints to an IloModel one by one can be prohibitively slow. (I am referring to the construction of the model, not the optimization.) ...
10
votes
4answers
15k views

Matlab : Is there a way to programatically safely halt code execution (like FORTRAN's stop)? [closed]

Like the title says, I want to be able to stop the code at a specific location and have it halt safely. I cannot find a command to do it like for example in FORTRAN there is the stop command.
7
votes
4answers
7k views

How to find more than one root of a polynomial?

This program finds the first root of the function f, defined in the code. There are 5 roots of this function. (x=1,2,3,4,5) I wish to find all of the roots in this program and print them to the screen....
4
votes
2answers
194 views

Problem Condition and Algorithm Stability

Consider 2 mathematical problems: $$ f_1(x) = a - x \\ f_2(x) = e^x -1 $$ The condition number for a function is defined as follows: $$ k(f) = \left| x \cdot \frac{f'}{f} \right| $$ Lets analyze ...
0
votes
1answer
159 views

Neighbor pattern look-up table enumeration on an octree mesh

I am working with an octree mesh where variables are stored in a collocated fashion at octant centers. I want to construct a lookup table for interpolation weights that may occur using only a cell and ...
1
vote
1answer
1k views

GMRES Matlab 'tol' parameter

I need to use GMRES solver in MATLAB, and I need to play around with the codes parameters and I had a very simple question about its usage. The documentation of the solver here mentions a parameter <...
4
votes
2answers
3k views

4th order Padé scheme formula derivation

I am trying to derive the formula of the 4th order Padé scheme that passes through the points $x_i$, $x_{i-1}$ and $x_{i+1}$ $$\Big(\frac{\partial\phi}{\partial x} \Big)_i = -\frac{1}{4}\Big(\frac{\...
3
votes
2answers
644 views

Solver for a MIQP with an indefinite coefficient matrix

Do CPLEX or Gurobi handle MIQPs with indefinite coefficient matrices? The problem I am dealing with has quadratic terms in which one variable is binary and the other variable is continuous. The ...
5
votes
2answers
223 views

Are there any specialized methods available for solving structurally symmetric sparse linear systems?

When solving $Ax=b$, prior knowledge about $A$'s structure can help in designing an efficient solver which exploits this information (e.g conjugate gradient method is to be used when $A$ is ...
2
votes
2answers
1k views

Solver error in SciPy/LSODA with a very specific parameter set

I'm implementing a very simple Susceptible-Infected-Recovered model with a steady population for an idle side project - normally a pretty trivial task. But I'm running into solver errors using either ...
7
votes
2answers
166 views

Why is the Dual problem preferred for Maximal Margin Classification?

The primal problem is $$\min_{w,b}\frac{1}{2}w^Tw$$ $$s.t. f_i(w)=1-y_i(w\cdot x_i+b)\leq0$$ Where $y_i=\pm1$. Instead of using Gradient Descent directly, the dual is usually solved: $$\max_{\...
3
votes
1answer
87 views

Progression of molecular dynamics simulation sizes

I'm looking for literature on the progression (year on year, or more fine-grained if possible) of Molecular Dynamics simulation sizes. By simulation size I mean number of atoms, time step, total ...
4
votes
2answers
3k views

C++ alternatives for simulating dynamic systems

I'm looking for alternatives to Matlab/Simulink and Dymola for simulating a non-linear dynamic system. I know it's possible to implement the time-domain behavior without a lot of code and a good ...
5
votes
0answers
188 views

Finding quadrature weights for a given set of points? How to select points such that all weights are positive?

Currently, I fit a Finite Element solution of a PDE on a spectral basis. The matrices ($R^{25000\times 2000}$) of the corresponding system of linear equations are highly ill-conditioned ($\kappa \...
1
vote
1answer
467 views

Singular matrix for 2D Stokes flow in finite differences

I have a problem by solving stokes flow in 2D by finite differences. I am using a marker and cell method, my scheme is ...
3
votes
1answer
264 views

Where can I find a proof that the numerical sign problem is NP-hard?

I've reading up on the numerical sign problem, and how a general solution is NP-Hard. I can't seem to find a proof of this, though. Does anyone know where I can find a proof that the numerical sign ...
2
votes
1answer
255 views

python numpy print array(x,y,z) as (x by y) by z?

Printing photo matrices (x,y,z) where z is 0:2 colour, I want to see (x in rows, y in columns) 3 times, once for each colour (the way I've been taught by every mathematician). By default, numpy does ...
5
votes
2answers
1k views

First order finite volume spatial discretization of the heat equation on an unstructured triangle mesh

Consider a scalar field $u$ on an unstructured triangle mesh which is constant on each face. Let $A_i$ be the area of triangle $T_i$, $N(i)$ the set of triangles sharing an edge with $T_i$, and $L_{...
7
votes
1answer
6k views

Schroedinger/Diffusion equation with Crank-Nicolson in Python/SciPy

I tried to make the question as detailed as possible. I have an extremely simple solver written for the Schroedinger equation but with imaginary time, which transforms it basically into the diffusion ...
7
votes
4answers
2k views

computing the determinant of a dense nonsymmetric 100x100 matrix having very big and very small eigenvalues

The motivation for my question is the following: in one of Project Euler questions there is a need to count the spanning trees of a rectangular grid graph of dimension 100x500. By the Matrix-Tree ...
5
votes
0answers
893 views

How does GAMG in OpenFOAM really work?

I use OpenFOAM for CFD simulations. A very popular preconditioner is GAMG which needs a low number of iterations per a time step in SIMPLE or PISO solvers that are used to simulate the fluid flow. I ...
6
votes
2answers
384 views

Introduction to computational science?

I'm a high school student interested in computational science, and I would like to learn more about it. This year I took AP Computer Science for that reason, but except for some very basic gambling ...
6
votes
5answers
9k views

How to solve block tridiagonal matrix using Thomas algorithm

Thomas algorithm can be used to solve a tridiagonal matrix: $$ \begin{bmatrix} {b_ 1} & {c_ 1} & { } & { } & { 0 } \\ {a_ 2} & {b_ 2} & {c_ 2} & { } & { }...
2
votes
1answer
129 views

Location of Unknowns in Unstructured Mesh

I am currently learning a code which utilizes Scharfetter-Gummel discretization for unsteady drift-diffusion equations. For this scheme, a 2D unstructured triangular mesh is used, with the unknowns ...
0
votes
1answer
92 views

mapping data with a spike to a heat map

I have the following dataset that I need to display on the heat map: [30, 15, 66, 7, 9999, 78, 42, 132] So if I map the values to the color scale using a linear function I only see the spike while ...
0
votes
1answer
188 views

Where do I find engineering problems to practice solving computationally?

I'm an engineer and I'm planning to get a bigger toolbox than Excel to solve difficult problems. I started learning Python (as that seems the script language to go for math intense jobs, and runs in ...
5
votes
2answers
298 views

Library for closest point on a polyhedron

I need to compute a closest point on a nonconvex polyhedron to a given point in 3D space. I need a simple algorithm or library. I search in CGAL but did not find a suitable function and the package is ...

15 30 50 per page
1
149 150
151
152 153
179