<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Thanks Lucien, however, to complete the task, you should first
      reopen bug #15368 at
      <a class="moz-txt-link-freetext" href="https://bugzilla.scilab.org/show_bug.cgi?id=15368">https://bugzilla.scilab.org/show_bug.cgi?id=15368</a></p>
    <p>S.<br>
    </p>
    <p>Can you create a bug<br>
    </p>
    <div class="moz-cite-prefix">Le 25/09/2019 à 16:06, lucien.povy a
      écrit :<br>
    </div>
    <blockquote type="cite"
      cite="mid:2761d5f1-63e8-b343-baae-516f5abff7b9@free.fr">Hello all
      !
      <br>
      I believe that there are new problems with "freson.sci" program in
      CACSD module.
      <br>
      If you are running two programs, one for continuous system another
      for sampled system,
      <br>
      sometimes you have a result as [ ] : you must improve the accuracy
      of result ;("ffreson.sci" program is proposed).
      <br>
      (Bugs not bugs ???? yes bugs : see in text REMARK.
      <br>
      <br>
      1 . Example : continuous system.
      <br>
         s=%s ; num = s+1.4*s^2+1.4*s^3+0.4*s^4 ; den =
      0.5+0.8*s+1.4*s^2+1.4*s^3+0.4*s^4 ;
      <br>
         h = syslin("c",num,den)
      <br>
         fr = freson(h)
      <br>
         fr =
      <br>
              []
      <br>
         gainplot(h,0.01,1)
      <br>
         with my new function "ffreson.sci" :
      <br>
         ffreson(h)//La nouvelle fonction.
      <br>
         ans  =
      <br>
                  0.111164226146
      <br>
      <br>
      2 . Example : sampled system.
      <br>
         The exercise in "help" page of "freson" with sampling period
      Ts=0.01s : the program gives "fr=[]" .
      <br>
         With sampling period Ts=0.04s you have a good result (problem
      of accuracy) : run the example in help
      <br>
         and change sampling period.
      <br>
      <br>
      3 . My opinion and the proposed solutions.
      <br>
      <br>
         - For continuous system :
      <br>
         If you calculated the function "h(s)*h(-s)" by convolution, the
      result, as I mentioned before,
      <br>
         must be an even rational : with "horner" it's not, but by
      convolution the result is OK. (take a look on "ffreson" program :
      <br>
         you find a program "hps_hms" which gives "h(s)*h(-s)" by
      convolution).
      <br>
         - After that, the numerator of "h(s)*h(-s)"derivative is
      calculated, this polynomial "der" must be odd (s=0 is a particular
      root of "der" which   corresponds to zero frequency). If you
      excluded this root from "der", the new polynomial is even, and you
      can solve
      <br>
          the finding roots problem with a new polynomial in u=s*s as
      variable.If "rac" is the vector of square roots of this new
      polynomial, the vector "r", roots of "der", is r=[rac;-rac;0]. You
      divide by two the degree of "der" and increase the accuracy
      <br>
          of the result : I use this method in my program.
      <br>
      <br>
          REMARK : If you run "freson" and "ffreson", step by step, when
      you calculated the roots of derivatives, the number of roots are
      not the same !!!  (see "Exemple freson.pdf").
      <br>
      <br>
          - For sampled system :
      <br>
          - We calculated the function "hh=h(z)*h(1/z)", also with
      convolution, the result of convolution gives for coefficients
      vectors
      <br>
          of "hh" a symmetric vector [c1,c2, ....cn], (for numerator and
      denominator), c1=cn, c2=c(n-1) etc ....see "hpz_hiz" at the end of
      function "ffreson.sci".
      <br>
          - After that we take account of
      "z^(degree(h.num)-degree(h.den)) in "hh", and calculated the
      numerator of derivative of new
      <br>
          "hh".
      <br>
          - Like for continuous system, you excluded "z=1" and "z=-1",
      which corresponds to frequencies f0=0 and f1=1/*(2*ts) (Nyquist
      frequency).
      <br>
          - At the end you calculated the roots "r" of new polynomial
      (the degree of polynomial decreases by two) . A "good" solution
      must respect "rp=exp(%i*%pi*fp*ts)"; so |rp|=1 and fp>0. The
      end of my new program is the same as "freson.sci".
      <br>
          I use those methods in the new program "ffreson.sci".
      <br>
          REMARK : the same.
      <br>
      <br>
          Yours sincerely
      <br>
          <a class="moz-txt-link-abbreviated" href="mailto:lucien.povy@free.fr">lucien.povy@free.fr</a>
      <br>
      <br>
          PS
      <br>
          I attached the new function "ffreson.sci" and a report
      ("Exemples freson.pdf", sorry in french language) to my email.
      <br>
          In "ffreson" you have two functions "hps_hms" for h(s)*h(-s)
      and  "hpz_hiz" for h(z)*h(1/z).
      <br>
          This program "ffreson" can be used for "iodelay systems", and
      " hps_hms" , "hpz_hiz" used in m_margin and p_margin
      <br>
          to improve the accuracy of results.
      <br>
      <br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:users@lists.scilab.org">users@lists.scilab.org</a>
<a class="moz-txt-link-freetext" href="https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users">https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users</a>
</pre>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
<a class="moz-txt-link-freetext" href="http://www.utc.fr/~mottelet">http://www.utc.fr/~mottelet</a>
</pre>
  </body>
</html>