0% found this document useful (0 votes)
31 views5 pages

State Space and Transfer Function 012005

This document discusses modeling systems with state-space and transfer function blocks in Simulink. It shows how to represent a second-order differential equation as state-space matrices and model a single-degree-of-freedom system using the state-space and transfer function blocks. The response of the system is shown to be the same using either method.

Uploaded by

maxterminator555
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views5 pages

State Space and Transfer Function 012005

This document discusses modeling systems with state-space and transfer function blocks in Simulink. It shows how to represent a second-order differential equation as state-space matrices and model a single-degree-of-freedom system using the state-space and transfer function blocks. The response of the system is shown to be the same using either method.

Uploaded by

maxterminator555
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Using the State-Space and Transfer Function Blocks in Simulink

INTRODUCTION

In this tutorial, two additional methods for modeling differential equations in Simulink will
be discussed. The state-space and transfer function methods offer a more succinct way of
modeling systems and are often used in controls analysis. To better understand their use, the
second-order, single-degree of freedom (SDOF) system will be modeled using both techniques.

MODELING WITH THE STATE-SPACE BLOCK

The state-space method is convenient for breaking down a higher-order differential equation
into a series of first-order equations for easier solution by matrix methods. To begin, select the
State-Space block from the Continuous sub-menu of the Simulink library. Complete the model
with the Step and Scope blocks as shown in Fig. 1.

Fig. 1. Basic system model using the State-Space block.


At this point the model is very general, and an equation of any order can be set up for
solution in the block parameters. The equation inside the State-Space block is
x& = Ax + Bu
(1)
y = Cx + Du
This represents the basic state-space equation, where
x& = a vector of the first-order state variables,
y = the output vector,
x = the state variable vector,
u = the forcing function,
A = the state matrix,
B = the input matrix,
C = the output matrix, and
D = the transmission matrix.

The second-order ODE that will be modeled is


m&x& + cx& + kx = f ( t ) . (2)
The first step in putting this into state-space form is to break down this equation into two
first-order state equations. This can be done by assigning a subscripted variable for each "state"
of the system in the order of increasing derivatives (i.e. x1 = displacement state and x2 = velocity
state). Therefore, the equations obtained are:

Using the State-Space and Transfer Rev 012005


Function Blocks in Simulink 1
x 1 = x = displacement state
x 2 = x& = x& 1 = velocity state (3)
x& 2 = &x&
This allows a re-statement of (2) in terms of state variables only. For this example, two first-
order differential equations are created.
x& 1 = x 2
(4)
mx& 2 + cx 2 + kx 1 = f (t )
These can be reorganized to obtain:
 x& 1   0 1  x   0 
 1  
 =  k c    +  1 f ( t ) . (5)
x& 2  − −  x   
 
 m m 2 m 
Compare this to (1). The state and input matrices (matrices A and B) needed to define the
block parameters have been defined. What remains are the output matrix C and the transmission
matrix D. To solve for these, a desired state of interest must be chosen. For this example, the
displacement of the system is important. The resulting output equation is
 x 1 
y = [1 0]  + [0]u . (6)
x 2 
Note that, for the purpose of this tutorial, the transmission matrix D will be set to 0. The use
of the transmission matrix is beyond the scope of this tutorial.
With all of the matrices defined, the data can be entered into the state-space block
parameters. As shown in Fig. 2, the matrix dimensions must be maintained.

Fig. 2. Required matrix dimensions for State-Space block.


Open the State-Space block parameter window and set the parameters as shown in Fig. 3.

Using the State-Space and Transfer Rev 012005


Function Blocks in Simulink 2
Fig. 3. State-Space Parameter window.
The m, c, and k values shown in the parameter box should be set to
m = 2,
c = 2, and
k = 4.
With these settings, the output will be as shown in Fig. 4.

Fig. 4. SDOF response due to a step input using a state-space model.


It is clear that this is an under-damped system. Try changing the m, c, and k values to see
how the system will respond with different properties.

Using the State-Space and Transfer Rev 012005


Function Blocks in Simulink 3
MODELING WITH THE TRANSFER FUNCTION BLOCK

The same model will be run using the transfer function block. The advantage of the transfer
function block is that it is easy to set up in Simulink. Like the state-space block, all of the
information about the system is contained within one block. The system transfer function is
essentially a ratio between the Laplace transform of the output response of a system and the
Laplace transform of the input forcing function. To obtain the system transfer function for any
system, take the Laplace transform of the governing differential equation for that system with all
initial conditions set to zero. Then form the ratio of the output response to the input forcing
function. For the single-degree-of-freedom system, the basic system transfer function is
X(s) 1
= H(s) = 2
. (7)
F(s) ms + cs + k
To illustrate the use of the transfer function block, a reevaluation of the example from above
will be performed to show that the results will be the same. From the Simulink Library Browser,
select Continuous, and drag and drop the Transfer Fcn block into the model space. Also drag a
Step block and a Scope block into the model space. Construct the model as shown in Fig. 5.

Fig. 5. Basic Transfer Function model.


Double-click on the Transfer Fcn block and set the parameters as shown in Fig. 6.

Fig. 6. Transfer function block parameters.


The inputs for this block include the coefficients of the polynomials in the numerator and
denominator of the transfer function. Fig. 6 shows how the values from our previous example

Using the State-Space and Transfer Rev 012005


Function Blocks in Simulink 4
would be inserted. Selecting Apply → OK, and the Transfer Fcn block in the model will be
updated to show the new values as in Fig. 7
.

Fig. 7. Specific transfer function model for the SDOF system.


After running the model, a plot that looks like Fig. 8 should be seen.

Fig. 8. SDOF response due to a step input using transfer function model.
A comparison of this plot with the one obtained from the state-space model will show that
they are identical, as expected. It is apparent that the transfer function model is the easier of the
two to use, and it therefore gets wide use in application. It is important that the student be able to
obtain the system transfer function for a given differential equation and model the system in
Simulink.

Using the State-Space and Transfer Rev 012005


Function Blocks in Simulink 5

You might also like