qp_ca_sl

PURPOSE ^

Wrapper used in the QP control allocation Simulink block.

SYNOPSIS ^

function u = qp_ca_sl(arg,B,plim,rlim,T,Wv,Wu,ud,alg,imax,gam,tol)

DESCRIPTION ^

 Wrapper used in the QP control allocation Simulink block.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function u = qp_ca_sl(arg,B,plim,rlim,T,Wv,Wu,ud,alg,imax,gam,tol)
0002   
0003 % Wrapper used in the QP control allocation Simulink block.
0004   
0005 % Dimensions
0006   [k,m] = size(B);
0007   
0008   % Extract nonconstant input arguments
0009   v = arg(1:k);
0010   uprev = arg(k+1:end);
0011   
0012   % Overall position limits
0013   if isempty(rlim)
0014     umin = plim(:,1);
0015     umax = plim(:,2);
0016   else
0017     umin = max(plim(:,1),uprev+rlim(:,1)*T);
0018     umax = min(plim(:,2),uprev+rlim(:,2)*T);
0019   end
0020   u0 = mean([umin umax]')';
0021   W0 = zeros(m,1);
0022   
0023   switch lower(alg)
0024    case 'sls'
0025     u = sls_alloc(B+j,v,umin,umax,Wv,Wu,ud,u0,W0,imax);
0026    case 'mls'
0027     u =    mls_alloc(B,v,umin,umax,Wv,Wu,ud,u0,W0,imax);
0028    case 'wls'
0029     u = wls_alloc(B,v,umin,umax,Wv,Wu,ud,gam,u0,W0,imax);
0030    case 'wlsc'
0031     u = wlsc_alloc(B,v,umin,umax,Wv,Wu,ud,gam,u0,W0,imax);
0032    case 'ip'
0033     u = ip_alloc(B,v,umin,umax,ud,gam,tol,imax);
0034    case 'fxp'
0035     u = fxp_alloc(B,v,umin,umax,Wv,Wu,ud,gam,u0,imax);
0036    case 'cgi'
0037     u = cgi_alloc(B,v,umin,umax,Wv,Wu,ud);
0038   end

Generated on Wed 25-Aug-2004 14:38:35 by m2html © 2003