Newer Computing Techniques for Molecular Structure Studies by X

Jul 23, 2009 - ABSTRACT. This review presents a selection of newer algorithms used in X-ray crystallographic calculations. Some of the material is not...
0 downloads 0 Views 2MB Size
5 Newer Computing Techniques for Molecular Structure

Downloaded by UNIV OF CALIFORNIA SAN DIEGO on March 21, 2016 | http://pubs.acs.org Publication Date: June 1, 1977 | doi: 10.1021/bk-1977-0046.ch005

Studies by X-Ray Crystallography DAVID J. DUCHAMP The Upjohn Co., Kalamazoo, MI 49001

Crystal!ographers have been users o f computers ever s i n c e computers became a v a i l a b l e f o r s c i e n t i f i c c a l c u l a t i o n s . The nature o f c r y s t a l l o g r a p h i c c a l c u l a t i o n s used i n molecular s t r u c t u r e d e t e r m i n a t i o n — l a r g e amounts o f data t o be t r e a t e d by r a t h e r complicated mathematics—makes e f f i c i e n t use o f computers e s s e n t i a l and l e d q u i t e e a r l y t o the development o f r a t h e r sophist i c a t e d techniques f o r both manual and computer computations. The f e a t u r e s which make c r y s t a l l o g r a p h i c c a l c u l a t i o n s somewhat d i f f e r e n t i n c l u d e : 1) the use o f symmetry, i.e. space groups, 2) the use o f a g e n e r a l i z e d c o o r d i n a t e system, 3) the t h r e e dimensional nature o f both data and intermediate and f i n a l r e s u l t s 4) the high p r e c i s i o n o f the r e s u l t s , l e a d i n g t o generous use o f s t a t i s t i c s , 5) use o f computer c o n t r o l l e d data a c q u i s i t i o n , and 6) the need f o r d i s p l a y and p r e s e n t a t i o n o f three-dimensional molecular s t r u c t u r e i n f o r m a t i o n . For the most p a r t , these a r e the areas i n which c r y s t a l 1ographers have tended t o be i n the f o r e f r o n t i n a l g o r i t h m development. This paper concentrates on newer computing techniques, t r y i n g t o g i v e a sampling o f r e c e n t l y developed techniques, which may be u s e f u l t o both c r y s t a l 1ographers and n o n - c r y s t a l l o g r a phers. M a t e r i a l judged o n l y understandable w i t h i n depth c r y s t a l l o g r a p h i c background has been omitted. Apologies are made f o r the omission o f many " f a v o r i t e " a l g o r i t h m s . Since many o f the algorithms a r e unpublished, the more d e t a i l e d d e s c r i p t i o n s a r e taken o f n e c e s s i t y from the author's own experience. The o l d e r algorithms not discussed here are well described i n standard reference works, such as "The I n t e r n a t i o n a l Tables f o r X-ray Crystal!oaraphy" (1) and textbooks by R o l l e t t {2) and Stout and Jensen ( 3 J . In a d d i t i o n , many o f the algorithms used i n c r y s t a l l o g r a p h i c computing a r e taken from numerical a n a l y s i s (4) o r are d i r e c t a p p l i c a t i o n s o f standard computing algorithms such as those used i n s o r t i n g data. The recent textbook o f Aho, Hopcroft and Ullman (5») (and the references t h e r e i n ) provide an e x c e l l e n t i n t r o d u c t i o n t o the l i t e r a t u r e o f general purpose computing a l g o r i t h m s , as w e l l as an i n t r o d u c t i o n t o the s t r a t e g i e s used i n

98 Christoffersen; Algorithms for Chemical Computations ACS Symposium Series; American Chemical Society: Washington, DC, 1977.

5.

DUCHAMP

Molecular Structure Studies

99

development o f e f f i c i e n t a l g o r i t h m s .

Downloaded by UNIV OF CALIFORNIA SAN DIEGO on March 21, 2016 | http://pubs.acs.org Publication Date: June 1, 1977 | doi: 10.1021/bk-1977-0046.ch005

