# How to model a \<= 1/b

**URL:** <https://discourse.julialang.org/t/how-to-model-a-1-b/44370>\
**Category:** Optimization (Mathematical)\
**Tags:** jump, mosek\
**Created:** [August 5, 2020, 9:32pm UTC](https://discourse.julialang.org/t/how-to-model-a-1-b/44370 "2020-08-05T21:32:37Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sobhan](https://avatars.discourse-cdn.com/v4/letter/s/258eb7/32.png) [@sobhan](https://discourse.julialang.org/u/sobhan)\
**Post date:** [August 5, 2020, 9:32pm UTC](https://discourse.julialang.org/t/how-to-model-a-1-b/44370/1 "2020-08-05T21:32:37Z")

</div>

i know we can write a \geq \frac{1}{b} as `[a +b, a - b, 2] in SecondOrderCone()` or a + b \geq ||(a-b, 2)||\_2

But how can i rewrite a \leq \frac{1}{b} with Second Order cones, power cones, exponential cones, basically anything that mosek offers?

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [August 5, 2020, 9:57pm UTC](https://discourse.julialang.org/t/how-to-model-a-1-b/44370/2 "2020-08-05T21:57:01Z")

</div>

You can’t because this is a non-convex constraint. Mosek is a convex optimization solver.

---

<div class="post-metadata">

**Author:** ![sobhan](https://avatars.discourse-cdn.com/v4/letter/s/258eb7/32.png) [@sobhan](https://discourse.julialang.org/u/sobhan)\
**Post date:** [August 5, 2020, 10:04pm UTC](https://discourse.julialang.org/t/how-to-model-a-1-b/44370/3 "2020-08-05T22:04:06Z")

</div>

oh i see, thanks!

---

<div class="post-metadata">

**Author:** ![sobhan](https://avatars.discourse-cdn.com/v4/letter/s/258eb7/32.png) [@sobhan](https://discourse.julialang.org/u/sobhan)\
**Post date:** [August 5, 2020, 10:13pm UTC](https://discourse.julialang.org/t/how-to-model-a-1-b/44370/4 "2020-08-05T22:13:49Z")

</div>

is there any nice of modeling t\geq (\log x)^2 when x\geq 1?

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [August 5, 2020, 10:31pm UTC](https://discourse.julialang.org/t/how-to-model-a-1-b/44370/5 "2020-08-05T22:31:57Z")

</div>

If you want to use Mosek, you need convex constraints: [Convex function - Wikipedia](https://en.wikipedia.org/wiki/Convex_function).

This is not convex.

 ![image](https://global.discourse-cdn.com/julialang/original/3X/3/1/316176d741e5e7c0cdabde5bcaf4d95ebfe3396c.png)

> **[Graphs of Logarithmic Functions](https://www.desmos.com/calculator/ecbwmjbxbk)**
>
> Explore math with our beautiful, free online graphing calculator. Graph functions, plot points, visualize algebraic equations, add sliders, animate graphs, and more.

---

<div class="post-metadata">

**Author:** ![mtanneau](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mtanneau/32/17787_2.png) [@mtanneau](https://discourse.julialang.org/u/mtanneau)\
**Post date:** [August 5, 2020, 10:42pm UTC](https://discourse.julialang.org/t/how-to-model-a-1-b/44370/6 "2020-08-05T22:42:15Z")

</div>

If x only appears through \log(x), e.g., there are no other constraints of the form x + y \leq 1, then you can write z = \log(x) \geq 0 and replace all occurrences of \log(x) by z \geq 0.

Here, t \geq (\log x)^2 becomes t \geq z^{2}, which is convex in the t, z space.

Solve the resulting problem w.r.t z, and recover x = \exp(z) \geq 1.
