computer

Arlo D. Ha&. California State University, San Bernardino, CA 92407. It is a truism that computers are here to stay. Students registered in first-year ...
0 downloads 0 Views 2MB Size
BASIC and the Density of Glass A First-Year Laboratoty/Computer Experiment Arlo D. Ha& California State University, San Bernardino, CA 92407 I t is a truism that computers are here to stay. Students registered in first-year chemistry courses are sophisticated enough to want experiments which lend themselves to data collection that can be treated by a simple computer program. The experiment described herein does this by combining a classical method of determining density, i.e., water displacement, with a very direct and simple computer program written in BASIC. Itsmethods are readily adapted to other types of experiments a t all levels of instruction. Purpose The experiment is designed as a class project. Students individually collect data which are then gathered together by all and entered into a simple computer program written in BASIC. Doing this, the density of glaas in the form of marbles is determined. A second part of the program allows for statistically treating the data. Students report the experimentally determined density along with its average deviation and percent precision. Using this information, the student compares the density of a separate larger sample calculated from a different kind of measurement. This comparison of two experimental methods and a computer-generated "standard" gives the student some insight into the usefulness of both methods. What readily follows is a general discussion of the advantages and disadvantages of these and related methods. Materials For a class of 40 students, a minimum of 220 glass playing marbles is required. These are readily available in the toy departments of many stores. At least 12 larger ones of the same material are alsoneeded for the comparison part of the experiment. A good balance which reads to a t least two decimal places, graduated cylinders, a good pair of calipers and, of course, access to a computer are also required. Expwlmantal Procedure The class of 40 students is divided into 10 groups of four each. These are numbered consecutively from one to 10. Each person in each group then selects a number of marbles

equal to the number of the group, i.e., group one uses one, group two uses two. ete. Each student then measures the totaimass of the marble(s) to one decimal place. The total volume is measured to one decimal olace bv water disnlacement in a graduated cylinder. The DATA collected from each of the 10 groups produce 80 pieces of information which are typed into the DATA lines in the computer program. These are alternated as (mass, volume). The program is RUN and the printed output gives the average density with both deviation and percent precision. For the second portion of the experiment, the larger marbles' mass and volume are measured. The mass is by balance. The volume is obtained by measuring the diameter with a . data are caliper and calculating it from V = 4 1 3 ~ 9 These used to calculate the density of the larger glass marble. The result is compared with that found in part one. DATA and Program

The DATA for part one of a typical experiment are typed oroeram. LIST follows. into the DATA lines 300 to 390 in the . " The program name is GLASSM.

LIST GLASSM 100 REH 110 REM 120 REH 130 REM 140 REM 150 REH 160 REH 170 REM 180 REM 190 REM

200 210 220 230 240

------ -

N INDEX (NO. OF GLASS MIIRBLES) (DATA) M - A V O . MASS OF MARBLES ( a . ) v AVG. VOL. OF MRRBLES ~ I ; ~ L ; ) D DENSITY OF N MARBLES (g./mL.) S SUM OF THE DENSITIES A MASS OP MARBLEIS) THEN C , E , G (DATA) B VOL. OF HARBLE(S) THEN D,F,H (DATA) C AVG. DENSITY OF MARBLES X DEVIATION FROH THE AVO. DENSITY Y SUM OF THE DEVIATIONS REH Z AVG. DEVIATION REM O & W VARIABLE TAB PUNCTIONS REM P PERCEN? PRECISION ( Z * 1 0 0 ) / C REM SET UP TWO SEPARATE FOR NEm LOOPS AT L I N E S 280 AND 480 P R I N T l P R I N T TAB[10):"---------------------"

PRINT TAB(10):"I":TAB(14);"GLASS

~~~(30);"l"

MARBLES":

RUN GLASSM

PRINT TAB(lO);.---------------------*: PRINT PRINT TAB(2):"NO..N*:T~(12);'M.,g~";TAB(21);

I

"V..mL.";TAB(31);"D.,q./nL."

