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

perrichon perrichon.pierre at wanadoo.fr
Tue Sep 18 15:42:04 CEST 2018



Dears,

 

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 : 

XCOS STATE-SPACE MATRIX 

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

  B=[  5.2800843 ; 0.]          

  C=[- 5.2800843    0. ]  

  D=[ 0.  ] 

  X0[ 0. ; 0.]   

 MATLAB STATE-SPACE MATRIX    

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

  B =[ 1. ;  0.  ] 

  C=[  - 20.2281    0.  ] 

  D = [    0. ]  

  X0  = [ 0. ;  0.] 

 TRANSFER FUNCTIONS   

  TRANSMITTANCE H    

     - 20.228058s      

    --------------    

    1 + 0.7255586s ^2  

  TRANSMITTANCE MATLAB SYSMATLAB    

     - 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. 

Sincerely 

 

Pierre Perrichon

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20180918/12699cc5/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.gif
Type: image/gif
Size: 906 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20180918/12699cc5/attachment.gif>


More information about the users mailing list