You are on page 1of 3

the program, as written, is for a family of straight lines , with the slopes being a simple linear function of the

second independent variable, and it includes the option of also "looking at " a log function of the second variable. if the family of curves is obviously not a series of straight lines , the program MULTSLOPE can readily modified, following the procedure outlined in the preceding section (p. 31), with a function to account for the curvature. if the relationship among the family of curves is also obviously not linear (e.g.,if the second parameter varies to powers of ten), the program can be easily modified to use a more suittable function of the second parameter . " to meet the author see p.38. A family of lines. it is quiet common to have a situation in which data produce a series of curves that are of similar shape but are separated from each other by straight lines, as illustrated in FIg.1, they ca be expressed by an equation: Y=b0 + s.X1 where s is the regression (or slope) of Y upon X1 . In Fig.1, the slope of the lines increases as x2 goes from case 1 to case 4. if the slope of a linear function of the second variable, it may be expressed as: S=b1 + b2.X2

these two equations may be combined to yield an overall correlation equation: Y=b0 + b1.X1 + b2.X1.X2 handles the data input and calculates the sum, sums of squares and sums of cross products of Y and X , r. also calculates value at X1.X2 for the second term in the final equation . it calls on sub

comments subroutine 1. for the calculation of the sums for the second term the routine is used twice if two functions of X2 are used

subroutine 2 : establishes the second function of X 2 if it is required and calculates X1.F(X2) to give the second term of the second correlating equation. the function of X2 can be changed at line 40 . as written the program yields nLog(X2) as the second function

routine B: permits a check of EY,EX1,EX2 and N (the number of datasets) before proceeding with the main calculation. (continued)

routine D: provides for deleting data. it uses subroutine 5 to subtract values from the various sums.

Fig2: solids - transport data - pressure drop per unit length vs. solids rate at different gas velocities

Routine C: the main calculations. this routine carries out the calculations that are performed only once, and calls on subrountine 3 for the calculations that might be requiered more then once

Fig 3 cellulose - treating data - viscosity vs. treatment time at different acid concentrations subroutine 3: completes the calculation of the sums of squares of deviation that are required for a least - squares solution for a two - independent- variable equation, and calculates the equation constants and the correlation coefficient. the subroutine is used twice if two functions of x2 are investigated. the solution to the two - variable equation follows the equations given by ref.[2],p.315

subroutine 4: calls up the stored values of the second function of x2 if it is used. Page 42

clear all storage areas. set the second function of x2 to be tested at line 40, if this is other than the log function that is already set. In order to get the program to use the second function, it is necessary to set Flag 1, [STF 1]. the way the program is written, the second function is not used unless Flag 1 is set before the data are entered. enter the data : Y - [Enter] , x1 - [enter], x2 - key [A] repeat these operations until all the data are entered . if the data input is interrupted, the last Y value processed is in storage register A, the last X1 is in register B and the last x2 is in C. These values can be examined at any time without

affecting the results. press key [B] when all the data are entered. this provides EY ,EX1, EX2 and N (the number of data sets) as a check on the data input before proceeding with the main calculation . Key [B] can be used at any time to check the data input to that point without affecting the results. run the main calculation by pressing key [C]. the output is : b1, the regression coefficient of the first variable ; b2 , the regression coefficient of the second variable (X1.X2);b0 , the intercept ; and r, the correlation coefficient - in that order. If Flag I is set before the data are entered, the program also calculates and prints a second set of equation constants and a second correlation coefficient , using (X1.F(X2)) as the second variable in the equation. F(X2) is the function set at line 40 . at any point in the operation , before the last step, data may be deleted by using key [D] . to delete data , Y, X1 and X2 to be deleted are entered in the usual manner, except with key [D] instead of key [A].

if one or both of the relationships is not a simple linear function of the variable, but is a linear relationship of some function of the variable, as discussed for program MULTFIT [P.31], Eq.(3) could be expanded as follows: Y=b0 + b1.F1(X1) + b2.F1(X1).F2(X2) (4) the correlation program presented here, MULTSLOPE, uses a linear relationship for the simple value of both independent variables. but the program is easily modified to use a different function o0f either variable, and the cellulose - reduction example that is given later in this article uses a modification of both (F1=1/X1 and F2=logX2). a statistically significant correlation with MULTI SLOPE indicates that the data may be represented by family of curves. the shape of the curves is established by the function of X1. The displacement of the curves in the family is set by the function of X2. the output from MULTSLOPE consists of the three equation constants b1, b2 and b0, in that order, plus r, the correlation coefficient [p.32]. if two functions of the second parameter are tested with one input of data the output is two sets of equation constants and two correlation coefficients. the program table I shows the program. It is written for a hew - lett - packard HP - 97 , but will run equally well on an HP - 67 . It can be modified for any other programmable calculator having sufficient capacity - 211 steps and 20 storage areas. with a calculator of smaller capacity, the program could be divided into two parts - the first 97 lines for data the main calculation and output. Keys [A], [B] and [D] may be used at any time and in any order before running the main calculation with key [C].

You might also like