control systems
DESCRIPTION
State Space in control systemsTRANSCRIPT
SRI LANKA INSTITUE OF INFORMATION TECHNOLOGYB.Sc.Eng.Department of Electronic & ComputerEngineering EC 350 - Control SystemsLaboratory 03 State Space
State Space representation of Transfer Function 2. Transfer function to state space Given a transfer function of the form
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 1Consider the following transfer function
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 FunctionTo 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
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 1Example. Using MATLAB, obtain the transfer function for the control system in the figure below.
Where,