Skip to Main Content Skip to Search
Login
File Exchange
MATLAB Newsgroup
Link Exchange
  Blogs  
 Contest 
MathWorks.com

Thread Subject: Working with state-space representation of multivariable models

Subject: Working with state-space representation of multivariable models

From: Micik

Date: 3 May, 2008 18:44:59

Message: 1 of 4

Hello,
I'm trying to figure out how to convert from transfer function
representation to state-space representation.
For example:
g1=tf(1,[1 1]);
g2=tf(2,[1 2]);

G = [g1,g2;g2,-g1]
will give this:

Transfer function from input 1 to output...
        1
 #1: -----
      s + 1

        2
 #2: -----
      s + 2

Transfer function from input 2 to output...
        2
 #1: -----
      s + 2

       -1
 #2: -----
      s + 1

Now, I'm trying to find a way how to convert this to state-space
model. It seems that tf2ss is not working with MIMO systems, and yet
state-space representation supports MIMO models.
If there is no MATLAB function, can you tell how to approach this
problem?
Thank you

Subject: Working with state-space representation of multivariable models

From: Craig Buhr

Date: 5 May, 2008 12:00:50

Message: 2 of 4

Use the ss command to cast the transfer function to a state-space model.

ss(G)

-craig


"Micik" <brobigi@yahoo.com> wrote in message
news:43928588-e29d-48b8-8fed-40e030c712ca@f63g2000hsf.googlegroups.com...
> Hello,
> I'm trying to figure out how to convert from transfer function
> representation to state-space representation.
> For example:
> g1=tf(1,[1 1]);
> g2=tf(2,[1 2]);
>
> G = [g1,g2;g2,-g1]
> will give this:
>
> Transfer function from input 1 to output...
> 1
> #1: -----
> s + 1
>
> 2
> #2: -----
> s + 2
>
> Transfer function from input 2 to output...
> 2
> #1: -----
> s + 2
>
> -1
> #2: -----
> s + 1
>
> Now, I'm trying to find a way how to convert this to state-space
> model. It seems that tf2ss is not working with MIMO systems, and yet
> state-space representation supports MIMO models.
> If there is no MATLAB function, can you tell how to approach this
> problem?
> Thank you


Subject: Working with state-space representation of multivariable models

From: Micik

Date: 5 May, 2008 19:36:21

Message: 3 of 4

Thank you Craig.
When browsing through help I skiped ss function because I saw:SYS =
SS(A,B,C,D) in function prototype. Help about this could be better.
That solves my problem

Subject: Working with state-space representation of multivariable models

From: Hamid Nejati

Date: 9 Sep, 2008 15:28:02

Message: 4 of 4

Micik <brobigi@yahoo.com> wrote in message <43928588-e29d-48b8-8fed-40e030c712ca@f63g2000hsf.googlegroups.com>...
> Hello,
> I'm trying to figure out how to convert from transfer function
> representation to state-space representation.
> For example:
> g1=tf(1,[1 1]);
> g2=tf(2,[1 2]);
>
> G = [g1,g2;g2,-g1]
> will give this:
>
> Transfer function from input 1 to output...
> 1
> #1: -----
> s + 1
>
> 2
> #2: -----
> s + 2
>
> Transfer function from input 2 to output...
> 2
> #1: -----
> s + 2
>
> -1
> #2: -----
> s + 1
>
> Now, I'm trying to find a way how to convert this to state-space
> model. It seems that tf2ss is not working with MIMO systems, and yet
> state-space representation supports MIMO models.
> If there is no MATLAB function, can you tell how to approach this
> problem?
> Thank you
============================================================

As I know, the number of state variables should be the same as the number of poles in the transfer function. If there are repetitive poles in the transfer function, SS command can not generate the minimum number of state variables for the problem. Let's look at this example:

Transfer function is:

H11=tf([-6.4 12.8],conv([0.5 1],[16.7 1]));
H12=tf([28.35 -18.9],conv([1.5 1],[21 1]));
H21=tf([-23.1 6.6],conv([3.5 1],[10.9 1]));
H22=tf([29.1 -19.4],conv([1.5 1],[14.4 1]));

H=[H11,H12;H21,H22];

The pole at -2/3 is repeated twice so that we have 7 poles. let's solve it by SS function the result is

sys=ss(H)

a =
            x1 x2 x3 x4 x5 x6 x7 x8
   x1 -2.06 -0.479 0 0 0 0 0 0
   x2 0.25 0 0 0 0 0 0 0
   x3 0 0 -0.3775 -0.2097 0 0 0 0
   x4 0 0 0.125 0 0 0 0 0
   x5 0 0 0 0 -0.7143 -0.127 0 0
   x6 0 0 0 0 0.25 0 0 0
   x7 0 0 0 0 0 0 -0.7361 -0.1852
   x8 0 0 0 0 0 0 0.25 0
 
b =
       u1 u2
   x1 2 0
   x2 0 0
   x3 1 0
   x4 0 0
   x5 0 2
   x6 0 0
   x7 0 2
   x8 0 0
 
c =
            x1 x2 x3 x4 x5 x6 x7 x8
   y1 -0.3832 3.066 0 0 0.45 -1.2 0 0
   y2 0 0 -0.6055 1.384 0 0 0.6736 -1.796
 
d =
       u1 u2
   y1 0 0
   y2 0 0
 
Continuous-time model.


Which has 8 variables instead of 7. But the minimum number of variables is 7 and the beautiful 7 variable configuration is as follows:

A=diag([-2 -0.0599 -0.6667 -0.0476 -0.2857 -0.0917 -0.0694]);
B=[1 0;1 0;0 1; 0 1; 1 0; 1 0; 0 1];
C=[-1.5802 0.8138 1.9385 -1.0385 0 0 0 ; 0 0 3.0078 0 -1.7838 1.1783 -1.6605];

You can check both of the results by:

I8=eye(8);
syms s;
trans1=sys.c*(s*I8-sys.a)^(-1)*sys.b;
simplify(trans1)

OR

I7=eye(7);
trans2=C*(s*I7-A)^(-1)*B;
simplify(trans2);

Both of them can generate the transfer function.

My question is that how we can generate the minimum number of variables required for state space realization for this problem using MATLAB easily.

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

envelope graphic E-mail this page to a colleague

Public Submission Policy
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.
Related Topics