home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / apps / 116 / applic / plothelp.doc < prev    next >
Encoding:
Text File  |  1987-04-16  |  20.9 KB  |  485 lines

  1. SHORT INSTRUCTIONS FOR PROGRAM PLOTFIT (VERSION 4.0)
  2. ====================================================
  3.  
  4. This program was written in GFA Basic and will therefore require that
  5. you have the GFA Basic interpreter ( GFABASRO.PRG Versiom 2.0).
  6. This program may be used with a color or a mono Atari St computer.
  7. Once the program is started the appropriate file PLOTFIT.MON or
  8. PLOTFIT.COL will be read. After that these files will not be needed
  9. anymore. These file must reside in the same folder than the
  10. interpreter.
  11.  
  12. This program is fully menu driven.
  13.  
  14. PLOTFIT will allow you to graphically display the X, Y range pair
  15. with the optional error checking of the Y range. Different point
  16. symbols like lines may be used. There is no pie chart. The X- and
  17. Y- axis will automatically be adjusted for the chosen range.
  18. You may write to both axis and you may also add text at any place
  19. you like. Text may be chosen in different fonts. Logarithmic and
  20. linear representations of both axis are posssible. Many pictures
  21. can be drawn on the same screen. Lines and symbols may be combined.
  22. More than one data set may be created at the same time (<=8).
  23. All attributes from the data set (scale range, axis markings) will
  24. also be created and may be changed individually.
  25.  
  26. Maximum number range: -2000000 -> 2000000
  27. Minimum number range: -0.01 -> 0.01
  28. Maximum number of points: 250, 500 for the last data set.
  29.  
  30. A second menu includes a fit packet.
  31. This allows you to match different functions to the data set:
  32. 1)Polynomial (like a parabola)
  33. 2)Exponential function (like Y =height*exp(const.*X),or a Gauss-curve.
  34. 3)Power function (like Y=const.* x^power)
  35. 4) multibles ( <=3) overlaying Gauss-curves.
  36. At the most 10 parameters will be matched.
  37. The match may consider the error in the Y value or the absolute or
  38. relative disgression of the Y value from the curve. The matched data
  39. set may then be supplied with specification by one or more X values 
  40. by using the mouse. 
  41.  
  42. A third menu allows you to manipulate the data set:
  43. 1)Addition, Subtraction, Division, Multiplication of the Y value.
  44. 2)Copy, Combine, Erase data sets
  45. 3)Invert Y value, exchange X and Y value, sort, averaging neighboring
  46.   points, calibration of the X and Y values.
  47. 4)Replace, erase, calibrate and averaging ranges of a data set.
  48. 5)Transformation of cartesian coordinates (X,Y) to polar coordinates
  49.   or the reverse, as the rotation and mirroring of the X,Y pair.
  50.  
  51. Examples and possible problems are at the end of this document.
  52.  
  53. Short description of each of the PLOT-MENUES
  54. --------------------------------------------
  55. DESK-Menu
  56. =========
  57. Return to the desktop by selecting DESK or to Basic by the BASIC
  58.  option.
  59. Before calling accesorries be sure to save the screen by using
  60. the BUFFER option from the OUTPUT-Menu and then restore it with
  61. the BUFFER option from the INPUT-Menu.
  62.  
  63. INPUT-Menu:
  64. ===========
  65. The input may be from a file, the keyboard or the mouse.
  66. X-values may automatically be produced by the program. If input
  67. is by mouse, the X- and Y- scales must have been defined by using
  68. the X-RANGE and Y-RANGE or they must been established thru previous
  69. input. The option COEFF allows input of the coefficients of a
  70. polynomial (see FIT). With the help of those coeffiecents a data
  71. set (X-,Y- value pair) may then be created.
  72.  
  73. Errors for the Y value can be input as either absolute or relative
  74. ( in %). These are identified by the input of a "%".
  75. The option ERROR makes Y-errors possible, that are build tru roots
  76. (Y)-statistical error.
  77.  
  78. Later changes are possible by using the option CHANGE from the
  79. INPUT menu.
  80. While in CHANGE, individual points may be changed by using the
  81. mouse or the keyboard. You may also change individual coefficients
  82. by selecting COEFF from the INPUT-Menu. It it also possible to 
  83. append or merge data from another data set. The option CHANGE
  84. performs all changes to the data set that was chosen in the DATA
  85. SET option (the current data set graphically displayed).
  86.  
  87. The option TEXT makes it possible to include your own text into
  88. the picture (maximum of 10 lines). These lines may be changed
  89. or deleted thru the CHANGE option within the INPUT menu. ( You may
  90. use the backspace to change text or use the mouse to change the
  91. position of the text.
  92.  
  93. The option DATA SET allows you to select the data set that will
  94. be used for the display (Pick data set number, replace current 
  95. data set with new data set).
  96.  
  97. OUTPUT-Menu:
  98. ------------
  99. Data may be output to the screen, printer or a file. The HARDCOPY
  100. routine creates copies which are turned 90 degrees, and are 1.8
  101. times as large as normal hardcopies. The first time HARDCOPY is
  102. called the printer type must be selected (IBM or Epson). When
  103. using medium resolution the grey will be red and blue. You can 
  104. always use the ALTERNATE HELP to get a normal hardcopy.
  105.  
  106. The OUTPUT menu also contains an Integration routine. 
  107. SUM Y adds all Y values within a X range and calculates the 
  108. mean and the X- median (SUM X(i)*Y(i) / Sum Y(i) ). INTEGRATE
  109. is useful to compute the sum Y(i)*Delta-X(i).
  110.  
  111. Through the DATA SET option, the mode of all OUTPUT options of
  112. active data sets may be chosen.
  113.  
  114. The option FIT selects the FIT menu (see below).
  115.  
  116. You can use the option BUFFER to store the screens. The actual data
  117. fields are not changed only the X- and Y- scales. You may therefore
  118. put more graphs into a buffered picure by using the option ADD from
  119. the DRAW menu.
  120.  
  121. X-SCALE Menu
  122. ============
  123. RANGE allows you to input the axis range by using the keyboard
  124.       or the mouse.
  125. AUTO selects the range according to the data. Once AUTO is 
  126.      deactivated the previous set range goes into effect. If no 
  127.      range was specified than the range will be set automatically.
  128. LOG  turns on the logarithmic display of the data set.
  129. CALIBRATE recomputes the X values (X-new = X-old * slope + Offset.
  130.      A RETURN without a value makes slope=1 and offset=0.
  131. EXPAND allows you to increase the range via the mouse. The X values
  132.      are not changed and the range selected by AUTO remains intact.
  133. MARKER turns vertical help lines on and off. They do not become
  134.      visible until NEW or FRAME is selected from the DRAW menu.
  135.  
  136. Y-SCALE Menu
  137. ============
  138. see X-SCALE Menu.
  139. Instead of EXPAND you must use the ZOOM option to enlarge the 
  140. picture. Select the start and ending positions with the click
  141. of the mouse.
  142.  
  143. DRAW-Menu:
  144. ========= 
  145. NEW  erases the screen and plots a graph based on the range selected
  146.      thru the X-SCALE and Y-SCALE Menus.
  147. ADD  allows you to add more graphs into the same picture. The ranges
  148.      are not changed.
  149. FRAME draws only the X- and Y-axis. The screen is erased.
  150. FIT  allows you to add the last match to the existing screen. The
  151.      line form of the fitcurve may selected by using option LINE
  152.      from the STYLE Menu.
  153. DATA SET allows you to pick the data set. Data set is displayed in
  154.      the top right corner.
  155. NEXT switches the the next data set. When the last data set is 
  156.      reached, the first data set will again be chosen.
  157. PREVIOUS select the previous data set. This wraps around to the last
  158.      data set from first.
  159. TEXT allows you to turn the display of text on and off during
  160.      graphic display.
  161. ERROR turns the Y-ERROR bars on and off.
  162.  
  163. STYLE-Menu:
  164. ===========
  165. The selected style from option TEXT is only active for labels, which
  166. are inserted somewhere into the screen by using option TEXT from
  167. the INPUT Menu.
  168. Lines and symbols may be combined by selecting them from the STYLE
  169. Menu and adding them thru the option ADD from the DRAW menu.
  170. The option COLOR allows you to select different color for text and
  171. lines.
  172.  
  173. All other options are self explanatory (maybe).
  174.  
  175. Greek letters and other signs may be added by pressing Control S
  176. and any other letter of your choice. (K=Delta, J=Omega, H=Phi, etc).
  177.  
  178. Short description of the FIT Menu:
  179. ----------------------------------
  180.  
  181. FUNCTION
  182. ========
  183. Selects the fit functions (match functions) and allows you to 
  184. select up to ten fit parameters. The default is 2.
  185.  
  186. This fits a polynomial (option LINEAR, EXPONETIAL, POWER LAW ).
  187. Thru this the Y values can become logarithmical (option EXPONENTIAL)
  188. or the X- and Y- values (option POWER LAW). Errors will always be
  189. correctly changed.
  190. Attention:In the case of option POWER LAW negative values ((X-X0) < 0)
  191.      will not be evaluated during the curve fitting. Negative Y-values
  192.      with option EXPONENTIAL and POWER LAW will be replaced by the
  193.      maximum of the Y axis/100000 (linear Y axis) or the minimum of
  194.      the Y axis/10 (logarithmic Y axis)!
  195.  
  196. In the case of a Gauss-curve, the height, position of the maximum,.
  197. median and area of the Gauss-curve will be computed from the fit
  198. parameters (option EXPONENTIAL,3,coefficient).
  199.  
  200. With the option GAUSS-FUNCT. you may match one or many Gauss curves.
  201. a non linear match system is used. This requires the input of starting
  202. values (position, height and mean of the Gauss-curve). This method
  203. is more complicated but also more accurate. If the start values are
  204. to far from the optimal value, the solving process may last forever
  205. and the fitting is interrupted.
  206.  
  207. The option TEST-FUNCTION allows you to apply a previous selected
  208. function to the data. The function itself can be specified thru
  209. input of coefficients by using the INPUT menu or thru another 
  210. data set.
  211.  
  212. The option X-REFERENCE allows you to select a reference point (X0)
  213. for the fit parameters.
  214. Attention: The option POWER LAW requires positive values (X-X0)
  215. within the fit range (see above).
  216.  
  217. Option FIT performs the selected functions on the data, whereby the
  218. mean deviation (CHI**2) is minimized. If the statistical error of
  219. the data is taken into account (see: Menu WEIGHT), the probability 
  220. is computed that will correctly describe the data (values between
  221. 5% and 95% are possible).
  222.  
  223. WEIGT
  224. =====
  225. Specifies the weight that is assigned to each data point.
  226. Y-ERROR: Previously entered errors of the Y values will be used
  227.          as the weight.
  228. ABSOLUTE: The deviation of the data points from the fit curve is
  229.           minimized.
  230. RELATIVE: The relative deviation of the data points from the fit
  231.           curve are minimized.
  232. Attention: With option ERROR and RELATIVE the smallest weight factor
  233.           is (y-max - Y-min)/10000 with linear or Y-min/1000 with
  234.           logarithmic Y-axis. Smaller weight factors will be 
  235.           replaced by these values!
  236.  
  237. REGION
  238. ======
  239. Specifies the range of the data that will be used to fit the curve:
  240. ALL:     All data points.
  241. DISPLAY: Range of current data displayed.
  242. NEW:     Select X range with the mouse.
  243. APPEND:  Add additional X ranges (maximum of 10).
  244. SHOW:    shows thru markers the  X ranges that were selected with
  245.          NEW or APPEND option. At the same time these ranges are
  246.          reactivated in case the option ALL or DISPLAY were 
  247.          previously active.
  248. DATA SET: Specifies the data set or sets to which the fit curve
  249.          should be applied to. The currently displayed data set is
  250.          the default.
  251.  
  252. STORE:
  253. ======
  254. Allows you to save the  X- and Y- results of the fit as a data set.
  255. The option CREATE allows you to pick your own X range. 
  256. Option SUBTRACT subtracts the fit result from the data set.
  257. Option DIVIDE divides the data with the fit result.
  258. Option DATA SET selects the data set in which the result is saved.
  259. If no data set is specified a new data set is created.
  260.  
  261. DRAW:
  262. =====
  263. see main menu.
  264. Option Buffer is also present (see INPUT menu in the main menu.
  265.  
  266. OUTPUT:
  267. =======
  268. Allows you to print the result of the fit to the printer (option
  269. PRINT), the screen (option SCREEN) or the disk drive (option FILE).
  270.  
  271. The mean deviation of the data within a given range can also be
  272. specified ( option SUM-ERROR).
  273.  
  274. The option X -> Y calculates the Y value for a give X value. The
  275. error of the Y fit value is also calculated. This makes it possible
  276. to estimate the values that are past the visible range.
  277.  
  278. Option MAIN MENU returns you to the main menu.
  279.  
  280. Note:
  281. -----
  282. The menu STORE and OUTPUT are also active if a set of coeffiecents
  283. were previously entered thru the keyboard (option COEFF from the
  284. INPUT menu). The errors are set to null in this case.
  285.  
  286.  
  287. Short description of menus from MENU III.
  288. -----------------------------------------
  289.  
  290. CREATE
  291. ======
  292. The currently displayed data set is combined with another data set 
  293. (see below). The result will be put in a new data set or an old
  294. data set will be overwritten (option DATA SET).
  295. ADD:     Addition or subtraction of the Y values between two data
  296.          sets. The Y values of the second data set may be multiplied
  297.          by a factor value.
  298. DIVIDE:   Division of the Y values between two data sets.
  299. MULTIPLY: Multiply the Y values of two data sets.
  300.  
  301. In all three cases will the error of the resulting Y values be
  302. calculated from the errors of the output values. If more than one
  303. data set is displayed than only the last one will be used.
  304. If the X values of the data sets are not identical, the Y values
  305. of the second data set will be adjusted.
  306.  
  307. COPY:  Copies one or more data sets to a new data set.
  308. MERGE: Merges the selected data set into the displayed data set.
  309.        It is merged by the size of the X value. The relative order
  310.        of the value pairs of the two data sets remains unchanged.
  311.        Attention: The number of the new data set should not be
  312.        identical to the number of either output data set!
  313.  
  314. DELETE:
  315. =======
  316. To erase all of the data set or the text of the data set.
  317.  
  318. CHANGE:
  319. =======
  320. Changes to contents of a data set.
  321. INVERT:  Replaces the Y values by 1 / Y value.
  322.          Y-errors, ranges, text coordinates will also be recalculated.
  323. SWAP X, Y: Switches the X and Y values. This option can also be used
  324.          to display error result for the X values.
  325. CALIBRATE X: linear allignment of the X values: X-new = X-old*slope
  326.           + Offset.
  327. CALIBRATE Y: Linear allignment of the Y values.
  328. AVERAGE: Creates the average of the two neigboring points. If the
  329.          Y values are given with error results, a weighted average
  330.          will be performed so that the errors of the Y average is
  331.          minimized. If the number of data points is not even, the
  332.          last value will be taken as is.
  333. SMOOTH:  Three Y values are averaged. The number of values remains
  334.          unchanged [ Y(i)=( Y(i-1) + 2*Y(i) + Y(i+1) )/4 ].
  335.          Attention:  The data points are not statistically independent
  336.          after a SMOOTH operation!
  337. INTEGRATE: Numeric integration thru the X-, Y- value function:
  338.           Y-new(n) = Sum(Y(i)*delta-X(i)), i=1-n.
  339.           Attention: depending on the distant between the points on
  340.           the X axis, large Y values may be created. Calibrating
  341.           these values by using the option CALIBRATE Y is sinful.
  342.  
  343. REGION
  344. ======
  345. Changes a data set only within the selected range.
  346. REPLACE: Replaces the data points of the displayed set or sets with
  347.          the values of another data set with values in the same 
  348.          range. The marked range of the displayed data set is not
  349.          required to contain points. In this case the points of 
  350.          the second data set will be inserted or added.
  351. DELETE:  Erases all points of the chosen X range.
  352. CALIBRATE X: Calibrates the data points of selected range on the 
  353.          X axis (see X-SCALE).
  354. CALIBRATE Y: Same as previous except (Y-SCALE).
  355. AVERAGE: Computes the average between the two neighboring points
  356.          within a selected range.
  357. If more than one data set is displayed, then all above operations
  358. are performed for all displayed data sets.
  359.  
  360. TRANSFORM:
  361. ==========
  362. X-Y -> `-R: Transforms cartesian coordinates (X,Y) into polar
  363.             coordinates (angle, radius). A circle will for example
  364.             be transformed to a horizontal incline. Angles are 
  365.             given in degrees.
  366. `,R -> X-Y: Transforms polar coordinates into cartesian coordinates.
  367.             A incline with a slope <>0 would for example be 
  368.             transformed into a spiral. Example: input of the
  369.             smallest radius (example 10) and the increments of
  370.             the radius per degree (example 0.1) thru the COEFF
  371.             option. LINEAR from the INPUT menu and a choice for the
  372.             Theta value X-min=0, X-max=1080 with increment=10.
  373. ROTATE:  Rotate the value pair clockwise by the given angle.
  374. MIRROR:  Mirror the X and Y values of the displayed data set or
  375.          sets thru the X-Y CENTER.
  376. X,Y-CENTER: Sets the orgin from which the data is rotated. (Default:
  377.             X=0, Y=0 ).
  378. Errors for the Y values are not taken into account during any of
  379. the above functions.
  380.  
  381. File-Structure:
  382. ===============
  383. The data file must have the extension .DAT. It can reside in a folder
  384. as well as a folder within a folder.
  385.  
  386. The data file can contain many different options or comments before
  387. the actual data set. 
  388. Options are identified by key words followed by the option:
  389. X-RANGE:X-min,X-max
  390. Y-RANGE:Y-min,Y-max
  391. X-TEXT:X-axis text
  392. Y-TEXT:Y-axis text
  393. STYLE:Symbol-flag, Histogram-flag, style-Nr, Line-width, Line-Color
  394. LABLE:Lable Text    (anywhere on the screen)
  395. X-Position, Y-Position, Text-style (1-31), Text-size (4,6,13,32)
  396.  
  397. All lines that do not begin with a keyword will be treated as
  398. comments. The first Comment line will be saved and transferred to
  399. the Output-File, all others are ignored.
  400.  
  401. The start of the data fields begin with the keyword DATA: 
  402. Example: DATA:X,Y(,Y-ERROR or X-ERROR)
  403. (The optional keyword X-ERROR identifies that Error results ( 3
  404. numbers per line) are for the X values.
  405. The following input values will automatically be tested for input
  406. error.)
  407. X value, Y value, Y-error       or
  408. X value, Y value                or
  409. X value, Y value                or
  410. X value, Y value, X-error
  411. No special mark to signify the end of the data set is needed. A 
  412. empty line after the data set will result in an error message.
  413.  
  414. END: needed to seperate more than one data set within the same file.
  415.     (It may be the only thing after the data, but further input is
  416.      then ignored.)
  417.  
  418. Keywords do not have to be capitilized. The option FILE from the
  419. OUTPUT menu creates these data files.
  420.  
  421. Changing the default program parameters:
  422. ========================================
  423. The file PLOTFIT.MON or PLOTFIT.COL contain the disk drive default
  424. and dimension for data fields (size of data sets) in line 1.
  425. Line 2 contains the screen coordinates used for graphic.
  426. The dimension variables follow along with the keywords for the
  427. menus.
  428. The Symbol table of the graphic symbols is on the end.
  429.  
  430. Possible Problems!!
  431. ===================
  432. If the Menu row is frozen after a command, a short click with the
  433. mouse will unlock it.
  434. Multiple inputs with the mouse are terminated by pressing the right
  435. mouse button.
  436. If everything else fails try pressing the RETURN key.
  437. The old value usually remains in tact when pressing the RETURN
  438. with any input; Exception: X- Y- axis marking.
  439. In the case of an error it is best to return to the menu. If nothing
  440. else works you may save data and start from the beginning.
  441. If hardcopy does not work, turn printer of and on.
  442. To fit a data set with the EXPONENTIAL or POWER LAW function
  443. requires positive X or X and Y values. You may have to expand the
  444. range using the EXPAND from the X-SCALE menu. If the program is
  445. too much pressure on your nerves, just erase the program.
  446.  
  447. Example Program:
  448. 1) Load TEST2.DAT by selecting FILE from the INPUT menu. Plot the
  449.   yearly taxes of Hans Zahlemann by selecting NEW from the DRAW menu.
  450.   Compute the yearly average from the years 197801984 by selecting
  451.   INTEGRATE from the OUTPUT menu. All taxes for this range are 
  452.   automatically computed.
  453.   Select FIT from the OUTPUT menu. By selecting EXPONENTIAL from the
  454.   FUNCTION menu (Number of Fit parameters=2) and then picking from
  455.   FIT, you will receive a adjustment curve that will allow you to
  456.   inspect the future and the past. (option X -> Y).
  457.  
  458.   Select MAIN MENU and then X-SCALE (1930-2030) and then Y-SCALE
  459.   (0-65000) to see the predicted curve of your taxes. The screen
  460.   text will also change, but you may discard it it by using the
  461.   TEXT option from the DRAW menu.
  462.   The FIT option in the DRAW menu will tell you the predicted taxes
  463.   to your country. The option MOUSE from the OUTPUT menu will give 
  464.   you more accurate information.
  465.   The CREATE option in the STORE menu allows you to save the results
  466.   as a data set.
  467.  
  468. 2) Load TEST1.DAT and fit a Gauss curve in the peak. Then select
  469.   the range by using the NEW option in the region menu. Then
  470.   select EXPONENTIAL from the FUNCTION menu and specify the number
  471.   of fit coefficients (# OF COEFF. = 3.
  472.   The height, width and position of the gauss curve is obtained
  473.   by selecting the SCREEN  or PRINT option from the OUTPUT menu.
  474.   Compare the mean deviation CHI with the result by using the 
  475.   GAUSS-FUNCT.
  476.  
  477. Have fun!
  478. Wolgang Koenig, am Bruehl 1, 6101 Messel, Tel. 6159-1476, December 86
  479.  
  480. PS. The internal hardcopy command should work without any problem
  481. on Epson and IBM compatible printers. (see your printer documentation
  482. for more information).
  483.  
  484. Translated to English by Wilford Niepraschk.
  485.