Computing Techniques f o r X-ray D i f f r a c t o m e t e r s In most computer-controlled d i f f r a c t o m e t e r systems, the computer has c o n t r o l of the s e t t i n g s and r a t e of change o f the angles ( u s u a l l y 4) which determine the o r i e n t a t i o n of the c r y s t a l and the p o s i t i o n o f the r a d i a t i o n d e t e c t o r r e l a t i v e to the i n c i dent X-ray beam. I t can a l s o u s u a l l y open and c l o s e the i n c i d e n t beam s h u t t e r , and c o n t r o l the counting of pulses from the det e c t o r . The b a s i c process of data c o l l e c t i o n , which a l l systems can perform, c o n s i s t o f : f o r each r e f l e c t i o n 1) c a l c u l a t e the s e t t i n g s of the a n g l e s , 2) move the d i f f r a c t o m e t e r goniometer t o those s e t t i n g s , 3) measure the i n t e n s i t y of the r e f l e c t i o n , and 4) output the measured i n t e n s i t y . In a d d i t i o n most systems have enhancements, such as a program to a i d i n determining the o r i e n t a t i o n of the c r y s t a l on the instrument. U s u a l l y a f a i r amount of manual operation i s r e q u i r e d i n s e t t i n g up the experiment, i n c l u d i n g the c o r r e c t indexing o f the r e f l e c t i o n s . In most cases, the c r y s t a l l o g r a p h e r has l i t t l e c o n t r o l over the computer programs, s i n c e they are most o f t e n coded i n assemb l e r language on a small minicomputer, and are t h e r e f o r e d i f f i c u l t to modify. In some l a b o r a t o r i e s , however, most of the programs are w r i t t e n i n an e a s i l y changed high l e v e l language, making i t easy to modify the a l g o r i t h m s used f o r programmed experiments, and to develop programs f o r new experiments. In the system i n our l a b o r a t o r y (Figure 1 ) , a small instrument c o n t r o l minicomputer operates as a s l a v e to a l a r g e r l a b automation computer. When a F o r t r a n program running i n the l a r g e r computer wants a s p e c i f i c task performed on the d i f f r a c t o m e t e r , i t loads a program i n t o the minicomputer (unless the program i s already t h e r e ) , and sends i t i n f o r m a t i o n f o r the task to be performed. At task complete, the F o r t r a n programs i n the l a r g e r computer process the r e s u l t and determine the course of the experiment. G e t t i n g a piece o f information measured on the d i f f r a c t o m e t e r i s f u n c t i o n a l l y s i m i l a r to c a l l i n g a subroutine which r e t u r n s a f t e r the information i s a v a i l a b l e . An a l t e r n a t i v e way to achieve the same f l e x i b i l i t y i s to b u i l d up the instrument c o n t r o l minicomputer i n t o a much l a r g e r system. Several improvements to the b a s i c data c o l l e c t i o n a l g o r i t h m have been made. Perhaps the most s i g n i f i c a n t i s the use of the step-scan technique, v e r s i o n s of which were developed i n 1969 f o r our computerized d i f f r a c t o m e t e r , and s i m u l t a n e o u s l y elsewhere. The usual method o f i n t e g r a t e d i n t e n s i t y measurement i s to scan c o n t i n u a l l y through the r e f l e c t i o n p r o f i l e , accumulating counts c o n t i n u o u s l y , then to measure the background by counting f o r f i x e d time a t each extreme of the p r o f i l e ( 6 ) . B l e s s i n g , Coppens, and Becker have r e c e n t l y discussed the step-scan procedure (7). B a s i c a l l y i t c o n s i s t s o f sampling the peak p r o f i l e a t a number o f p o i n t s , perhaps 50 to 100, see Figure 2. Computer a n a l y s i s o f

Christoffersen; Algorithms for Chemical Computations ACS Symposium Series; American Chemical Society: Washington, DC, 1977.

100

ALGORITHMS

- ( A N G L E CONTROL)-

INSTRUMENT CONTROL MINICOMPUTER

FOR C H E M I C A L

COMPUTATIONS

DIFFRACTOMETER

-QNGLE P0SIT10N> C0U

NTER ) SHUTTER

Downloaded by UNIV OF CALIFORNIA SAN DIEGO on March 21, 2016 | http://pubs.acs.org Publication Date: June 1, 1977 | doi: 10.1021/bk-1977-0046.ch005

TERMINAL

COMMANDS, PROGRAMS, TERMINAL OUTPUT

DATA, TERMINAL INPUT

UPACS MULTI INSTRUMENT LAB AUTOMATION COMPUTER Figure 1.

DISK

UPACS computer-controlled diffractometer system

BACKGROUND

|

PEAK

j BACKGROUND

Figure 2. Step scan data collection

Christoffersen; Algorithms for Chemical Computations ACS Symposium Series; American Chemical Society: Washington, DC, 1977.

Downloaded by UNIV OF CALIFORNIA SAN DIEGO on March 21, 2016 | http://pubs.acs.org Publication Date: June 1, 1977 | doi: 10.1021/bk-1977-0046.ch005

5.

DUCHAMP

Molecular Structure Studies

101

the recorded p r o f i l e provides many advantages over the " b l i n d " continuous scan mode, a l l o w i n g a much s u p e r i o r background c o r ­ r e c t i o n , making p o s s i b l e the d e t e c t i o n of abnormal p r o f i l e s , and producing a r e d u c t i o n i n experimental standard d e v i a t i o n s over the former method. In a d d i t i o n the step-scan experiment i s g e n e r a l l y f a s t e r s i n c e the time spent counting background i s e l i m i n a t e d . Further work on processing step-scan data (8, 9) and f u r t h e r work o p t i m i z i n g the measurement of x-ray i n t e n s i t i e s (10, Π , 12) have r e c e n t l y appeared; the references i n those papers provide access to the e a r l i e r l i t e r a t u r e on t h i s s u b j e c t . In a d d i t i o n to the improvement of the b a s i c data c o l l e c t i o n procedures, programs and algorithms are being developed f o r other experiments to a s s i s t i n the use of the d i f f r a c t o m e t e r and t o make the process more automatic. Progress i n t h i s area has been slow as r e c e n t l y pointed out by Spinrad (V3). The goal of being able to drop a c r y s t a l i n a magic funnel and have e v e r y t h i n g happen a u t o m a t i c a l l y i s not i n s i g h t , however, s i g n i f i c a n t auto­ matic enhancements are being made. Procedures to a i d i n indexing r e f l e c t i o n s were developed by Sparks (^4) and more r e c e n t l y by Jacobson (15); i n our l a b o r a t o r y a procedure i n v o l v i n g somewhat more i n t e r a c t i o n w i t h the d i f f r a c t o m e t e r i s under development. Two experiments which we have found very u s e f u l - - p r e c i s e a l i g n ­ ment of the x-ray tube and determination of p r e c i s i o n u n i t c e l l p a r a m e t e r s — a r e d e s c r i b e d i n d e t a i l below. When the x-ray tube i s changed on a d i f f r a c t o m e t e r i t must be p o s i t i o n e d very p r e c i s e l y to center the x-ray beam i n the i n c i d e n t beam c o l i m a t o r . This i s accomplished by t r a n s l a t i n g the tube i n the plane p e r p e n d i c u l a r to the c o l i m a t o r . Approximate p o s i t i o n i n g i s e a s i l y accomplished manually. Then a t e s t c r y s t a l i s placed on the d i f f r a c t o m e t e r , and from angle values obtained by c e n t e r i n g c e r t a i n r e f l e c t i o n s i n the d e t e c t o r , misalignment o f the tube may be i n f e r r e d . The process i s complicated by s l i g h t d e v i a t i o n s o f the c r y s t a l from the center of the goniometer (both i n height along the φ a x i s and t r a n s l a t i o n (normal t o i t ) , the a r b i t r a r y zero p o i n t of the 0 angle, and p o s s i b l e misalignments o f the zero p o i n t s o f the 2Θ, ω , and χ a n g l e s - - a l l of which a f f e c t the c e n t e r i n g o f a r e f l e c t i o n i n the d e t e c t o r . In our procedure, the user mounts the t e s t c r y s t a l , invokes the proce­ dure and g i v e s the computer approximate s e t t i n g angles f o r one o r more r e f l e c t i o n s . The computer measures accurate c e n t e r i n g angles f o r each t e s t r e f l e c t i o n at the 8 p o s s i b l e p o s i t i o n s w i t h ω = θ, as shown i n Table 1(a). From t h i s d a t a , a simple a l g o ­ r i t h m a l l o w s the computer t o separate the d i f f e r e n t v a r i a b l e s , and to d i r e c t the user e x a c t l y (to w i t h i n the approximation o f small t r a n s l a t i o n s ) how f a r and i n what d i r e c t i o n to move the tube, see Table 1(b). Other v a l u a b l e i n f o r m a t i o n d e r i v e d from t h i s experiment are accurate determinations of the t r u e zero's o f the ω , 2Θ, and χ angles. The d e t a i l e d equations are not pre­ sented here, s i n c e they vary w i t h goniometer geometry, however a s h o r t F o r t r a n program f o r performing the c a l c u l a t i o n f o r the

Christoffersen; Algorithms for Chemical Computations ACS Symposium Series; American Chemical Society: Washington, DC, 1977.

102

A L G O R I T H M S FOR C H E M I C A L C O M P U T A T I O N S

Table I a)

