tag:blogger.com,1999:blog-76666141096746995842024-03-16T02:12:24.018+01:00The MOSEK blogThis blog is about MOSEK.MOSEKhttp://www.blogger.com/profile/16182492737219707955noreply@blogger.comBlogger206125tag:blogger.com,1999:blog-7666614109674699584.post-12448483374173317632024-03-14T09:38:00.000+01:002024-03-14T09:38:17.002+01:00Pi day and the geometric mean cone<p><b>Happy Pi Day! </b>If Euler wasn't so keen on complex numbers then instead of $e^{i\pi}+1=0$ he would certainly have declared $$\pi^3+1=2^5$$ as the most beautiful equation. (Both sides indeed equal $32.0$). We can easily give a formal proof of this identity with MOSEK. Note that we need to simultaneously prove two inequalities $$\sqrt[3]{31}\geq \pi\quad \mathrm{and}\quad \sqrt[5]{\pi^3+1}\geq 2.$$ In MOSEK we have the <a href="https://docs.mosek.com/modeling-cookbook/powo.html#geometric-mean" target="_blank">geometric mean cone</a> of dimension $n+1$: $$\mathcal{GM}^{n+1}=\{(x_1,\ldots,x_n,t)~:~x\geq 0, (x_1\cdot\ldots\cdot x_n)^{1/n}\geq |t|\},$$ so all we need to check is the feasibility of the conic problem $$(31,1,1,\pi)\in\mathcal{GM}^4,\quad (\pi^3+1,1,1,1,1,2)\in\mathcal{GM}^6.$$ This is straightforward with, for instance, <a href="https://docs.mosek.com/latest/pythonfusion/index.html" target="_blank">Python Fusion</a>:</p><p><span style="font-family: courier;">M.constraint(Expr.constTerm([31, 1, 1, pi]), </span></p><p><span style="font-family: courier;"> Domain.inPGeoMeanCone())</span></p><p><span style="font-family: courier;">M.constraint(Expr.constTerm([pi**3+1, 1, 1, 1, 1, 2]), </span></p><p><span style="font-family: courier;"> Domain.inPGeoMeanCone())</span></p><p>and voila! here is our proof:</p><div><div><span style="font-family: courier; font-size: x-small;">Interior-point solution summary</span></div><div><span style="font-family: courier; font-size: x-small;"> Problem status : PRIMAL_AND_DUAL_FEASIBLE</span></div><div><span style="font-family: courier; font-size: x-small;"> Solution status : OPTIMAL</span></div><div><span style="font-family: courier; font-size: x-small;"> Primal. obj: 0.0000000000e+00 nrm: 1e+00 Viol. var: 0e+00 acc: 1e-04 </span></div><div><span style="font-family: courier; font-size: x-small;"> Dual. obj: 0.0000000000e+00 nrm: 0e+00 Viol. var: 0e+00 acc: 0e+00</span></div></div><p>Bonus question for the advanced user: which Mosek parameters do you have to modify to get this answer? Can you get away with only modifying one parameter by not too much? You can try to <a href="https://solve.mosek.com/static/pub/webapp/editor/index.html?ex=snippets/pi" target="_blank">run it and find out yourself here</a>.</p>Michal Adamaszekhttp://www.blogger.com/profile/02629946505878541732noreply@blogger.comtag:blogger.com,1999:blog-7666614109674699584.post-70185187694264750002024-03-06T11:13:00.001+01:002024-03-06T18:21:09.523+01:00Ferrari, factorizing, and portfolios in conic form<p><b>1.</b> <b>Suppose</b> we want to solve the equation $$\begin{equation*}(x^2-3x+2)(x-3)(x-4)=0.\end{equation*}$$ The straightforward approach is to multiply everything out: $$\begin{equation*}x^4-10x^3+35x^2-50x+24=0\end{equation*}$$ and use the algorithm for solving a general 4-th degree equation discovered by Lodovico Ferrari, an Italian mathematician, around 1540. The procedure is pretty involved, requires solving auxiliary 3-rd degree equations and other operations. Luckily it can be summarized in <a href="https://planetmath.org/QuarticFormula" target="_blank">explicit formulae for the quartic roots</a>, which we don't quote here due to restricted space. Having gone through this ordeal we get, for example, that one of the four roots is <span style="font-size: xx-small;">$$\begin{equation*}x_1=\frac{-1}{6} \sqrt{6} \sqrt{\frac{\left(\frac{1}{2}\right)^{\frac{2}{3}} \left(\left(\frac{1}{2}\right)^{\frac{2}{3}} \left(36\sqrt{-3}+70\right)^{\frac{2}{3}}+5\left(\frac{1}{2}\right)^{\frac{1}{3}} \left(36\sqrt{-3}+70\right)^{\frac{1}{3}}+13\right)}{\left(36\sqrt{-3}+70\right)^{\frac{1}{3}}}}-\frac{1}{2} \sqrt{\frac{-1}{3} \left(\frac{1}{2}\right)^{\frac{1}{3}} \left(36\sqrt{-3}+70\right)^{\frac{1}{3}}-\frac{\frac{26}{3} \left(\frac{1}{2}\right)^{\frac{2}{3}}}{\left(36\sqrt{-3}+70\right)^{\frac{1}{3}}}+\frac{10}{3}}+\frac{5}{2}\end{equation*}$$</span> which numerically evaluates to $x_1\approx 1.00 - 1.38\cdot 10^{-17}i$ and with some good faith we conclude $x_1=1$. We obtain the other three roots similarly.</p><p><b>Of course</b> you wouldn't do it that way. You would exploit the fact that your equation already comes almost completely factored, the small quadratic part $x^2-3x+2$ is easy to factor as $(x-1)(x-2)$ with standard school math, so we have $$\begin{equation*}(x-1)(x-2)(x-3)(x-4)=0\end{equation*}$$ and we get all the solutions for free, exactly. The only reason we used the previous method is because we thought we first have to reduce the problem to some standard form and then use it as a black-box. The black-box, however, is unnecessarily complicated for what we need here, introduces noise, and ignores the additional structure we started with so a lot of wasted work is done to go back and forth.</p><p><b>You can read</b> more about the twisted story of Ferrari and his mathematical duels over polynomial equations online, for instance <a href="https://www.quantamagazine.org/the-scandalous-history-of-the-cubic-formula-20220630/" target="_blank">in this article</a>.</p><p><br /></p><p><b>2. Suppose</b> we want to optimize a portfolio with a factor covariance model of the form $\mathrm{diag}(D)+V^TFV$, with assets $x\in \mathbb{R}^n,\ (n\approx 3000)$, where $D\in \mathbb{R}^{n}$ is specific risk, $F\in \mathbb{R}^{k\times k},\ (k\approx 40)$ is factor covariance and $V\in \mathbb{R}^{k\times n}$ is the matrix of factor exposures. The straightforward approach is to multiply everything out, in pseudocode:</p><p><span style="font-family: courier;">Q = diag(D) + V.T @ F @ V</span></p><p><span style="font-family: inherit;">and use the algorithm for optimizing a general quadratic problem:</span></p><p><span style="font-family: courier;">risk = sqrt(quad_form(x, Q))</span></p><p><span style="font-family: inherit;">The procedure is pretty involved, requires checking that the matrix $Q\in \mathbb{R}^{n\times n}$ is positive-semidefinite, which at this size is prone to accumulation of numerical errors and can be time consuming (even though we know very well $Q$ is PSD by construction). Simultaneously the modeling tool and/or conic solver will need to compute some decomposition $Q=U^TU$. Having gone through this ordeal, the solver will finally have the risk in conic form</span></p><p><span style="font-family: courier;">risk = norm(U@x)</span></p><p><span style="font-family: inherit;">albeit working with a dense matrix $U$ with $n\times n\approx 10^7$ nonzeros will not be optimal for efficiency and numerical reasons. We finally obtain the solution.</span></p><p><b>Of course</b> you wouldn't do it that way. You would exploit the fact that your risk model already comes almost completely factored, the small factor covariance matrix $F\in \mathbb{R}^{k\times k}$ is easy to factor using standard Cholesky decomposition as $F=H^TH$, $H\in\mathbb{R}^{k\times k}$, and we get a conic decomposition of risk for free: $$\begin{equation*}x^T(\mathrm{diag}(D)+V^TFV)x=x^T(\mathrm{diag}(D)+V^TH^THV)x=\sum_i D_ix_i^2 + \|HVx\|_2^2,\end{equation*}$$ or in pseudocode:</p><p><span style="font-family: courier;">risk = norm([diag(D^0.5); H @ V] @ x)</span></p><p><span style="font-family: inherit;">The matrix $HV\in \mathbb{R}^{k\times n}$ has $kn\approx 10^5$ nonzeros (a factor of $n/k\approx 100$ fewer than before) and everything else is very sparse so we get the solution very quickly and with high accuracy. The only reason we used the previous method is because we thought we first have to formulate a general quadratic problem and then solve it as a black-box. </span>The black-box, however, is unnecessarily complicated for what we need here, introduces noise, and ignores the additional structure we started with so a lot of wasted work is done to go back and forth.</p><p><b>You can read</b> more about the efficient conic implementation of the factor model in our <a href="https://docs.mosek.com/portfolio-cookbook/factormodels.html#portfolio-optimization-with-factor-model" target="_blank">Portfolio Optimization Cookbook</a>, the <a href="https://docs.mosek.com/latest/pythonfusion/case-studies-portfolio.html#factor-model-and-efficiency" target="_blank">documentation</a>, a <a href="https://colab.research.google.com/github/cvxgrp/cvx_short_course/blob/master/book/docs/applications/notebooks/portfolio_optimization.ipynb#scrollTo=U61R9tM7-TO4" target="_blank">CVXPY tutorial</a> and other resources.</p>Michal Adamaszekhttp://www.blogger.com/profile/02629946505878541732noreply@blogger.comtag:blogger.com,1999:blog-7666614109674699584.post-23333358790351493352024-02-26T14:52:00.000+01:002024-02-26T14:52:51.620+01:00New Portfolio Optimization Cookbook chapter and notebook<p><span style="background-color: white; font-size: 14px;">We are happy to share that our </span><a href="https://www.mosek.com/resources/portfolio-optimization/" style="font-size: 14px;" target="_blank">Portfolio Optimization Cookbook</a><span style="background-color: white; font-size: 14px;"> </span><span style="background-color: white; font-size: 14px;">has been updated with a new chapter about regression. As always the new chapter is accompanied by<a href="https://nbviewer.org/github/MOSEK/PortfolioOptimization/blob/main/python/notebooks/ch12_regression.ipynb " target="_blank"> a notebook</a> with an illustrative code example</span><span style="background-color: white; font-size: 15px; font-variant-ligatures: common-ligatures;"> implemented in MOSEK Fusion for Python.</span></p><div>Enjoy! </div>MOSEKhttp://www.blogger.com/profile/16182492737219707955noreply@blogger.comtag:blogger.com,1999:blog-7666614109674699584.post-26205305078981044132024-02-19T13:40:00.000+01:002024-02-19T13:40:57.369+01:00New third party interfaces to MOSEK<p>Recently we added <a href="https://pypsa.org/" target="_blank">PyPSA</a> and <a href="https://linopy.readthedocs.io/en/latest/" target="_blank">linopy</a> as third party interfaces to MOSEK.</p><p>PyPSA stands for <b>Py</b>thon for <b>P</b>ower <b>S</b>ystem <b>A</b>nalysis. It is pronounced "pipes-ah. It is a toolbox for simulating and optimizing modern power systems. </p><p>PyPSA utilizes linopy to connect to solvers, such as MOSEK. But linopy can also be used on its own. It is designed to be a link between data analysis frameworks, such as <a href="https://pandas.pydata.org/" target="_blank">pandas</a> and <a href="https://docs.xarray.dev/en/stable/" target="_blank">xarray</a>, and optimization solvers, like MOSEK. </p><p>A full list of available third party interfaces to MOSEK can be seen <a href=" Recently we added PyPSA and linopy as third party interfaces to MOSEK. PyPSA stands for Python for Power System Analysis. It is pronounced "pipes-ah. It is a toolbox for simulating and optimizing modern power systems. PyPSA utilizes linopy to connect to solvers, such as MOSEK. But linopy can also be used on its own. It is design to be a link between data analysis frameworks, such as pandas and xarray, and optimization solvers. " target="_blank">here</a>. If you feel like the list is not complete, whether it is an existing interface that is missing or an interface that you wished existed, let us know! This is easiest done by contacting <b>support@mosek.com</b>. </p>MOSEKhttp://www.blogger.com/profile/16182492737219707955noreply@blogger.comtag:blogger.com,1999:blog-7666614109674699584.post-5807415175063845952024-02-12T12:12:00.000+01:002024-02-12T12:12:02.347+01:00NEOS server and Mosek<p>MOSEK offers <a href="https://www.mosek.com/products/academic-licenses/" target="_blank">free licenses to academics</a> as part of our academic initiative. This also extends to academic use of MOSEK through the <a href="https://neos-server.org/neos/" target="_blank">NEOS server</a>. </p><p>The NEOS server is a great initiative and service hosted by <a href="https://wid.wisc.edu/" target="_blank">Wisconsin Institute for Discovery at the University of Wisconsin in Madison</a>. The NEOS server is a free internet-based service for solving numerical optimization problems. We at MOSEK are proud to one of the 60 supported solvers. </p>MOSEKhttp://www.blogger.com/profile/16182492737219707955noreply@blogger.comtag:blogger.com,1999:blog-7666614109674699584.post-67908833144648087182024-01-24T13:47:00.002+01:002024-01-24T13:47:59.866+01:00New prices from June 2024<p>The new prices will come into effect on <b>June 1st, 2024.</b> </p><p>The price for the basic PTS and PTON floating licenses increases with 100 USD each. Our other prices follows accordingly. With NODE licenses costing 4 times the price of their floating license counterpart and the annual maintenance 25% of the base price of the part.</p><p>This equates to a price increase of 5.1% on average.</p><p>The new prices can be found at the top of our <a href="https://www.mosek.com/sales/commercial-pricing/" target="_blank">commercial pricing page</a> on our website.</p><p><br /></p>MOSEKhttp://www.blogger.com/profile/16182492737219707955noreply@blogger.comtag:blogger.com,1999:blog-7666614109674699584.post-17126474368494119582024-01-18T14:37:00.000+01:002024-01-18T14:37:34.888+01:00Seminar at LiU<p> <span style="background-color: white; color: rgba(0, 0, 0, 0.9); font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif; font-size: 20px; white-space-collapse: preserve;">On Monday (January 22) MOSEK CEO and chief scientist </span><a class="ql-mention" data-entity-urn="urn:li:fsd_profile:ACoAAABRI0wBvet4hrfm4lfjFAfTeflwPtFibCY" data-guid="0" data-object-urn="urn:li:member:5317452" data-original-text="Erling Dalgaard Andersen" data-test-ql-mention="true" href="https://www.linkedin.com/company/205193/admin/feed/posts/#" spellcheck="false" style="border: var(--artdeco-reset-link-border-zero); box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif; font-size: var(--artdeco-reset-base-font-size-hundred-percent); font-weight: 600; margin: var(--artdeco-reset-base-margin-zero); padding: var(--artdeco-reset-base-padding-zero); text-decoration: var(--artdeco-reset-link-text-decoration-none); touch-action: manipulation; vertical-align: var(--artdeco-reset-base-vertical-align-baseline); white-space-collapse: preserve;">Erling Dalgaard Andersen</a><span style="background-color: white; color: rgba(0, 0, 0, 0.9); font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif; font-size: 20px; white-space-collapse: preserve;"> will be giving a talk at Linköping University. The talk will, maybe unsurprisingly, be about conic optimization. </span></p><p style="--artdeco-reset-typography_getfontsize: 1.6rem; --artdeco-reset-typography_getlineheight: 1.5; background-color: white; border: var(--artdeco-reset-base-border-zero); box-sizing: inherit; color: rgba(0, 0, 0, 0.9); counter-reset: list-1 0 list-2 0 list-3 0 list-4 0 list-5 0 list-6 0 list-7 0 list-8 0 list-9 0; cursor: text; font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif; font-size: 20px; line-height: var(--artdeco-reset-typography_getLineHeight); margin: 0px; padding: 0px; vertical-align: var(--artdeco-reset-base-vertical-align-baseline); white-space-collapse: preserve;">The seminar will take place at 13.15 in Hopningspunkten (B-huset) on the campus of LiU. It is open for everybody who are interested :) </p>MOSEKhttp://www.blogger.com/profile/16182492737219707955noreply@blogger.comtag:blogger.com,1999:blog-7666614109674699584.post-85759904182370040692024-01-15T14:23:00.000+01:002024-01-15T14:23:16.760+01:00Happy New Year!<p>We here at MOSEK have had a good start to the new year and we hope the same is true for all of you!</p><p>For those who have had a less than optimal start to the year we would like to share some resources that might bring you on to the fast path to optimum.</p><p>We know many users of MOSEK use it for portfolio optimization, in light of that we gladly recommend the recently published paper <a href="https://web.stanford.edu/~boyd/papers/pdf/markowitz.pdf" target="_blank">Markowitz Portfolio Construction at Seventy</a>. </p><p>Further there is now an<a href="https://ask.cvxr.com/t/announcement-cvx-for-apple-silicon/12280" target="_blank"> unofficial package for CVX with native Apple Silicon support</a>. This package due to the work of <a href="https://scholar.google.com/citations?user=7g2LhbAAAAAJ&hl=en" target="_blank">Dr. Wenyuan (Mike) Wang</a> and MOSEKs own Michal Adamaszek with permission from <a href="https://ask.cvxr.com/u/mcg/summary" target="_blank">Michael C. Grant</a>.</p><p>We hope these resources can be of use and that you will have a great 2024! </p>MOSEKhttp://www.blogger.com/profile/16182492737219707955noreply@blogger.comtag:blogger.com,1999:blog-7666614109674699584.post-36980693826804945972023-12-18T10:03:00.000+01:002023-12-18T10:03:25.151+01:00Christmas lights<p>In this year's Christmas blogpost, we explain how to properly hang the Christmas lights on the Christmas tree <span face=""Google Sans", Roboto, arial, sans-serif" style="background-color: white; color: #4d5156; font-size: 16px;">🎄.</span></p><p>Let us fix some notation. The <span face=""Google Sans", Roboto, arial, sans-serif" style="background-color: white; color: #4d5156; font-size: 16px;">🎄</span> in dimension $D\geq 2$ is (surprise!) a reflected and rescaled quadratic cone:</p><p>$$(x_1,\ldots,x_D) \in \unicode{x1F384} \subseteq\mathbb{R}^D\quad \iff\quad W(1-x_D/T)\geq \|x_{1:D-1}\|_2,\ x_D\geq 0$$</p><p>where $T$ is the coordinate of the top and $W$ is a width rescaling parameter. The tree comes decorated with $P$ ornaments located at $c_1,\ldots,c_P\in\unicode{x1F384}$. Here is an example in dimension $D=2$.</p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5ITwGla_89TCpnJdIZm7bXOLLAM35ITrs4-4Q5Lh5cPt9Pe28L8Jx90aweAx9KZvtn3tVYv33VVBdT7fzVXaVtiGmXmk2ojJ02lzrcDZiasKAzwn9j0J1RYClHpszSnhCVs0efYSBxborx0mhH5gIf0C0zW6fR8CGl7ar2D5YYsmNiWWBpIqYd5Cw3ROA/s388/Screenshot%20from%202023-12-12%2009-15-54.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="388" data-original-width="223" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5ITwGla_89TCpnJdIZm7bXOLLAM35ITrs4-4Q5Lh5cPt9Pe28L8Jx90aweAx9KZvtn3tVYv33VVBdT7fzVXaVtiGmXmk2ojJ02lzrcDZiasKAzwn9j0J1RYClHpszSnhCVs0efYSBxborx0mhH5gIf0C0zW6fR8CGl7ar2D5YYsmNiWWBpIqYd5Cw3ROA/s320/Screenshot%20from%202023-12-12%2009-15-54.png" width="184" /></a></div><p>The Christmas lights chain consists of $N$ bulbs evenly spaced in distance $L$ along the wire. Their locations $x_1,\ldots,x_N\in \unicode{x1F384}$ are to be determined. If, like us, you have been collecting and repairing your lights for almost 25 years then it is possible that each of the lightbulbs shines with different power $I_1,\ldots,I_N$.</p><p>The main requirement we have is that <b>each of the ornaments is nicely illuminated</b>, more precisely we wish to maximize the total amount of light received by the worst-illuminated ornament. Let $\mathrm{il}_j(d)$ be the amount of light that a point in distance $d$ from the light source receives from the $j$-th lightbulb. Obviously $\mathrm{il}_j(d)$ is a decreasing function of the distance $d$ to the bulb. That leads us to the optimization problem:</p><p>$$\begin{array}{llrr}\mathrm{maximize} & \mathrm{il}_{MIN} & &\\ \mathrm{s.t.} & \mathrm{il}_{MIN}\leq \sum_{j=1}^N \mathrm{il}_j(d_{ij}) & i=1,\ldots,P & (2.1) \\ & d_{ij}\geq \|x_j-c_i\|_2 & i=1,\ldots,P,\ j=1,\ldots,N &(2.2) \\ & \|x_j-x_{j+1}\|_2\leq L & j=1,\ldots,N-1 & (2.3) \\ & x_j \in \unicode{x1F384} & j=1,\ldots,N &(2.4) \\ & x_1 = (W,0,\ldots) & &(2.5)\end{array}$$</p><p>In principle we should let the brightness of the $j$-th bulb decay as $\mathrm{il}_j(d)=I_j/d^{D-1}$, but that does not lead to a convex constraint in (2.1). Instead, let us use a piecewise-linear approximation $\widetilde{\mathrm{il}_j}(d)=\mathrm{max}(I_i-d,0)$. This function is not concave either, so it cannot be used directly in (2.1) in a continuous fashion, but when written as</p><p>$$(d\in[0,I_j]\ \mathrm{and}\ \widetilde{\mathrm{il}_j}(d) = I_j-d)\ \mathrm{or}\ (d\geq I_j\ \mathrm{and}\ \widetilde{\mathrm{il}_j}(d) = 0)$$</p><p>it becomes evidently definable via a <a href="https://docs.mosek.com/latest/pythonfusion/tutorial-djc-fusion.html#doc-tutorial-djc" target="_blank">disjunctive constraint</a>. Here is a rough comparison between $\mathrm{il}_j(d)$ and $\widetilde{\mathrm{il}_j}(d)$:</p><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEh0RaaDVLAZUxX3QyOSebWvgFcBkuEXdI2Jo7PHhQ3xcaIYbD2EfHIPeRfWOyQcVuoeLNFrimq7hljO-dRWzXqbj3yPoFZG70UrHfNkNhF40iUh6Dosl2aCc2DJgHbPnnPRq3W5VVUTiJjXXNiJ2kkPzPB5WPSxc63Jz9zacZMKUBkCHi5s_6mLuPRt9JIC" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="290" data-original-width="413" height="142" src="https://blogger.googleusercontent.com/img/a/AVvXsEh0RaaDVLAZUxX3QyOSebWvgFcBkuEXdI2Jo7PHhQ3xcaIYbD2EfHIPeRfWOyQcVuoeLNFrimq7hljO-dRWzXqbj3yPoFZG70UrHfNkNhF40iUh6Dosl2aCc2DJgHbPnnPRq3W5VVUTiJjXXNiJ2kkPzPB5WPSxc63Jz9zacZMKUBkCHi5s_6mLuPRt9JIC=w202-h142" width="202" /></a></div>Let us quickly recap problem (2): constraint (2.1) (with $\widetilde{\mathrm{il}_j}$ in place of $\mathrm{il}_j$) computes the approximate amount of light received by each ornament as a function of the distance $d_{ij}$ from the $i$-th ornament to the $j$-th bulb; that distance is computed in (2.2). Two consecutive lightbulbs cannot be spaced by more than the wire length between them, as in (2.3), while (2.5) ensures that the chain starts at the fixed bottom point of the tree, where the electric socket is. The complete MOSEK Fusion model <a href="https://gist.github.com/aszekMosek/745adc2b7d5c8c760f9293339e3c28b2" target="_blank">can be found on GitHub</a>; it is a mixed-integer (due to the disjunctive constraints) second-order cone optimization problem.<p></p><p>We end with some examples. The ornaments have been given intensity according to the amount of light received. The disk sizes correspond to the brightness of lightbulbs.</p><p></p><table><tbody><tr><td><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEhgCXa9eiEsc978tdeqeTjysCPhKq3qEXO-3ExyhJOJPDG_p1Vqv5NWggF9NPOZ3s5NkdVhtX1D2CcImHk7deyUg4NnAxvwg1IPF-qK_ZqdvAKr4yWth2JBPUfnniOoNnn8gpG0kd8bwk5lmXX_dshN5SfDTjA-Z70QQOBtUumCFXZ1gGw0ODpN0_64f2EA" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="381" data-original-width="220" height="285" src="https://blogger.googleusercontent.com/img/a/AVvXsEhgCXa9eiEsc978tdeqeTjysCPhKq3qEXO-3ExyhJOJPDG_p1Vqv5NWggF9NPOZ3s5NkdVhtX1D2CcImHk7deyUg4NnAxvwg1IPF-qK_ZqdvAKr4yWth2JBPUfnniOoNnn8gpG0kd8bwk5lmXX_dshN5SfDTjA-Z70QQOBtUumCFXZ1gGw0ODpN0_64f2EA=w165-h285" width="165" /></a></div></td><td><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEhgCXa9eiEsc978tdeqeTjysCPhKq3qEXO-3ExyhJOJPDG_p1Vqv5NWggF9NPOZ3s5NkdVhtX1D2CcImHk7deyUg4NnAxvwg1IPF-qK_ZqdvAKr4yWth2JBPUfnniOoNnn8gpG0kd8bwk5lmXX_dshN5SfDTjA-Z70QQOBtUumCFXZ1gGw0ODpN0_64f2EA" style="margin-left: 1em; margin-right: 1em;"></a><a href="https://blogger.googleusercontent.com/img/a/AVvXsEj9FFPsUuqvDfz_rmRdLu-oSJzTItwUa3sYwIBIU1BLQh1S7Sise6L9dlnkc-zPQ5fqgqjn9k_2U41yNfMuU0aFYvJUoHVWei9JmxlYR1TUPfgj3qRSsXJa-WQL5Va3Q6ChnwbGRnTqoTQFwdr9zOxO9IUEdXJaX4hYk2ibKG3YnUc-aVzAlpRDPXU1k2vt" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="381" data-original-width="220" height="282" src="https://blogger.googleusercontent.com/img/a/AVvXsEj9FFPsUuqvDfz_rmRdLu-oSJzTItwUa3sYwIBIU1BLQh1S7Sise6L9dlnkc-zPQ5fqgqjn9k_2U41yNfMuU0aFYvJUoHVWei9JmxlYR1TUPfgj3qRSsXJa-WQL5Va3Q6ChnwbGRnTqoTQFwdr9zOxO9IUEdXJaX4hYk2ibKG3YnUc-aVzAlpRDPXU1k2vt=w163-h282" width="163" /></a></div></td><td><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEj9FFPsUuqvDfz_rmRdLu-oSJzTItwUa3sYwIBIU1BLQh1S7Sise6L9dlnkc-zPQ5fqgqjn9k_2U41yNfMuU0aFYvJUoHVWei9JmxlYR1TUPfgj3qRSsXJa-WQL5Va3Q6ChnwbGRnTqoTQFwdr9zOxO9IUEdXJaX4hYk2ibKG3YnUc-aVzAlpRDPXU1k2vt" style="margin-left: 1em; margin-right: 1em;"></a><a href="https://blogger.googleusercontent.com/img/a/AVvXsEjYzqHL32UaN9g6qf5VpDjDQKqEqAlqDUlsnzri6QIqrHW5-KKIT183DOosmgNPvafJH70SvR51cO04OzMs9mR_o7f1hmNSLLwM9BuQMnrctl8y0Pq3AqCDnfEK0QJfkHfdNllFHM2cDjLp_-3L3qvWl3I2j5QTHH9DuKrLfnzQ5fZ73U6asthbLqsvc02E" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="381" data-original-width="220" height="272" src="https://blogger.googleusercontent.com/img/a/AVvXsEjYzqHL32UaN9g6qf5VpDjDQKqEqAlqDUlsnzri6QIqrHW5-KKIT183DOosmgNPvafJH70SvR51cO04OzMs9mR_o7f1hmNSLLwM9BuQMnrctl8y0Pq3AqCDnfEK0QJfkHfdNllFHM2cDjLp_-3L3qvWl3I2j5QTHH9DuKrLfnzQ5fZ73U6asthbLqsvc02E=w158-h272" width="158" /></a></div></td></tr></tbody></table><br /><p></p><p>It remains to wish all readers a very well-lit 🎄 and Happy New year 2024!</p><p><i>The MOSEK team</i></p><p></p>Michal Adamaszekhttp://www.blogger.com/profile/02629946505878541732noreply@blogger.comtag:blogger.com,1999:blog-7666614109674699584.post-56844126160627308672023-11-28T15:03:00.000+01:002023-11-28T15:03:09.661+01:00MOSEK in Abu Dhabi<div style="background-color: white; text-align: left;"><span style="font-family: inherit;"><span style="font-size: 15.4px;">Next week MOSEK will be in Abu Dhabi </span><span style="font-size: 15.4px;">attending</span><span style="font-size: 15.4px;"> the dual conference <a href="https://www.ctl.ae/adrio1-ewgcfm68">C</a></span><span style="background-color: transparent; font-size: 15.4px;"><a href="https://www.ctl.ae/adrio1-ewgcfm68" target="_blank">onverging paths in commodity and financial market analysis</a>. In consist of the established conferences <a href="https://www.ctl.ae/adrio1-ewgcfm68#/adrio?lang=en" target="_blank">Research in Options</a> and </span><a href="https://www.ctl.ae/adrio1-ewgcfm68#/ewgcfm68?lang=en" target="_blank"><span style="box-sizing: inherit; line-height: 1.2em; text-align: center;">Euro</span><span style="box-sizing: inherit; line-height: 1.2em; text-align: center;"> </span><span style="box-sizing: inherit; line-height: 1.2em; text-align: center;">Working Group for Commodity and Financial Modelling</span></a>. </span></div><p style="background-color: white; font-size: 15.4px;"><span style="font-family: inherit;">If you are going to the conference or if you are based in Abu Dhabi and would like to discuss MOSEK, don’t hesitate to reach out to <a href="mailto:support/sales@mosek.com" style="color: #ff8832; text-decoration-line: none;">sales@mosek.com</a>.</span></p><p class="MsoNormal" style="background-color: white; font-size: 15.4px;"><span lang="EN-GB"><span style="font-family: inherit;">See you in Abu Dhabi!</span></span></p>MOSEKhttp://www.blogger.com/profile/16182492737219707955noreply@blogger.comtag:blogger.com,1999:blog-7666614109674699584.post-36178553997509982042023-10-09T11:58:00.000+02:002023-10-09T11:58:43.278+02:00Irreducible Infeasible Subsets<p>When an optimization problem is infeasible it is common to ask for the reason for infeasibility. It is very typical that the model is infeasible because it contains a set of mutually contradicting constraints which is relatively small compared to the total size of the problem. Locating and analyzing such a subset is usually helpful in understanding the reasons for infeasibility.</p><p>Such considerations have led the OR community to come up with the notion of <i>Irreducible Infeasible Set (IIS)</i> - a subset of constraints which is infeasible but cannot be reduced to a smaller infeasible set (all its proper subsets are already feasible). Every infeasible problem has an IIS - possibly many, possibly of different sizes. For example the problem <span style="font-family: courier;">bgdbg1</span> (see below) has a few hundred bounds but its infeasibility is caused already by the small segment</p><p><span style="font-family: courier;">X104_JY >= 0.0<br /></span><span style="font-family: courier;">X104_JH >= 36.0<br /></span><span style="font-family: courier;">X104_JY + X104_JH <= 6.0</span></p><p>consisting of 3 bounds, which is an IIS. In fact the same model has also another IIS</p><p><span style="font-family: courier;">X199_CM1 >= 96.0<br />X199_CM1 <= 86.0</span></p><p>with just 2 bounds (it doesn't get any better - a single linear bound is always feasible on its own).</p><p>An IIS can be found by a simple iterative algorithm which tries to remove one bound at a time and checks if the problem remains infeasible. We have implemented it for linear and mixed-integer linear problems in a recently published <a href="https://nbviewer.org/github/MOSEK/Tutorials/blob/master/iis-deletion-filter/DeletionFilter.ipynb" target="_blank">python notebook</a>, where you can also read more details of the algorithm and its implementation. You can also <a href="https://nbviewer.org/github/MOSEK/Tutorials/blob/master/iis-deletion-filter/iis_deletion.py" target="_blank">download the python code directly</a>. </p><p>Below are the results produced by our sample code on the infeasible problems from <a href="https://netlib.org/lp/infeas/" target="_blank">NETLIB</a>. We report the number of bounds in the problem, the size of the (Farkas) infeasibility certificate (these are the bounds that will appear in the <a href="https://docs.mosek.com/latest/pythonapi/debugging-infeas.html#locating-primal-infeasibility" target="_blank">infeasibility report</a> or in the <a href="https://docs.mosek.com/latest/pythonapi/optimizer-task.html#mosek.task.getinfeasiblesubproblem" target="_blank">task.getinfeasiblesubproblem()</a> function) and finally the size of the smallest IIS out of 5 runs of the algorithm (the IIS found depends on an ordering of the bounds, which we randomize).</p><p><span style="font-size: x-small;"><span style="font-family: courier;">bgdbg1.gz: OK, all bounds = 926, Farkas size = 2, IIS size = 2<br /></span><span style="font-family: courier;">bgetam.gz: OK, all bounds = 1577, Farkas size = 31, IIS size = 25<br /></span><span style="font-family: courier;">bgindy.gz: OK, all bounds = 14694, Farkas size = 196, IIS size = 154<br /></span><span style="font-family: courier;">bgprtr.gz: OK, all bounds = 68, Farkas size = 12, IIS size = 10<br /></span><span style="font-family: courier;">box1.gz: OK, all bounds = 723, Farkas size = 10, IIS size = 9<br /></span><span style="font-family: courier;">ceria3d.gz: OK, all bounds = 3576, Farkas size = 117, IIS size = 198<br /></span><span style="font-family: courier;">chemcom.gz: OK, all bounds = 1416, Farkas size = 86, IIS size = 37<br /></span><span style="font-family: courier;">cplex2.gz: numerical issues, all bounds = 733, Farkas size = 177, IIS size = 715<br /></span><span style="font-family: courier;">ex72a.gz: OK, all bounds = 609, Farkas size = 61, IIS size = 60<br /></span><span style="font-family: courier;">ex73a.gz: OK, all bounds = 597, Farkas size = 28, IIS size = 25<br /></span><span style="font-family: courier;">forest6.gz: OK, all bounds = 196, Farkas size = 96, IIS size = 92<br /></span><span style="font-family: courier;">galenet.gz: OK, all bounds = 26, Farkas size = 5, IIS size = 5<br /></span><span style="font-family: courier;">gosh.gz: OK, all bounds = 15353, Farkas size = 9, IIS size = 9<br /></span><span style="font-family: courier;">gran.gz: OK, all bounds = 8386, Farkas size = 2, IIS size = 2<br /></span><span style="font-family: courier;">grbeai.gz: OK, all bounds = 10402, Farkas size = 93, IIS size = 54<br /></span><span style="font-family: courier;">itest2.gz: OK, all bounds = 13, Farkas size = 3, IIS size = 3<br /></span><span style="font-family: courier;">itest6.gz: OK, all bounds = 21, Farkas size = 3, IIS size = 3<br /></span><span style="font-family: courier;">klein1.gz: OK, all bounds = 108, Farkas size = 55, IIS size = 54<br /></span><span style="font-family: courier;">klein2.gz: OK, all bounds = 531, Farkas size = 57, IIS size = 55<br /></span><span style="font-family: courier;">klein3.gz: numerical issues, all bounds = 1082, Farkas size = 97, IIS size = 192<br /></span><span style="font-family: courier;">mondou2.gz: OK, all bounds = 1832, Farkas size = 24, IIS size = 23<br /></span><span style="font-family: courier;">pang.gz: OK, all bounds = 942, Farkas size = 34, IIS size = 32<br /></span><span style="font-family: courier;">pilot4i.gz: OK, all bounds = 1886, Farkas size = 43, IIS size = 47<br /></span><span style="font-family: courier;">qual.gz: OK, all bounds = 1360, Farkas size = 217, IIS size = 370<br /></span><span style="font-family: courier;">reactor.gz: OK, all bounds = 1652, Farkas size = 15, IIS size = 9<br /></span><span style="font-family: courier;">refinery.gz: OK, all bounds = 1360, Farkas size = 206, IIS size = 120<br /></span><span style="font-family: courier;">vol1.gz: OK, all bounds = 1360, Farkas size = 275, IIS size = 196<br /></span></span><span style="font-family: courier;"><span style="font-size: x-small;">woodinfe.gz: OK, all bounds = 173, Farkas size = 2, IIS size = 2</span></span></p><p>The work reported here and in the notebook was carried out by Adam Bosák during his student internship at MOSEK. Thanks!</p>Michal Adamaszekhttp://www.blogger.com/profile/02629946505878541732noreply@blogger.comtag:blogger.com,1999:blog-7666614109674699584.post-7541815034142134612023-10-09T11:26:00.000+02:002023-10-09T11:26:56.859+02:00Informs Annual meeting<p><span style="font-family: inherit;">Next
week Informs annual meeting will take place in Phoenix and MOSEK will of course be there.
If you are going to Informs annual meeting and would like to discuss MOSEK,
don’t hesitate to reach out to </span><a href="mailto:support/sales@mosek.com" style="font-family: inherit;">sales@mosek.com</a><span style="font-family: inherit;">.</span></p>
<p class="MsoNormal"><span lang="EN-GB"><span style="font-family: inherit;">See you
in Phoenix!</span><b><o:p></o:p></b></span></p>MOSEKhttp://www.blogger.com/profile/16182492737219707955noreply@blogger.comtag:blogger.com,1999:blog-7666614109674699584.post-54514558020477531272023-10-02T14:13:00.000+02:002023-10-02T14:13:16.532+02:00Autumn and MOSEK<p></p><p class="MsoNormal"><span lang="EN-GB" style="mso-ansi-language: EN-GB;"></span></p>
<p style="text-align: left;"><span style="font-family: inherit; font-size: medium;"><span lang="EN-GB">The summer has been long here in Copenhagen, but now it feels like the fall is here to stay. For MOSEK the arrival of autumn means the arrival of thousands of new persons allegeable to use MOSEK for free.<br /></span><span lang="EN-GB">This is because MOSEK, through our academic initiative, grants <a href="https://www.mosek.com/products/academic-licenses/" target="_blank">free </a></span><span style="background-color: white;"><a href="https://www.mosek.com/products/academic-licenses/" target="_blank">licenses for research or educational</a> purposes at degree-granting academic institutions.</span></span></p><p style="text-align: left;"><span lang="EN-GB"><span style="font-size: medium;"><span style="font-family: inherit;">Whether you are a new student or a seasoned academic why not use this </span>opportunity<span style="font-family: inherit;"> to <a href="https://www.mosek.com/products/academic-licenses/" target="_blank">try MOSEK</a>!</span></span></span></p><p style="text-align: left;"><span lang="EN-GB"><span style="font-size: medium;"><span style="font-family: inherit;"> </span></span></span></p><p></p><p></p>MOSEKhttp://www.blogger.com/profile/16182492737219707955noreply@blogger.comtag:blogger.com,1999:blog-7666614109674699584.post-31639365908081821602023-09-21T14:20:00.000+02:002023-09-21T14:20:47.501+02:00Apple Silicon and Matlab R2023b<p>The <a href="https://mathworks.com/" target="_blank">MATLAB</a> R2023b is the first stable release with native support for the Apple Silicon M1/M2 platform. </p><p><a href="https://docs.mosek.com/latest/toolbox/index.html" target="_blank">The MOSEK Optimization Toolbox for MATLAB</a> is <a href="https://docs.mosek.com/10.1/releasenotes/changes.html#release-notes-for-10-1" target="_blank">available natively for Apple Silicon from MOSEK 10.1</a>. It means that from version 10.1 there are two ways to use MOSEK in MATLAB on the M1/M2 platform:</p><p></p><ul style="text-align: left;"><li>(natively) Use the Apple Silicon release of MATLAB (version 2023b+, architecture MACA64) and the <span style="font-family: courier;">osxaarch64</span> MOSEK package, with its included toolbox for MATLAB.</li><li>(via Rosetta, the "old" way) Use the Intel release of MATLAB (any version, architecture MACI64) and the <span style="font-family: courier;">osx64x86</span> MOSEK package with its included toolbox for MATLAB. </li></ul><div>In other words, the architecture of MOSEK should <a href="https://docs.mosek.com/latest/faq/faq.html#how-to-use-toolbox-on-apple-m1-m2" target="_blank">match the architecture of the MATLAB installation</a>.</div><div><br /></div><div>The "old" way, with emulation via Rosetta, may be relevant for users of binary MATLAB packages which do not (yet) have native releases for M1/M2 but only for the Intel-based Macs. This is (currently) the case, for instance, with <a href="http://cvxr.com/cvx/" target="_blank">CVX</a>.</div><p></p>Michal Adamaszekhttp://www.blogger.com/profile/02629946505878541732noreply@blogger.comtag:blogger.com,1999:blog-7666614109674699584.post-14174683446774028432023-09-18T11:59:00.000+02:002023-09-18T11:59:35.028+02:00MIP improvements in 10.1<p> </p><p class="MsoNormal"><span lang="EN-US" style="color: black; font-size: 13.5pt; line-height: 107%; mso-ansi-language: EN-US;">In a previous blogpost we talked about
additions made to MOSEK with the release of <a href="https://www.mosek.com/downloads/">version 10.1</a>. However, as usual
with new releases improvements in the existing functionality have also been
made.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color: black; font-size: 13.5pt; line-height: 107%; mso-ansi-language: EN-US;">One area where we have improved a lot with
our latest release is with our mixed integer solver. On our internal
benchmarking set we have seen an improvement of over 30 per cent on the geometric
mean of the solution time compared to MOSEK 10.0. <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color: black; font-size: 13.5pt; line-height: 107%; mso-ansi-language: EN-US;">Does this mean you will see a 30 per cent improvement on your mixed integer problems? No, or yes or maybe… It depends!<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color: black; font-size: 13.5pt; line-height: 107%; mso-ansi-language: EN-US;">Mixed integer problems are hard,
NP-complete in fact, and in the design of the solver algorithms there are tradeoffs
to be made. These tradeoffs will make the solver good for certain problems and
less so for others. Tuning the solver will determine which problems it will perform
well on and on which it will not. <span style="mso-spacerun: yes;"> </span><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color: black; font-size: 13.5pt; line-height: 107%; mso-ansi-language: EN-US;">At MOSEK we tune our solvers based on our
internal benchmarking sets. These sets are mainly based on problems we have received
from customers, and we feel they are representative of the problems being
solved for practical applications.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color: black; font-size: 13.5pt; line-height: 107%; mso-ansi-language: EN-US;">So, does this mean you will see a 30 per
cent improvement on your mixed integer problems? No, not for certain. But it might
be worthwhile to upgrade to <a href="https://www.mosek.com/downloads/">10.1</a> and test and see! <o:p></o:p></span></p>MOSEKhttp://www.blogger.com/profile/16182492737219707955noreply@blogger.comtag:blogger.com,1999:blog-7666614109674699584.post-86357021327710880672023-09-11T11:29:00.000+02:002023-09-11T11:29:23.957+02:00Remote optimization with OptServer(Light)<p>Together with the recently released <a href="https://www.mosek.com/products/version-10/" target="_blank">MOSEK 10.1</a> we introduced OptServerLight - a light version of a remote optimization server. Let us take this opportunity to write a few words about remote optimization in MOSEK and introduce the two variants of the OptServer.</p><p>In a typical scenario the user sets up an optimization problem in MOSEK (through an API, or by reading a file), solves it, and retrieves the solution. All steps are executed in one process, on the same machine. Under remote optimization the user still sets up the problem locally (in the <i>client</i>), but the optimization itself (the call to <span style="font-family: courier;">MSK_optimize()</span>, <span style="font-family: courier;">optimize()</span>, <span style="font-family: courier;">solve()</span> or similar) is being executed on a remote machine (<i>server</i>), before the user can again retrieve the solution in the local process on the client. In practice the client submits the problem data to the server via HTTP/HTTPS, the server calls its own instance of MOSEK to solve the problem, and transmits the solution back to the client in response.</p><p>From the client's point of view the process is completely transparent. All it takes is to instruct MOSEK to contact the remote server instead of optimizing locally. Everything else - setting up the problem, retrieving the solution, printing log output - remain unchanged. Here is an illustration in Python Fusion:</p><div class="separator" style="clear: both; text-align: center;"><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0S3U0xMbPq0QRhaxkM-xVTZa-Bp84usB95Xtbu-E2B5q4R0a8N1uCfDUIpxcTLsnCs0KJjF1HlGvE_sAoCckjDQcnEBu-h608_lWVPfkP_JWNbuZTlayB_f1TafiKL34mTXMKkd-Ar3_X1kJJtKtDm2T8YzKA_xYmSP_0JximSgaTWVOwpfpuD5hwt9KI/s1056/server.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="503" data-original-width="1056" height="309" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0S3U0xMbPq0QRhaxkM-xVTZa-Bp84usB95Xtbu-E2B5q4R0a8N1uCfDUIpxcTLsnCs0KJjF1HlGvE_sAoCckjDQcnEBu-h608_lWVPfkP_JWNbuZTlayB_f1TafiKL34mTXMKkd-Ar3_X1kJJtKtDm2T8YzKA_xYmSP_0JximSgaTWVOwpfpuD5hwt9KI/w650-h309/server.png" width="650" /></a></div><br /></div>The client code is the same for local and remote optimization, except for the one line which introduces the address of the remote OptServer. This code will, in fact, work, because<span style="font-family: inherit;"> the URL points to an existing OptServer which we made available online and which can solve small problems for demonstration purposes. See <a href="https://solve.mosek.com">https://solve.mosek.com</a> for more information and downloadable code samples.</span><div><br /></div><div>Why/when use the remote OptServer?</div><div><ul style="text-align: left;"><li>One centralized computational server where all heavy computations are offloaded by clients.</li><li>The problems are too big/time consuming for weak client machines.</li><li>No need for the clients to have the MOSEK license, only the server requires a license.</li><li>Solving problems produced by a different source than a MOSEK client.</li><li>Load and user access control.</li></ul><div>We provide two flavors of the OptServer:</div><div><ul style="text-align: left;"><li>OptServerLight - a minimalistic binary. Shipped in the distribution, started directly from command line with minimal or no configuration, works out-of-the-box, available for all platforms. Keeps no state, works in-memory, suitable as a simple solver service in container pipelines. Very basic load balancing and configuration are available. Recommended as a starting point and probably sufficient for a majority of applications. See the brief <a href="https://docs.mosek.com/latest/opt-server/install-and-run.html#optserverlight" target="_blank">startup notes</a>.</li><li>The full OptServer. In addition to the solver service provides a user API, job history, authentication, API tokens, various levels of permissions, administrator/user accounts, statistics, web interface and more. Requires a more elaborate setup, including configuring a database. See <a href="https://github.com/MOSEK/Dockerfiles/tree/master/optserver-demo" target="_blank">the demo docker image</a> for a stand-alone container and <a href="https://docs.mosek.com/latest/opt-server/install-and-run.html#optserver" target="_blank">installation instructions</a>.</li></ul></div><div><br /></div></div>Michal Adamaszekhttp://www.blogger.com/profile/02629946505878541732noreply@blogger.comtag:blogger.com,1999:blog-7666614109674699584.post-62126090141848973222023-08-14T10:55:00.001+02:002023-08-16T09:29:35.594+02:00All Rustaceans can now enjoy Mosek from a fully supported official API<p style="text-align: left;"><span style="font-family: inherit;"><span style="background-color: white;"><span style="font-size: 15px; font-variant-ligatures: common-ligatures;">Rust is a fairly new programming language that is gaining momentum due to its performance and memory safety.<br /></span></span><span style="background-color: white;"><span style="font-size: 15px; font-variant-ligatures: common-ligatures;">Hence it is time to make a Rust interface available to MOSEK.</span></span></span><span aria-label="" class="c-mrkdwn__br" data-stringify-type="paragraph-break" style="box-sizing: inherit; display: block; font-size: 15px; font-variant-ligatures: common-ligatures; height: 8px;"></span><span style="font-family: inherit;"><span style="background-color: white;"><span style="font-size: 15px; font-variant-ligatures: common-ligatures;">Therefore, the recently released <a href="https://www.mosek.com/products/version-10/" target="_blank">MOSEK version 10.1</a> includes the Optimizer API for Rust that provides<br /></span></span><span style="background-color: white;"><span style="font-size: 15px; font-variant-ligatures: common-ligatures;">low-level access to all functionalities of MOSEK. It is essentially a thin interface to the native C optimizer API </span><span style="font-size: 15px; font-variant-ligatures: common-ligatures;">that has almost zero overhead.</span></span></span></p><p style="text-align: left;"><span style="font-family: inherit;"><span lang="EN-US" style="background: white; color: black; letter-spacing: -0.1pt; mso-ansi-language: EN-US; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;">Have a look at our <a href="https://docs.mosek.com/latest/rustapi/index.html" target="_blank">API guide</a> for code
snippets and instructions of how you best solve your optimization problems with Rust and
MOSEK</span><span style="background-color: white; letter-spacing: -0.1pt;">. </span></span></p><p style="text-align: left;"><span style="font-family: inherit;"><span style="background-color: white; letter-spacing: -0.1pt;">To get started download the <a href="https://crates.io/crates/MOSEK" target="_blank">MOSEK crate</a>. </span></span></p><div class="separator" style="clear: both; text-align: center;"><a href="https://www.rustaceans.org/" style="margin-left: 1em; margin-right: 1em; text-align: center;" target="_blank"><img border="0" data-original-height="307" data-original-width="460" height="105" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhN0RlyEY4R9KGlbzeFbFJ_nKJkB83OvsdRMkz6_ups9-pBZesSsRCf6GNK0NkqVgN17fWuTe0UEnYyKZmfvNTC1xaQado6flnWxYzFW9YPjXqpcVw4-tlck3xrJSI5gC50h4POXRaFe6_5DosAY4vMc6VjkH1qGtmRpf2xL1M3FRX04F5MUAPmOlcNLhpM/w157-h105/rustacean-flat-happy.png" width="157" /></a></div><p style="text-align: left;"></p><div><br /><p></p></div>MOSEKhttp://www.blogger.com/profile/16182492737219707955noreply@blogger.comtag:blogger.com,1999:blog-7666614109674699584.post-26594325517445862992023-06-19T13:53:00.000+02:002023-06-19T13:53:12.063+02:00New Portfolio Optimization Cookbook chapters and notebooks<div style="text-align: left;"><span color="rgba(0, 0, 0, 0.9)" face="-apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif" style="background-color: white; font-size: 14px;">We are happy to share that our <a href="https://www.mosek.com/resources/portfolio-optimization/" target="_blank">Portfolio Optimization Cookbook</a> has been updated and new chapters has been added. We have also added new notebooks with code examples.<br /></span><span face="-apple-system, system-ui, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Fira Sans, Ubuntu, Oxygen, Oxygen Sans, Cantarell, Droid Sans, Apple Color Emoji, Segoe UI Emoji, Segoe UI Emoji, Segoe UI Symbol, Lucida Grande, Helvetica, Arial, sans-serif"><span style="background-color: white; font-size: 14px;">The additions cover among other things:<br /><ul style="text-align: left;"><li><span style="background-color: white; font-size: 14px;">CVaR</span></li><li><span style="background-color: white; font-size: 14px;">EVaR</span></li><li><span style="background-color: white; font-size: 14px;">Gaussian mixture return model</span></li><li><span style="background-color: white; font-size: 14px;">Risk budgeting</span></li><li><span style="background-color: white; font-size: 14px;">Robust optimization</span></li><li><span color="rgba(0, 0, 0, 0.9)" face="-apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif" style="background-color: white; font-size: 14px;">Multiperiod optimization</span></li></ul></span></span><div><span style="background-color: white; font-family: Slack-Lato, Slack-Fractions, appleLogo, sans-serif; font-size: 15px; font-variant-ligatures: common-ligatures;">As usual the new concepts are implemented in Mosek Fusion for Python</span></div><div>Enjoy! </div></div>MOSEKhttp://www.blogger.com/profile/16182492737219707955noreply@blogger.comtag:blogger.com,1999:blog-7666614109674699584.post-84072428672399029532023-06-06T14:28:00.000+02:002023-06-06T14:28:07.069+02:00MOSEK 10.1 - more platforms and OptServerLightWe are delighted to announce <a href="https://www.mosek.com/products/version-10/" target="_blank">MOSEK 10.1</a> (Beta). It is a direct continuation of version 10.0 which adds support for:<div><ul style="text-align: left;"><li>Python 3.11</li><li><a href="https://docs.mosek.com/10.1/intro/remoteoptimization.html#the-optserverlight">OptServerLight</a> - a lightweight remote optimization server.</li><li>Rust and Julia Optimizer APIs as official APIs.</li><li>Native M1 Mosek Optimization Toolbox for Matlab.</li></ul><div>You can read more and find all the information, documentation and downloads on the <a href="https://www.mosek.com/products/version-10/" target="_blank">latest release page</a>.</div><div><br /></div></div>Michal Adamaszekhttp://www.blogger.com/profile/02629946505878541732noreply@blogger.comtag:blogger.com,1999:blog-7666614109674699584.post-40709018320192429312023-04-24T15:38:00.001+02:002023-04-24T15:38:55.617+02:00SIAM Conference on Optimization (OP23)<p>MOSEK is proud to be one of the sponsors of the SIAM Conference on Optimization (OP23). SIAM OP23 will be held on May 31 - June 3, 2023, at the Sheraton Grand Seattle | Seattle, Washington, U.S.</p><p>More details and registration at <a href="https://www.siam.org/conferences/cm/conference/op23"><span style="color: #ffa400;">https://www.siam.org/conferences/cm/conference/op23</span></a></p>MOSEKhttp://www.blogger.com/profile/16182492737219707955noreply@blogger.comtag:blogger.com,1999:blog-7666614109674699584.post-21864164210015511222023-03-29T14:17:00.001+02:002023-03-29T14:17:45.104+02:00Mosek and AMPL<p>We are pleased to announce that <a href="https://ampl.com/" target="_blank">AMPL Inc</a> has become a reseller of MOSEK.</p><p>Moreover, a new AMPL to MOSEK interface was made available in the <a href="https://github.com/ampl/mp" target="_blank">AMPL/MP</a> open-source library of solver interfaces.</p><p>Details can be found on the <a href="https://ampl.com/products/solvers/solvers-we-sell/mosek/" target="_blank">MOSEK for AMPL page</a>.</p>Michal Adamaszekhttp://www.blogger.com/profile/02629946505878541732noreply@blogger.comtag:blogger.com,1999:blog-7666614109674699584.post-14876385674621364362023-03-29T12:32:00.002+02:002023-03-29T12:32:30.803+02:00Easter 2023<p>Due to Easter support and sales will be closed from <b>Thursday</b>, April 6th, until <b>Monday</b>, April 10th, both days inclusive.</p><br />The MOSEK team wishes everyone a peaceful Easter.Michal Adamaszekhttp://www.blogger.com/profile/02629946505878541732noreply@blogger.comtag:blogger.com,1999:blog-7666614109674699584.post-73103445567267310052023-01-24T11:41:00.002+01:002023-01-24T11:41:48.171+01:00Mosek with AmpliconArchitect<p><a href="https://github.com/virajbdeshpande/AmpliconArchitect" target="_blank">AmpliconArchitect (AA)</a>, a Python tool for genomic reconstruction used in cancer biology is in the process of updating that will make it compatible with all versions of MOSEK.</p><p>Until recently the tool was dependent on an older MOSEK API which required the use of MOSEK 8, making the installation process a bit more cumbersome, and making AA dependent on the discontinued, less accurate general convex optimizer.</p><p>With the new updates installing MOSEK for use with AA will be as simple as <span style="font-family: courier;">"pip install mosek" </span><span style="font-family: inherit;">and one gets easy access to MOSEK upgrades the same way. AA will use MOSEK to solve its optimization tasks with the more accurate, faster conic solver.</span></p><p><span style="font-family: inherit;">We would like to thank <a href="https://github.com/jluebeck" target="_blank">Jens Luebeck</a> for guidance and help with the installation, running and testing the new software.</span></p><p>For the time being you can try this new version via <a href="https://github.com/jluebeck/AmpliconArchitect" target="_blank">Jens' fork of AmpliconArchitect</a>, where the readme file also provides all the necessary details. As always you can get a MOSEK personal academic license for academic use of AA via <a href="https://www.mosek.com/products/academic-licenses/" target="_blank">our website</a>.</p>Michal Adamaszekhttp://www.blogger.com/profile/02629946505878541732noreply@blogger.comtag:blogger.com,1999:blog-7666614109674699584.post-36714044941301472522022-12-15T13:37:00.001+01:002022-12-16T08:43:11.365+01:00Design a heart with DJC<p>In connection with the approaching Christmas, we are receiving many support questions about the use of mixed-integer conic optimization in the design of the traditional Danish "braided heart" Christmas tree decorations:</p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTLm_bokmo6WJPFIkPR5gv3TqNBVGhv5QvhhFTtQ9eqP9PLSz8v8Xmpas0XsDjZDmnFyxwOVUX_2hBtG11krBgw7JGndzZbyvApp0Jql7iA5eDTKnIIe-E-gcWeIwL84et8ISvW8BjZLWr6RbJRsBo223eEyDEBFKEufSNnE_J_r6qKdG7kPUbgqn60A/s2048/heart.jpeg" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="2048" data-original-width="1152" height="206" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTLm_bokmo6WJPFIkPR5gv3TqNBVGhv5QvhhFTtQ9eqP9PLSz8v8Xmpas0XsDjZDmnFyxwOVUX_2hBtG11krBgw7JGndzZbyvApp0Jql7iA5eDTKnIIe-E-gcWeIwL84et8ISvW8BjZLWr6RbJRsBo223eEyDEBFKEufSNnE_J_r6qKdG7kPUbgqn60A/w116-h206/heart.jpeg" width="116" /></a></div><div><br /></div>Let us demonstrate how this can be done with MOSEK. First, we need to define the heart. A suitable model is given by<div>$$x^2+(y-p|x|)^2\leq r^2,$$</div><div>where $p,r$ are parameters which can be adjusted for different shapes and sizes:</div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCkUYR95iQEuPjhWasN_qwmZD11wt3_THUZzjHaCU5bgVYGkBCWyM86H-qHZdlfFSyvIwRS9Dn19HntMv2MlS2B3OmnrHPT5XKf0Qitr2ESevXmL8i-ic8kLmozGwKLIxw5flqM72ZT3UzxL3cM40LVIBLJq9O4FyDnpmRqnh5W0cx33TcyhEFCIQf1Q/s1920/h.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="480" data-original-width="1920" height="162" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCkUYR95iQEuPjhWasN_qwmZD11wt3_THUZzjHaCU5bgVYGkBCWyM86H-qHZdlfFSyvIwRS9Dn19HntMv2MlS2B3OmnrHPT5XKf0Qitr2ESevXmL8i-ic8kLmozGwKLIxw5flqM72ZT3UzxL3cM40LVIBLJq9O4FyDnpmRqnh5W0cx33TcyhEFCIQf1Q/w648-h162/h.png" width="648" /></a></div>This is not a convex shape, but it can still be modelled in conic form if we employ a mixed-integer model of $|x|$. This can be done using a <a href="https://docs.mosek.com/modeling-cookbook/mio.html#exact-absolute-value" target="_blank">classical big-M approach</a> or, in MOSEK 10, using a <a href="https://docs.mosek.com/latest/pythonfusion/tutorial-djc-fusion.html#doc-tutorial-djc" target="_blank">disjunctive constraint (DJC)</a>:<div>$$\begin{array}{l}(x\geq 0 \ \mathrm{AND}\ z=x)\ \mathrm{OR}\ (x\leq 0 \ \mathrm{AND}\ z=-x) \\ x^2+(y-pz)^2\leq r^2\end{array},$$</div><div>combining a DJC with a quadratic cone constraint in <a href="https://docs.mosek.com/latest/pythonapi/tutorial-acc-optimizer.html" target="_blank">affine conic (ACC) form</a>.</div><div><br /></div><div>Having defined the domain, it is time to draw some lines with slope $\pm 45^\circ$ to determine the braided pattern. To do this, we will choose, one at a time, line segments with integer endpoints, say $x=(x_1,x_2)$, $y=(y_1,y_2)$, inside the heart. Such a line segment has the correct slope if</div><div>$$x_1-x_2=y_1-y_2\ \mathrm{OR}\ x_1+x_2=y_1+y_2,$$</div><div>which, again, is a disjunctive constraint. We will only choose sufficiently long line segments, for example by requiring</div><div>$$|x_1-y_1|\geq c$$</div><div>for some constant $c$. Here the absolute value can again be modelled in the same mixed-integer fashion as before. We set no objective, so this becomes a feasibility problem, but one could also decide, for instance, to maximize the length of the segment or optimize some other measure of beauty for the design.</div><div><br /></div><div>Having found one segment, we will construct a new one by adding additional constraints to guarantee that the new segments do not interfere too much with the previous ones. For the sake of simplicity, we will demand that new endpoints do not belong to any line of slope $\pm 45^\circ$ containing the previous endpoints, but one could consider other elimination conditions as well. This iterative procedure is similar to <a href="https://docs.mosek.com/latest/pythonfusion/case-studies-tsp.html#doc-fusion-case-studies-tsp" target="_blank">solving the travelling salesman problem by cycle elimination</a>, and it terminates once there is no more place for new segments under all the constraints. The implementation requires us to be able to write the "not equals" condition $x\neq a$, which, assuming we work with integers, can again be cast as a DJC:</div><div>$$x\leq a-1 \ \mathrm{OR}\ x\geq a+1.$$</div><div>The iterative procedure will construct more and more segments:</div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4W2ypcbbMn12jLac3j-rPZvJZKc-3KtPN7N7eHKlXUCu7iGB72-8k0dyNTBAHwvrVkQGOTFrQvH7_R0jLs6WIbKo4odAIj0eUoYeRAxiWTxo2HDat19EelVK-KANbPuAhoTTUImHtD_pkgR22tZf5ZmR4WxDRInYQ8eISPg7Q4W2rDNLs4fIiRsKL5Q/s2560/p.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="480" data-original-width="2560" height="123" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4W2ypcbbMn12jLac3j-rPZvJZKc-3KtPN7N7eHKlXUCu7iGB72-8k0dyNTBAHwvrVkQGOTFrQvH7_R0jLs6WIbKo4odAIj0eUoYeRAxiWTxo2HDat19EelVK-KANbPuAhoTTUImHtD_pkgR22tZf5ZmR4WxDRInYQ8eISPg7Q4W2rDNLs4fIiRsKL5Q/w656-h123/p.png" width="656" /></a></div>To obtain different designs, we can vary the parameters $p,r$. Still, there is enough freedom in the choice of segments that even just varying the random seed (<span style="font-family: courier;">"mioSeed"</span>) for the mixed-integer optimizer produces different final solutions for the same choice of $p,r$:<div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiB9qQjtxMPqcGL6JztNaquP6wfM9VJdYZJUaB5Z-Kb73nzwMxTIwXMrl65nFwdqSIlLNxRd7cxA49eK9QmHieZwIiQaafARvkKgKa5rchlGQLkA3p63iAiFIBAmUKPeITAiDWZtgv4wq9eS0IMFq-gp0YfLQZX_5Z-Lz-yh8vs1psKmRewfq7fgpjbpw/s1280/x.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="960" data-original-width="1280" height="404" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiB9qQjtxMPqcGL6JztNaquP6wfM9VJdYZJUaB5Z-Kb73nzwMxTIwXMrl65nFwdqSIlLNxRd7cxA49eK9QmHieZwIiQaafARvkKgKa5rchlGQLkA3p63iAiFIBAmUKPeITAiDWZtgv4wq9eS0IMFq-gp0YfLQZX_5Z-Lz-yh8vs1psKmRewfq7fgpjbpw/w538-h404/x.png" width="538" /></a></div>And on this note, we leave you with the <a href="https://docs.mosek.com/latest/pythonfusion/design.html" target="_blank">Fusion API</a> code below and wish you all the best. (You can also read our last Christmas special from way back in <a href="https://themosekblog.blogspot.com/2018/12/christmas-tree-denoising-via-sdp.html" target="_blank">2018</a>).<br /><div class="separator" style="clear: both; text-align: center;"><br /></div>MOSEK Team<br /><div><br /></div><script src="https://gist.github.com/aszekMosek/7651abec35a2c63d1a863b5b62960527.js"></script><div><br /></div><div><br /></div><div><br /></div><div><br /><div><br /></div></div></div>Michal Adamaszekhttp://www.blogger.com/profile/02629946505878541732noreply@blogger.comtag:blogger.com,1999:blog-7666614109674699584.post-35162909209296230302022-12-12T12:52:00.003+01:002022-12-12T12:52:25.077+01:00Christmas 2022<p>During the Christmas period our sales and support will be closed 23-27 December 2022, inclusive. </p><p><br /></p><p>The MOSEK Team</p>Michal Adamaszekhttp://www.blogger.com/profile/02629946505878541732noreply@blogger.com