0% found this document useful (0 votes)
152 views6 pages

MATLAB Basics For SISO LTI Systems

MATLAB can represent linear time-invariant (LTI) systems using transfer functions, state space, or zero-pole-gain models. It allows conversion between representations and performing operations like series, parallel, and feedback connections. Key commands include tf for transfer functions, ss for state space, zpk for zero-pole-gain, and conversion commands. MATLAB extracts coefficients and matrices using commands like tfdata and ssdata.
Copyright
© Attribution Non-Commercial (BY-NC)
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)
152 views6 pages

MATLAB Basics For SISO LTI Systems

MATLAB can represent linear time-invariant (LTI) systems using transfer functions, state space, or zero-pole-gain models. It allows conversion between representations and performing operations like series, parallel, and feedback connections. Key commands include tf for transfer functions, ss for state space, zpk for zero-pole-gain, and conversion commands. MATLAB extracts coefficients and matrices using commands like tfdata and ssdata.
Copyright
© Attribution Non-Commercial (BY-NC)
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
You are on page 1/ 6

MATLAB basics for SISO LTI systems

SYSTEM REPRESENTATION
MATLAB defines systems in 3 ways
1) Transfer functions can be formed in the following ways
NOTE: Polynomials in MATLAB are represented as a vector.
a) >> num = [1 5];
>> den = [1 4 5];
>> sys = tf(num,den)
Transfer function:
s+5
-------------
s^2 + 4 s + 5

b) >> sys = tf([1 5],[1 4 5])


Transfer function:
s+5
-------------
s^2 + 4 s + 5

c) You can also create an LTI object as follows


>> s=tf('s')
Now, this object can be arithmetically manipulated to create the transfer function as follows:
>> sys = (s+5)/(s^2+4*s+5)

Transfer function:
s+5
-------------
s^2 + 4 s + 5

2) State Variable Representation


The state space representation of a system can be represented as follows:
‫ݔ‬ሶ = ‫ ݔܣ‬+ ‫ݑܤ‬
‫ ݔܥ = ݕ‬+ ‫ݑܦ‬
Example: Consider the following linear differential equations:
‫ݔ‬ሶ ଵ = −‫ݔ‬ଵ + 2‫ݔ‬ଶ
‫ݔ‬ሶ ଶ = −3‫ݔ‬ଶ + 5‫ݑ‬
‫ݔ = ݕ‬ଵ
Where ‫ݔ‬ଵ and ‫ݔ‬ଶ are the states
‫ ݕ‬is the output
‫ ݑ‬is the input
‫ݔ‬ሶ −1 2 ‫ݔ‬ଵ 0
൤ ଵ൨ = ቂ ቃ ቂ‫ ݔ‬ቃ + ቂ ቃ ‫ݑ‬
‫ݔ‬ሶ ଶ 0 −3 ଶ 3

‫ݔ‬ଵ
‫ = ݕ‬ሾ1 0ሿ ቂ‫ ݔ‬ቃ + ሾ0ሿ‫ݑ‬

To create this system in MATLAB:

>> A = [-1 2;0 -3];


>> B = [0;3];
>> C = [1 0];
>> D = 0;
>> sys = ss(A,B,C,D)

a=
x1 x2
x1 -1 2
x2 0 -3

b=
u1
x1 0
x2 3

c=
x1 x2
y1 1 0

d=
u1
y1 0

Continuous-time model.

3) Zero-Pole-Gain

Transfer functions can be given in the following form:

4ሺ‫ ݏ‬+ 3ሻሺ‫ ݏ‬+ 5ሻ


‫ܩ‬ሺ‫ݏ‬ሻ =
ሺ‫ ݏ‬+ 1ሻሺ‫ ݏ‬+ 2ሻሺ‫ ݏ‬+ 3ሻ

This can be created in MATLAB using the zpk command:


>> Z = [-3 -5];
>> P = [-1 -2 -3];
>> K = 4;
>> sys = zpk(Z,P,K)

Zero/pole/gain:
4 (s+3) (s+5)
-----------------
(s+1) (s+2) (s+3)

