Re: [Scilab-users] Strange behaviour of prod on rationals

2020-03-17 Thread Federico Miyara


Pierre,

Thanks for your answer.

However, I believe no involved computatins are required to get the 
correct result. The multiplication of the two polynomials from the 
denominators is straightforward, no need to solve any system, no risk of 
ill-conditioned or badly-scaled matrices.


This must be another kind of problem.

Regards,

Federico Miyara

On 17/03/2020 06:48, Perrichon wrote:


Hello Federico

I have met few months or years ago this problem when i was developping 
my  « OPTSIM Solution » software to fix parameters of a PID for 
turbines (30 mw to 2 gw) in Nyquist and Bode Plans with hydraulic 
parameters site


So I’ve seen instability of the denominator, witch damage calculus.

I don ‘t remember what I’ve done to get a cool solution, but it  has 
been a hard and severe problem with syslin, tf2ss and ss2tf instructions


Sincerely

Pierre P.

*De :*users  *De la part de* Federico 
Miyara

*Envoyé :* mardi 17 mars 2020 10:31
*À :* Users mailing list for Scilab 
*Objet :* [Scilab-users] Strange behaviour of prod on rationals


Dear all,

Look at this code (the coefficients are actually the result of pevious 
calculations):


NUM = [5.858D-09 + 2.011D-08*%s + 4.884D-08*%s^2 ...
5.858D-09 + 8.796D-10*%s + 7.028D-10*%s^2]
DEN = [0.1199597 + 7.2765093*%s + %s^2 ...
   8.336136 + 7.0282601*%s + %s^2]
q = NUM./DEN

Running it yields

   5.858D-09 +2.011D-08s +4.884D-08s²  5.858D-09 +8.796D-10s +7.028D-10s²
   -- --
   0.1199597 +7.2765093s +s²    8.336136 +7.0282601s +s²

This is, correctly, a two-component rational vector with the expected 
numerators and denominators.


Now let's evaluate

q = prod(NUM./DEN)

The prod documantation sys that the argument may be "an array of 
reals, complex, booleans, polynomials or rational fractions". It 
should provide the rational obtained by multiplying the twonumrators 
and the two denominators. However, we get


   3.432D-17 +1.230D-16s +3.079D-16s² +5.709D-17s³ +3.432D-17s⁴

1

The numeratoris right, but the expected denominator has been just 
replaced by 1


However, rewriting the command as

prod(NUM)/prod(DEN)

we get the expected result:

   3.432D-17 +1.230D-16s +3.079D-16s² +5.709D-17s³ +3.432D-17s⁴

   1.004 +61.501079s +59.597296s² +14.304769s³ +s⁴

This is quite strange!

Now we repeat with simpler polynomials:

NUM = [1-%s 2-%s]
DEN = [1+%s 2+%s]
q = NUM./DEN

We get

   1 -s  2 -s
     
   1 +s  2 +s

Now evaluate

prod(NUM./DEN)

The result is the expected one!

   2 -3s +s²
   -
   2 +3s +s²

The behavior seems to depend on the type of polynomials.

Is this a bug or there is something I'm not interpreting correctly?

Regards,

Federico Miyara


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] ?==?utf-8?q? Bug report etiquette : memory leaks in graphics

2020-03-17 Thread Antoine Monmayrant
Hello,

Following a private discussion with Samuel, I submitted a bug report on a 
memory leak in Matplot(): http://bugzilla.scilab.org/show_bug.cgi?id=16377

Cheers,

Antoine 
 
 
Le Mardi, Mars 17, 2020 15:28 CET, "Antoine Monmayrant"  a 
écrit: 
 
> Hi all,
> 
> I know that it's usually bad practice to duplicate an already existing bug.
> But it's also good practice to make one report per specific bug.
> I've just waisted two days on a nasty memory leak when plotting/clearing a 
> graph in a loop (50 iterations were enough to kill scilab).
> Looking at reports of bugzilla, I see plethora of memory leak bugs for 
> graphics (eg #14310, #14508, #14977 to name just a few) that are most 
> probably all related.
> 
> Should I report a new bug or comment on these ones, being slightly off topic?
> 
> Antoine
> 
> ___
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] Bug report etiquette : memory leaks in graphics

2020-03-17 Thread Antoine Monmayrant
Hi all,

