I am trying to run the following LMI codes on Matlab but it gives me an error called "Segmentation Violation Detected" and I do not know what is the meaning of this? Please any one help me solve the problem? See attached codes
2 views (last 30 days)
Show older comments
clc clear all; close all;
m11=1.0852; m22=2.0575; m23=-0.4087; m32=-0.4087; m33=0.2153; d11=0.0865; d22=0.0762; d23=0.151; d32=0.0151; d33=0.0031; f11=0.0000; f22=0.0000; f33=0; a41=-f11/(m22*m33-m32*m23); a44=d11/(m22*m33-m32*m23); a52=-m22*f22/(m11*(m22*m33-m32*m23)); a53=-m23*f33/(m11*(m22*m33-m32*m23)); a55=((m22*d22)+(m32*d32))/(m11*(m22*m33-m32*m23)); a56=((m22*d23)+(m32*d33))/(m11*(m22*m33-m32*m23)); a62=-m32*f22/(m11*(m22*m33-m32*m23)); a63=-m33*f33/(m11*(m22*m33-m32*m23)); a65=((m23*d22)+(m33*d32))/(m11*(m22*m33-m32*m23)); a66=((m23*d23)+(m33*d33))/(m11*(m22*m33-m32*m23)); b41=1/(m11*(m22*m33-m32*m23)); b52=m22/(m11*(m22*m33-m32*m23)); b53=m32/(m11*(m22*m33-m32*m23)); b62=m23/(m11*(m22*m33-m32*m23)); b63=m33/(m11*(m22*m33-m32*m23)); labda=sin(2); delta=cos(88); A=[0 0 0 1 -labda 0; 0 0 0 labda 1 0; 0 0 0 0 0 1; a41 0 0 a44 0 0; 0 a52 a53 0 a55 a56; 0 a62 a63 0 a65 a66] A1=A B=[0 0 0; 0 0 0; 0 0 0; b41 0 0; 0 b52 b53; 0 b62 b63] A2=[0 0 0 delta -1 0; 0 0 0 1 delta 0; 0 0 0 0 0 1; a41 0 0 a44 0 0; 0 a52 a53 0 a55 a56; 0 a62 a63 0 a65 a66] A3=[0 0 0 delta 1 0; 0 0 0 -1 delta 0; 0 0 0 0 0 1; a41 0 0 a44 0 0; 0 a52 a53 0 a55 a56; 0 a62 a63 0 a65 a66] B1=[0 0 0; 0 0 0; 0 0 0; 1 0 0; 0 b52 b53; 0 b62 b63] B2=B1 B3=B1
A0=[0 0 0 0.0015 0.0050 0; 0 0 0 0.0050 0.0015 0; 0 0 0 0 0 0.0050; 0 0 0.0014 0 0 0; 0 0 0 0 0.0020 0.0033; 0 0 0 0 0.0001 0.0010] B0=[0 0 0; 0 0 0; 0 0 0; 0.0050 0 0; 0 0.1018 0.0048; 0 0.0048 0.0010] Q=[0.0100 0 0 0 0 0; 0 0.0100 0 0 0 0; 0 0 0.0100 0 0 0; 0 0 0 0.0100 0 0; 0 0 0 0 0.0100 0; 0 0 0 0 0 0.0100] I=[1 0 0 0 0 0; 0 1 0 0 0 0; 0 0 1 0 0 0; 0 0 0 1 0 0; 0 0 0 0 1 0; 0 0 0 0 0 1] N=(A0'*A0)+Q; Q=inv(N)
setlmis([]); X=lmivar(1,[6 1]); Y=lmivar(1,[6 1]); Y1=lmivar(2,[3 6]); Y2=lmivar(2,[3 6]); Y3=lmivar(2,[3 6]);
lmiterm([1 1 1 0],1) lmiterm([-1 1 1 X],1,1) % X > I : X
lmiterm([-2 1 1 Y],1,1);
lmiterm([3 1 1 X],A1',1,'s'); lmiterm([3 1 1 Y1],B1,1,'s'); lmiterm([3 1 1 0],2); lmiterm([3 1 1 0],1); lmiterm([3 1 2 Y1],0,B0); lmiterm([3 1 3 X],1,1); lmiterm([3 2 2 0],-1); lmiterm([3 2 3 0],0); lmiterm([3 3 3 0],0); lmiterm([3 3 2 0],0); lmiterm([3 3 3 0],-1);
lmiterm([4 1 1 X],A2',1,'s'); lmiterm([4 1 1 Y2],B2,1,'s'); lmiterm([4 1 1 0],2); lmiterm([4 1 1 0],1); lmiterm([4 1 2 Y2],0,B0); lmiterm([4 1 3 X],1,1); lmiterm([4 2 2 0],-1); lmiterm([4 2 3 0],0); lmiterm([4 3 3 0],0); lmiterm([4 3 2 0],0); lmiterm([4 3 3 0],-1);
lmiterm([5 1 1 X],A3',1,'s'); lmiterm([5 1 1 Y3],B3,1,'s'); lmiterm([5 1 1 0],2); lmiterm([5 1 1 0],1); lmiterm([5 1 2 Y3],0,B0); lmiterm([5 1 3 X],1,1); lmiterm([5 2 2 0],-1); lmiterm([5 2 3 0],0); lmiterm([5 3 3 0],0); lmiterm([5 3 2 0],0); lmiterm([5 3 3 0],-1);
LMIs=getlmis;
[alpha,popt]=gevp(LMIs,6);
X=dec2mat(LMIs,popt,1);
Y=dec2mat(LMIs,popt,2);
Y1=dec2mat(LMIs,popt,3);
Y2=dec2mat(LMIs,popt,4);
Y3=dec2mat(LMIs,popt,5);
P=inv(X);
L1=Y1*P;
L2=Y2*P;
L3=Y3*P;
W=P*Y*P;
% show results
alpha
L1
L2
L3
P
W
0 Comments
Answers (1)
Johan Löfberg
on 12 Jun 2014
It simply means that there is a bug in the MATLAB/LMILAB version you are using, so it crashes. You're not doing anything wrong.
BTW, the command "eye" might be worth learning...
0 Comments
See Also
Categories
Find more on Linear Matrix Inequalities in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!