>> sys = zpk([-3 -5],[-1 -2 -3],[4])

Zero/pole/gain:
4 (s+3) (s+5)
-----------------
(s+1) (s+2) (s+3)

POLE-ZERO CANCELLATION
To cancel any common poles and zeros in a transfer function, you can use the ݉݅݊‫ ݈ܽ݁ݎ‬command.
Example:
>> sys = tf([1 3],[1 3 0])
Transfer function:
s+3
---------
s^2 + 3 s
>> minreal(sys)
Transfer function:
1
-
s

DATA EXTRACTION
For quick access to the numerator and denominator of the transfer function of an LTI system
• [num,den] = tfdata(sys) returns the numerator and denominator of the transfer function sys.
NOTE: For a single SISO model,
• [num,den] = tfdata(sys,'v')
This command returns the numerator and denominator as row vectors rather than cell arrays.
For access to A,B,C,D matrices of an LTI system, the following syntax may be used:
• [A,B,C,D] = ssdata(sys)
To extract information of the zeros, poles and gain of an LTI system the following syntax can be used:
• [Z,P,K] = zpkdata(sys)
Again, [Z,P,K] = ZPKDATA(SYS,'v') returns the zeros Z and poles P as column vectors rather than cell
arrays.

CONVERSION
A system in one of the three representations can be converted to any other using the following syntax:
[input_arguments] = conversion_command [ouput_arguments]
From To Command Input Output
State Space Transfer function ss2tf [A,B,C,D] [num,den]
State Space Zero-Pole-Gain ss2zp [A,B,C,D] [z,p,k]
Transfer function State Space tf2ss [num,den] [A,B,C,D]
Transfer function Zero-Pole-Gain tf2zp [num,den] [z,p,k]
Zero-Pole-Gain Transfer function zp2tf [z,p,k] [num,den]
Zero-Pole-Gain State Space zp2ss [z,p,k] [A,B,C,D]

If a system is already defined, they can be automatically converted as follows:


>> P_ss = ss(sys);
>> P_tf = tf(sys);
>> P_zp = zpk(sys);

SYSTEM CONNECTIONS
• Series

G
G1 G2

>> G1 = tf([1 3],[1 3 2]);


>> G2 = tf([1],[5 3]);
>> G = G2*G1
Transfer function:
s+3
-------------------------
5 s^3 + 18 s^2 + 19 s + 6

>> G = series(G1,G2)

Transfer function:
s+3
-------------------------
5 s^3 + 18 s^2 + 19 s + 6
Parallel

G1
G
+

+
G2

>> G = G1+G2

Transfer function:
6 s^2 + 21 s + 11
-------------------------
5 s^3 + 18 s^2 + 19 s + 6

>> G = parallel(G1,G2)

Transfer function:
6 s^2 + 21 s + 11
-------------------------
5 s^3 + 18 s^2 + 19 s + 6

Feedback

+
G1
-

G2
>> feedback(G1,G2)

Transfer function:
5 s^2 + 18 s + 9
-------------------------
5 s^3 + 18 s^2 + 20 s + 9

>> G1/(1+G2*G1)

Transfer function:
5 s^4 + 33 s^3 + 73 s^2 + 63 s + 18
---------------------------------------------
5 s^5 + 33 s^4 + 84 s^3 + 105 s^2 + 67 s + 18

>> minreal(ans)

Transfer function:
s^2 + 3.6 s + 1.8
-------------------------
s^3 + 3.6 s^2 + 4 s + 1.8

Note that the feedback function cancels the common poles and zeros whereas you have to use the
minreal command if you use direct arithmetic operations on the transfer functions.

SOME USEFUL COMMANDS


conv: When A and B are vectors of polynomial coefficients, conv(A,B) results in the product of the two
polynomials.
poly: poly(V), when V is a vector whose elements are the coefficients of the polynomial whose roots are
the elements of V .
roots: roots(C) computes the roots of the polynomial whose coefficients are the elements of the vector
C.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy