home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d1xx / d164 / polyroot.lha / PolyRoot / Readme.Poly < prev    next >
Text File  |  1988-11-22  |  10KB  |  245 lines

  1.  
  2. Rev 2.01  13JUL87  -  A couple small usage quirks removed, helpfile expanded.
  3.  
  4. ----------------------------------------------------------------------------
  5.  
  6.  
  7.   PolyRoot           Finds all roots of a given polynomial        July,1987
  8. (Version 2.0)
  9.  
  10.  
  11.   By Jon Giorgini, 1321 Cherokee Avenue, West St. Paul, MN  55118-2005
  12.   
  13.   This Archive should contain the following files:
  14.  
  15.        PolyRoot       -  Tokenized AmigaBASIC 1.2 source.
  16.        PolyRoot.info  -  Icon DATA
  17.        PolyRoot.TXT   -  On-line help file.
  18.        README.POLY    -  This information file
  19.        EXECUTE.ME     -  Renames .inf file, sets PROTECT
  20.  
  21.  
  22.   REQUIREMENTS:
  23.  
  24.        AmigaBASIC
  25.        Amiga computer with 512K minimum.
  26.        System configured with 80 columns and the default system font.
  27.  
  28.  
  29.   INSTALLATION:
  30.  
  31.        First type EXECUTE EXECUTE.ME to rename the .info file.
  32.  
  33.        If the program will be started from the Workbench by clicking,
  34.     on its icon, place PolyRoot.TXT in the same directory as PolyRoot and
  35.     PolyRoot.info.
  36.  
  37.        If AmigaBASIC will be started from the CLI, place PolyRoot.TXT
  38.     in the same directory as AmigaBASIC.
  39.  
  40.   PURPOSE:
  41.  
  42.        Certain types of engineering problems involve determining the 
  43.     roots of polynomials. Stability and control problems encountered
  44.     in aircraft design are a case in point.  Polynomial roots contain 
  45.     information which identifies what oscillatory modes are present
  46.     when an aircraft is subjected to a perturbation, their period and
  47.     time to double and half amplitude, along with other information.
  48.  
  49.        Convenient determination of these roots is very helpful and most
  50.     scientific mainframes have a routine available to find these solutions.
  51.     However, many mainframes remain heavily influenced by the BATCH
  52.     entry mentality; cumbersome and irritating user interfaces are the
  53.     norm, often making usage of on-line routines exasperating and 
  54.     inconvenient (in my experience).
  55.  
  56.        This program was written to shamelessly exploit the greater
  57.     flexibility of a dedicated microcomputer by bringing a powerful
  58.     solution algorithm and a helpful user interface together.
  59.  
  60.        The program is written in a language available on every Amiga
  61.     and distributed in source form so the user may customize it for 
  62.     specialized purposes.  While the numeric processing abilities and
  63.     resources available to the Amiga are less than those of a mainframe,
  64.     the nature of the problems this program solves are such that
  65.     solution time is acceptable.
  66.  
  67.  
  68.   PROGRAM NOTES:
  69.  
  70.        The method for switching screens in this program may need some
  71.     comment, since it is done under local program control.  
  72.     
  73.        There is no Intuituion back/front gadget on the screen used by this
  74.     program. If you need to access another task while running this program,
  75.     use the "BACK" menu option.  When returning to the program, bring its
  76.     screen to the front, click once in the window to inform the system
  77.     this is the active window.  Then use the menu option "FRONT" to 
  78.     inform the program you have returned.
  79.  
  80.        If you want to compile and distribute this program, add the compiled
  81.     code into this archive.  It MUST be distributed with all files listed
  82.     above, including an UNMODIFIED copy of the source.
  83.  
  84.     Execution Warning Messages:
  85.  
  86.        "No solution within xxxxx after yyy iterations"  --
  87.          Means a root has not converged.  Residuals and tolerance values
  88.          will reflect this.  Try adjusting the tolerance and iteration
  89.          settings as described in the on-line help file. 
  90.  
  91.        "Division by zero detected.  Continuing."  --
  92.          Usually means process has converged very rapidly.  Not to worry.
  93.  
  94.        "Overflow detected. Continuing."  --
  95.          Numbers too big for BASIC to handle are being generated.  Usually
  96.          means one or more roots will be inaccurate. Be careful in accepting
  97.          results, as roots, residuals, and tolerance could all be misleading.
  98.          Most common with very high (>10th, say) order equations.
  99.  
  100.        "Over yyy Newtonian iterations"  -- 
  101.          Root refinement process has not converged within tolerance.  Usually
  102.          means the answers will be close, but the error may  be larger
  103.          than you specified.  This will be reflected in the tolerance column.
  104.          
  105.  
  106.      What is Happening?
  107.  
  108.  
  109.            A polynomial with general form
  110.  
  111.                   n      n-1
  112.                        x  + a x    + ... + a    x  +  a       = 0,
  113.                              0              (n-2)      (n-1) 
  114.  
  115.            may be written as
  116.  
  117.              2             (n-2)      (n-3)
  118.        0 = (x  + px + q) (x      + b x      + ... b    x  + b     ) + Rx + S
  119.                                     0              (n-4)     (n-3)
  120.       
  121.  
  122.            Rx + S is a linear remainder term that, if equal to zero, means
  123.        the original polynomial is exactly divisible by the quadratic factor.
  124.        Bairstow's method assumes intial guesses for p and q, then refines
  125.        the factors by correction factors
  126.   
  127.                            p = p + Delta-p
  128.                            q = q + Delta-q
  129.        
  130.        with the goal of making  R(p,q) and S(p,q) zero.
  131.  
  132.            In short, the algorithm pulls quadratic factors out of the
  133.        polynomial, solves them using the quadratic equation, then repeats
  134.        the process on the now-reduced-order polynomial until a complete
  135.        solution is obtained.
  136.  
  137.            There is some additional theory involving Taylor's series 
  138.        expansions behind the computation of Delta-p and Delta-q which
  139.        requires the program to determine partial derivatives, but this
  140.        is the central gist.
  141.  
  142.   
  143.  
  144.        The author can be reached at
  145.  
  146.                Miller's  BBS (612) 698-1485
  147.  
  148.  
  149.   EXAMPLES:
  150.  
  151.        What follows are some sample program outputs.
  152.  
  153.  
  154.  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  155.  
  156.  
  157.  Tol = .00001                                                    Iter = 150
  158.  
  159.  1(x^4) +-3(x^2) +-4  =  0
  160.  
  161.                   Roots                          Residuals         Tolerance
  162.   -------------------------------------   -----------------------  ---------
  163.          Real             Imaginary          Real       Imaginary      +
  164.          part               part             part         part         -
  165.   -------------------------------------   -----------------------  ---------
  166.     0.000000000D+00    1.000000000D+00     0.00D+00      0.00D+00  6.511D-21
  167.     0.000000000D+00   -1.000000000D+00     0.00D+00      0.00D+00  6.511D-21
  168.     2.000000000D+00    0.000000000D+00     0.00D+00      0.00D+00  1.534D-10
  169.    -2.000000000D+00    0.000000000D+00     0.00D+00      0.00D+00  1.534D-10
  170.   -------------------------------------   -----------------------  ---------
  171.  
  172.  
  173.  
  174.  
  175.  Tol = .00001                                                    Iter = 150
  176.  
  177.  2.5(x^5) + 10(x^4) +-22.5(x^3) + 35(x^2) + 125(x^1) +-1500  =  0
  178.  
  179.                   Roots                          Residuals         Tolerance
  180.   -------------------------------------   -----------------------  ---------
  181.          Real             Imaginary          Real       Imaginary      +
  182.          part               part             part         part         -
  183.   -------------------------------------   -----------------------  ---------
  184.     3.000000000D+00    0.000000000D+00     0.00D+00      0.00D+00  4.973D-13
  185.    -4.000000000D+00    0.000000000D+00     0.00D+00      0.00D+00  4.973D-13
  186.     1.000000000D+00    3.000000000D+00    -9.09D-13     -3.41D-13  2.216D-07
  187.     1.000000000D+00   -3.000000000D+00    -9.09D-13      3.41D-13  2.216D-07
  188.    -5.000000000D+00    0.000000000D+00    -5.07D-10      0.00D+00  6.362D-07
  189.   -------------------------------------   -----------------------  ---------
  190.  
  191.  
  192.  
  193.  
  194.  Tol = .00001                                                    Iter = 150
  195.  
  196. -3(x^10) + 2.33(x^9) +-.56(x^5) + 12.23(x^4) + .655(x^3) +-1.899  =  0
  197.  
  198.                   Roots                          Residuals         Tolerance
  199.   -------------------------------------   -----------------------  ---------
  200.          Real             Imaginary          Real       Imaginary      +
  201.          part               part             part         part         -
  202.   -------------------------------------   -----------------------  ---------
  203.    -1.450920228D-02    6.251604431D-01    -4.04D-09     -6.62D-09  1.202D-15
  204.    -1.450920228D-02   -6.251604431D-01    -4.04D-09      6.62D-09  1.202D-15
  205.     6.183918274D-01    0.000000000D+00     2.03D-14      0.00D+00  1.202D-08
  206.    -6.430871935D-01    0.000000000D+00     5.84D-15      0.00D+00  1.202D-08
  207.     1.425043395D+00    0.000000000D+00    -2.84D-14      0.00D+00  4.263D-09
  208.    -1.141984249D+00    0.000000000D+00    -5.33D-15      0.00D+00  4.263D-09
  209.     7.944602175D-01    1.054297618D+00     1.00D-07      6.61D-07  9.270D-08
  210.     7.944602175D-01   -1.054297618D+00     1.00D-07     -6.61D-07  9.270D-08
  211.    -5.207995719D-01    1.078915331D+00     6.88D-07      4.74D-07  1.665D-06
  212.    -5.207995719D-01   -1.078915331D+00     6.88D-07     -4.74D-07  1.665D-06
  213.   -------------------------------------   -----------------------  ---------
  214.  
  215.  
  216.  
  217.  
  218.  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
  219.   
  220.  
  221.    LEGAL:
  222.  
  223.  
  224.        POLYROOT is Public Domain software. POLYROOT may be freely distributed
  225.    as long as it remains UNMODIFIED with all the related files included and 
  226.    with correct author credit given.  It may not be sold commercially or 
  227.    distributed on "public domain" disks selling for more than $8.00 without 
  228.    the written permission of the author.
  229.  
  230.        If the program is of value to you, drop me a postcard and let me know.
  231.    
  232.        THE AUTHOR MAKES NO WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS
  233.    SOFTWARE.  THE ENTIRE RISK AS TO THE QUALITY AND FITNESS OF THE SOFTWARE
  234.    RESIDES WITH THE USER.  IN NO CASE SHALL THE AUTHOR BE LIABLE FOR
  235.    DAMAGES RESULTING FROM A DEFECT IN THE SOFTWARE EVEN IF ADVISED OF SUCH
  236.    A DEFECT.  IN USING THIS SOFTWARE, YOU AGREE TO BE BOUND BY THESE TERMS.
  237.  
  238.                                1987  Jon Giorgini
  239.  
  240.                   [This notice may not be removed or altered]
  241.  
  242.  
  243.        
  244.                            *** END OF FILE ***
  245.