[Scilab-users] tf2ss error in Scilab, comparing Scilab and Matlab

classic Classic list List threaded Threaded
1 message Options
Perrichon Pierre Perrichon Pierre
Reply | Threaded
Open this post in threaded view

[Scilab-users] tf2ss error in Scilab, comparing Scilab and Matlab



We here simulate on xcos and matlab/simulink platform, an oscillator to get the behavior of a hydraulic water

harmmer in a penstock, following a transmittance of 2 order : b*s/(1+a*s^2).

Our main reference is based on a canonic method using only two integrators and we also do some tests with a

state space representation, with xcos and simulink

The tfss2 function to go from transmittance state-space representation,  in xcos, gives results :


 A =[ 0.  - 1.3782485 ; 1.    0. ]        

  B=[  5.2800843 ; 0.]         

  C=[- 5.2800843    0. ] 

  D=[ 0.  ]

  X0[ 0. ; 0.]  


A =[ 0.  - 0.7256 ; 1.    0.]      

  B =[ 1. ;  0.  ]

  C=[  - 20.2281    0.  ]

  D = [    0. ] 

  X0  = [ 0. ;  0.]



     - 20.228058s     


    1 + 0.7255586s ^2 


     - 27.877756s     


    1 + 1.3781698s ^2   


Entering in a numerical scop XY, X=canonic method, Y=State-Space method, we cleary see a correct behavior

X=Y with Matlab/Simulink coefficients, and a a very strong dispersion with Scilab/Xcos computing parameters.

On another way, and because we need a stable state at t=0 (no oscillation), apparently, only the canonic

method runs in all modes (sequence=1 ou 2 in the script). The initial vector X0 is only able to controll the first

point, but not the stability in this case, so it works only with a zero initial condition.


Program Xcos/Scilab, ou Matlab/Simulink, schemes, results are available in buggzilla n°15771

Tests have been done with Scilab 5.5.2 under windows W10.


To read you.



Pierre Perrichon

users mailing list
[hidden email]