I know that it's usually bad practice to duplicate an already existing bug.
But it's also good practice to make one report per specific bug.
I've just waisted two days on a nasty memory leak when plotting/clearing a 
graph in a loop (50 iterations were enough to kill scilab).
Looking at reports of bugzilla, I see plethora of memory leak bugs for graphics 
(eg #14310, #14508, #14977 to name just a few) that are most probably all 
related.

Should I report a new bug or comment on these ones, being slightly off topic?

Antoine

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Strange behaviour of prod on rationals

2020-03-17 Thread Perrichon
Here are examples of my process in Open loop (FTBO) or Close loop (FTBF)

Depending of managemat, D can have s14 …

 



 

 

De : Perrichon  
Envoyé : mardi 17 mars 2020 10:49
À : 'Users mailing list for Scilab' 
Objet : RE: [Scilab-users] Strange behaviour of prod on rationals

 

Hello Federico

 

I have met few months or years ago this problem when i was developping my  « 
OPTSIM Solution » software to fix parameters of a PID for turbines (30 mw to 2 
gw) in Nyquist and Bode Plans with hydraulic parameters site

So I’ve seen instability of the denominator, witch damage calculus.

I don ‘t remember what I’ve done to get a cool solution, but it  has been a 
hard and severe problem with syslin, tf2ss and ss2tf instructions 

 

Sincerely

 

Pierre P.

 

 

De : users mailto:users-boun...@lists.scilab.org> > De la part de Federico Miyara
Envoyé : mardi 17 mars 2020 10:31
À : Users mailing list for Scilab mailto:users@lists.scilab.org> >
Objet : [Scilab-users] Strange behaviour of prod on rationals

 


Dear all, 

Look at this code (the coefficients are actually the result of pevious 
calculations):

NUM = [5.858D-09 + 2.011D-08*%s + 4.884D-08*%s^2 ... 
   5.858D-09 + 8.796D-10*%s + 7.028D-10*%s^2] 
DEN = [0.1199597 + 7.2765093*%s + %s^2 ... 
   8.336136 +  7.0282601*%s + %s^2] 
q = NUM./DEN
 
Running it yields

   5.858D-09 +2.011D-08s +4.884D-08s²  5.858D-09 +8.796D-10s +7.028D-10s²  
   --  --  
   0.1199597 +7.2765093s +s²8.336136 +7.0282601s +s²   

This is, correctly, a two-component rational vector with the expected 
numerators and denominators. 

Now let's evaluate 

q = prod(NUM./DEN) 

The prod documantation sys that the argument may be "an array of reals, 
complex, booleans, polynomials or rational fractions". It should provide the 
rational obtained by multiplying the twonumrators and the two denominators. 
However, we get

   3.432D-17 +1.230D-16s +3.079D-16s² +5.709D-17s³ +3.432D-17s⁴  
     
1

The numeratoris right, but the expected denominator has been just replaced by 1

However, rewriting the command as

prod(NUM)/prod(DEN)

we get the expected result:

   3.432D-17 +1.230D-16s +3.079D-16s² +5.709D-17s³ +3.432D-17s⁴  
     
   1.004 +61.501079s +59.597296s² +14.304769s³ +s⁴   

This is quite strange!

Now we repeat with simpler polynomials:

NUM = [1-%s 2-%s]
DEN = [1+%s 2+%s]
q = NUM./DEN 

We get 

   1 -s  2 -s  
       
   1 +s  2 +s 

Now evaluate

prod(NUM./DEN)

The result is the expected one!
  
   2 -3s +s²  
   -  
   2 +3s +s²  

The behavior seems to depend on the type of polynomials. 

Is this a bug or there is something I'm not interpreting correctly?

Regards,

Federico Miyara

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Strange behaviour of prod on rationals

2020-03-17 Thread Perrichon
Hello Federico

 

I have met few months or years ago this problem when i was developping my  « 
OPTSIM Solution » software to fix parameters of a PID for turbines (30 mw to 2 
gw) in Nyquist and Bode Plans with hydraulic parameters site

So I’ve seen instability of the denominator, witch damage calculus.

I don ‘t remember what I’ve done to get a cool solution, but it  has been a 
hard and severe problem with syslin, tf2ss and ss2tf instructions 

 

Sincerely

 

Pierre P.

 

 

De : users  De la part de Federico Miyara
Envoyé : mardi 17 mars 2020 10:31
À : Users mailing list for Scilab 
Objet : [Scilab-users] Strange behaviour of prod on rationals

 


Dear all, 

Look at this code (the coefficients are actually the result of pevious 
calculations):

NUM = [5.858D-09 + 2.011D-08*%s + 4.884D-08*%s^2 ... 
   5.858D-09 + 8.796D-10*%s + 7.028D-10*%s^2] 
DEN = [0.1199597 + 7.2765093*%s + %s^2 ... 
   8.336136 +  7.0282601*%s + %s^2] 
q = NUM./DEN
 
Running it yields

   5.858D-09 +2.011D-08s +4.884D-08s²  5.858D-09 +8.796D-10s +7.028D-10s²  
   --  --  
   0.1199597 +7.2765093s +s²8.336136 +7.0282601s +s²   

This is, correctly, a two-component rational vector with the expected 
numerators and denominators. 

Now let's evaluate 

q = prod(NUM./DEN) 

The prod documantation sys that the argument may be "an array of reals, 
complex, booleans, polynomials or rational fractions". It should provide the 
rational obtained by multiplying the twonumrators and the two denominators. 
However, we get

   3.432D-17 +1.230D-16s +3.079D-16s² +5.709D-17s³ +3.432D-17s⁴  
     
1

The numeratoris right, but the expected denominator has been just replaced by 1

However, rewriting the command as

prod(NUM)/prod(DEN)

we get the expected result:

   3.432D-17 +1.230D-16s +3.079D-16s² +5.709D-17s³ +3.432D-17s⁴  
     
   1.004 +61.501079s +59.597296s² +14.304769s³ +s⁴   

This is quite strange!

Now we repeat with simpler polynomials:

NUM = [1-%s 2-%s]
DEN = [1+%s 2+%s]
q = NUM./DEN 

We get 

   1 -s  2 -s  
       
   1 +s  2 +s 

Now evaluate

prod(NUM./DEN)

The result is the expected one!
  
   2 -3s +s²  
   -  
   2 +3s +s²  

The behavior seems to depend on the type of polynomials. 

Is this a bug or there is something I'm not interpreting correctly?

Regards,

Federico Miyara

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] Strange behaviour of prod on rationals

