The 2024 Developer Survey results are live! See the results

# Questions tagged [optimization]

This tag is intended for questions on methods for the (constrained or unconstrained) minimization or maximization of functions.

1,015 questions
Filter by
Sorted by
Tagged with
22 views

### formula for the elliptical orbit of the magnetic field in a current carrying circular loop [closed]

In a circular current carrying loop the magnetic field lines form elliptical orbits if I have constant value for current and a point let's say at r distance from the center of th current carrying loop ...
69 views

• 35
55 views

### LBFGS-B initial gradients too high?

I'm optimizing a geometrical shape for electromagnetic performance. The shape is constrained with bounds, say between 0.2 and 0.8, whereas the parameters are all between 0.2 and 0.8. I am interested ...
92 views

### An alternative to Levenberg–Marquardt algorithm

When trying to solve for a (over)determined non-linear least square method: $$\underset{x}{\min}||f(x)||^2_2, f: \mathbb{R}^n \rightarrow \mathbb{R}^m, x\in \mathbb{R}^n, m\geq n$$ we use the Gauss-...
4k views

### Are penalty functions still "necessary"?

In my constrained problems (box constraints) I simply set my cost function to INFINITY (the c99 macro) if an inequality constraint is violated. This prevents the point being used, seems to work very ...
• 329
133 views

### Algorithm to find local minima of function which is unbounded from below

I have a differentiable function $\mathbb{R}^n \to \mathbb{R}$ of several variables $f(x_1,\ldots,x_n)$, whose form I can write down and compute derivatives of. Typically $n = 8$. The function is ...
22 views

### Unable to decipher the error in Anderson-Darling estimation code in R

I just ran the code in R, which estimates some parameters using Anderson-Darling estimation method. The code is given in the appendix of the Habib-Khalil paper. ...
• 111
1 vote
89 views

### Is there existing code for solving a Lagrangian Dual problem using the subgradient method?

I know there is a generic code for solving the lagrangian relaxation of an LP. However, for an integer program, sometimes you want some constraints relaxed, but not all. For example, I want the ...
1 vote
82 views

### How to spot a "centre-bias operator"?

I recently asked this question after noticing abnormally good results from a popular "nature-based meta-heuristic algorithm". I established by "origin shifting" that the method ...
• 329
2k views

### Ensuring IEEE 754 Compliance and Numerical Precision in C++ HPC Projects

I'm currently engaged in a large-scale C++ HPC project focused on numerical simulation, particularly Finite Element Method (FEM) simulations. Our project spans various Linux-based platforms and ...
• 151
310 views

### Difficult because non-convex, or some other reason?

In my github project, I have come up with a very simple function that seems to cause problems for all the optimizers I have thrown it at, and I am wondering why. There is an obvious downhill ...
• 329
1 vote
53 views

• 133
112 views

### Gradient descent for solving polynomial equations while encouraging variables to be nonzero

I would like to use gradient descent to "randomly sample" solutions to a set of homogeneous polynomial equations. Because the equations are homogeneous, setting all variables to 0 is a valid ...
• 123
74 views

### Why using large bound to supplement inifinity in interior point method can be bad

