# How can we represent this transfer function into state space representation in MATLAB?

18 visualizzazioni (ultimi 30 giorni)
Hind Aljallaf il 1 Mag 2023
Risposto: Sam Chak il 11 Mag 2023
How can we represent this transfer function into state space representation in MATLAB? What are the commands that are regarding state space?
##### 1 CommentoMostra -1 commenti meno recentiNascondi -1 commenti meno recenti
Star Strider il 1 Mag 2023
Use the appropriate Control System Toolbox functions.

Accedi per commentare.

### Risposte (2)

Sachin il 11 Mag 2023
Hi
I understand that you want to find a state space representation of the transfer function.
For this, I suggest you to use MathWorks Control System Toolbox.
Follow these steps for a workaround:
1. First, find the state space form on the transfer function using the “tf2ss” function. This output will be in the form of [A, B, C, D].
2. After finding the state space form use the “canon” function to find the state space form.
[A_c, B_c, C_c, D_c] = canon(A, B, C, D, 'companion') %transform linear model into the canonical realization
Refer the below MATLAB documentation for state space Realizations:
Refer to this MATLAB page for the “canon” function
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

Sam Chak il 11 Mag 2023
As far as I know, there is no MATLAB command in the Control System Toolbox for directly computing the controllable canonical form. The canon() command only convert the identified state-space model to either the modal or companion canonical form.
G = tf([1 3], [1 3 2])
G = s + 3 ------------- s^2 + 3 s + 2 Continuous-time transfer function.
sys = ss(G); % convert from TF to random SS (non-unique)
You need to write a code to get the Observable Canonical form first and then transform it to Controllable Canonical form
obsys = ss(Aa, Bb, Cc, Dd) % Observable Canonical form
obsys = A = x1 x2 x1 0 -2 x2 1 -3 B = u1 x1 3 x2 1 C = x1 x2 y1 0 1 D = u1 y1 0 Continuous-time state-space model.
%% State-space in Conventional Controllable Canonical form
A = Aa';
B = Cc';
C = Bb';
D = Dd;
ctsys = ss(A, B, C, D) % Controllable Canonical form
ctsys = A = x1 x2 x1 0 1 x2 -2 -3 B = u1 x1 0 x2 1 C = x1 x2 y1 3 1 D = u1 y1 0 Continuous-time state-space model.
cttf = tf(ctsys)
cttf = s + 3 ------------- s^2 + 3 s + 2 Continuous-time transfer function.
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

### Categorie

Scopri di più su Dynamic System Models in Help Center e File Exchange

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by