2020-03-17 Thread Federico Miyara


Dear all,

Look at this code (the coefficients are actually the result of pevious 
calculations):


NUM = [5.858D-09 + 2.011D-08*%s + 4.884D-08*%s^2 ...
5.858D-09 + 8.796D-10*%s + 7.028D-10*%s^2]
DEN = [0.1199597 + 7.2765093*%s + %s^2 ...
   8.336136 + 7.0282601*%s + %s^2]
q = NUM./DEN

Running it yields

   5.858D-09 +2.011D-08s +4.884D-08s²  5.858D-09 +8.796D-10s +7.028D-10s²
   -- --
   0.1199597 +7.2765093s +s²    8.336136 +7.0282601s +s²

This is, correctly, a two-component rational vector with the expected 
numerators and denominators.


Now let's evaluate

q = prod(NUM./DEN)

The prod documantation sys that the argument may be "an array of reals, 
complex, booleans, polynomials or rational fractions". It should provide 
the rational obtained by multiplying the twonumrators and the two 
denominators. However, we get


   3.432D-17 +1.230D-16s +3.079D-16s² +5.709D-17s³ +3.432D-17s⁴
   
    1

The numeratoris right, but the expected denominator has been just 
replaced by 1


However, rewriting the command as

prod(NUM)/prod(DEN)

we get the expected result:

   3.432D-17 +1.230D-16s +3.079D-16s² +5.709D-17s³ +3.432D-17s⁴
   
   1.004 +61.501079s +59.597296s² +14.304769s³ +s⁴

This is quite strange!

Now we repeat with simpler polynomials:

NUM = [1-%s 2-%s]
DEN = [1+%s 2+%s]
q = NUM./DEN

We get

   1 -s  2 -s
     
   1 +s  2 +s

Now evaluate

prod(NUM./DEN)

The result is the expected one!

   2 -3s +s²
   -
   2 +3s +s²

The behavior seems to depend on the type of polynomials.

Is this a bug or there is something I'm not interpreting correctly?

Regards,

Federico Miyara
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users