Settings with ω = θ ω

Downloaded by UNIV OF CALIFORNIA SAN DIEGO on March 21, 2016 | http://pubs.acs.org Publication Date: June 1, 1977 | doi: 10.1021/bk-1977-0046.ch005



b)

0

χ



2Θ/2

0

χ

-2Θ

-2Θ/2

0

χ

-2Θ

-2Θ/2

0



2Θ/2



2Θ/2

0 0 + 180

-2Θ

-2Θ/2

0 + 180

-2Θ

-2Θ/2

0 + 180

180 - χ

29

2Θ/2

0 + 180

180 - χ

χ + 180 χ + 180

-χ -χ

Computer r e p o r t (retyped f o r c l a r i t y )

X-RAY ALIGNMENT REPORT AFTER-ADJUST-AGAIN 3/4/75 12812 Κ

L

TTH

OMEGA

PHI

0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0

16.46 -16.45 -16.44 16.46 16.45 -16.46 -16.46 16.45

8.21 -8.23 -8.21 8.23 8.22 -8.22 -8.23 8.22

332.04 332.04 332.04 332.04 152.03 152.03 152.03 152.03

CHI

INT

78.98 815 79.20 830 180+79.20 811 180+78.96 783 - 79.16 917 - 79.07 903 180-78.95 896 180-79.28 913

PHI ERROR = -0.022 PHI (CORRECTED) = 332.062 CHI (AVE) = 79.105 AVE DEL (CHI) = 0.110 NEED TO MOVE TUBE DOWN 3.2 DIVISIONS CHI (ZERO) = -0.015 OMEGA ERROR FROM CENTERING = -0.000 PROBABLY CRYSTAL HEIGHT APPARENT TTH (ZERO) = 0.001 APPARENT OMEGA (ZERO) = -0.000 NEED TO MOVE TUBE OUT 0.3 DIVISIONS FOR TTH OR MOVE TUBE IN 0.1 DIVISIONS FOR OMEGA

Christoffersen; Algorithms for Chemical Computations ACS Symposium Series; American Chemical Society: Washington, DC, 1977.

Downloaded by UNIV OF CALIFORNIA SAN DIEGO on March 21, 2016 | http://pubs.acs.org Publication Date: June 1, 1977 | doi: 10.1021/bk-1977-0046.ch005

5.

Molecular Structure Studies

DUCHAMP

103

