2
$\begingroup$

I want find the minima of a (multivariable) function under a constraint which has to be fulfilled on a whole interval, let's say $$ \nabla f (\underline x) = 0 \ \\ \ c(\underline x,s)\geq0\ \forall s\in [0,1]. $$ How do I implement such a condition into the Minimize[{f[x1,x2,...,xn],c[x1,...,xn,s]>=0 ?},{x1,x2,...,xn}] function? Thanks in advance!

Edit: Ok, small mistake. I wanted a condition to be an inequality. If I just change that in the example proposed it is stated that this are not valid constraints:

f[x_, y_] := x^2 + y^2;
c[x_, y_, s_] = 2 x + 3 y + s;
NMinimize[{f[x, y], c[x, y, s] >= 0, 1 >= s >= 0}, {x, y}]
$\endgroup$
1
  • $\begingroup$ Welcome to Mathematica.SE! I suggest that: 1) You take the introductory Tour now! 2) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! 3) As you receive help, try to give it too, by answering questions in your area of expertise. $\endgroup$
    – bbgodfrey
    Commented Jan 31, 2015 at 16:34

2 Answers 2

4
$\begingroup$

Here's a two dimensional example:

f[x_, y_] := x^2 + y^2;
c[x_, y_, s_] = 2 x + 3 y + s;
Minimize[{f[x, y], c[x, y, s] == 0, 1 >= s >= 0}, {x, y}]

This gives an answer that depends on the value of s, as is plausible. For your revised/edited problem:

Minimize[{f[x, y], c[x, y, s] >= 0, 1 >= s >= 0}, {x, y, s}]
$\endgroup$
1
  • $\begingroup$ But doesn't that just imply that c[x,y,s]>=0 for just one special s and not for all? I wanted to enforce the constraint on the whole interval. $\endgroup$
    – Malte B
    Commented Feb 3, 2015 at 14:38
1
$\begingroup$

This belongs to the class of Semi-Infinite Programming problems for which ad-hoc algorithms must be used. The most intuitive one (discretization) involves building a finite grid on the interval and imposing the constraint on the grid points only, thus obtaining a classical constrained optimization problem with n constraints. One solves a sequence of such discretized problems on increasingly fine grids until a suitable convergence criterion is satisfied. You can check out the Wikipedia page for a list of references on this and other approaches: https://en.m.wikipedia.org/wiki/Semi-infinite_programming

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.