All Questions

0
votes
0answers
1 views

non-smooth convex c++ solver

I happened to know that there are advanced established techniques for non-smooth convex optimization in research. For example, these two papers: ...
2
votes
0answers
26 views

Designing a preconditioner for a very Ill-conditionned matrix

I am a physicist with limited numerical methods knowledge and I am trying to speed up the inversion of a very ill-conditioned problem (rcond>10^30). The same sparse square matrix is used repeatedly, ...
0
votes
0answers
16 views

Numerically boosting between reference frames

I have a question about numerically boosting between reference frames in MATLAB. Simply stated, if I have a function $f(x,t)$, I want to write it in a new frame, ...
0
votes
2answers
35 views

Need a simple mesh format (for FEA) and a tool to generate the mesh

I want to write a 2D FEA code for my course project and I need to import a mesh (2d, simple quad/tri) on a simple geometry such as a L shaped plate or with a square/circular hole in it, something like ...
0
votes
1answer
30 views

What is the best method to combine multiple vectored results into one chart?

Currently I am working on my research report where I've done a lot of measurements. For now I have uploaded everything into Matlab and visualise each on chart. Each one consists of 4 lines drawn with ...
0
votes
0answers
27 views

Checking if convex polytope is nonempty

I am currently running a linear program with MATLAB to determine, by the exitflag of linprog, if two rotated and shifted hypercubes have nonempty intersection. I wondered if this is a waste of time, ...
0
votes
0answers
36 views

how to pick a submatrix of a sparse matrix quickly(matlab)

I have a large sparse matrix A and i want to pick the submatrix of it to do block jacobi iterations. For the blocks, i have get a matrix Q that contains the index of nonzero entries in its Jth column ...
0
votes
0answers
38 views

Eigen-unsupported: Levenberg - Marquardt algorithm

I am using Eigen-unsupported: LevenbergMarquardt algorithm. I use this algorithm inside my model. I wrote the minimization code both in MATLAB (using fsolve) and C++ and both gave the similar results ...
0
votes
1answer
26 views

MAX-SAT and MAX-cut

I have been using MAX-SAT solver to obtain the exact ground state of ising spin glass model: For 1D periodic model, for systems with 50 binary variables and interaction range of 15th nearest ...
1
vote
1answer
43 views

Switch between 2 equations to be given to ODE using events

I am trying to simulate a system with bilinear stiffness described by the following equations: $25\ddot{x}+15\dot{x}+330000x = p(t)$ if $x < 0.00072$ $25\ddot{x}+15\dot{x}+930000x = p(t)$ if $x ...
0
votes
1answer
48 views

Help me analyze the computational cost of two kinds of operations

everyone, I have a question about computational costs for a algorithm. That is: I have two vectors $u_n,\ v_n\in \mathbb{C}^N$, a matrix $A\in \mathbb{C}^{N\times N}$ (can be both sparse and dense) ...
1
vote
0answers
40 views

How to solve an ode with stochastic time-dependent input

I am trying to repeat an example I found in a paper. I have to solve this ODE: $25 \ddot{x} + 15 \dot{x} + 330000 x = p(t)$ where $p(t)$ is a white noise sequence band-limited into the 10-25 Hz ...
0
votes
0answers
17 views

How to separate model errors from measurement errors? [on hold]

I've got data measured with errors that have known measured_RMS. I am testing a model that has model_RMS differences between model prediction and measured data. What would be a reasonable estimate of ...
0
votes
2answers
35 views

MILP formulation and optimization

For $i=1, \dotsc, K$, we have $n_i$ ordered real numbers: $$ x_i(1) \leq x_i(2) \leq \dotsc \leq x_i(n_i) $$ I want to solve the following optimization problem: \begin{align} \mathrm{maximize} \; ...
1
vote
1answer
43 views

Global optimization methods in computational chemistry

I'm looking for a current and comprehensive overview (like a review article) of global optimization methods and their application in computational chemistry. Mostly I'm interested in geometry ...
2
votes
0answers
53 views

How to tell if symplectic integrator is more suitable for my problem, and what are downsides?

This question follows another one that I have already asked. My intention was to use a classical Runge-Kutta 45 method to solve ODEs of my system. However, I have seen recommendations for using ...
5
votes
1answer
91 views

Are additional penalty terms necessary to solve elliptic PDE's with DG-FEM?

