question about the LPV-model in simulink

119 views
Skip to first unread message

Hanmi Xu

unread,
Nov 20, 2014, 9:48:11 AM11/20/14
to yal...@googlegroups.com
hello,

i am trying to compare the nomal MPC method and the minmax MPC based LMI (kothare,Balakrishnan,Morari 1996) with simulink.
The plant is a LPV model. so in the nomal MPC i set a nominal Acn and Bcn.
After simulation, at t=0, the first value u after optimization is not reached 230 (u_max).
as my mind, the value u at t=0 should be 230 so that it can reach the reference value as fast as possible.
And the minmax MPC dosen't show the advantages to the nomal MPC in my simulation.
Could you give me some advice about my simulink model and the definition of the function?
thanks a lot

best regards
xu
PT1_minmaxMPC.slx.tar.gz

Johan Löfberg

unread,
Nov 20, 2014, 12:50:57 PM11/20/14
to
Not sure what you are asking, doesn't sound like it is YALMIP related. Sounds like you basically don't like the solution of Kothare as it is conservative and doesn't exploit the control authority to the fullest.

Hanmi Xu

unread,
Nov 20, 2014, 2:50:44 PM11/20/14
to yal...@googlegroups.com
Dear Johan,

Thank you for the reply.

I would like to ask you, did I correctly define the function of Kothare's method with Yalmip ? 

xs is the current value x and r is the reference value.


here is the function

 uout=rmpcKBM96(xs,r,t)


persistent Controller


if t==0
   
    
Ts=0.0001;
    
% Vertex
   
    Ad{1}=[0.9998,0;0 0.9998];
    Ad{2}=[0.9975 0;0 0.9975];
    
    Bd{1}=[0.0017 0;0 0.0017];
    Bd{2}=[0.0069 0;0 0.0069];
    

    nx=size(Bd{1},1);
    nu=size(Bd{2},2);
    nv=size(Ad,1);


    u_max=[230;230];
    
    
    
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    
% Define data for MPC controller
    
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    

    
Q=[1 0;0 1];
R=0.01*eye(2);
   
   
    
% ZERO-Tolerance of strict LMIs
    
ZERO = 1e-6;
    
    
%-----------------------
    
% Controller
    
%-----------------------
    
% Aviod explosion of internally defined variables in YALMIP
  
  
yalmip('clear')
    
   

% variables
  
  
S=sdpvar(nx);
    
Y=sdpvar(nu,nx,'full');
    
gamma=sdpvar(1);
    
xk=sdpvar(nx,1);



 

% LMI Definition and Constraints
    

Constraints=[];
    
    

Constr_S=[S>=ZERO];
    
    
lmi1=[1 xk';xk S];
    
Constr_lmi1=[lmi1>=ZERO];
   
 
    
Constr_lmi2=[];
    
for v=1:nv
        
lmi2_constr=[[S, (Ad{v}*S+Bd{v}*Y)', S*sqrtm(Q), Y'*sqrtm(R);...
            
(Ad{v}*S+Bd{v}*Y), S, zeros(nx), zeros(nx,nu);...
            
sqrtm(Q)*S, zeros(nx), gamma*eye(nx), zeros(nx,nu);...
            
sqrtm(R)*Y, zeros(nu,nx), zeros(nu,nx), gamma*eye(nu)]>=ZERO];
        
        

Constr_lmi2=Constr_lmi2+lmi2_constr;
    
end
    
   
    

% inputs Constraints
    
lmi_in=[diag(u_max.^2) Y;Y' S];
    
Constr_in=[lmi_in>=ZERO];
    
    

% outputs Constraints
    
Constr_out=[];

               
 % Controller design
    
    
Constraints=Constr_S+Constr_lmi1+Constr_lmi2+Constr_in+Constr_out;

    
options=sdpsettings('solver','sedumi');
   
Controller=optimizer(Constraints,gamma,options,xk,{Y,S})
 
   
    
sol=Controller{{xs-r}};
    
uout=sol{1}*inv(sol{2})*(xs-r);


else
    

sol=Controller{{xs-r}};
    
uout=sol{1}*inv(sol{2})*(xs-r);


end

Johan Löfberg

unread,
Nov 20, 2014, 2:54:16 PM11/20/14
to yal...@googlegroups.com
You are doing several X >= smallnumber where you really want to do X >= smallnumber*eye(n)
Reply all
Reply to author
Forward
0 new messages