Function Reference    
connect

Derive state-space model from block diagram description

Syntax

Description

Complex dynamical systems are often given in block diagram form. For systems of even moderate complexity, it can be quite difficult to find the state-space model required in order to bring certain analysis and design tools into use. Starting with a block diagram description, you can use append and connect to construct a state-space model of the system.

First, use

to specify each block sysj in the diagram and form a block-diagonal, unconnected LTI model sys of the diagram.

Next, use

to connect the blocks together and derive a state-space model sysc for the overall interconnection. The arguments Q, inputs, and outputs have the following purpose:

Since it is easy to make a mistake entering all the data required for a large model, be sure to verify your model in as many ways as you can. Here are some suggestions:

The connect function does support delays in a reliable way. If you need to work extensively with block diagrams or you need to interconnect models with time delays, Simulink is a much easier and more comprehensive tool for model building.

Example

Consider the following block diagram

Given the matrices of the state-space model sys2

Define the three blocks as individual LTI models.

Next append these blocks to form the unconnected model sys.

This produces the block-diagonal model

Note that the ordering of the inputs and outputs is the same as the block ordering you chose. Unnamed inputs or outputs are denoted b.

To derive the overall block diagram model from sys, specify the interconnections and the external inputs and outputs. You need to connect outputs 1 and 4 into input 3 (u2), and output 3 (y2) into input 4. The interconnection matrix Q is therefore

Note that the second row of Q has been padded with a trailing zero. The block diagram has two external inputs uc and u1 (inputs 1 and 2 of sys), and two external outputs y1 and y2 (outputs 2 and 3 of sys). Accordingly, set inputs and outputs as follows.

You can obtain a state-space model for the overall interconnection by typing

Note that the inputs and outputs are as desired.

See Also
append      Append LTI systems

feedback    Feedback connection

minreal     Minimal state-space realization

parallel    Parallel connection

series      Series connection

References

[1] Edwards, J.W., "A Fortran Program for the Analysis of Linear Continuous and Sampled-Data Systems," NASA Report TM X56038, Dryden Research Center, 1976.


  conj covar