After a cursory glance at several references to discontinuous galerkin finite element methods for the elliptic poisson PDE, i notice that all of them emphasize using penalty methods where an ...
2
votes
2answers
117 views

Eigenvectors: MATLAB vs LAPACK DGGEV or DGGEVX

If we call LAPACK DGGEV or DGGEVX routines for two badly-conditioned matrices in a C++ code, will we get the same Eigen values & vectors of MATLAB eig command ...
5
votes
1answer
78 views

What is a good way to take fractional powers of a matrix in MATLAB?

I am working on a problem that involves taking fractional powers of particular matrices. For the matrix A with 2 on the main diagonal and -1 on the sub and super diagonal (the finite difference ...
1
vote
0answers
27 views

Eigenvalues and Timestep restriction Follow up

This is a follow-up question to the previous questions I had on eigenvalues. Please let me know if I should edit the previous question itself for asking this. If the eigenvalues of a matrix ...
1
vote
1answer
74 views

How can I call the Boost C++ odeint Runge-Kutta integrator for a system of ODEs?

I would like to use Boost C++ odeint Runge-Kutta integrator on a system that looks like this : $$\ddot x = - \frac A{||x||^3} * x $$ $ x $ is a vector in 3D space, so basicaly $ x(i, j, k) $ $ ...
0
votes
0answers
7 views

Is there an existing library that calculates all modes in a step index fiber? [duplicate]

Before embarking on this task I thought it wise to ask if anyone knows of an existing library that does this. I would be coding it in python and at least for starters work on the assumption that ...
3
votes
1answer
95 views

Why is my MATLAB code for back-substitution slower than the backslash operator?

I wrote the code below to invert an upper triangular matrix, avoiding any possible multiplication/subtraction by zero. It just uses $\frac{1}{6}n^3+\ldots$ flops instead of $n^3+\ldots$ flops. ...
0
votes
0answers
31 views

Is there an existing library that calculates all modes in a step index fiber?

Before embarking on this task I thought it wise to ask if anyone knows of an existing library that does this. I would be coding it in python and at least for starters work on the assumption that ...
0
votes
0answers
20 views

How to code the enumeration of restricted positions on a chessboard?

I am currently studying restriction permutations with regards to chess. In my case, I want to code a program (preferably C) to find out how many ways are there to place $k$ number of rooks (pieces ...
3
votes
1answer
98 views

Eigenvalues and Timestep restriction

For an equation of the kind $u_t=Au$, time step is usually defined by ensuring that the eigenvalues are within the stability region of the time-stepping scheme employed. If the eigenvalues are on ...
2
votes
1answer
61 views

Filling out a mesh (for Fenics FEM)

I have been using Fenics to model some simple electrostatic problems, but now I need to simulate more complicated geometries. Assuming I have created a mesh of several objects, and know their ...
0
votes
0answers
31 views

How to do Outlier Detection for data of an unknown function $f(x)$

Suppose I have an unknown function $f(x)$ that is monotonic, convex and nonlinear by definition. I somehow evaluated it at 1000 different $x$ points. By ploting these data, I found a very obvious ...
1
vote
0answers
70 views

Optimizing rank computation for very large sparse matrices

I have a sparse matrix such as ...
5
votes
1answer
62 views

Additional cost associated with quad (or higher) precision

In going from double precision to quad (or higher) precision, roughly how much of a performance hit is taken on various architectures and frameworks. Do floating point operations take twice as much ...
0
votes
0answers
38 views

Proof of corollary to Chinese remainder theorem

I was puzzled regarding corollary 31.29 of the Chinese remainder theorem as presented in the chapter on number theoretic algorithms by Cormen et al. I found another person who asked the same question ...
1
vote
2answers
66 views

convex optimization with objective function given by oracles

Is there any solver for convex optimization in C++ (or some dedicated scheme while no solver is yet available) that could solve a convex optimization problem with objective function value given by an ...
1
vote
1answer
63 views

Nonlinear ODE to solve Duffing's equation

I am trying to solve the Duffing's equation in MATLAB. $ m\ddot{y}+c\dot{y}+ky+k_{3}y^{3} = f(t) $ where $ f(t) = A \sin{\omega t}$ To do that I wrote a function to be given to the ode45. ...
3
votes
1answer
84 views

Inverse advection-diffusion problem, solving for a drift coefficient with experimental data?

I am investigating a physical process where I believe the 1-D advection-diffusion equation: \begin{equation} \frac{\partial u}{\partial t} = -\frac{\partial}{\partial x}[\mu(x,t) u(x,t)] + ...
-2
votes
1answer
42 views

Solving electron density function for Hydrogen and drawing in 3D

I recently stumbled upon interesting site that has interactive 3D representation of radial electron distribution (atomic orbital). here is the url: ...
0
votes
1answer
42 views

Why doesn't the integral of a smoothing kernel equal 1?

I was checking the unity condition on a smoothing kernel for SPH, however I don't understand why the integral is not giving 1. The kernel function is $\displaystyle W(||\vec r||,h) = \frac{315}{64\pi ...
5
votes
1answer
151 views

On the completeness of the Periodic Table of Finite Elements

In a recent SIAM News article, there is a long article describing a systematic organization of the finite elements, aptly dubbed the Periodic Table of Finite Elements. Its really quite fascinating to ...
1
vote
1answer
34 views

Sampling from the Generalized Beta of the Second Kind in Fortran

I need to sample from the generalized beta of the second kind (GB2) distribution (McDonald, 1984, Econometrica). Its PDF has the form $$ f_{a,b,p,q}(x) = ...
0
votes
0answers
24 views

BiCGSTAB with preconditioner and initial guess in ViennaCL and Eigen [closed]

Apparently, ViennaCL has support for operating directly on Eigen objects. For example, ...
1
vote
1answer
60 views

Discrete optimization on a cartesian product with component-wise increasing objective function

The set-up is the following: We have $K$ finite sets of real numbers, i.e. sets $G_i, i=1 \dotsc, K$ and $|G_i| = n_i < \infty$. Furthermore, assume that we have a function $$ h: \mathbb R^K ...
0
votes
0answers
65 views

2D cross section from 3D surface

I am trying to apply the "restoring force surface" method to a dynamic linear system. The idea behind this method is that, knowing acceleration, displacement, velocity and input force it is possible ...
0
votes
0answers
41 views

smallest eigenvalues for linear elasticity

I want to compute a few tens of the smallest eigenvalues of a linear system which is a discretization of a linear elasticity. In the presence of additional constraints like Dirichlet boundary ...
1
vote
1answer
56 views

Are there any popular (paralleled) implementations of Lanczos methods for SVD/eigendecomposion?

I want to use it in Matlab or Java. Will these two languages be much slower for computing the algorithm compared to C, C++, in case efficiency is an important factor? I'm aware of that there's a ...
0
votes
0answers
23 views

Comsol - Make an stl file a domain for CFD

I need to do a CFD simulation with Comsol. I have an STL file with a mesh describing the surface of an object on which I would like to do some fluid dynamics simulation. As far as my understanding ...
0
votes
2answers
36 views

How to represent molecules and compare equality

I originally asked this question at StackOverflow, and was suggested to bring it here. I've seen this question about the representation of molecules in memory, and it makes sense to me (tl;dr ...
2
votes
1answer
43 views

graph theory operations to explore structure of a graph

I'm analyzing experimental data, and I've produced graphs that look similar to the attached sketch. When I look at the graph, I see structure in the connections (connections tend to be local, there is ...
2
votes
1answer
88 views

Finite volume method implementation issues

I am trying to write a simple finite volume method code but there are some concepts I'm still not really getting right (perhaps I'm overcomplicating things) Given a uniform grid, the idea is to ...
2
votes
1answer
61 views

On the cardinality of the set of numbers representable by a floating point system

I am new to numerical methods and I cannot think of a way to start solving the following problem. I know the mantissa, base and the boundaries are related when defining a number but I cannot really ...
1
vote
1answer
58 views

Finite Volume Method flux integration

I was reading through this document about FVM. I understood all up to the point where we have on page 15 the following $$(\bar u^{n+1}_i - \bar u^n_i) \Delta x + \int^{t^{n+1}}_{t^n} ...
3
votes
1answer
48 views

Riemann surfaces: computing $f(z) = \int_0^z \frac{dx}{\sqrt{P(x)}}$

I am trying to validate that the Schwartz-Christoffel mapping does indeed take the upper-half plane $\mathbb{H} = \{ z: \mathrm{Re}(z) > 0\}$ to a polygon. This involves integrals of functions ...

15 30 50 per page