Syntex d i f f r a c t o m e t e r i s a v a i l a b l e from the author on request. Although a determination o f the u n i t c e l l parameters r e s u l t s from determination o f the o r i e n t a t i o n and i n d i c e s o f several r e ­ f l e c t i o n s used t o i n i t i a t e the data c o l l e c t i o n experiment, we have found t h a t a c o n s i d e r a b l y more accurate determination may be made by running a separate experiment i n v o l v i n g only measuring 2Θ values f o r high 2Θ r e f l e c t i o n s . Depending upon the c r y s t a l system, 1, 2, 4, o r 6 o f the u n i t - c e l l a x i a l lengths and i n t e r a x i a l angles have t o be measured e x p e r i m e n t a l l y , the remaining parameters being f i x e d by symmetry. The symmetry o f the u n i t c e l l i s important and must be used i n p r e c i s i o n u n i t - c e l l d e t e r ­ mination. The procedure c o n s i s t s o f f o u r steps: 1) the computer surveying the i n t e n s i t i e s o f p r e v i o u s l y measured r e f l e c t i o n s t o choose about 20 high 2Θ r e f l e c t i o n s , 2) making h i g h l y accurate step-scans o f the s e l e c t e d r e f l e c t i o n s , 3) c a l c u l a t i n g accurate 2-theta values from the scan data; and 4) c a l c u l a t i n g u n i t - c e l l parameters from accurate 2-theta measurements. The method used to c a l c u l a t e the "best" 2-theta f o r each r e f l e c t i o n from step-scan data was developed e s p e c i a l l y f o r t h i s system. Each peak i s a c t u a l l y a doublet--one peak due to αχ r a d i a t i o n and another due t o a r a d i a t i o n . The method assumes t h a t t h i s doublet may be f i t by the sum o f two Gaussian curves separated by Δ2Θ which can be c a l c u l a t e d from the wavelengths and the approximate 2-theta o f the 0 4 peak: 2

2Θ -2Θ \ 1

2e *

w

I 2θ .-(2θ!+Δ2θ)

2

1

w

1

/A +e

Ί

(1)

w

-I

+d

where I., i s the c a l c u l a t e d count a t 2Θ. ; w, c, and d are parame­ t e r s dependent upon peak w i d t h , peak height, and background, r e s p e c t i v e l y . The "best" 2-theta, 2θχ above, i s c a l c u l a t e d by a n o n - l i n e a r l e a s t - s q u a r e s procedure which v a r i e s c, w, and 2Θ t o minimize Χ

Σ all steps

2

[giid^o - di) )] .

(2)

c

where g. i s the weight c a l c u l a t e d by t a k i n g the r e c i p r o c a l o f the standard d e v i a t i o n (from counting s t a t i s t i c s ) o f (Ι ·) · Ί

0

The value o f d i s c a l c u l a t e d by averaging step-scan observa­ t i o n s a t ends o f the scan, and i s not v a r i e d during the l e a s t squares procedure. D e r i v a t i v e s are c a l c u l a t e d a n a l y t i c a l l y using expressions obtained by d i f f e r e n t i a t i n g equation 1. Up t o 10 i t e r a t i o n s a r e allowed; 3 t o 5 a r e u s u a l l y r e q u i r e d . When the method was developed, the e f f e c t s o f c, w, and d on 2θχ and σ(2θ ), the e r r o r estimate f o r 2Θ , were thoroughly χ

Χ

Christoffersen; Algorithms for Chemical Computations ACS Symposium Series; American Chemical Society: Washington, DC, 1977.

104

A L G O R I T H M S FOR C H E M I C A L

COMPUTATIONS

s t u d i e d . The value used f o r d was found t o have l i t t l e o r no e f f e c t on e i t h e r 2Θ o r σ(2θ ), unless an u t t e r l y r i d i c u l o u s d value was assumed. Therefore d i s not i n the refinement. The values o f c and w were found t o have only small e f f e c t s on 2 θ but somewhat l a r g e r e f f e c t s on σ(2θ!). The two parameters c and w are s t r o n g l y c o r r e l a t e d — a l l o w i n g l a r g e s h i f t s i n c before w has quieted down r e s u l t s i n an unstable refinement. C a l c u l a t i o n o f the u n i t - c e l l parameters from the 2Θ data i s accomplished by a s p e c i a l adaptation o f a method used i n several l a b o r a t o r i e s f o r determining accurate c e l l parameters from spe­ c i a l f i l m data (16). For the general case Χ

2

Downloaded by UNIV OF CALIFORNIA SAN DIEGO on March 21, 2016 | http://pubs.acs.org Publication Date: June 1, 1977 | doi: 10.1021/bk-1977-0046.ch005

ΐ 9

j

2

2

2

sin 0 = h a*

2

2

+ k b*

2h£a*c*

2

2

2

+ £ c * + 2k£b*c*

cos3* + 2hk a*b*

cosa* +

cosy*

(3)

