Skip to main content
6 votes

How to maximize sum of cosine squared plus sum of sine squarred?

Allowing $\phi_k\in[-2\pi,2\pi]$ gives you enough freedom to achieve any angle $\theta_k$ as the common argument of $\cos$ and $\sin$. A geometric interpretation of your problem is to find a sequence ...
RobPratt's user avatar
  • 32.3k
5 votes
Accepted

Question About Fritz John Theorem and Slater Constraint Qualification

Lets break down the statement: There is a ball $U$ about $\mathbf{x}^*$ in $\mathbb{R}^n$. That is, let $U = \{ x \in \mathbb{R}^n : \| x - \mathbf{x}^* \| \leq \rho \}$ be a norm-ball with some ...
Henrik Alsing Friberg's user avatar
5 votes
Accepted

How to transform a binary QP into an MILP?

For simplicity, lets assume $Q$ is a $2$ dimensional matrix: $$ x^TQx = \begin{pmatrix} x_1 & x_2 \\ \end{pmatrix} \begin{pmatrix} q_{11} & q_{12} \\ q_{12} & q_{22} \end{pmatrix} \begin{...
Kuifje's user avatar
  • 13.5k
4 votes
Accepted

How to model a penalty for exceeding a threshold in a nonlinear optimization problem using IPOPT?

What you want can be expressed mathematically as $$\text{Penalty} = \lambda * \text{max(}(P_m - P_c)/P_c,0)$$ In this problem, max is being used in a convex manner, so can be handled without ...
Mark L. Stone's user avatar
4 votes

Linear approximation of fraction for a maximization problem

One major issue is that your problem is nonconvex since you are maximizing a function that is not concave, i.e., $\max|z|^2$ or equivalently, $\max|z|$. If $z$ was a real number, you could perhaps ...
Henrik Alsing Friberg's user avatar
3 votes
Accepted

How to maximize sum of cosine squared plus sum of sine squarred?

Using Hexaly Optimizer, we can confirm the elegant interpretation and solution given by Rob: ...
Hexaly's user avatar
  • 2,976
3 votes
Accepted

Min-convex function as constraint

In case $y$ belongs to a finite domain (e.g., if binary), you can split your difficult constraint into multiple simpler (one for each element of the domain) using: $$ Ax \leq \min_y g(x,y) \quad\...
Henrik Alsing Friberg's user avatar
2 votes

$\min\{f(x_1),\dots,f(x_n)\}$ with other constraints

Your model contains a lot more items than are needed. Assume that $M$ is a sufficiently large positive parameter. I'll add two binary variables $z_x$ (used to linearize $\sqrt{x}$) and $z_y$ (used to ...
prubin's user avatar
  • 39.3k
2 votes

Nonlinear fractional objective function

To supplement the answer by Nikos Kazazakis, I will add that it is always good modeling practice to squeeze as much convexity out of your model as possible, as to reduce degree of nonconvexity. Hence, ...
Henrik Alsing Friberg's user avatar
2 votes
Accepted

Derivative-free based optimization subject to a linear constraint

Why do you want derivative-free (see below)? A good derivative-based local optimization solver should be more robust and likely faster executing than a derivative-free solver. If you insist on using a ...
Mark L. Stone's user avatar
2 votes
Accepted

Is there any literature on constrained nonlinear optimization where constraint returns have to be queried from an oracle?

If $g_{oracle}(x)$ can return gradients, then this is a standard nonlinear optimization problem which can be passed directly to an oracle-based solver like Ipopt (https://github.com/coin-or/Ipopt). ...
Oscar Dowson's user avatar
2 votes
Accepted

Finding a starting ellipsoid and a minimum volume to approximate a convex optimization problem

Not all convex optimization problems can be solved in polynomial time unless P = NP. Copositve Programs are convex optimization problems. Per this Copositive Programming chapter by Samuel Burer, many ...
Mark L. Stone's user avatar
2 votes

How to maximise black-box function defined on a subset of integers, with access to its derivative?

For the modelling question, I would say that if there is really more difference between $x_i = 1$ and $x_i = 20$ than between $x_i = 19$ and $x_i = 20$, then using integers might be more relevant. On ...
fontanf's user avatar
  • 2,623
2 votes
Accepted

Lagrangian Multipliers for constraints in nonlinear optimization problems?

Let's assume that you want to minimize $f:\mathbb{R}^n \rightarrow \mathbb{R}$ subject to $g(x)\ge 0$ ($g:\mathbb{R}^n \rightarrow \mathbb{R}^m$) with no particular assumptions on $f$ and $g.$ ...
prubin's user avatar
  • 39.3k
1 vote

Converting a function composing of multipe pieces into a linear equation

I assume here that the $\beta_j$ are all nonnegative. You can linearize the definition of $b_1$ as follows: $$b_1 \le \beta_1 x_1$$ $$b_1 \le \beta_1 x_2$$ $$b_1 \ge \beta_1 (x_1 + x_2 - 1).$$ The ...
prubin's user avatar
  • 39.3k
1 vote

How to maximise black-box function defined on a subset of integers, with access to its derivative?

Let me start with a bit of terminology: we will say $x^{(1)}$ dominates $x^{(2)}$ if $x^{(1)}_i \ge x^{(2)}_i$ for all $i$ and $x^{(1)}_i \gt x^{(2)}_i$ for some value of $i.$ Since $f()$ is ...
prubin's user avatar
  • 39.3k
1 vote
Accepted

How to describe nonlinear programming in gurobipy?

You can apply gurobipy, you just need to approach it differently. How would you code this up for a 100x100 matrix? The current approach using a hardcoded formula is impractical. Instead use the ...
Riley's user avatar
  • 166
1 vote

Algorithms for maximizing the sum of power functions with linear constraints?

Sequential least-squares from Scipy is able to express this directly: Method SLSQP uses Sequential Least SQuares Programming to minimize a function of several variables with any combination of bounds,...
Reinderien's user avatar
1 vote
Accepted

Knitro dimension of lambda for Hessian

Indeed, there is a bug in the Knitro R interface. The size of the lambda array in the callback input is wrong, and the lambda ...
fontanf's user avatar
  • 2,623
1 vote

How do I optimize this problem where the constraints and objective are variable?

Your merit function is nonlinear, continuous and differentiable. So long as $C$ is unknown, variable and unbounded, the fact that $V_o$ may be expressed as a function of $P_o$ is immaterial. If $C$ is ...
Reinderien's user avatar
1 vote

How do I optimize this problem where the constraints and objective are variable?

I am not 100% sure, but I am thinking like this: I suppose you can rewrite the objective to: $$\max V_a(P_a-P_o)+V_b(P_b-P_o)$$ since $V_a + V_b = V_o$. And since that sum is also equal to whatever is ...
Andreas's user avatar
  • 313
1 vote
Accepted

Knitro`ms_maxsolves` equivalent in Ipopt

As @mark-l-stone says, Ipopt does not have a multi-start option. Just solve your model with different starting points manually.
Oscar Dowson's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible