You are on page 1of 7

SRI LANKA INSTITUE OF INFORMATION TECHNOLOGY

B.Sc.Eng. Department of Electronic & Computer Engineering


EC 350 - Control Systems
Laboratory 03 State Space

State Space representation of Transfer Function


2. Transfer function to state space
Given a transfer function of the form

H (s )=

B(s)
A (s)

num polynomials num


=
den polynomial s den

MATALB can be used to obtain a state-space representation of the transfer function


with the following command:
>> [A, B, C, D] = tf2ss(num, den)
It is important to note that the state space representation is not unique, i.e. there
are many state-space representations for the same system. The MATLAB command
gives just one possible state-space equation.
Example 1
Consider the following transfer function

H (s )=

s
(s+10)(s + 4 s +16)
2

A possible state-space representation for this system is

For the example transfer function, MATLAB produces the following state-space
representation

3. State Space to Transfer Function

To obtain the transfer function from state-space equations, use the following
MATLAB code

Where num_in must be specified for systems with more than one input. For
example, if there is only one input, then num_in = 1, if there are two inputs then
num_in = 2, etc. For systems with only one input, then the following code is allowed

Example. Given the state-space equations

MATLAB produces the following system transfer function

H (s )=

B(s)
25 s+5
= 3
A (s) s +5 s2 +25 s +5

The MATLAB implementation of this is given by the following code

Example
State space modeling in MATLAB and Simulink
>> tau = 5;
>> A=-1/tau;
>> K=2;
>> B=K/tau;
>> C=1;
>> D=0;
>> sys = ss(A,B,C,D)

Observe the step response of the system as follows

>> step(sys)

Convert continuous state space model to discrete state space model using
following command

Step response of the discrete state space model as follows

>> step(sysd)

Obtain the transfer function of the state space model as follows


>> sysl = tf(sys)

Exercise 1
Example. Using MATLAB, obtain the transfer function for the control system in the
figure below.

Where,

Type equation here .

You might also like