where h, k, and ι are r e f l e c t i o n i n d i c e s ; a*, b*, c*, a*, 3*, γ* are a x i a l lengths and i n t e r a x i a l angles o f the r e c i p r o c a l c e l l . Equation 9 may be abbreviated as 2

2

sin 0 = h s

2

x

+ k s

2

2

+ £ s

3

+ kis

h

+ h£s

5

+ hks

The l i n e a r l e a s t - s q u a r e s procedure determines so as t o minimize

^w^Cisin^Oo -

(sin^d

(4)

6

s

l 9

... , s

6

(5)

2

i=l Comparison o f equations 3 and 4 shows immediately how t o c a l c u l a t e the r e c i p r o c a l c e l l parameters from the c o e f f i c i e n t s i n 4. From these, the u n i t c e l l parameters may be c a l c u l a t e d using standard expressions (17). The weight o f each observation i s c a l c u l a t e d by 1 W

i

=

( 6 )

( s i n 2θ)σ(29)

The e f f e c t o f symmetry i s c o n v e n i e n t l y taken i n t o account by r e s t r i c t i o n s on ... , s as f o l l o w s : 6

C r y s t a l System

To Be Determined

Triclinic Monoclinic Orthorhombic Tetragonal Hexagonal Cubic

S i , ... , s Si, s ,S3,s S i , s , S3 s i ,s s s 6

2

2

3

l f

Sx

3

5

Restrictions None s = s =0 s^ = s = s = 0 S 2 = s i , Sh = ss = S 6 = 0 s = s = s , s = s =0 s = s = s 5 ^ = 5 5 = s 4

6

5

2

6

x

3

2

l

6

5

9

Christoffersen; Algorithms for Chemical Computations ACS Symposium Series; American Chemical Society: Washington, DC, 1977.

4

6

=0

5.

DUCHAMP

Molecular Structure Studies

105

Standard d e v i a t i o n s i n u n i t - c e l l parameters may be c a l c u l a t e d a n a l y t i c a l l y by e r r o r propagation. In these programs, however, the Jacobian o f the t r a n s f o r m a t i o n from s ... , s t o u n i t - c e l l parameters and volume i s evaluated n u m e r i c a l l y and used to transform the variance-covariance m a t r i x o f ... , s i n t o the v a r i a n c e s o f the c e l l parameters and volume from which standard d e v i a t i o n s are c a l c u l a t e d . I f s u i t a b l e standard d e v i a t i o n s are not obtained f o r c e r t a i n o f the u n i t c e l l parameters, i t i s easy t o program the computer t o measure a d d i t i o n a l r e f l e c t i o n s which s t r o n g l y c o r r e l a t e w i t h the d e s i r e d parameters, and repeat the f i n a l c a l c u l a t i o n s w i t h t h i s a d d i t i o n a l data. l

5

6

Downloaded by UNIV OF CALIFORNIA SAN DIEGO on March 21, 2016 | http://pubs.acs.org Publication Date: June 1, 1977 | doi: 10.1021/bk-1977-0046.ch005

6

Treatment o f C r y s t a l D e t e r i o r a t i o n : The v a r i a t i o n o f the i n t e g r a t e d i n t e n s i t i e s o f X-ray r e f l e c t i o n as a f u n c t i o n o f time o f exposure t o X-rays i s a problem which has plagued c r y s t a l ! o g r a p h e r s f o r some time. L i t t l e i s known o f the p h y s i c a l and chemical processes l e a d i n g to r a d i a t i o n damage (18). U s u a l l y several c a r e f u l l y chosen r e f l e c t i o n s (check r e f l e c t i o n s ) are repeated a t r e g u l a r i n t e r v a l s during data c o l l e c t i o n . The problem i s how best t o use the f l u c t u a t i o n s i n these measured i n t e n s i t i e s t o s c a l e the observed s e t o f i n t e n s i t i e s . We use 10 check r e f l e c t i o n s a f t e r experimenting w i t h more and fewer. Since the f l u c t u a t i o n s o f i n t e n s i t y w i t h time are almost always n o n - l i n e a r , and f r e q u e n t l y a r e non-monotonic a l s o , a f a i r l y complicated f u n c t i o n i s r e q u i r e d t o express the deterioration scale factor. In the procedure described here, the s c a l e f a c t o r i s represented as a f u n c t i o n o f time C ( t ) described mathematically by C(t)

(7)

= a i f i ( t ) + a f ( t ) + ... + a f ( t ) 2

2

p

p

where t i s the cumulative exposure time o f the c r y s t a l , the f ^ U ) are

