Code covered by the BSD License  

Highlights from
Reduced-order discrete-time LQG design for systems with white parameters

Reduced-order discrete-time LQG design for systems with white parameters

by

 

22 May 2008 (Updated )

Optimal compensation of time-varying discrete-time linear systems with white stochastic parameters

[pt,ph,st,sh]=sproeq(pt,ph,st,sh,pm,gm,cm,pms,gms,cms,pgms,pcms,...
% SPROEQ: one iteration of the Stochastic Parameter
%         Reduced-Order LQG EQuations.
%         Control and estimation equations of compensator
%         for (P,G,C,W,V) based on (Q,R,MC) and nc<=nx.
%         (P,G,C) stochastic and dependent.
%
%         [pt,ph,st,sh]=sproeq(pt,ph,st,sh,pm,gm,cm,pms,gms,cms,pgms,pcms,...
%                              pva,gva,cva,pgva,pcva,v,w,q,r,nc,a,b,m,rtol);
%
%         See also sprotin, gmhfac
%
%         W.L. De Koning, L.G. Van Willigenburg 28-11-95.
%
  function [pt,ph,st,sh]=sproeq(pt,ph,st,sh,pm,gm,cm,pms,gms,cms,pgms,pcms,...
                                pva,gva,cva,pgva,pcva,v,w,q,r,mc,me,nc,a,b,m,rtol);

% Scale mean square values and variances in case of a
% homotopy
  if a~=1
    [pms,pva,gms,gva,cms,cva,pgms,pgva,pcms,pcva]=...
    msvhom(pms,pva,gms,gva,cms,cva,pgms,pgva,pcms,pcva,a);
  end;

%
% full order equations
%
  ln=r; kn=w; stn=st; ptn=pt;

  ln(:)=gms'*st(:)+r(:)+gva'*sh(:);
  h=mc'; h(:)=h(:)+pgms'*st(:)+pgva'*sh(:); l=pinv(ln)*h;
  kn(:)=cms *pt(:)+w(:)+cva *ph(:);
  h=me ; h(:)=h(:)+pcms *pt(:)+pcva* ph(:); k=h*pinv(kn);

  lnl=l'*ln*l; khk=k'*sh*k;
  stn(:)=pms'*st(:)-lnl(:)+q(:)+pva'*sh(:)+cva'*khk(:);
  h=st; h1=k'*sh; h(:)=pcva'*h1(:); stn=stn-h-h';

  psi2=(pm-k*cm)'*sh*(pm-k*cm) +lnl;
 
  knk=k*kn*k'; lhl=l*ph*l';
  ptn(:)=pms *pt(:)-knk(:)+v(:)+pva *ph(:)+gva *lhl(:);
  h=pt; h1=l*ph ; h(:)=pgva *h1(:); ptn=ptn-h-h';

  psi1=(pm-gm*l) *ph*(pm-gm*l)'+knk;

%
% reduced order adaptation
%
  [nx,nx]=size(pm);
  [ta]=gmhfac(ph,sh,nc,a,m,rtol); tao=eye(nx)-ta;
  tpsi1to=tao *psi1*tao'; tpsi2to=tao'*psi2*tao;

  phn=psi1*ta'; phn=0.5*(phn+phn');
  shn=psi2*ta ; shn=0.5*(shn+shn');

  ptn=ptn+tpsi1to;
  stn=stn+tpsi2to;

  if a==0; b=0; end;
  pt=(1-b)*ptn+b*pt; pt=0.5*(pt+pt');
  st=(1-b)*stn+b*st; st=0.5*(st+st');

  ph=(1-b)*phn+b*ph;
  sh=(1-b)*shn+b*sh;

Contact us