octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #63052] (Control) Inverse operation with trans


From: Luiz Antonio Maccari Junior
Subject: [Octave-bug-tracker] [bug #63052] (Control) Inverse operation with transfer function variables resulting in wrong results
Date: Mon, 12 Sep 2022 11:51:37 -0400 (EDT)

URL:
  <https://savannah.gnu.org/bugs/?63052>

                 Summary: (Control) Inverse operation with transfer function
variables resulting in wrong results
                 Project: GNU Octave
               Submitter: luiz
               Submitted: seg 12 set 2022 15:51:36 UTC
                Category: Octave Forge Package
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: Luiz Antonio Maccari Jr.
        Originator Email: 
             Open/Closed: Open
                 Release: 7.2.0
         Discussion Lock: Any
        Operating System: Microsoft Windows


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: seg 12 set 2022 15:51:36 UTC   By: Luiz Antonio Maccari Junior <luiz>
Hello,

I was trying to obtain the transfer function from a third order state-space
system by means of the equation C*inv(s*eye(3)-A)*B+D. However, the results in
linux (GNU Octave 7.2) are correct and in windows 10 are wrong (also GNU
Octave 7.2).

The test code is:

%%%%%%%%%%%%%%%%%%%%%%%%%

clear;
clc;

pkg load control;
pkg load signal;

A = [-1 0 10;
         2 -4 6;
        -9 -8 -3];

B= [1;1;1];
C = [1 0 0];
D=2;

sis = ss(A,B,C,D);

s = tf([1 0],[1]);

FT = C*inv(s*eye(3)-A)*B+D
FT= minreal (FT)

[num,den] =ss2tf (A,B,C,D);
FT2 = tf (num,den)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

In linux the result is:

warning: tf: converting to minimal state-space for MIMO TF interconnections
warning: called from
    __sys_connect__ at line 103 column 5
    mtimes at line 58 column 7
    asdasd at line 20 column 4

warning: tf: converting to minimal state-space for MIMO TF interconnections
warning: called from
    __sys_connect__ at line 103 column 5
    mtimes at line 58 column 7
    minus at line 45 column 7
    asdasd at line 20 column 4

warning: tf: converting to minimal state-space for MIMO TF interconnections
warning: called from
    __sys_connect__ at line 103 column 5
    mtimes at line 58 column 7
    minus at line 45 column 7
    asdasd at line 20 column 4

warning: tf: converting to minimal state-space for MIMO TF interconnections
warning: called from
    __sys_connect__ at line 103 column 5
    mtimes at line 58 column 7
    asdasd at line 20 column 4

warning: tf: converting to minimal state-space for MIMO TF interconnections
warning: called from
    __sys_connect__ at line 103 column 5
    mtimes at line 58 column 7
    asdasd at line 20 column 4


Transfer function 'FT' from input 'u1' to output ...

      2 s^3 + 17 s^2 + 332.4 s + 1222
 y1:  -------------------------------
         s^3 + 8 s^2 + 157 s + 580

Continuous-time model.

Transfer function 'FT' from input 'u1' to output ...

      2 s^3 + 17 s^2 + 332.4 s + 1222
 y1:  -------------------------------
         s^3 + 8 s^2 + 157 s + 580

Continuous-time model.

Transfer function 'FT2' from input 'u1' to output ...

      2 s^3 + 17 s^2 + 331 s + 1180
 y1:  -----------------------------
        s^3 + 8 s^2 + 157 s + 580

Continuous-time model.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

This result above is correct, FT = FT2.

In windows 10 the result is:

Continuous-time model.
warning: tf: converting to minimal state-space for MIMO TF interconnections
warning: called from
    __sys_connect__ at line 103 column 5
    mtimes at line 58 column 7
    teste at line 23 column 4


warning: tf: converting to minimal state-space for MIMO TF interconnections
warning: called from
    __sys_connect__ at line 103 column 5
    mtimes at line 58 column 7
    minus at line 45 column 7
    teste at line 23 column 4


warning: tf: converting to minimal state-space for MIMO TF interconnections
warning: called from
    __sys_connect__ at line 103 column 5
    mtimes at line 58 column 7
    minus at line 45 column 7
    teste at line 23 column 4


warning: tf: converting to minimal state-space for MIMO TF interconnections
warning: called from
    __sys_connect__ at line 103 column 5
    mtimes at line 58 column 7
    teste at line 23 column 4


warning: tf: converting to minimal state-space for MIMO TF interconnections
warning: called from
    __sys_connect__ at line 103 column 5
    mtimes at line 58 column 7
    teste at line 23 column 4


Transfer function 'FT' from input 'u1' to output ...


      2 s^2 + 80.76 s + 291
 y1:  ---------------------
      s^2 + 38.66 s + 142.5


Continuous-time model.


Transfer function 'FT' from input 'u1' to output ...


      2 s^2 + 80.76 s + 291
 y1:  ---------------------
      s^2 + 38.66 s + 142.5


Continuous-time model.


Transfer function 'FT2' from input 'u1' to output ...


      2 s^3 + 17 s^2 + 331 s + 1180
 y1:  -----------------------------
        s^3 + 8 s^2 + 157 s + 580


Continuous-time model. 

%%%%%%%%%%%%%%%%%%

As one can see FT is different from FT2. It was expected the same result as
the one obtained on linux. 








    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?63052>

_______________________________________________
Mensagem enviada pelo Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]