f u n c t i o n s o f t , and the a^ are the c o e f f i c i e n t s t o be d e t e r -

mined from the check r e f l e c t i o n data t o s p e c i f y C ( t ) .

The

c r i t e r i a chosen i s t o determine the a^ so as t o minimize the sum of the weighted second moments about the means o f the s c a l e d check r e f l e c t i o n i n t e n s i t i e s . With a second Lagrange undetermined m u l t i p l i e r term added t o avoid the t r i v i a l minimum, the f u n c t i o n minimized becomes

Christoffersen; Algorithms for Chemical Computations ACS Symposium Series; American Chemical Society: Washington, DC, 1977.

A L G O R I T H M S FOR C H E M I C A L

106

where t . . i s the time f o r the i

COMPUTATIONS

1

^ o b s e r v a t i o n of the j * * check

r e f l e c t i o n , g.. i s i t s i n t e n s i t y .

The weights w. are defined by

IJ

J

W

m

J

_

= j

1

Ç^j

- 1

(8)

where σ.. i s the standard d e v i a t i o n i n g.., and m. i s the number of observations o f check r e f l e c t i o n j . The b. are defined by Downloaded by UNIV OF CALIFORNIA SAN DIEGO on March 21, 2016 | http://pubs.acs.org Publication Date: June 1, 1977 | doi: 10.1021/bk-1977-0046.ch005

j bj = m j - i £c(tij)gij

(9)

By s u i t a b l e mathematical manipulation the above may be shown t o be a l i n e a r l e a s t - s q u a r e s w i t h c o n s t r a i n t problem i n the v a r i ­ ables a^. Before the a can be determined, the f u n c t i o n s f ( t ) k

k

must be s p e c i f i e d . I f C ( t ) i s chosen to be a simple polynomial i n t , (i.e., k-1 fjjt) = t ), and a d i r e c t l e a s t - s q u a r e s s o l u t i o n i s c a l c u l a t e d , c a l c u l a t i o n t r o u b l e u s u a l l y r e s u l t s s i n c e the determinant of the c o e f f i c i e n t s o f the normal equations tends to be very small (19). A C ( t ) w i t h a l l the f l e x i b i l i t y of the general polynomial i s obtained, and the numerical problem i s avoided by choosing the f ( t ) t o be the orthogonal polynomials o f Forsythe (19). Cast k

in our n o t a t i o n , the f ( t ) are defined r e c u r s i v e l y by k

fi(t) = 1 f (t)

= (t - u ) f ( t )

f (t)

= (t - u ) f ( t ) - v f i ( t )

f (t)

= (t - u )f .-,(t) - v .-,f . (t)

2

3

k

2

x

3

2

k

2

k

k

k

2

(11)

where

2

= _ U

U l

Ο )

k

_ _hi

w

v

d

dk-1

k-i k =

(13)

-

d _ k

£

(f (t k

2

i j ) ) 2

• 9J

Christoffersen; Algorithms for Chemical Computations ACS Symposium Series; American Chemical Society: Washington, DC, 1977.

(14)

5.

DUCHAMP

107

Molecular Structure Studies

In t h i s f o r m u l a t i o n , the needed c o e f f i c i e n t s a^ may be c a l c u l a t e d d i r e c t l y without recourse to s o l v i n g the usual eigenvector problem. In our programs p r o v i s i o n i s a l s o made f o r a dependence o f s c a l e f a c t o r on d i r e c t i o n i n the c r y s t a l , h and on the Bragg angle, Θ. A new s c a l e f a c t o r C'(t,Ji,£) i s defined as 9

Downloaded by UNIV OF CALIFORNIA SAN DIEGO on March 21, 2016 | http://pubs.acs.org Publication Date: June 1, 1977 | doi: 10.1021/bk-1977-0046.ch005

C'(t,h.0) = 1 + ( C ( t ) - l ) H(h) E(9)

(15)

