Frequently asked question
Installation
Solvers
YALMIP
Known bugs
Other
Q: |
I have been using a previous version
of YALMIP, but after installing the new version nothing works. |
A: |
Restart MATLAB. |
Q: |
..still doesn't work! |
A: |
Remove any old version of
YALMIP before you install the new version. Do not just copy the new
version into the old YALMIP directory. |
Q: |
..still doesn't work! |
A: |
Added all the paths? (/yalmip,
/yalmip/extras, /yalmip/demos, /yalmip/solvers) |
Q: |
..still doesn't work! |
A: |
Did your unzip application
really decompress the files to the path structure, instead of placing
all files in one directory. |
Q: |
..still doesn't work! |
A: |
Are you sure you added all the paths! (/yalmip,
/yalmip/extras, /yalmip/demos, /yalmip/solvers) |
Q: |
..still doesn't work! |
A: |
Could be related to toolbox
path caching (open menu File/Preferences/General and run "Update Toolbox
Path Cache") |
Q: |
..still doesn't work! |
A: |
Removed your old YALMIP
version from the MATLAB path? |
Q: |
..still doesn't work! |
A: |
Added all the paths to your solver? |
Q: |
...still doesn't work! |
A: |
Do you have any solver
installed?
|
Q: |
...still doesn't work! |
A: |
Compiled the solver (if needed)?
Compiled it for the correct MATLAB version?
|
Q: |
...still doesn't work! |
A: |
Using MATLAB 5.3.1 or later?
|
Q: |
...still doesn't work! |
A: |
Probably a PICNIC problem ;-P
|
Q: |
It is so slow! |
A: |
As a rule of thumb, the time
reported as 'yalmiptime' in the output diagnostic should be around fractions
of a second for small problems, and typically a fraction of the actual
solution time for larger problems. If this is not the case, you probably
have a problem with your installation.
As another rule of thumb, yalmiptest(sdpsettings('verbose',0,'solver','sedumi'))
takes 2-5 seconds (including initial search for solvers) on my PC machines
(2GHz and 3GHz).
Do you have FEMLAB on your MATLAB
path? Removing FEMLAB from the path can improve performance significantly.
Another way to make YALMIP faster is to set the field cachesolvers
in sdpsettings to 1. (One reason for the
extremely poor performance of YALMIP in these cases is typically due to slow
network functionalities, making the command exist , which is
used in solvesdp when detecting solvers, very slow.
Are you running over a network?
This can be extremely detrimental for general performance in YALMIP. On some
networked Linux version, YALMIP runs 10-100 times slower!
Do you have a poor sparse matrix
library in your installation? Some distributions seem to have extremely poor
performance for sparse matrices (observed on Linux), which is used a lot in YALMIP. One
way to test this is to run the script below. If the displayed result is
substantially larger than 20, you have problems (and I have no idea how you
can resolve this...)
d = sprandn(1e5,1,0.5);
tic;for i= 1:1000;d([2000:3000]);end;t1 = toc;
d = d';
tic;for i= 1:1000;d([2000:3000]);end;t2 = toc;t1/t2
Do
you have MOSEK installed? This solver overloads
the function optimset in Mathworks optimization toolbox, but is much slower. optimset is called in sdpsettings
to initialize the option fields for LINPROG and
QUADPROG. Note that
sdpsettings is called in solvesdp
if no options structure is passed in the call. Hence, for optimal speed,
define the options structure once, and always use three arguments when
calling solvesdp. This is recommended even if you do
not have MOSEK.
Are you working with nonlinear
expressions? In that case, clear the internals of YALMIP regularly using
yalmip('clear') .
Are you working with large
polynomial
expressions? Try to compile the file findhash.c (mex findhash.c )
Have you formulated a standard
primal SDP form problem and expected YALMIP to solve it that way? Make sure
to read the section on dualization.
Finally, standard MATLAB coding
practice applies. This means that you should try to vectorize code, define
things once etc.
|
Q: |
YALMIP cannot find any
solver. |
A: |
Do you have any solver? You typically
need to install a (or several) solver and update you path. See
interfaced solver.
|
Q: |
PENBMI does not work with
YALMIP anymore. |
A: |
Version 1.1 and earlier will not
work directly anymore. However, this is easily fixed. Edit the file
callpenbmim.m (if you use the
PENOPT version) or
callpenbmi.m (if you use the TOMLAB
version). Uncomment the code below the comment "UNCOMMENT THIS".
|
Q: |
SDPT3-3.02 does not work with
YALMIP anymore. |
A: |
Download SDPT3-3.02 and compile (code
updated without version increment)
|
Q: |
My version of
SDPT3-3.02 does not work and complains about
the file svec . |
A: |
Do you have the solver SDPPACK
installed? Remove the path to this solver.
|
Q: |
SDPT3 (or
SeDuMi) does not work. |
A: |
Make sure not to have both SDPT3
(version 3.02) and
SeDuMi on the MATLAB path. This problem is
resolved in SDPT3 3.1
|
Q: |
CSDP does not work. |
A: |
Do you have CSDP in your system path?
|
Q: |
CSDP
runs but crashes. |
A: |
Running MATLAB 6.1 and CSDP
4.6? In that case, edit readsol.m in the CSDP
directory and replace all occurrences of && with &. Even better,
download the latest version of CSDP.
|
Q: |
I already have
LMILAB and LINPROG
installed, do I need any other solver? |
A: |
Yes, at-least if you intend to
solve anything but a few small problems. See next issue.
|
Q: |
LMILAB
is slower when I use it with YALMIP |
A: |
Yes. YALMIP, and all other
supported solvers, works with a completely general SDP formulation in
contrast to LMILAB that requires the
problem structure to be explicitely described by the user for speed (in
particular for control related problems). Rule of
thumb : Do not use LMILAB with YALMIP. If you
have made the effort to download YALMIP, take 5 more minutes and install a
more efficient and general solver. Future versions of YALMIP may resolve
this issue. Constraints defined using the KYP operator
is efficiently handled in some cases already.
|
Q: |
CDD hangs |
A: |
Try
sdpsettings('cdd.method','dual-simplex')
|
Q: |
fmincon crashes |
A: |
Do you have MOSEK
installed? This can cause problems due to an inconsistency between MATLABs
and MOSEKs implementation of the file
optimget.m. Remove MOSEK
from your path.
|
Q: |
MAXDET fails |
A: |
MAXDET seems to be sensitive to unbounded feasible regions and
unconstrained variables. Try to add redundant bound constraints on all your
variables.
|
Q: |
XPRESS performs badly, claims infeasibility etc. |
A: |
Adding bounds on the involved
variables solves this issue in many cases.
|
Q: |
There are so many solvers, which
one should I use? |
A: |
SeDuMi
and
SDPT3 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
benchmark might be helpful.
If you mainly solve LPs, make sure to try the free solvers
GLPK,
QSOPT,
CLP and
CDD |
Q: |
The solution I get in an SDP is not
feasible but has eigenvalues around, say, -1e-6. |
A: |
Most solvers actually use
infeasible/exterior algorithms, so slightly infeasible
solutions are common.
|
Q: |
Can I solve BMIs without
PENBMI? |
A: |
The BMI-examples in
yalmipdemo show some alternative
ways to code your own solver rather easily, but for performance and
robustness,
PENBMI is highly recommended.
|
Q: |
My solution is not what I
expected. |
A: |
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).
Are your variables really what you
meant to declare (display them to see if they are symmetric, Hermitian,
full, etc.).
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!) |
Q: |
Typing help set gives
me no information on the YALMIP function set . |
A: |
Yep, a bit tricky since set also is a built-in
function. Type help sdpvar/set and you will find what you are
looking for. |
Q: |
Is there really a set class? |
A: |
No...set is only a wrapper to
call the old class lmi . To much work to re-write all code
just for a name change.
|
Q: |
Is set related to
the "normal" set command in MATLAB |
A: |
No... The name set
was selected since it is short. An alternative would be to define
constraints, or feasible sets, using a command named, e.g.,
constraint . However, my keyboard typing speed is too slow to
allow for such a long command name. In my opinion, the name set
is at-least better than the old name lmi .
|
Q: |
I define a
semidefinite constraint, but YALMIP declares it "element-wise". |
A: |
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.
|
Q: |
Are inequalities really
strict? |
A: |
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
shift in sdpsetttings,
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 set(x<2) , this will not be interpreted as set(x<=1)
. To avoid confusion, use set(x<=1) . The same holds for rank constraints set(rank(x)<2). |
Q: |
How do I solve generalized
eigenvalue problems (like gevp in LMILAB)? |
A: |
Two options. The first one is to code your own
script based on a simple bisection. This is illustrated in
the example decayex.m . An alternative is to install the BMI solver
PENBMI. This solver solves GEVP problems
globally.
|
Q: |
I get strange
results when I use the option 'removeequalities' |
A: |
When equality constraints are
removed by YALMIP by deriving a reduced basis ('removeequalities' set to 1 or 2) dual variables will not be recovered. This may
lead to further complications in some cases. If you are solving a problem
that you have derived by using the function dualize, you original variables
will not be computed, since they are computed from the missing duals.
Another case is when you solve a linearly parameterized sum of squares problem using
a kernel model ('sos.model' set to 0 or 1). The
parameterization variables are computed from the dual variables, hence failure will
occur. To summarize, do not use the option 'removeequalities' in sum-of-squares
problems or dualized problems, unless you really now what you are doing.
|
Q: |
YALMIP complains about
failing in convexity propagation |
A: |
This means that you have used so
called nonlinear operators to model your
problem, and most likely you have defined a problem which cannot be
represented using standard convex constraints. If you know that your model
is convex, try to model the nonlinear terms by hand to see if you actually are
correct (the convexity analysis is conservative, although in most cases
failure in the convexity propagation is due to actual nonconvexity.
|
Q: |
I have problems solving a
geometric program. |
A: |
To begin with, you need a solver
that can solve geometric programs (YALMIP currently supports
GPPOSY,
Mosek and
fmincon). If you still have problems, the reason may be that YALMIP
converts convex quadratic constraints to seconds order constraints. This
should not be done in geometric programs (it is a known bug). To avoid this,
set the option 'convertconvexquad' to
0. Another reason is that runs into problem during the expansion of
nonlinear operators. To avoid this issue, explicitly
tell YALMIP that the
problem is a geometric problem by specifying the solver to 'gpposy' , 'mosek-geometric'
or 'fmincon-geometric' .
|
Q: |
I can not write X =
eye(2); X(1,1)=sdpvar(1,1) ! |
A: |
This is because of the way the
object orientation works in MATLAB. There is currently no way to support
this feature (without overloading the @double class, which can cause
instability.)
|
Q: |
Vector-valued quadratic constraints |
A: |
If you have vector-valued
quadratic constraints with mixed convexity and concavity, things may
fail. To avoid problems, use the options sdpsettings('convertconvexquad',0) ,
or simply do not use a vectorized constraint. Turning off the automatic
conversion of convex quadratic constraints to second order cones is
typically recommended if you know that you will not solve the problem using a
semidefinite solver. |
Q: |
Using implies on set objects |
A: |
Using the logical constraint
implies with the first argument being a constraint is currently causing problems in some cases,
and should thus be avoided. |
Q: |
Sometimes MATLAB fails to
declare an SDPVAR object named i or j inside a function |
A: |
This is one of the weirdest
bugs in MATLAB I have come across. If you define your own class (such as
SDPVAR) and use the constructor inside of a function body and assign the
name i or j to the object, MATLAB fails to perform the definition, and i
or j remains to point to the imaginary number. The bug has been reported
and been acknowledged by The Mathworks. If you stumble upon this problem
(very rare), just change the variable name. |
Q: |
I have found a bug. What to do? |
A: |
Send a mail to
loefberg@control.ee.ethz.ch. Type ver in MATLAB and include
the result in the mail. If possible, include the code (as simple as
possible) that generated the fault, otherwise, include at-least the error
message etc. The more information the better.
|
Q: |
I have an idea for a new feature.
What to do? |
A: |
Send a mail to
loefberg@control.ee.ethz.ch. However, I only add new features when I
need them my self, but if your idea is good enough, I might realize that I
need it! |
Q: |
What does YALMIP mean? |
A: |
Used to be short for Yet
Another LMI Parser. However, since YALMIP is much more than a LMI parser
now, it does not mean anything.
|
|