# Is there a way to solve semi infinite optimization problem?

**URL:** <https://community.wolfram.com/t/is-there-a-way-to-solve-semi-infinite-optimization-problem/14629>\
**Category:** Questions\
**Tags:** optimization\
**Created:** [August 21, 2019, 12:04pm UTC](https://community.wolfram.com/t/is-there-a-way-to-solve-semi-infinite-optimization-problem/14629 "2019-08-21T12:04:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ricsi045](https://avatars.discourse-cdn.com/v4/letter/r/5f9b8f/32.png) [@ricsi045](https://community.wolfram.com/u/ricsi045)\
**Post date:** [August 21, 2019, 12:04pm UTC](https://community.wolfram.com/t/is-there-a-way-to-solve-semi-infinite-optimization-problem/14629/1 "2019-08-21T12:04:12Z")

</div>

Hello

Let’s say your constraint contains a parameter, for example x\*cos(t)+y \< 1, it must hold for all t\in [0;2pi] . Is it possible to include a constraint like this? I don’t see any solution in the documentation of Minimize/Maximize:

The constraints cons can be any logical combination of:  
lhs==rhs equations  
lhs!=rhs inequations  
lhs\>rhs or lhs\>=rhs inequalities  
{x,y,}?reg region specification  
Exists[x,cond,expr] existential quantifiers

---

<div class="post-metadata">

**Author:** ![fkampas](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/fkampas/32/41217_2.png) [@fkampas](https://community.wolfram.com/u/fkampas)\
**Post date:** [August 21, 2019, 12:40pm UTC](https://community.wolfram.com/t/is-there-a-way-to-solve-semi-infinite-optimization-problem/14629/2 "2019-08-21T12:40:28Z")

</div>

If that expression holds over that range then there doesn’t exist any point where it is violated in that range, so negating Exists might work.

---

<div class="post-metadata">

**Author:** ![ricsi045](https://avatars.discourse-cdn.com/v4/letter/r/5f9b8f/32.png) [@ricsi045](https://community.wolfram.com/u/ricsi045)\
**Post date:** [August 21, 2019, 2:04pm UTC](https://community.wolfram.com/t/is-there-a-way-to-solve-semi-infinite-optimization-problem/14629/3 "2019-08-21T14:04:02Z")

</div>

Thanks, sounds good

---

<div class="post-metadata">

**Author:** ![ricsi045](https://avatars.discourse-cdn.com/v4/letter/r/5f9b8f/32.png) [@ricsi045](https://community.wolfram.com/u/ricsi045)\
**Post date:** [August 21, 2019, 3:40pm UTC](https://community.wolfram.com/t/is-there-a-way-to-solve-semi-infinite-optimization-problem/14629/4 "2019-08-21T15:40:02Z")

</div>

I wrote some code, which might look messy, but hope you can see through it and tell me how to make it work. Minimize outputs itself, which is becouse it doesn’t have enough information to solve the problem?

```
n = 2;
k = Binomial[n,2];
m = n + k;
Xs = Array[x,n];
Ds = Array[d,m];
PHIs = Array[phis,n-1];
Cs = Array[c,n];
c[1]=0
c[2]=0
x[1]=d[1]*Cos[d[3]]*Cos[phis[1]]-d[2]*Sin[d[3]]*Sin[phis[1]]+c[1]
x[2]=d[1]*Sin[d[3]]*Cos[phis[1]]+d[2]*Cos[d[3]]*Sin[phis[1]]+c[2]
expr = x[1]^2-x[2]-2
objfun = -Times @@ Part[Ds,1;;n] 
Minimize[{objfun,{phis[1]>=0,phis[1]<=2*Pi,!Exists[phis[1],expr>0]}},{d[1],d[2],d[3]}]

```

The code supposed to solve:  
min -d\_1\*d\_2  
s.t  
x\_1^2-x\_2-2\leq 0  
where x\_1=d\_1\*cos(d\_3)\*cos(\phi\_1)-d\_2\*sin(d\_3)\*sin(\phi\_1)+c\_1 and x\_2=d\_1\*sin(d\_3)\*cos(\phi\_1)+d\_2\*cos(d\_3)\*sin(\phi\_1)+c\_2  
for all \phi\_1 in the [0;2pi] interval, which can be transformed to the !Exist form according to Frank’s suggestion

This problem is finding the maximal area ellipse in the x\_2\geq x\_1^2-2 region, given it’s center (0,0).
