Friday, March 3, 2017

Power flow problems - workshop summary

On February 28th we held the Workshop on Semidefinite Optimization in Power Flow problems.

  • Spyros Chatzivasileiadis gave a talk about SDO methods for producing stability certificates for power systems and about the optimal power flow under uncertainty.
  • Cédric Josz introduced the complex variant of the Lasserre moment hierarchy and discussed the possible advantages of a convex optimizer working directly over the complex numbers.
  • Martin Skovgaard Andersen talked about numerical aspects and experiments with convex relaxations of optimal flow problems. In particular, he was able to solve the SDP relaxations of test cases with over 10K power buses using MOSEK.

The slides from all three talks can be found on our website.

We thank the speakers and the participants for making this a great workshop!


Friday, February 24, 2017

Sponsorship: NemFest, Atlanta, 11-12 May 2017

We are very proud to be one of the sponsors of NemFest 2017 taking place May 11-12, 2017 in Atlanta.

NemFest 2017 is a conference in honor of two extraordinary researchers who shaped the area of discrete and comtinuous optimization: George Nemhauser and Arkadi Nemirovski.

Arkadi Nemirovski was one of the first users of MOSEK back in 1998, even before the release of the first official version.


Tuesday, February 21, 2017

Sponsorship: MIP 2017 - Montréal, 19-22 June

MOSEK is once again one of the sponsors of the Mixed Integer Programming Workshop, which will take place June 19-22, 2017 at HEC Montréal (Québec, Canada).

The program includes talks from distinguished specialists from the academic and industrial world. Until March 1st you can still submit a poster abstract and apply for travel support for students and postdocs.

More details on the official workshop website.


Tuesday, January 3, 2017

Semidefinite optimization in power flow problems

We are pleased to announce a MOSEK workshop on Semidefinite optimization in power flow problems taking place on Tuesday, February 28th, 2017 at the Symbion research park.

Optimal power flow is one of the major problems in optimization of electric power systems, asking for the minimization of operating costs in terms of a specified objective function in the presence of non-linear power flow equations. Three experts, Spyros Chatzivasileiadis (DTU), Cédric Josz (CNRS) and Martin Skovgaard Andersen (DTU) will discuss recent advanced based on convex relaxations and in particular on semidefinite programming.

The workshop is free and open to everyone. There will be coffee, refreshments and time for discussions. Please register through this form to help us with planning.

14:00 - 14:05   Welcome
14:05 - 14:50   Spyros Chatzivasileiadis
15:00 - 15:45   Cédric Josz
16:00 - 16:45   Martin Skovgaard Andersen
17:30+ optional dinner (Nørrebro Bryghus)

  • Spyros Chatzivasileiadis, DTU
    SDP Problems for Power System Stability and Optimization
    In recent years, semidefinite programming is met with increasing interest within the power systems community. Its most notable application to-date is on the convex formulation of the AC optimal power flow problem. At the same time, semidefinite programs can be used to derive Lyapunov functions that guarantee power system stability.

    In this talk we will report on recent work both on power system stability and optimization. First, we will present a novel robust stability toolbox for power grids that can address uncertainties in equilibrium points and fault-on dynamics. In that, we bring in the quadratic Lyapunov functions approach to transient stability assessment.

    Second, we will propose formulations for the integration of chance constraints for several uncertain variables in the optimal power flow problem. We demonstrate our method with numerical examples, and we investigate the conditions to achieve zero duality gap.
  • Cédric Josz, LAAS CNRS
    Application of Polynomial Optimization to Electricity Transmission Networks
    Multivariate polynomial optimization where variables and data are complex numbers is a non-deterministic polynomial-time hard problem that arises in various applications such as electric power systems, imaging science, signal processing, and quantum mechanics. We transpose to complex numbers the Lasserre hierarchy which aims to solve real polynomial optimization problems to global optimality. This brings complex semidefinite programming into the picture and calls for an interior-point algorithm in complex numbers. The Nesterov-Todd direction will be discussed and supplemented by numerical results on the European high-voltage electricity transmission network.
  • Martin Skovgaard Andersen, DTU
    Numerical Aspects of Semidefinite Relaxations of Optimal Power Flow Problems
    Power flow optimization plays an important role in power system operation and planning. It is used to find a cost-optimal operating point of a power system that consists of a set of power buses that are interconnected through a network of transmission lines. We discuss recent progress based on convex relaxation techniques for optimal power flow problems and investigate some numerical aspects through an empirical study.

