%% Getting Started with LTI Models -- Connecting Models

%   Copyright 1986-2004 The MathWorks, Inc.
%   $Revision: 1.1.6.1 $  $Date: 2004/08/17 21:33:04 $

%% Conecting Models
GSConnectingModels_aux(1) % Draw Diagram

%%
% The Control System Toolbox provides a number of functions to help you
% build complex networks of models.  These include functions to perform
%
% * Series and parallel connections (SERIES and PARALLEL)
% * Feedback connections (FEEDBACK a`nd LFT)
% * I/O concatenation ([ , ], [ ; ], and APPEND)
%

%% Series Connection
GSConnectingModels_aux(2)
   
%%
% You can connect models H1 and H2 in series using
%
% >> H = series(H1,H2);
%
% A series connection is equivalent to the product of the models:
% 
% >> H = H2 * H1;


%% Parallel Connection
GSConnectingModels_aux(3)  % Draw Diagram


%%
% You can connect models H1 and H2 in parallel using
%
% >> H = parallel(H1,H2);
%
% A parallel connection is equivalent to the sum of the models:
%
% >> H = H2 + H1;
 

%% Feedback Connection
GSConnectingModels_aux(4)  % Draw Diagram

%%
% You can connect models H1 and H2 in a feedback configuration using
%
% >> H = feedback(H1,H2);
%
% To apply positive feedback, use the syntax
%
% >> H = feedback(H1,H2,+1);


%% Summing Outputs
GSConnectingModels_aux(5) % Draw Diagram
    
%%
% You can sum the outputs of models H1 and H2 using
%
% >> H = [ H1 , H2 ];
%
% In matrix notation, this connection is equivalent to the horizontal
% concatenation of these models.  Note that if H1 and H2 are SISO models,
% then the concatenated model H is a MIMO model with 2 inputs and 1
% output.

%% Distributing Inputs
GSConnectingModels_aux(6) % Draw Diagram

%%
% You can distribute inputs to models H1 and H2 using
%
% >> H = [ H1 ; H2 ];
%
% In matrix notation, this connection is equivalent to the vertical
% concatenation of these models.  Note that if H1 and H2 are SISO models,
% then the concatenated model H is a MIMO model with 1 input and 2 outputs.

%% Appending Models
GSConnectingModels_aux(7) % Draw Diagram
 
%%
% You can append the inputs and outputs of models H1 and H2 using
%
% >> sys = append(H1,H2);
%
% In matrix notation, this connection is equivalent to the block-diagonal
% concatenation of these models.  Note that if H1 and H2 are SISO models,
% then the concatenated model H is a MIMO model with 2 inputs and 2
% outputs.
 