“GRAPH-B3”—computer printout for power curve ‘POWERC01’ Curve Fitting DATA File : POWERC01 Power Curve Fit ******************************************* Factor A = 2 Factor B = 2 Mean X = 5.5 Mean Y = 77 Standard Deviation X = 3.02765 Standard Deviation Y = 68.34715 Coefficient of Correlation = .9999997 Determination Coefficient = .9999994 X-Data 1.000 2.000 3.000 4.000 5.000 6.000 7.000 8.000 9.000 10.000
APPENDIX B.4: CUBIC SPLINE COMPUTER PROGRAM “GRAPH-B4” This program was discussed in Section 2.2.3 and fits a smoothed cubic spline through each of the data points in one data set.
LINE GRAPHS AND AREA CHARTS
Cubic spline (a) Initialization and control
Line numbers 10–90
See notes for section (a) of Appendix B.1. Since the fitting of spline curves to data requires matrix algebra, several arrays are also initialized in this section. Note that due to memory considerations, 20 is the maximum number of data points or rows. (b) Data loading See notes for section (b) of Appendix B.1. (c) Data check See notes for section (c) of Appendix B.1 (d) Text file entry See notes for section (d) of Appendix B.1 (e) Graph presentation selection See notes for section (e) of Appendix B.1 (f) Line graph display See notes for section (f) of Appendix B.1. (g) Cubic spline curve
Line numbers 100–180 Line numbers 200–440 Line numbers 500–580 Line numbers 600–750 Line numbers 1000–1380
Line numbers 3000–3940
This segment of code is described in Section 2.2.3 and uses Eqts 2.13– 2.15. The initial cubic spline polygon vertices and conditions are specified and then a curve fitted through the data points. The data points and the interpolated data curve points are saved in a data file with a ‘.CUB’ extension for future plotting. (h) Data printout?
Line numbers 4000–4090
At the completion of the plot, the user can obtain a hardcopy printout by pressing the [Shift] and [Prt sc] keys simultaneously. The user also has an opportunity to obtain a printout of the data at Line 6500. (i) Printout of data
Line numbers 6500–6670
Please note this segment of code only uses Lines 6500–6570 of Appendix A.7. The remainder are new lines specific to this program. This program also requires the routines (k) to (z) of Appendix B.2. “GRAPH-B4”—BASIC program
10 14 16 20 30 40 50 60
REM Presentation Graphics Program B.4 - Line Graphs REM (c) Copyright P.H.Milne 1990 **** - Cubic Spline **** REM ALL RIGHTS RESERVED **** - 1 DATA Set Only **** REM VERSION PC-1.00, 1990 : *** Maximum 20 Rows of Data *** CLEAR ON ERROR GOTO 10000 PCF$ = "PGSCRDSK.PGD" GOSUB 8000: REM Check Screen & Disc