forked from yalmip/YALMIP
-
Notifications
You must be signed in to change notification settings - Fork 2
/
yalmipdemo.m
139 lines (109 loc) · 3.62 KB
/
yalmipdemo.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
%YALMIPDEMO Brief tutorial and examples.
%
% See also YALMIPTEST
disp('The examples here are obsolete.')
disp(sprintf('Please check out the <a href="http://users.isy.liu.se/johanl/yalmip/pmwiki.php?n=Tutorials.Tutorials">on-line tutorials</a> on the YALMIP Wiki instead'));
return
% Check for paths
if ~(exist('socpex')==2)
disp('You have to set the path to the demo library (...\yalmip\demos\)')
return;
end
i = 1;
problems{i}.class = 0;
problems{i}.info = 'Getting started, the basics';
problems{i}.call = 'basicsex';i = i+1;
problems{i}.class = 1;
problems{i}.info = 'Linear and quadratic programming';
problems{i}.call = 'regressex';i = i+1;
problems{i}.class = 1;
problems{i}.info = 'Second order cone programming';
problems{i}.call = 'socpex';i = i+1;
problems{i}.class = 2;
problems{i}.info = 'Lyapunov stability (SDP)';
problems{i}.call = 'stabilityex';i = i+1;
problems{i}.class = 0;
problems{i}.info = 'Model predictive control (LP,QP,SDP)';
problems{i}.call = 'mpcex';i = i+1;
problems{i}.class = 2;
problems{i}.info = 'Determinant maximization (MAXDET)';
problems{i}.call = 'maxdetex';i = i+1;
problems{i}.class = 2;
problems{i}.info = 'Decay-rate estimation (SDP)';
problems{i}.call = 'decayex';i = i+1;
problems{i}.class = 0;
problems{i}.info = 'Mixed integer programming (MILP,MIQP,MICP)';
problems{i}.call = 'milpex';i = i+1;
problems{i}.class = 3;
problems{i}.info = 'Working with polynomial expressions';
problems{i}.call = 'nonlinex';i = i+1;
problems{i}.class = 3;
problems{i}.info = 'Working with nonlinear operators';
problems{i}.call = 'nonlinopex';i = i+1;
problems{i}.class = 3;
problems{i}.info = 'Nonlinear semidefinite programming using PENBMI (BMI)';
problems{i}.call = 'bmiex1';i = i+1;
problems{i}.class = 3;
problems{i}.info = 'Decay-rate estimation revisited with PENBMI (BMI)';
problems{i}.call = 'decaybmiex';i = i+1;
problems{i}.class = 3;
problems{i}.info = 'Simultaneous stabilization with PENBMI (BMI)';
problems{i}.call = 'simstabex';i = i+1;
problems{i}.class = 4;
problems{i}.info = 'Sum-of-squares decompositions';
problems{i}.call = 'sosex';i = i+1;
problems{i}.class = 4;
problems{i}.info = 'Polynomial programming using moment-relaxations';
problems{i}.call = 'momentex';i = i+1;
problems{i}.class = 4;
problems{i}.info = 'Global nonlinear programming';
problems{i}.call = 'globalex';i = i+1;
problems{i}.class = 5;
problems{i}.info = 'Multi-parametric programming';
problems{i}.call = 'mptex';i = i+1;
problems{i}.class = 5;
problems{i}.info = 'KYP problems (SDP)';
problems{i}.call = 'kypdex';i = i+1;
problems{i}.class = 5;
problems{i}.info = 'Posynomial geometric programming';
problems{i}.call = 'geometricex';i = i+1;
problems{i}.class = 5;
problems{i}.info = 'Complex-valued problems';
problems{i}.call = 'complexex';i = i+1;
problems{i}.class = 5;
problems{i}.info = 'Dual variables';
problems{i}.call = 'dualex';i = i+1;
while (1)
clc
echo off
disp(' ')
disp(' ')
disp(' YALMIP DEMO')
disp(' ')
oldclass = 0;
for i = 1:length(problems)
% if problems{i}.class == oldclass
% fprintf('\n');
% end
fprintf([' %1.2d) ' problems{i}.info '\n'],i);
% oldclass = problems{i}.class;
end
disp(' ');
disp(' 0) quit')
inp = input('Select demo: ');
try
if ~isempty(inp)
switch(inp)
case 0
return
otherwise
if inp<=length(problems)
eval(problems{inp}.call);
end
end
end
catch
disp(lasterr)
pause
end
end