LIBRARY OF THE UNIVERSITY OF ILLINOIS AT URBANA-CHAMPAICN 510.84- Ltfer no. .361-366 cop 2. which it was witlllr e ' lbrar y fr °m l a,e s , Do , e l ';^ e d -- o °n or before th< Theft _...:■.. L161— O-1096 Digitized by the Internet Archive in 2013 http://archive.org/details/functionaldevice361guth Report No. 30I 1 - * FUNCTIONAL DEVICE MODELS AND COMPUTER AIDED CIRCUIT DESIGN by Gary R. Guth December 1, 1969 LIBRARY OF: THE NOV 9 1972 UNIVERSITY Of (IXWOI'-- AT UR9Af- » X * V EB KT . KT e -* e 13 q.v CB KT X ^CB KT The result of this approach is that V becomes a straight line EB function of log I . Beta however, is still approximately a constant. q v EB l' E = I E o(e KT 1) Ir s Tr.o(e KT -l) Figure 3* Ebers-Moll non-linear model The point of view of this paper is based upon an empiric of the preceding discussion. Experimental measurements of V EE show that it is, in fact, not a straight line function of log I.,, but has a moaerat,e curvature. furthermore, it is standard practice for trans, tor specification sheets to display beta plotted as a function of log T-. 14 Both V^- and beta are functions of temperature. It is therefore proposed to find a convenient method of representing V and beta in EB terms of polynomials of log I , and temperature. The following chapters are devoted to the details of this representation. 15 3. SINGLE TRANSISTOR CIRCUIT There are two objectives in this part of the paper. The first of these is to develop the loosely defined non-linear model we isolated at the end of Chapter 2 into a more precisely defined model and examine the range for which the model is valid. The second objective is to attempt to use this model in the actual solution of a circuit and hopefully to begin to formulate a method which can be used in any circuit employing such a model. For the purposes of illustration and for the natural simplifications which this arrangement provides, we shall limit the study to that of a single transistor circuit without feedback. The addition of more non-linear elements and the possibility of handling feed- back will be considered in Chapter h. The first question which arises in obtaining a more precise definition of our model is whether to limit the model to that of second degree polynomial (parabola) or to allow the polynomial to be of as many terms as desired. To answer this question consider the following arguments. First consider a first degree polynomial, i. e., a straight line, and remember that only two points are needed to define it. The reason is that there are only two coefficients to be evaluated. Simi- larly, for a second degree polynomial we would need three points and so on. Theoretically, to obtain an exact fit through n + 1 data points we would need an n degree polynomial. Consider the graphs in Figure h. The first graph is that of a quadratic, the second is that of a quartic. Note that both of these curves go through the same four points. If these are supposed to rep- resent a transistor characteristic such as beta (at least on part of the 16 curve) then it is extremely doubtful that the characteristic will contain the dip at the top of the quartic, yet the four data points do lie on the curve. Therefore, it is wiser to hedge in our attempts to carry out the polynomial to a great number of terms to force the curve through a large number of points. Instead, we use the methods of linear regression to handle the curve fitting job after we select the simplest polynomial adequate to simulate our model. For the range we are currently consid- ering, the parabola, or at least a portion of a parabola, will suffice. Figure h. Similar polynomials If we are going to use linear regression to fit the polynomial to ' ba values we may also take advantage of any data transformation: to improve the fit of the model. Usually, the data given for 17 transistors is displayed against the logarithm of the independent variable, in order to display the characteristics over as wide a range as possible while emphasizing the characteristics in the principal operating range. In addition, consider Figure 5 where the base emitter voltage is displayed as a function of both collector current and the logarithm of collector current: it is easier to fit a parabola through the logarithmic dependent function than through the non- logarithmic dependent function. For further comparisons consider Figures 6, 7, 8, and 9 in which the curves representing the measured or actual values of 3 and V for the Delco DS-67 are plotted as functions of I and log I , along with the predicted values of (3 and V_,_ which were obtained by using linear regression to find the best fit through the actual points given a second degree polynomial equation. Clearly the fit is better on the logarithmic dependent functions. For a more quantitative comparison, consider Tables 3 -la, b, c, d which are the vital statistics obtained from the linear regressions used for the predicted values in Figures 6, 7, 8, and 9 respectively. Note that in Tables 3-lb and 3-ld where the logarithmic dependence was used, the values for R and R squared are significantly closer to 1.0 than the same values in Tables 3-la and 3-lc which are the corresponding regressions for linear dependence. Similarly, the logarithmic dependent models obtained residuals which were an order of magnitude less than the linearly dependent models. It is obvious for this particular case, that using the logarithm of the collector current results in the better model. This result will not always be true, but what is indicated is that the selection of a particular model can significantly affect the accuracy of calculations made using that model. For the transistor the fact exists that L is an exponential 18 S § i 3 g •— in ISIS 6 19 function of V and therefore I is close to being an exponential Br, C function of V according to the simple physical device model theories. It follows then, that expressing V_„ as a function of log I„ is a reasonably good choice. Using a second order function in log I takes into account the discrepancies of the device from the simple theory. The argument does not apply to beta at all; according to first-order theory, beta should be a constant. However, the logarithmic dependence of beta on collector current is well known in practice and most transis- tor manufacturers use this method of display. With this consideration the choice of expressing beta as a logarithmic function of collector current is reasonable. From the data in Table 1 the parameters of the model are: 3 = 88.56775 + 11.91306 Log(l c ) + O.56603 Log 2 (l c ) V BE = ' 792kl + - 01782 ^ (V " •° 0059 L °g 2 ( I c ) At this point we have effectively described a model for the transistor which is similar to the usual non-linear models except that two of the parameters are non-linear. The model is essentially true to the real world over a collector current range of one tenth of a milliampere to forty milliamperes for the DS-67 and this is probably a reasonably good operating range if the transistor is indeed in its active region of operation. Actually the model is oversimplified. Strictly speaking we should also check to see whether or not our two non- linear parameters are possible functions of other variables besides the collector current. We should also check to see if any other parameters are functionally dependent on these same variables. However, it is 20 21 o M bO O H o g •rH •p o O n3 C CO -O cu ■P o ■H ft *— »- u 24 Q CO 00 Q. Z < -J to _j I u CM H O C o •H -P CJ 0) 0) CO o a CO Tj ■P o •H 0) U ft o -8 O 2 00 - *■ <\J w CO QL 2? < 1 I I I I I I S110A 3a A sz%zm r*. k O s 8 C3A H rH rH CO K VO ^O -* OA UACO CM OO CO [— Lf\ rH OO o\ oa w m • • o O CM 3 H o <; a. II II II II ►pp- o H S « Q CO o o w CO w 3 < WW P g p « a 3 W W Q CO « Ph W <£, « « CO O Q W 2 Q 3 H K W H H Eh W W CO CO 02 CO 1 O ""a ^ B o 00 W Q Q Q w o o o w o w a w o o CO w o Cm w CO lt\ gn t— oo t- ITv OO-^- ON ir\ CM 0^v ir\ oa cr. ir\ CM CM CO en CM CO II II II II -H- ua CM O OO < H o u E-i o w w w o o <: H W cq S § < EH CO O o w o L/A 0O CO o K 0A 0A VO -3" LT\ H cm s o w H M -3" O CO H _h- w o -H- -H- UA OA UA UA ON o o VO oa o CO UA CM ri oo UA O + w CM oo H O CM MD H CO P < > @ o V£) O R M O OO O H CM UA M <£ LT\ VO Cm VO -3- • • Ph H VD oo 1 Pn I CQ Ph - I W Pm w o w o w I EH o < O CO CMMD-HrCMf-COOH,, oo C--3- OHO h-H C^OMM CM-- 0A CM CO uA-cf 4-4- ChOJ W W OV3 MD H 0A oo UA |>- 0O oo CO OCO CM VQ rH OO t— CO UA H UA MD f- 0\ t^- H UA ua m H OO OO CM I H CM H CMV0-J- t— CM H 0\C0 0A CO ^-O CO UA 0O t~--cf- 0\CO On CM CO O oa cm CA CM ON CM CO -if UA UA UA O h- CM CM O OO VOHOAVOJ-CMVOVOHOCOCMrO H ro lA H -t 00 J CM-3- H r- H -=t- H H H CM CM 0OVOH0OCOHMDV0 roooooooooonoo-^'-^f--^- ua ua ua OOOOOOOOOOOOO OOOOOOOOOOOOO OOOOOOOOOOOOO OOOOOOOOOOOOO - OA r O O CO o o o o OJWOOO VO CO O oo-Hr r— O oo-cf t>-0 J-00 CM CM OO0O0O0O-4--H--4--H- UA UA UA H CM oo J- LP, VO h- CO CA O H CM OO r-{ r-1 r-i <-i £-> o > LT\ EH < CO W H 1-3 M C/2 <; b p »-i S 88 o CO CO CQ s w w o s o < £ &H ON H o CM :=> 9 o CM co 3 CO o m m s CM ON O no t~- H CO CM LTN ON o CM co NO o CO ct3 no NO LfN s OJ LTN w o CM CM H M ir\ O o H ir\ -4" M 2 H • ON @ O ir\ « H H Ph w Ph w Q O EH O < a 4- O fO UN O) ^i u-\\0 nD O h- lAt-OlOIHH^aNfl^HrlH H >"0 Q O UA NO NO oio 0 H i rn W Eh W Eh Q CO DC IX 02 M NO UN 00 00 < =H eg o o w 3 LTN o CJ 1-3 ►-} H CM CO -4" iJNNOh-OOONOHCMCO t-\ H <-{ r-{ eg oo <; q 01 H ■§ Eh vo VO 26 Q PC o H CO 02 W « W K ". M CO I o co o I d o o pq O o o M o o . (H o H ir\ o GOOD (\l O l-J- CM Q CM o co II II II II o o s 00 g Q Q vxi; w w J3 EH EH EH Jd 00 CO 02 £ ^ H ^ ^ Q Q Q =1 < < < IAIAO m cm co lt\ on co ro po-3- H OJ lAO O 0\CO O w pq II CXI lf\ o o CM EH E3 w M H O Sj H CM HHOJOJ LT\ VO vo vo vo vo vo vo t — c — t — c^— t— H w n-t iavo t- ■ CO ON O rH CM 0O H H H H LA la ro CM O H H LT\ nr. • a o M En 3 Q 5 H i-5 oo w H Q a H 0J H pq w •H -P aj t— CjN -^ -P o t— o t<-j 1 .L'\4 W H r- >H O O -rl- o o • • •H o W o CQ OJ H EH 27 oo j- ^ o iCO VO On ON O rH II II II !l CO J" 00 U"N O Q O O CM ONCO c o on O 0\C\O CQ oo C\J II II II II II II - a) li -3- ON o CO o w o o ITV -cr OO ON oo H O as *. M CM o r— U"N M m VO H On CM g itn -4- VO t-~ VO CVJ f- VO CVJ o o C\J o o o Cvl on n CM 00 c— H o itn O O O CQ ir\ o c_> co w COQOJ-COVONONVOOCOfnH ^COCOCOVO-J-VOVO H rH H rH O O O Q O O O O O "" oooojooojo-j- , ooqooooo ooooooooo I I I ] I HONOJDOVOh-OroONdrnH IfN H 0O CO VO -3- VO 0O UA O0 -J" -J" f - ■On Onco vo CM O r— -4" Onco lt\_3- o h-ONH oo -J- VO r~ ON ON O H CM CO ltnuavOVOVOVOvOvovo r- t"- r- r- OOOOOOOOOOOOO OOOOOOOOOOOOQ H O r-LTNH O t--irNCMCMCO-3-VC CO O H M4 VOC— ONOHHCMCM m vo vo vo vo vo vo vo r*- f- t^- t— r- H CvJ CO-J LAVO t^-OO ON O H Ol oo H H rH r-i CM O H W CM O H H vo oo • aJ + ii O H o M H O H H CM g ra ii S o W > £ w o •H +5 VO H VC co o t^vo •H l H EH ■a; CO w H ai co 3 rJ ^ eg CO co cq I 23 Eh < W Pm C3 a 2^ M §£ R CO < 28 possible to continue this argument into circles if we are not careful. We might find that beta is a function of the collector to emitter voltage and attempt to add this dependence to our modelo However, assuming that emitter current and collector current are approximately equal we note that the collector to emitter voltage then becomes a function of collector current. Now that we have essentially isolated our model we need only figure out how to solve a circuit containing it using only linear circuit analysis methods. From here on in, we will ignore the details of obtaining the parameters of the model and instead concentrate on the problems involved in solving various circuit configurations. For the remainder of this chapter we shall consider a basic common- emitter amplifier. The circuit to be considered is shown in Figure 10. We shall assume the transistor to be a Delco DS-67 with a beta of about fifty and a base-emitter voltage of about seven tenths of a volt. This is the transistor we have just modeled and hence we can use the parameter values we just calcaulated. The values of the components in the circuit were calculated using the normal type of analysis, i.e., picking an operating point on a load line, selecting a certain stability factor and so on. Remember, the purpose of the model is for use on a computer in aiding circuit analysis, not circuit synthesis. For this reason we still design the circuit in the usual way. The purpose of the analysis is to offer a detailed study of a given circuit subject to such things as variations in circuit resistances or transistor variations. 29 E« + 18 E« + 18 12KSR, R r S 330ft 4.7K | R 2 R E | 220ft Figure 10. Common Emitter amplifier If we inserted our model and momentarily regard beta and the "base emitter voltage as constants, we would find: p [e- v BE a + yH 2 )] c (i + a)R e (i + lyiy + r 1 where P = P DC = h^ This equation is a non-linear relationship since 3 and V__ are both quadratic functions of log I ; therefore a direct linear solution is out of the question. Usually when equations of this type are to be solved on a computer, there are two possible methods of solution. One method is the strict 30 application of numerical analysis, for example, the Newton-Raphson method or a similar iterative method, and the other would be one of the methods of methodical guesswork, i.e., keep plugging in values of the unknown until the right one turns up. Either method, however, must begin with some sort of approximate result and then work from there toward the actual solution. Now glance again at the equation we are trying to solve. It is an equation for I . If we needed an approximation from which to start a solution of either type, we could plug in the nominal values of beta and the base emitter voltage which would give us a nominal collector current. From here we could proceed to use either method outlined previously. For either method, the most likely next step is to check to see what values we would get for beta and the base emitter voltage if we calculate their values with the I~ we just calculated. If the values are the same as the ones we originally used, we have a solution for I_. If not, we use these new values to calculate a new I and try again. Hopefully the process will converge to a solution. The process is generally referred to as the method of successive approximation and is sometimes used to solve simultaneous linear equations where it is impractical to use normal matrix methods. The process as it applies in this case is outlined in the flowchart of Figure 11. 31 TSTART ) Obtain circuit parameters and nominal values of beta and the base emitter voltage z Calculate a nominal solution for the collector current I Calculate the beta and base emitter voltage corresponding to the present value of the collector current I Calculate a new solution for the collector current YES Print the current solution as the final solution I Cej Figure 11. Flowchart of successive approximation The question which now arises is whether the method will always converge to a solution. The question has even more significance when the possibility of adding more transistors exists since circuits are often designed to be self-regulating. These types of circuits, however, usually employ feedback and this topic is investigated in the next chapter. The equation under question is of the form: I = f(l r ). For the method of successive approximation to converge, the necessary and 32 sufficient condition for convergence is that: f'|(l c )| < 1 in the neighborhood of the root. Unfortunately, even for the relatively- simple circuit under consideration here, the resulting expression for f (I ) is too complicated to spend considerable time evaluating. An easier test for convergence is to try the method on a computer. Another interesting question which arises is, "how important are the initial values chosen for the parameters?" To answer this question the program which was written to test the successive approximation approach was written to do the following: start the method with an initial beta cf 10, 20, 30, 1+0 and 50; count the number of iterations required to converge and display the results. There was no need to vary V^- as well, its range of .575 to .725 against a larger voltage won't have nearly as large an effect as varying beta. The results are displayed in Table 3-2. Putting it bluntly, it doesn't appear to matter where you start from. P v BE i c f> v BE i c P v^ i c no no 700 6 878 20.00 .700 9.651 30.00 .700 1.1. 1^9 £28 : ? 690 J:3U9 fc*! .69? ^69 %•% •£* *-*g k7 lb 70U 12 555 U7.21 .70^ 12.559 ^7.2^ .10k 12.560 k 7 '26 *70U ll\ Ui U7 26 .70U 12.561 U7.26 .70U 12.561 .{0U 12.561 U7.26 .70U 12.561 U7.26 .T0U 12.561 i+o.oo .700 12.087 50.00 .700 12.730 U7 00 .701. 12.5^8 **7. 36 .705 12.566 U7 26 .10k 12.561 ^7.27 .70U 12.561 1+7 '.26 .701+ 12.561 ^7.26 .70U 12.561 Tnble 3-2. Results of varying initial value of beta 33 Simila. riments were tried with circuits operating at different points in the range of the model. The method worked each time, but remember tnat we are still at the single transistor circuit level. In the next chapter, we will test the method on multi-transistor circuits and see what modifications to the method may be required. & k. MULTIPLE TRANSISTOR CIRCUITS In the last chapter, we started from scratch to derive a transistor model and some method of solving the resulting non-linear circuit using linear methods. We mentioned at the end of Chapter 3 that problems could arise if dc feedback was present. In this chapter we shall first examine a small multi-transistor amplifier without feedback and then follow up with a feedback circuit and see what problems do arise and how they may be solved. Let us first consider the cascaded R-C coupled amplifier shown in Figure 12. It should be obvious that this circuit presents no problems to our method of solution. The reason is that the capacitors between stages are used to block the dc path between stages, hence each stage is independent of any other stage and each stage can therefore be adjusted without disturbing the existing state of an adjacent stage. Figure 12. Cascaded R-C coupled amplifier. 35 Now let us extend the problem and examine a direct coupled circuit, again vithout feedback. This particular circuit is shown in Figure 13 . This time there is no coupling capacitor to isolate the transistors, hence the stages are no longer independent, but as we shall see, this does not necessarily mean that we cannot solve each transistor circuit independently. The first step is to apply Thevenin's theorem to the base circuit of T , insert the model into the circuit and solve for the base current of T . The modified circuit is shown in Figure Ik. Figure 13 . Direct coupled amplifier | VW- E R 2 Rl *R 2 -J- to R3 < R5 V B E1 B 1 ! B1 > VBE2 *&B2 ! e4* CALCULATE AN INITIAL I CALCULATE NEW 0. , bV* v BE] NEW I c , CALCULATE THE CHANGE IN I © CALCULATE AN LNIT1AL I C2 ©- CALCULATE NEW , V^g AND THEN 2 A NEW I C2 CALCULATE THE CHANGE IN I © CALCULATE AN INITIAL I C3 0- CALCULATE NEW V__,_ AND THEN i DC 5 A NEW I Cl CALCULATE THE CHANGE IN I CALCULATE THE CHANGE FROM THE SELECTED I TO THE PRESENT Ij 3 Figure 16. Flowchart of method #1 42 loop; the one which checks on the collector current in transistor 3 in terms of the circuit. This would mean that every time it is required to calculate a new collector current in the chain of Equations 4.1, 4.2 and 4.3, we would have to first calculate values for all the model parameters in terms of the value of the currents presently available. In other words select a value of I„ as before and then calculate I . f irst using some rough value of I_. to calculate f3 and V . Then I can be found in a similar fashion, then I and so on. Although the C3 rough values originally chosen for I„, and I will probably result in Ui. o<_ odd values of the transistor parameters at first, the whole thing should begin to converge after a few iterations. The flowchart for this method is shown in Figure 17 and the results of actually trying it are shown in Table 4-1. A quick glance at Table 4-1 shows that instead of converging, the routine results in oscillatory divergence. One possible reason might be that any initial error which occurs is "amplified" greatly before any corrective action can be taken which might allow the method to continually over -compensate for the initial error. Before we attempt to find a third method, the one major short- coming of method #2 should be considered. The problem is simply that there is no inherent stability anywhere in the method. In method #1, stability was demanded at every step along the way. In method #2, stability was the end in itself. Just to see what effect the- initial values of the parameters were, method #2 was repeated using the final values of method #1 which are the values the method should converge to when done. The results are the ones shown in Table 4-1. The results of using arbitrary initial values were worse; the method diverged even faster! »*3 C START ") SELECT AN INITIAL l e|l IC2 AND I c3 CALCULATE VALUES FOR $\, $z, flat V B El. v BC2 ,and V 8 ES calculate a NEW I CI , I C 2 AND I c3 CALCULATE THE CHANGE IN la Figure 17. Flowchart of method #2 As a quick review, method #1 required each stage to stabilize and then for the entire circuit to stabilize. On the other hand, method #2 required that the circuit stabilize but no stability restriction was placed on the transistor parameters; the values of the parameters were different during each iteration. Perhaps a compromise method could be worked out which would also achieve stability but with less complexity than method #1. Towards this end, consider the following: assume initial values for all three collector currents, preferably reasonable ones; calculate the values of the 3's and the V_. 's using the present values of the an, collector currents; while holding all the parameters constant at the values just calculated, iterate through Equations U.l, k.2. and U.3 until a stable value of I , is found; if this value is not different from the starting value for I , then the process is complete, otherwise, using the present stable values of the collector currents, calculate new parameters and try again. The flowchart of this method is given in Figure 18 and the results are listed in Table k-2 alongside the results of method #1. These results were obtained by starting with perfectly ridiculous values for the collector currents. It should be mentioned that methods #1 and #3 are not immune to divergence, but from other tests these methods appear to be as stable as the circuit which they attempt to solve. Actually, there is a definite significance to the differences between methods #1 and #3 a nd this is explained in Chapter 7. ^5 ( 9IAKT } OBTAIN A NOMINAL sour YES CALCULATE HEW VALUES ror p., P , e,, v , r.i.,« V bej BEV BE?' CALCULATE NSW VALUES TOR I J ca M,D ^3 Cl' CALCULATE THE CHANCE IN I_. A CALCULATE THE CHARGE TOON THE HOVTOUS aOLUTIOM/ TO THI3 glLUTIOy * Obtaining a nominal solution using standard values for the transistor parameters is a good way of getting reasonable starting values. It could have been used for all three methods unless reasonable starting values vere already known. However, since methods #1 and #3 a re independent of their starting values this step is academic. Figure 18. Flowchart of method #3 46 \ ( ma ) I (ma) 3.91 36. 14 .95 ZM 38.85 I.05 3.86 36.39 .95 3.4l 39.01 1.06 3.89 36.23 .94 3.38 39.18 1.07 3.92 36.05 .94 3.35 39.37 1.07 3.96 35. 84 .93 3.31 39.58 1.08 4.00 35.61 .92 3.27 39.82 I.09 4.o4 35.36 .91 3.22 40.09 1.10 4.09 35.07 .90 3.17 40.39 1.12 4.15 34.74 .88 3.H 40.73 1.13 4.21 34.38 .87 3.05 4l.ll 1.15 4.28 33.97 .85 2.97 41.53 1.17 4.36 33.51 .84 2.89 42.00 1.19 4.45 33.00 .82 2.80 42.52 1.21 4.54 32.44 .80 2.70 43.10 1.24 4.65 31.81 .77 Table 4-1 Results of method #2 Method #1 Final Value Method #3 39.575 54.673 61.084 .27576 .32854 .29942 3.646 37.681 1.007 109 b. P 2 P 3 Jm JJ3E2 *C2 ma) v I (amps; # of Iterations 39.565 54.674 61.091 .27571 .32854 .29942 3.648 37.671 1.007 89 Table 4-2 Comparison of methods #1 and #3 hi 5. THE EFFECT OF ADDING TEMPERATURE In Chapters 3 and h methods of solving non-linear equations were explored. These non-linear equations were the result of the inclusion of non-linear functions for £ and V in the transistor model. Until now, BE the effects of temperature were ignored lest including temperature in the model have any disastrous effects on the circuit solving method. Actually, temperature is not the problem it might originally seem because as far as the circuit is concerned the temperature is an external variable; that is, the temperature is not a function of any other variables in the circuit as were (3 and V . This is not entirely true; if any cur- oE rent at all is flowing through the transistor there will be some power dissipation at the semiconductor junctions which will be dissipated as heat. The relation of junction temperature to power dissipation in the junctions is of course a function of the current and voltage waveforms at the junction as well as of time. The theory will be developed, however, as if it is possible to consider only an ambient temperature and that the circuit designer will have to allow for junction temperatures. Before attempting to select a model containing some temperature dependence, let us glance at the graphs of Figure 19 which show V and £ as functions of both collector current and temperature. From the re- lations of these curves to one another it should be clear that the rela- tion between either (3 or V..^ and temperature is at least linear and using ait a quadratic function as an approximation should help account for any dis- crepancies. These curves are for the Texas Instruments 2N910 family of NFN double diffused planar silicon transistors and were taken from the 1966 perpetual data book produced by T.I. (These curves are typical of he 1.0 01 0.1 r 0.7 I I as I 0.9 I u i° 4 T 0.3 * az BASE-EMITTER VOLTAM Vt FREE-AIR TIMPERTURE vce« U)i "4 1 ■^^c »50»« see notc « "v^ •c« 10m 'c" lmo ^N L -75 -50 -25 25 50 79 100 125 150 T A — Fr«« -Air T«mp«ratur« — # C NORMALIZED STATIC FORWARD CURRENT TRANSFER RATIO Vt COLLECTOR CURRENT 2.0 1.6 1.6 1.4 1.2 1.0 0.8 0.6 0.4 0.2 J NONMALIZ AT l c « 10i ED TO 1.0 no, T A «28» C Ta- ' 1 25 *c v ce' 10 * Sec NOTf • ta 1 ei l«< t A ' 1 — so •c \ II 1 1 10 100 l c ~ Coll»ct»r Curr.nl — M« 1000 Figure 19. Transistor characteristics h9 most silicon transistors.) Although not all transistors have these graphs (some merely have a list of approximate parameter values), it should be clear that such graphs can be easily constructed from data measured in the laboratory. Returning to the task of building our model, it is clear that the free air temperature in degrees centigrade is a poor choice of units. Any model which contains a linear temperature term must contend with the sign change at -sero degrees centigrade, and any polynomial model would have to have a point of inflection at zero. Therefore to avoid these problems we shall use the absolute temperature scale in degrees Kelvin which is merely a linear transformation from degrees centigrade, accomplished by adding 273 to the centigrade temperature. The full model then, for (3 or Vl,^, either one being referred to as QUANTITY below, would be: QUANTITY = a. 1 + a 2 Log(l c ) + a 3 Log 2 (l c ) + a^T + a^ 2 Tnis equation is essentially the same as our previous models. The difference can be easily absorbed by specifying a constant temperature which allows the a, T and a T terms to be absorbed into a, and reduces the 45 1 model to the same model used in Chapters 3 and k. The easiest way to fit this equation is with a multiple linear regression program which is what was done using data points selected from these graphs. Returning to the problem of physically solving this network, either method #1 or method #3 of Chapter k can be used within a loop which adjusts the temperature after a stable solution is found. The reason for the simplicity of adding the temperature is that the temperature is an ex- ternal variable and hence does not affect the internal loop. Using this 50 method on the common emitter amplifier of Figure 20 with the following parameters for p and V_ • Bill for p : a ± = -57. 6765, a ? = -7.273, 83 = -.91 a, = .301, a = .10711 x 10' k . a x = 1.39799, a g = -.IU5U, a 3 = -.0182 i k = -.00121, a = .II8U9 x 10' and working through a temperature range of -55" C to 125" C in ten degree increments the results of Table 5 - l were obtained. 51 Temperature (°C) I c (na) P V fiE ( volts) V CE ( volts) -55 8.57 22.45 1.35 12.75 -45 9.02 25.57 1.34 12.48 -35 9.41 28.69 1.32 12.25 -25 9.76 31.79 1.30 12.05 -15 10.07 34.89 1.29 11.87 - 5 10.36 37.99 1.27 11.70 5 10.62 41.08 1.25 11.55 15 10.86 44.17 1.23 11.41 25 11.08 47.27 1.21 11.28 35 11.29 50.36 1.19 11.16 45 11. 48 53.45 1.18 11.04 55 11.67 56.54 1.16 10.93 65 11.85 59.64 1.14 10.83 75 12.02 62.73 1.12 10.73 85 12.18 65.83 1.10 IO.63 95 12.3^ 68.92 1.0? 10.54 105 12.49 72.02 1.05 10.45 115 12.64 75.12 1.03 IO.36 125 12.78 78.23 1.01 10.28 Table 5-1 Performance of common emitter amplifier 47K I C j< 330 TRANSISTOR- 2N910 INTERNAL £~50 INTERNAL V BE ~1.2V Figure 20. Common emitter amplifier .52 6. A GENERAL LINEAR CIRCUIT ANALYSIS PROGRAM Chapters 3, k, and 5 illustrated the solution of non-linear cir- cuits by using iterative linear analysis. In each case it was necessary to write a specific set of programs to solve each particular network. It is clearly impossible to write enough specific programs in advance to handle each circuit which may be designed. Alter natively, one could always write a new routine to solve each new circuit but the amount of programming and debugging time involved makes this practice prohibitive. For this reason we shall now examine the capabilities and use of an existing linear circuit analysis program and attempt to modify it for our own use. The I.B.M. Electronic Circuit Analysis Program (ECAP) is an inte- grated system of programs designed to aid the electrical engineer in the design and analysis of electronic circuits. This system of programs can produce dc, ac and/or transient analysis of electrical networks from a de- scription of the connections of the network (the circuit topology), a list of corresponding element values, a selection of the type of analysis wanted, a description of the circuit excitation, and a list of the outputs desired. ECAP recognizes a set of standard electrical circuit elements. Any electrical network that can be constructed from any or all of the different elements in the set can be analyzed by ECAP. There is almost no limit to the number of ways that the circuit elements can be arranged in the network, although the topology is limited to 200 nodes and 600 branches for the I.B.M. 709U and System 3o0. The set of standard circuit elements does not include active el- ements, but in many cases these components are easily simulated by means of linear equivalent circuits constructed of standard elements. Non-linear 53 models cannot be represented by these standard elements, and piecewise linear models only over a restricted range. ECAP is very simple to use. The user needs no knowledge of the internal construction of the program and no previous computer experience is required. It is only necessary that the user become acquainted with the methods of communication with ECAP. These include: (a) the technique of describing a circuit to the program, (b) the specification of the type of analysis required, and (c) the interpretation of the res\ilts. The problem of communicating with ECAP is particularly simple for the engineer because the input for ECAP, as well as its output, is expressed in the language of the electrical engineer. Once the input for ECAP is prepared, the statements are punched 3 cards for entry as input to the ECAP program. ECAP interprets the in- put statements, determines the network topology, generates the network (nodal) equations, performs the desired analysis and produces the specified output in tabular form. ECAP actually consists of four related programs: 1. input language processor 2. dc analysis program 3. ac analysis program h. transient analysis program. Only the input language and the information relevant to the dc analysis program will be discussed. The input language processor is the primary communications link between the user and the analysis programs. It provides the user with a means of describing in familiar terms the complex arrangements of components directly from the circuit. It provides, as well, a means of controlling 5V the type and the extent of the analysis to be performed, and the form and the amount of the output that is desired. The outstanding features of the input language are the English language style and the simplicity of the input format. Only six types of statements are needed to describe a given circuit completely. The input statements define the topology of the circuit, the element values, the type of analysis desired, the circuit excitation and a list of the desired output . The dc analysis program provides the steady-state solution (volt- ages, currents and power losses) of linear networks, the partial derivatives and sensitivity coefficients of the node voltages with respect to the in- put parameters such as resistance, voltage sources and BETA'S, and both a worst case and a standard deviation analysis of the node voltages. The latter analyses require the entry of parameter tolerances as input data. An automatic parameter modification capability is also available to the program. To use this program for dc analysis in ECAP (l620 version) we always need the following two statements which begin in columns one and seven respectively: *CONTROL , PRINT ( , TRACE ) ( , PDUMP ) DC ANALYSIS The information in the parentheses is useful mainly in the modification of ECAP itself and is optional. These two statements must always appear in the order shown and always before any other types of statements except the comment statements which are explained below. It should be noted that this only holds for the 1620 version of ECAP. 55 The comment statement may be placed anywhere in the input and is identified by the letter "C" in column one of the card followed by anything at all . For example : C COMMON EMITTER TEST PROBLEM Numeric data may be represented in a number of ways in ECAP as is shown below where "X" is any digit, "E" indicates "10 raised to the power and "Y" indicates the exponent that 10 is raised to. Two examples of each type are also given. +XX 12000 1 +XX. 470. -3. +XX.X - 12.5 +1.1 + .XX + .001 - .3 + X.XXE+YY +263.1E+3 + .1+7E-06 +XXE+YY +12E3 +1E-12 Note also that blanks are ignored, exponents are limited to +99 °r -99 and that the maximum mantissa length is eight digits. These limits still pro- vide for a great # deal of flexibility in the range and form of data which can be entered into the program. For dc purposes, ECAP considers a standard circuit branch which appears as shown in Figure 21. This branch exists between an initial node m with node voltage e and a final node n with node voltage e . It must m n always contain some value for R and may contain a value for the fixed volt- age source E, the fixed current source I and/or the controlled or dependent current source i'. The current J' is defined as the element current; i is 56 defined as the branch current. Using these symbols the following defini- tions and relations can be obtained: Node voltages Element current Element voltage Branch current Branch voltage Element power loss e 5 e m n e +E-e m n e -e m n (e +E-e )*J' m n The values for R,E, I and i' are inputs and the six quantities above are outputs of the program. o e, Figure 21. Standard dc circuit branch In order to define completely the topology of a dc circuit only two types of input statements are required: the statements specifying the branch data and the statements specifying the dependent current source data These statements are easily written from an existing circuit schematic as will be demonstrated later, but first we consider the format of these statements. 57 The general form, of the branch data statement is : Bnn (N. , N_), R=spec(,E=spec)( ,I=spec) where the "Bnn" must lie between columns 1-5 and the rest of the informa- tion must lie between columns 7-72. The information in parentheses is op- tional for any particular branch. The "B" is the identification for the branch data statement, "nn" is the number of the branch, "N. " and "N " are ' i f the numbers of the initial and final nodes of the branch and "spec" may be a single value such as 12000 or for purposes of worst case analysis may be of Vne form: value (minimum value, maximum value) or value (percentage). For example, a 10K resistor with a 5% tolerance could be represented as: R=10000(9500, 10500) or R= 10000 (.05) The branch data statements for the simple voltage divider of Figure 22 are : Bl N(0,l), R=2000, E=12 B2 N(1,0), R=i+000 Note that the ground or datum node is considered as node "0" and note the signs and directions of the branch currents. B, 58 I2v "WAr 2K 4K |B 2 -ir Figure 22. Simple voltage divider The general form of the dependent current source statement is : Tnn B(b ,b ), BETA=spec (or GM=spec) where the "Tnn" must lie between columns 1-5 and the rest of the informa- tion must lie between columns 7-72. The information in parentheses may be used if the current source is to be dependent on a voltage instead of a current. The "T" is the identification for the dependent current source statement, "nn" is the number of the current source and is used for iden- tification only, "b " is the controlling branch, "b " is the controlled branch, "BETA" or "GM" is the current gain and "spec" is as before. For example, if part of a transistor model looked like Figure 23 the appropri- ate B and T statements would be: B3 NO, 1 *), R=1000, E=-0.6 Bh NO, 1 *), R=10000 Tl BO, 1 *), BETA=50 Note the sign of the voltage source; it is negative because it is opposing the current flow from the initial to the final node of branch three. Also note that in the T statement, branch 3 controls branch k. 59 0*50 Figure 23. Transistor model In addition to the dc steady state solutions, the dc analysis can also give a worst case analysis, a listing of sensitivities and partial derivatives of node voltages with respect to branch elements and the stan- dard deviations of the node voltages. These statements begin in column seven and are written: WORST CASE SENSITIVITY STANDARD DEVIATION The types of output specifically desired must be indicated in the PRINT statement which also begins in column seven: PRINT , OUTPUT ,(,0UTFUT 2 ) ( , OUTPUT ) . . . where OUTPUT ,0UTPUT 2 , OUTPUT . . . are defined as follows 60 OUTPUT DESCRIPTION OF OUTPUT Node voltages Element currents Element voltages Branch currents Branch voltages Element power losses Sensitivities and partial derivatives Worst case Standard deviation Nodal admittance matrix, equivalent current vector, nodal impedance matrix In order to execute a given program the following statement begin- ning in column seven is used: EXECUTE It is also possible to modify the parameters of a circuit after its first solution by using the following statement which begins in column seven : "NV" or "VOLTAGES" "CA" or "CURRENTS" "CV" "BA" "BV" "BP" "SE" or "SENSITIVITIES" "WO" or "WORST CASE" "ST" or "STANDARD DEVIATION "MI" or "MISCELLANEOUS MODIFY followed by B and T statements containing only enough information to modify the existing circuit. For example, to change the value of the voltage 61 source in the transistor model of Figure 23 to 0.8 volts we would need: B3 E=-0.8 EXECUTE During the modification process it is also possible to use a "spec" of the form: a x (a 2 )a 3 which causes the element to take on the range of values from a to a with a_+l being the total number of values in the range. For example, to force a resistor to take on the values 1K,2K,3K, . . ,10K we would use the follow- ing: R=1000( 9)10000 which would cause the circuit to be solved 10 times while the resistor was stepped from IK to 10K. Finally, to indicate the end of a problem the following statement, beginning in column seven is used: END This has not been an exhaustive discussion of ECAP's uses or cap- abilities, it was given only to point out the generality, the ease of input and the simplicity of a general linear circuit analysis program. There are other programs as well which not only duplicate ECAP's capabilities but offer even more capabilities. In the next chapter we shall deal with a modification to ECAP which will allow it to be used with non-linear 62 networks . For the remainder of this chapter a sample ECAP program will be developed and the results will be reproduced. Consider the common emitter amplifier of Figure 2ke. and the de- sired transistor model given in Figure 2Ub. The first step in preparing the input for ECAP for this circuit is to redraw the circuit, including the model, by splitting common voltage sources and showing the voltage sources connected to ground. The next step is to number all the nodes except the ground or datum node which is automatically designated zero, beginning with 1 and making sure that all the nodes form an unbroken se- quential set since ECAP uses that test to determine if all the data are present before it executes. Next all the branches are numbered beginning with 1 and again forming an unbroken sequential set. Given this type of circuit it is a simple matter to write the ECAP circuit description. The circuit, modified as described above, is shown in Figure 26. In order to specify a worst case analysis it is necessary to place tolerances on all of the components so the actual ECAP source program in Figure 25 is shown with tolerances ranging up to 10$ in the B and T statements. Finally, the listing from the computer is shown in the remaining pages of the chapter. 63 500A Figure 2k. (a) Common emitter amplifier, (b) transistor model 6U *CONTROL, PRINT C C SINGLE STAGE COMMON EMITTER AMPLIFIER C C C c Bl B2 B3 Bl* B5 B6 C C C Tl C C C DC ANALYSIS BRANCH DATA N(0,2), R=2000 (i860, 211*0), E=20(l9,2l) N(0,1), R=6000( 5580, 6*120), Efc=20(l9,2l) N(0,l), R=1000( 930,1070) N(l,3), R= 350(.10), E=-0.5 N(3,0), R= 500( 1*65, 535) N(2,3), R=11.1E3(.10) DEPENDENT CURRENT SOURCE DATA B(lf,6), BETA-50(l+5,55) SOLUTION CONTROL CARDS WORST CASE STANDARD DEVIATION SENSITIVITIES OUTPUT SPECIFICATIONS PRINT,NV,CA,CV,BA,BP,SE,WO,ST,MI EXECUTE END Figure 25. ECAP program for common emitter amplifier 20v 20v 6K ||b 100 > I B 50OHb 5 Figure 26. Common emitter amplifier to be analyzed by ECAP 65 «CCNTRCL,PRIM t C SINGLE STAGE CUNfL'N EMITTER AMPLIFIER C CC ANALYSIS BRANCH CATA N(C,2) .K = 2:::i l96Ct 21^.C), E = 2C( 19, 211 N(C,l),R=6:::(5b8C,6A2C),E*2C(19,21) nic, 1 ) ,'< = 1 ::••:( 93 CtU7C) N(i,3) t R=35:(.LO) f E«-C.5 N(3,:) ,K*5" : (46^>,535) N(2, ?) ,!i=ll.lt3l ,1C) DEPENCENT CLIENT SCIRCE TATA B(^,fc),HETA=5:(45,55) SCLtTICN CCNTRGL CARCS WCRST CASE STANCARC TEVIAIILN SENSITIVI7 IuS CU7PUT RFCLESTS PRIM,NV,CA,CV,BA,RV t eP,SE»WC,ST,Nl EXECLTE c C C 01 22 E3 t<. e5 E6 C C C 11 C c c c c c 66 NCDAL CCNCUCTANCE MATRIX PCW CCLS 1 1 - 3 .4C2381CE-C2 2 1 - 3 .1428571E CC 3 1 - 3 -.1457143E CC .COCCC CCE C C .59CC901E-C3 .90C9CCSE-C4 _sl2 8 5.71^2E-C2_ .142S472E CC .1478044E CC NCCAL IMPEDANCE MATRIX RCfc CCLS 1 - 3 1 - 3 1 - 3 .8236EE5E C3 -.316365 IE C4 .81C3CS6E 22 .285269SE CI . 1977274 E C4 .401755SE CI .186E52CE .185114 IE .263149 9E 4_4 C4 C2 NCDE VCLTAGES NCCES 1- 3 eRANCH 1 2 3 A 5 6 VOLTAGES 27S422CE CI .11C7270E C2 .226S526E CI EPANCP VCLTAGES .11C7270E C2 .2754220E CI •2794223E CI .5256933E CC .2268526E CI .E8C4170E CI CURRENTS .44636 52E-C2 .286763CE-C2 -.2 794 2 2CE-C2 .7340943E-CA .4537C53E-C2 .4463640E-C2 VCLTAGES .852 73C3E CT .172C576E C2 -. 27542 2CE CI .256S23:E-C1 .22685261 CI .88CA17CE CI PARTIAL CERIVATIVFS NCDE VCLTAGE U I T h RESPECT TC RES. IN BRANCH NCCE NC. PARTIALS SENSITIVITIES 1 -.63667276E-I5 2 -.A4l292 c .Sr-C2 3 -.ES66^516C-:5 -. 12733455E-C3 -.E82*8558E-C1 -.17';229e3E-C3 PARTIAL CERlVATlVtS NCDE VCLTAGE V. I T P RESPECT TC RES. IN BRANCH NODE NC. PART IALS 1 -.293767896-03 2 .1512C3CCE-02 3 -.387278C1E-03 SENSITIVITIES -.23626C73E-G1 .9C7218G2E-C1 -.22236681E-01 PARTIAL DERIVATIVES NCCE VOLTAGE ^ I T h RESPECT TC RES. IN BRANCH NCDE NO. PARTIALS SENSITIVITIES 1 .23C21253t-C2 2 -.68399?54t-02 3 .226A1825E-C2 .23:212536-01 -.68399254E-01 .22641829E-01 PARTIAL CERIVATIVtS NCOE VOLTAGE WITH RESPECT TC RES. IN BRANCH NCDE NO. PARTIALS SENSITIVITIES 1 ,2eA796^^E-C5 2 .27C948766-C3 3 -.6939S5C4E-C4 .99678755E-05 .948320666-03 -.242894766-03 PARTIAL CERIVATIV6S NCDE VOLTAGE ^ I T H RESPECT TC RES. IN BRANCH NCCE NC. PARTIALS SENSITIVITIES 1 .1695:>143li-:3 2 .1679745C6-C1 3 .23678AS6E-03 .847757186-03 .639872526-01 . 119392486-02 FARTIAL DERIVATIVES NCCE VOLTAGE hllh RESPECT TC RcS. IN BRANCH NCDE NC. PARTIALS SENSITIVITIES 1 -.113133666-05 2 .9C129894E-C5 3 -.159329686-:5 -. 125578376-03 . 1CCC44186-C2 -. 176656176-03 PARTIAL DERIVATIVES NODE VOLTAGE WITH RESPECT TC GV f BRANCH 4 TC BRANCH _fc_ NODE NO. PARTIALS SENS ITIVITIES .4C67891CE 00 .58112728E-03 2 -.32407557E 01 3 .57289453E 00 -.4629651CE-02 . 81842C74E-03 68 PARTIAL DERIVATIVES NODE VOLTAGE WITH RESPECT TC VOLTAGE SOURCE IN BRANCH 1 NODE NO. PARTIALS SE NSITIVITIES 1 .14263496E-C2 2 .98863675E CO 3 .2CC87795E-02 .26526992E-C3 .19772734E 00 .4C175589E-03 PARTIAL DERIVATIVES NODE VOLTAGE WITH RESPECT TC VCLTAGE SOLRCE IN BRANCH NCDE NO. PARTIALS SENSITIVITIES 1 .13731474E CO 2 -.52727515E OC 3 .135C5159E CC .27462949E-C1 -.1C545503E CO .27C1C319E-C1 PARTIAL CERIVATIVES NCDE VCLTAGE V«ITH RESPECT TC VCLTAGE SOLRCE IN BR ANC H NCDE NO. PARTIALS SENSITIVITIES 1 -.3879562CE-C1 2 -.3 690925 8 E C 1 3 .94536224E 00 -.19397EC9E-C3 -.1645462eE-Cl .^72681 11E-C2 WCRST CASE NCCE VCLTAGES NCCE NO. NCMINAL CASE WCRST CASE MAX fcCRST CASE PIN 1 .279A2197E 01 2 .11072696E 02 3 .22685264E CI .228C5e7CE CI .151 51E4CE 02 .27 5872 3 6E CI .2 31C2CC1E CI .6 974 846 7E CI .17816257E CI STANDARD CEVIAT1CN OF NCDE VCLTAGES NCCE NC. STL.CCV. .8966177CE-C1 69 2 .5 5 5 5665:- CC 3 .e83ci22ef-;i 70 7. A GENERAL N0N- LINEAR CIRCUIT ANALYSIS PROGRAM In previous chapters it was shown that methods could be devised to solve non-linear circuits using linear analysis methods, and it was also shown that a generalized program could be written to solve linear circuits. It is the purpose of this chapter to devise a general non-linear circuit analysis program. As noted in Chapter k t two methods exist for solving non-linear circuits. Since only one method can be used the choice of method will probably be determined by the capabilities of the general program. Clear- ly a general circuit analysis program cannot rely on writing equations for each circuit and then proceed to solve them iteratively as was done in Chapters 3 and k. Therefore, an examination of how the general circuit analysis program selves equations must be completed first, then the appli- cability of the methods of Chapter k can be determined. An examination of the ECAP source program indicates that after the topology of the circuit is read as input, the nodal equations for the net- work are constructed in matrix form, after which the matrix elements due to dependent generators are added. The node voltages are calculated by solv- ing the matrix equations. Once the node voltages are calculated it is a simple matter to determine the branch voltages and currents, and then the element voltages, currents and power losses. Other quantities such as sensitivities are calculated through methods irrelevant to this discussion. The main point is that the program essentially solves the node equations of the network after constructing the appropriate data matrices. This means it once a set of parameters are entered into the system they must remain i.ant all through the solution. 71 At this point an examination of the two successful methods of Chapter h is appropriate. The first method requires iterating around a single transistor stage until the stage is stable, then continuing the pro- cess for any remaining stages and then checking the overall convergence. In the second method, a nominal solution allows the generation of new de- pendent parameters which are then held constant until convergence of the circuit is obtained. Obviously, either of the two methods can make use of ECAP to provide a nominal starting point. To use ECAP with the first method, ECAP would have to be called upon each time a modification was made to the parameters in any one stage and the entire circuit would be solved even though only one set of para- meters was recalculated. Although the entire circuit is reevaluated, only one stage is readjusted. Therefore, if each stage requires three itera- tions for convergence, each total circuit iteration of three stages requires nine iterations and if the circuit is required to iterate three times then ECAP routine will be required to produce 27 solutions plus the initial nominal solution. The second method, which seems to require nearly as many iterations as the first (at the end of Chapter k it was noted that for the same prob- lem the first method took 109 iterations and the second method 89 itera- -.s), does possess a property which cuts the number of iterations down considerably. In the second method, the parameters for all stages are evaluated simultaneously and then the circuit is iterated until it conver- ges. In essence, this is the same thing as solving the circuit's nodal or loop equations by successive approximation. Whereas iterating a given set of parameters to a convergent solution may have taken five or six iterations, the use of ECAP will solve the circuit in one step. Therefore, if the 72 reevaluation of parameters was done three times, ECAP will be called on only three times. Therefore, this method is far more efficient than the first method. To use the second method of Chapter h with ECAP a solution would be developed as follows : 1) ECAP would be used to analyze the topology of the circuit and produce an initial solution of the circuit using nominal linear values for the non-linear paremeters; 2) after obtaining the results of the new solution, all of the dependent parameters would be re-evaluated and placed into the appropriate locations in ECAP's data structures and one or more of the currents would be chosen to be checked as criteria for determining convergence; 3) ECAP would be called to obtain a new solution to the present circuit and therefore a new set of values for the currents which were cho- sen for convergence criteria in step two; h) the relative changes in the currents would be noted and if any of the changes were significant the process would be repeated from step two; otherwise the process would be complete and the solutions considered as the final solution. Now the process contains only one iterative loop although the calculations within the loop are considerably more complex. The revised method also eliminates the problem of finding or creating an independent stage when feedback loops are present. Finally, this modification in no way affects the inclusion of temperature effects since the temperature is still exter- nal to any of the internal processes. The only problem left then is the implementation of the method. 73 In order to modify ECAP as little as possible the most desirable approach would be to add a completely new routine to ECAP which only re- quires enough modification to ECAP to allow entry into the routine. This also has the advantage of allowing ECAP to be used as it was originally intended. Matters are also simplified if the approach to the problem is to allow ECAP to analyze a nominal value circuit and get the nominal solution and then pass control to the iterative procedure which will use as many of ECAP' 3 circuit solving facilities as is feasible to produce the iterated results. It should be noted that the program structure of ECAP (l620 Version) consists of one main routine and about seventy subroutines which can be called either from a main routine or another subroutine. The input data to such a modified ECAP would consist of the nor- mal ECAP input followed by the normal execution of the program. After execution the language processor would read a control statement and pass control to the new routine. This routine would then read in and analyze the functional parameter dependence, the tolerance required to end the iterative procedure and the quantity to apply this tolerance to as well as a possible control of temperature factors. The routine would then build the required evaluation routines for the dependent parameters, set up the proper tests for ending the iterative procedure and, if necessary, create an iterative loop for varying the temperature. Ideally, the routine should be able to accept and evaluate a func- tional relation in any form. However, to program this feature would require a considerable effort to duplicate the algebraic compilation capabilities of a higher level algebraic compiler such as FORTRAN. Therefore, to avoid this complication the following model is assumed: 7U F(I C ,T) = a x + a 2 lnl c + a 3 ^ 2 I C + a^T + a T 2 (7.1) and only the coefficients a. ,a ,a ,a, and a are read in. If no temperature dependence is required, a. and a are set to zero or ignored. There is no reason for this restriction other than the desire to simplify program de- sign. It is also possible to program in any other type of model on a "co- efficient only" basis such as this. The first required statement for this routine is the only statement of the set which can be recognized by ECAP's language processor and it causes control to be passed to the iterative routine. The format of this statement which appears somewhere in columns 7-72 is : ITERATE Since this statement gives control to the iteration routine and must be used only after a nominal solution is obtained, it must follow an "EXECUTE" statement (see Chapter 6) and precede any of the following statements which provide information to the iteration routine. These statements however, may appear in any order after the "ITERATE" statement. The general form of the statement which indicates the functional dependence of one quantity upon some current and possible temperature is: Ann Q(j)=a 1 ,a 2 ,a , (,a^,a ) where the "Ann" appears in columns 1-5 and the remainder of the statement appears in columns 7-72. The "a ,a ,a (,a, ,a,_)" are the coefficients of the model shown in Equation 7.1. Note that "a. " and "a " may be omitted if no temperature dependence is required in the function. The allowable format for these coefficients is the same as that of any other numerical 75 value in ECAP (see Chapter 6). The "Q," may be "E" if the quantity is to be » a voltage source, "R" for a resistor, and either "BETA" or "GM" for a de- pendent current source. The "J" is the number of the branch in which the current that the "Q" is dependent on flows. The "Ann" represents either the proper branch data reference or the proper dependent current source ref- erence of the original quantity as used in the nominal circuit analysis. Therefore, if in the nominal circuit analysis the following two statements appeared to provide values for V and p respectively: B3 N(l,2), R=50,E=-0.3 Tl B(3, 1 +),BETA=50 and it is desired to express V and 3 as functions of the current in BE branch k, the following statements would be used: B3 E(U)=-.3895,-1.62^1E-2,+7.1715E-U Tl BETA(U)=8i+. 41282, 10. 61*133, .V73C-8 In order to specify the current or currents which are to be used as the criteria for halting the iteration procedure, either of the follow- ing statements, in columns 7-72, may be used: CURRENTS=I- ,I.,I,... 1 2' 3 CURRENT=I where "I. ,1 ,I_. . ." are the branch numbers of the currents to be examined. To specify the tolerance of each current to be examined, either of the following statements in columns 7-72 may be used: TOLERANCES^ , T , T- . . . T0LERANCE=T 1 76 where "T_,Tp,T . .." are the decimal equivalents of the maximum percentage change allowable to stop -che iterations. * The tolerances specified apply to the respective currents given in the "CTJRRENTS. . ." statement. There- fore, if it is desired that a certain procedure continue until the changes in the currents in branches 3 and 12 do not exceed 1% and 3% respectively, the following two statements are necessary: CURRENTS=3,12 T0LERMCES=.01,.03 It should be noted that iteration will continue until all the criteria which are specified are met. To specify the temperature parameter if the solution is to be calculated for a single temperature the following statement in columns 7-72 is used: TEMPERATURES T where "T" is the desired temperature in degrees centigrade. To carry out the procedure over a range of temperatures the following statement in columns 7-72 is used: TEMPERATURE=T. (T )T- i n f where "T." is the initial value of temperature in degrees centigrade, "T " is the final value of temperature in degrees centigrade, and "T " is the total number of values in the range other than the initial value to be used in the calculations. For example, to execute the iteration technique every 10° from -55° C to 125° C, a total of 19 points, the following statement would be used: 77 TEMPERATURE= -55 ( 18 ) 125 Note : In developing the model of Equation 7.1 the temperature was assumed to be in degrees Kelvin. Although the temperatures in the statements above are given in degrees centigrade, the routine will automatically make the adjustment to degrees Kelvin before evaluating any parameters. Finally, to execute the routine after all data statements are en- tered, the "EXECUTE" statement of Chapter 6 is used. The comment statement, although not mentioned above, may be used freely. Also, after the routine completes the iterative process it returns control to ECAP's language processor. To complete the chapter, two examples of the use of the routine are given. The first example is the three-transistor feedback amplifier originally discussed in Chapter h, but with slightly different beta func- tions. To provide a valid comparison of the results, the method used in Chapter h was repeated using the new beta function. The second example is the circuit of Chapter 5 evaluated over the same temperature range. Results for both circuits are shown for both types of solution. Some justification of the slight differences can be provided from the non- representation of a resistor less branch in ECAP. In previous chapters, the base of the transistor model contained no resistor at all. Since ECAP re- quires some resistance in a branch, very small values were tried, but this was unsatisfactory for the following reason: ECAP calculates node voltages first; with a small base resistor the node voltage difference minus the V drop was very small and the usual errors which arise from subtracting two nearly equal numbers occurred, resulting in relatively inaccurate base cur- rents. Therefore, a larger base resistance was required. To offset this 78 resistance, the program was altered to examine the voltage drop across the resistor and then adjust the value of the voltage source to force the branch voltage to be correct. For each circuit, a schematic properly drawn for ECAP is given followed by the ECAP source program and then the comparative results. There is also a great deal of data provided by ECAP which is not shown. The routine itself is written in FORTRAN-II and is shown in Appendix A. Although this version of ECAP was written for the IBM 1620, the version was modified and recompiled on the I3M 709^, and later recom- piled for the IBM System 360. The only significant changes to 1620 ECAP were in the rewriting of the DIMENSION, COMMON and EQUIVALENCE statements to reconcile word length differences and the way in which the University of Illinois' FASTRAN compiler assigns COMMON storage, and the changes in alphameric variable initialization techniques. Otherwise, all other modifications consisted of renaming library subroutines and leaving all 70 subroutines in main storage at one time. One problem in conversion did occur, which was the inability of FASTRAN to handle alphameric input-output (A- type format) with fixed point variables and hence all alphameric variables were renamed to change them to floating point variables. Although the same conversion on the 1620 would require more storage, the 709^ assigns one word of storage to both fixed point variables and single precision floating point variables. 79 13.3 13.3 r 1 l *'\ Bui 47 IH Bsi O NO CM NO ro NO CO CO On On On O O 8 ON CM s t^ 1A W CO 4 ON J- CO NOCOO H oo _4- NO D- H CM CM CM H H CM CM CM P a u i 1 +3 O p PC UN .4- CM O oo ro co oo ON r- LfN no rH ON co NO CJ OJ CM CM CM H H H -4" CM O 0- UN oo H H O O O O > •H h 0) -P o o ■o o x: p ca UN -4" rH C~- ON ON ON ON CO UN NO t- CO ON O r- H h VO ITi 4 4 CM CO -4" UN NO 0O CO t- CO CM CM ON O CM CM UN CO CM CM H _4 t>- P P •H e o o o Sh O , VLAST(50) RM(50) ,M0STEP(50) , IWC0UT(4) CURR(200),SMLE(200)»EQUCUR(50),EX(2 00) 00),AMPB(200) ,VN0M(50) ,ST0SQ(50» ,L t M,IITOL LTA,DUM1(28) 0(2,20) ,KLABEL(4) ,KPUNC ( 5 ) , INDC < 2 , 20 ) (20),KTYPE(5),NBLANK,NOEXEC, I TOL ♦ NEOU IM, P IC LTYPE,KC0L,NQUIT,ITRANS,K0,KS,KELAST,NUM,M1 ,NP,NTR,MAC,HNODE,TNUM,NUEL,NOE,NOI,NOIC T(2,10) YX(200) ,YB(200),YTERMX(200),YTERMB(200) N(50) P,CURR,SMLE,EQUCUR COEFS<50,5) , ICRES(50) , IPTYPE(50) , IPL0C(50) OL(25) ,AMP0L0(25),BETA(200),GM(200) INITIALIZE £ DEFINE DICTIONARY f. INDICATORS IF (NTRACE) 1,3,1 WRITE (6,2) FORMAT (' SUBROUTINE GUTHS1 ENTERED'/) NI TER ( 1 » 1 ) = NITER( 1,2)= NITER(2,1 ) = NITFR(2,2)= NITER (3,1 ) = NITFRI 3,2)= NI TER<4,2)= N[TFR(4,1 ) = NITFR (5,1 ) = NITFRI 5,2)= NITER (6,1 ) = NITFR<6,2)= DO 300 1=1,50 -4R232B512 -985644992 -1019199424 -^65551296 -4R232R512 -700432320 -415219648 -PR564A992 -7339B6752 -700432320 -650100672 -9R5644992 91 ICRESi I)«0 IPTYPEI ] )»0 IPLOC( I )«0 00 300 J«l,5 300 C0EFS( l,J)-0.0 00 301 1-1,25 ICURR( I )«0 T0L( 1 )»0.0 301 AMP0LD( I )-0.0 00 302 I»l,200 BETA( I )«0.0 302 GM( I )-0.0 INDCUR-0 1NDT0L"0 INDTEM«0 TFMP-0.0 TEMPI*0.0 TFMPFxO.O TEMPC=0.0 I INUM»0 ITEMP2M C C READ L LIST DATA CARO C 1000 READ ( 5,4) NWURDS 4 FORMAT (72AI) WRITE (6,5) NWOROS 5 FORMAT ( 1X,72A1 ) KCAR0=KCARD+1 NOEXEC=N0EXEC+NQUIT C C CHECK FOR ' ID' CARD C IF -INDC( 1,15) ) 1004, 1001 , 100* 1001 IF (NW0RDS(2)-NMC0(1,1) ) 1004,1002,1004 1002 00 1003 ICOL=l,72 1003 I0W0RD( ICOL)=NWOROS( ICOL » GO TO 1000 C C CHECK FOR 'COMMENT' CARD C C SHIFT LEF1 COLUMS 7-72, ELIMINATING BLANKS C 1004 IF (NWORL)S< l)-INPUTB(B) ) 2000,1000,2000 2000 KC0L=6 c DO 7 IC0L=7,72 IF (NW0R!)S( ICUL )-NBLANK) 6,7,6 6 KC0L=KC0L+1 NWORDS(KCUL )»NwORDS( ICOL ) 7 CONTINUE C C CHECK CONTENTS OF COLUMNS 1-6 C 00 11 IC0L=1,5 IF (KWOROSI ICOD-NBLANK) 8,11,8 A DO 9 LTYPE=1,2 92 IF (NW0R0S< ICOL)-KLABEL(LTYPE)) 9,200,9 9 CONTINUE M3 = 5 15 ITRANS=6 10 WRITE (6,3006) M3 ,KCARD, ICOL N0UIT=1 GO TO 1000 3006 FORMAT CO ***** ERROR *«,I3 f « CARD #«,I3,« APPROX. COL.', 11 CONTINUE IF (KCOL-6) 500,12,13 12 M3 = 4 GO TO 15 500 ITRANS=5 GO TO 10 CHECK FOR TEMPERATURE, CURRENT, TOLERANCE, EXECUTE, MOOIFY OR RETURN STATEMENT, INDEX NUMBERS 1,2,. ..,6 RESPECTIVELY 13 IC0L=7 DO 20 IDENT^1,6 IF ) 225,224,225 207 MTYPE=1 MJ TO 210 208 MTYPE=2 GO TO 210 209 MTYPE=3 211 IC0L=IC0L+1 210 IPTYPE( I INUM)=MTYPE IF (ICOL-KCOL) 212,212,21 212 IF (NWORDSI I COL ) -KPUNC < 2 ) ) 211,213,211 213 IOiL = IC0L+l 94 IF (ICOL-KCOL) 214,214, 2i 214 CALL ECB09 NUM=TNUM ICRESI IINUM)=NUM ICCLMCOL + 1 IF ( ICOL-KCOL) 215,215,21 215 IF (NWORDSt ICOL ) -KPUNC ( 4 ) ) 206,216,206 216 IC0L=IC0L+1 IF (ICOL-KCOL) 217,217,21 217 IF -KPUNC ( 3 ) ) 206,222,206 224 MTYPE=4 GO TO 210 22 5 M3--36 GO TO 15 C C BEGIN EXECUTION OF ITERATION TECHNIQUE C 8000 IF (NTRACE) 8901,8900,8901 H401 WRITE (6,8908) WRITE (6,8902) ( TOL ( I ) , I = 1 , I T ) WRITE (6,«903) ( ICURR ( I ) , I = 1 , I T ) WRITE (6,8906) WRITE (6,8904) < ( COEFS ( I , J ) , J= 1 , 5 ) , I = 1 , I I NUM ) WRITF (6,890 7) WRITE (6,8905) ( I , ICRES ( I ) , I PTYPE ( I ) , I PLOC ( I ) , I =1 , 20 ) WR I IE (6,8911 ) WRITE (6,8910) ( CURR ( J ) , J= 1 ,NMAX ) 8902 FORMAT ( • • , 10F 10 .4 ) 8903 FORMAT ( '0' ,10110) H904 FORMAT ( • • ,5E1 7.7) 8905 FORMAT ( • • , 13,3110) 8906 FORMAT ( • OCOEFF IC I ENTS : • / ) 8907 FORMAT (»0 I«,7X, 'ICRES IPTYPE IPLOC'/) 8908 FORMAT ( • OTUL ER ANCES AND CURRENTS:*/) H910 FORMAT ( « • ,8E16.7) 8911 FORMAT ( « OC URRENTS ' / ) HVOO IF ( INDCUR+INOTOL-2) 8001,8002,8001 H001 M3=35 GO TO 15 *» +CUEFS ( I , 3 ) *ALCUR ) 1 +TEMP*( COEFS ( I,4)+C0EFS< I,5)*TEMP) MTYt>E=IPTYPE< I ) GO TO (8101, 8102,8103, 8104) ,MTYPE HiOl E< I I ) = VALUE*CCSAV< I 1,3) GO TO 8105 8102 BETA! I I ) = VALUE NBRM=ICOLT( ! I ) YTERM( II !=VALUF.*Y(NBRN) GO TO 8105 8 103 GM( I I )= VALUE YTERM( I I )=VALUE GO TO 8105 8104 Y(NBRN)=1 .0/VALUE - 105 CONTINUE C C SOLVE DC PROBLEM C DO 8106 I=1,NMAX YX( I )=Y( I ) EX( I ) = E( I ) HlOfc AMPX( I )=AMP ( I ) IF (NTERMS) 8107,8109,8107 B107 00 8108 1 = 1 , NTERMS 8108 YTERMX( I ) = YTERM( I ) 8109 CALL ECB22( ZPRL) CALL ECB23 96 CALL ECB25 CALL tCB26(ZPRL) IF (NUM-20) 8200,8300,8200 C C CHECK TOLERANCES C 8200 00 8201 1 = 1, IT J=ICURR( I ) SAVE=CURR(J) IF < ABSUMPOLDU »-SAVE)-ABS(AKPOLD(n*TOL3 FORMAT (•- NUMBER OF ITERATIONS: ',13/) IF (INOTEM) 8202„8203„8202 8202 !'eMPA=TEMP~273„0 WRITE (6,9000) TEMPA 9000 FORMAT ( » f EMPERATURE : 8 ,F10.3/) 8203 DO 8204 I=1,NMAX YX( I ) = Y( I ) EX I I )=E( ! ) 8204 AMPX{ I )=AMP( I ) IF (NTERMS) 8205,8207,8205 *205 DO 0206 I = 1,'\JTERMS B206 YTERMX( I )^=YTERM{ I ) M>07 CALL ECB22(ZPRL) CALL ECB23 IF (NPRINT(IO)) 107,107,108 10S JX1=1 CALL ECB2MZPRL) 07 CALL fcCB26(7.PRL) NTR=1 IF iNPRINTUO)) 103*103,104 JX1---2 CALL cCB2MZPRL> I.C3 CALL ECB25 NTR-4 WRITE (6,9002) < I , ICOLT U ) , I ROWT ( I ) , BETA { I ) ,GM( I) , YTERM( I) , I I=1,IMTERMS) WRITE (6,9001) )1 FORMAT (//• T-NUMBER» ,8X,« IC0LT«,12X,» IR0WT»,6X, •BETA' ,11X, «GM« f LUX, 'YTtRM'/ ) FORMAT ( 3X, I4,llX,I4,13X,i4,2F15.7,E15.7) GO TO (POOR, 8053) , ITFMP2 100 WRITE (6,8301 ) . 01 F.irfMAT MONO CONVERGENCE AFTER 20 ITERATIONS'/) TO 8 302 FUTURE MODIFY ROUTINE 00 CONTINUE TO 1000 (-/IT TO MAIN ROUTINE 97 9999 RETURN END 98 APPENDIX B COMMON A,ACHG, ICDCT,KCHG DOUBLE PRECISION A ( 40 ) , ACHG ( 40, 4) ,0LD, ICDCT OOUBLE PRECISION A I D ( 20 ) , CS < 20 » ,C ( 20, 20 ) , V ( 20 ) , BB ( 20 ) DOUBLE PRECISION TST , SSS , STDV ,SPST DOUBLE PRECISION AMEAN,CD, AKNT , SOUT, S IGN, PCT , STER, AST DOUBLE PRECISION BETA , BVAR, BSTD, TRAT , S I ZE , AM, DF,RR ,R , ADJR, ADJRR DIMENSION TITLE( 18),FMT IN ( 18 ) , FMTOUT { 18 ) , A I ( 40 ) , ANAM ( 25, 40 ) DATA ANAM/»C» , , 0«,«N',«S , , , T», , A», , N , » , T»,« •» , T» f , E , t , R , » , M , f 19H?*' •/ C C STEPWISE MULTIPLE LINEAR REGRESSIUN PROGRAM C (. CONTROL CARD FORMAT: C C 1. HEADING CARD - FORMAT (18A4) C THE CONTENTS OF THIS CARD ARE PRINTED AS A HEADING ON EVERY C PAGE OF OUTPUT. C C 2. PARAMETER CARD - FORMAT (12,13,12) f A. COLS 1-2: NIND = # OF INPUT VARIABLES TO BE READ AS DATA. C B. COLS 4-5: NVAR = NIND + VARIABLES CREATED BY TRANSFORMATIONS. C. COL 7: ICHG = 1 IF ANY DATA TRANSFORMATIONS C = IF NO DATA TRANSFORMATIONS C C 3. OATA VARIABLE NAME CARDS - FORMAT (24A1) C ONE CARU FOR tACH VARIABLE (IN ORDER) CONTAINING THE VARIABLE C NAME IN COLUMNS 1-24. THIS INCLUDES ALL VARIABLES BOTH READ IN C AND CREATEIJ BY TRANSFORMATIONS C C 4. INPUT DATA FORMAT CARD - FORMAT (18A4) C STANDARD FORTRAN FORMAT, INCLUDING PARENTHESES, USED TO READ C THE INPUT DATA. FOR EXAMPLE: (6F10.3) C C 5. OUTPUT DATA FORMAT CARD - FORMAT (18A4) SAME AS 4. ABOVE, EXCEPT USED FOR PRINTING INPUT DATA, r. TOL=0. 00005 c f 6. INPUT OATA TRANSFORMATION CARDS - FORMAT ( 5X , 3 1 3,4X , F9.0 ) C NOTE: THESE CARDS MOST BE OMITTED IF ICHG=0 IN 2. ABOVE. C A. TRANSFORMATION CARD FIELOS: (. COLS 7- 8: I (FIXED POINT FORMAT) C COLS 10-11 : J (FIXED POINT FORMAT) C COLS 13-14: K (FIXED POINT FORMAT) C COLS 19-27: L OR DL (FLOATING POINT FORMAT) C B. I: TRANSFORMATION CODE, INTREPETED AS FOLLOWS: C I TRANSFORMATION C 01 A(K) = A( J) ** DL C 02 A(K) = 1.0 / (A(J) ** DL ) C 03 A(K)=A(J)*A(L) 04 A(K) = A( J) / A(L ) C OD A(K ) = A( J) - A(L) C 06 A(K ) = SORT (A (J) ) C 07 A(K) a ELOG(A(J>) C OR A(K ) = FXPF(A< J) ) 09 A(K)=A(J)+A(L) 10 A(K) = SEQUENCE NUMBER OF DATA CARO 99 C 11 »UI » AIJ) ♦ DL C 12 AlK) = A(J) * DL C C C. THE SET Oh TRANSFORMATION CARDS MUST BE FOLLOWED BY A 360 C DATA SET DELIMITER CARD (/*>. C 1*0 C C 7. DATA CARDS - FORMAT GIVEN IN 4. ABOVE. C THE INPUT DATA CARDS MUST BE FOLLOWED BY A 360 DATA SET C DELIMI VER CARD ( /*) . c C 8. MODEL SELECTION CARDS - FORMAT (40F2.0) C BEGINING WITH COLUMN 2, EVERY OTHER COLUMN (I.E.. 2,4,6,8,...) C CORRESPONDS TO THE RESPECTIVE DATA VARIABLE (I.E., 1,2,3,4,...) C. THE CONTENTS OF THESE COLUMNS DETERMINES THE DISPOSITION OF THE C VARIABLE FOR THE REGRESSION CARRIED OUT AS FOLLOWS: C 0: VARIABLE NOT USED C l: INDEPENDENT VARIABLE C 2: DEPENDENT VARIABLE C 3: RESTART PROGRAM, I.E., RETURN TO 1. ABOVE C 4: END OF PROGRAM - RETURN CONTROL TO SYSTEM C NOTE: AS MANY MODEL CARDS AS DESIRED MAY BE USED ; EACH CARD C WILL CAUSE THE PROPER REGRESSION TO Bb CARRIED OUT. C 9. THE LAST DATA CARD OF ANY KIND MUST BE A 360 DATA SET DELIMITER C CARD (/*). f. •510 FORMAT ( 24A1 ) b 1 1 FORMAT |i VARIABLE *',I3,«: ',24A1/) 615 FORMAT (//• INPUT DATA:'//) iuOO FORMAT ( 12,13,12) 1U01 FORMAT (18A4) 1002 FORMAT ( • 1 ' ,2X,18A4) 1006 FORMAT (40(F1.0,1X) ) lo56 FORMAT (1RA4) I0b7 FORMAT (//• DATA INPUT FORMAT: »18A4) 1058 FORMAT (//• DATA OUTPUT FORMAT: »18A4) hUOl FORMAT (6X.F2.0, 1X,F2.0, 1 X , F2 . , IX, F6.0 ) H002 FORMAT ( ' • ,2X , ' ACHG ( • , I 2 , • ) = • , F3.0 , IX , F3.0, IX , F3.0 , 1 X, F6.0) •*J00 FORMAT (1H0,10H C(I,J)= ,6F6.2//) «*OG2 FORMAT (1H,7H SIZE= ,F10.2) 1066 FORMAT (•-•,2X,'VAR NO. • , 6X , • NAME • , 2 1 X , • MEAN • , 3X , • POP STD DEV», 12X, 'SAMP STU UEV / ) 1067 FORMAT (' ' , I 5 , 5X , 24A 1 , 3F12 . 5 ) '♦Bft FORMAT (4^H0TOO FEW DEGREES OF FREEDOM, TRY ANOTHER E0N/14H SAMPLE I SIZE =/18HINDEP VAR IN EON =,F5.0) 2000 FORMAT («QVAR NO . • , I 3 , • LEADS TO SINGOLARITY VALUE IS',F12.8) ^♦46 FORMAT (///2X, • I NT ERCORREL AT I ON MATRIX') <*bb FORMAT ( 7X , 24A1 , 5X , I 4 , 2X , 16F6.2 ) ^^>9 FORMAT (40X,8I6//24X,9I5) 3J09 FORMAT ( •-• ,18X, 'DEPENDENT VARIABLE IS NUMBER -• , I 3, • - • , 3X , 24A1 ) ^90 FORMAT (' ', 1 5X ,' SAMPLE SIZE =•, F6. 1 , 7X , 'DEGREES OF FREEDOM =',F6. II ) 3010 FORMAT ( •0',6X, , R**2 = «,Fb.3,7X,'R = • , F5. 3, 8X , • STD ERR OF EST =• 1 ,Fft.3) <*72 FORMAT (•0 , ,2x,'AOJ R**2 = ' , F5. 3, 3X, ' ADJ R = • , F5. 3, 4X, • ADJ STD E 1RR OF EST = • ,FP.3) 100 475 FORMAT < •- • , 2X , • L I NEAR REGRESSION EQUATION COEFFICIENTS') 3012 FORMAT (»0 VAR MO. NAME'23X'REG WT BTA WT WT SIG -RAT 110' ) 3053 FORMAT (• • ,2X , 14 ,3X ,24A1 ,F12.5, 3F1 1 .5 ) 469 FORMAT CO'///) 3091 FORMAT (»-• ,2X , 'RESULTS ARE IN RAW SCORES') 3086 FORMAT ('0',2X,'END OF PROBLEM' //« 2 • ) 430 FORMAT (*-',2X,'END OF REGRESSION PROGRAM' /• 1 • ) 9003 FORMAT (5016. R) 5000 FORMAT (//• DURBIN - WATSON STATISTIC: ' F7 .3, 20X • VON NEUMANN RATIO 1: «F7.3//) 5001 FORMAT ( • • 31)20.9) 5002 FORMAT (// T14, • ACTUAL ', T28 ,' EST IMATE '♦ T52 , 'RES I DUAL •// ) C C INITIALIZE PROGRAM PARAMETERS C 10 DO 14 1=1,20 AID( I )=0.0 DO 14 J=l,20 14 C( I ,J)=0.0 REWIND 3 C C READ TITLE READ (5,1056) ( T I TL t ( I ) , 1 = 1 , 18 ) WRITE (6,1002) (TI ILE ( K) ,K=1 , 18 ) C READ NUMBER OF VARIABLES, NVAR = 10 MAX 16 READ (5,1000) N I NO, NVAR, ICHG NIN0=NIND+1 ICI)CT = NVARM=NVAR+l M=NVARM IF (NVARM .LT. 1) GO TO 850 20 DO 24 1=2, NVARM C READ IN NAMES OF VARIABLES IN CARO COLS 1-24 K= I- 1 READ (5,510) (ANAM( J, I ) ,J = 1,24) 24 WRITE (6,511) K , ( ANAM ( J , I ) , J= 1 , 24) C READ IN DATA FORMAT READ (5,1001) (FMTIN( I), 1=1,18) READ (5,1001) (FMT0OT( I ),I=1,1R) C WRITE TITLE OF OUTPUT DATA C WRITE FORMAT USED TO READ IN INPUT DATA WRITE (6,1057) ( FMT I N ( I ) , I = 1 , 1 8 ) WRITE (6,105H) ( FMTOUT ( I ) , I = 1 , 1 8 ) IF ( ICHG .LE. 0) GO TO 38 KCHG=0 NTRANS=40 DO 35 L=1,NTRANS C RFAO IN VARIABLE TRANSFORMATIONS, MAX # ■ 10 30 READ (5,8001,tND=35) ( ACHG ( L , J ) , J= 1 ,4 ) C WRITE OOT TRANSFORMATIONS WRITE (6,H002) L , ( ACHG ( L , J ) , J= I ,4 ) KCHG=KCHG+1 GO TO 30 35 REWIND 5 C WRITE NAMES OF INPUT DATA VARIABLES 38 WRITE (6,1002) ( T I TL E < I ) , I =1 , 18 ) 101 40 55 60 12 74 7ft 79 80 M 82 HA WRITE 4 6.615) READ IN NINO COLS OF DATA PER DATA CARD FORMAT R6F STMT 1001 REWIND 5 READ (5,FMTIN,EN0=60) ( A ( I ) , I -2 ,N INO ) WRITE LIST OF INDEPENDENT VARIABLE INPUT DATA WRITE (6,FMT0UT) ( A ( I ) , I «2 ,N IND ) WRITE (3,9003) ( A ( I ) , I -2 ,NVARM ) A( n-i.o ICDCT=ICDCT+1 IF ( ICHG .GT. 0) CALL CHANGG DO 55 I=1,NVARM DO 55 J=I,NVARM C( I , J)=C( I ,J)+A( I )*A( J) GO TO 40 S I ZF = C (1.1 ) END FILE 3 REWIND 1 V( 1 )=DSORT(C( 1,1 ) ) DO 74 I=2,NVARM IF (C( I, I ) .LE. 0) GO TO 72 v(i) = = 1 .0 IF (AI(2)-3.0) 82,800,850 AKNT=0.0 00 84 I=1,NVARM IF (A( I ) .NE. AKNT=AKNT+1.0 CONTINUE IF (SIZE .GT. WRITE (6,4RR) 1 .0) GO TO 84 AKNT) GO TO SI?E,AKNT 86 102 GO TO 80 fl6 DO 92 1=1,NVARM IF (AIO( I ) .GT. 0) GO TO 90 CS( I)=1.0/V< I ) GO TO 92 90 CS( I)«V( I ) 92 CONTINUE DO 94 I«1,NVARM DO 94 J=1,NVARM 94 C( I ,J)=C( I,J)*CS< I)*CS< J) DO 180 N=1,M IF IAI (N) .EO. 1 ) GO TO 96 SDUT=0.0 GO TO 98 96 S0UT=1.0 98 IF (SOUT .EO. AID(N)) GO TO 180 IF ,MK,(C*V( I ) ) STER=C( I, I )/SIZE AST=SIZt/(SI2E-AM) A()SSR = STER*AST STER=DSORT(STER) ADSSR=SORT(ADSSR) DF=SIZE-AM RR=1.0-PCT R=DSORT(RR) ADJRR=1.0-(1.0-RR)*( ( S I ZE-1 .0 ) / ( S IZE-AM ) ) IF (ADJRR .GT. 0.0) GO TO 340 ADJRR=0.0 ADJR=0,0 GO TO 344 340 ADJR=OSORT( ADJRR ) 344 K= I - 1 C WRITE REGRESSION EOUATION STATISTICS WRITE (6,1002) (TITLE(MK),MK»1,18) WRITE (6,3009) K , ( ANAM ( MK , I ) ,MK»1 , 24 ) 10 k WRITE (6,490) SIZE, OF WRITE (6,3010) RR,R,STER WRITE (6,472} ADJRR , ADJR , ADSSR WRITE (6,475) ; WRITE TITLES FOR REGRESSION EQUATION COEFFICIENT TABLE WRITE (6,3012) DO 320 J*1,NVARM IF (AID(J) .NE. 1.0) GO TO 320 IF (I~J> 324,320,325 324 BETA»C( I ,J> GO TO 326 325 BETA=C( J, I ) 326 BVAR=C( I, I) *C U , J ) / ( S I ZE-AM ) BSTD=DSORT(BVAR) TRAT=BETA/BSTD K = J-1 BB( J )=BETA BVAR=BETA*V( J)/V< I ) ; WRITE REGRESSION EQUATION COEFFICIENTS WRITE (6,3053) K , ( ANAM ( NJ , J ) ,NJ«1 , 24 ) ,BETA , BVAR, BSTD, TR AT 320 CONTINUE SE=0.0 DIFS=0.0 KZ = 2 PR6=0.0 IN I = 1 WRITE (6,b002) 4002 READ ( 3 ,9003 , END=4004 ) ( A ♦ I A ) , I A = 2 ,NVARM ) EST=0.0 DO 4060 J=2,NVARM IF (AIO(J)-l.O) 4060,4059,4060 4059 EST = EST + BB( J)*A(.J) 4060 CONTINUE EST=EST+Bft( 1 ) A ( 1 ) =: fc S T RESI0=A( I )-EST SE=SE+RESID*RESID IF- (IN1-1) 4071,4071,4070 4070 DIFD=RESIO-PRE DIFS=DIFS+DIFD*DIFD 4071 PRE=RESIO WRITE (6,50011 A( I ) ,EST,RESIO I N I = I N I + 1 GO TO 400 2 4004 REWIND 3 D'.IRR = DIFS/SE V0N=SIZE*UURB/(SIZE-1.01 WRITE (6,5000) OURB,VON 300 CONT INUE WRITE (6,3091) GO TO 80 BOO WRITE (6,3096) IF (NVARM .LE. 820 GO TO 10 H50 WRITE (6,430) 0) GO TO 850 105 STOP END SUBROUTINE CHANGG COMMON A, ACHG, ICOCT t KCHG DOUBLE PRECISION A ( 40 ) , ACHG140,M ,DLD, ICOCT OC 100 I-WKCHG KBAB-ACHG( 1,1) ND-IDINT(ACHG( I ,2 ) ) MD«IOINT(ACHG( 1,3} ) LO»IDINT( ACHG1 I ,4) ) MD-MD+1 ND*N0+1 LD-LD+1 DLO-ACHGI 1 ,4) GO TO < I, 2, 3, 4, 5, 6, 7, 8, 9, 10,11, 12), KBAB 1 A(MD) =A(ND) **DLD GO TO 100 2 AIMD)*1 ,0/( A(ND)**DLD) GO TO 100 3 A(MD>=A(NO)*A(LD) GO TO 100 <♦ A(MD)*A(ND)/A(LD) GO TO 100 5 A(MO)*A(NO)-A(LO) GO TO 100 6 A(MD)=DSORT( A(ND} ) GO TO 100 7 A(MD)=DLOG< A(ND) > GO TO 100 R A(MO)=DbXP( A(NO) ) GO TO 100 9 A(MQ)=A(ND)+A(LD) GO TO 100 10 A(MD)=ICOCT GO TO 100 11 MMD)=A(ND)+DID GO TO 100 12 A(MD)=A(ND)*DLD 100 CONTINUE RETURN ENO >s» i « rfl &"* .