Here in the documentation of mosek (https://docs.mosek.com/latest/pythonfusion/debugging-numerical.html) we see: Never use a very large number as replacement for infinity . Instead define the ...
• 127
135 views

### BFGS Constrained Optimization Failure Due to Precision Loss

I am trying to optimize the following objective function according to some constraints. However, the optimization fails at the first iteration with the message that the desired error was not ...
1 vote
459 views

### optimizing piecewise linear objective functions (perhaps non convex) with equality constraints

When I do my project, I need to optimize piecewise linear objective functions (perhaps non convex) with equality constraints. The piecewise linear objective function may be not convex like this in the ...
197 views

### Speeding up 3 body problem acceleration calculation

I want to find optimizations to my code for the 3BP, and more specifically computing accelerations. I'm using a data-driven approach, so I have a bodies structure ...
• 41
24 views

### Loop Bounds vs. Iteration Domain in Polyhedral optimization

Context: I was reading a tutorial on polyhedral optimization. But got confused while trying to translate the iteration domain (i.e. loop bound) to set builder notation. Problem Description: A code ...
• 101
72 views

### MIP - Large Piecewise Linear Constraints Over Continuous Intervals

I'm currently trying to run a MIP (have access to both Gurobi and CBC) with a piecewise linear function having ~200 intervals for each of the ~30 x values I have. I am using the standard decomposition ...
1 vote
29 views

### 1-dimensional nonlinear global minimization of kepler distance problem

I want to solve the problem to determine the next intersection of a Keplerian orbit with the Sphere of Influence of a celestial body to find the next intersection within one future period of the ...
• 143
24 views

• 325
1 vote
170 views

### Why researchers use MATLAB based YALMIP or CasADi for MPC?

I was looking at various research papers and most of the researchers use CasADi, YALMIP, MPCTools to implement MPC. My question is "Why researchers use MATLAB based YALMIP or CasADi for MPC ...
150 views

### Role of rotation's pivot point in optimization?

In this paper, the authors describe how to use locally rigid transformations (sampled on nodes in space) to deform mesh vertices. In the paper, rotations are relative to the pivot point, which ...
• 31
64 views

### PETSc non-linear solvers (SNES): specifying single Eval & Jacobian function

The PETSc documentation example of a non-linear solver call has the user provide separate functions for the Jacobian and function evaluations: ...
• 378
1 vote
121 views

### Improvement to naive gradient descent implementation for the Thomson problem

I have a Python program (available on github) that uses naive gradient descent to find approximate solutions to the Thomson Problem. It works surprisingly well, but I've been wondering if there's a ...
• 229
9k views

### stupid + stupid = brilliant in scientific computing

I'm interested in examples of very effective methods in scientific computing that are the sum or naive combination of very ineffective or bad ones.
• 10.4k
119 views

### Automatic Differentiation In the Presence of Jump Points

I have a complex monte-carlo cashflow model that traditionally uses the finite difference (FD) method to calculate its derivative at any given point. To improve model performance, I coded forward-mode ...
1 vote
188 views

### Are there good block sparse matrix solver libraries?

There are some great libraries with linear solvers for sparse matrices - SuiteSparse is the obvious one. The methods work on sparse matrices with scalar entries. However, often in optimization ...
• 111
61 views

### What 2nd-order optimization algorithms have convergence guarantees for strictly- but not strongly-convex problems?

A function $f$ is strictly convex if $$f((1 - \lambda)x + \lambda y) \le (1 - \lambda)f(x) + \lambda f(y)$$ with equality if and only if $x$ and $y$ are equal. This implies that the second derivative ...
• 10.4k
1 vote
60 views

### Optimization: Find minimizer along linestring

Given some function f(x) and a set of points A representing a linestring (or polygonal chain), I am searching for the point on ...
1 vote
48 views

### Name this optimum-within-convex-hull algorithm: State is a convex combination of hull vertices; Nonnegativity ensured by reparameterization

I'm looking for the "official" name(s) for a procedure for optimizing a convex loss function over a convex subset. This seems to be a default/naïve algorithm that folks come up with before ...
• 153
1 vote
58 views

### Beyond the LP relaxation of binary least squares

I have a binary quadratic program with a convex objective function, of the form, \begin{align} \text{minimize}\;\;& x^tAx+b^tx\\ \text{subject to}\;\;& x_i\in\{0,1\} \end{align} where $A$ is ...
• 503
432 views

### Packages suitable for numerical optimization of functions with discontinuous gradient at the point of minimum

Are there packages for numerical optimization in julia or python, or in any other system for scientific computing, capable of taking into account the discontinuity of gradient at the minimum point? ...
• 153
1 vote
66 views

### min(f(x)) is convex or concave based on type of f(x)

i have f(x) that is concave function. My question is g=min(f(x)) is concave or convex? And max(g) is concave or convex? there is a theorem for this?
• 11
1 vote
141 views

### Possible bug with scipy.optimize SHGO sobol: TypeError: <lambda>() takes 1 positional argument but 3 were given

I have been trying to perform some global optimization with SciPy optimizer SHGO and I've had issues with the sampling method 'sobol'. Specifically, I get an error ...
• 31
55 views

1 vote