where C ( t ) i s our o r i g i n a l f u n c t i o n i n time, H{h) i s a d i r e c t i o n dependent f a c t o r w i t h s i x determinable parameters, and Ε(θ) i s a f a c t o r w i t h one determinable parameter. The c o e f f i c i e n t s o f t h i s g e n e r a l i z e d s c a l e f a c t o r f u n c t i o n i s determined to minimize the same q u a n t i t y w i t h C r e p l a c i n g C, by f i r s t s o l v i n g as before w i t h the new parameters set so t h a t H{h) = Ε(θ) =1.0, then a l l o w i n g a l l parameters to vary from t h a t p o i n t i n an i t e r a t i v e m i n i m i z a t i o n procedure s i m i l a r to "steepest descents". A more d e t a i l e d d e s c r i p t i o n of the g e n e r a l i z e d s c a l e f a c t o r f u n c t i o n i s contained i n an implementation of t h i s s c a l i n g a l g o r i t h m i n a F o r t r a n data r e d u c t i o n program a v a i l a b l e from the author. Hidden L i n e A l g o r i t h m s : In the d i s p l a y of a three dimensional o b j e c t on a p l o t t e r o r on the screen of a graphics t e r m i n a l , the task of d e c i d i n g which p a r t s of the o b j e c t should be shown and which should be e l i m i ­ nated (or made dashed) i s known as the "hidden l i n e problem". This problem and the more complicated "hidden surface problem" has r e c e n t l y been reviewed by Sutherland, S p r o u l l and Schumacker (20) from a s o r t i n g p o i n t of view. These algorithms are espe­ c i a l l y important because programs w i t h i n e f f i c i e n t hidden l i n e algorithms can use up enormous amounts of computer time and because manual "touch up" of drawings to e l i m i n a t e hidden l i n e e r r o r s may be q u i t e time consuming. The most e f f i c i e n t a l g o ­ rithms r e s u l t when the o b j e c t to be drawn has s p e c i a l f e a t u r e s which a l l o w the general problems to be s i m p l i f i e d . Two problems are t r e a t e d here i n some d e t a i l : the drawing of a c r y s t a l from face measurements and the drawing of a " b a l l and s t i c k " repre­ s e n t a t i o n of a molecule. The problem of producing of a c r y s t a l l i k e t h a t shown i n Figure 3 arose i n a graphics program (21) used to v i s u a l l y compare the computer d e s c r i p t i o n of a c r y s t a l as a convex poly­ hedron w i t h the c r y s t a l as viewed on an o p t i c a l goniometer. The problem i s one of d i s p l a y i n g a convex polyhedron given the information d e s c r i b i n g the faces of the polyhedron. From t h i s i n f o r m a t i o n the faces which i n t e r s e c t at the v a r i o u s corners and the coordinates of the corners can e a s i l y be computed (22). From t h i s , a l i s t of edges--the l i n e s a c t u a l l y to be drawn i n the f i g u r e - - c a n e a s i l y be compiled.

Christoffersen; Algorithms for Chemical Computations ACS Symposium Series; American Chemical Society: Washington, DC, 1977.

108

ALGORITHMS

FOR C H E M I C A L

COMPUTATIONS

Downloaded by UNIV OF CALIFORNIA SAN DIEGO on March 21, 2016 | http://pubs.acs.org Publication Date: June 1, 1977 | doi: 10.1021/bk-1977-0046.ch005

In producing the drawing, a r o t a t i o n of the coordinates o f the corners i s performed to g i v e a s e t o f x,y,z r e l a t i v e to an o r i g i n a t the center w i t h the χ a x i s a l i g n e d w i t h the viewing d i r e c t i o n . Next i s i d e n t i f i c a t i o n o f those edges which l i e on the convex polygon which d e f i n e s the periphery of the polyhedron i n p r o j e c t i o n on the y,z plane. For each edge, d e f i n e d by two corners i and j , the edge i s on the polygon i f a l l other corners e i t h e r l i e on the edge or on one s i d e o f i t i n p r o j e c t i o n on the y,z plane, or simply i f

( z

z

r j

) y

z

^j"V k V j "

+

k

+

z

i*j

> 0 for all k or o r 0 for all k