① matlab中SeDuMi和YaLMIP,以及LMI工具箱有什麼區別和聯系
SeDuMi 和來 LMI 都是求解器,前者是第三方的,後自者是 Robust Control Toolbox 中的
YaLMIP 是基於 MATLAB 的建模語言,它的作用是為不同的求解器提供一致的調用介面,目前支持這些求解器:
YALMIP Wiki | Solvers / Solvers
簡單來說,YaLMIP 用於描述問題,SeDuMi 和 LMI 以及其他求解器用來解決問題
② 求高手用matlab的LMI工具箱 或者 YALMIP工具包 求下列矩陣不等式中η的最優解(最大值)。
和可惜不會啊
③ 找得到yalmip工具箱的位置,但yalmiptest卻不能通過的原因
你要想找到工具箱的位置,但是不能通過原因。
④ 如何在matlab路徑中安裝yalmip
安裝步驟:
1、將yalmip放到你的MATLAB的toolbox文件夾下;
2、將yalmip文件目錄添加到MATLAB的path里(方法:matlab主界面:file->set
path)
可直接選
Add
with
subfolders...
注意:要將下面每一個文件目錄都添
到matlab的path中
/yalmip
/yalmip/extras
/yalmip/demos
/yalmip/solvers
/yalmip/moles
/yalmip/moles/parametric
/yalmip/moles/moment
/yalmip/moles/global
/yalmip/moles/robust
/yalmip/moles/sos
/yalmip/operators
3、重啟matlab
檢驗yalmip工具箱是否添
成功。
鍵入「which
sdpvar」。就可以了。
⑤ matlab整數規劃程序
可以用YALMIP工具箱解整數規劃
定義變數:
sqdvar()實型
intvar()整型
binvar()0-1型
設定目標函數 :
f=目標函數
設定限定條件:
F=set(限定條件)
多個限定條件用加號相連:
F=set(限定條件)+set(限定條件1)+set(限定條件2)……
求解: solvesdp(F,f)
這里解得是F條件下目標函數f的最小值,要求最大值f前面加個負號
求解之後查看數值 :
double(f) double(變數)
intvar(m,n):生成整數型變數;
sdpvar(m,n):生產變數;
solvesdp(F,f):求解最優解(最小值),其中F為約束條件(用set連接),f為目標函數
double:顯示求解的答案
有個例子:
已知非線性整數規劃為:
Max z=x1^2+x2^2+3*x3^2+4*x4^2+2*x5^2-8*x1-2*x2-3*x3-x4-2*x5
s.t.
0<=xi<=99(i=1,2,...,5)
x1+x2+x3+x4+x5<=400
x1+2*x2+2*x3+x4+6*x5<=800
2*x1+x2+6*x3<=800
x3+x4+5*x5<=200
matlab中輸入
>> x=intvar(1,5);
f=[1 1 3 4 2]*(x'.^2)-[8 2 3 1 2]*x';F=set(0<=x<=99);
F=F+set([1 1 1 1 1]*x'<=400)+set([1 2 2 1 6]*x'<=800)+set(2*x(1)+x(2)+6*x(3)<=800);
F=F+set(x(3)+x(4)+5*x(5)<=200);solvesdp(F,-f);
max=double(f)
sx=double(x)
* Starting YALMIP integer branch & bound.
* Lower solver : fmincon-standard
* Upper solver : rounder
* Max iterations : 300
Warning : The relaxed problem may be nonconvex. This means
that the branching process not is guaranteed to find a
globally optimal solution, since the lower bound can be
invalid. Hence, do not trust the bound or the gap...
Node Upper Gap(%) Lower Open
1 : -8.020E+004 0.03 -8.025E+004 2
2 : -8.020E+004 0.03 -8.025E+004 1
3 : -8.020E+004 0.00 -8.020E+004 2
+ 3 Finishing. Cost: -80199
max =
80199
sx =
53 99 99 99 0
⑥ 如何在matlab路徑中安裝yalmip
安裝步驟:
1、將yalmip放到你的MATLAB的toolbox文件夾下;
2、將yalmip文件目錄添加到MATLAB的path里(方法:內matlab主界面:file->set path)
可直接容選 Add with subfolders...
注意:要將下面每一個文件目錄都添 到matlab的path中
/yalmip
/yalmip/extras
/yalmip/demos
/yalmip/solvers
/yalmip/moles
/yalmip/moles/parametric
/yalmip/moles/moment
/yalmip/moles/global
/yalmip/moles/robust
/yalmip/moles/sos
/yalmip/operators
3、重啟matlab
檢驗yalmip工具箱是否添 成功。
鍵入「which sdpvar」。就可以了。
⑦ 請問matlab中的symbolic工具包與SeDuMi_1_1R3,yalmip是否有沖突
你再試試其他工具包
⑧ yalmip工具箱工具箱怎麼解決混合線性優化
說明求解器找不到解,大部分是原問題無解或者你的初值給的不對
⑨ 用yalmip解非線性混合整數規劃的時候為什麼結果都是NaN
MATLAB求解線性的整數規劃可以用分支定界法,但實現起來還是比較困難。可以去下載一個叫YALMIP的工具箱,用他可以解決線性規劃,非線性規劃,整數規劃,混合規劃,強烈推薦把這個工具整合到matlab中去,這個工具是私人的,不過可以免費下載使用。不過最好的方法是用LINGO求解。有了YALMIP工具箱,輸入也變的相對簡單,代碼如下:x=intvar(2,7);f=[0.487,0.520,0.613,0.720,0.487,0.520,0.640;0.487,0.520,0.613,0.720,0.487,0.520,0.640]*x';F=set(x>=0);F=F+set(x(1,1)+x(2,1)<=8)+set(x(1,2)+x(2,2)<=7)+set(x(1,3)+x(2,3)<=9)+set(x(1,4)+x(2,4)]<=6)+set(x(1,5)+x(2,5)<=6)+set(x(1,6)+x(2,6)<=4);F=F+set([2,3,1,0.5,4,2,7;2,3,1,0.5,4,2,7]*.x'<=[40;40])+set([0.487,0.52,0.613,0.72,0.487,0.52,0.64;0.487,0.52,0.613,0.72,0.487,0.52,0.64].*x'<=[10.2;10.2])+set([0,0,0,0,0.487,0.52,0.64;0,0,0,0,0.487,0.52,0.64].*x'<=[3.027;3.027]);solvesdp(F,-f)下面用lingo求解:model:max=0.487*x11+0.52*x12+0.613*x13+0.72*x14+0.487*x15+0.52*x16+0.64*x17+0.487*x21+0.52*x22+0.613*x23+0.72*x24+0.487*x25+0.52*x26+0.64*x27;x11+x21<=8;x12+x22<=7;x13+x23<=9;x14+x24<=6;x15+x25<=6;x16+x26<=4;2*x11+3*x12+x13+0.5*x14+4*x15+2*x16+x17<=40;2*x21+3*x22+x23+0.5*x24+4*x25+2*x26+x27<=40;0.487*x11+0.52*x12+0.613*x13+0.72*x14+0.487*x15+0.52*x16+0.64*x27<=10.2;0.487*x21+0.52*x22+0.613*x23+0.72*x24+0.487*x25+0.52*x26+0.64*x17<=10.2;0.487*x15+0.52*x16+0.64*x17<=3.027;0.487*x25+0.52*x26+0.64*x27<=3.027;@gin(x11);@gin(x12);@gin(x13);@gin(x14);@gin(x15);@gin(x16);@gin(x17);@gin(x21);@gin(x22);@gin(x23);@gin(x24);@gin(x25);@gin(x26);@gin(x27);end運行結果:(由於字數超限,運行結果已刪除)
⑩ 在MATLAB中下載了yalmip工具箱 添加路徑後定義P=sdpvar(5,1);時就提示以下錯誤,忘大神解讀
解決方案1:
直接用緝鼎光刮叱鈣癸水含驚ifft();例如信號x
y=fft(x);%對信號傅里葉變換到頻域
z=ifft(y);%對信號y傅里葉反變換到時域,
解決方案2:
工具箱啊。IFFT()函數