All Questions

7,773 questions
25 views

Fit exponential convergence

I'm working with a numerical algorithm whose output $y$ asymptotically approaches a certain unknown value $a$. I expect an exponential convergence, i.e. the data $y$ given by my algorithm should be ...
21 views

Simulating Anderson model, have problem with momentum representation (MATLAB)

I want to change from real-space representation to momentum-space representation I have a Hamilton-operator (Anderson-model), and I calculated some kind of entropy of its eigenstates (this is working, ...
55 views

26 views

Obtaining integer digits using the GNU Multiprecision Arithmetic Library (gmplib)

I'm using the GNU Multiprecision Arithmetic Library (gmplib) for some experiments in computational mathematics. I want to extract, and manipulate, the base-b digits (with 2 <= b <= 10) of ...
49 views

How to check experimental data against a theoretical curve? (Python)

I am trying to check the agreement of a dataset against a theoretical curve, specifically a bandstop filter in an RLC circuit. I have generated a function which describes the curve we expect from the ...
136 views

Automatic timestep adjustment in a CFD solver

I have developed my own 3D Finite Volume Navier-Stokes solver based on projection method for nonuniform grid. I am looking to incorporate automatic timestep adjustment at each time step based on ...
136 views

I write a test program to integrate foward on $[0,T_f]$ and then backward on $[T_f,0]$ from the endpoint of the forward integration an Hamiltonian system: $$\dot q(t) = \frac{\partial H}{\partial p}(... 0answers 15 views finding rotations between 2 points in COMSOL So I have the results of an eigenfrequency analysis, and would like to find out how much an object has rotated in a certain plane. For instance, in the picture below, I'd like to find out how much the ... 0answers 29 views How to show equivalence between two programs? Consider the following space A = \{(x_1,x_2,x_3)\in \mathbb{R}^3|x_1+x_2+x_3 = 1\}. Then say that we want to minimize a function J(y):\mathbb{R}^{3}\to \mathbb{R} subjected to the constraint that ... 0answers 22 views Finding the polynomial for the solution of an ODE I’m stuck trying to solve part (b) and (c) of the below problem, but part (b) is the one of main concern here as I think (c) should follow easily once (b) is completed. I don’t know where to start ... 0answers 37 views Finite dimensional optimization problem over dynamical system I am interested in solving numerically the following mathematical problem Consider an ode of the form$$ \dot q(t) = f(q(t),t_1,\ldots, t_N),\qquad t\in [0,T], $$where q\in \mathbb{R}^n is the ... 1answer 98 views Is there any explicit symplectic Runge-Kutta method? As far as I know, all the symplectic Runge-Kutta methods are implicit which need to solve non-linear equations during the calculation. Is there any explicit method? If not, why? 0answers 41 views What kind of standard deviation must be used in optimization algorithms? I would like to ask about the standard deviation of objective function value. There are two types of standard deviations ° Population standard deviation ° Sample standard deviation In ... 2answers 67 views How to efficiently invert K \otimes M+I_T\otimes \Sigma? I'm looking for a way to efficiently invert$$K \otimes M+I_T\otimes \Sigma$$where the inverses for M,K exist. I_T is the identity matrix of dimension T, and \Sigma is a diagonal matrix, with ... 1answer 46 views Automatic differentiation via ADOL-C and the Heaviside Function I am writting a c++ program in which I define a function$$\displaystyle F(t) = \sum_{i}r_i\,H(t-t_i)$$where H is the heaviside function, t_i are optimal parameters which are mutable. The ... 0answers 48 views Strange spectral (finite) element results of a solid plate I tried to implement the spectral element method1 as proposed in . I simulated an aluminum plate and a vertical concentrated force was applied at the middle of the top left quarter of the plate2. I ... 0answers 93 views How to solve a 4th order nonnegative LASSO problem? I need to solve the following 4th order nonnegative LASSO problem:$$ \min_{x \geq 0} \quad || |Ax|^2 - b ||^2 + \lambda ||x||_1 $$where |\cdot|^2 denotes element-wise squared. A is small size (e.... 0answers 32 views Neumann boundary conditions on arbitrary surface for finite difference diffusion I am facing the following problem, formulated in practical terms: I have a region \Omega in two or three dimensions, represented as a binary mask, and an initial density u_0 within that region ... 1answer 57 views Is “Gradient Computation” in Finite Volume Discretization Really 2nd order accurate? Based on this, pp 245, we go through these steps to discretize a gradient statement, namely \nabla\phi: 1- Gauss theorem reads,$$ \int_V\nabla \phi dV = \oint_{\partial V}\phi dS $$2- Integral ... 1answer 42 views Demagnetizing field using scalar potential method I want to calculate the stray magnetic field from a ferromagnet using the scalar potential method (1). The problem consists of a ferromagnetic cuboid divided into small cuboidal cells in which the ... 0answers 54 views How reproducible are conda environments? I am aiming at keeping my scientific studies and analyses reproducible: I am automating them as much as possible, I am sharing them, and I sharing them together with the execution environment(s) I've ... 1answer 54 views Online Parameter Estimation using steepest descent I have a first order system which is described by the following differential equation: dx/dt = -a*x + b*u where u is the input <... 1answer 77 views How to : numerical integration by quadrature in C language / remove NaN What I wanna solve it the problem following ( by quadrature method ) I want to get two arrays of data ( z & tau ) from z, tau to z, tau. Since the integrand diverges at z=0.9, ... 0answers 21 views Metis: how to use and tutorial recommendation I am new to METIS and trying to use it in my fortran code. I read the manual online. But still, I am not sure about how to implement it my code. I tried the test cases in the graphs directory. For ... 0answers 73 views Second derivative using Fornberg finite difference method I have some discrete data, non-equispaced in x, y=f(x). I want to use a numerical finite difference method to calculate the second derivatives of y, at some point. I am using the Fornberg method, ... 1answer 31 views Plotting ratings matrix Hello fellows and folks. I have been looking to do this for 1 month and still cannot find the way to do it. Here’s what’s going on: I have a csv file called ratings.csv with the following ... 1answer 35 views Discretization with non-constant matrix containg entries form unknown vector Consider a system of PDEs$$ \begin{cases} u_t = \nabla \cdot (D(u)\nabla u) + \frac{c}{K_U+c}u-ku\\ c_t = d_c\Delta c -\frac{\nu_U c}{K_U + c}u \end{cases} $$with some boundary conditions. Here, D(... 1answer 36 views Single-variable multimodal derivative-free optimization (for a well-behaved function) Are there well-established approaches to single-variable multimodal optimization? Given f:\mathbb{R}\rightarrow\mathbb{R} that: has several local minima within a given range of interest [a,b] is ... 0answers 45 views Numerically Approximating the Jacobian and Comparing the Eigenvalues With Analytical Form I am trying to study the stability of numerical discretization schemes using the Jacobian matrix of the residues with respect to the vector of conserved variables. For a simple diffusion equation ... 0answers 26 views Density functional theory: Total energies and forces In DFT, forces are calculated using the Hellman-Feynman theorem, such that:$$\frac{\text{d} E_\lambda}{\text{d} \lambda} = \left \langle \psi_\lambda \left|\frac{\text{d} \hat{H_\lambda}}{\text{d}\...
24 views

I'm using Nevergrad by Facebook in Python and am observing some strange behaviour relating to bounds. Let's find the minimum of a standard simple function: ...
85 views

Creating 3D Mesh from stl files with gmsh

After long hours of searching for an answer I thought it might be better to ask the community. The problem I have is that I need to convert STL files to mesh files. I know that I therefore need to ...