Thursday, December 1, 2016

Modeling non-convex absolute value constraints with MILP

We are being asked if one can use MOSEK to express a constraint of the form $$\label{eq:sumabs}\sum_i|x_i|=c$$ for some $x\in\mathbb{R}^n$ and $c\in\mathbb{R}$. This condition is non-convex; for instance for $n=1$ it is equivalent to $x=\pm c$. Such constraints appear in long-short portfolio optimization problems (see stackoverflow, paper).

The idea is to introduce a binary vector indicating the positions of positive/negative entries in $x$. Concretely, we want to split $x$ into the positive and negative part $x=s-t$ with $s,t\geq 0$.

If we know an upper bound $M$ on $s_i$ and $t_i$, then the following system:
0\leq s_i&\leq My_i,\\
0\leq t_i&\leq M(1-y_i),\\
& y_i\in \{0,1\}
\end{align*}$$ has the property that at most one of $s_i,t_i$ is non-zero. Indeed:
s_i>0 \implies y_i=1 \implies t_i=0,\\
t_i>0 \implies y_i=0 \implies s_i=0.
$$ Given that we are looking at $\sum_i|x_i|=c$ we can choose $M=c$ as an upper bound for all $|x_i|$. Then an equivalent version of the condition $\eqref{eq:sumabs}$ as a mixed-integer linear program is:
0\leq s&\leq cy,\\
0\leq t&\leq c(1-y),\\
0\leq y&\leq 1,\\
& x,s,t\in\mathbb{R}^n,\ y\in\mathbb{Z}^n.\\

Monday, October 10, 2016

New phone number

We have gotten a new phone number. It is

  • +45 7174 9373
Also the fax number has been closed. 

Monday, June 6, 2016

Improving Python API performance

Recently a MOSEK user pointed out out that sometimes the MOSEK Python API can be quite slow when it comes to input large amount of data. In particular the problem is related to the way MOSEK handles 32 and 64 bit integers.

If you use Numpy with a 64-bit Python, integer arrays will usually end up being arrays of numpy.int64 since the native Python integer is an int64.

Most MOSEK functions require arrays of numpy.int32, e.g. for variable or constraint indexing. In this case it can often significantly speed up the function call to explicitly convert the types.

To this extent is worth using numpy.array class to convert arrays of indexes to the right size: the numpy implementation is highly efficient and saves a lot of time!


To show the performance gain in Python 2.7 we implement a simple tests involving
  • n=1000000 variables,
  • linear objective function terms and
  • quadratic objective function terms.
using Python timeit module. Each tests is repeated num=100 times and we removed from the timing unecessart contributions such as module import and task/environment declaration.

Note we show source code without timeit instrumentation to keep it simple. 

The complete testing code is available at the end of the post.

Objective function linear coefficents.

Say we want to input the coefficients for n variables in the objective function. We can do it using Python arrays or  numpy arrays instead. The code to time the running time is

We obtain the following results

  • direct input: 1.113329s
  • using numpy : 0.017299s

Objective function quadratic coefficients.

Say we want to input the coefficients of the linear part of the objective function. The benchmark code is

It provides the following results

  • direct input: 2.239344s
  • using numpy : 0.028208s


The MOSEK Python API converts by default 64bit integers to 32 bit ones, and this operation could introduce significant overhead. Using numpy array to convert integer arrays to 32 bit is a simple simple workaround that allows to speed up the input process significantly. 

The improvement is quite remarkable. However, it must be noticed that not all users will experience such an improvement. Nevertheless it is a good idea to check your code and see whether you can gain some performance.

Remember that this issue is solved in the new MOSEK 8 release.

Complete code