Signal library problem

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Signal library problem

JORGE JONATHAN DIAZ PIÑA
hi!
i'm using your library in Octave and i have a problem in the function ss2tf, the value returned of the function should be a vectors and the size of this depend of the grade of the matrix, but the function returns a vectors who depend of te numbers diferents of zero.
if you don't understand me i put a example:

--this is mat:
A=[1 1 0; 1 -1 0; 0 0 -2];

B=[2; 1; 1];

C=[1 0 1];

D=[0];

---Using matlab the result is this:

>> [ num , den ] = ss2tf( A, B, C, D )

num =

     0     1     2     0


den =

     1     1    -2     0


---Using octave the result is:

[ num , den ] = ss2tf( A, B, C, D )
num =  1
den =

   1  -1


---------------
octave don't return the correct result and send a diferent size 



Reply | Threaded
Open this post in threaded view
|

Re: Signal library problem

Dmitri A. Sergatskov
On Thu, May 23, 2019 at 8:18 AM JORGE JONATHAN DIAZ PIÑA
<[hidden email]> wrote:

>
> hi!
> i'm using your library in Octave and i have a problem in the function ss2tf, the value returned of the function should be a vectors and the size of this depend of the grade of the matrix, but the function returns a vectors who depend of te numbers diferents of zero.
> if you don't understand me i put a example:
>
> --this is mat:
> A=[1 1 0; 1 -1 0; 0 0 -2];
>
> B=[2; 1; 1];
>
> C=[1 0 1];
>
> D=[0];
>
> ---Using matlab the result is this:
>
> >> [ num , den ] = ss2tf( A, B, C, D )
>
> num =
>
>      0     1     2     0
>
>
> den =
>
>      1     1    -2     0
>
>
> ---Using octave the result is:
>
> [ num , den ] = ss2tf( A, B, C, D )
> num =  1
> den =
>
>    1  -1
>
>
> ---------------
> octave don't return the correct result and send a diferent size
>
>

I cannot reproduce this problem.

What is your
octave version?
OS ?
signal package version?
control package version?

Regards,

Dmitri.
--


Reply | Threaded
Open this post in threaded view
|

Re: Signal library problem

nrjank

> A=[1 1 0; 1 -1 0; 0 0 -2];
>
> B=[2; 1; 1];
>
> C=[1 0 1];
>
> D=[0];
>
> ---Using matlab the result is this:
>
> >> [ num , den ] = ss2tf( A, B, C, D )
>
> num =
>
>      0     1     2     0
>
>
> den =
>
>      1     1    -2     0
>
>
> ---Using octave the result is:
>
> [ num , den ] = ss2tf( A, B, C, D )
> num =  1
> den =
>
>    1  -1
>
>


I do not get the same result as you.  
Using Octave 5.1.0 on Windows 10, signal v1.4.1, control 3.2.0

>> pkg load signal
>> A = [1 1 0; 1 -1 0; 0   0 2], B = [2;1;1], C = [1 0  1], D = [0]
A =
   1   1   0
   1  -1   0
   0   0   2
B =
   2
   1
   1
C =
   1   0   1
D = 0
>> [num,den]=ss2tf(A,B,C,D)
num =
   3.0000  -1.0000  -8.0000
den =
   1.0000  -2.0000  -2.0000   4.0000


and in Matlab 2018b:

>> A = [1 1 0; 1 -1 0; 0   0 2], B = [2;1;1], C = [1 0  1], D = [0]
A =
     1     1     0
     1    -1     0
     0     0     2
B =
     2
     1
     1
C =
     1     0     1
D =
     0
>> [num,den]=ss2tf(A,B,C,D)
num =
         0    3.0000   -1.0000   -8.0000
den =
    1.0000   -2.0000   -2.0000    4.0000



other than the extra zero in the numerator (is that a significant compatibility bug?) these answers seem equivalent. 




Reply | Threaded
Open this post in threaded view
|

Re: Signal library problem

Mike Miller-4
On Thu, May 23, 2019 at 13:18:18 -0400, Nicholas Jankowski wrote:
> other than the extra zero in the numerator (is that a significant
> compatibility bug?) these answers seem equivalent.

That compatibility bug is https://savannah.gnu.org/bugs/?43947

--
mike



signature.asc (849 bytes) Download Attachment