UBC Theses and Dissertations

UBC Theses Logo

UBC Theses and Dissertations

A microcomputer program for optical multilayer thin films Betts, Kevin Howard 1985

Your browser doesn't seem to have a PDF viewer, please download the PDF to view this item.

Item Metadata

Download

Media
831-UBC_1985_A7 B47.pdf [ 5.22MB ]
Metadata
JSON: 831-1.0096295.json
JSON-LD: 831-1.0096295-ld.json
RDF/XML (Pretty): 831-1.0096295-rdf.xml
RDF/JSON: 831-1.0096295-rdf.json
Turtle: 831-1.0096295-turtle.txt
N-Triples: 831-1.0096295-rdf-ntriples.txt
Original Record: 831-1.0096295-source.json
Full Text
831-1.0096295-fulltext.txt
Citation
831-1.0096295.ris

Full Text

A MICROCOMPUTER PROGRAM FOR OPTICAL MULTILAYER THIN FILMS by KEVIN HOWARD BETTS B.A.Sc, The U n i v e r s i t y of B r i t i s h Columbia, 1983 A THESIS SUBMITTED IN PARTIAL FULFILMENT OF THE REQUIREMENTS FOR THE DEGREE OF MASTER OF APPLIED SCIENCE in THE FACULTY OF GRADUATE STUDIES (Department of P h y s i c s ) We accept t h i s - t h e s i s as conforming to the r e q u i r e d standard THE UNIVERSITY OF BRITISH COLUMBIA APRIL 1985 © Kevin Howard B e t t s , 1985 In presenting t h i s thesis i n p a r t i a l f u l f i l m e n t of the requirements for an advanced degree at the University of B r i t i s h Columbia, I agree that the Library s h a l l make i t f r e e l y available for reference and study. I further agree that permission for extensive copying of t h i s thesis for scholarly purposes may be granted by the head of my department or by his or her representatives. I t i s understood that copying or publication of t h i s thesis for f i n a n c i a l gain s h a l l not be allowed without my written permission. Department of ^ V ^ A S l t S  The University of B r i t i s h Columbia 1956 Main Mall Vancouver, Canada V6T 1Y3 Date ftpr;\ X*-, m - 5 i i ABSTRACT A microcomputer software package was written to calculate the tranmission and reflection characteristics of multilayer thin films on a substrate. The program was written to be as "user-friendly", versatile and modular as possible. To test the program, a transparent oxide-type heat-mirror film capped with an antireflection coating was studied for greenhouse applications. Si0 2 and ZnO were considered as representative antireflection and heat-mirror materials respectively. The results of calculations of heat transfer coefficient and transmittance of the glazing construction polyethylene/air gap/Si02/ZnO/polyethylene are presented. The resulting structure is shown to give a visible light transmission spectrum which closely matches the plant sensitivity curve for plant growth and has higher thermal insulation compared to uncoated polyethylene. i i i TABLE OF CONTENTS ABSTRACT i i LIST OF TABLES f v LIST OF FIGURES v i ACKNOWLEDGMENT v i i INTRODUCTION 1 CHAPTER TWO 2.1 T h e o r e t i c a l Background:Single Layer F i l m s 6 Transmission and R e f l e c t i o n C o e f f i c i e n t s 6 G e n e r a l i z i n g the S n e l l Law 8 E x t i n c t i o n C o e f f i c i e n t 9 2.2 T h e o r e t i c a l B ackgroundrMultilayer Thin F i l m s 10 Transmission and R e f l e c t i o n C o e f f i c i e n t s 10 Maximizing the T C o e f f i c i e n t 15 CHAPTER THREE 3.1 Features of Hetero 17 3.2 Exec u t i n g Hetero 21 CHAPTER FOUR 4.1 Hetero Compilation U n i t s 23 CHAPTER FIVE 5.1 Background 29 5.2 Design C r i t e r i a f o r M u l t i l a y e r S t r u c t u r e 30 5.3 Choice of M a t e r i a l s 32 5.4 Design of Heat M i r r o r H e t e r o s t r u c t u r e 33 5.5. Performance of G l a z i n g H e t e r o s t r u c t u r e 35 CONCLUSION 4 4 i v REFERENCES 4 5 APPENDIX A O p t i c a l C o n s t a n t s f o r ZhO and P o l y e t h y l e n e 47 APPENDIX B L i s t i n g of Program He t e r o 49 V LIST OF TABLES TABLE I O p t i c a l Constants 41 TABLE II Cost E f f e c t i v e n e s s 42 vi LIST OF FIGURES FIGURE 1 Structure of Hetero Compilation Units 4 FIGURE 2 Transmission/Reflection Coefficients for a Single Film .7 FIGURE 3 Transmission and Reflection Coefficients for Thin Films on One Side of Substrate 11 FIGURE 4 Transmission and Reflection Coefficients for Thin Films on Both Sides of Substrate 14 FIGURE 5 Transmission Through Polyethylene/air gap/Si02/ZnO/Polyethylene 31 FIGURE 6 Refractive Index Data for Si0 2, ZnO, Polyethylene 34 FIGURE 7 Reflection of IR Radiation from ZnO/Polyethylene 36 FIGURE 8 Cross Section of AR/Heat-mirror Film for Greenhouses ...37 FIGURE 9 Angular T Variation for Parallel Polarization 39 FIGURE 10 Angular T Variation for Perpendicular Polarization 40 v i i ACKNOWLEDGMENT I would l i k e to thank Dr. Robert Parsons, my t h e s i s s u p e r v i s o r , f o r h i s continued support, c o n s t r u c t i v e c r i t i c i s m , and a s s i s t a n c e . Thanks i s a l s o due to a number of f e l l o w students. In p a r t i c u l a r , Mike B r e t t who was always w i l l i n g to give a s s i s t a n c e when asked, John A f f i n i t o f o r h i s thorough t e s t i n g of a l l aspects of the program and f o r h i s c o n s t r u c t i v e c r i t i c i s m on ways to make Hetero " u s e r - f r i e n d l y " , and, B r i a n S u l l i v a n f o r h i s i n v a l u a b l e h e l p when I was l e a r n i n g P a s c a l . 1 INTRODUCTION O p t i c a l m u l t i l a y e r t h i n f i l m theory f o r a n t i r e f l e c t i n g and r e f l e c t i n g systems was f i r s t formulated around 1937 [1-2]. Thin f i l m a p p l i c a t i o n s in o p t i c s s t a r t e d around the same time with the i n t r o d u c t i o n of the vacuum ev a p o r a t i o n technique f o r d e p o s i t i n g t h i n f i l m s [2-3]. Since then many t h i n f i l m d e p o s i t i o n t e c h n o l o g i e s have been used i n d e p o s i t i n g m u l t i l a y e r t h i n f i l m s on a s u b s t r a t e (e.g. planar magnetron s p u t t e r i n g ) [ 3 ] , With m u l t i l a y e r t h i n f i l m s being s u c c e s s f u l l y used i n transparent window i n s u l a t i o n , s o l a r - c o l l e c t o r , e l e c t r o -o p t i c a l , i n d u s t r i a l heat s h i e l d i n g and a i r c r a f t a p p l i c a t i o n s [ 3 ] . In 1978 a research group i n the P h y s i c s Department at U.B.C. began to study the o p t i c a l p r o p e r t i e s of m u l t i l a y e r t h i n f i l m s that were d e p o s i t e d by a planar magnetron s p u t t e r i n g system. The o p t i c a l p r o p e r t i e s that were of main i n t e r e s t were the t r a n s m i s s i o n and r e f l e c t i o n (T/R) p r o p e r t i e s of m u l t i l a y e r t h i n f i l m s on a p l a s t i c s u b s t r a t e . Unfortunately,, a n a l y t i c a l work in s t u d y i n g even two or three f i l m l a y e r s can become very l a b o u r i o u s . As a r e s u l t , i t was decided to use a microcomputer program to compute the T/R curves. Since there were no precedents i n the l i t e r a t u r e of a program which c a l c u l a t e d the T/R curves of any number of t h i n f i l m l a y e r s , i t was necessary to w r i t e our own program. Consequently, i n 1982 a simple computer program was w r i t t e n which c o u l d c a l c u l a t e the T/R curves of one, two or three t h i n f i l m l a y e r s ; but the theory used d i d not r e a d i l y allow f o r easy expansion of t h i s program. 2 A l s o , t h i s program was not " u s e r - f r i e n d l y " ; i n other words, the user had to enter the program to make any changes ( t h i s r e q u i r e d that the user know how the program worked). In May of 1983 work began on a " u s e r - f r i e n d l y " program, c a l l e d Hetero, which would handle m t h i n f i l m l a y e r s on e i t h e r or both s i d e s of the s u b s t r a t e using the general m u l t i l a y e r t h i n f i l m theory of r e f e r e n c e 4. A d e c i s i o n was made to l i m i t the program to c a l c u l a t e the T/R values f o r up to twenty t h i n f i l m l a y e r s because: ( i ) more than twenty l a y e r s r e q u i r e d too much memory and ( i i ) i t was f e l t there would be no immediate need f o r more than twenty t h i n f i l m s on a s u b s t r a t e . I t was a l s o decided that the program should be w r i t t e n to allow f o r easy f u t u r e expansion of the maximum number of t h i n f i l m s ; t h i s w i l l be -discussed i n a l a t e r s e c t i o n . By the time work had begun on Hetero the l a b had a l r e a d y w r i t t e n a microcomputer software package to c o n t r o l and monitor the planar magnetron s p u t t e r i n g process and to d i s p l a y and r e c o r d data from the process equipment [ 5 ] . The system c a l l e d M i c r o s p u t , was w r i t t e n i n P a s c a l and operated on the UCSD P a s c a l Version. IV.0 o p e r a t i n g system. Consequently, Hetero was a l s o w r i t t e n i n P a s c a l , using the same o p e r a t i n g system, to make the two software packages complimentary. A secondary reason f o r using P a s c a l over other programming languages was based on the f a c t that P a s c a l i s a s t r u c t u r e d language which can handle data and number crunching as w e l l as c h a r a c t e r and s t r i n g handling e f f i c i e n t l y . The e x p l a n a t i o n and documention of Hetero i s the primary 3 t o p i c of t h i s t h e s i s . . To t e s t the program the problem of c a l c u l a t i n g the T/R curves of a m u l t i l a y e r t h i n f i l m s s t r u c t u r e on greenhouse pol y e t h y l e n e was c o n s i d e r e d . Restated, the main o b j e c t i v e of t h i s t h e s i s was to w r i t e a " u s e r - f r i e n d l y " microcomputer program f o r studying m u l t i l a y e r t h i n f i l m s T/R c h a r a c t e r i s t i c s as a f u n c t i o n of wavelength, where the user i n t e r a c t i v e l y enters a minimal amount of important h e t e r o s t r u c t u r e data while s t i l l m a i n t a i n i n g maximum var i a n c e in the h e t e r o s t r u c t u r e composition. It was a l s o d e s i r e d that t h i s program be w r i t t e n i n pure p a s c a l code which allowed i t to used on any o p e r a t i n g system that supported UCSD P a s c a l ; t h i s allows f o r easy a d a p t a b i l i t y of Hetero to new microcomputer systems. F i n a l l y , as a program to be used in resea r c h one must be able to extend and a l t e r the software e a s i l y as research n e c e s s i t a t e s the a d d i t i o n o f , say, new t h e o r i e s f o r c a l c u l a t i n g the r e f r a c t i v e i n d i c e s of t h i n f i l m s (e.g. s e r m i t e s ) . Hetero achieves t h i s a d a p t a b i l i t y by p r o v i d i n g s e p e r a t e l y compiled u n i t r o u t i n e s with each u n i t preforming a very s p e c i f i c task (see F i g u r e 1 ) . To v e r i f y that t h i s program would work as d e s c r i b e d above a secondary rese a r c h e f f o r t was done i n t h i s r e p o r t on improving the T/R c h a r a c t e r i s t i c s of p o l y e t h y l e n e on greenhouses. In p a r t i c u l a r , the T/R c h a r a c t e r i s t i c s of the g l a z i n g c o n s t r u c t i o n p o l y e t h y l e n e / a i r gap/Si0 2/ZnO/polyethylene were c a l c u l a t e d . T h i s r e s u l t was r e l a t e d to greenhouse a p p l i c a t i o n s . The s t r u c t u r e of t h i s r e p o r t i s as f o l l o w s . Chapter Two 4 P l o t R e s u l t H e t e r o C a l c V a l u e S e t Up D a t a E n t e r D a t a I n i t i a l i z e s y s t e m + f u t u r e p r o m p t s F u t u r e U n i t Hyp T r i g C m p l e x M a t h F i g u r e 1. The s t r u c t u r e o f H e t e r o c o m p i l a t i o n u n i t s , w i t h an i n d i c a t i o n o f how f u t u r e c o m p i l a t i o n u n i t s c a n be a d d e d . U n i t s a t t o p o f t h e f i g u r e h a v e a c c e s s t o t h o s e b e l o w . F o r s i m p l i c i t y a l l g l o b a l v a r i a b l e d e c l a r a t i o n s a r e i n u n i t ENTER DATA 5 d e s c r i b e s the theory of s i n g l e l a y e r and m u l t i l a y e r t h i n f i l m s as how they are a p p l i e d to the Hetero. Chapter Three i s an overview of the f e a t u r e s of the program and how to use i t . Chapter Four i s an overview of the program; an e x p l a n a t i o n of each c o m p i l a t i o n u n i t . Chapter F i v e d i s c u s s e s the a p p l i c a t i o n of t h i s program f o r improving the T/R c h a r a c t e r i s t i c s of p o l y e t h y l e n e on greenhouses. Chapter Six concludes the t h e s i s . Appendices i n c l u d e the determination of o p t i c a l constants f o r ZnO and p o l y e t h y e l e n e ; and the e n t i r e l i s t i n g of Hetero. 6 CHAPTER TWO 2.1 THEORETICAL BACKGROUND:SINGLE LAYER FTLMS TRANSMISSION AND REFLECTION COEFFICIENTS The f o l l o w i n g theory.has a p p l i c a t i o n s i n c a l c u l a t i o n of ( i ) the t o t a l t r a n s m i s s i o n and r e f l e c t i o n c o e f f i c i e n t s ( T s / R s ) of a s i n g l e p a r a l l e l p l a t e and ( i i ) the a b s o r p t i o n a and e x t i n c t i o n k c o e f f i c i e n t s ( d e f i n e d below-) -of t h i s p l a t e . Both c a l c u l a t i o n s are now proven and s h a l l be used i n a l a t e r sect i o n . Consider a p a r a l l e l t r ansparent p l a t e of r e f r a c t i v e index n, surrounded by a medium of r e f r a c t i v e index n 0 . Now suppose a plane wave of l i g h t i s i n c i d e n t upon the medium at an angle 0, represented by ray SB,. At the f i r s t s u r f a c e t h i s wave i s d i v i d e d i n t o two plane waves, one r e f l e c t e d i n the d i r e c t i o n B,C, and the other t r a n s m i t t e d i n t o the p l a t e i n the d i r e c t i o n B ^ , . The l a t t e r wave i s i n c i d e n t on the second s u r f a c e at an angle 0, and i s d i v i d e d there i n t o two plane waves, one r e f l e c t e d i n t o the p l a t e i n the d i r e c t i o n D,B 2 and one t r a n s m i t t e d i n the d i r e c t i o n D , E i . T h i s process of d i v i s i o n of the wave remaining i n s i d e the p l a t e continues as i n d i c a t e d i n F i g u r e 2. Let I 0 be the i n t e n s i t y of the incoming wave. By summing a l l the rays t h a t are t r a n s m i t t e d through the p l a t e ( i . e . rays DjEj , f o r i , j = 1,2..) the t r a n s m i t t e d i n t e n s i t y i s found I = I 0 ( 1 - r ) 2 e x p ( - a t / c o s e , ) + I 0 ( 1 - r ) 2 r 2 e x p ( - 3 a t / c o s 0 , ) + . .(1) Si m p l i f y i n g 7 Figure 2. Cross section of a single film. Transmission and *j - t/cosS' u e s s o l v e d f r ° m an energy viewpoint. 8 I = T s = ( 1 - r ) 2 e x p ( - a t / c o s O i ) I 0 1- r'exp(-2at/cos0,) (2) s i m i l a r l y f o r the t o t a l i n t e n s i t y r e f l e c t e d 1=1 0 r + I 0 r (1-r ) 2exp(-2at/cost9 1 ) + I 0 r 3 (1-r ) 2exp(-4at/cost? 1 )+ . (3) s i m p l i f y i n g I = R s= r d + ( 1-2r )exp(-2at/cosg 1 ) ) I 0 ( 1 - r*exp(-2at/cosfl , )) (4) where r = F r e s n e l c o e f f i c i e n t f o r r e f l e c t i o n at a s i n g l e s u r f a c e . t = t h i c k n e s s of s u b s t r a t e = dcose?, a = a b s o r p t i o n c o e f f i c i e n t ( d e f i n e d below) d\ = complex angle of r e f r a c t i o n ; d e f i n e d below. The det e r m i n a t i o n of the complex cos(0,) i s now d i s c u s s e d b r i e f l y ; then the determination of a i s shown. GENERALIZING THE SNELL LAW The r e f r a c t i v e index, of the p l a t e , i s i n general complex as d e f i n e d by fr, = n, - i k , (5) where k, i s the e x t i n c t i o n c o e f f i c i e n t of the l a y e r . I t i s r e l a t e d to the a b s o r p t i o n c o e f f i c i e n t a by the r e l a t i o n k , = _oX_ (6) 4 7T The angle 6} i s r e l a t e d to the angle of i n c i d e n c e of 0 by S n e l l ' s law. n o s i n ( 0 ) = -f r ^ s i n f f l , ) (7) Since t? 1 i s complex, i n e v i t a b l y one must assume a complex 0, = tT, and c o r r e s p o n d i n g l y a complex sinCt^,). S o l v i n g f o r a complex sinCt?',) and c o s ( ^ , ) f o l l o w i n g r e f e r e n c e 2; l e t us write s i n ( ? , ) = S' + i S " (8) we f i n d from S n e l l ' s law i 9 S' = n 0 s i n ( ( 9 ) -n, (9) n, * + k, * S" = nnsin(g)•k, (10) n, 2 + k, 2 Now s o l v i n g f o r the complex co s i n e cosCT,) = C + i C " = /(1 - sin 2(c9, ) )v (11) The components of t h i s complex c o s i n e are found to be C = J ( p + .Ftf~T^) ( 1 2 ) C" = | ( - p + T p 7 + q2') (13) where p = 1 - S' 2 + S" 2 = C 2 - C" 2 (14) q = -2S'S" = 2 C C " (15) EXTINCTION COEFFICIENT From equations (1)~(6) i t i s now p o s s i b l e to c a l c u l a t e the a b s o r p t i o n c o e f f i c i e n t . Since R > r i t i s a good approximation in g e n e r a l t o take r<<1; thus from equation (2) and (4) we get an e x p r e s s i o n f o r the F r e s n e l c o e f f i c i e n t r = Rs (16) 1 + Ts2 o S o l v i n g equation 2 f o r a g i v e s a = - l n ( - Q - r ) 2 + / ( 1 - r ) " + 4T s 2"r 2"l + ln ( 2 T s r 2 ) (17) t t Determining R s and T s e x p e r i m e n t a l l y , say, with a spectrophotometer and then by using equations (6), (16) and (17) the e x t i n c t i o n c o e f f i c i e n t of a s i n g l e t r ansparent p a r a l l e l p l a t e can be found. 10 2.2 THEORETICAL BACKGROUND:OPTICAL MULTILAYER THIN FILMS TOTAL TRANSMISSION AND REFLECTION COEFFICIENTS If a beam of el e c t r o m a g n e t i c r a d i a t i o n f a l l s onto a s t r u c t u r e c o n s i s t i n g of t h i n f i l m s of s e v e r a l d i f f e r e n t m a t e r i a l s , m u l t i p l e r e f l e c t i o n s take plac e and i n t e r f e r e n c e occurs [ 4 ] . In order to c a l c u l a t e the r e f l e c t i o n and t r a n s m i s s i o n c o e f f i c i e n t at any angle of i n c i d e n c e (and any number of t h i n f i l m l a y e r s ) i t i s convenient to use a matrix f o r m u l a t i o n [4,6]. Consider a t h i n f i l m system c o n s i s t i n g of 1 l a y e r s as shown i n F i g u r e 3. The c o n s t r u c t i o n parameters comprise not only the r e f r a c t i v e index riband t h i c k n e s s t-, of the l a y e r s but a l s o the r e f r a c t i v e i n d i c e s ^ and n 0 of the su b s t r a t e and i n c i d e n t medium, r e s p e c t i v e l y . The wavelength X, the angle of i n c i d e n c e 6, and the plane of p o l a r i z a t i o n of the i n c i d e n t r a d i a t i o n are e x t e r n a l v a r i a b l e s of the system. I t can be shown [4,6] that the j t h f i l m can be represented by the so c a l l e d " c h a r a c t e r i s t i c matrix". with and M = cos ( 6 j ) i s i n ( 8 ,) /U-, i U s i n ( 5 j) cos(6 ; ) 6; = (2*/A) ( n s t j cost*-, ) ) U: = n,- p o l a r i z a t i o n p a r a l l e l to cos(4>j ) plane of i n c i d e n c e n j C o s ( 0 ; ) p o l a r i z a t i o n p e r p e n d i c u l a r to p l a n e of i n c i d e n c e (18) (19) (20) The q u a n t i t y 6 j i s . c a l l e d the " e f f e c t i v e phase d i f f e r e n c e " of 11 F i g u r e 3. C o n s t r u c t i o n parameters f o r the c a l c u l a t i o n of t r a n s m i s s i o n and r e f l e c t i o n c h a r a c t e r i s t i c s f o r m u l t i l a y e r t h i n f i l m s on one s i d e of the s u b s t r a t e . 1 2 the j t h l a y e r f o r an angle of r e f r a c t i o n <t>t . The r e f r a c t i v e index i s i n general complex as d e f i n e d by -fT = n - ik (21 ) where k i s the e x t i n c t i o n c o e f f i c i e n t of the l a y e r . I t i s r e l a t e d to the a b s o r p t i o n c o e f f i c i e n t a d e f i n e d i n equation 6. k = aX (22) The angle <p-t i s r e l a t e d to the angle of i n c i d e n c e 6 by S n e l l ' s law. n o s i n ( 0 ) = -fr. s i n ( 0 . ) . (23) The complete m u l t i l a y e r s t r u c t u r e of F i g u r e 3 i s represented by the product of the i n d i v i d u a l c h a r a c t e r i s t i c m a t r i c e s , M = M,M2M3 . . .MMM, (24) which can be expressed as M = m 21 m 2 2 (25) The e l e c t r i c f i e l d amplitude t r a n s m i t t a n c e and r e f l e c t a n c e c o e f f i c i e n t s are given by r a . s = n 0cos(t9) (m, , + m 1,n , scos(^ ! i)) - m, , - m , 7 ^ c o s ( ^ , ) (26) nocos ( e)(m, , + m, 21i-scos(<(>s ) ) + m2 , + m2 2 f r s cos (<j>s') t a . s = 2nf,cos(t9) . ^ (27) n 0cos(f?) (m, , + m, j ^ c o s (<ps) ) + m2 , + m2 2"nscos(<ps ) The t r a n s m i s s i o n and r e f l e c t i o n c o e f f i c i e n t s , f o r energy, are - T„., = R e C f u c o s U s ) l t 0 . c | 2 (28) R e ( n 0 c o s ( 6 ) ) Ra-s = | r a . s | 2 (29) where Re(x) denotes the r e a l p a r t of the complex q u a n t i t y , x, 13 The a b s o r p t i o n of the m u l t i l a y e r stack i s c a l c u l a t e d from A = 1 - T - R (30) In g e n e r a l we want to be able to c a l c u l a t e the t r a n s m i s s i o n , r e f l e c t i o n and a b s o r p t i o n c h a r a c t e r i s t i c s of a h e t e r o s t r u c t u r e that has t h i n f i l m s on both s i d e s of the s u b s t r a t e , see Fi g u r e 4. To c a l c u l a t e the t r a n s m i s s i o n and r e f l e c t i o n v a l u e s from the s u b s t r a t e / t h i n f i l m s / a i r s i d e of the h e t e r o s t r u c t u r e ( l a b e l l e d T s. aand R s. aon Fig u r e 4) equations (26) - (29) become r s . a = • f T > scos ( 0 s ) (m^ t + mf 2 n 0 c o s ( 7) ) - m 2 , - m ^ n n c o s ( 7 ) (31) fi"sCOS ( 4>l) (m^ ! + mf 2 n o c o s ( 7 ) ) + m'2 , + m $ 2 n 0 c o s ( 7 ) t s . a = 2fT"t c o s ( ^ s ) (32) f?scos(<f>s) (m^ ! + m<f 2 n 0 c o s ( 7 ) ) + m'j,, + m / 2 2 n 0 c o s ( 7 ) Tg.„= R e ( n n c o s ( 7 ) ) l t « . n I 2 (33) Re (1 f scos(0 s) ' R s-a = | r , . a | 2 (34) with m-j r e p r e s e n t i n g the c o e f f i c i e n t s of the product matrix on the s u b s t r a t e s i d e which does not have i n c i d e n t e l e c t r o m a g n e t i c r a d i a t i o n . The above t r a n s m i s s i o n , r e f l e c t i o n and a b s o r p t i o n values equations (26) - (34) are f o r the el e c t r o m a g n e t i c waves prop a g a t i n g i n t o or out of the s u b s t r a t e ; but, i t i s d e s i r e d t h a t the t o t a l t r a n s m i s s i o n , r e f l e c t i o n and a b s o r p t i o n curves (T, R, A r e s p e c t i v e l y ) be of the e n t i r e h e t e r o s t r u c t u r e . Consequently, a c o r r e c t i o n term i s added to the equations (26) -(34) to take i n t o account a b s o r p t i o n i n the s u b s t r a t e . Because the s u b s t r a t e i s , i n g e n e r a l , much t h i c k e r than a t h i n f i l m the above theory c o u l d not be used d i r e c t l y . Thus the s i n g l e f i l m 14 F i g u r e 4 . C o n s t r u c t i o n parameters f o r the c a l c u l a t i o n of t r a n s m i s s i o n and r e f l e c t i o n c h a r a c t e r i s t i c s f o r m u l t i l a y e r t h i n f i l m s on b o t h s i d e s of t h e s u b s t r a t e . 15 theory of the previous s e c t i o n i s a p p l i e d [ 6 ] . More s p e c i f i c a l l y , Ts.a and TQ.S have a l r e a d y accounted for the r e f l e c t i o n at the s u b s t r a t e / t h i n - f i l m i n t e r f a c e (and v i s e a v e r s a ) ; thus equation (2) s i m p l i f i e s to A l s o , i n general the F r e s n e l c o e f f i c i e n t i s small and the a t t e n u a t i o n , i n the s u b s t r a t e , l a r g e thus, the major c o n t r i b u t i o n to the o v e r a l l r e f l e c t a n c e of the h e t e r o s t r u c t u r e i s from the t h i n f i l m l a y e r s on the s u b s t r a t e s i d e which has the i n c i d e n t e l e c t r o m a g n e t i c r a d i a t i o n , R0.s . A minor c o n t r i b u t i o n to R comes from r e f l e c t i o n from the s u b s t r a t e / t h i n f i l m s i n t e r f a c e R 0 . Re i s small because the wave R must ( i ) propagate through the s u b s t r a t e and t h i n f i l m s ( i . e . f i l m s which are on s u b s t r a t e s i d e which has e l e c t r o m a g n e t i c r a d i a t i o n ) which leads to l a r g e a t t e n u a t i o n and ( i i ) undergoes m u l t i l p l e r e f l e c t i o n s from the s u b s t r a t e / t h i n f i l m s i n t e r f a c e . Using the above equations (28) , (29) , (33) , (34) , (35) , and (36) the t o t a l t r a n s m i s s i o n and r e f l e c t i o n c o e f f i c i e n t s of the h e t e r o s t r u c t u r e of F i g u r e 4 are found to be T s = exp(-at s/cost9 s ) (35) Ro = R s. aT s'. aexp(-at s/cos(9 s ) (36) T - T s. aT a. s exp(-at s/cos(9 s ) (37) R = Ra- S + R s. aT $. aexp(-at s / c o s 0 s ) (38) where T a- S ,Ts.a ,Ts'.a ,Ra-s ,Rs-a are l a b e l l e d and i l l u s t r a t e d i n F i g u r e 4. 1 6 MAXIMIZING THE T COEFFICIENT If equations (18)—(29) are s o l v e d i t can be shown that f o r maximum t r a n s m i s s i o n of l i g h t at a wavelength X 0 the t h i c k n e s s t , of a s i n g l e l a y e r t h i n f i l m should be t , = X 0tan- 1 [2n,k s/(n. 1 2 - ns2 - kj ) ], (39) assuming l i g h t i s f a l l i n g normally from a i r onto the f i l m and the s u b s t r a t e has a complex index of r e f r a c t i o n -fi^ . In the case of a weakly or non absorbing s u b s t r a t e , Eq. (39) reduces to t , =_Xo_ (40) 4n, which i s the w e l l known quarter wavelength des i g n . For a two l a y e r a n t i r e f l e c t i n g (AR) c o a t i n g the optimum t h i c k n e s s e s are given by the quarter wavelength and h a l f wavelength design equations, Eqs. (40) and (41) r e s p e c t i v e l y [6,8]. With the l a y e r c l o s e s t to the s u b s t r a t e being governed by Eq. (41) and the l a y e r f u r t h e s t from the s u b s t r a t e being governed by Eq. (40). t 2 = _Xp_ (41 ) 4n 2 Hetero's use of t h i s theory w i l l be d i s c u s s e d i n chapters Four and F i v e and Appendix B. 1 7 CHAPTER THREE 3.1 FEATURES OF HETERO Aside from Hetero c a l c u l a t i n g the T/R c h a r a c t e r i s t i c s as a f u n c t i o n of wavelength of a t h i n f i l m s t r u c t u r e i t was a l s o d e s i r e d that the program be very " u s e r - f r i e n d l y " ( i . e . easy to use with a minimal amount of knowledge r e q u i r e d to use the program) and v e r s a t i l e ; these f e a t u r e s of Hetero w i l l now be d i s c u s s e d . The f i r s t and most b a s i c f e a t u r e of Hetero which makes i t user f r i e n d l y i s that the user i s prompted, by qu e s t i o n s d i s p l a y e d on the t e r m i n a l , to i n t e r a c t i v e l y enter a l l the important h e t e r o s t r u c t u r e data (e.g. t h i c k n e s s e s of the t h i n f i l m s , angle of i n c i d e n t r a d i a t i o n , e t c . ) . In each prompt l i n e the user i s , i n g e n e r a l , given a choice of p i c k i n g one v a r i a b l e out of a set of v a r i a b l e s to enter. Then the user i s shown how to enter the chosen v a r i a b l e . If the user does not enter one of the v a l u e s l i s t e d i n the prompt l i n e then the prompt l i n e w i l l be r e d i s p l a y e d g i v i n g the user another chance to enter the r i g h t response. By checking the entered data, the program prevents user entered mistakes from c r a s h i n g i t because of wrong data types. The second b a s i c f e a t u r e of Hetero i s that i t i n t e r a c t i v e l y allows the user to change any of the entered data ( i ) before running the program to make any l a s t minute changes; and ( i i ) a f t e r running the program to make minor changes i n the h e t e r o s t r u c t u r e composition. T h i s f e a t u r e saves time i f the 18 user only wants one or two v a r i a b l e s i n the h e t e r o s t r u c t u r e a l t e r e d because i n these cases the user does not have to reenter a l l the data and reexecute the program. To use the m u l t i l a y e r t h i n f i l m theory of the pre v i o u s s e c t i o n one must know the r e f r a c t i v e index as a f u n c t i o n of wavelength f o r each t h i n f i l m . Thus i t was decided that a l l the r e f r a c t i v e index data that c o u l d be obtained from the l i t e r a t u r e should be c o l l e c t e d together and s t o r e d on one d i s c , c a l l e d Data:. Then when running Hetero to c a l c u l a t e the T/R c h a r a c t e r i s t i c s , the user simply need enter the filename to o b t a i n the a p p r o p r i a t e o p t i c a l data r a t h e r than manually e n t e r i n g t h i s data f o r each l a y e r before e x e c u t i o n . The r e f r a c t i v e index data i s s t o r e d on the flopp y d i s c by chemical formula or most common trade name, which ever i s s h o r t e r . The r e f r a c t i v e index data that are c u r r e n t l y s t o r e d on Data: are f o r the m a t e r i a l s : A l , A1N, Ag, Au, B i , Ce0 2, Cu, L a 2 0 3 , Mg, mylar, p o l y e t h y l e n e , S i 0 2 , T i 0 2 , and ZnO. The data fo r these m a t e r i a l s span the v i s i b l e to i n f r a r e d regions (0.3Mm - 30Mm). The format of the data i n each f i l e on Data: i s wavelength, r e a l part of r e f r a c t i v e index (n) and imaginary part of r e f r a c t i v e index (k) with the f o l l o w i n g c o n s t r a i n t s : (1) wavelengths must be i n u n i t s of angstroms; and (2) wavelengths, i n the f i l e , must have data i n i n c r e a s i n g order wavelengths s t a r t i n g with the s m a l l e s t wavelength. Any wavelength values can be used with v a r i a b l e spacing between wavelength v a l u e s ; and up to 45 data p o i n t s may be in t h i s 19 f i l e . T h i s maximum number of data p o i n t s may be changed by changing the index values i n a r r a y s mat_type2 and mat_type3 which are d e c l a r e d i n u n i t e n t e r _ d a t a . T h i s f e a t u r e of a l l o w i n g any wavelength values i s allowed because: ( i ) hetero i n t e r p o l a t e s the data f o r each t h i n f i l m l a y e r to one set of c o n s i s t e n t wavelengths; and ( i i ) the wavelength range f o r which the T/R curves are c a l c u l a t e d i s v a r i a b l e . The range i s v a r i a b l e because the range i s based on the user entered range and the range of wavelengths i n each f i l e ; with the sm a l l e s t range of wavelengths being used. O p t i c a l data may be entered on to the fl o p p y by e i t h e r using the e d i t o r and f i l e h a ndling commands of the UCSD p-system commands or by running program Hetero and l e t t i n g Hetero s t o r e the data. T h i s f e a t u r e i s now d i s c u s s e d . Another f e a t u r e of hetero i s to allow the user to enter the r e f r a c t i v e index data f o r any of the l a y e r s . In general t h i s f e t a u r e i s used i f the h e t e r o s t r u c t u r e of i n t e r e s t i s made up of m a t e r i a l s f o r which d i s c Data: does not c u r r e n t l y have the r e f r a c t i v e index data; then the program prompts the user o b t a i n the data f o r these l a y e r s so that execution can c o n t i n u e . For the h e t e r o s t r u c t u r e s where the o p t i c a l data f o r two or more of l a y e r s i s the same the user need only enter the data once simply by naming these l a y e r s with the same chemical formula. A f t e r a l l of the data i s entered the user can scan through the r e f r a c t i v e index data and make any changes. F i n a l l y , i f the operator wants these data values f o r f u t u r e use Hetero w i l l s t o r e i t on d i s c data: by the chemical formula the user 20 entered. For more in f o r m a t i o n about t h i s f e a t u r e see u n i t enter_data i n Appendix B. Other f e a t u r e s of Hetero i n c l u d e the a b i l i t y to c a l c u l a t e the T/R c h r a c t e r i s t i c s as a f u n c t i o n of wavelength of: (1) most t h i n f i l m m a t e r i a l s ; (2) up to 10 t h i n f i l m l a y e r s on both s i d e s of the s u b s t r a t e ; (3) f o r any i n c i d e n t angle of e l e c t r o m a g n e t i c r a d i a t i o n ( i . e . between 0 +/- 90 degrees with the normal to the plane of i n c i d e n c e ) ; (4) f o r p o l a r i z a t i o n s of r a d i a t i o n p a r a l l e l and p e r p e n d i c u l a r to the plane of i n c i d e n c e ; and (5) up to 45 T/R curve data p o i n t s . C u r r e n t l y Hetero can handle up to ten t h i n f i l m l a y e r s and 45 T/R data p o i n t s . These l i m i t s were set because the o p e r a t i n g system used only had 64K of random access memory (RAM) and Hetero was to l a r g e even with memory o v e r l a y s ( d i s c u s s e d i n the next s e c t i o n ) to be f i t on the memory space a v a i l a b l e . Consequently t h i s program i s c u r r e n t l y being t r a n s f e r r e d to the SAGE and IBM Columbia microcomputer sytems which have over twice t h i s much memory space. With these systems the number of t h i n f i l m l a y e r s and T/R data p o i n t s can be i n c r e a s e d . The number of T/R data p o i n t s can be i n c r e a s e d by changing a r r a y s mat_type2 and mat_type3 d e c l a r e d i n u n i t e n t e r _ d a t a . S i m i l a r l y , the expansion of the number of t h i n f i l m l a y e r s i s done by i n c r e a s i n g the index i n a r r a y s mat_type1, mat_type3, and mat_type5. 21 The f i n a l f e a t u r e of Hetero i s that i t can c a l c u l a t e the T/R curves as a f u n c t i o n of wavelength for ( i ) one t h i c k n e s s of each t h i n f i l m l a y e r ; or ( i i ) a range of t h i c k n e s s e s f o r each t h i n f i l m l a y e r . If the operator would l i k e to o b t a i n a c e r t a i n percentage of t r a n s m i s s i o n of l i g h t (or r e f l e c t i o n of i n f r a r e d r a d i a t i o n ) f o r the m u l t i l a y e r s t r u c t u r e of i n t e r e s t then he enters a range of t h i c k n e s s e s . Hetero then i t e r a t i v e l y t r i e s to obta i n t h i s value (= max_value) by s y s t e m a t i c a l l y v a r y i n g each t h i c k n e s s of each t h i n f i l m a user s p e c i f i e d number of times. A f t e r each new t h i c k n e s s the T or R curve i s c a l c u l a t e d and i n t e g r a t e d between ( i ) lower wavelength range l i m i t and 1 jum f o r T; or ( i i ) 1 Mm and the upper wavelength range l i m i t f o r R. 1 Mm was used as a bound i n the i n t e g r a t i o n because i t d i v i d e s the v i s i b l e and i n f r a r e d r e g i o n s . The c l o s e s t area to max_value and a l s o the maximum and minimum area T/R curves are p l o t t e d ; along with the a p p r o p r i a t e l a y e r t h i c k n e s s e s . C u r r e n t l y only 10 v a r i a b l e l a y e r s can be used as was p r e v i o u s l y d i s c u s s e d . To inc r e a s e t h i s value one must change a r r a y s : mat_type1,mat_type3 and mat_type5 i n u n i t e n t e r _ d a t a . The programmmer must a l s o change the r e p e a t - u n t i l loops i n procedure c a l c _ a n d _ s t o r e _ d a t a a p p r o p r i a t e l y ; see t h i s procedure f o r more i n f o r m a t i o n . 3.2 EXECUTING HETERO To run program Hetero the user needs: (1) the d i s c s c a l l e d (a) H e t e r o s t : , which c o n t a i n s the e n t i r e compiled program and (b) Data:, which c o n t a i n s a l l the index data as a f u n c t i o n of wavelength. 22 (2) the r e f r a c t i v e index data f o r l a y e r s which do not have o p t i c a l data on d i s c Data:. (3) a b a s i c p i c t u r e of the h e t e r o s t r u c t u r e which c o n t a i n s the t h i c k n e s s e s of each l a y e r , the composition of each l a y e r , angle of i n c i d e n c e of r a d i a t i o n . With t h i s p i c t u r e the user can then j u s t read o f f the values as the program requests i t . The operator then boots up d i s c Hetero and X)ecutes f i l e Hetero. Hetero w i l l f i r s t prompt the user to put the d i s c Data: i n t o d i s c d r i v e B and then i t w i l l prompt the user to enter a l l the p e r t i n e n t h e t e r o s t r u c t u r e data. Upon completion of execution, Hetero w i l l d i s p l a y a T/R curve p l o t . The user can then manipulate t h i s p l o t before g e t t i n g a hard copy or a l t e r some of the h e t e r o s t r u c t u r e data and rerun Hetero. These computer gr a p h i c s c a p a b i l i t i e s w i l l not be a v a i l a b l e on a l l v e r s i o n s of Hetero as w i l l be d i s c u s s e d i n the next s e c t i o n . 23 CHAPTER FOUR 4.1 HETERO COMPILATION UNITS Hetero i s w r i t t e n i n Pascal and runs on the UCSD p-system v e r s i o n IV.0 o p e r a t i n g system. Because of the s i z e of Hetero, two p-system extensions to standard P a s c a l were used; they are ( i ) segments and ( i i ) s e p a r a t e l y compiled subprogram u n i t s . Segments are used i n mini and microcomputer o p e r a t i n g systems to allow the execution of programs which are too l a r g e to f i t e n t i r e l y i n random access memory (RAM). Since only the s e c t i o n of program code which i s a c t u a l l y running need be i n RAM, i t i s advantageous i n systems with severe memory l i m i t a t i o n s to f i r s t l o a d only the segments of the program which are to be run immediately i n t o RAM; then when one segment i s f i n i s h e d and a new segment i s needed the new segment i s simply w r i t t e n over the used segment. T h i s process continues u n t i l execution of the program i s completed. More s p e c i f i c a l l y , a segment i s the miminum amount of program code which can be read i n t o RAM or o v e r w r i t t e n i n RAM. While segments can v a s t l y i n c r e a s e the s i z e of programs that the o p e r a t i n g system can handle, a programmer must not make too l i b e r a l a use of segments because the e x e c u t i o n time of the program can become unreasonably slow. F u n c t i o n s , procedures and processes may be e x p l i c i t l y d e c l a r e d as code segments. A UCSD subprogram module i s c a l l e d a c o m p i l a t i o n u n i t . A u n i t i s a group of s e p a r a t e l y compiled types, constants, v a r i a b l e s , f u n c t i o n s procedures and processes which can be 2 4 l i n k e d i n t o a program f o r use at run time [ 5 ] . U n i t s provide a means of packaging programs i n a modular f a s h i o n , so that a p p l i c a t i o n l i b r a r i e s can be b u i l t . I d e a l uses f o r u n i t s are the grouping together of s e c t i o n s of program which form s e l f c o n s i s t e n t packages such as d e f i n i n g a l l complex number ope r a t i o n s or h y p e r b o l i c t r i g o n o m e t r i c f u n c t i o n s ; these u n i t s can then be used by any other programs. A c o m p i l a t i o n u n i t ' c o n s i s t s of an i n t e r f a c e p a r t , an implementation part and an o p t i o n a l i n i t i a l i z a t i o n / t e r m i n a t i o n code. The l a t e r part was not used and hence s h a l l not be mentioned; f o r more info r m a t i o n see r e f e r e n c e 9. The i n t e r f a c e part of a u n i t c o n t a i n s d e c l a r a t i o n s ( i . e . constant, type,and v a r i a b l e ) and procedure and f u n c t i o n headings. These may be used by the program or other u n i t s that use the u n i t [ 9 ] , The implementation part c o n t a i n s other d e c l a r a t i o n s and the code f o r the procedures and f u n c t i o n s that were d e c l a r e d i n the i n t e r f a c e p a r t . Procedures and f u n c t i o n s can a l s o be d e c l a r e d i n the implementation p a r t . These r o u t i n e s are g e n e r a l l y used to help i n the r e a l i z a t i o n of the r o u t i n e s d e c l a r e d i n the i n t e r f a c e p a r t ; however, only d e c l a r a t i o n s made in the i n t e r f a c e part are a v a i l a b l e to the c a l l i n g u n i t or program. The program Hetero was "broken up" i n t o u n i t s with each u n i t performing one s p e c i f i c f u n c t i o n i n the task of c a l c u l a t i n g the T/R c h a r a c t e r i s t i c s of a m u l t i l a y e r t h i n f i l m s t r u c t u r e . These c o m p i l a t i o n u n i t s (shown i n F i g u r e 1) are now d i s c u s s e d , beginning with the u n i t s at the bottom of F i g u r e 1. 25 The u n i t s i n the f i g u r e are are grouped p r i m a r i l y i n the order of e x e c u t i o n ; where the bottom c o m p i l a t i o n u n i t s are executed f i r s t . The f i r s t u n i t executed i s I n i t i a l i z e . The purpose of t h i s u n i t i s to o b t a i n a l l of the p e r t i n e n t h e t e r o s t r u c t u r e data f o r the c a l c u l a t i o n of the T/R (Eqs. (37) and (38)) c h a r a c t e r i s t i c s of a user d e f i n e d h e t e r o s t r u c t u r e . The important data needed i s : (1) t o t a l number of t h i n f i l m l a y e r s on s u b s t r a t e ; (2) The number of t h i n f i l m l a y e r s on both s i d e s of the s u b s t r a t e . (3) The i n c i d e n t angle of elec t r o m a g n e t i c r a d i a t i o n ; (4) The angle of p o l a r i z a t i o n of the i n c i d e n t r a d i a t i o n . (5) The r e f r a c t i v e index of each l a y e r as a f u n c t i o n of wavelength. As mentioned i n chapter three most of t h i s data i s a l r e a d y s t o r e d on a floppy d i s c named DATA: and to o b t a i n i t the user need simply s p e c i f y the chemical formula. However i f the r e f r a c t i v e index data f o r some of the t h i n f i l m l a y e r s i s not c u r r e n t l y a v a i l a b l e the user has the op t i o n to enter h i s own data (see u n i t E n t e r _ D a t a ) . (6) The t h i c k n e s s of each l a y e r or range of t h i c k n e s s e s . As mentioned i n chapter three i f the user e n t e r s only only one t h i c k n e s s f o r each l a y e r of the s t r u c t u r e then only one T/R curve w i l l be c a l c u l a t e d . If however the user e n t e r s a range of t h i c k n e s s e s f o r each t h i n f i l m , then the program w i l l t r y a s p e c i f i e d number of t h i c k n e s s e s 26 f o r each l a y e r and f o r each new t h i c k n e s s a new T/R curve w i l l be c a l c u l a t e d . The curves with maximum area, minimum area, and the user s p e c i f i e d value ( i . e . max_value) w i l l then be saved and d i s p l a y e d ; along with the corresponding t h i n f i l m t h i c k n e s s e s . T h i s u n i t a l s o allows the user to a l t e r any of t h i s p e r t i n e n t h e t e r o s t r u c t u r e data before c a l c u l a t i o n of the T/R curves; t h i s g i v e s the user the chance to make l a s t minute a l t e r a t i o n s . The second u n i t executed i s e n t e r _ d a t a . The purpose of t h i s u n i t i s to enter the o p t i c a l data f o r the l a y e r s of the h e t e r o s t r u c t u r e which do not have r e f r a c t i v e index data c u r r e n t l y present on fl o p p y d i s c Data:. For the other l a y e r s which have o p t i c a l data on the f l o p p y the user need only enter the filename. The o p t i c a l data, 'for each l a y e r with no data on Data:, can be entered with any wavelength, n and k v a l u e s as long as they are i n i n c r e a s i n g order of wavelengths. A f t e r e n t e r i n g the o p t i c a l data, t h i s u n i t allows the operator to then scan the r e f r a c t i v e index data and make the any a p p r o p r i a t e changes. F i n a l l y , the user i s given the chance to s t o r e any of t h i s o p t i c a l data f o r f u t u r e use on Data: by i t s chemical formula simply by e n t e r i n g i t s l a y e r p o s i t i o n i n the h e t e r o s t r u c t u r e . The t h i r d u n i t executed i s Set_up_data. The purpose of t h i s u n i t i s to f i r s t generate a set of wavelengths from the number of T/R data p o i n t s and the range of wavelengths f o r which the T/R curves are to be p l o t t e d . Then using t h i s set of wavelengths i n t e r p o l a t e the o p t i c a l data f o r each l a y e r to t h i s 27 set of wavelengths so that the T/R curves can be c a l c u l a t e d . The f o u r t h u n i t used i s c a l c _ v a l u e . The purpose of t h i s u n i t i s to take the o p t i c a l data f o r a l l the l a y e r s and f i r s t f i n d the c h a r a c t e r i s t i c m a t r ices (Eq. (25)) f o r each l a y e r ; then f i n d the product matrix f o r each si d e of the s u b s t r a t e (Eq. (24)) and f i n a l l y c a l c u l a t e the t r a n s m i s s i o n and r e f l e c t i o n c o e f f i c i e n t s (Eqs. (37) and (38)) of the h e t e r o s t r u c t u r e f o r the number of data p o i n t s s p e c i f i e d . Some of the procedures i n Hetero are then executed. The primary purpose of t h i s u n i t i s to c a l l a l l the other u n i t s . I t ' s secondary purpose i s to take the generated t r a n s m i s s i o n and r e f l e c t i o n data, from unit c a l c _ v a l u e and e i t h e r (1) s t o r e i t f o r a p l o t r o u t i n e ; t h i s case occurs when the user wants the T/R curves c a l c u l a t e d f o r only one t h i c k n e s s of each t h i n f i l m ; or (2) f i n d s the optimum T/R c u r v e s . The optimum T/R curves are the ones with maximum area, minimum area and max_value. These optimum curves are found by i n t e r g r a t i n g the the T or R data as was e x p l a i n e d i n chapter three. Computer g r a p h i c s programming languages and packages are not yet s t a n d a r d i z e d such that one graphics language can be used (by r e c o m p i l a t i o n of the program) on any system. Since i t was d e s i r e d to have Hetero i n a form where i t c o u l d be u n i v e r s a l l y used on any microcomputer that supported UCSD p a s c a l , Hetero i n general w i l l simply d i s p l a y the T/R c h a r a c t e r i s t i c s as t a b l e s on the s c r e e n . But f o r my r e s e a r c h i t was e a s i e r to see a v i s u a l p i c t u r e of the r e s u l t s , consequently a u n i t P l o t r e s u l t was added to Hetero. I t i s mentioned here 28 f o r completeness sake. The purpose of t h i s u n i t i s to d i s p l a y a p l o t of the T/R or a b s o r p t i o n curves of the operator d e f i n e d h e t e r o s t r u c t u r e . In a d d i t i o n t h i s u n i t a l s o performs elementary computer gr a p h i c s which allows the user to zoom in on any part of the p l o t , s c a l e the p l o t e t c . . As i s shown in F i g u r e 1, to expand Hetero the programmer must f i r s t add the a p p r o p r i a t e prompt l i n e s to u n i t i n i t i a l i z e so that the user can enter any needed data f o r t h i s f u t u r e u n i t . Then the programmer must add the new u n i t and a procedure c a l l statement in the main program ( i n u n i t H e t e r o ) . F i n a l l y he must add a l i n e of text i n a f i l e c a l l e d U s e r l i b . t e x t ( s t o r e d on d i s c Heterost:) of the form Future.Code; t h i s l i n e i s needed for the "Uses" statement at the beginning of each u n i t , see r e f e r e n c e 9. 29 CHAPTER FIVE 5. 1 BACKGROUND Poly e t h y l e n e i s c u r r e n t l y used as g l a z i n g m a t e r i a l for approximately h a l f of the commercial greenhouses in North America because of i t s a v a i l a b i l i t y and low c o s t . Standard c o n s t r u c t i o n comprises two or three p o l y e t h y l e n e l a y e r s , with each l a y e r e i t h e r 100 or 150/xm t h i c k . A i r i s u s u a l l y f o r c e d between the l a y e r s to keep them apart. A t y p i c a l q u a l i t y greenhouse p o l y e t h y l e n e sheet has a tra n s m i t t a n c e of 88% and a r e f l e c t a n c e of approximately 12% f o r s o l a r energy. Poly e t h y l e n e i s e s s e n t i a l l y opaque to middle i n f r a r e d radiation(8-15ym) and has a high emmissivity of about 0.88 f o r room temperature thermal r a d i a t i o n . The s o l a r transmittance of p o l y e t h y l e n e can be improved by a p p l y i n g a n t i r e f l e c t i o n (AR) c o a t i n g s . The emmissivity f o r room temperature i n f r a r e d r a d i a t i o n may be decreased by a p p l y i n g a heat - m i r r o r c o a t i n g which s t r o n g l y r e f l e c t s t h i s middle i n f r a r e d r a d i a t i o n . The primary purpose of our r e s e a r c h was to design an AR/heat-mirror c o a t i n g which f o l l o w s the p l a n t s e n s i t i v i t y curve and o p t i m i z e s both s o l a r t r a n s m i s s i o n and r e f l e c t a n c e of room temperature thermal r a d i a t i o n . To achieve these r e s u l t s we have c o n s i d e r e d a two l a y e r c o a t i n g c o n s i s t i n g of a ZnO heat-mirror [10] capped with a S i 0 2 a n t i r e f l e c t i o n l a y e r . Our r e s u l t s , however, are a p p l i c a b l e to other oxide-type h e a t - m i r r o r s and other low r e f r a c t i v e index m a t e r i a l s . In t h i s chapter we d e s c r i b e our c a l c u l a t i o n of the 30 r e f l e c t a n c e (R) and t r a n s m i t t a n c e (T) of the two l a y e r c o a t i n g on a p o l y e t h y l e n e f i l m . We r e l a t e t h i s r e s u l t to greenhouse a p p l i c a t i o n s . Our design c r i t e r i a are d i s c u s s e d f i r s t , f ollowed by our method of o b t a i n i n g the o p t i c a l c onstants f o r S i 0 2 , ZnO and p o l y e t h y l e n e . The r e s u l t s of our c a l c u l a t i o n s give a f i n a l c h o i c e of l a y e r t h i c k n e s s e s f o r optimal performance. The c o s t -e f f e c t i v e n e s s of the h e t e r o s t r u c t u r e f o r greenhouse a p p l i c a t i o n s i s d i s c u s s e d . 5.2 DESIGN CRITERIA FOR THE MULTILAYER STRUCTURE We are i n t e r e s t e d i n an o p t i c a l c o a t i n g which s a t i s f i e s the f o l l o w i n g c r i t e r i a : C.1 A t r a n s m i s s i o n curve c l o s e to that of the p l a n t s e n s i t i v i t y curve; given i n F i g u r e 5, '[11]. C.2 Minimum r a d i a t i v e heat l o s s ; C.3 Improved s o l a r gain above that of a standard two or three l a y e r p o l y e t h y l e n e sheet greenhouse; and C.4 A c o s t - e f f e c t i v e product. To a f i r s t approximation, the f i r s t design c r i t e r i o n , C . 1 , i s s a t i s f i e d by maximizing the t r a n s m i s s i o n of l i g h t >at X 0 = 0.566Atm; i . e . the geometric c e n t r e of the p l a n t s e n s i t i v i t y curve (see F i g u r e 5). S i m i l a r l y , design c r i t e r i o n C.2, can be s a t i s f i e d by maximizing the r e f l e c t i o n of i n f r a r e d r a d i a t i o n at 10/zm (the maximum f o r room temperature blackbody r a d i a t i o n ) . More accurate, f i g u r e s of merit which enable b e t t e r comparison of performance c h a r a c t e r i s t i c s of v a r i o u s o p t i c a l c o a t i n g s are: % p l a n t = X T ( X ) S ( X ) I ( X ) d X x l 0 0 % J O Q 5S(X)I (X)dX (42) % s o l a r = J c T(X)I (X)dXxl00% r I ( X ) d X (43) 31 F i g . 5. 1,2 and 3 are (%) Transmission through one,two and three l a y e r s of uncoated p o l y e t h y l e n e , r e s p e c t i v e l y . The coated double l a y e r i s the t r a n s m i s s i o n through our h e t e r o s t r u c t u r e ( F i g . 3) w i t h t ( S i 0 2 ) • 0.0969*un, t(ZnO) • 0.5(tm and t ( p o l y e t h y l e n e ) • I50»tin. Normalized t o 100% i s the p l a n t s e n s i t i v i t y . 32 U-value = t h e r m a l conductance of h e t e r o s t r u c t u r e . where X = wavelength; T(X) = the t r a n s m i t t a n c e through the complete g l a z i n g u n i t ; S(X) = the n o r m a l i z e d v a l u e s of p l a n t s e n s i t i v i t y ; and I ( X ) = the i n t e n s i t y of the s o l a r spectrum. The c o s t - e f f e c t i v e n e s s of the c o a t i n g i s e s t i m a t e d u s i n g the f o l l o w i n g i n f o r m a t i o n g a t h e r e d from commerical greenhouse growers i n Canada. A t y p i c a l greenhouse c r o p y i e l d i s about $56.00/m 2 (Canadian funds) of p l a s t i c c o a t i n g , w i t h a 1% i n c r e a s e i n % p l a n t g i v i n g about a 1% i n c r e a s e i n c r o p y i e l d [ 1 2 ] . T y p i c a l h e a t i n g c o s t s a re about $8.60/m 2 of p l a s t i c c o v e r i n g , w i t h a p p r o x i m a t e l y h a l f the c o s t a t t r i b u t e d t o temp e r a t u r e c o n t r o l and the o t h e r h a l f t o h u m i d i t y c o n t r o l [ 1 2 ] . A 1% i n c r e a s e i n the U-value i s ex p e c t e d t o d e c r e a s e the tem p e r a t u r e c o s t s by 1% whereas the h u m i d i t y c o s t s a r e ex p e c t e d t o be unchanged. F i n a l l y , the % s o l a r s h o u l d be as l a r g e as p o s s i b l e t o maximize p a s s i v e s o l a r h e a t i n g . 5.3 CHOICE OF MATERIALS P o l y e t h y l e n e s u b s t r a t e was chosen f o r the purpose of t h i s s t u d y over o t h e r p l a s t i c s because: (1) I t i s w i d e l y used i n the i n d u s t r y ; (2) Greenhouse q u a l i t y p o l y e t h y l e n e has n e g l i g i b l e a b s o r p t i v i t y f o r v i s i b l e l i g h t ; (3) P o l y e t h y l e n e i s a v a i l i b l e i n a l a r g e v a r i e t y of s i z e s , i n p a r t i c u l a r , l a r g e , wide r o l l s a p p r o p r i a t e f o r greenhouses; (4) I t i s i n e x p e n s i v e ; and (5) I t has good m e c h a n i c a l p r o p e r t i e s and does not r i p as e a s i l y as many p l a s t i c s . In the p r e s e n t s t u d y , we choose our m a t e r i a l s p r i m a r i l y t o 33 s a t i s f y the f i r s t two design c r i t e r i a , C . 1 and C.2. To achieve maximum p o s s i b l e t r a n s m i s s i o n around the p l a n t s e n s i t i v i t y peak we r e q u i r e an a n t i r e f l e c t i o n (AR) c o a t i n g . U n f o r t u n a t e l y , a l l m a t e r i a l s that can be used as s i n g l e l a y e r " h e a t - m i r r o r s " [13] cannot a l s o be used as an AR c o a t i n g on p o l y e t h y l e n e due to an i n s u f f i c i e n t l y low r e f r a c t i v e index. Consequently we are lead to adding an AR c o a t i n g onto the heat-mirror l a y e r . S i 0 2 and ZnO were chosen f o r the AR and h e a t - m i r r o r c o a t i n g , r e s p e c t i v e l y , because they have the necessary r e f r a c t i v e i n d i c e s f o r a two l a y e r AR s t r u c t u r e [ 6 ] . A l s o , S i 0 2 i s very s t a b l e and p r o v i d e s an e x c e l l e n t p r o t e c t i v e l a y e r , and ZnO can be f a b r i c a t e d as a good h e a t - m i r r o r onto a p l a s t i c s u b s t r a t e [10]. 5.4 DESIGN OF HEAT MIRROR HETEROSTRUCTURE In order to c a l c u l a t e the t r a n s m i s s i o n - r e f l e c t i o n c h a r a c t e r i s t i c s of a m u l t i l a y e r c o a t i n g [6,8],(Eqs. (37) and (38)) one must know the r e f r a c t i v e index of each l a y e r . Measurements of the r e f r a c t i v e index of S i 0 2 are found i n the l i t e r a t u r e [14-21]. F i g u r e 6 shows these experimental values of the r e a l and imaginary p a r t s of r e f r a c t i v e index ,n and k r e s p e c t i v e l y , as a f u n c t i o n of wavelength. In the case of ZnO and p o l y e t h y l e n e we c o u l d not f i n d complete experimental r e f r a c t i v e index data i n the l i t e r a t u r e f o r the range of i n t e r e s t , 0.3 to 40jim wavelength. Consequently, t h e o r e t i c a l a n a l y s i s of our own s p e c t r a l data was used to f i l l i n these gaps. The d e r i v a t i o n of the complex i n d i c e s f o r ZnO and 34 35 p o l y e t h y l e n e are o u t l i n e d i n the Appendix A. Our i n i t i a l c h o i c e s of t h i c k n e s s e s f o r the Si0 2/ZnO c o a t i n g were the qu a r t e r wavelength ( t , = X 0/4n, = 0.0969mn) and h a l f wavelength ( t 2 = X 0/2n 2 = 0. 1419 jum) l a y e r t h i c k n e s s e s for a two l a y e r AR c o a t i n g [6] (Eqs. (40) and (41)); where X 0 = 0.566MIII, and n, and n 2 are the r e f r a c t i v e i n d i c e s f o r S i 0 2 and ZnO, r e s p e c t i v e l y . With % p l a n t near maximum, we then s y s t e m a t i c a l l y v a r i e d the t h i c k n e s s of S i 0 2 and ZnO i n order to maximize the r e f l e c t a n c e of i n f r a r e d r a d i a t i o n . V a r y i n g the t h i c k n e s s of S i 0 2 d i d not change the i n f r a r e d (IR) r e f l e c t a n c e . Consequently, We s y s t e m a t i c a l l y v a r i e d the t h i c k n e s s of ZnO while keeping the t h i c k n e s s of S i 0 2 constant i n order to maximize the r e f l e c t a n c e of i n f r a r e d r a d i a t i o n while m a i n t a i n i n g % p l a n t near i t s maximum. We found that the i n f r a r e d r e f l e c t a n c e curve " s a t u r a t e d " with a r e f l e c t a n c e of 74% at lO^m fo r t h i c k n e s s e s of ZnO greater than or equal to 0.5ym, see F i g u r e 7. I n c r e a s i n g the ZnO t h i c k n e s s from a half-wavelength t h i c k n e s s of 0.14l9Mm to 0.5mn decreased % p l a n t by l e s s than 2%. In summary, with t h i s o p t i c a l l y "untuned" s t r u c t u r e , t ( S i 0 2 ) =0.0969MHI and t(ZnO) = 0.5Mm, we came very c l o s e to sim u l t a n e o u s l y maximizing the % p l a n t and i n f r a r e d r e f l e c t i v i t y . 5.5 PERFORMANCE OF THE GLAZING HETEROSTRUCTURE A standard p o l y e t h y l e n e g l a z e d greenhouse i s comprised of two or three p o l y e t h y l e n e l a y e r s . AR/heat-mirror c o a t i n g s can be a p p l i e d on any of these f i l m s u r f a c e s . However, as i n d i c a t e d in F i g u r e 8 the p r e f e r r e d f i l m s u r f a c e i s one i n the a i r gap 36 O O O O co « * a ( y . ) r j o i s s i i A i S M V b i j -F i g u r e 7. 1, 2, 3, 4 a r e the r e f l e c t a n c e c u r v e s o f f of ZnO/ p o i y e t h y l e n e w i t h the t h i c k n e s s of ZnO b e i n g O.Sum, 0.3utn, 0.1 jzm, and 0.05Mm r e s p e c t i v e l y . The t h i c k n e s s of p o l y e t h y l e n e i s 150jxm. 37 DOlyothylan* air gap 2 cm —• SIO. ZnO potyathylana Inside F i g . 8. Cross s e c t i o n of our AR/heat-mirror f i l m f o r greenhouses. Not t o s c a l e . 38 where the c o a t i n g i s p r o t e c t e d a g a i n s t mechanical damage, condensation and other contaminants in the surroundings. F i g u r e 5 compares the c a l c u l a t e d t r a n s m i s s i o n of one, two, and three l a y e r s of uncoated p o l y e t h y l e n e ( l a b e l e d 1,2,3 r e s p e c t i v e l y on the diagram) with the g l a z i n g s t r u c t u r e shown in F i g u r e 8. From these curves we c a l c u l a t e d % p l a n t and % s o l a r . We assumed normal i n c i d e n c e ; however, f u r t h e r c a l c u l a t i o n s showed that the t r a n s m i s s i o n p r o p e r t i e s do not change g r e a t l y with angle of i n c i d e n c e , p r o v i d e d the angles are l e s s than 45°. F i g u r e s 9 and 10 i l l u s t r a t e the v a r i a t i o n of the t r a n s m i s s i o n of l i g h t through S i 0 2 / Z n O / p o l y e t h y l e n e with angle of i n c i d e n c e f o r p a r a l l e l (P) and p e r p e n d i c u l a r (S) p o l a r i z a t i o n s r e s p e c t i v e l y . Using our r e s u l t s of e m i s s i v i t y we c a l c u l a t e d .the U-value with standard heat t r a n s f e r formalism [22] and the f o l l o w i n g assumpt io n s : (1) P o l y e t h y l e n e i s a p e r f e c t absorber in the range 7-12Mm, where the room temperature blackbody spectrum i s a maximum; (2) The l a y e r s of p o l y e t h y l e n e are separated, by a uniform a i r gap of 2 cm; and (3) The a i r between the l a y e r s i s s t i l l . (4) The o u t s i d e temperature i s 0°C and the i n s i d e i s 20°C. A summary of our c a l c u l a t e d % p l a n t , % s o l a r and the U-values are given i n Table 1. In a d d i t i o n , the c o s t -e f f e c t i v e n e s s i s compared i n Table 2. I t i s evident that a c h i e v i n g maximum p o s s i b l e l i g h t t r a n s m i s s i o n f o r p l a n t growth i s the most important f a c t o r ( w i t h i n the assumptions of t h i s paper) in determining the c o s t e f f e c t i v e n e s s of the g l a z i n g h e t e r o s t r u c t u r e . F i n a l l y , i t should be noted that AR/heat-m i r r o r c o a t i n g s should a l s o be u s e f u l on g l a s s covered 39 j | | L O © © O • <0 « M © N O I S S I l A l S N V t l l F i g u r e 9. " A n g u l a r dependence o f t r a n s m i t t a n c e through S i 0 2 / Z n O / p o l y e t h y l e n e f o r an incoming wave p o l a r i z e d p a r a l l e l (P) t o t h e p l a n e of i n c i d e n c e . 0, 30, 45, 60 a r e the a n g l e s of i n c i d e n c e i n degrees o f t h e incoming wave. 40 (%) M O I S SIIAIS1M V tJ ± Figure 10. Angular dependence of transmittance through Si02/ZnO/polyethylene structure for an incoming wave polarized perpendicular (S) to the plane of incidence. 0, 30, 45, 60 are the angles of incidence in degrees of the incoming wave. 41 Table I. Optical Constants SAMPLE %PLANT %SOLAR U-VALUE HEAT (W/m2K) LOSS (W/m2) Two layers of uncoated polyethylene separated 59 71 0. 337 59. 4 by a 2.0cm air gap. Three layers of uncoated polyethylene separated 47 60.3 0. 486 41. 1 by a 2.0cm air gap. Our heterostructure.* 70.5 78 0. 438 40. 0 * polyethylene/air gap/Si02/ZnO/polyethylene Table I. Comparison of heterostructure and polyethylene using design c r i t e r i a C.I - C.3. 42 Table II. Cost Effectiveness SAMPLE INCREASE IN DECREASE IN CROP YIELD HEATING (1/m2) COSTS(1/m2) Heterostructure versus two layers of uncoated $9.10 $1.00 polyethylene. Heterostructure versus three layers of uncoated $18.60 -$0.5 polyethylene. Table II. Cost effectiveness of our film coating versus uncoated polyethylene. 43 greenhouses f o r i n c r e a s i n g crop y i e l d s . There are a wide v a r i e t y of wide bandgap semiconductors that have been used as h e a t - m i r r o r s , of which ZnO i s a r e p r e s e n t a t i v e m a t e r i a l . Other h e a t - m i r r o r s , such as I n 2 0 3 : S n , Sn0 2, Cd2SnO<,, and I n 2 0 3 :Sb appear to be e q u a l l y s u i t a b l e f o r greenhouse a p p l i c a t i o n s . We b e l i e v e that the performance and manufacturing c o s t of these m a t e r i a l s are comparable to ZnO. S i m i l a r l y , there are other types of m a t e r i a l s and c o n s t r u c t i o n s f o r AR c o a t i n g s that c o u l d be s u b s t i t u t e d for S i 0 2 . 44 CONCLUSION The convenience of using Hetero to c a l c u l a t e the t r a n s m i s s i o n , r e f l e c t i o n and a b s o r p t i o n c h a r a c t e r i s t i c s of m u l t i l a y e r t h i n f i l m s on one or both s i d e s of a su b s t r a t e has been d i s c u s s e d . The program has already, been used by some of the UBC Ph y s i c s s p u t t e r i n g group to a i d in t h e i r r e s e a r c h . To t e s t Hetero, a ZnO heat m i r r o r f i l m capped with a S i 0 2 c o a t i n g was s t u d i e d f o r greenhouse a p p l i c a t i o n s . The r e s u l t s of c a l c u l a t i o n s given here f o r a p o l y e t h y l e n e / a i r gap/Si0 2/ZnO/polyethylene g l a z i n g u n i t are encouraging. From Table 2 a "heat-mirror" c o a t i n g combined with an AR c o a t i n g appears to have a payback i n one year. The major b e n e f i t of the c o a t i n g i s i n in c r e a s e d crop y i e l d . Heat c o n s e r v a t i o n appears to be a minor b e n e f i t . 45 REFERENCES 1. A. Vasicek, O p t i c s of Thin F i l m s , (North-Holland P u b l i s h i n g Co., Amsterdam, 1960). 2. Zdenek K n i t t l , O p t i c s of Thin F i l m s , (John Wiley and Sons, New York, 1976), p. 183. 3. C a r l M. Lampert, S o l a r Energy M a t e r i a l s . 6j_ 2 ( 1 981 ) . 4. J . A. Dobrowolski, Coatings and F i l t e r s , (Mcgraw-Hi11, New York, 1978), chap. 8. 5. R. McMahon, Microsput: A Microcomputer Operating System  fo r Planar Magnetron S p u t t e r i n g , ( t h e s i s r e p o r t , U.B.C.), 1 982 6. A. Nussbaum and R. A. P h i l l i p s , Contemporary O p t i c s f o r  S c i e n t i s t s and Engineeers, ( P r e n t i c e - H a l l , New J e r s e y , 1976), p. 192. 7. M. Born, P r i n c i p l e s of O p t i c s , (Pergamon Press, New York, 1970), p. 324. 8. N. D. Arara and J . R. Hauser, J . Appl. Phy. 53, 8839(1982). 9. R. Cl a r k and S. Koehler, The UCSD Pascal Handbook, ( P r e n t i c e - H a l l , New Jersey^ 1982). 10. M.J. B r e t t , R.W. McMahon, J . A f f i n i t o , and R.R. Parsons, J.Vac. S c i . Technol. Aj_, 352(1983). 11. P h i l i p s L i g h t i n g a r t i c a l , A r t i f i c a l L i g h t i n H o r t i c u l t u r e , P h i l i p s , New Jersey,p.7. 12. P r i v a t e communication with Alec Mackenzie, P r e s i d e n t of Dome Greenhouses; Surrey B.C., Canada. 13. John C.C. Fan, and Frank J . Bachner, App. Opt. 15, 1012(1976). 14. Herbert R. P h i l i p p , J . Appl. Phys. 50, 1053(1979). 15. D.G. Drummond, Proc. Roy. Soc. Al53, 328(1935). 16. R.E. Nyswander, Phys. Rev. 28, 291(1909). 17. M. M i l e r , Czech. J . Phys. BJ_8, 355(1968). 18. I.H. M a l i t s o n , J . Opt. Soc. Am. 55, 1205(1965). 19. F.F. M a r t i n s , Ann. Phys. 603( 1901). 46 20. J.W. G i f f o r d , Proc. Roy. Soc. 70, 329(1902). 21. H. Trammsdorff, Phys. Zs. 2, 576(1901). 22. J.P. Holman, Heat T r a n s f e r , (Mcgraw-Hi11, New York, 1972). 23. L.R. P a i n t e r , E.T. Arakawa,M.W. W i l l i a m s , and J.C. Ashley, Rad. Res. 8_3, 1 ( 1980) . 24. Donald R. Smith and Ernest V. Loewenstein, App. Opt. 14, 1335(1975). 25. J.H. Morgan and D.E. Brodie, Can. J . Phys. 60, 1387(1982). 26. M.J. B r e t t and R.R. Parsons, S o l i d State Communications, i n p ress (1985). 27. W.S. Baer, Phys. Rev. J_5_4, 785(1967). 28. E.C. Heltemes, and H.L. Swinney, J . App. Phys. 38, 2387(1967). 29. J . Barkley Rosser and C a r l de Boor, Pocket C a l c u l a t o r  Supplement f o r C a l c u l a t o r s , (Addison-Wesley P u b l i s h i n g Company, Massachusetts, 1979), p. 171 47 APPENDIX A: Determination of O p t i c a l Constants f o r ZnO and . P o l y e t h y l e n e In order to c a l c u l a t e the r e f l e c t a n c e and transmittance c o e f f i c i e n t s [6,8], we r e q u i r e knowledge of the index of r e f r a c t i o n over the wavelength range of i n t e r e s t , f o r each m a t e r i a l i n the h e t e r o s t r u c t u r e . For greenhouse a p p l i c a t i o n s t h i s corresponds to wavelengths from the near UV to the f a r i n f r a r e d (0.3 to 40/im) . O p t i c a l c o n s t a n t s of most p l a s t i c s , i n c l u d i n g p o l y e t h y l e n e , are not w e l l known because the t h i c k n e s s v a r i a t i o n s , a d d i t i v e s , draw r a t e s and other manufacturing processes which change from one manufacturer to another. However to a good approximation the r e a l p a r t of the index of r e f r a c t i o n of p o l y e t h y l e n e i s constant [23,24]. The imaginary part of the r e f r a c t i v e index v a r i e s s u b s t a n t i a l l y between manufacturing p r o c e s s e s . We obtained e x t i n c t i o n c o e f f i c i e n t data f o r p o l y e t h y l e n e by using a 150MITI t h i c k r e p r e s e n t a t i v e sample of greenhouse p o l y e t h y l e n e obtained from r e f e r e n c e 12. Using a dual beam Beckmann Spectrophotometer UV 5270 (with an i n t e g r a t i n g sphere f o r r e f l e c t i o n measurements) and a Perkin Elmer i n f r a r e d Spectrophotometer model #598 , we obtained t r a n s m i s s i o n - r e f l e c t i o n p l o t s between 0.35-40Mm of a sample of greenhouse q u a l i t y p o l y e t h y l e n e , represented i n Figure 5. In the 0.4 - 2.5/im range, p o l y e t h y l e n e absorbs very l i t t l e l i g h t and has a t r a n s m i s s i o n of approximately 88% and r e f l e c t i o n of 12%.In the 2.5 - 30MII» range two i n t e r f a c e t h i n f i l m theory was used to f i n d the e x t i n c t i o n c o e f f i c i e n t [7] (see Eqs. (16) and 48 ( 1 7 ) ) . F i n a l l y , i n the 30- 40ym range the valu e s of r e f e r e n c e 24 were used. The n and k values used f o r p o l y e t h y l e n e are shown in F i g u r e 6 f o r a l l wavelengths. The o p t i c a l c o n s t a n t s of ZnO over a l a r g e range of wavelengths are not w e l l known. By d i v i d i n g the range of i n t e r e s t i n t o two areas, the v i s i b l e and i n f r a r e d , and by using d i f f e r e n t models f o r each area we were able to o b t a i n s a t i s f a c t o r y data. In the v i s i b l e r e g i o n * the a b s o r p t i o n of heat-mirror q u a l i t y ZnO i s n e g l i g i b l e [10], thus the index of r e f r a c t i o n was taken t o be r e a l i n t h i s range with value n = 2.0 [25]. Recent work by B r e t t and Parsons [26] has shown that the i n f r a r e d r e f l e c t i o n c h a r a c t e r i s t i c s of ZnO are w e l l modelled by Drude f r e e e l e c t r o n theory. T h i s theory p r e d i c t s the o p t i c a l c o n s t a n t s t o be given by: n 2 - k 2 = e g - Ne 2 ( i ) e 0m*(cj z + 7 2 ) 2nk = Ne 2 7 ( i i ) e0m*«j(o)2 + 7 2 ) where 7 i s a damping f a c t o r which depends on the m o b i l i t y (y) of charge c a r r i e r s 7 = e/Vm* , e g i s the d i e l e c t r i c constant i n the absence of f r e e charges; N i s the f r e e c a r r i e r c o n c e n t r a t i o n and m* i s the e l e c t r o n e f f e c t i v e mass. Fil m s of best IR r e f l e c t i v i t y had N = 1.8E20 cm 3, u = 20 cm 2/Vs, and o = 500 Qcm. In a d d i t i o n we used m* = 0.24m e[27] and e g • 3.7 [28]. With these values we generated the o p t i c a l c o n s t a n t s f o r ZnO. F i g u r e 6 shows the r e f r a c t i v e i n d i c e s of ZnO as a f u n c t i o n of wavelength. 49 APPENDIX B LISTING OF PROGRAM HETERO 50 UNIT HYP_TRIG;• f************************************************* { { UNIT HYPERBOLIC TRIGONOMETRIC FUNCTIONS { {************************************************************* { { PURPOSE: To d e f i n e some of the more elementary { h y p e r b o l i c f u n c t i o n s that need to be used in { the transmisson and r e f l e c t i o n c a l c u l a t i o n s . { |************************************************************* INTERFACE { Cosh(x) f i n d s the h y p e r b o l i c c o s i n e of x.} F u n c t i o n Cosh(x: r e a l ) : r e a l ; { Sinh(x) f i n d s the h y p e r b o l i c sine of x.} Fu n c t i o n Sinh(x: r e a l ) : r e a l ; IMPLEMENTATION F u n c t i o n Cosh; Begin cosh := (exp(x) + exp(-x))/2; End; {cosh} F u n c t i o n Sinh; Begin s i n h := (exp(x) - exp(-x))/2; End; {sinh} End. 51 UNIT CMPLX_MATH; {************************************ { UNIT COMPLEX MATH (******************************** { PURPOSE: To d e f i n e the elementary complex a r i t h m e t i c { r u l e s needed in the c a l c u l a t i o n of the { t r a n s m i s s i o n and r e f l e c t i o n curves. I * * * * * * * * * * * * * * * * * * * * * * * * * * * * * INTERFACE type c_type = r e c o r d r e : r e a l ; im: r e a l ; end; m_type = re c o r d a1,a2,a3,a4: c_type; end; {CMPLX_MULT takes two complex numbers,z1 & z2, and { m u l t i p l i e s them together. The complex r e s u l t i s retu r n e d . Procedure Cmplx_Mult(z1,z2: c_type; var mult: c _ t y p e ) ; {CMPLX_DIVSN takes two complex numbers, d i v i d e s one i n t o {the o t h e r , z l / z 2 , and r e t u r n s the complex r e s u l t . Procedure Cmplx_Divsn(z1,z2: c_type; var d i v s n : c _ t y p e ) ; {CMPLX_ADD takes two cmplex numbers,z1 & z2, adds them {together and r e t u r n s the r e s u l t . Procedure Cmplx_Add(zl,z2: c_type; var add: c_ t y p e ) ; {CMPLX_SUB takes two complex numbers,z1 & z2, s u b t r a c t s {them from each other and r e t u r n s the compex r e s u l t . Procedure Cmplx_Sub(z1,z2: c_type; var sub: c_ t y p e ) ; {MULT_MATRIX m u l t i p l i e s together two complex 2x2 matrices {and r e t u r n s the r e s u l t of the complex product matrix. {Note the determinant of the product matrix i s s t i l l u n i t y . Procedure Mult_Matrix(w1,w2: m_type; var w3: m_type); IMPLEMENTATION 52 Procedure Cmplx_Mult; {z1,z2: c_type; var mult: c_type} Begin with z1 do begin mult.re := (re * z2.re - im * z2.im); mult.im := (im * z2.re + re * z2.im); end; { with z1} End; {cmplx_mult}' Procedure Cmplx_Divsn; {z1,z2: c_type; var d i v s n : c_type} Begin with z l do begin ' i f (abs(z2.re) <= 1.0e16) and (abs(z2.im) <= 1.Oe16) then begin d i v s n . r e := (re * z2.re + im * Z2.im)/(sqr(z2.re) + s q r ( z 2 . i m ) ) ; divsn.im := (im * z2.re - re * z 2 . i m ) / ( s q r ( z 2 . r e ) + s q r ( z 2 . i m ) ) ; end e l s e begin d i v s n . r e := ( r e / z2.im + im/z2.re)/(z2.re/z2.im + z2.im/z2.re); divsn.im := (im/z2.im - r e / z 2 . r e ) / ( z 2 . r e / z 2 . i m + z2.im/z2.re); end; { i f then else} end; {with z1} End; { cmplx_divsn} Procedure Cmplx_Add; {z1,z2: c_type; var add: c_type} Begin with z l do begin add.re := re + z2.re; „. add.im := im + z2.im; end; {with z1} End; {cmplx_add} Procedure Cmplx_Sub; {z1,z2: c_type; var sub: c_type} Begin With z1 do begin sub.re := re - z2.re; sub.im := im - z2.im; end; {with z1} End; {cmplx_sub} {Coeff_matrix m u l t i p l i e s together the a p p r o p r i a t e complex } 53 {numbers to r e t u r n a value which i s a c o e f f i c e n t of the } {product matrix (see procedure M u l t - M a t r i x ) . } Procedure C o e f f _ M a t r i x ( z 1 , z 2 , z 3 , z 4 : c_type; var c o e f f : c _ t y p e ) ; var tempi,temp2: c_type; Begin cmplx_mult(z1,z2,tempi); cmplx_mult(z3,z4,temp2); cmplx_add(tempi,temp2,coef f ) ; End; {coeff matrix} Procedure Mult_Matrix; {w1,w2: m_type; var w3: m_type} Begin With w3 do begin coeff_matrix(w1.a1,w2.a1,w1.a2,w2.a3,al); coef f_matrix(w1.a1 fw2.a2,w1,a2,w2.a4,a2); coef f_matrix(w1.a3,w2.a1,wl.a4,w2.a3,a3); coeff_matrix(wl,a3,w2.a2,wl,a4,w2.a4,a4); end; {with} End; {mult matrix} End. 54 UNIT INITIALIZE_SYSTEM; { UNIT INITIALIZE_SYSTEM } f *************************************************************} { PURPOSE: Prompts the user to enter a l l the important } { data r e q u i r e d ( e . g . chemical composition of each} { l a y e r , t h i c k n e s s e s e t c . . ) f o r the t h i n f i l m } { h e t e r o s t r u c t u r e of i n t e r e s t . T h i s u n i t a l s o } { allo w s the user a chance to a l t e r any of t h i s } { p e r t i n e n t h e t e r o s t r u c t u r e data before } { c a l c u l a t i o n of the t r a n s m i s s i o n and r e f l e c t i o n } { curv e s . The data entered from t h i s u n i t i s then} { used by the remaining procedures of the program} { to c a l c u l a t e the t r a n s m i s s i o n and r e f l e c t i o n } { T/R c h a r a c t e r i s t i c s [6,8]. } I * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *******************************] INTERFACE USES screen_ops, {$U enter.code} e n t e r _ d a t a ; {INTRODUCTION i s a b r i e f statement, d i s p l a y e d at the beginning} {of the program, on what the program can do. } Procedure I n t r o d u c t i o n ; {*************************************************************} { START ' } I*************************************************************} { PURPOSE: To get most and/or a l l of the important } { h e t e r o s t r u c t u r e v a r i a b l e s from the user f o r } { the t r a n s m i s s i o n and r e f l e c t i o n curve } { c a l c u l a t i o n s . } { DESCRIPTION: T h i s procedure o b t a i n s the t h i n f i l m s t r u c t u r e } { v a r i a b l e s needed by prompt l i n e s d i s p l a y e d } { on the t e r m i n a l . The user i s t o l d what to } { enter as a response and given an example of } { how to enter i t . Surrounding each } { "prompt-response" case i s a p a s c a l "repeat } { - u n t i l " statement which w i l l continue } { d i s p l a y i n g the same prompt u n t i l one of a l i s t } { of c o r r e c t responses i s r e c e i v e d . T h i s } { prevents user entered mistakes from c r a s h i n g } { the program. } INPUTS: The user e n t e r s : 55 { (1) the t o t a l number of t h i n f i l m l a y e r s { = tot_num_lay { (2) the number of t h i n f i l m l a y e r s on both { s i d e s of the s u b s t r a t e . { (3) the i n c i d e n t angle of elect r o m a g n e t i c { r a d i a t i o n = t h e a t a . { (4) the chemical name f o r each l a y e r of the { s t r u c t u r e (=name[m]) so that the r e f r a c t i v e { index data can be obtained; the chemical { name = filename on floppy d i s c DATA:. Note { that f o r those l a y e r s with no o p t i c a l data { on the fl o p p y d i s c DATA:, the user can { enter h i s own r e f r a c t i v e index (n and k) { data v a l u e s . See u n i t ENTER DATA. { (5) the t h i c k n e s s e s (= t h i c k [ i ] T or range of { t h i c k n e s s e s (= th i c k _ u p and thick_low) f o r { each l a y e r . I f a range of t h i c k n e s s e s f o r { each t h i n f i l m l a y e r i s entered then the { program w i l l s y s t e m a t i c a l l y vary each { t h i c k n e s s i n order to maximize the T or R { of ele c t r o m a g n e t i c r a d i a t i o n . { (6) wavelength range f o r which the user wants { the t r a n s m i s s i o n and r e f l e c t i o n { c h a r a c t e r i s t i c s c a l c u l a t e d . { = low_lamda and up_lamda. { (7) number of data p o i n t s f o r which the user { wants the t r a n s m i s s i o n and r e f l e c t i o n { curves c a l c u l a t e d = v i s _ s p a c i n g + { i r _ s p a c i n g . { OUTPUTS: Prompt l i n e s to t e r m i n a l f o r user to { enter data. { NOTES: (1) T h i s procedure c a l l s the procedures { RANGE, ENTER_OWN_DATA and ALTER_DATA |************************************* Procedure S t a r t ; {************************************ { ALTER_DATA |********************************** { PURPOSE: To allow the user a chance to change any of. { the data that he has j u s t entered i n { procedure START before c a l c u l a t i o n of the { T/R c h a r a c t e r i s t i c s . I t i s a l s o used i n the { main program to allow the user to a l t e r the { c u r r e n t l y e x i s t i n g data and re-run the { the program. 56 DESCRIPTION: T h i s procedure allows a l l of the v a r i a b l e s s p e c i f i e d i n s e c t i o n INPUTS of procedure START to be changed by means of a "case" statement. The user i s prompted to enter what he wants changed; and then he i s prompted to change t h i s one v a r i a b l e a p p r o p r i a t e l y . T h i s continues u n t i l a l l v a r i a b l e s to be changed are changed INPUTS: The user enters a l e t t e r [a..g] which represents one of the v a r i a b l e s to be changed. OUTPUTS: Prompt l i n e s to t e r m i n a l f o r user to pick a v a r i a b l e and change i t a p p r o p r i a t e l y . NOTES: T h i s procedure c a l l s procedures START and RANGE. ********************************** Procedure A l t e r _ D a t a ( v a r ans : c h a r ) ; IMPLEMENTATION Segment Procedure S _ i n t r o ; Begin s c _ c l r _ s c r e e n ; w r i t e l n ; w r i t e l n ( ' P u t d i s c c a l l e d DATA: i n t o d r i v e B ' ) ; gotoxy(0,8); w r i t e l n C *** EVALUATION OF TRANSMITTANCE & REFLECTANCE COEFFICENTS * * * ' ) ; w r i t e l n ; w r i t e l n ( ' T h i s program c a l c u l a t e s the t r a n s m i s s i o n , r e f l e c t ion and ' ) ; w r i t e l n ( ' a b s o r p t i o n c h a r a c t e r i s t i c s f o r m u l t i l a y e r t h i n f i1ms on a ' ) ; w r i t e l n ( ' s u b s t r a t e based on the c h a r a c t e r i s t i c matrix formulat i o n ' ) ; w r i t e l n ; w r i t e l n ; End; {int r o d u c t i o n } Segment Procedure S _ S t a r t ; var i : i n t e g e r ; {dummy v a r i a b l e , wavelength,n,k: r e a l ; { o p t i c a l data v a r i a b l e s : {n = r e a l p a r t of r e f r a c t i v e index {k = imaginary part of r e f r a c t i v e { index. Begin 57 {$1-} repeat w r i t e l n ; w r i t e l n ( ' I n p u t the number of l a y e r s that your h e t e r o s t r u c t u r e has, ' ); w r i t e ( ' n o t counting the s u b s t r a t e , between 1 to 10 l a y e r s . ' ) ; readln(tot_num_lay); u n t i l (tot_num_lay in [1..10]); w r i t e l n ; w r i t e l n ; w r i t e l n ; w r i t e l n ( * w r i t e l n ( ' w r i t e l n ( ' I--> w r i t e l n ( ' writeln('R< w r i t e l n ( ' w r i t e l n ; w r i t e l n ; w r i t e l n ; repeat w r i t e l n ; writeln('How many of these l a y e r s bound the s u b s t r a t e on the s i d e which'); w r i t e ( ' h a s the i n c i d e n t e l e c t r o m a g n e t i c r a d i a t i o n { i e . l e f t side} ? ' ); readln(num_lay_on_inc); u n t i l (num_lay_on_inc i n [0..10]) and (num_lay_on_inc <= tot_num_lay); w r i t e l n ; w r i t e l n ; repeat w r i t e ( ' I n p u t the angle of incidence,between 0 - 9 0 degrees ' ) ; r e a d l n ( t h e a t a ) ; u n t i l (theata <= 90) and (theata >= 0); {convert theata from degrees to radians } theata := theata * 3.1416 /180; w r i t e l n ; angle_ans := ' S ' ; i f t h eata <> 0 then begin repeat w r i t e l n ( ' I s the i n c i d e n t e l e c t r o m a g n e t i c r a d i a t i o n p o l a r i z e d ' ) ; w r i t e l n ( 1 p a r a l l e l (P ) or p e r p e n d i c u l a r ( S ) to the plane of ' ) ; w r i t e l n ( ' i n c i d e n c e ? {e.g. S <return> } ' ) ; r e a d l n ( a n g l e _ a n s ) ; u n t i l angle_ans i n t ' S ' , ' P ' ] ; end; { i f theata <> 0} #1 #2 s u b s t r a t e #n ' ); ' ); > ' ) ' ) ' ) T ' ) ; 58 w r i t e l n ; repeat w r i t e l n ( ' D o you want to see a l i s t of the f i l e s of n & k data c u r r e n t l y ' ) ; w r i t e ( ' a v a i l a b l e {y/n} ? ' ) ; readln(respon1); u n t i l responl i n t'y','n']; {DATA:DISPLAY.TEXT d i s p l a y s the filenames of a l l the } {materials f o r which o p t i c a l data ( i . e . wavelength n k) } {is c u r r e n t l y s t o r e d on the flopp y d i s c named DATA:. } i f responl = 'y' then begin reset(store_name,'DATA:Display.text'); while not eof(store_name) do begin readln(store_name,str_name); w r i t e l n ( s t r _ n a m e ) ; end; {while} close(store_name,normal); end; { i f respon1} . repeat w r i t e l n ; w r i t e l n ( ' A r e a l l the data f i l e s you need a v a i l a b l e {y/n} ? n means t h a t ' ) ; w r i t e ( ' y o u want to enter your own data f o r some/all of the f i l e s . * ) ; re a d l n ( r e s p o n 2 ) ; u n t i l respon2 i n ['y','n']; {Some of the l a y e r s do not have t h e i r own o p t i c a l data on} {disc' DATA:. User can enter h i s own data or stop program } {and get data needed. } i f respon2 = 'n' then begin repeat w r i t e l n ; w r i t e l n ( ' D o you want to enter your own values f o r these m a t e r i a l s ' ) ; w r i t e l n ( ' s o the program w i l l continue {y/n} ? ,n w i l l e x i t you ' ) ; w r i t e ( ' f r o m the program. ' ) ; re a d l n ( r e s p o n 3 ) ; u n t i l respon3 i n ['y','n']; i f respon3 = 'y' then enter_own_data e l s e e x i t ( p r o g r a m ) ; end; { i f response2} {This o p t i o n i s used when a l l the o p t i c a l data f o r the } 59 { h e t e r o s t r u c t u r e of i n t e r e s t , i s a v a i l a b l e on the f l o p p y } { d i s c DATA:. } i f (respon2 = 'y') then b e g i n respon3 := 'n'; num_lay_with_no_data := 0; {This v a l u e w i l l be used i n u n i t SET_UP_DATA t o get } { a l l the data from DATA:. } l a y e r _ w i t h _ o w n _ d a t a [ 1 ] := tot_num_lay + 2; w r i t e l n ; w r i t e l n ( ' I n p u t . c h e m i c a l f o r m u l a f o r the l a y e r s s t a r t i n g from l a y e r # 1 ' ) ; w r i t e l n ( ' I f t he c h e m i c a l f o r m u l a i s g r e a t e r than s i x c h a r a c t e r s i n ' ) ; w r i t e l n ( ' l e n g t h then e n t e r the most common name u s i n g o n l y the f i r s t ' ) ; w r i t e l n ( ' 1 1 c h a r a c t e r s i n the name {eg. p o l y e t h y l e n e = p o l y e h t h y l e } . ' ) ; w r i t e l n ( ' T h e s u b s t r a t e name w i l l be asked f o r l a s t . ' ) ; w r i t e l n ( ' {eg. l a y e r 1 i s s i o 2 <return>} ' ) ; f o r i:= 1 t o tot _ n u m _ l a y do beg i n r e p e a t w r i t e ( ' l a y e r ' , i , ' i s ' ) ; r e a d l n ( n a m e [ i ] ) ; u n t i l ( l e n g t h ( n a m e [ i ] ) <= 11 ; end; { f o r i } re p e a t w r i t e ( ' S u b s t r a t e i s ' ) ; readln(name[tot_num l a y + 1 ] ) ; u n t i l ( l e n g t h ( n a m e [ i ] 7 <= 11); { c a l l p r o c e d u r e RANGE t o e n t e r the wavelength range} { f o r which the T/R c u r v e s a re t o be c a l c u l a t e d . } range; end; { i f respon2 = 'y'} repeat w r i t e l n ; w r i t e l n ( ' D o you want t o e n t e r one t h i c k n e s s f o r each l a y e r {y} or a ' ) ; w r i t e ( ' r a n g e of t h i c k n e s s e s {n} ? ' ) ; r e a d l n ( r e s p o n 1 ) ; u n t i l r e s p o n l i n t ' y ' j ' n ' ] ; {One t h i c k n e s s f o r each l a y e r i s e n t e r e d . The T/R c u r v e } {may not n e c e s s a r i l y have the optimum v a l u e s . } i f r e s p o n l = 'y' then b e g i n w r i t e l n ; 60 w r i t e l n ( ' E n t e r the t h i c k n e s s of each l a y e r , again s t a r t i n g from l a y e r ' ) ; - writeln('#1, i n u n i t s of angstroms, {eg. sio2 800 <return>} ' ) ; writeln('Warning: t h i c k n e s s e s of the t h i n f i l m s g r e a t e r than 1e6 ' ) ; writeln('angstroms w i l l cause the program to c r a s h . I n s e r t the ' ) ; w r i t e l n ( ' t h i c k n e s s of the s u b s t r a t e l a s t , i n mm.'); w r i t e l n ; f o r i := 1 to tot_num_lay do begin repeat w r i t e ( n a m e [ i ] , ' ' ) ; r e a d l n ( t h i c k [ i ] ) ; u n t i l ( t h i c k [ i ] >= 0) and ( t h i c k [ i ] <= I00e4); end; { i f i} repeat write(name[tot_num_lay + 1],' ' ) ; r e a d l n ( t h i c k [ t o t _ n u m _ l a y + 1]); {Convert s u b s t r a t e t h i c k n e s s from m i l l i m e t e r s to {angstroms. thick[tot_num_lay + 1] := thick[tot_num_lay + 1] * 1e7.; u n t i l ( t h i c k f t o t _ n u m l a y + 1] >= 0) and ( t h i c k f tot_num_lay +lT <= 6.5e7); w r i t e l n ; end { i f respon1} {A range of t h i c k n e s s e s i s entered. By v a r y i n g the {thicknesses the program t r i e s to maximize the T/R {curves. e l s e begin w r i t e l n ; w r i t e l n ; w r i t e l n ( ' E n t e r the range of t h i c k n e s s e s f o r each l a y e r s t a r t i n g from'); w r i t e l n ( ' l a y e r #1,in angstroms.{eg. Si02 300 800 <return> } * ) ; w r i t e l n ( ' T h e s u b s t r a t e t h i c k n e s s w i l l be asked f o r l a s t ; enter o n l y ' ) ; w r i t e l n ( ' o n e t h i c k n e s s f o r i t , in mm. Warning: t h i c k n e s s e s of the ' ) ; w r i t e l n ( ' t h i n f i l m s g r e a t e r than 1e6 angstroms w i l l cause the program'); w r i t e l n ( ' t o c r a s h . ' ) ; w r i t e l n ; f o r i:= 1 to tot_num_lay do begin 61 repeat w r i t e ( n a m e [ i ] , ' 1 ) ; r e a d l n ( t h i c k _ l o w [ i ] , t h i c k _ u p [ i ] ) ; u n t i l ( t h i c k _ l o w [ i ] >= 0) and ( t h i c k _ l o w [ i ] <= I00e4) and ( t h i c k _ u p [ i ] >= 0) and ( t h i c k _ u p [ i ] <= I00e4); end; {for i} repeat write(name[tot_num_lay + 1],' ' ) ; r e a d l n ( t h i c k [ t o t _ n u m _ l a y + 1]); {Convert the t h i c k n e s s of the s u b s t r a t e to } {angstroms. } t h i c k [ t o t _ n u m _ l a y + 1] := t h i c k [ t o t _ n u m _ l a y + 1] * 1e7; u n t i l ( t h i c k [ t o t _ n u m _ l a y + 1] >= 0) and ( t h i c k [ t o t _ n u m _ l a y + 1] <= 6.5e7); {Up to 50 d i f f e r e n t t h i c k n e s s e s can be t r i e d for each} {thin f i l m l a y e r . Note that to s y s t e m a t i c a l l y vary } {each t h i n f i l m t h i c k n e s s 50 times w i l l i n v o l v e } {(50 * # of t h i n f i l m l a y e r s ) i t t e r a t i o n s through } { t h i s program; t h i s c o u l d take up to 24 hours. } repeat w r i t e l n ; w r i t e l n ('Enter the number of d i f f e r e n t thicknesses, that you want ' ); w r i t e ( ' t r i e d , i n t h i s range{1..50}. ' ) ; r e a d l n ( p o i n t s ) ; u n t i l p o i n t s i n [1..50]; i f up_lamda <= 1.0e4 then begin w r i t e l n ; w r i t e l n ( ' T h e t r a n s m i s s i o n of l i g h t w i l l be maximzed'); respon5 := ' t ' ; end; { i f i n v i s } i f low_lamda >= 1.0e4 then begin w r i t e l n ; w r i t e l n ( ' T h e r e f l e c t a n c e of IR w i l l be maximized.'); respon5 := ' r ' ; end; { i f i n i r } i f (low_lamda <= 1.0e4) and (up_lamda >= 1.0e4) then begin repeat w r i t e l n ; w r i t e l n ( ' D o you want to maximize the t r a n s m i s s i o n of v i s i b l e l i g h t ' ) ; w r i t e l n ( ' { e n t e r t} or the r e f l e c t i o n of IR {enter r} f o r the range ' ) ; 62 w r i t e ( ' o f t h i c k n e s s e s e n t e r e d a b o v e . ' ) ; r e a d l n ( r e s p o n 5 ) ; u n t i l r e s p o n 5 i n t ' t ' , ' r ' ] ; e n d ; { i f i n b o t h } r e p e a t w r i t e l n ; w r i t e l n ( ' E n t e r t h e maximum t r a n s m i s s i o n { o r r e f l e c t i o n } t h a t y o u ' ) ; w r i t e l n ( ' w o u l d l i k e t o o b t a i n w i t h t h i s r a n g e o f t h i c k n e s s e s a n d ' ) ; w r i t e ( ' m a t e r i a l s , b e t w e e n 0 - 1 . 0 . ' ) ; r e a d l n ( m a x _ v a l ) ; w r i t e l n ; u n t i l ( m a x _ v a l >= 0) a n d ( m a x _ v a l <= 1 ) ; { C o n v e r t t h e maximum v a l u e ( m a x _ v a l ) t o t h e } { a p p r o p r i a t e w a v e l e n g t h r a n g e . } i f r e s p o n 5 = ' t ' t h e n m a x _ v a l := m a x _ v a l * ( 1 e 4 - l o w _ l a m d a ) e l s e m a x _ v a l := m a x _ v a l * ( u p _ l a m d a - 1 e 4 ) ; e n d ; { i f e l s e r e s p o n l } r e p e a t w r i t e l n ( ' D o y o u wan t t o c h a n g e a n y o f t h e d a t a t h a t y o u h a v e j u s t ' ) ; w r i t e ( ' e n t e r e d { y / n } ? ' ) ; r e a d l n ( r e s p o n 4 ) ; u n t i l r e s p o n 4 i n [ ' y ' , ' n ' ] ; i f r e s p o n 4 = ' y ' t h e n b e g i n r e p e a t a l t e r _ d a t a ( a n s ) ; u n t i 1 a n s = ' n ' ; e n d ; { i f r e s p o n s e 4} s c _ c l r s c r e e n ; g o t o x y T O , 0 ) ; w r i t e ( ' T h i s p r o g a m w i l l t a k e a n y w h e r e f r o m I m i n - l h r t o g e n e r a t e t h e r e s u l t s . . . ' ) ; {$1 + } E n d ; { s t a r t } Segment Procedure S _ a l t e r _ d a t a ; var m : i n t e g e r ; {m = a r r a y index r e p r e s e n t i n g the l a y e r } {number. } begin {$1-} repeat w r i t e l n ; w r i t e l n ( ' What do you want changed ? type i n ' ) ; w r i t e l n ( ' a l a y e r name a ' ) ; w r i t e l n ( ' a l a y e r t h i c k n e s s b ' ) ; 63 w r i t e l n ( ' t o t a l no. of l a y e r s C ) ; w r i t e l n C t o t a l no. of l a y e r s on i n c . s i d e d ' ) ; w r i t e l n C wavelength range and/or # of d a t a p t s e ' ) ; w r i t e l n C a n g l e of i n c i d e n c e & E . M . R - p o l a r i z a t i o n f' ); w r i t e l n ( ' max. T/R t h a t you want t o o b t a i n g ' ) ; w r i t e C ' ) ; r e a d l n ( r e s p o n d ) ; u n t i l respond i n ['a'..'g']; i f respond = 'a' then b e g i n s t a r t ; ans := 'n' ; end; { i f a} i f respond = 'b' then begin w r i t e l n ( ' D o you want t o change the t h i c k n e s s of the s u b s t r a t e { y } ' ) ; w r i t e l n ( ' o r the t h i n f i l m s { n } ? ' ) ; r e a d l n ( a n s ) ; i f ans = 'y' then b e g i n r e p e a t w r i t e ( ' E n t e r t h i c k n e s s of s u b s t r a t e , i n mm{eg. 0. 152 <return>}'); r e a d l n ( t h i c k [ t o t _ n u m _ l a y + 1]); t h i c k f t o t _ n u m _ l a y + 1] := t h i c k [ t o t _ n u m _ l a y + 1 ] * 1e7; u n t i l t h i c k [ t o t _ n u m _ l a y + 1] <= 6.5e7; end { t h i c k of s u b s t r a t e } e l s e beg i n i f r e s p o n l = 'n' then begin repeat w r i t e l n ( ' E n t e r the l a y e r number and the new t h i c k n e s s r a n g e ' ) ; w r i t e C {eg. 3 800 1000 <return> } ' ) ; r e a d l n ( m , t h i c k _ l o w [ m ] , t h i c k _ u p [ m ] ) ; u n t i l (m i n [1..10]) and ( t h i c k low[m] >= 0) and ( t h i c k _ l o w [ m ] <=l00e4T and ( t h i c k _ u p [ m ] >= 0) and ( t h i c k _ u p [ m ] <= I00e4); end e l s e b e g i n r e p e a t w r i t e ( ' I n p u t the l a y e r number and t h i c k n e s s {eg. 3 100'); w r i t e C <return>} ' ) ; r e a d l n ( m , t h i c k [ m ] ) ; u n t i l (m i n [1..10]) and ( t h i c k [ m ] >= 0) and ( t h i c k f m ] <= I00e4); end; { i f r e s p o n l } end; { i f e l s e s u b s t r a t e / t h i n f i l m } 64 end; {By changing the number of l a y e r s the program needs to} {know the names and t h i c k n e s s e s of these new layers.} {Consequently the program jumps back to the begining of } {the program where the user must enter " a l l " the data. } i f respond= 'c' then begin s t a r t ; ans := 'n'; end; { i f c) i f respond = 'd' then begin s t a r t ; ans := * n'; end; { i f d} i f respond = 'e' then range; i f respond = ' f ' then begin repeat w r i t e ( ' I n p u t the new angle of i n c i d e n c e , in degrees ' ) ; r e a d l n ( t h e a t a ) ; u n t i l (theata>= 0) and (theata <= 90); theata := theata * 3.1416/180; i f theata <> 0 then begin repeat w r i t e l n ( ' I s the i n c i d e n t E.M.R p a r a l l e l (P) or ' ); w r i t e l n ( ' p e r p e n d i c u l a r (S) to the plane of inc i d e n c e ? ' ) ; w r i t e l n ( ' { e . g . P <return>} ' ) ; readln (angle_ans); u n t i l angle_ans i n ['P'/S'] end; end; { i f f} i f respond = 'g' then begin i f responl = 'n' then begin w r i t e l n ( ' E n t e r the maximum t r a n s m i s s i o n { r e f l e c t i o n } that you ' ) ; write('would l i k e to o b t a i n ' ) ; readln(max_val); i f respon5 = ' t ' then max_val := max_val * (1e4 - low_lamda) e l s e max_val := max_val * (up_lamda - 1e4); end { i f responl} e l s e begin w r i t e l n ( ' T h i s o p t i o n i s meant to be used only i f t h i c k n e s s r a n g e 1 ) ; 65 w r i t e l n ( ' f o r each l a y e r was used.'); end; { i f e l s e responl} end; {g} i f respond i n ['a','b','e','f','g'] then begin repeat w r i t e l n ; w r i t e ( ' Do you want to change any more data {y/n}?'); r e a d l n ( a n s ) ; u n t i l ans i n [' y' ,' n' ]; end; { i f respond i s not c or d} {$1 + } end; { a l t e r data} Procedure i n t r o d u c t i o n ; begin S _ i n t r o ; end; {intro} Procedure s t a r t ; begin S _ s t a r t ; end; {start} Procedure A l t e r _ d a t a ; {var ans: char} begin S _ a l t e r _ d a t a end; {alter_data} End. 66 UNIT Enter_Data; ! *************************************** { UNIT ENTER_DATA i * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ~ { PURPOSE: To enter o p t i c a l data f o r the l a y e r s (of the { h e t e r o s t r u c t u r e ) with no data c u r r e n t l y present { , on the floppy d i s c DATA:. For the other l a y e r s . { (which have r e f r a c t i v e index data a v a i l a b l e on ' { DATA:) the user must enter the { chemical formula = filename on DATA:. The { o p t i c a l data, f o r each l a y e r , can be entered { with any wavelength n and k value s as long as { they are i n i n c r e a s i n g order of wavelengths. { I n t e r p o l a t i o n i s done on n and k values of each { l a y e r to get a l l the l a y e r s to have a { c o n s i s t e n t set of wavelengths. T h i s u n i t i s { entered from procedure START. ************************************************************** INTERFACE type mat_type1 = packed a r r a y [ l . . l O ] of r e a l ; { s t o r e s the t h i c k {of each l a y e r { mat_type2 = packed a r r a y [ l . . 4 5 ] of r e a l ; { s t o r e s a l l the {wavelengths { mat_type3 = packed array[1..10,1. . 3 ,1..45] of r e a l ; {stores { a l l the l a y e r #s, {and e i t h e r {wavelength or n or • {values. { mat_type5 =packed array!1..10] of i n t e g e r ; { s t o r e s the l a y e r {#s; f o r l a y e r s {which need data to {be entered. { var low_lamda : r e a l ; {The s m a l l e s t and l a r g e s t up_lamda : r e a l ; {wavelengths which bound the {wavelength range f o r which T/R { c h a r a c t e r i s t i c s w i l l be found. {Input i n procedure RANGE. { 67 v i s _ s p a c i n g i r_spac ing p o i n t s i n t e g e r ; i n t e g e r ; integer, tot_num_lay : i n t e g e r ; num_lay_on_inc : i n t e g e r theata : r e a l ; {Angle of i n c i d e n c e . Input i n {procedure START { max_val : r e a l ; {The max. T/R value the user hopes {to o b t a i n . T h i s i s only used when {the user e n t e r s a range of {thicknesses. Input i n procedure {START. { {The # of p o i n t s i n the v i s i b l e & {IR r e s p e c t i v e l y , that are used i n { c a l c u l a t i n g the T/R curves. Input {in procedure RANGE. { {The # of d i f f e r e n t t h i c k n e s s f o r {each l a y e r that the user wants { t r i e d i n the t h i c k n e s s range. {Input i n procedure START. { {The t o t a l number of t h i n f i l m { l a y e r s . Input i n procedure START. {The t o t a l # of l a y e r s on the {i n c i d e n t s i d e of s t r u c t u r e . Input {in procedure START. { num_lay_with_no_data: i n t e g e r ; {The # of l a y e r s with no {data. { name : packed a r r a y [ l . . 5 ] of s t r i n g [ l l ] ; {Contains a l l the f i l e names. {Input i n procedure START. { t h i c k : mat_type1;{contains the t h i c k n e s s e s of { a l l the l a y e r s . Input i n {procedure START. { t h i c k _ l o w , t h i c k _ u p : mat_type1;{Contains the lower & upper {thickness bounds f o r each l a y e r . {These are used only i f the user {wants to f i n d the optimum {thickness that maximizes the T/R. {Input i n procedure START. { dat : mat_type3;{array which c o n t a i n s the {wavelength n & k data from e i t h e r {the f i l e s on f l o p p y DATA: or as {entered manually by user, before { i n t e r p o l a t i o n i s done. Values {input e i t h e r i n procedures {NOW ENTER .or GET DATA FROM FILE. { " - - _ data : mat_type3;{array which c o n t a i n s the { r e f r a c t i v e index data " a f t e r " 68 a l l _ l y r s _ d a t : t e x t ; s t o r e name layer_with_own_data : mat i n t e r p o l a t i o n i s done. The n and k data f o r the l a y e r has an e q u i v a l e n t set of wavelengths. Set i n procedure PICK_AND_STORE. lamda : mat_type2;{array holds NOT the f i l e 'wavelength values but i n s t e a d the wavelength values which s a t i s f y the # data p o i n t s wanted. P a s c a l i n t e r n a l f i l e used i n opening and a s s o c i a t i n g an e x t e r n a l data f i l e with i t . t e x t ; {Pascal i n t e r n a l f i l e used in c o n j u n c t i o n with c r e a t i n g a new data f i l e on DATA:. See procedure ENTER_OWN_DATA. type5;{Array holds the l a y e r # Tthat r e q u i r e d i t s own data to be entered . dots : mat_type5;{Array•which t e l l s how many n & k 'values the i t h l a y e r has; only used when user enters h i s own data. Input i n procedure ENTER_OWN_DATA. Responses to a l l the qu e s t i o n s that are asked in procedures START and Enter_DATA. Used i n procedure START to read f i l e DATA:DISPLAY.TEXT which c o n t a i n s a l l the data f i l e s c u r r e n t l y s t o r e d on DATA:. angle_ans : char; {Is equal to e i t h e r P or S 'depending on whether the p o l a r i z a t i o n of E.M.R. i s p a r a l l e l or p e r p e n d i c u l a r to the plane of i n c i d e n c e r e s p e c t i v e l y . ************************************** respond,ans : char; respon1,respon2: char; respon3,respon4: char; respon5 : char; str_name : s t r i n g ; ENTER_OWN_DATA ************************************************************* PURPOSE: To enter the r e f r a c t i v e index data f o r a l l of the l a y e r s with no data c u r r e n t l y on the d i s c DATA:. 69 DESCRIPTION: The number of l a y e r s which are going to have o p t i c a l data entered i s input. Then each l a y e r (which w i l l have data entered) i s named by i t s chemical formula. T h i s naming of l a y e r s allows o p t i c a l data to be entered only once f o r h e t e r o s t r u c t u r e s with two or more e q u i v a l e n t composition l a y e r s by s p e c i f y i n g the same name for each e q u i v a l e n t l a y e r . A f t e r a l l the o p t i c a l data i s entered each l a y e r s r e f r a c t i v e index data can be scanned and any needed changes can be made. In a d d i t i o n these l a y e r s (with user entered o p t i c a l data) can be saved on DATA:. F i n a l l y , the remaining l a y e r s , with r e f r a c t i v e index data on DATA:, have t h e i r chemical formulas entered by the user." INPUTS: The user e n t e r s : ( 1 ) Num_lay_with_no_data = the number of l a y e r s with no o p t i c a l data on d i s c DATA:. (2) Wavelength, n and k values f o r each l a y e r with no data on DATA:. See procedure Now_Enter. (3) Chemical formula and l a y e r number of each l a y e r = namefm] , m r e s p e c t i v e l y ( 4 ) the l a y e r s to have t h e i r o p t i c a l data s t o r e d on f l o p p y d i s c DATA:. OUTPUTS: Prompt l i n e s to t e r m i n a l for user to enter a p a r t i c l a r p i e c e of da t a . NOTES: (1) T h i s procedure o b t a i n s the t h i n f i l m v a r i a b l e s s p e c i f i e d above by prompt l i n e s . See the DESCRIPTION s e c t i o n of procedure START f o r more d e t a i l s . (2) T h i s procedure c a l l s procedure NOW_ENTER and RANGE. (3) T h i s procedure i s c a l l e d by procedure START **************************************** Procedure Enter_Own_Data; f * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * RANGE ************************************************************* PURPOSE: To enter the wavelength range of i n t e r e s t and the number of p o i n t s i n t h i s r e g ion f o r which the T/R cuvres w i l l be c a l c u l a t e d . INPUTS: The user e n t e r s : (1) Low_Lambda and Up_lambda = the wavelength 70 { range of i n t e r e s t . { (2) V i s _ S p a c i n g and IR_Spacing = the number of { data p o i n t s i n the v i s b l e and IR . The { number of T/R p o i n t s that w i l l be { c a l c u l a t e d . { OUTPUTS: Prompt l i n e s f o r the user to enter the above { i n p u t s . { NOTES: (1) T h i s procedure i s c a l l e d by procedures { START, ENTER_OWN_DATA and ALTER_DATA. ************************************************************** Procedure Range; IMPLEMENTATION ************************************************************** { NOW_ENTER ************************************************************** { PURPOSE: To s p e c i f y how many data values are going to be { entered f o r the l a y e r chosen. And then to enter { the wavelength, n and k values f o r t h i s l a y e r . { DESCRIPTION: The user enters the wavelength, n and k { values f o r the number of p o i n t s he s p e c i f i e d { ( f o r the l a y e r of i n t e r e s t ) . Note that the { wavelengths entered must be i n i n c r e a s i n g order { If the lowest wavelength entered i s l a r g e r than { the lower range l i m i t (e.g. low_lamda) then { low_lamda i s reset to t h i s wavelength value; { thus the wavelength range s h r i n k s . T h i s same { technique a p p l i e s to the upper wavelength range { l i m i t as w e l l . T h i s technique of a d j u s t i n g the { %. wavelength range i s a l s o used i n procedure { % GET_DATA_FROM_FILE. F i n a l l y , the entered { data i s put i n t o a r r a y DAT; i t stays in t h e i r { u n t i l i n t e r p o l a t i o n i s done on the data (see { un i t SET_UP_DATA). { INPUTS: The user e n t e r s : { (1) dots[m] = the number of data p o i n t s for { l a y e r m that he i s going to e n t e r . { (2) wavelength { (3) n and k = r e a l and imaginary p a r t s of { r e f r a c t i v e index. { OUTPUTS: Prompt l i n e s to t e r m i n a l to enter above data. { NOTES: (1) T h i s procedure i s c a l l e d by procedure 7 1 { ENTER OWN DATA. •} { " " • } {*******************************^  Procedure Now_Enter(m : i n t e g e r ) ; forward; Segment Procedure S_Enter_Own_Data; var 1,m,i,j,low,m0,kO : i n t e g e r ; {Index v a r i a b l e s used i n For } {loops and a r r a y s . } same : char; {SAME i s yes/no depending on } {whether two l a y e r s with the } {same entered names have the } {same o p t i c a l data. } Begin repeat w r i t e l n ; write('How many l a y e r s are there with no data {1..10}? ' ) ; readln(num_lay_wi th_no_data); u n t i l num_lay_with_no_data i n [1..10]; w r i t e l n ; { C a l l procedure RANGE to enter the wavelength range f o r } {which the T/R curves are to be c a l c u l a t e d . } range; wr i t e l n ; w r i t e l n ( ' I n p u t the l a y e r no. {1..10} and chemical name in order s t a r t i n g ' ) ; w r i t e l n ( ' f r o m the l e f t most l a y e r which does not have a data f i l e . Then ' ) ; w r i t e l n ( ' e n t e r data f o r l a y e r . I f s u b s t r a t e data i s going to be e n t e r e d , ' ) ; w r i t e l n ( ' e n t e r i t l a s t . { e g . l a y e r # and name are 2 ZnO <return>} ' ) ; f o r 1 := 1 to num_lay_with_no_data do begin repeat writeC'Layer # and name are ' ) ; readln(m,name[m]); u n t i l (m i n [1..10]) and (length(name[m]) <= 11); layer_with_own_data[1] := m; same := 'd';. {More than one l a y e r i s having data entered } {manually. } i f 1 > 1 then begin j := 1; repeat 72 {Compare the j u s t entered l a y e r name with a l l } {other entered l a y e r names to see i f they are } j : = j - 1 ; i := layer_with_own_data[ j ] ; {The l a y e r names are the same which probably } {means the r e f r a c t i v e index data i s the same } {for both l a y e r s . I f t h i s i s so the user only } {has to enter o p t i c a l data f o r one of these two i f ((pos(name[i],name[m]) <> 0) and (length(name[i]) = length(name[m]))) then begin repeat w r i t e l n ; w r i t e ( ' I s the data f o r l a y e r s ' , i , ' and ' ,m) ; w r i t e l n ( ' the same {y/n} ? ' ) ; readln(same); u n t i l (same i n ['y','n']); i f same = 'y' then begin dots TITI] := d o t s [ i ] ; ' f o r kO := 1 to dotst-i ] do begin dat[m,1,k0] := d a t [ i , 1 , k 0 ] ; dat[m,2,k0] := d a t [ i , 2 , k 0 ] ; dat[m,3,ku] := d a t [ i , 3 , k 0 ] ; end; {for kO} end { i f same} {The user entered the same name f o r two } {lay e r s with d i f f e r e n t o p t i c a l data, so } {he must change the name of one of these } { l a y e r s . } e l s e begin w r i t e ( ' E n t e r new name ' ) ; readln(name[m]); now enter(m); end; T i f not the same} end; {names are the same} u n t i l (j=1); i f same = 'd' then now_enter(m); end { i f 1 >1} e l s e begin now enter(m) {the same. } { l a y e r s . } } 7 3 end; { i f 1 = 1} end; {for 1} repeat w r i t e l n ; write('Do you want to change any entered wavelength,n & k data{y/n}?'); r e a d l n ( r e s p o n d ) ; i f respond = *y' then begin w r i t e l n ; w r i t e l n ( ' E n t e r l a y e r f o r which you would l i k e to see data ' ) ; w r i t e l n ( ' { e g . 3 <return>}'); readln(m); { S c r o l l out o p t i c a l data f o r l a y e r m on screen. } writeln('WAVELENGTH N K ' ) ; fo r j := 1 to dots[m] do begin w r i t e l n ( d a t [ m , 3 , j ] , d a t [ m , 1 , j ] , d a t [ m , 2 , j ] ) ; end; {for j} repeat repeat w r i t e l n ( ' D o you want to change any data in t h i s l a y e r {y/n}?'); r e a d l n ( a n s ) ; u n t i l (ans i n ['y','n']); {Change t y p i n g mistakes of a p p r o p r i a t e data } {values. } i f ans = 'y' then begin w r i t e l n ; w r i t e l n ( ' I n p u t the data p o i n t # that you want changed ' ) ; w r i t e l n ( ' a n d then the new v a l u e s of wavelength, n, k ' ) ; w r i t e l n ( ' t h a t you want f o r t h i s p o i n t . ' ) ; w r i t e l n ( ' { e g . 13 4500 1.45 0.3 <return>'); repeat r e a d l n ( j , d a t [ m , 3 , j ] , d a t [ m , 1 , j ] , d a t [ m , 2 , j ] ) ; u n t i l (dat[m,3,j] >= 3000) and (dat[m,3,j] <= I20e4) and (dat[m,1,j] >= 0) and (dat[m,1,j] <= 400) and (dat[m,2,j] >= 0) and • (dat[m,2,j] <= 600); end; { i f ans = yes} u n t i l ans = 'n'; end; { i f respon = yes} u n t i l respond = 'n'; w r i t e l n ; w r i t e l n ( ' D o you want to save any of these data f i l e s 74 permanently on'); w r i t e l n ( ' f l o p p y d i s c DATA: {y/n} ? ' ) ; repeat r e a d l n ( a n s ) ; u n t i l (ans i n ['y','n']); {Save some of the l a y e r s entered o p t i c a l data on floppy } {DATA:. } i f ans = 'y' then. begin w r i t e l n ; w r i t e l n ( ' I n p u t the # of l a y e r s that you want saved ?'); r e a d l n ( j ) ; w r i t e l n ( * Input l a y e r s that you want saved. ' ) ; w r i t e l n ( ' { e g . 2 <return> 5 <return> } ' ) ; repeat j := j - 1 ; readln(m); r e w r i t e ( a l l _ l y r s _ d a t , c o n c a t ( ' d a t a : ' , n a m e [ m ] , ' . t e x t ' ) ) {The format of the data on the f l o p p y i s wavelength} {n k. with the f o l l o w i n g c o n s t r a i n t s : wavelengths } {must be i n u n i t s of angstroms; the wavelength must} {have data i n i n c r e a s i n g order of wavelengths; any} {wavelength val u e s can be used with any spacing } {between the wavelengths; And any number of data } {points may be i n the f i l e . O p t i c a l data may be } {entered on to the floppy e i t h e r using the standard} {e d i t o r and f i l e h a ndling commands, or i t may be} {entered by e n t e r i n g data f o r t h i s program and then} {saving i t (the next few steps i l l u s t r a t e t h i s ) . } f o r 1 := 1 to dots[m] do begin w r i t e l n ( a l l l y r s _ d a t , d at[m,3,l], dat[m,1,l], d a t T m,2,l]); end; {for 1} c l o s e ( a l l _ l y r s _ d a t , l o c k ) ; r eset(store_name,'DATA:display.text'); while not eof(store_name) do begin readln(store_name); end; {while} writeln(store_name,name[m]); close(store_name,normal); u n t i l j = 0; end; { i f ans = y} layer_with_own_data[num_lay_with_no_data + 1] := tot_num_lay + 2; w r i t e l n ; w r i t e l n ( ' I n p u t chemical formula f o r the remaining l a y e r s needed, s t a r t i n g ' ) ; 75 w r i t e l n ( ' f r o m l a y e r #1, s k i p p i n g the l a y e r s f o r which you j u s t entered ' ) ; w r i t e l n ( ' d a t a . If chemical formula i s g r e a t e r than s i x c h a r a c t e r s i n ' ) ; w r i t e l n ( ' l e n g t h then enter the most common name using only the f i r s t 11'); w r i t e l n ( ' c h a r a c t e r s i n the name. {eg. p o l y e t h y l e n e = polyethyle} ' ); w r i t e l n ( ' T h e s u b s t r a t e w i l l be asked f o r l a s t . ' ) ; w r i t e l n ; low := 1 ; {The remaining l a y e r s have data s t o r e d on d i s c DATA:. } {Just the names of these l a y e r s names are input by using} {a combination of the two FOR loops below. } fo r m := 1 to (num_lay_with_no_data + 1) do begin f o r mO := low to (layer_with_own_data[m] - 1) do begin i f (mO <> tot_num_lay + 1) then begin repeat w r i t e ( * l a y e r ',m0,' i s ' ) ; readln(namefmO]); u n t i l (length(name[mO]) <= 11); end { i f mO} e l s e begin i f (layer_with_own_data[num_lay_with_no_data] <> tot_num_lay+1) then repeat w r i t e ( ' s u b s t r a t e i s ' ) ; readln(name[mO]); u n t i l (length(name[mO]) <= 11); end; { i f e l s e mO} end; {for mO} low := layer_with_own_data[m] + 1; end; {for m} {$1 + } End; {enter_your_own_data} Procedure Range; Begin repeat w r i t e l n ; w r i t e l n ( ' I n p u t wavelength range of i n t e r e s t , between 3000-1.2e6 angstroms'); w r i t e l n C {eg. 3000 I0e4 <return> }'); w r i t e l n ; readln(low_lamda,Up_lamda); u n t i l (low_lamda>=3000) and (up_lamda<=120e4) and (low_lamda <=up_lamda); 76 i f (low_lamda <= 10000) then begin repeat w r i t e l n ; w r i t e l n ( ' I n p u t the number of data p o i n t s {1..40} you want i n the ' ) ; w r i t e ( ' v i s i b l e , b e t w e e n 3000 and 10,000 angstroms.'); r e a d l n ( v i s _ s p a c i n g ) ; u n t i l v i s _ s p a c i n g i n [1..40]; end; { i f low_lamda} i f (up_lamda > 1.0e4 ) then begin repeat w r i t e l n ; w r i t e l n ( ' I n p u t the number of data p o i n t s {=40 - v i s _ s p a c i n g } you'); write('want i n the IR, between 10,000- 1.2e4. ' ) ; r e a d l n ( i r _ s p a c i n g ) ; u n t i l ( i r _ s p a c i n g i n [1..40]) and ( i r _ s p a c i n g <= 40 - v i s _ s p a c i n g ) ; end; { i f up_lamda} i f (low_lamda <- 1.0e4) and (up_lamda <= 1.0e4) then i r _ s p a c i n g := 0; i f (low_lamda > 1.0e4) and (up_lamda > 1.0e4) then v i s _ s p a c i n g := 0; End; {Procedure Range} Procedure Enter_own_data; Begin S_enter_own_data; End; {enter own data} Procedure Now_Enter; var i , j : i n t e g e r ; {dummy index v a r i a b l e s . } wavelength,n,k:real; { o p t i c a l v a r i a b l e s = wavelength and} {r e a l and imaginary r e f r a c t i v e } { i n d i c e s , n and k r e s p e c t i v e l y . } Begin w r i t e l n ; w r i t e l n ( ' E n t e r the number of data p o i n t s f o r t h i s l a y e r that you a r e ' ) ; w r i t e l n ( ' g o i n g to e n t e r . Note that t h i s number does not have to e q u a l ' ) ; w r i t e l n ( ' t h e number of data p o i n t s i n the v i s i b l e + IR that you want ' ) ; w r i t e l n ( ' p l o t t e d ( i n t e r p o l a t i o n w i l l be done). A l s o , you must have at '-); w r i t e l n ( ' l e a s t two data p o i n t s i n the v i s i b l e and/or IR. ' ) ; repeat r e a d l n ( d o t s f m ] ) ; 77 u n t i l (dotsfm] >= 0) and (dots[m] <= 40); w r i t e l n ; writeln('Now input wavelength n & k values f o r the # of data p o i n t s ' ) ; w r i t e l n ( ' g i v e n above, s t a r t with the s m a l l e s t wavelength and work ' ) ; w r i t e l n ( ' u p to the l a r g e s t . The range of wavelengths must be ' ) ; writeln('between 3000 - I20e4 angstroms. {e.g. 3500 1.5 0.1 <return>}'); f o r j := 1 to dots[m] do begin repeat w r i t e ( ' D a t a p o i n t i s * ) ; readln(wavelength,n,k); u n t i l (wavelength >= 3000) and (wavelength <= 120e4) and (n >= 0) and (n <= 400) and (k>= 0) and (k <= 600) ; dat[m,1,j] dat[m,2,j] dat[m,3, j ] = n; = k; = wavelength; {Check to see i f the f i r s t wavelength entered i s .} {l a r g e r than low_lamda. If t h i s i s so then adjust} {range. } i f ( ( j = l ) and (wavelength > low_lamda)) then low_lamda := wavelength; end; {for j} {Check to see i f the l a s t wavelength entered } {Up_lamda i s g r e a t e r . If i t i s not, then a d j u s t the} {range. } i f (wavelength < up_lamda) then up_lamda := wavelength; w r i t e l n ; End; {procedure now_enter data} End. 78 UNIT Set_Up_Data; I * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * UNIT SET UP DATA **************************************** PURPOSE: To take the set of wavelengths ( s t o r e d in array LAMDA; c a l c u l a t e d from the wavelength range (= Up_Lamda - Low_Lamda) and the number of data p o i n t s (= V i s _ S p a c i n g + IR_Spacing)) and then i n t e r p o l a t e the o p t i c a l data f o r each l a y e r to t h i s set of wavelengths. T h i s i s done by g e t t i n g the o p t i c a l data f o r each l a y e r entered i n t o a r r a y DAT. Array DAT gets the r e f r a c t i v e index data from user entered data d i r e c t l y (see procedure Enter_Own_Data) and/or from the r e f r a c t i v e index v a l u e s a l r e a d y on flopp y DATA: (see procedure Get_Data_From_File). Then i n t e r p o l a t i o n i s used to f i t the data f o r each l a y e r to t h i s set of wavelengths. These r e f r a c t i v e index values, c o n s i s t e n t with the wavelengths s t o r e d i n a r r a y LAMDA, are st o r e d i n DATA:. ************************************************************* INTERFACE uses screen_ops, { $U' enter .code} e n t e r _ d a t a , {$U i n i t i a l i z e . c o d e } i n i t i a l i z e ; ************************************************************* GET_DATA_FROM_FILE ************************************************************* PURPOSE: To load only the wavelength and r e f a c t i v e index data f o r the l a y e r s , which have data f i l e s on floppy DATA:, i n t o a r r a y DAT. The other l a y e r s which had t h e i r o p t i c a l data entered ( i n procedure Enter_Own_Data) have data a l r e a d y al r e a d y i n some regions of DAT. DESCRIPTION: A l a y e r (mO) with o p t i c a l data on d i s c DATA i s s e l e c t e d . Then the name the user assigned to t h i s l a y e r (= name[mO]) i s used to open t h i s t h i s f i l e on the f l o p p y ( i . e . r e s e t ( a l l _ l y r _ d a t DATA:name[mO].text)). With the f i l e open a l l the wavelength, n and k data i s read from t h i s f i l e . These steps are repeated f o r a l l the l a y e r s that have o p t i c a l data on d i s c DATA:. 79 Note that i f the lowest wavelength i n t h i s f i l e i s l a r g e r than the lower wavelength range l i m i t (e.g. Low_Lamda) then Low_Lamda i s reset to t h i s h i g h e r v a l u e , thus s h r i n k i n g the RANGE Th i s same technique a p p l i e s to the upper wavelength range l i m i t . T h i s technique of a d j u s t i n g the range i s a l s o used i n procedure Now_Enter. INPUTS: O p t i c a l data ( i . e . wavelength, n and k) from f i l e s on d i s c DATA:. OUTPUTS: Prompt l i n e s to screen, only i f the user c a l l s c a l l s f o r a f i l e not on DATA:. NOTES: (1) The s e l e c t i o n of l a y e r s with o p t i c a l data "only" on fl o p p y DATA: i s done by the combination of FOR loops. (2) I f one of the data f i l e s i s not on the f l o p p y (e.g. user m i s s p e l l e d the filename) then t h i s r o u t i n e l e t s the user r e s p e l l the filename so the program w i l l c ontinue. (3) T h i s procedure c a l l s procedure MODIFY_DATA. (4) T h i s procedure i s c a l l e d from MAIN. **************************************** Procedure Get_Data_From_File; IMPLEMENTATION var i,j,m : i n t e g e r ; { i n d i c i e s used to get at p o i n t s i n a r r a y s {data,dat and lamda. {m = i s used to represent the l a y e r no. in {array DAT & DATA. {j = i s used to index n or k or wavelength {values from a r r a y DAT. {i = i s used to represent e i t h e r n or k {values from a r r a y DATA, wave : r e a l ; {A v a r i a b l e used i n Pick_and_store to a i d in { i n t e r p o l a t i o n . f************************************************************* INTERPOLATE FROM ARRAY DAT FOR n & k ************************************************************* PURPOSE: To use a r r a y DAT and a wavelength a s s o c i a t e d with a data p o i n t ( c a l l e d count_lamda) to i n t e r p o l a t e between some n and k values f o r the n and k v a l u e s a s s o c i a t e d with the wavelength count lamda. 80 DESCRIPTION: n values from DAT are i n t e r p o l a t e d to } c o i n c i d e with wavelengths, count_lamda, using } the formula } slope = X 2 ~ X, } n 2 - n, } = couht_lamda - X, } n(count_lamda) - n, } with } n,, n 2 = the r e a l p a r t s of r e f r a c t i v e index} (from array DAT) before i n t e r p o l a t i o n } n(count_lamda) = the r e f r a c t i v e index that } c o i n c i d e s with the wavelength value } count lamda (which i s s t o r e d i n array} { LAMDAT. I t w i l l be s t o r e d i n ar r a y } DATA, see procedure PICK_&_STORE. } X,,X2 = wavelength values from DAT } count_lamda = a wavelength data p o i n t . } The above technique i s a l s o used to f i n d } k(count_lamda). } INPUTS: (1) count_lamda = a data p o i n t wavelength } which i s d e f i n e d i n procedure MODIFY FILE.} (2) r e f r a c t i v e index (n & k) and wavelength } values form a r r a y DAT. } OUTPUTS The r e f r a c t i v e index val u e s that c o i n c i d e with} wavelengths i n LAMDA. } NOTES: (1) T h i s procedure i s c a l l e d by procedure } PICK_and_STORE. } * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * nt_From_Table_For_n_&_k(count_lamda: r e a l ; var n & k: r e a l ) ; orward; *************************************************************} PICK_AND_STORE } *************************************************************! PURPOSE: To get a l l the l a y e r s n & k value s to coincide} with the data p o i n t s count_lamda ( u s u a l l y by } i n t e r p o l a t i o n ) ; and to s t o r e these r e f r a c t i v e } index va l u e s i n a r r a y DATA. A l s o to st o r e the } count_lamda values i n a r r a y LAMDA. } DESCRIPTION: A wavelength value i s obtained from a r r a y } DAT and compared to the data p o i n t count_lamda} If the wavelengths are the same then these n } 81 and k values and count_lamda are s t o r e d i n new ar r a y s c a l l e d DATA and LAMDA; i f the . wavelengths are not the same then the procedure INT_FROM_TABLR_FOR_n_&_k i s used to f i n d the n and k values a s s o c i a t e d with count_lamda, and again, these new n & k and count_lamda are s t o r e d in ar r a y s c a l l e d DATA and LAMDA, r e s p e c t i v e l y . This i s repeated f o r a l l wavelengths i n each layer and then a l l l a y e r s . INPUTS: ( 1 ) count_lamda = a data point wavelength which i s d e f i n e d in procedure MODIFY_FILE. (2 ) O p t i c a l data from array DAT. OUTPUTS: I n t e r p o l a t e d r e f r a c t i v e index v a l u e s i n array DATA. And data p o i n t wavelengths i n array LAMDA NOTES: ( 1 ) T h i s procedure i s c a l l e d by MODIFY_FILE. ( 2 ) T h i s procedure c a l l s procedure INT_FROM_TABLE_FOR_n_and_k. ************************************** Procedure Pick_and_Store(count_lamda : r e a l ) ; forward; ************************************************************* MODIFY_FILE ************************************************************* PURPOSE: INPUTS: OUTPUTS; NOTES: To simply increment count_lamda from the input s t a r t i n g value up to the upper wavelength range l i m i t ( i . e . Up_lamda) and to c a l l procedure PICK_&_STORE between each increment. ( 1 ) count_lamda = the s t a r t i n g v alue which i s i s set i n procedure MODIFY_DATA (2 ) Up_Lamda = the maximum wavelength. Count_lamda w i l l be incremented up to t h i s v a l u e . (3) D e l t a = i s the increment added to count_lamda to f i n d the next data p o i n t . D e l t a i s set i n procedure MODIFY_DATA. New count_lamda values f o r PICK_&_STORE. (1 ) T h i s procedure i s c a l l e d by MODIFY_DATA. ( 2 ) T h i s procedure c a l l s PICK AND STORE. ************************************************************* Procedure Modify_File(count_lamda,Up_lamda,delta: r e a l ) ; 82 forward; |************************************** { MODIFY_DATA } ********************************** { PURPOSE: To c a l c u l a t e the a p p r o p r i a t e data p o i n t } { increment ( = d e l t a ) f o r count_lamda. } { DESCRIPTION: Using the data input from procedure RANGE } ( i . e . Up_lamda and Low_lamda) i t decides in } what area the data p o i n t s are i n (e.g. v i s i b l e } or i n f r a r e d or both) and then f i n d s the } a p p r o p r i a t e data poin t increment (= d e l t a ) . } F i n a l l y procedure MODIFY_FILE i s c a l l e d f o r } each l a y e r . } Up_lamda, low_lamda, v i s _ s p a c i n g and } i r _ s p a c i n g from procedure RANGE. } De l t a = the increment f o r count_lamda. } (1) T h i s program d i v i d e s the range of i n t e r e s t } i n t o the v i s i b l e (3000-10000 angstroms) } and the i n f r a r e d (10000-50000 angstorms) } because the t r a n s m i s s i o n curves of the } v i s i b l e vary q u i c k l y ( i . e . i n t e r f e r e n c e } f r i n g e s ) where as the IR curves do not. } T h i s allows the user to see more T/R } d e t a i l s on one p l o t . } (2) T h i s procedure c a l l MODIFY_FILE. } (3) T h i s procedure i s c a l l e d by procedure } GET_DATA_FROM_FILES. } *************************************************************** Segment 'Procedure S_Modify_data; var delta,waves: r e a l ; {waves = a dummy v a r i a b l e used only i f } {plot i s e n t i r e l y i n IR, want to set } {pointer i n dat to r i g h t p o s i t i o n . } {delta = the increment of count_lamda. } Begin { A l l of the T/R p o i n t s are i n the v i s i b l e . } i f (low_lamda < 1.0e4) and (up_lamda <= 1.0e4) then begin f o r m := 1 to (tot_num_lay + 1) do begin wave := 0.25e4; i := 0; INPUTS: OUTPUTS: NOTES: 83 j := 0; d e l t a :=(up lamda - l o w _ l a m d a ) / v i s _ s p a c i n g ; modi f y _ f i l e T l o w _ l a m d a , u p _ l a m d a , d e l t a ) ; end; {for m} end; { i f in v i s i b l e } { A l l of the T/R p o i n t s to be c a l c u l a t e d in the i n f r a r e d . i f (low_lamda >= 1.0e4) and (up_lamda > 1.0e4) then begin f o r m := 1 to (tot_num_lay + 1) do begin j := 0; d e l t a :=(up_lamda - low_lamda)/ir_spacing; { A l l the data in a r r a y DAT w i l l u s u a l l y have data {in the v i s i b l e r e g i o n . The a r r a y p o i n t e r w i l l { s t a r t at the s m a l l e s t wavelength f o r each l a y e r , { t h i s w i l l i n general not be the s m a l l e s t IR {wavelength so the p o i n t e r must be advanced to {r i g h t spot i n a r r a y . repeat j:= j + 1; wave := dat[m,3,j]; u n t i l (wave >= low_lamda); wave := 0.25e4; i := 0; modi f y _ f ile(low_lamda,up_lamda,delta); end; {for m} end; { i f i n IR} {The T/R data p o i n t s are to be c a l c u l a t e d i n both the } { v i s i b l e and i n f r a r e d r e g i o n s . Thus two D e l t a s must be } { c a l c u l a t e d , one f o r each r e g i o n . } i f (low_lamda < 1.0e4) and (up_lamda > 1.0e4) then begin f o r m := 1 to (tot_num_lay + 1) do begin wave := 0.25e4; i:= 0; j := 0; delta:= (I.0e4 - low_lamda)/vis_spacing; m o d i f y _ f i l e ( l o w _ l a m d a , 1 . 0 e 4 , d e l t a ) ; d e l t a := (up_lamda - 1.0 e 4 ) / i r _ s p a c i n g ; m o d i f y _ f i l e ( 1 . 0 e 4 + d e l t a , u p _ l a m d a , d e l t a ) ; end; {for m} end; { i f i n both IR and v i s i b l e } end; {modify data} 84 Segment Procedure S _ G e t _ d a t a _ f r o m _ f i l e ; var go_on : boolean; {is true as long as end of f i l e (eof) {has not been reached. n_val,k_val,wave v a l : r e a l ; {values read from the flopp y TDATA: m 0 , j 0 , l o w , m 1 : i n t e g e r ; {array and FOR loop dummy {index v a r i a b l e s . respond2,respond 1 : char; {responses to a m i s s p e l l e d {layer name. begin low := 1; {Obtain data from a new l a y e r . } for m:= 1 to (num_lay_with_no_data + 1) do begin {Get a l l the data f o r t h i s l a y e r . } for mO := low to (layer_with_own_data[ml] - 1) do begin { $ 1 - } r e s e t ( a l l _ l y r s _ d a t , c o n c a t ( ' D a t a : ' , name[mO],' .text') ); {Filename, name[mO], e x i s t s on flopp y DATA: so } {enter o p t i c a l d a t a . } i f i o r e s u l t = 0 then begin {$1 + } j 0 : = 0 ; go_on := t r u e ; while go_on do begin r e a d l n ( a l l _ l y r s _ d a t , w a v e _ v a l , n _ v a l , k _ v a l ) ; j 0 : = j 0 + 1 ; d a t [ m 0 , 1 , j 0 ] := n_val; dat[mO ,2,jO] :=k_val; dat[mO ,3,jO] := wave_val; {Check to see i f f i r s t wavelength } {entered i s grea t e r than low_lamda. If } {t h i s i s t r u e then a d j u s t the range. } i f ( ( J 0 = 1 ) and (wave_val > low_lamda)) then low__lamda := wave_val; {Check to see i f the l a s t wavelength } {entered i s l e s s than Up_lamda. I f t h i s } {is t r ue then a d j u s t range. } 85 i f (up_lamda <= wave_val) or ( e o f ( a l l _ l y r s _ d a t ) ) then go_on := f a l s e ; i f e o f ( a l l _ l y r s _ d a t ) = t r u e then up_lamda := wave_val; end; {while not eof} c l o s e ( a l l _ l y r s _ d a t , n o r m a l ) ; end {if i o r e s u l } {The filename namefmO] i s not on d i s c DATA:.} {Perhaps the name i s m i s s p e l l e d . } e l s e begin {$1 + } .w r i t e l n ; w r i t e ( ' No data e x i s t s f o r a f i l e c a l l e d ' ) ; writeln(name[mO]);. w r i t e l n ; write('Do you want to see a l i s t of the f i l e s a v a i l a b l e {y/n}? 1 ) ; readln(respond 1); i f respondl = *y' then begin r e s e t (store_name,.' d a t a : d i s p l a y . t e x t ' ); while not eof(store_name) do begin readln(store_name,str_name); w r i t e l n ( s t r _ n a m e ) ; end; {while} close(store_name,normal); end; { i f respondl = yes} w r i t e l n ; w r i t e l n ( ' Do you want to r e s p e l l t h i s f i l e name {y/n} ? ' ) ; w r i t e ( ' N w i l l e x i t you from the program ' ) ; readln(respond2); i f respond2 = 'y' then begin w r i t e l n ; w r i t e ( ' e n t e r new name ' ) ; readln(name[mO]); mO := mO - 1; end { i f respond2} e l s e e x i t ( p r o g r a m ) ; end; { i f e l s e i o r e s u l t } end; {for mO loop} low := layer_with_own_data[m] + 1; end; {for m loop} s modify_data end; Tget_data} 86 Procedure Int_From_Table_For_n_k; var n1, n2,k1,k2,slope_n,slope_k,wave 1,wave2 : r e a l ; v a l _ n , v a l _ k : r e a l ; begin n2 : = dat[m,1,j]; n 1 := dat[m,1,j -1 ]; k1 := dat[m,2,j-1]; k 2 := da t[m,2,j ]; wavel := dat[m,3,j-1 ]; wave2 := dat[m,3,j]; v a l _ k := (1 .0e4 * (k2 - k1 ) ) ; v a l _ n := (1.0e4 * (n2 - n i ) ) ; {n and k values are the same f o r two c o n s e c u t i v e values } {in DAT. No i n t e r p o l a t i o n i s needed i n t h i s case. } i f ( abs(val_n) <= 0.01) and (abs(val_k) <= 0.01) then begin n : = n 1 ; k : = k 1 ; end { i f } e l s e begin {Two co n s e c u t i v e n v a l u e s i n DAT are the same. Thus } {we need only i n t e r p o l a t e k v a l u e s . } i f (abs(val_n) <= 0.01) and (abs(val_k) >= 0.01) then begin slope_k := (wave2 - wave 1 ) / ( v a l _ k ) ; k := kl + 1e~4 * (count_lamda - wave 1)/slope_k; n : = n 1 ; end; { i f only n2=nl} {Two co n s e c u t i v e k valu e s i n DAT are the same. Thus,} only the n values need i n t e r p o l a t i o n . } i f ( abs(val_k) <= 0.01) and (abs(val_n) >= 0.01) then begin slope_n := (wave2 - wave 1 ) / ( v a l _ n ) ; n := m + le~4 * (count_lamda - wave 1)/slope_n; k : = k 1 ; end; { i f only k2-k1 =0} { I n t e r p o l a t i o n must be done on both n and k v a l u e s . } i f ( abs(val_k) >= 0.01) and (abs(val_n) >= 0.01 ) then begin slope_k := (wave2 - w a v e l ) / ( v a l _ k ) ; slope_n := (wave2 - w a v e l ) / ( v a l _ n ) ; k := k1 + 1e-4 * (count_lamda - wave 1)/slope_k; n := n1 + 1e-4 * (count_lamda - wave 1)/slope_n; end; {neither a r e 0} 87 end; { i f else} end; { i n t e r p o l a t e from t a b l e f o r n and k} Procedure Pick_and_Store; var n,k : r e a l ; begin {Step through the wavelengths of la y e r m u n t i l wave > } {count_lamda. T h i s c o n d i t i o n must occur f o r proper } { i n t e r p o l a t i o n . } i f count_lamda > wave then begin repeat j : = j + 1 ; wave := dat[m,3,j]; u n t i l (wave >= count_lamda) or (abs(wave-count_lamda) <= 1e-3); {The wavelengths are d i f f e r e n t so i n t e r p o l a t e . } i f wave > count_lamda then begin int_from_table_for_n_k(count_lamda, n, k); i := i + 1 ; datafm,1 , i ] := n; datafm,2, i ] := k; lamdati] := count_lamda; end {The wavelengths are equal so we have a data p o i n t at} {at wavelength, wave. } e l s e begin i := i + 1; data[m,1,i] := dat[m,1,j]; data[m,2,i] := dat[m,2,j]; lamdati] := dat[m,3,j]; end; { i f e l s e } end {if} {Count_lamda < wave. So we a l r e a d y have the r i g h t } {c o n d i t i o n s f o r i n t e r p o l a t i o n . } e l s e begin i f wave > count_lamda then begin int_from_table_for_n_k(count_lamda,n,k); i : = i + 1; 88 data[m,1,i] := n; data[m,2,i] := k; lamda[i] := count_lamda; end e l s e begin i : = i + 1 ; data[m,1,i] := dat[m,1,j]; data[m,2,i] := dat[m,2,j]; lamdafi] := dat[m,3,j]; end; { i f else} end; { i f e l s e count_lamda i s s t i l l < wave} End; {pick and Store} Procedure M o d i f y _ F i l e ; var d i f f : r e a l ; { d i f f i s needed because of round o f f e r r o r } Begin d i f f := up_lamda - count_lamda; while (count_lamda <= up lamda) or ( d i f f <= delta/1000.0) do begin pick_and_store(count_lamda); count_lamda := count_lamda + d e l t a ; d i f f := abs(up_lamda - count_lamda); end; {while} End; {modify data f i l e } Procedure Get_Data_From_File; Begin s _ g e t _ d a t a _ f r o m _ f i l e ; End;{get data from f i l e s } End. 89 UNIT_CALC_VALUE; '************************************************************* UNIT CALCULATE_VALUE ************************************** PURPOSE: To take the o p t i c a l data f o r a l l the l a y e r s , put n e a t l y i n t o a rray DATA by un i t SET_UP_DATA, and then proceed to f i n d a l l the matrix c o e f f i c i e n t s of each l a y e r . These l a y e r matrices are then m u l t i p l i e d together to form f i n a l c h a r a c t e r i s t i c m a t r i c e s ; one on e i t h e r s i d e of the s u b s t r a t e . From these f i n a l m a t r i ces the t o t a l t r a n s m i s s i o n and r e f l e c t i o n (T/R) of elec t r o m a g n e t i c r a d i a t i o n (E.M.R.) i s found f o r each data p o i n t [6,8]. ************************************************************* NTERFACE ************************************************************* TOTAL TRANSMISSION AND REFLECTION ************* * * **************************** * * **************** PURPOSE: To c a l l a l l the procedures in t h i s u n i t and thus f i n d the t o t a l t r a n s m i s s i o n and r e f l e c t i o n c o e f f i c i e n t s f o r one data poi n t ( i . e . one wavelength value from a r r a y LAMDA). DESCRIPTION: F i r s t , each l a y e r s c h a r a c t e r i s t i c matrix i s m u l t i p l i e d together to obt a i n one c h a r a c t e r i s t i c matrix f o r each sid e of the su b s t r a t e (M[on i n c i d e n t s i d e ] and M[on t r a n s m i t t e d s i d e ] ) . Then the t o t a l T/R values are c a l c u l a t e d based on the f o l l o w i n g f i g u r e . M(inc) Substrate M(trans) I >> > >> T ( i n sub) -> >>• •> >> > > > T ( i n sub)xDecay x < << < R i R = R , + R; = T(out) T(out sub) = T < << <--R 2 I I >> > >>• << < ---<<< x T ( i n sub)xdecay 2xR 0 90 where } I = i n c i d e n t e l e c t r o m a g n e t i c r a d i a t i o n . } T = t o t a l t r a n s m i s s i o n of E.M.R through } the h e t e r o s t r u c t u r e . } R = t o t a l r e f l e c t i o n of E.M.R. o f f of the } h e t e r o s t r u c t u r e . R = R, + R 2 } R, = r e f l e c t i o n o f f of the substate - } "t r a n s m i t t e d " t h i n f i l m s i n t e r f a c e . Usually} a small percentage of R. } R 2 = r e f l e c t i o n o f f of the i n c i d e n t } l a y e r s - s u b s t r a t e i n t e r f a c e . The major " } component of R. } Decay = exp(-47rkt/X) = how much } the wave attenuates as i t propogates } through the s u b s t r a t e . } Remaining terms are s e l f explanatory from } the above p i c t u r e . } INPUTS: j = an in t e g e r index used i n a r r a y DATA to } obtai n the j t h data p o i n t . } OUTPUTS: tot_R = the t o t a l r e f l e c t a n c e of E.M.R., at one} wavelength, o f f of the h e t e r o s t r u c t u r e . } Represented by R i n the above f i g u r e . } tot_T = the t o t a l t r a n s m i s s i o n of E.M.R., at } "one" wavelength, through the } h e t e r o s t r u c t u r e . Represented by T i n the } above diagram. } CALC_AND_STORE_DATA c a l l s t h i s procedure } ( v i s _ s p a c i n g + i r _ s p a c i n g ) times. } Th i s procedrue c a l l s procedures. } SIMPLIFY_TO_1_MARIX, GET_n_and_k_VALUES, } FIND_THEATA, TRANSMITTANCE, REFLECTANCE. } *********************************** Procedure T o t _ t r a n s _ a n d _ r e f 1 ( j : i n t e g e r ; var t o t _ T , tot_R : r e a l ) ; IMPLEMENTATION Uses screen_ops, {$U cmplx_math.code} cmplx_math, {$U hyp_trig.code} h y p _ t r i g , {$U enter.code} e n t e r _ d a t a , {$U i n i t i a l i z e . c o d e } i n i t i a l i z e _ s y s t e m , {$U get_data.code} set_up_data; NOTES: (1) (2) const n a i r = 1 . 0 ; 91 k a i r = 0 . 0 ; type mat_type4 = packed a r r a y [ l . . 5 ] of m_type; {Array that i s } {used to st o r e the c h a r a c t e r i s t i c l a y e r m a t r i c e s . } /*************************************************************} { GET_n_and_k_VALUES } s * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * { PURPOSE: To obta i n the wavelength, n and k values f o r } { the mth l a y e r and the j t h data p o i n t i n that } { la y e r from a r r a y s DATA and LAMDA. } { INPUTS: m = an i n t e g e r index which r e p r e s e n t s the layer} { the l a y e r number i n ar r a y data. } {. j = on i n t e g e r index which r e p r e s e n t s the j t h } { data p o i n t i n array data. } { OUTPUTS: The j t h data p o i n t wavelength, n and k values } { for l a y e r m. } { NOTES: T h i s procedure i s c a l l e d by procedures } { FIND_MATRIX_COEFF, and TOT_TRANS_AND_REFL. } I*************************************************************] Procedure Get_n_and_k_values(m,j : i n t e g e r ; var wavelength,n,k: r e a l ) ; forward; t * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ] { FIND_THEATA } (*************************************************************) PURPOSE: To f i n d the c o s i n e of complex angle ^ which i s used i n f i n d i n g the c o e f f i c i e n t s of each l a y e r s c h a r a c t e r i s t i c matrix. DESCRIPTION: Using the technique o u t l i n e d i n ref e r e n c e 2. St a r t with complex S n e l l ' s law: n 0 s i n (8) = ri^ s i n (<p) = (n - i k ) s i n ( ^ ) Assume a complex 0 = ^  and co r r e s p o n d i n g l y a complex s i n ^ ) s i n ( ^ ) = S' + i S " From S n e l l s law S' = n n s i n ( f l ) x n n 2 + k 2 S" = nnsin(c?) x k n 2 + k 2 92 s i m i l a r i l y c o s ( ? ) = C + i C " C =JP + /p 2 +_Q_2'' where: P = 1 - S ' 2 + S " 2 = C ' 2 Q = -2S'S" = 2C'C" + C " 2 INPUTS OUTPUTS: NOTES m = an i n t e g e r index r e p r e s e n t i n g the l a y e r number of a r r a y data. i = an i n t e g e r index r e p r e s e n t i n g the i t h data p o i n t i n a r r a y data. The c o s ( ^ ) where "f> i s a complex angle. (1) T h i s procedure i s c a l l e d by procedures FIND MATRIX COEFF and TOT TRANS AND REFL. *************************************** Procedure Find_Theata(i,m : i n t e g e r ; var c : c _ t y p e ) ; forward; ************************************************************* FIND_MATRIX_COEFFICIENTS ************************************************************* PURPOSE: To f i n d the matrix c o e f f i c i e n t s of each t h i n f i l m l a y e r , f o r the j t h data p o i n t , and s t o r e these v a l u e s i n array matrixfm]. DESCRIPTION: The f o l l o w i n g equations were used to c a l c u l a t e the matrix c o e f f i c i e n t s [10]: The j t h f i l m can be represented by the c h a r a c t e r i s t i c matrix M; = cos(5 j ) i s i n ( 6 ; )/U; iUj s i n ( 6 j) cost 6;) a i a 2 a 3 a a with cos(0 (. ) ^ p a r a l l e l p o l a r i z a t i o n (P) 93 U;= < .rijX c o s ( 0 j ) p e r p e n d i c u l a r (S) nt - i ( k t ) = 2 7 r ( n - i k ) t i c o s ( 0 j )/X S i m p l i f y i n g the above equations g i v e s the c o e f f i c i e n t s of the mth matrix.: a, = a, = c o s ( n t ) c o s h ( k t ) + i s i n ( n t ) s i n h ( k t ) a 2 = ( c o s ( n t ) s i n h ( k t ) + i s i n ( n t ) c o s h ( k t ) ) / U a, = U( c o s ( n t ) s i n h ( k t ) + i s i n ( n t ) c o s h ( k t ) ) INPUTS: j = an int e g e r index r e p r e s e n t i n g the j t h data p o i n t in arr a y data. OUTPUTS: The matrix c o e f f i c i e n t s of each t h i n f i l m l a y e r f o r the j t h data p o i n t ( i . e . matrix[m]). NOTES: (1) T h i s procedure i s c a l l e d by procedure SIMPLIFY_TO_1_MATRIX. (2) T h i s procedure c a l l s procedures CMPLX_DIV CMPLX_MULT, GET_N_AND_K, and FIND_THEATA. ************************************ *'* * * Segment Procedure F i n d _ M a t r i x _ C o e f f s ( j : i n t e g e r ; var matrix: mat_type4); const p i = 3.141592654; var w,nt,kt : r e a l ; {w = v a r i a b l e r e p r e s e n t i n g p a r t of eq. 6 {which i s d e f i n e d above. {nt and kt = represent the r e a l and {imaginary p a r t s of 6. wavelength,n,k : r e a l ; { O p t i c a l data v a r i a b l e s , x : r e a l ; {dummy v a r i a b l e m,l : i n t e g e r ; {index v a r i a b l e s n1,n2,c,temp,U : c_type; {C = the cosine of complex {U = depends on p o l a r i z a t i o n of E.M.R.; {defined above. Begin f o r m:= 1 to tot_num_lay do begin get_n_and_k values(m,j,wavelength,n,k); With matrixTm] Do Begin w:= (2 * p i * thick[m])/wavelength; n 1 . r e : = n; n1.im := -k; f i n d _ t h e a t a ( j , m , c ) ; cmplx_mult(c,n1,n2); {Incident E.M.R. i s p o l a r i z e d p e r p e n d i c u l a r to the} 94 {plane of i n c i d e n c e . } i f angle_ans = 's' then cmplx_mult(c,n1,U) {Incident E.M.R. i s p o l a r i z e d p a r a l l e l to the plane} {of i n c i d e n c e . } e l s e cmplx_div(n1,c,U); nt:= n2.re * w; {These next s i x l i n e s are r e q u i r e d s i n c e the} {cos/sin/tan of any angle g r e a t e r than 2 x ir w i l l } {cause a run time e r r o r f o r t h i s o p e r a t i n g system. } 1:= 0; repeat 1 : = 1 + 1 ; x:= 1 * 2 * p i ; u n t i l x >= nt; nt := nt - (x - (2 * p i ) ) ; kt:= -n2.im * w; {With equation 8 now d e f i n e d , work out the matrix} { c o e f f i c i e n t s as d e f i n e d i n DESCRIPTION above. } a1.re:= co s ( n t ) * c o s h ( k t ) ; a4 . re:= a 1 . r e ; temp.re:= co s ( n t ) * s i n h ( k t ) ; temp.im:= s i n ( n t ) * c o s h ( k t ) ; cmplx_divsn(temp,U,a2); a1.im:= s i n ( n t ) * s i n h ( k t ) ; a4.im:= a 1.im; cmplx_mult(U,temp,a3); end; {with} end; {for m} End; ""{find matrix c o e f f s } Procedure Get_n_and_k_values; Begin n := datatm,1,j]; k := data[m,2,j]; wavelength := l a m d a [ j ] ; End; {get_n_&_k_values} Procedure Find_Theata; var s : c_type; { v a r i a b l e s d e f i n e d above. } p,q,denom,x,diff : r e a l ; 1 : i n t e g e r ; 95 Begin {The f o l l o w i n g s i x steps are needed because t h i s } {operating system can not take the c o s / s i n / t a n of any } {angle gr e a t e r than 2ir. } 1 := 0; repeat 1 := 1 + 1; x := 6.283 * 1; u n t i l x >= theata; theata := theata - (x - 6.283); {Find the cosine of complex <fr as d e f i n e d by the equations} {in s e c t i o n DESCRIPTION above. } denom := sqr(data[m,1,i]) + s q r ( d a t a [ m , 2 , i ] ) ; s.re := ( n a i r * s i n ( t h e a t a ) * data[m,1,i])/denom; s.im := ( n a i r * s i n ( t h e a t a ) * data[m,2,i])/denom; p := 1 - s q r ( s . r e ) + s q r ( s . i m ) ; q := -2 * s.re * s.im; e r e := s q r t ( ( p + s q r t ( s q r ( p ) + s q r ( q ) ) ) / 2 ) ; {These steps are r e q u i r e d because round o f f e r r o r . } d i f f := ((-p + s q r U s q r (p) + s q r ( q ) ) ) / 2 ) ; i f d i f f <= 0.0001 then d i f f := 0.0; c.im := - s q r t ( d i f f ) ; End; { f i n d theata} * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * SIMPLIFY_TO_ONE_MATRIX } *************************************************************] PURPOSE: To m u l t i p l y a l l the complex l a y e r m a t r i c e s } together on each s i d e of the s u b s t r a t e ; and } ret u r n one matrix f o r each sid e of the } s u b s t r a t e . I f there are no t h i n f i l m s on one } si d e of the s u b s t r a t e then the i d e n t i t y matrix } i s returned f o r that s i d e . } DESCRIPTION: The complete m u l t i l a y e r t h i n f i l m s t r u c t u r e on "one" s i d e . o f the s u b s t r a t e can be represented by the product matrix M. e.g. M = M,M2...M M(inc) = a 2 a 3 a 1 a 2 a 3 ai, 96 j = an i n t e g e r index r e p r e s e n t i n g the j t h data } p o i n t . } ma t r i x _ i n c = f i n a l product matrix of each } i n d i v i d u a l l a y e r matrix on the s u b s t r a t e } sid e which has the i n c i d e n t E.M.R. } ma t r i x _ t r a n s = the f i n a l product matrix of each} i n d i v i d u a l l a y e r matrix on the s u b s t r a t e } sid e o p p o s i t e of the s i d e which has the } i n c i d e n t E.M.R. } (1) T h i s procedure i s c a l l e d by TOT_TRANS_&_REF} (2) T h i s procedure c a l l s MULT_MATRIX and } FIND_MATRIX_COEFFS. } ************************************ Procedure Smplfy_to_1 Mat(j : i n t e g e r ; var m a t r i x _ i n c , m a t r i x _ t r a n s : m_typeT; var m : i n t e g e r ; matrix : mat_type4; Begin f i n d _ m a t r i x _ c o e f f s ( j , m a t r i x ) ; {No t h i n f i l m s on the s u b s t r a t e s i d e which has the} {in c i d e n t E.M.R. } i f num_lay_on_inc = 0 then begin with m a t r i x _ i n c do begin a1 . re • — • 1 a1 . im < — * 0 a2. re » — « 0 a2. im • — • 0 a3. re • — • 0 a3. im • 0 a4. re • — • 1 a4. im • 0 end; { i f no l a y e r s on inc side} end { i f a l l l a y e r s on other side} e l s e INPUTS: OUTPUTS: NOTES: {Some t h i n f i l m s are on the s u b s t r a t e s i d e which has } {the E.M.R. S i m p l i f y to one matrix. } begin for m := 1 to (num_lay on_inc - 1) do mult_matrix(matrix [mT,matrix[m+1],matrix[m+1]); with m a t r i x _ i n c do begin a l . r e := matrix[num_lay_on_inc].a 1.re; 97 a1 . im := matrix[num l a y _ _on_ i n c \ .a 1 . im; a2. re := matr ix[num l a y _on_ i n c ] .a2. r e ; a2. im := matrix[num_ > y l 'on_ i n c \ .a2. im; a3. re := matrix[num l a y _ _on_ i n c \ . a3. r e ; a3. im := matrix[num l a y _ _on_ i n c j .a3. im; a4. re : = ma t r i x [ n urn l a y _ _on_ i n c ] .a4. r e ; a4. im := matrixfnum l a y _ on_ i n c ] .a4. im; d; {wi th} end; { i f e l s e } {No t h i n f i l m s on the s u b s t r a t e s i d e which does "not" {have the i n c i d e n t E.M.R. i f num_lay_on_inc = tot_num_lay then begin w i t h m a t r i x _ t r a n s do be g i n a 1.re := 1; a 1 . i m : = 0; a2.re := 0; a2.im := 0; a3.re := 0; a3.im := 0; a4.re := 1; a 4 . i m : = 0 ; end; { i f a l l l a y e r s on i n c s i d e } end { i f } {Some t h i n f i l m s a r e on both s i d e s of the s u b s t r a t e . { S i m p l i f y the m a t r i c e s on the s u b s t r a t e s i d e which {does not have the i n c i d e n t E.M.R. t o one m a t r i x . e l s e b e g i n f o r m := (num l a y _ o n i n c + 1) t o (to t _ n u m _ l a y - 1) do mult_ma t r i x T m a t r i x T m ] , m a t r i x [ m + 1 ] , m a t r i x [ m + 1 ] ) ; w i t h m a t r i x _ t r a n s do b e g i n a l . r e := m a t r i x [ t o t _ n u m _ l a y ] . a l . r e ; a l . i m := m a t r i x [ t o t _ n u m _ l a y ] , a 1 . i m ; a 2 . r e := m a t r i x [ t o t _ n u m _ l a y ] , a 1 . r e ; a2.im := m a t r i x [ t o t _ n u m _ l a y ] . a 2 . i m ; a 3 . r e := m a t r i x f t o t _ n u m _ l a y ] . a 3 . r e ; a3.im := m a t r i x [ t o t _ n u m _ l a y ] . a 3 . i m ; a 4 . r e : = . m a t r i x [ t o t _ n u m _ l a y ] . a 4 . r e ; a4.im := m a t r i x [ t o t _ n u m _ l a y ] . a 4 . i m ; end; {with} end; { i f e l s e } end; { s i m p l i f y t o one m a t r i x } ************************************* 98 REFLECTANCE } *************************************** PURPOSE: To use the f i n a l c h a r a c t e r i s t i c product } matrices and the r e f l e c t a n c e formula below } to c a l c u l a t e the t o t a l r e f l e c t a n c e of E.M.R } o f f of the h e t e r o s t r u c t u r e at one wavelength. } DESCRIPTION: The f o l l o w i n g formulas were used [1] } r = n 0 c o s ( f l ) ( a 1 + a 2-ffc cos ( ) - a 3 - a nf?^  cos (<ftp)} n 0 c o s ( f i ) (a, + a ^  cos (<tg ) + a3 + a« f f s'cos(^l } R = | r | 2 } W = The f i n a l product matrix f o r one s i d e of } the s u b s t r a t e . } pf = n ' O c o s ( 6 ) tor } the f i r s t l a y e r ( e i t h e r a i r or s u b s t r a t e ) . } If i t s the s u b s t r a t e 8 w i l l be complex. } p i = n cos(<£) f o r the l a s t l a y e r } ( e i t h e r a i r or s u b s t r a t e depending on the } d i r e c t i o n of the i n c i d e n t E.M.R. <j> may } be complex. } r e f l e c = i s the t o t a l r e f l e c t a n c e of E.M.R. } at one wavelength o f f of the h e t e r o s t r u c t u r e . } (1) This procedure i s c a l l e d by TOT_TRAN_&_REF} (2) T h i s procedure c a l l s the ba s i c complex } a r i t h m e t i c procedures. } {*************************************************************! Procedure Reflectance(w: m_type;pf,pl:c_type;var r e f l e c : r e a l ) ; var tempi,temp2,numerator,denom,ref1: c_type; Begin With w Do Begin cmplx_mult(a2,pl,tempi); cmplx_add(a1,tempi,tempi); cmplx_mult(pf,tempi,temp2); cmplx_sub(temp2,a3,numerator); cmplx_mult(a4,pi,tempi); cmplx_sub(numerator,tempi,numerator); cmplx_add(temp2,a3,denom); cmplx_add(denom,tempi,denom); cmplx_divsn(numerator,denom,ref1); r e f l e c : = s q r ( r e f l . r e ) + s q r ( r e f 1 . i m ) ; End; {with} End; {reflectance} INPUTS: OUTPUTS: NOTES: 99 **************************************** TRASMITTANCE ************************************************************* PURPOSE: To use the product l a y e r m a t r i c e s and the formulas l i s t e d below t o c a l c u l a t e the t o t a l t r a n s m i s s i o n of E.M.R. through the h e t e r o s t r u c t u r e f o r one wavelength. DESCRIPTION: The f o l l o w i n g formulas were used i n the c a l c u l a t i o n of T [10]: t = 2n 0cos( 6)  n o c o s ( 0 ) ( a , + a j - n ^ c o s ^ ) + a 3 + a , 1 ^ c o s ( ^ T = -f^cosUc) |t [ 2 riocos (6) INPUTS: W,pf,pl = see procedure r e f l e c t a n c e f o r a v e r b a l d e s c r i p t i o n . OUTPUTS: Transmitt = the t o t a l t r a n s m i s s i o n through the l a y e r s of i n t e r e s t . E.g. a i r / p r o d u c t matrix/sub outputs the t r a n s m i s s i o n INTO the su b s t a t e . NOTES: T h i s procedure i s c a l l e d by TOT_TRANS_AND_REFL ************************************************************* Procedure Transmittance(w: m_type;pf,pl: c_type; var tr a n s m i t : r e a l ) ; var tempi,temp2,temp3,numerator,denom,tra: c_type; Begin With w Do Begin Cmplx_add(pf,pf,numerator); cmplx_mult(a2,pi,tempi); cmplx_add(a 1,tempi,temp2); cmplx_mult(a4,pl,tempi); cmplx_add(a3,tempi,denom); cmplx_mult(pf,temp2,tempi); cmplx_add(tempi,denom,denom); cmplx_divsn(numerator,denom,tra); transmit:= ( s q r ( t r a . r e ) + s q r ( t r a . i m ) ) * ( p i . r e ) / p f . r e ; End; {with} End; {transmittance} Procedure Tot_Trans_and_Ref1; const 100 p i = 3.141592654; var matrix _ i n c , m a t r i x _ t r a n s : m_type; n_sub,k_sub wavelength alpha major_ref r e a l ; r e a l ; r e a l ; r e a l : t rans_out_sub,trans_in_sub,decay p1,p3,c c_type; The f i n a l product matrices f o r e i t h e r s i d e of the s u b s t r a t e See the f i g u r e i n s e c t i o n DESCRIPTION above. The r e f r a c t i v e index of the s u b s t r a t e . The a b s o r p t i o n c o e f f i c i e n t d e f i n e d by] a = 47rk/X The major component of R; d e f i n e d as R 2 i n the f i g u r e that i s i n s e c t i o n DESCRIPTION, r e a l ; {Defined i n s e c t i o n DESCRIPTION above. p1 = n ( a i r ) c o s ( 0 ) p3 = n ° (sub)cos (<j>) c = cos (<j> ° ) Begin s m p l f y _ t o _ 1 _ m a t ( j , m a t r i x _ i n c , m a t r i x _ t r a n s ) ; get_n_and_k_values(tot_num l a y 1,j,wavelength,n_sub,k_subT; p1.re:= n a i r * c o s ( t h e a t a ) ; p1.im:= - k a i r * c o s ( t h e a t a ) ; f i n d _ t h e a t a ( j , t o t _ n u m _ l a y + 1,c); p3.re:= n_sub * e r e ; p3.im:= -k_sub * c.im; t r a n s m i t t a n c e ( m a t r i x _ i n c , p 1 , p 3 , t r a n s _ i n _ s u b ) ; transmittance(matr ix_trans,p3,p1,trans_out_sub) alpha:= 4 * p i * k_sub/wavelength; alpha := -alpha * thick[tot_num_lay + 1 ] / C ; i f alpha < -9 then decay := 0 e l s e decay := exp(alpha); trans_in_sub:= t r a n s _ i n _ s u b * decay; t o t _ T := t r a n s _ i n _ s u b * trans_out_sub; r e f l e c t a n c e ( m a t r i x _ t r a n s , p 3 , p l , t o t _ R ) ; tot_R := tot_R * decay * t r a n s _ i n _ s u b ; t r a n s m i t t a n c e ( m a t r i x _ i n c , p 3 , p 1 , t r a n s _ o u t _ s u b ) ; tot_R := tot_R * trans_out_sub; r e f l e c t a n c e ( m a t r i x _ i n c , p 1 , p 3 , m a j o r _ R e f ) ; t o t R := tot_R + major_ref; end; T t o t a l E.M.R t r a n s m i i t e d & Reflected} End. 101 PROGRAM HETEROSTRUCTURE; f************************************************************* PROGRAM HETEROSTRUCTURE **************************************** PURPOSE: To c a l c u l a t e the t r a n s m i s s i o n / r e f l e c t i o n of electromagnetic r a d i a t i o n , f o r a range of wavelengths(i.e. v i s i b l e and/or IR) through/off of some d e f i n e d h e t e r o s t r u c t u r e . T h i s i s accomplished by the main program which c a l l s procedures: START = user e n t e r s a l l important o p t i c a l data about a h e t e r o s t r u c t u r e . GET_DATA_FROM_FILES = The r e f r a c t i v e index data fo r each l a y e r i s loaded i n t o the program. CALC_AND_STORE = The T/R curves are c a l c u l a t e d for .a wavelength range and st o r e d on d i s c DATA:. PLOT_RESULT = these T/R curves are p l o t t e d on the t e r m i n a l . The above h e t e r o s t r u c t u r e data can then be a l t e r e d and the above procedures repeated. ************************************************************* uses screen_ops, {$U g r a p h i c . l i b r a r y } p l o t _ g r a p h i c s , {$U cmplx_math.code} cmplx_math, ($U hyp_trig.code} h y p _ t r i g , {$U enter.code} e n t e r _ d a t a , {$U i n i t i a l i z e . c o d e } i n i t i a l i z e , ($U p l o t _ r s l t . c o d e } p l o t _ t h e _ r e s u l t , {$U calc.code} c a l c _ v a l u e , {$U get_data.code} set_up_data; var a _ o p t _ t h i c k :mat_type1; {Stores the t h i c k n e s s e s of a l l {the l a y e r s which give {T/R curves c l o s e s t to {max_val. b _ o p t _ t h i c k :mat_type1; {Stores a l l the l a y e r t h i c k n e s s e s {which maximize the {T/R c u r v e s . c _ o p t _ t h i c k :mat_type1; {Stores a l l the l a y e r t h i c k n e s s e s {which minimze the {T/R curves. que : i n t e g e r ; {Is d e f i n e d i n procedure PLOT_RESULT. {************************************************************* { { INTEGRATE { 102 j * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * } { PURPOSE: To i n t e g r a t e the area under the T/R curves f o r } { a range of wavelengths. T h i s procedure i s only } { used when the user has entered a range of } { th i c k n e s s e s f o r each t h i n f i l m and wants the } { optimum ( i . e . maximum and minimum and max_val } { areas) T/R curves p o s s i b l e f o r some } { h e t e r o s t r u c t u r e . } { DESCRIPTION: The i n t e g r a t i o n of the T/R curve i s } { accomplished by using the t r a p e z o i d a l r u l e [3]:} { TRAP(h) = 0.5h{f(a) + f(b)} + Z f ( a + nh) } { with } { h = the width of each t r a p e z o i d . } { a,b = the lower and upper i n t e g r a l l i m i t s , } { r e s p e c t i v e l y . } { f ( x ) = the f u n c t i o n (T or R) f o r which the } { area i s being c a l c u l a t e d . } { TRAP(h) = the area of f(x)e{a,b} } { usin g t r a p e z o i d a l i n t e g r a t i o n . } { INPUTS: (1) low_lamda = lower bound f o r i n t e g r a l } { (2) up_lamda = upper bound f o r i n t e g r a l } { (3) spacing = the # of r e c t a n g l e s used between } { the lower and upper i n t e g r a l bounds. } { (4) low = dummy v a r i a b l e to insu r e the c o r r e c t } { T [ i ] / R [ i ] values are used. } { (5) f = the f u n c t i o n (T or R) for which the } { a r e a . i s being found. } { OUTPUTS: area = the area between the lower and upper } { wavelength bounds of f u n c t i o n f. } { NOTES: (1) T h i s procedure i s c a l l e d by CALC_AND_STORE } { only when the user wants the optimum T/R } { curves ( i . e . maximum/minimum/max_val areas)} I*************************************************************} Procedure Integrate(low_lamda,up_lamda : r e a l ; spacing,low : i n t e g e r ; f : mat_type2; var area: r e a l ) ; forward; f * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * { STORE_DATA } I * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ] { PURPOSE: To s t o r e the T/R/absorption (A) data on the } { fl o p p y DATA:; t h i s i s l a t e r r e t r i e v e d by } { PLOT RESULT. } 1 03 { DESCRIPTION: The maximum, minimum and max_val T data i s } { s t o r e d i n DATA: by d i f f e r e n t filenames. } { Depending on where t h i s procedure i s c a l l e d i n } { CALC_AND_STORE_DATA a d i f f e r e n t append } { l e t t e r i s passed to t h i s procedure (e.g. f o r } { maximum T append = a and the filename = } { DATA:hetroTa ). S i m i l a r l y f o r R and A. These } { filenames are then c r e a t e d on d i s c DATA: } { ( i . e . r e w r i t e ( f i l e l , D A T A : h e t r o T a ) ) and the data] { i s entered. Then the f i l e i s c l o s e d , to save } { t h i s data. } { INPUTS: (1) j = i s used i n c h a r ( j ) to pi c k out a } { c h a r a c t e r which appends t o a filename so } { that the max, min and max_val T/R/A curves} { are f i l e d under d i f f e r e n t filenames. } { (2) count = the t o t a l number of data p o i n t s , i t } { i s used as a counter. { (3) T,R,A = are the t o t a l t r a n s m i s s i o n , } { r e f l e c t i o n and a b s o r p t i o n values f o r one } { set of l a y e r t h i c k n e s s e s . } { OUTPUTS: The T/R/A data onto d i s c DATA: } { NOTES: (1) T h i s procedure i s c a l l e d by procedure } { CALC_AND_STORE_DATA. } I * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Procedure Store_Data(count,j : i n t e g e r ; T,R :mat_type2); forward; ************************************** CALCULATE AND STORE DATA *************************************** PURPOSE: To take the generated t r a n s m i s s i o n and r e f l e c t i o n data, from u n i t CALC_VALUE, and e i t h e r (1) s t o r e i t f o r a p l o t r o u t i n e ( t h i s case occurs when the user wants the T/R curves c a l c u l a t e d f o r onl y one t h i c k n e s s of each t h i n f i l m ) or (2) f i n d s the optimum T/R curves. The optimum T or R curves are found by i n t e g r a t i n g the T or R data f o r one set of l a y e r t h i c k n e s s e s and then s y s t e m a t i c a l l y v a r y i n g each l a y e r t h i c k n e s s and again i n t e g r a t i n g these new T/R cu r v e s ; T h i s i t e r a t i v e technique i s repeated u n t i l a l l the p o s s i b l e l a y e r t h i c k n e s s e s are t r i e d and the optimum T/R curves ( i . e . maximum, minimum and max_val areas) are found. 104 { DESCRIPTION: The user, in procedure START, e i t h e r { s p e c i f i e d a range of t h i c k n e s s e s f o r each { l a y e r or only one t h i c k n e s s f o r each l a y e r of { the h e t e r o s t r u c t u r e . If the user wanted the T/R { data c a l c u l a t e d f o r only one t h i c k n e s s of each { l a y e r , then the REPEAT-UNTIL loops of t h i s { procedure are only gone through once and the { T/R data i s s t o r e d immediately. If however, the { user wants the max. and min. T/R (and p o s s i b l y { to see of a c e r t a i n value of T/R can be { obtained = max_val) found f o r the { h e t e r o s t r u c t u r e then the range of t h i c k n e s s e s { entered i n procedure START are s y s t e m a t i c a l l y { t r i e d . For each new t h i c k n e s s the T/R data i s { c a l c u l a t e d and i n t e g r a t e d ; i t i s then compared { to see i f i t i s the max/min/max_val, i f so i t { i s s t o r e d , along with the a p p r o p r i a t e optimum { t h i c k n e s s e s on f l o p p y DATA: f o r procedure { PLOT_RESULT. { INPUTS: ' (1) The t r a n s m i s s i o n and r e f l e c t i o n data, { l a b e l e d t o t _ T and tot_R r e s p e c t i v e l y . { OUTPUTS: The optimum set of l a y e r t h i c k n e s s e s which { maximize & minimize & max_val the T/R curves { NOTES: (1) T h i s procedure c a l l s procedures STORE_DATA { and TOT_TRANS_AND_REFL. { (2) T h i s procedure i s c a l l e d by MAIN program. /************************************** Segment Procedure Calc_and_Store_data; var A,Ref,Tra : mat_type2; {Arrays which c o n t a i n the complete {absorption, r e f l e c t i o n and {transmission data f o r the {wavelength range of i n t e r e s t , {for "only" one set of { t h i c k n e s s e s . { i , j : i n t e g e r ; {Array and FOR loop index { v a r i a b l e s . { count : i n t e g e r ; {count = number of data p o i n t s { = v i s _ s p a c i n g + i r _ s p a c i n g + 1 { A l l i n t e g e r s from 1 to count {represent a wavelength data {point. { t o t _ T , t o t _ R : r e a l ; {Are the t o t a l t r a n s m i s s i o n and { r e f l e c t i o n r e s p e c t i v e l y ; f o r {one data p o i n t . See procedure {TOT_TRAN_AND_REFL. 1 05 { } area : r e a l ; {the area of a r r a y s TRA ar REF. } max, min, d i f f : r e a l ; {max = the maximum area obtained } {by i n t e g r a t i o n of TRA or REF } {curves. Used as an i n d i c a t o r to } {compare each s u c c e s s i v e } { c a l c u l a t i o n of TRA or REF and } {is set to the l a r g e s t v a l u e . } {min = the minimum area } {obtained by i n t e g r a t i o n of TRA } {or REF curves. Uses same } {technique as max above. } { d i f f = i s used to compare the } {area of TRA or REF curves with } {the user d e s i r e d area (max_val) } {and t r y to get the curve c l o s e s t } {to t h i s d e s i r e d value = } { d i f f - a rea. } { } value : r e a l ; { tolerance used i n d e c i d i n g i f } {any of the TRA or REF curve } {areas are c l o s e enough to } {max v a l ; must be with i n +/- 10% } { ~ } s_space : r e a l ; { } inc : mat_type1; {Array which c o n t a i n s the amount } {each t h i n f i l m l a y e r t h i c k n e s s } {is incremented. T h i s a r r a y i s } {set to zero i f only one } {thickness f o r each t h i n f i l m i s } {entered. } { } Begin que := 1 ; max := 0.0; min := 120e4; { C a l c u l a t e the t o l e r a n c e to which T/R curves areas must} {be before these curves w i l l be. s t o r e d on d i s c DATA:.} {Note that i f none of TRA and REF areas are equal to } {max_val +/- t o l e r a n c e then a message i s d i s p l a y e d on the} {screen. See procedure PLOT_RESULT. } value := (max_val + 0.1 * max_val) - (max_val - 0.1 * max_val); {A range of t h i c k n e s s e s has been entered; c a l c u l a t e the} {thickness increment f o r each t h i n f i l e m . } i f responl = 'n' then begin f o r i := 1 to tot_num l a y do i n c [ i ] := ( t h i c k _ u p T i ] - t h i c k _ l o w [ i ] ) / p o i n t s ; end; { i f responl} 1 06 {Only one t h i c k n e s s f o r each t h i n f i l m has been e n t e r e d . } {Set a r r a y increment = 0 so a l l of the f o l l o w i n g } {REPEAT-UNTIL l o o p s are s k i p p e d . } i f r espon l = ' y ' then beg in f o r j := 1 to tot_num_lay do begin t h i c k _ l o w [ j ] := t h i c k f j ] ; t h i c k u p [ j ] := t h i c k f j ] ; i n c f j T := 0 . 0 ; end; { for j} end ; { i f respon1} t h i c k _ l o w [ t o t _ n u m _ l a y + 1] := t h i c k [ t o t _ n u m _ l a y + 1 ] ; t h i c k _ u p [ t o t _ n u m _ l a y + 1 ] := t h i c k [ t o t _ n u m _ l a y + 1 ] ; i nc [ to t_num_lay + 1] := 0; f o r j := ( tot_num_lay + 2) to 10 do beg in t h i c k _ l o w [ j ] := 0; t h i c k u p [ j ] := 0; i n c t j T := 0; end ; {for j} t h i c k t l O ] := t h i c k _ l o w [ 1 0 ] - i n c [ l 0 ] ; repeat t h i c k [ l 0 ] := t h i c k f l O ] + i n c f l O ] ; t h i c k [ 9 ] := t h i c k _ l o w [ 9 ] - i n c [ 9 ] ; repeat t h i c k [ 9 ] := t h i c k [ 9 ] + i n c [ 9 ] ; t h i c k [ 8 ] := t h i c k _ l o w [ 8 ] - i n c [ 8 ] ; repeat t h i c k [ 8 ] := t h i c k [ 8 ] + i n c [ 8 ] ; t h i c k [ 7 ] := t h i c k _ l o w [ 7 ] - i n c [ 7 ] ; repeat t h i c k [ 7 ] := t h i c k [ 7 ] + i n c [ 7 ] ; t h i c k [ 6 ] := t h i c k _ l o w [ 6 ] - i n c [ 6 ] ; repeat - t h i c k [ 6 ] := t h i c k [ 6 ] + i n c [ 6 ] ; t h i c k [ 5 ] := t h i c k _ l o w [ 5 ] - i n c [ 5 ] ; repeat t h i c k [ 5 ] := t h i c k [ 5 ] + i n c [ 5 ] ; t h i c k [ 4 ] := t h i c k _ l o w [ 4 ] - i n c [ 4 ] ; repeat t h i c k [ 4 ] := t h i c k [ 4 ] + i n c [ 4 ] ; t h i c k [ 3 ] := t h i c k _ l o w [ 3 ] - i n c [ 3 ] ; repeat t h i c k [ 3 ] := t h i c k [ 3 ] + i n c [ 3 ] ; t h i c k [ 2 ] := t h i c k _ l o w [ 2 ] - i n c [ 2 ] ; repeat t h i c k [ 2 ] := t h i c k [ 2 ] + i n c [ 2 ] ; t h i c k f l ] := t h i c k _ l o w [ l ] - i n c f l ] ; repeat t h i c k ! 1 ] := t h i c k [ l ] + i n c [ l ] ; count := ( v i s _ s p a c i n g + i r _ s p a c i n g + 1 ) ; f o r i := 1 to count do 1 07 begin t o t t r a n s _ a n d _ r e f 1 ( i , t o t _ T , t o t _ R ) ; T r a T i ] := t o t _ T ; R e f f i ] := tot_R; end; {for i} {A range of t h i c k n e s s e s has been } {entered so f i n d the max, min and } {max_val ar e a s . } i f responl = 'n' then begin i f (respon5 = 't') and (up_lamda > 1.0e4) then integrate(low_lamda, Ie4, v i s _ s p a c i n g + 1 , 1, T r a , a r e a ) ; i f (respon5 = 't') and (up_lamda <= 1.0e4) then integrate(low_lamda, up_lamda, v i s _ s p a c ing+1,1,tra,area); i f (respon5 = 'r') and (low_lamda > 1e4) then integrate(low_lamda, up_lamda, i r _ s p a c i n g , 1 , r e f , a r e a ) ; i f (respon5 = 'r') and (low_lamda <= 1e4) then integrate(1e4,up_lamda, i r _ s p a c i n g , v i s _ s p a c i n g + 1, r e f , a r e a ) ; {Compare TRA or REF area with} {max v a l ar e a . } i f (Tmax_val-0.1*max_val) < area) and(area< (max_val+0.1*max_val)) then begin d i f f := abs(max_val - a r e a ) ; i f d i f f < value then begin que:= 0; value := d i f f ; s t o r e data(count, 65, T r a , RefT; f o r i := 1 to tot_num_lay do a _ o p t _ t h i c k [ i ] : = t h i c k [ i ] ; end; { i f d i f f < value} end; { i f area i n range} {Is t h i s TRA or REF curve area } {the maximum area? i f so } {store i t on DATA: along with } {the c o r r e s p o n d i n g l a y e r } {th i c k n e s s e s . } i f area > max then begin max := area; 108 s t o r e _ d a t a ( c o u n t, 66, Tra, R e f ) ; fo r i := 1 to tot_num lay do b _ o p t _ t h i c k [ i ] : = t h i c k T i ] ; end; { i f area> max} {Is t h i s TRA or REF curve area} {the minimum area? I f yes } {then s t o r e i t on DATA: a long } {with the c o r r e s p o n d i n g } { layer t h i c k n e s s e s } i f area < min then begin s t o r e _ d a t a ( c o u n t, 67, Tra, R e f ) ; min := a r e a ; fo r i:= 1 to tot_num_lay do c _ o p t _ t h i c k [ i ] : = t h i c k [ i ] ; end; { i f area< min} end { i f responl = 'n ' } e l s e beg in s tore _ d a t a ( c o u n t,65,Tra,Ref); end; { i f e l s e response 1} u n t i l ( a b s ( t h i c k [1 ] - t h i c k _ u p [1]) < 1e-3) or ( t h i c k [1]> = thic.k_up[ 1 ]) and (tot_ n u m _ l a y • - 1 >= 0 ) ; u n t i l ( a b s ( t h i c k[2] - t h i c k _ u p[2]) < 1e-3) or ( th ick[2]>= t h i c k _ u p[2]) and (tot_ n u m _ l a y -2 >= 0); u n t i l ( a b s ( t h i c k [3] - th ick_up[3])<1e-3) or ( t h i c k[3] >= t h i c k up[3]) and (tot_num lay - 3 >= 0T; u n t i l ( a b s ( t h i c k l 4 ] - t h i c k _ u p[4]) < 1e-3) or ( t h i c k[4] >= t h i c k _ u p[4]) and (tot_num l a y -4 >= 0 ) ; u n t i l ( a b s(thickT5] - t h i c k _ u p[5]) < 1e-3) or ( t h i c k[5] >= t h i c k u p[5]) and (tot_num l a y - 5 >= 0T; u n t i l ( a b s ( t h i c k l 6 ] - t h i c k u p[6]) < 1e-3) or ( t h i c k[6] >= t h i c k _ u p T 6 ] ) and (tot_num l a y - 6 >= 0 ) ; u n t i l ( a b s(thickT7] - t h i c k up[7]) < 1e-3) or ( t h i c k[7] >= t h i c k _ u p T 7 ] ) and (tot_num l a y - 7 >= 0 ; u n t i l ( a b s ( t h i c k l 8 ] - t h i c k up[8]) < 1e-3) or ( t h i c k[8] >= t h i c k _ u p T 8 j ) and (tot_ n u m _ l a y -8 >= 0 ) ; u n t i l ( a b s ( t h i c k [ 9 ] - t h i c k _ u p [ 9 ] ) <1e-3) or ( t h i c k [ 9 ] >= t h i c k _ u p [ 9 ] ) and (tot_ n u m _ l a y - 9 >= 0 ) ; u n t i l ( a b s ( t h i c k [ 1 0 ] - t h i c k u p [ l 0 ] ) < 1e-3) or ( t h i c k [ 1 0 ] >= t h i c k _ u p T l 0 ] ) and (tot_ n u m _ l a y -109 10 >= 0 ; end; { c a l c u l a t e & s t o r e data} Procedure I n t e g r a t e ; var i : i n t e g e r ; {Index f o r FOR loop. } h : r e a l ; {Width of t r a p e z o i d . } Begin h := (up_lamda - low lamda)/spacing; area := 0.5 * h * ( f [ l o w ] + f T s p a c i n g ] ) ; for i := (low + 1) to (spacing - 1) do area := area + (h * f [ i ] ) ; End; {integrate} Procedure Store_Data; var append : s t r i n g [ 9 ] ; A : mat_type2; i : i n t e g e r ; f i l e 1 , f i l e 2 , f i l e 3 : f i l e of graph_data; r _ p l o t _ f i l e n a m e , t _ p l o t _ f i l e n a m e , a _ p l o t _ f i l e n a m e : s t r i n g ; c u r r _ d a t a : graph_data; Begin append := ' .data[2]'; append[l] := c h r ( j ) ; r _ p l o t _ f i l e n a m e : = concat('data:hetroR',append); r e w r i t e ( f i l e 1 , r _ p l o t _ f ilename); t _ p l o t _ f i l e n a m e : = concat('data:hetroT',append); r e w r i t e ( f i l e 2 , t _ p l o t _ f i l e n a m e ) ; a_plot_filename:= concat('datarhetroA',append); r e w r i t e ( f i l e 3 , a _ p l o t _ f ilename); f o r i := 1 to count do begin c u r r _ d a t a [ g r _ x _ d a t a ] := lamdafi] * 1e-4; c u r r _ d a t a [ g r _ y _ d a t a ] := R [ i ] ; f i l e l a := c u r r _ d a t a ; p u t ( f i l e 1 ) ; c u r r _ d a t a [ g r _ y _ d a t a ] := T [ i ] ; f i l e 2 a := c u r r _ d a t a ; p u t ( f i l e 2 ) ; A [ i ] := 1 - R [ i ] - T [ i ] ; c u r r _ d a t a [ g r _ y _ d a t a ] := A [ i ] ; f i l e 3 a := c u r r _ d a t a ; p u t ( f i l e 3 ); end; {for i} c l o s e ( f i l e l , l o c k ) ; c l o s e ( f i l e 2 , lock)"; c l o s e ( f i l e 3 , l o c k ) ; End; {store data on floppy} {MAIN PROGRAM uses a l l the procedures d e f i n e d p r e v i o u s l y to} { c a l c u l a t e the T/R data and p l o t i t one the s c r e e n . I t also} {allows the user to change any of the e x i s t i n g data and } 1 10 {rerun the program. } Begin {main program} i n t r o d u c t i o n ; s t a r t ; g e t _ d a t a _ f r o m _ f i l e s ; c a l c _ a n d _ s t o r e _ d a t a ; p l o t _ r e s u l t ( l o w _ l a m d a , up_lamda, r e s p o n l , a _ o p t _ t h i c k , b _ o p t _ t h i c k , c _ o p t _ t h i c k , q u e ) ; repeat s c _ c l r s c r e e n ; gotoxyTO,0); w r i t e l n('Do you want to a l t e r any of the c u r r e n t l y e x i s t i n g data and ' ) ; w r i t e ( ' r e r u n the program {y/n} ? ; n w i l l e x i t you from the program. ' ) ; r e a d l n ( r e s p o n d ) ; i f respond = ' y ' then begin repeat a l t e r _ d a t a ( a n s ) ; u n t i l ans in [ ' n ' ] ; s c _ c l r _ s c r e e n ; w r i t e l n ( ' T h i n k i n g ?! .... ' ) ; g e t _ d a t a _ f r o m _ f i l e s ; c a l c _ a n d _ s t o r e _ d a t a . ; p l o t _ r e s u l t ( l o w _ l a m d a , up_lamda, r e s p o n l , a _ o p t _ t h i c k , b _ o p t _ t h i c k , c o p t _ t h i c k , q u e ) ; end ; { i f respondT u n t i l respond = ' n ' ; End. {main} 111 UNIT PLOT_The_RESULT; {************************************************************* { UNIT PLOT_RESULTS ************************************************************** { PURPOSE: To p l o t the r e s u l t s of T/R/A data generated by { the program h e t e r o s t r u c t u r e . s * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * INTERFACE uses screen_ops, {$U enter.code} e n t e r _ d a t a , {$U i n i t i a l i z e . c o d e } i n i t i a l i z e ; !************************************************************* { PLOT_RESULT ?************************************************************* { PURPOSE:- To d i s p l a y a p l o t , on the t e r m i n a l , of the { t r a n s m i s s i o n and/or r e f l e c t i o n and/or { a b s o r p t i o n c h a r a c t e r i s t i c s of the user d e f i n e d { h e t e r o s t r u c t u r e . In a d d i t i o n , t h i s procedure { a l s o performs elementary computer gra p h i c s { and allo w s the user to zoom i n on any part of { the p l o t , s c a l e the p l o t a p p r o p r i a t e l y e t c . . { b e f o r e g e t t i n g a hardcopy of the p l o t . Note that { i f a range of th i c k n e s s e s for each l a y e r had { been ent e r e d i n procedure START then the user { can see a T or R p l o t o f : { ( 1 ) the curve which i s c l o s e s t to max_val. That { i s i f any of the curves come to w i t h i n { +/- 1 0 % . { (2) the curve which has maximum T {or R} of { E.M.R. through {off of} the h e t e r o s t r u c t u r e { (3) the curve which has minimum T {or R} of { E.M.R. through {off of} the h e t e r o s t r u c t u r e { A l s o , the corresponding t h i c k n e s s of a l l l a y e r s { be d i s p l a y e d f o r a l l three cases above. { DESCRIRTION: Using the p l o t t i n g f u n c t i o n w r i t t e n by Brian { S u l l i v a n of Department of Phy s i c s U.B.C. t h i s { p l o t procedure works as f o l l o w s : { - the main program c a l l s t h i s procedure a f t e r { a l l the T/R/A data has been generated and { s t o r e d on d i s c DATA: { - If only one t h i c k n e s s f o r each l a y e r of the { s t r u c t u r e was used on the c a l c u l a t i o n s then 1 12 upon e n t e r i n g t h i s procedure a T and R p l o t i s d i s p l a y e d with the x-axis e{low_lamda, up_lamda} and y - a x i s e{0,l}. - If a, range of t h i c k n e s s e s f o r each t h i n f i l m had been entered; then upon e n t e r i n g t h i s procedure a statement i s d i s p l a y e d asking the user whether he wants to see a maximum, minimum or max_value»T {or R} p l o t . The corresponding l a y e r t h i c k n e s s e s to h i s response are d i s p l a y e d and then the a p p r o p r i a t e curve p l o t t e d with the x-a x i s e{low lamda,up_lamda} and y - a x i s eTO,1}. - the f o l l o w i n g prompt l i n e i s then d i s p l a y e d Q ) u i t P ) l o t X ) s e t t i n g Y ) s e t t i n g Var t h i c k n e s s with Q ) u i t = e x i t s the user from t h i s procedure and goes back i n t o the main program where he can a l t e r and of the data and rerun t h i s program. P ( l o t = allows the user to s e l e c t from a menu what he wants p l o t t e d . Then with the cur r e n t x - a x i s and y - a x i s s e t t i n g s the a p p r o p r i a t e curveis} i s p l o t t e d . X ( s e t t i n g s = d i s p l a y s a prompt l i n e which allows the user to change the range and and d i v i s i o n s on x- a x i s . ' Y ( s e t t i n g s = s i m i l a r to x ( s e t t i n g s . V ( a r i a b l e t h i c k n e s s e s = i f a range of th i c k n e s s e s was entered then the max, minimum, or max_val T{or R} p l o t s can be viewed along with the corresponding t h i c k n e s s e s . But i f the user e n t e r s t h i s o p t i o n and only one t h i c k n e s s f o r each l a y e r was used i n the c a l c u l a t i o n s then a message i s d i s p l a y e d t e l l i n g him that t h i s o p t i o n was not meant f o r t h i s case. ( 1 ) Low_lamda and up_lamda = are used to i n i t i a l l y set the a x i s bounds on the d i s p l a y of data on the screen. (2) a / b / c _ o p t _ t h i c k = are used only i f a range are used. (3) a_opt_thick= i s the optimum t h i c k n e s s e s of the t h i n f i l m l a y e r s which g i v e a T {or R} curve c l o s e to max_val. (4) b _ o p t _ t h i c k = i s the t h i c k n e s s e s of the f i l m s f o r which the T/R curve i s a maximum (a maximum to w i t h i n the range of th i c k n e s s e s g i v e ; t h i s may not be the the absolute maximum of the h e t e r o s t r u c t u r e (5) c _ o p t _ t h i c k = i s the t h i c k n e s s e s of the f i l m s f o r which the T/R curve i s a minimum. 1 13 Again t h i s may not be the g l o b a l minimum of t h i s h e t e r o s t r u c t u r e . (6) que = i s set to zero of the value the user wanted to o b t a i n f o r T/R can be found to w i t h i n +/- 10%. If que i s zero then a _ o p t _ t h i c k w i l l be p r i n t e d out. If que = 1 then a message i s d i s p l a y e d informing the operator that f o r the range of t h i c k n e s s e s entered the T/R curve d e s i r e d could not be achieved. OUTPUTS: A p l o t of T and /or R and/or A curves f o r a p a r t i c u l a r m u l t i l a y e r e d t h i n f i l m s t r u c t u r e . NOTES: ( l ) T h i s procedure i s c a l l e d by the MAIN program ************************************* Procedure plot_result(low_lamda,up_lamda : r e a l ; responl : char; a _ o p t _ t h i c k , b _ o p t _ t h i c k , c _ o p t _ t h i c k : mat_type1;que:integer); IMPLEMENTATION USES {SU GRAPHIC.LIBRARY} PLOT GRAPHICS; Var t _ p l o t , r _ p l o t , a _ p l o t : s t r i n g ; min_x,max_x,x_div : r e a l ; { V a r i a b l e s used i n s e t t i n g {x-axis bounds and s c a l e . min_y,max_y,y_div : r e a l ; { V a r i a b l e s used i n s e t t i n g {y-axis bounds and s c a l e . {Plot t r a n s m i s s i o n curves p o i n t s with a " c r o s s " symbol. Procedure P l o t _ T r ; begin g p h _ p l o t ( t _ p l o t , g r _ s y m _ c r o s s ) ; gph p l o t ( t _ p l o t , g r _ s y m _ v e c t o r ) ; end; T p l o t transmission} {Plot r e f l e c t i o n curves p o i n t with a "square" symbol. Procedure Plot_Re; begin g p h _ p l o t ( r _ p l o t , g r _ s y m _ s q u a r e ) ; gph p l o t ( r _ p l o t , g r _ s y m _ v e c t o r ) ; end; T p l o t r e f l e c t i o n } {Plot a b s o r p t i o n curves p o i n t s with a " c i r c l e " symbol. Procedure Plot_Ab; begin g p h _ p l o t ( a _ p l o t , g r _ s y m _ c i r c l e ) ; gph p l o t ( a _ p l o t , g r _ s y m _ v e c t o r ) ; end; T p l o t absorption} 1 1 4 {clear screen and draw a x i s with a p p r o p r i a t e s c a l i n g , { d i v i s i o n s and bounds. Procedure Set_up_graph; begin gph_scale(min_x,max_x,min_y,max_y); sc_clr_s'creen ; gph_x_axis(x_div,2,5,2,'Wavelength ( m i c r o n s ) ' ) ; gph y _ a x i s ( y _ d i v , 2 , 4 , 2 , ' ' ) ; end; T s e t up graph} Procedure P l b t _ R e s u l t ; var i : i n t e g e r ; append : s t r i n g [ 6 ] ; ch,respond ,ch1,ch2,ch3: char; ans : i n t e g e r ; chset1,chset2 : set of 'A'..'Z'; q u i t t i n g , s t o p p i n g : boolean; Begin up_lamda := up_lamda * le-4; low_lamda := low_lamda * 1e~4; q u i t t i n g := f a l s e ; append:=' .data'; c h s e t l := ['P' ,'X', 1Y','Q','V]; chset2 := ['S','M','L','D']; s c _ c l r screen; gotoxy~C0,0); {The next 80 l i n e s of program are used to i n i t i a l l y { d i s play a p l o t ; see s e c t i o n DESCRIPTION above. {$1-} i f responl = 'y' then appendf1] := chr(65) {A range of t h i c k n e s s e s has been used. What optimized {plot does the user want to see. e l s e begin repeat w r i t e l n ( ' W h i c h p l o t do you want to see ? type i n ') w r i t e l n ( ' max. T{or R} that requested a ' ) ; w r i t e l n C max. p o s s i b l e T{or R} i n t h i c k n e s s range b ' ) ; w r i t e l n C min. p o s s i b l e T{or R} i n t h i c k n e s s range O ; r e a d l n ( a p p e n d f 1 ] ) ; i f (que = 1) and (append [ l ] 'a') then begin w r i t e l n ; w r i t e l n ( ' T h e max. T{ or R} that you wanted to achieve does not ); 1 1 5 w r i t e l n ( ' e x i s t f o r the range of t h i c k n e s s e s e n t e r e d ; at l e a s t ' ) ; w r i t e l n C t o w i t h i n +/- 10%'); w r i t e l n ; end {if} e l s e begin que := 0; s c _ c l r s c r e e n ; gotoxyTO,0); {D isp lay the optimum t h i c k n e s s e s of each l a y e r . } w r i t e l n ( ' F o r t h i s p l o t : ' ) ; case append[1] of ' a ' : begin fo r i := 1 to tot_num_lay do begin w r i t e ( ' T h e optimum t h i c k n e s s of ' , n a m e [ i ] , ' i s ' ) ; w r i t e l n ( a _ o p t _ t h i c k [ i ] ) ; end ; { for i} end; {a} ' b ' : begin f o r i := 1 to tot_num_lay do begin w r i t e ( ' T h e optimum t h i c k n e s s of ' ,namef i ] , ' i s ' ) ; w r i t e l n ( b _ o p t _ t h i c k [ i ] ) ; end; end; {b} ' c ' : begin f o r i := 1 to tot_num_lay do begin w r i t e ( ' T h e optimum t h i c k n e s s of ' , n a m e [ i ] , ' i s ' ) ; w r i t e l n ( c o p t _ t h i c k [ i ] ) ; end; { for i T end; {c} end; {case} end ; { i f e lse} u n t i l (append!1] in [ ' a ' , ' b ' , ' c * 3) and (que <> 1); r e a d ( c h ) ; que := 1; end; { i f e l s e response 1} t _ p l o t : = c o n c a t ( ' D a t a : h e t r o T ' , a p p e n d ) ; r _ p l o t : = conca t ( ' .Data :het roR' , a p p e n d ) ; a _ p l o t : = c o n c a t ( ' D a t a : h e t r o A ' , a p p e n d ) ; max_x := up_lamda; i f low_lamda <= 0.5 then min_x := 0.0 e l s e min_x := t r u n c ( l o w _ l a m d a ) ; i f up_lamda > 2.0 then 1 1 6 0.0; 1.0; max_x 10.0; = 0.5; : = 1.0; := 10.0; : = 10.0; else} begin min_y max_y x_div := - min_x; y_d i v end e l s e begin min_y max_y x_div y _ d i v end; { i f set_up_graph; p l o t _ t r ; p l o t re; r e a d T c h ) ; gotoxy(0,0); repeat write('Do you want to r e p l o t t h i s data on a d i f f e r e n t s c a l e {Y/N} ? ' ) ; rea d l n ( r e s p o n d ) ; u n t i l respond i n [ 'y ' , ' n ' ] ; i f respond = begin while not begin ch1 := sc_prompt('Parameters: Q ( u i t P ( l o t X ( s e t t i n g s Y ( s e t t i n g s V(ar t h i c k n e s s e s ' , -1,0,0,0,chset1,false, s c _ c l r _ s c r e e n ; case ch1 of 'y* then q u i t t i n g , do ' Q' 'P' q u i t t i n g := t r u e ; begin repeat gotoxy(0,0); w r i t e ( ' A v a i l a b l e f o r p l o t t i n g i s the t r a n s m i s s i o n ( T ) , ' ) ; w r i t e l n ( ' r e f l e c t i o n ( R ) ' ) ; w r i t e l n ( ' a n d absorption(A) of the h e t e r o s t r u c t u r e . ' ) ; w r i t e l n ( ' c o m b i n a t i o n type i n ) w r i t e l n ( w r i t e l n ( w r i t e l n ( w r i t e l n ( w r i t e l n ( w r i t e l n ( w r i t e l n ( w r i t e l n ; w r i t e ( ' T - c r o s s , R- square, A- c i r c l e ' ) ; r e a d l n ( a n s ) ; u n t i l ans i n [ 1 . . 7 ]; T R A T T R T R A A R & A 1 2 3 4 5' 6 7 1 1 7 case ans of 1 : begin set_up_graph; p l o t _ t r ; end; 2 : begin set_up_graph; p l o t _ r e ; end; 3 : begin set_up_graph; p l o t _ a b ; end; 4 : begin set_up_graph; p l o t _ t r ; p l o t _ r e ; end; 5 : begin set_up_graph; p l o t _ t r ; p l o t _ a b ; end; 6 : begin set_up_graph; p l o t _ r e ; p l o t _ a b ; end; 7 : begin set_up_graph; p l o t _ t r ; p l o t _ r e ; p l o t _ a b ; end; end; {case} end; {plot} begin s t o p p i n g := f a l s e ; while not stopping do begin ch2 :=sc prompt('X Parameters: S(top M(ax LTowest D ( i v ' , -1, 0, 0, 0, chset2, f a l s e , ' ' ) ; case ch2 of 'S' : stopping := t r u e ; 'M' : begin w r i t e l n ; w r i t e ( ' E n t e r the maximum wavelength(in angstroms) ') readln(max_x); max_x := max_x * 1.0e-4; s c _ c l r _ s c r e e n ; end; {M} 'L' : begin 1 18 w r i t e l n ; w r i t e ( ' E n t e r the minimum wavelength(in angstroms) ' ) ; ' readln(min_x); min_x := min_x * 1.0e-4; s c _ c l r _ s c r e e n ; end; {L} 'D' : begin w r i t e l n ; w r i t e ( ' E n t e r the d e s i r e d number of wavelengths ' ) ; w r i t e ( ' d i v i s i o n s ' ) ; r e a d l n ( x _ d i v ) ; s c _ c l r _ s c r e e n ; end; {D} end;{case ch2} end; {while} end; {x} begin stopping := f a l s e ; while not stopping do begin ch3 :=sc_prompt('Y Parameters: S(top M(ax L(owest D ( i v ' , - 1 ,0,0,0,chset2,false,' ' ) ; case ch3 of 'S' : stopping := t r u e ; 'M' : begin w r i t e l n ; w r i t e ( ' E n t e r the maximum t r a n s m i s s i o n ( T ) / r e f l e e ' ); w r i t e ( ' t i o n ( R ) , (0-1) ' ) ; readln(max_y); sc c l r _ s c r e e n ; end;TM} 'L' : begin w r i t e l n ; w r i t e ( ' E n t e r the minimum t r a n s m i s s i o n / r e f l e c t i o n ' ); w r i t e ( ' value,(0-1) ' ) ; readln(min_y); s c _ c l r _ s c r e e n ; end; {1} 'D' : begin w r i t e l n ; w r i t e ( ' E n t e r the number of T/R d i v i s i o n s ' ) ; r e a d l n ( y _ d i v ) ; s c _ c l r _ s c r e e n ; end; {d} end; {case ch3} end; {while} end;{case y} 119 begin i f responl = 'n' then begin repeat write('Which p l o t do you want to see ? ' ) ; w r i t e l n ( ' type i n ' ) ; w r i t e ( ' max T{or R} that you requested ' ) ; wr i t e l n ( ' a ' ) ; w r i t e ( ' max. p o s s i b l e T{or R} i n t h i c k n e s s range'); w r i t e l n C b ' ) ; w r i t e ( ' min. p o s s i b l e T{or R} i n t h i c k n e s s range'); w r i t e l n ( ' c ' ); rea d l n ( a p p e n d f 1 ] ) ; i f (que =1) and (append!1] = 'a') then begin w r i t e C T h e max. T{or R} that you wanted to a c h i e v e ' ) ; w r i t e l n ( ' d o e s not e x i s t ; ' ) ; w r i t e C a t l e a s t to w i t h i n +/-10% of t h i s v a l u e , f o r ' ) ; w r i t e l n ( ' the range of t h i c k n e s s e s e n t e r e d . ' ) ; w r i t e l n ; end {if} e l s e begin que := 0; s c _ c l r screen; gotoxyT0,0); w r i t e l n ( ' F o r p l o t requested: ' ); case appendf1] of 'a' : begin f o r i := 1 to tot_num_lay do begin w r i t e C T h e optimum t h i c k n e s s of ' ) ; w r i t e ( n a m e [ i ] ) ; w r i t e l n ( ' i s ', a_opt t h i c k f i ] ) ; end; {for i T end; {a} 'b' : begin f o r i := 1 to tot_num_lay do begin w r i t e C T h e optimum t h i c k n e s s . of ' ); write(name[ i ] ) ; w r i t e l n ( ' i s ' , b_opt t h i c k f i ] ) ; end; {for i T 120 end; {b} ' c' : begin f o r i := 1 to tot_num_lay do begin write('The optimum t h i c k n e s s of ' ); w r i t e ( n a m e [ i ] ) ; w r i t e l n ( ' i s ', c_opt t h i c k [ i ] ) ; end; {for iT end; {c} end; {case} end; { i f else} u n t i l ( a p p endh] i n [ ' a' , ' b' , ' c ' ]) and (que <> 1); que := 1; t _ p l o t := concat ('Data:h'etroT', append); r _ p l o t := concat(VData:hetroR', append); a _ p l o t := concat('Data:hetroA', append); re a d ( c h ) ; end { i f responl i s no} e l s e begin w r i t e ( ' T h i s o p t i o n i s meant to be used only i f you ' ) ; w r i t e l n ( ' e n t e r e d a range of ' ) ; w r i t e l n ( ' t h i c k n e s s e s f o r each t h i n f i l m . ' ) ; •read(ch); end; { i f e l s e response 1} end;{ case V} end; {case ch1} end; {while ch1} end; {if} {$!+} End; {plot r e s u l t } 

Cite

Citation Scheme:

        

Citations by CSL (citeproc-js)

Usage Statistics

Share

Embed

Customize your widget with the following options, then copy and paste the code below into the HTML of your page to embed this item in your website.
                        
                            <div id="ubcOpenCollectionsWidgetDisplay">
                            <script id="ubcOpenCollectionsWidget"
                            src="{[{embed.src}]}"
                            data-item="{[{embed.item}]}"
                            data-collection="{[{embed.collection}]}"
                            data-metadata="{[{embed.showMetadata}]}"
                            data-width="{[{embed.width}]}"
                            async >
                            </script>
                            </div>
                        
                    
IIIF logo Our image viewer uses the IIIF 2.0 standard. To load this item in other compatible viewers, use this url:
http://iiif.library.ubc.ca/presentation/dsp.831.1-0096295/manifest

Comment

Related Items