# Problem using the exponential cone constraint

Hello I have a problem implementing
an exponential cone constraint in cvx, using the solver Mosek 9.1.9
to minimize over s
s^2 - log s
I minimize over s,z
s^2- z
with exponentiial cone constraint
log(s) >= z

inf { s^2- log(s) : s >= 0 }
= inf { s^2 -z : s>= 0 , log(s)>= z }

the target function ( s^2 -log(s) ) has a finite
minimum indeed, which matlab
function fminbnd can find

target=@(x) (x^2-log(x))
fminbnd(target,0,100)
ans =

``````0.7071
``````

## However cvx says that the minimization problem is unbounded, here is the code and the cvx output, thank you in advance for your help

cvx_solver mosek
cvx_begin

variable s(1) nonnegative
variable z(1)

minimize( s^2-z)

subject to

{s,1,z} == exponential(1)

shat= value(s)
zhat = value(z)

cvx_end

## Calling Mosek 9.1.9: 7 variables, 3 equality constraints For improved efficiency, Mosek is solving the dual problem.

MOSEK Version 9.1.9 (Build date: 2019-11-21 11:27:13)
Platform: Linux/64-X86

Problem
Name :
Objective sense : min
Type : CONIC (conic optimization problem)
Constraints : 3
Cones : 2
Scalar variables : 7
Matrix variables : 0
Integer variables : 0

Optimizer started.
Presolve started.
Linear dependency checker started.
Linear dependency checker terminated.
Eliminator started.
Freed constraints in eliminator : 0
Eliminator terminated.
Eliminator started.
Freed constraints in eliminator : 0
Eliminator terminated.
Eliminator - tries : 2 time : 0.00
Lin. dep. - tries : 1 time : 0.00
Lin. dep. - number : 0
Presolve terminated. Time: 0.00
Problem
Name :
Objective sense : min
Type : CONIC (conic optimization problem)
Constraints : 3
Cones : 2
Scalar variables : 7
Matrix variables : 0
Integer variables : 0

Optimizer - solved problem : the primal
Optimizer - Constraints : 1
Optimizer - Cones : 2
Optimizer - Scalar variables : 7 conic : 6
Optimizer - Semi-definite variables: 0 scalarized : 0
Factor - setup time : 0.00 dense det. time : 0.00
Factor - ML order time : 0.00 GP order time : 0.00
Factor - nonzeros before factor : 1 after factor : 1
Factor - dense dim. : 0 flops : 1.00e+01
ITE PFEAS DFEAS GFEAS PRSTATUS POBJ DOBJ MU TIME
0 4.0e+00 8.1e-01 1.8e-01 0.00e+00 1.827838399e+00 3.009105336e+00 1.0e+00 0.00
1 5.0e-01 1.0e-01 5.5e-02 -8.35e-01 1.540465283e+01 2.134462598e+01 1.3e-01 0.00
2 5.9e-02 1.2e-02 2.0e-02 -9.97e-01 1.584427199e+02 2.121344737e+02 1.5e-02 0.00
3 9.9e-03 2.0e-03 7.9e-03 -1.07e+00 9.802950371e+02 1.294357768e+03 2.5e-03 0.00
4 2.5e-03 4.9e-04 3.6e-03 -9.73e-01 3.743301787e+03 4.810750346e+03 6.1e-04 0.00
5 4.5e-04 9.1e-05 1.7e-03 -1.06e+00 2.333185325e+04 3.030136824e+04 1.1e-04 0.00
6 1.9e-04 3.9e-05 9.8e-04 -1.02e+00 4.817625476e+04 6.081939465e+04 4.8e-05 0.00
7 2.7e-05 5.4e-06 4.0e-04 -1.04e+00 3.963222885e+05 5.051719999e+05 6.7e-06 0.00
8 8.7e-06 1.7e-06 2.1e-04 -1.12e+00 1.075181198e+06 1.365174370e+06 2.2e-06 0.00
9 1.5e-06 2.9e-07 9.4e-05 -1.05e+00 7.216795662e+06 9.264771644e+06 3.6e-07 0.00
10 5.6e-07 1.1e-07 5.3e-05 -1.06e+00 1.655394667e+07 2.093347813e+07 1.4e-07 0.00
11 7.2e-08 1.4e-08 2.0e-05 -1.03e+00 1.439916570e+08 1.834934814e+08 1.8e-08 0.00
Optimizer terminated. Time: 0.00

Interior-point solution summary
Problem status : PRIMAL_INFEASIBLE
Solution status : PRIMAL_INFEASIBLE_CER
Dual. obj: 4.1520662054e+00 nrm: 4e+00 Viol. con: 0e+00 var: 2e-08 cones: 0e+00
Optimizer summary
Optimizer - time: 0.00
Interior-point - iterations : 11 time: 0.00
Basis identification - time: 0.00
Primal - iterations : 0 time: 0.00
Dual - iterations : 0 time: 0.00
Clean primal - iterations : 0 time: 0.00
Clean dual - iterations : 0 time: 0.00
Simplex - time: 0.00
Primal simplex - iterations : 0 time: 0.00
Dual simplex - iterations : 0 time: 0.00
Mixed integer - relaxations: 0 time: 0.00

Status: Unbounded
Optimal value (cvx_optval): -Inf

exponential() has different order of arguments than you’d think from some other sources. z and s should be swapped.

Also, you can just write directly `z<=log(s)`

Thanks a lot, it is as you said, it works after swapping s and z