DIM K(10): FOR N = 1 TO 10: READ N READ A , B , C , D . E . F , G . H DATA 1.2.5.1.3.2~4.1.4.2.3.1~2.2~4~1.1 DATA 2,4.4,2.1,4~5.2.1,4.6,2~334~2.2.4 DATA 3.6.5.3.2.6.4.3.3.6.2.3.4.6.0.3.3 DATA 4,8.6,4.3,8.3,4.1.8.5,440,8.4.4.4 DATA 5,10.2,5.1,10.4,5.2.10.1,5.3,10.3,5.0 DATA 6,12.4,6.2,12.2,6.1.12.3,6~2~12.1.6.5 DATA 7,14~3,7~2,14.1,7.0,14~5,7~2~14~4,7~1 DATA 8.16.5.8.4.16.4.8.1.16.1,8~0,16.2,8~4

~-lNT(~'l0-2+.5)/10-2: K ( N ) - D 420 0-12: IP M,-10 THEN 0-11 430 W-22: I F V,-10 THEN W - 2 1 440 PRlNT TAB(3)iN:TAB(O):M;TAB(W);V:TAB(32);D 450 S-(S+D): NEXT N: PRINT: C=((S/10)*10"2+.5)/10*2 460 PRINT "THE AVO. DENSITY IS:" C "g./mL.": PRlNT 470 P R l N T TAB(2);"NO. .N.":TAB(14):"DENSITY,D.*:

TAB(30):"DEVIATION.X."

480 FOR N = 1 TO 10: D = K ( N ) :

490 X=INT(X*10"2+.5)/10^Z 500 510 520 530 540 550 560 999

X-ABS

(C-D)

P"%"

END

2 3

THE AVG.

NO.,

N.

DENSITY

IS:

1.92 1.99 1.9 2.01 1.99 1.96 2.01 1.98 1.98 1.99

6 7 8

9 10

THE AVG.

DEVIATION IS:

DEVIATION, X.

.06 .O1

.08 .03 .O1

.02 .03

0 0 .O1

.03

1.978 +OR- .03 g./mL.

THE P R E C I S I O N IS:

Dlscusslon The experiment as presented is for a class of 40 students. I t is, however, readily adapted to classes both larger and smaller. Very small classes will not benefit from this statistical approach t o data treatment. Very large classes can he handled by dividing them into separate sections of 10 groups or changing the divisor for the average values. The experiment lends itself to instruction in the physical lahoratory as well as at the computer. I t clearly demonstrates a simple relationship between physically collecting data and actually treating i t by computer anaylsis. As such, i t may he used a t any level from secondary school through college. I t may also he used in physics courses. If a computer system or a terminal is available in the lab, the program minus the DATA lines, can he typed in previously. As the DATA are collected each group types in its results. When all the DATA are collected and entered, the program is RUN and the tabular results are obtained a t once. This presents an exciting immediate conclusion and reinforcement of the method to the student.

1.978 g./mL.

DENSITY, D.

1 2 3 4

THE DENSITY I S :

Results and Calculallons The results for part one of a typical experiment are in the printout a t the top of the right-hand column. RUN follows.

I

NO. , N 1

5

PRINT TAB(3);N;TAB(l6);D;TAB(33)iX Y-1~~((Y+X)*10^2+.5)/10-2~ NEXT N PRINT: 2 - I N T ( ( Y / l 0 ) * 1 0 - 2 + . 5 ) / ? 2 PRINT "THE AVG. DEVIATION IS: 2: P R I N T P R l N T "THE DENSITY I S i " C "+OR-" Z "g./nL." P R I N T 3 P-INT((Z.l00)/C) PRINT "THE P R E C I S I O N IS*"

GLASS MARBLES

1 %

Further Conslderatlons The program is written so that most home computers can be used. The RUN is designed to be within the 40-space screen limit of home televisions. Students who do not have a home computer or access to a printer can find these in all colleges and universities today. The program is not limited to the density of glass. Any solid may he used. Solution densities are also easily used since mass is determined by balance and volume by pipet. Other intensive properties may also he determined by measuring the appropriate extensive properties and replacing mass, volume, and density in the program with these. A logical extension of this program is to include graphics. A plot of mass versus volume would allow calculation of the VI). density from the slope where D = (Mz - MdI(V2 Utilizing a preprogrammed least-squares method would allow for a linear best fit. DIM statements for both M and V would he required. This can he done readily by adding to the program. Space in this article precludes this, but the author welcomes correspondence and suggestions along these lines.

-

Acknowledgment The author wishes t o thank Kenneth A. Mantei, David Neighhours, and Herb Nickles for their assistance.

Volume 63 Number 8 August 1966

719