O'Reilly logo

Process Control: Modeling, Design, and Simulation by B. Wayne Bequette

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix 13.2: m-File to Calculate the RGA

  function lambda = rga(g)
%
% calculate the relative gain array for a
% square gain matrix of any size
%
% first, check the dimensions to see if the
% process gain matrix is square
%
  [mrow ncol]=size(g);
%
% if the gain matrix is not square, let the
% user know
%
  if mrow ~= ncol;
    disp('needs to be square, buddy')
    end;
  else
%
% the matrix ghat is simply the inverse of the
% gain matrix.  ghatt is the transpose of ghat
%
    ghat = inv(g);
    ghatt=ghat';
%
%  perform an element by element multiplication
%  of g and ghatt to find the relative gain array
%
    lambda = g.*ghatt;
  end

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required