hkBattousai
hkBattousai

Reputation: 10931

How do I use tf2ss() with discrete-time systems?

A have a discrete time transfer function,

H(z-1) = B(z-1) / A(z-1) = (b0 + b1z-1) / (a0 + a1z-1 + a2z-2).

whose numerator and denominator are represented in the code as:

Num = [b0, b1];
Den = [a0, a1, a2];
Ts = 0.01; % Sampling period`

How do I use tf2ss() to obtain the A, B, C and D state space matrices?
Do I directly call tf2ss() like we do in continuous time system?
Or is there any other built-in Matlab function for this purpose?

Upvotes: 1

Views: 9448

Answers (3)

Ejup Hoxha
Ejup Hoxha

Reputation: 11

first of all you should build your continuous state space model by using this: sys_state_space = tf2ss(a,b) after that you should use this: sys_ss_discrete = c2d(sys_state_space,T*-sampling*,'zoh')

then you have the state space discrete model of the system.

Upvotes: 1

ninguem
ninguem

Reputation: 119

Transfer functions to state space conversions are equal in continuous and discrete models. But, if you want the matrices in a system represented discretely you might want to do something like this

S = ss(tf(Num,Den,T))

Upvotes: 2

Eitan T
Eitan T

Reputation: 32930

Maybe I'm missing something in your question, but you can use it simply like this:

[A, B, C, D] = tf2ss(Den, Num);

You can also refer to the official tf2ss documentation to confirm this.

Upvotes: 2

Related Questions