📄 faq.htm
字号:
more efficient and general solver. Future versions of YALMIP may resolve
this issue. Constraints defined using the <a href="kyp.htm">KYP</a> operator
is efficiently handled in some cases already.</p>
</td>
</tr>
</table>
<p style="margin-bottom: 0; margin-top:0"> </p>
<table border="0" cellpadding="0" style="border-collapse: collapse" width="100%">
<tr>
<td width="26" valign="top">
<p style="margin-bottom: 0; margin-top:0"><b><font color="#0000FF">
<a name="cddhangs"></a>Q:</font></b></td>
<td>
<p style="margin-bottom: 0; margin-top:0"><b><a href="solvers.htm#penbmi">
CDD</a> hangs</b></td>
</tr>
<tr>
<td width="26" valign="top">
<p style="margin-bottom: 0; margin-top:0"><font color="#0000FF"><b>A</b></font><b><font color="#0000FF">:</font></b></td>
<td>
<p style="margin-bottom: 0; margin-top:0">Try
<code>sdpsettings('cdd.method','dual-simplex')</code></p>
</td>
</tr>
</table>
<p style="margin-bottom: 0; margin-top:0"> </p>
<table border="0" cellpadding="0" style="border-collapse: collapse" width="100%" id="table2">
<tr>
<td width="26" valign="top">
<p style="margin-bottom: 0; margin-top:0"><b><font color="#0000FF">
<a name="fminconcrashes"></a>Q:</font></b></td>
<td>
<p style="margin-bottom: 0; margin-top:0"><b><a href="solvers.htm#fmincon">
fmincon</a> crashes</b></td>
</tr>
<tr>
<td width="26" valign="top">
<p style="margin-bottom: 0; margin-top:0"><font color="#0000FF"><b>A</b></font><b><font color="#0000FF">:</font></b></td>
<td>
<p style="margin-bottom: 0; margin-top:0">Do you have <a href="solvers.htm#mosek">MOSEK</a>
installed? This can cause problems due to an inconsistency between MATLABs
and <a href="solvers.htm#mosek">MOSEKs</a> implementation of the file
optimget.m. Remove <a href="solvers.htm#mosek">MOSEK</a>
from your path.</p>
</td>
</tr>
</table>
<p style="margin-bottom: 0; margin-top:0"> </p>
<table border="0" cellpadding="0" style="border-collapse: collapse" width="100%" id="table4">
<tr>
<td width="26" valign="top">
<p style="margin-bottom: 0; margin-top:0"><b><font color="#0000FF">
<a name="maxdetcrashes"></a>Q:</font></b></td>
<td>
<p style="margin-bottom: 0; margin-top:0"><b><a href="solvers.htm#maxdet">
MAXDET</a> fails</b></td>
</tr>
<tr>
<td width="26" valign="top">
<p style="margin-bottom: 0; margin-top:0"><font color="#0000FF"><b>A</b></font><b><font color="#0000FF">:</font></b></td>
<td>
<p style="margin-bottom: 0; margin-top:0"><a href="solvers.htm#maxdet">
MAXDET</a> seems to be sensitive to unbounded feasible regions and
unconstrained variables. Try to add redundant bound constraints on all your
variables.</p>
</td>
</tr>
</table>
<p style="margin-bottom: 0; margin-top:0"> </p>
<table border="0" cellpadding="0" style="border-collapse: collapse" width="100%">
<tr>
<td width="26" valign="top">
<p style="margin-bottom: 0; margin-top:0"><b><font color="#0000FF">
<a name="xpress"></a>Q:</font></b></td>
<td>
<p style="margin-bottom: 0; margin-top:0"><b><a href="solvers.htm#xpress">
XPRESS</a> performs badly, claims infeasibility etc.</a></b></td>
</tr>
<tr>
<td width="26" valign="top">
<p style="margin-bottom: 0; margin-top:0"><font color="#0000FF"><b>A</b></font><b><font color="#0000FF">:</font></b></td>
<td>
<p style="margin-bottom: 0; margin-top:0">Adding bounds on the involved
variables solves this issue in many cases.</p>
</td>
</tr>
</table>
<p style="margin-bottom: 0; margin-top:0"> </p>
<table border="0" cellpadding="0" style="border-collapse: collapse" width="100%">
<tr>
<td width="26" valign="top">
<p style="margin-bottom: 0; margin-top:0"><b><font color="#0000FF">
<a name="selectsolver"></a>Q:</font></b></td>
<td>
<p style="margin-bottom: 0; margin-top:0"><b>There are so many solvers, which
one should I use?</b></td>
</tr>
<tr>
<td width="26" valign="top">
<p style="margin-bottom: 0; margin-top:0"><font color="#0000FF"><b>A</b></font><b><font color="#0000FF">:</font></b></td>
<td>
<p style="margin-bottom: 0; margin-top:0"> <a href="solvers.htm#sedumi">SeDuMi</a>
and
<a href="solvers.htm#sdpt3">SDPT3</a> are good general purpose SDP
solvers (not necessarily the
best solvers though), efficient also on LP and SOCP problems and reasonably
efficient on small QP problems. Hans D. Mittelmanns
<a target="_blank" href="http://www.optimization-online.org/DB_HTML/2001/07/358.html">benchmark</a> might be helpful.
If you mainly solve LPs, make sure to try the free solvers
<a href="solvers.htm#glpk">GLPK</a>,
<a href="solvers.htm#qsopt">QSOPT</a>,
<a href="solvers.htm#clp">CLP</a> and
<a href="solvers.htm#cdd">CDD</a></td>
</tr>
</table>
<p style="margin-top: 0; margin-bottom: 0"> </p>
<table border="0" cellpadding="0" style="border-collapse: collapse" width="100%">
<tr>
<td width="26" valign="top">
<p style="margin-bottom: 0; margin-top:0"><b><font color="#0000FF">
<a name="infeasible"></a>Q:</font></b></td>
<td>
<p style="margin-bottom: 0; margin-top:0"><b>The solution I get in an SDP is not
feasible but has eigenvalues around, say, -1e-6.</b></td>
</tr>
<tr>
<td width="26" valign="top">
<p style="margin-bottom: 0; margin-top:0"><font color="#0000FF"><b>A</b></font><b><font color="#0000FF">:</font></b></td>
<td>
<p style="margin-bottom: 0; margin-top:0">Most solvers actually use
infeasible/exterior algorithms, so slightly infeasible
solutions are common.</p>
</td>
</tr>
</table>
<p style="margin-top: 0; margin-bottom: 0"> </p>
<table border="0" cellpadding="0" style="border-collapse: collapse" width="100%">
<tr>
<td width="26" valign="top">
<p style="margin-bottom: 0; margin-top:0"><b><font color="#0000FF">
<a name="bmi"></a>Q:</font></b></td>
<td>
<p style="margin-bottom: 0; margin-top:0"><b>Can I solve BMIs without
<a href="solvers.htm#penbmi">PENBMI</a>?</b></td>
</tr>
<tr>
<td width="26" valign="top">
<p style="margin-bottom: 0; margin-top:0"><font color="#0000FF"><b>A</b></font><b><font color="#0000FF">:</font></b></td>
<td>
<p style="margin-bottom: 0; margin-top:0">The BMI-examples in
<a href="reference.htm#yalmipdemo">yalmipdemo</a> show some alternative
ways to code your own solver rather easily, but for performance and
robustness,
<a href="solvers.htm#penbmi">PENBMI</a> is highly recommended.</p>
</td>
</tr>
</table>
<p style="margin-bottom: 0; margin-top:0"> </p>
<hr noShade SIZE="1" color="#FF0000">
<p style="margin-top: 0; margin-bottom: 0"> </p>
<table border="0" cellpadding="0" style="border-collapse: collapse" width="100%">
<tr>
<td width="26" valign="top">
<p style="margin-bottom: 0; margin-top:0"><b><font color="#0000FF">
<a name="typical"></a>Q:</font></b></td>
<td>
<p style="margin-bottom: 0; margin-top:0"><b>My solution is not what I
expected.</b></td>
</tr>
<tr>
<td width="26" valign="top">
<p style="margin-bottom: 0; margin-top:0"><font color="#0000FF"><b>A</b></font><b><font color="#0000FF">:</font></b></td>
<td>
<p style="margin-bottom: 0; margin-top:0">Is your problem what you expected?
Use the command checkset to see that you actually have the constraints that
you meant to declare (does it say matrix inequality or element-wise
inequality etc). </p>
<p style="margin-bottom: 0; margin-top:0"> </p>
<p style="margin-bottom: 0; margin-top:0">Are your variables really what you
meant to declare (display them to see if they are symmetric, Hermitian,
full, etc.). </p>
<p style="margin-bottom: 0; margin-top:0"> </p>
<p style="margin-bottom: 0; margin-top:0">Most common error is that you have
declared a square matrix but accidentally forgotten to declare it as full
and obtained a symmetric matrix instead (square matrices are full by
default!)</p></td>
</tr>
</table>
<p style="margin-top: 0; margin-bottom: 0"> </p>
<table border="0" cellpadding="0" style="border-collapse: collapse" width="100%" id="table15">
<tr>
<td width="26" valign="top">
<p style="margin-bottom: 0; margin-top:0"><b><font color="#0000FF">
<a name="typeset"></a>Q:</font></b></td>
<td>
<p style="margin-bottom: 0; margin-top:0"><b>Typing <code>help set</code> gives
me no information on the YALMIP function <code>set</code>.</b></td>
</tr>
<tr>
<td width="26" valign="top">
<p style="margin-bottom: 0; margin-top:0"><font color="#0000FF"><b>A</b></font><b><font color="#0000FF">:</font></b></td>
<td>
<p style="margin-bottom: 0; margin-top:0">Yep, a bit tricky since <code>set</code> also is a built-in
function. Type <code>help sdpvar/set</code> and you will find what you are
looking for.</p></td>
</tr>
</table>
<p style="margin-top: 0; margin-bottom: 0"> </p>
<table border="0" cellpadding="0" style="border-collapse: collapse" width="100%">
<tr>
<td width="26" valign="top">
<p style="margin-bottom: 0; margin-top:0"><b><font color="#0000FF">
<a name="setclass"></a>Q:</font></b></td>
<td>
<p style="margin-bottom: 0; margin-top:0"><b>Is there really a <code>set</code> class?</b></td>
</tr>
<tr>
<td width="26" valign="top">
<p style="margin-bottom: 0; margin-top:0"><font color="#0000FF"><b>A</b></font><b><font color="#0000FF">:</font></b></td>
<td>
<p style="margin-bottom: 0; margin-top:0">No...<code>set</code> is only a wrapper to
call the old class <code>lmi</code>. To much work to re-write all code
just for a name change.</p>
</td>
</tr>
</table>
<p style="margin-bottom: 0; margin-top:0"> </p>
<table border="0" cellpadding="0" style="border-collapse: collapse" width="100%">
<tr>
<td width="26" valign="top">
<p style="margin-bottom: 0; margin-top:0"><b><font color="#0000FF">
<a name="normalset"></a>Q:</font></b></td>
<td>
<p style="margin-bottom: 0; margin-top:0"><b>Is <code>set</code> related to
the "normal" set command in MATLAB</b></td>
</tr>
<tr>
<td width="26" valign="top">
<p style="margin-bottom: 0; margin-top:0"><font color="#0000FF"><b>A</b></font><b><font color="#0000FF">:</font></b></td>
<td>
<p style="margin-bottom: 0; margin-top:0">No... The name <code>set</code>
was selected since it is short. An alternative would be to define
constraints, or feasible sets, using a command named, e.g., <code>
constraint</code>. However, my keyboard typing speed is too slow to
allow for such a long command name. In my opinion, the name <code>set</code>
is at-least better than the old name <code>lmi</code>.</p>
</td>
</tr>
</table>
<p style="margin-bottom: 0; margin-top:0"> </p>
<table border="0" cellpadding="0" style="border-collapse: collapse" width="100%">
<tr>
<td width="26" valign="top">
<p style="margin-bottom: 0; margin-top:0"><b><font color="#0000FF">
<a name="lmielement"></a>Q:</font></b></td>
<td>
<p style="margin-bottom: 0; margin-top:0"><b>I define a
semidefinite constraint, but YALMIP declares it "element-wise".</b></td>
</tr>
<tr>
<td width="26" valign="top">
<p style="margin-bottom: 0; margin-top:0"><font color="#0000FF"><b>A</b></font><b><font color="#0000FF">:</font></b></td>
<td>
<p style="margin-bottom: 0; margin-top:0">YALMIP detects semidefinite
constraints by checking symmetry. In some cases (working with very
ill-conditioned data), numerical problems may lead to a small violation
of symmetry in MATLAB, and YALMIP will declare the constraint as
element-wise. To solve this problem, just symmetrize your variable
first.</p>
</td>
</tr>
</table>
<p style="margin-bottom: 0; margin-top:0"> </p>
<table border="0" cellpadding="0" style="border-collapse: collapse" width="100%">
<tr>
<td width="26" valign="top">
<p style="margin-bottom: 0; margin-top:0"><b><font color="#0000FF">
<a name="reallystrict"></a>Q:</font></b></td>
<td>
<p style="margin-bottom: 0; margin-top:0"><b>Are inequalities really
strict?</b></td>
</tr>
<tr>
<td width="26" valign="top">
<p style="margin-bottom: 0; margin-top:0"><font color="#0000FF"><b>A</b></font><b><font color="#0000FF">:</font></b></td>
<td>
<p style="margin-bottom: 0; margin-top:0">By default, strict (<,>) and
non-strict (<=,>=) inequalities are treated in the same way in YALMIP,
and the result depends on the solver. However, by using the field <code>
shift</code> in <a href="reference.htm#sdpsettings">sdpsetttings</a>,
inequalities defined using < and > will be treated slightly different.
YALMIP will add a small perturbation to these inequalities to
increase the likelihood of a strictly feasible solution. Warning : If you
have an integer variable, and add a constraint <code>set(x<2)</code>, this will not be interpreted as <code>set(x<=1)</code>
. To avoid confusion, use <code>set(x<=1)</code>. The same holds for rank constraints <code>set(rank(x)<2)<n)</code>.</code></td>
</tr>
</table>
<p style="margin-bottom: 0; margin-top:0"> </p>
<table border="0" cellpadding="0" style="border-collapse: collapse" width="100%" id="table5">
<tr>
<td width="26" valign="top">
<p style="margin-bottom: 0; margin-top:0"><b><font color="#0000FF">
<a name="gevp"></a>Q:</font></b></td>
<td>
<p style="margin-bottom: 0; margin-top:0"><b>How do I solve generalized
eigenvalue problems (like <code>gevp</code> in <a href="solvers.htm#lmilab">LMILAB</a>)?</b></td>
</tr>
<tr>
<td width="26" valign="top">
<p style="margin-bottom: 0; margin-top:0"><font color="#0000FF"><b>A</b></font><b><font color="#0000FF">:</font></b></td>
<td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -