home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 2: PC
/
frozenfish_august_1995.bin
/
bbs
/
d01xx
/
d0164.lha
/
PolyRoot
/
Readme.Poly
< prev
next >
Wrap
Text File
|
1988-11-22
|
10KB
|
245 lines
Rev 2.01 13JUL87 - A couple small usage quirks removed, helpfile expanded.
----------------------------------------------------------------------------
PolyRoot Finds all roots of a given polynomial July,1987
(Version 2.0)
By Jon Giorgini, 1321 Cherokee Avenue, West St. Paul, MN 55118-2005
This Archive should contain the following files:
PolyRoot - Tokenized AmigaBASIC 1.2 source.
PolyRoot.info - Icon DATA
PolyRoot.TXT - On-line help file.
README.POLY - This information file
EXECUTE.ME - Renames .inf file, sets PROTECT
REQUIREMENTS:
AmigaBASIC
Amiga computer with 512K minimum.
System configured with 80 columns and the default system font.
INSTALLATION:
First type EXECUTE EXECUTE.ME to rename the .info file.
If the program will be started from the Workbench by clicking,
on its icon, place PolyRoot.TXT in the same directory as PolyRoot and
PolyRoot.info.
If AmigaBASIC will be started from the CLI, place PolyRoot.TXT
in the same directory as AmigaBASIC.
PURPOSE:
Certain types of engineering problems involve determining the
roots of polynomials. Stability and control problems encountered
in aircraft design are a case in point. Polynomial roots contain
information which identifies what oscillatory modes are present
when an aircraft is subjected to a perturbation, their period and
time to double and half amplitude, along with other information.
Convenient determination of these roots is very helpful and most
scientific mainframes have a routine available to find these solutions.
However, many mainframes remain heavily influenced by the BATCH
entry mentality; cumbersome and irritating user interfaces are the
norm, often making usage of on-line routines exasperating and
inconvenient (in my experience).
This program was written to shamelessly exploit the greater
flexibility of a dedicated microcomputer by bringing a powerful
solution algorithm and a helpful user interface together.
The program is written in a language available on every Amiga
and distributed in source form so the user may customize it for
specialized purposes. While the numeric processing abilities and
resources available to the Amiga are less than those of a mainframe,
the nature of the problems this program solves are such that
solution time is acceptable.
PROGRAM NOTES:
The method for switching screens in this program may need some
comment, since it is done under local program control.
There is no Intuituion back/front gadget on the screen used by this
program. If you need to access another task while running this program,
use the "BACK" menu option. When returning to the program, bring its
screen to the front, click once in the window to inform the system
this is the active window. Then use the menu option "FRONT" to
inform the program you have returned.
If you want to compile and distribute this program, add the compiled
code into this archive. It MUST be distributed with all files listed
above, including an UNMODIFIED copy of the source.
Execution Warning Messages:
"No solution within xxxxx after yyy iterations" --
Means a root has not converged. Residuals and tolerance values
will reflect this. Try adjusting the tolerance and iteration
settings as described in the on-line help file.
"Division by zero detected. Continuing." --
Usually means process has converged very rapidly. Not to worry.
"Overflow detected. Continuing." --
Numbers too big for BASIC to handle are being generated. Usually
means one or more roots will be inaccurate. Be careful in accepting
results, as roots, residuals, and tolerance could all be misleading.
Most common with very high (>10th, say) order equations.
"Over yyy Newtonian iterations" --
Root refinement process has not converged within tolerance. Usually
means the answers will be close, but the error may be larger
than you specified. This will be reflected in the tolerance column.
What is Happening?
A polynomial with general form
n n-1
x + a x + ... + a x + a = 0,
0 (n-2) (n-1)
may be written as
2 (n-2) (n-3)
0 = (x + px + q) (x + b x + ... b x + b ) + Rx + S
0 (n-4) (n-3)
Rx + S is a linear remainder term that, if equal to zero, means
the original polynomial is exactly divisible by the quadratic factor.
Bairstow's method assumes intial guesses for p and q, then refines
the factors by correction factors
p = p + Delta-p
q = q + Delta-q
with the goal of making R(p,q) and S(p,q) zero.
In short, the algorithm pulls quadratic factors out of the
polynomial, solves them using the quadratic equation, then repeats
the process on the now-reduced-order polynomial until a complete
solution is obtained.
There is some additional theory involving Taylor's series
expansions behind the computation of Delta-p and Delta-q which
requires the program to determine partial derivatives, but this
is the central gist.
The author can be reached at
Miller's BBS (612) 698-1485
EXAMPLES:
What follows are some sample program outputs.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tol = .00001 Iter = 150
1(x^4) +-3(x^2) +-4 = 0
Roots Residuals Tolerance
------------------------------------- ----------------------- ---------
Real Imaginary Real Imaginary +
part part part part -
------------------------------------- ----------------------- ---------
0.000000000D+00 1.000000000D+00 0.00D+00 0.00D+00 6.511D-21
0.000000000D+00 -1.000000000D+00 0.00D+00 0.00D+00 6.511D-21
2.000000000D+00 0.000000000D+00 0.00D+00 0.00D+00 1.534D-10
-2.000000000D+00 0.000000000D+00 0.00D+00 0.00D+00 1.534D-10
------------------------------------- ----------------------- ---------
Tol = .00001 Iter = 150
2.5(x^5) + 10(x^4) +-22.5(x^3) + 35(x^2) + 125(x^1) +-1500 = 0
Roots Residuals Tolerance
------------------------------------- ----------------------- ---------
Real Imaginary Real Imaginary +
part part part part -
------------------------------------- ----------------------- ---------
3.000000000D+00 0.000000000D+00 0.00D+00 0.00D+00 4.973D-13
-4.000000000D+00 0.000000000D+00 0.00D+00 0.00D+00 4.973D-13
1.000000000D+00 3.000000000D+00 -9.09D-13 -3.41D-13 2.216D-07
1.000000000D+00 -3.000000000D+00 -9.09D-13 3.41D-13 2.216D-07
-5.000000000D+00 0.000000000D+00 -5.07D-10 0.00D+00 6.362D-07
------------------------------------- ----------------------- ---------
Tol = .00001 Iter = 150
-3(x^10) + 2.33(x^9) +-.56(x^5) + 12.23(x^4) + .655(x^3) +-1.899 = 0
Roots Residuals Tolerance
------------------------------------- ----------------------- ---------
Real Imaginary Real Imaginary +
part part part part -
------------------------------------- ----------------------- ---------
-1.450920228D-02 6.251604431D-01 -4.04D-09 -6.62D-09 1.202D-15
-1.450920228D-02 -6.251604431D-01 -4.04D-09 6.62D-09 1.202D-15
6.183918274D-01 0.000000000D+00 2.03D-14 0.00D+00 1.202D-08
-6.430871935D-01 0.000000000D+00 5.84D-15 0.00D+00 1.202D-08
1.425043395D+00 0.000000000D+00 -2.84D-14 0.00D+00 4.263D-09
-1.141984249D+00 0.000000000D+00 -5.33D-15 0.00D+00 4.263D-09
7.944602175D-01 1.054297618D+00 1.00D-07 6.61D-07 9.270D-08
7.944602175D-01 -1.054297618D+00 1.00D-07 -6.61D-07 9.270D-08
-5.207995719D-01 1.078915331D+00 6.88D-07 4.74D-07 1.665D-06
-5.207995719D-01 -1.078915331D+00 6.88D-07 -4.74D-07 1.665D-06
------------------------------------- ----------------------- ---------
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LEGAL:
POLYROOT is Public Domain software. POLYROOT may be freely distributed
as long as it remains UNMODIFIED with all the related files included and
with correct author credit given. It may not be sold commercially or
distributed on "public domain" disks selling for more than $8.00 without
the written permission of the author.
If the program is of value to you, drop me a postcard and let me know.
THE AUTHOR MAKES NO WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS
SOFTWARE. THE ENTIRE RISK AS TO THE QUALITY AND FITNESS OF THE SOFTWARE
RESIDES WITH THE USER. IN NO CASE SHALL THE AUTHOR BE LIABLE FOR
DAMAGES RESULTING FROM A DEFECT IN THE SOFTWARE EVEN IF ADVISED OF SUCH
A DEFECT. IN USING THIS SOFTWARE, YOU AGREE TO BE BOUND BY THESE TERMS.
1987 Jon Giorgini
[This notice may not be removed or altered]
*** END OF FILE ***