CURVSIMP.DOC ·
DOC ·
1.9 KB ·
1984-08-27 ·
from IBM-PC-User-Group-Software-Library_Disk-44_Feb-1980
CURVSIMP.BAS
This is a translation into Basic of "Simp", a curve fitting program using
the simplex algorithm, by Marco Caceci. The original Pascal program is listed
and explained in "Byte", May 1984, p. 340-362. The translation retains as many
of the same variable names as possible and includes the same starting data as
the Pascal version. The only addition is a graph plotting routine at the end.
This has been produced on a PC with a Hercules graphics card and will need the
inclusion of a SCREEN statement before running with any other type of graphics
card. This Basic version produces almost exactly the same results as those
given in "Byte" - it would be interesting to know why there are minor
differences! If there are any bugs, and you find them, please let me know. The
main difference that will be noticed between this version and the original is
in the way the procedures are handled, particularly "sum_of_residuals". This is
due to the absence of a DEF PROC statement in BASICA; owners of the BBC micro
would find the translation much easier!
To run the program for different functions and data, adjustments are needed
in the following areas: lines 90, 100, 240-410 (this reads the data, INPUT
statements would probably be preferable), 430, 450-490, 600-650, 1170-1220,
1920-1970, 1600, 1620, 1990-2290 (graph plotting routine), and, 2310-2330 (the
data). The program POLYSIMP.BAS is included with CURVSIMP as an example of how
this can be done. It has been adjusted to determine the first five coefficients
of the normal polynomial expansion for the sine function. This is rather
artificial, but illustrates the type of changes needed and gives satisfactory
results.
Edward Henning
18, Cleveland Mansions
Widley Road
London W.9
ENGLAND
01-286 0598
d and gives satisfactory
results.
Edward Henning
18, Cleveland Mansion