UM LIE-.3- A 3y Michigan State l 3‘ Univemy U Q \L.'..._____ ___________ This is to certify that the thesis entitled Sensitivity Calculations for Bond Graph Models of Linear Resistive Systems presented by David Richard Reed has been accepted towards fulfillment of the requirements for Master's dcgfifigfi, Mechanical Engineering flag» 1 Major professor Date M4;¢/97/9f% 0-7639 MSU is an Affirmative Action/Equal Opportunity Institution MSU LIBRARIES .—c_. RETURNING MATERIALS: Place in book drop to remove this.checkout from your record. FINES will be charged if book is returned after the date stamped below. SENSITIVITY CALCULATIONS FOR BOND GRAPH MODELS OF LINEAR EESISTIVE SISTERS By David Richard Reed A THESIS Submitted to Nichigan State University in partial fulfillment of the requirements for the degree of MASTER OF SCIENCE Department of Mechanical Engineering 1984 ABSTRACT SENSITIVITY CALCULATIONS FOB BOND GRAPE MODELS OF LINEAR BESISTIVE SYSTEMS By David Richard Reed Knowledge of the sensitivities of system response variables to a set of design parameters can he very useful in designing engineering systems. This thesis presents a method for calculating output sensitivities for linear resistive engineering systems modeled by bond graphs. A software module, written to interface with an existing bond graph processor. provides linear resistive system solutions and output sensitivities. The sensitivities are used to predict new solutions that result from parameter variations. ACKNOWLEDGMENTS I would like to thank my major professor, Dr. Ronald Rosenberg. Bis guidance, knowledge, and friendship have made this research possible. I would also like to thank DuPont and Chevron for providing fellowship support during my graduate study at Michigan State University. Finally. for her continuous love and support. I would like to thank my best friend and wife. Tamra. ii TABLE OF CONTENTS Page LIST OF FIGURES . . . . . . . . . . . . . . . . . . . . . . . . . . iv Chapter 1. INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . 1 2. THE STATIC MODULE . . . . . . . . . . . . . . . . . . . . . . 3 2.1 Implementation and Operation . . . . . . . . . . . . . . 3 2.2 Example 1 - Voltage Divider Circuit . . . . . . . . . . 5 2.3 Example 2 - 'heatstone Bridge Circuit . . . . . . . . . 7 3. STATIC MODULE SAMPLE RUN . . . . . . . . . . . . . . . . . . 9 4. SENSITIVITY CALCULATION METHOD . . . . . . . . . . . . . . . 12 5. SUMMARY . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 5.1 Conclusion . . . . . . . . . . . . . . . . . . . . . . . 16 5.2 Future Work . . . . . . . . . . . . . . . . . . . . . . 17 LIST OF REFERENCES . . . . . . . . . . . . . . . . . . . . . . . . 18 APPENDICES A. STATIC MODULE SUBROUTINES . . . . . . . . . . . . . . . . . 19 B. STATIC MODULE DATA BASE . . . . . . . . . . . . . . . . . . 21 C 0 STA“ C ”BULB SOURCE mDE O O O O O O C O C O O O O O O I O 22 iii Figure Figure Figure Figure Figure 1. 2. 3. LIST OF FIGURES Structure of a Linear Resistive System Voltage Divider Circuit 'heatstone Bridge Circuit Sample Run System Model Linear Resistive System iv Page 13 Chapter 1 INTRODUCTION Modern design of engineering systems often involves computer analysis of a mathematical model. Knowledge of the sensitivities of system response variables to a set of design parameters can greatly enhance the design process. The problem considered in this thesis is how to calculate the sensitivities of system outputs to resistive parameters for linear resistive engineering systems modeled by bond graphs [1]. Emphasis is placed upon efficient computation. Many practical system models fall into this class of systems. In general, output sensitivities can be obtained by stepping the parameters over a range of values and calculating the associated changes in output. Although this may be acceptable for small systems with only a few parameters, the computational burden increases significantly for larger systems. Numerous complete system solutions would be necessary to find the sensitivity of a set of outputs to each parameter. An alternative method for calculating output sensitivities for linear electrical resistive networks was given by Frank [2] and develOped more fully by Calahan [3]. The method is based on a general network theorem by Tellegen and makes use of an adjoint network 2 (sensitivity model) approach. The adjoint network solution and the original network solution are used to calculate precisely output sensitivities without recourse to an analytic expression. Adapting this adjoint system approach to bond graph models provided an efficient method for calculating output sensitivities. A computer software module called STATIC was written to interface with ENPORT‘S [4]. an interactive bond graph processor for linear dynamic systems. The combined program will solve linear resistive systems with constant inputs. calculate output sensitivities. and use the sensitivities to predict new solutions due to one-port resistance parameter variations. Chapter 2 describes the implementation and operation of STATIC and presents some examples. Chapter 3 illustrates a sample run through the STATIC module. Chapter 4 considers in detail the sensitivity calculation method and how it applies to bond graphs. Chapter 5 provides a summary of results and some suggestions for future work. Chapter 2 THE STATIC MODULE The STATIC module, when interfaced with ENPORT‘S. allows solution of linear resistive systems modeled by bond graphs. Such systems contain no C or I elements. The ENPORT‘S program processes the bond graph through equation formulation. Program control is then transferred to the STATIC module for solution. The inputs are set and the outputs are computed. The effort and flow on each resistive port (R-port) is also available. Next the sensitivity of each system output to each one-port resistive parameter (R-parameter) may be calculated. Finally a prediction of new system outputs due to changes in one or more Reparameters may be made. The prediction makes use of the calculated output sensitivities to generate a linear approximation to the new solution. 2.1 Implementation and Operation The calculation of sensitivities by the adjoint system method requires the computation of Report flows for both the original system and the adjoint system (see Chapter 4). The structure of both systems is identical and is defined by the original model. ENPORT‘S will process the model to the following Junction structure equations. Di B 833 ‘ D0 + 834 ‘ U (2.1) V - S43 ' D0 + 844 ‘ U (2.2) Do I L ‘ Di. (2.3) Di, Do, U. and V are vectors defined in Figure 1 and 833. S34. S43. S44. and L are matrices [5]. Equation (2.3) is substituted into (2.1) and the dissipation field (R-field) input Di is solved for as a function of U. The resulting equation is or - (I — szsoL)’1¢ 834 e U. (2.4) The R-field output is computed using equation (2.3). The Report efforts and flows are contained in Di and Do and are extracted using causality information. The junction structure output V is then computed using equation (2.2). SOURCE FIELD (SE,SF) U V JUNCTION STRUCTURE [S] (O.1,TF,GY) Di Do DISSIPATION FIELD [L] (R) Figure 1. Structure of a Linear Resistive System To calculate sensitivities, the adjoint system must now be solved. Since the structure is identical to the original system. equations (2.4) and (2.3) can be used with an adjoint input vector. All inputs are set to zero except the input corresponding to the desired output. which is 5 set to magnitude 1. The adjoint erield vectors are computed and the adjoint Rrport flows are extracted. The sensitivity of the desired system output to each one-port R-parameter is then calculated as the negative product of the Report flows from the original and adjoint systems. Chapter 4 develops the the adjoint sensitivity method in some detail. A prediction of a new solution can be made once the original solution, the output sensitivities. and a user-defined delta-R vector of changes are known. The following equation is used. V(k,predicted) - vm +2 ((dV(k)/dki)‘dRi) where dV(k)/dRi is the sensitivity of output V(k) to parameter Ri and dRi is the change in resistance for parameter Ri. A dR value may be set for each one-port Reparameter and the above summation is taken over all i, where i - 1 to r. the number of one-port resistors. 2.2 Example 1 - Voltage Divider Circuit Consider the linear resistive circuit of Figure 2 and its bond graph. 1 4 83—71—70—731? (0) 2 3 22 R3 Circuit Diagram Bond Graph Figure 2. Voltage Divider Circuit 6 Note that the zero flow source on port 4 of the bond graph represents the open circuit voltage output E4. The units are volts. amperes. and ohms. The inputs are E(l) 8 10, F(4) 3 O. The Rrparameters are R2 = 25. R3 ¢ 75. The bond graph was described to ENPORT‘S and processed. The STATIC module computed the system solution and calculated the sensitivities. The computer generated results are: SYSTEM INPUTS. . . SYSTEM OUTPUTS. . . E(1) ‘ 1.0000E+01 F(1) ‘ 1.0000E-01 F(4) = 0.0000E-01 3(4) ' 7.5000E+OO R ELEMENTS... E(2) 8(3) 2.5000E+OO F(2) - 1.0000E-01 7.5000E+OO F(3) 3 1.0000E-01 SENSITIVITIES... dF(1)/d(R2) 3 -1.0000E-O3 dF(1)/d(R3) ‘ “1.0000E-O3 dE(4)/d(R2) - -7.5000E—O2 dE(4)/d(R3) = 2.5000E-02 For comparison, the analytical solution of the voltage divider circuit is: OUTPUTS F(l) - E(l)/(R2 + R3) 3 0.1 E(4) = E(1)‘R3/(R2 + R3) ‘ 7.5 SENSITIVITIES dF(l)/d82 - ~5<1>I):G COMPUTATION COMPLETED. STATIC SOLVER OPTIONS (L.M.G.D.C.S,P.H,X, (FULL)):D SYSTEM INPUTS... SYSTEM OUTPUTS... E(1) 3 1.0000E+01 E(1) 3 2.0000E302 F(6) 3 0.0000E—01 E(6) 3 2.0000Ee00 DISPLAY EFFORTS AND FLOWS 0N RrPORTS? (Y): R ELEMENTS... E(2) 3 5.0000E+00 E(2) 3 2.0000E-02 E(3) 3 5.0000E+00 E(3) 3 2.0000E-02 E(4) 3 2.0000E+00 F(4) 3 31.0000E-02 E(5) 3 2.0000E+00 E(5) 3 1.0000E—02 STATIC SOLVER OPTIONS (L.M.G,D,C.S,P,H,K, (FUIL>):C CALCULATION COMPLETED. 11 srarrc SOLVER OPTIONS (L.M.G,D.C,S.P.R,x.(FULL>):S snusrrrvrrras... dF(1)/d(RZ) - ~4.ooooe-os ‘dF(1)/d(R5) -1.ooooe—os dE(6)/d(R2) dE(6)/d(R5) 34 . 0000E-03 4 . 0000E-03 SEISITIVITIES ASSOCIATED IITH MULTI-PORT R' S ARE NOT AVAILABLE. STATIC SOLVER OPTIONS (L.M.G,D,C,S,P,H.X.):P PREDICTOR OPTIONS : LIST THE dR VECTOR : MODIFY THE dR VECTOR : SET ALL dR VALUES ' GET THE PREDICTED SYSTEM SOLUTION : DISPLAY PREDICTED SYSTEM SOLUTION : HELP : EXIT PREDICTOR (3DEFAULT) NHUPMEI‘ mm OPTION (1) :S EITER d(RZ) ( 0.0000E-01):20 ENTER d(RS) ( 0.0000E-01):-20 PREDICTOR OPTIONS (L,M, S,G,D.H,X, ):D LINEAR PREDICTION OF SYSTEM SOLUTION. . . SYSTEM INPUTS. . . SYSTEM OUTPUTS. . . E(1) 3 1.0000E+01 F (1) 3 1.9400E-02 F (6) 3 0.0000E-01 E(4) 3 1.8400E+00 PREDICTOR OPTIONS (L.M.S.G.D.E.K. ):X STATIC SOLVER OPTIONS (L.M.G.D.C.S.P.E.K.):X PROCEED? (Y): At this point, program control was returned to EVPORT-S and the sample run was ended. Chapter 4 SENSITIVITY CALCULATION METHOD The basis of the adjoint system A method for calculating sensitivities is a general network theorem by Tellegen [6]. In bond graph terms. the theorem may be develOped as follows. Consider two bond graph models N and N’ which have the identical junction structure but possibly different types of field elements. The field elements are c, I. a. s2, and SF. Let (E(k),F(k)) and (E(k).F(k)) be the (effort.flow) on corresponding external ports (i.e.. field ports of the junction structure) of N and N. Further. let the corresponding power directions be the same. If n is the number of external ports on each junction structure, then Tellegen's theorem states that Earning) - o and Emotion) - o, for k - 1 to n. (4.1) Now let the efforts and flows in N change by amounts dE(k) and dF(k). Tellegen's theorem must still be satisfied. so that E (E(manum'fim - o and E (F(k)+dF(k))‘E(k) - o (4.2) which requires E muffin) - o and 2 muffin) - o. (4.3) Equations (4.3) can be combined and written as 2 (dE(k)‘F(k) - dF(k)‘E(k)) - o. (4.4) Equation (4.4) provides the key to sensitivity calculations. If the 12 13 elements of N are chosen correctly. each term of (4.4) can be forced to zero except the terms from the output port and the varied parameter port. A sensitivity can be directly calculated from the non-zero terms. As an example, consider the linear resistive system of Figure 5. The inputs are E(1) 3 constant. E(4) 3 zero. Assume the desired output is E(4) and the Reparameter to be varied is R2. The Tellegen sum (equation (4.4)) for each external port will be evaluated and the elements of N will be determined. N E Figure 5. Linear Resistive System For port 1 (k 3 1), dE(l) 3 0 because E(1) 3 constant. If E(1) is set to zero (implying a zero effort source on port 1 of N). the Tellegen sum for port 1 becomes (dE(1)¢F(1) - amnefiun - o. For port 2 (k 3 2). dR2 3 0. so dE(2) 3 R2'dF(2) + F(2)‘dR2. If R2 is duplicated in N. cancellation results and the Tellegen sum for port 2 becomes (dE(2)‘F(2) - dF(2)‘E(2)) .. F(2)3F(2)‘dR2. 14 For part 3 (k 3 3). dR3 3 0. so dE(3) 3 R3‘dF(3). If R3 is duplicated in N, cancellation results and the Tellegen sum for port 3 becomes (wanna) — «mamas» = o. For port 4 (k 3 4). dF(4) 3 0 because F(4) 3 constant. If F(4) is set to 1 (implying a flow source on port 4 of N). the Tellegen sum for port 4 becomes (dE(4)3F(4) - dF(4)-E(4)) - dE(4)‘(l). Summing the terms of equation (4.4) for ports 1 through 4 results in o + F(2)‘F(2)ednz + 0 + (113(4) - 0. Solving for the sensitivity, dE(4)/dR2 = -s(2)cF(2). Similarly. if R2 is held constant and R3 is varied, dE(4)/dR3 3 -F(3)‘F(3). Thus. for a linear resistive system with constant inputs. the sensitivity of an output to each one-port R-parameter can be calculated after solving for the Rrport flows of N and N. N'is called the adjoint system. In general, to construct the adjoint system for a linear resistive model. the following procedure is used. Note that the original bond graph model must contain a source corresponding to each desired output. (1) A11 R-elements in N are duplicated in‘N (including multi-port Rrelements) and retain the identical resistance parameters. (2) All independent sources in N are duplicated in N. The inputs are set to zero in N. (3) If the output under consideration is an effort, then the flow for that port (which is an input) is set to 1 in N. (4) If the 15 output under consideration is a flow, then the effort for that port (which is an input) is set to -1 in N. Thus, for a linear resistive model with one-port or multi-port resistors and independent effort or flow sources, the adjoint system N is nearly identical to the original system N. The only change is a different input vector U. Therefore. only a single reduction of the junction structure is necessary in order to solve both the original and adjoint systems. For computer solution, the junction structure is reduced and Di and D0 are computed given U using equations (2.4) and (2.3). The Rrport flows are extracted from Di, Do. Next. the adjoint input vector U corresponding to the output under consideration is substituted and Di and Do are computed. The adjoint flows are extracted and the output sensitivities are calculated. Chapter 5 SUMMARY A sensitivity calculation method for network models based on an adjoint network was adapted and applied to bond graph models. This adjoint system method allows calculation of the sensitivities of system outputs to one-port resistive parameters for linear resistive systems with constant inputs. A software module. STATIC, was written to interface with ENPORT-S, a bond graph processor for linear dynamic systems. The STATIC module computes static system solutions, calculates output sensitivities and predicts new solutions due to variations in one or more resistive parameters. 5.1 Conclusion For linear resistive bond graph models, the adjoint system approach provides an efficient method for computer calculation of sensitivities. Only one junction structure reduction is necessary to solve the original system and the one or more adjoint systems needed to calculate the sensitivities of system outputs to resistive parameters. 16 17 5.2 Future Iork Some suggestions for future work are: (1) DevelOp a sensitivity calculation method for C-fields and I-fields. C-field problems have. application in static deflection of compliant systems. (2) Deve10p a sensitivity calculation method for linear dynamic systems modeled by bond graphs.’ Possible considerations are state variable sensitivity. eigenvalue sensitivity. and frequency response sensitivity. (3) Make use of sensitivities in Optimizing system parameters. (4) DevelOp an efficient sensitivity calculation method for nonlinear systems. LIST OF REFERWCES LIST OF REFERENCES Rosenberg, R. C. and Karnopp. D. C.. INTRODUCTION TO PHYSICAL SYSTEM DYNAMICS, McGraw Hill, New York, 1983. Frank, P. M.. INTRODUCTION TO SYSTEM SENSITIVITY THEORY, Academic Press, New York, 1978. Calahan, D. A.. COMPUTERrAIDED NETWORK DESIGN, McGraw Hill, New York, 1972. Rosenberg, R. C.. 'ENPORT‘S User's Manual,’ A. H. Case Center, College of Engineering, Michigan State University, 1981. KarnopP. D. C. and Rosenberg, R. C.. SYSTEM DYNAMICS: A UNIFIED APPROACH, 'iley, New York, 1975. Penfield, P.. Spence, R. and Duinker, 8., TELLEGEN'S THEOREM AND ELECTRICAL NETWORKS, The M.I.T. Press, Cambridge, Massachusetts, 1970. Karnopp, D. C.. 'Power-conserving Transformations: Physical Interpretations and Applications using Bond Graphs,’ Journal of The Franklin Institute, Volume 288, No. 3, September 1969, pp. 175-201. Brayton, R. K. and Spence, R., SENSITIVITY AND OPTIMIZATION. Elsevier, New York, 1980. 18 APPENDICES APPENDIX A STATIC MODULE SUBROUTINES The following is a list of subroutines in STATIC with a brief description of each. STCALC STCOMP STDRVR STINPT STPRED STRDUC STSENS STSGET STSOLN calculates the sensitivity of each output to each one-port R-parameter. computes the effort and flow on each external bond. drives the STATIC module. lists or modifies/sets the inputs. predicts a new solution using the sensitivities and a user defined delta~R vector. reduces the junction structure matrices. prints the sensitivities to the terminal screen. gets the Sij sub-arrays from the 8 matrix. prints the system solution to the terminal screen. 19 20 The following is a calling tree for the subroutines in STATIC. DRIVER (mu) snmvs coon1 sumac CSMPY2 csmn)2 mmz srsos'r PRO emu STINPT PROMPTI GETRL1 nonns3 srcour csurr2 srsom ncnms3 PROMPT1 101ml STCALC csm2 srsms nonns3 sum) pl: 1 amp nonns3 cm: CSMPy CSADD2 sums“ PROCED1 1 Subroutine contained in IOUTIL (ENPORT) 2 Subroutine contained in CSUTIL (ENPORT) 3 Function contained in IOUTIL (ENPORT) 4 Subroutine contained in UFILER (ENPORT) APPENDIX B STATIC MODULE DATA BASE Many of the variables and arrays used in STATIC subroutines are shared with ENPORT35 through common files. A list of the shared common files and the variables used from each is given below. COMMON FILE VARIABLES USED SYBGBK IELLST, NBIMX, IBMX, NPTR, IMAM, IBNAM, NE, NBD CAUSBK ICMX CLASBK NFL, NFS RDUCBK S, IPS, LS, T, IPT, LM, UK, INK, LENIK, FL, IPFL, LENFL. '2, 1'2, LENWZ SOLNBK MAXU. U UTILBK. IERRF In addition to the shared common files, the STATIC module also uses a local common file called STATBK. A listing of each STATIC common file is given in Appendix C. 21 APPENDIX C STATIC MODULE SOURCE CODE The common files and subroutines in this appendix appear in the following sequence: 1. SYBGBK 9. STRDUC 2. CAUSBK 10. STSGET 3. CLASBK 11. STINPT 4. RDUCBK 12. STCOMP 5. SOLNBK l3. STSOLN 6. UTILBR 14. STCALC 7. STATBK 15. STSENS 8. STDRVR 16. STPRED The next several pages contain the source code for the STATIC module. 22 23 CSYBGBKOOOOOOOOOOOO0.0.COO...0....00.00.0000...OOOOOOOOOOOOOOOOO...OOOOC C C C-- COMMDN FILE SYBGBK: SYSTEM BONDGRAPH BLOCK C C C C--- SUPPORTS GRAPDR. BOND GRAPH DATA STRUCTURE C C C C-- VARIABLES: C IELLST LIST OF NODES BY TYPE NUMBER C NBIMX BONDS INCIDENT ON A GIVEN NODE C IBMX NODES ADJACENT TO A GIVEN BOND C NPTR POINTER TO START OF BONDS IN NBIMX FOR NODE I C IELNAM NAMES 0F NODES C IBNAM NAMES OF BONDS C C--- MOTEL THIS BLOCK SHOULD BE COORDINATED 'ITH GREDBK. SINCE C THE ARRAYS MATCH AND THE DIMENSIONS SET’BY PARAMETER C DECLARATIONS SHOULD TOO. C C PARAMETER (MNEL3100) PARAMETER (MNBD3100) C CHARACTER‘32 IELNAM(MNEL).IBNAM(MNBD) C C COMMON /SYBGB1/ NEL,NBD,IELLST(MNEL).NBIMX(MNBD‘2). + IBMX(MNBD,2),NPTR(MNEL+1).NMCR COMMON ISYBGBZI IELNAM, IBNAM C C CENDSYBGBKOOOOOOOOOOOOOOOOOOOOOOOOOOOOO0.0.0.0....OOOOOOOOOOOOOOOOOOOOOC C CCAUSBKOOOOOOOOOOOOOOOOOOOOOOOOO...0.0...00.0.0...OOOOOOOOOOOOOOOOOOOOOC c c c-- caussx SUPPORTS THE CAUSAL PROCESSSING OF THE GRAPH c c c c-- Icux CONTAINS THE CAUSAL INFORMATION. c O OTHER VARIABLES ARE DEFINED IN Ascau. c c ' c c-—-— THIS COMMON REQUIRES THE PRIOR USE OF iINSERI SYBOBK. c c PARAMETER (MNSTKM3100) PARAMETER (MNSTKN3100) “11mm (MAXBD313) PARAMETER (MAKND313) c canon Icausnx/ ICMX(MNBD'2) .MELMNT(MNSTKM) .MBNNMNSTKM) . + urromsmn ,NTEMP(MNSTKN) . + MTOP,NTOP.LEVEL, IBLIS (MAKBD) . + IchDmAIND) , IBPNT(1+MAKND/4) .NODLIS(1+MAIND/4) . + JPNT,KBOND.INODE c c CENDCAUSBKOOOOOOOO0.0000.0.000...COOO...CO...O0..OOOOOOOOOOOOOOOOOOOOOOC C 24 CMBKOOOOOOOOOOOOOOOOOOOOOOO0“...O...000......OOOOOOOOOOOOOOOOOOOOOOC C C C333 CLASBK SUPPORTS CLASS, DATA FOR BOND TYPE CLASSIFICATION C C BY FIELD. C C C C333 IBEO BOND EQUIVALENT LIST, MAPS INTEGER NAME INTO C C 'ORKING POSITION IN FIELD VECTOR. C C IBT BOND TYPE LIST. DEFINES BOTH FIELD TYPE AND CAUSALITY. C C SEE CLASS FOR DETAILS OF FIELD TYPES. C C NBEX NUMBER EXTERNAL (FIELD) BONDS C C NBIN NUMBER INTERNAL (JUNCTION) BONDS C C NFI NUMBER INDEPENDENT STORAGE BONDS (STATE) C C NFD NUMBER DEPENDENT STORAGE BONDS C C NFL NUMBER DISSIPATION (R) BONDS C C NFS NUMBER SOURCE BONDS C C NET NUMBER ITO-PORT (TF,GY) BWDS C C NFJ NUMBER OF (0.1) BONDS (SAME AS NBIN NO!) C C C333 REQUIRES THE PRIOR USE OF SYBGBK FOR PARAMETERS C COMMON ICLASBK/ IBEO(MNBD).IBT(MNBD).NBEX.NFI.NFD.NFL.NFS. + NBIN,NFT,NFJ C C CENDCLASBKOeseeesseeseseeseeseseesessesasseeeeassessesseesessseeeeseseec C cnpucnxsseesesessesseeeeeseeeseaccesseseeseeseeeeeeseseeseeeeeseseeesssc C C C333 RDUCBK : COMMON FOR REDUCE AND CSUTIL OPERATIONS C C333 VARIABLES: C S IS THE JUNCTION STRUCTURE ARRAY C I IS USED AS A 'ORKSPACE C UK 18 A WORKSPACE ARRAY C FL IS THE DISSIPATION FIELD MATRIX C FS IS THE STORAGE FIELD MATRIX C TP IS THE TF,GY MODULUS FIELD MATRIX C '2 IS A 'ORKSPACE ARRAY C A 18 THE SYSTEM 'A' MATRIX C B IS THE SYSTEM 'B' MATRIX C E IS THE SYSTEM 'E' MATRIX (DEPENDENT C,I) C LS IS THE JS MATRIX.BREAK POINT ARRAY C C333 NOTE. SPARSE ARRAY STORAGE: 8(1) CONTAINS THE SDATA. C IPS(I) GIVES THE X POSITION (RUNNING ROI INDEX). C AND LENS IS TOTAL NUMBER OF NONZERO ITEMS IN S. C OTHER SPARSE ARRAYS ARE SIMILAR. C 25 C333 PARAMETER DECLARATIONS: C PARAMETER PARAMETER PARAMETER PARAMETER PARAMETER PARAMETER PARAMETER PARAMETER PARAMETER PARAMETER PARAMETER PARAMETER (MAXS3400) (MAXT-MAXS) (MAXWK32‘MAXS/3) (MAXFL3100) (MAXFS3100) (MAXTP3100) (MAXW23MAXWK) (MAXA3250) (MAXB3100) (MAXE3100) (MAXC3100) (MAXD350) C C333 COMMON DECLARATIONS: C COMMON IBK8/ S(MAXS),IPS(MAXS),LENS,LS(16), T(MAXT).IPT(MAXT).LENT. WK(MAXWK),IWK(MAXWK).LENWK COMMON /BK9/ FL(MAXFL),IPFL(MAXFL).LENFL. FS(MAXFS).IPFS(MAXFS).LENFS. TP(MAXTP).IPTP(MAXTP).LENTP. W2(MAXW2).IW2(MAXI2).LENW2 COMMON /BK10/ A(MAXA).IPA(MAXA).LENA. B(MAXB).IPB(MAXB).LENB. E(MAXE),IPE(MAXE).LENE + + + + + + + C C CENDRDUCBKOOOOOOOOOOOOOO0.0....COCO....0.0.0.0.0...OOOOOOOOOOOOOOOOOO00c C CSQLNBKOOOOOOOOOOOOOOOOOOOOOOOCOOOOOOOOOOOOOOO0.00000000000000000000000C C c--- C C333 VARIABLES: TFIN NSAV DTSTR XSAVL USAVL DSAVL (DCICICDCSfbfhfifhfifhfif!(SCICOCEC) IS IS IS IS IS IS IS IS IS IS IS IS IS IS IS IS IS THE THE THE THE THE THE THE THE THE THE THE THE THE SOLNBK SUPPORTS SOLUTION PHASE WITH CONTROL DATA A MATRIX IN FULL STORAGE MODE B MATRIX IN FSM NUMBER OF STATE VBLS NUMBER OF INPUTS INITIAL CONDITION VECTOR STATE VECTOR AT TIME T INPUT VECTOR AT TIME T X3DOT VECTOR AT TIME T INITIAL TIME FINAL TIME NUMBER OF STAGES TO STORE RESULTS (TOTAL) DT STORAGE INTERVAL RESULTS ARRAY LOGICAL SAVE LIST FOR X VARIABLES LOGICAL SAVE LIST FOR U VBLS LOGICAL SAVE LIST FOR DX/DT VBLS NUMBER OF REQUESTS TO BE,SAVED C 26 PARAMETER (MAXX315) PARAMETER (MAXU310) PARAMETER muons”) PARAMETER (MAXRES3501) C LOGICAL XSAVL(MAXX).USAVL(MAXU).DSAVL(MAXX) INTEGER NREQ C COMMON IABMXBK/ AMX(MAXX.MAXX).BMX(MAXX.MAXU) COMMON IXVBLBK/ NX.XIN(MAXX).X(MAXX).DX(MAXX) COMMON IUVBLBK/ NU.U(MAXU) COMMON /TCTLBK/ TIN,TFIN,NSAV.DTSTR COMMON /RSLTHK/ RES(MAXRES.MAXXUD) COMMON ISAVEBK/XSAVL.USAVL,DSAVL,NREQ C C CENDSOLNBxseeeeeaesesseaseseeesesseeesseseecssseeseseeesseeeseseseeeessc C curngxssseesesseesseseeseesseseeeeeeeeseeeeeeesseeeeeeeceeesescssassesc C C C333 UTILBK GENERAL SUPPORT FUNCTIONS C C C C333 VARIABLES: IERRF ERROR RETURN VALUE ABNEW .TRUE. IF A,B ARE NEW TO SOLVIT DUMPFG SYSTEM LEVEL FLAG FOR DUMPING COMMON ITERM SPECIFIES KIND OF TERMINAL THE USER HAS DYNFLG IF TRUE WE HAVE A DYNAMIC SYSTEM STTFLG IF TRUE WE HAVE A STATIC SYSTEM GOOOOOO LOGICAL ABNEW,DUMPFG,DYNFLG,STTFLG 0 COMMON lUTILBK/IERRF,ABNEW,DUMPFG,ITERM,DYNFLG,STTFL C C CENDUTILBxsseseeeeseeesseeeseeseeeseeeseeseeeesseeseeeeeeeeeaeesaeeeesec C 27 CSTAIBKOOOOOOOOOOOOOOOOOOOOOOOOOOOOO..0.00000000000000000000000..Oc C C333 STATBK 3 LOCAL COMMON FOR THE ENPORT STATIC MODULE C C--- THIS COMMON REQUIRES THE PRIOR USE OF iINSERT SOLNBK. C C333 VARIABLES MLTPRT 3 POWRIN 3 MAXR 3 MAXU INLST IRLST ISLST IPDU DI D0 .. EFRT FLOW 34 _. SN DR U .. v .. C2(hfhfhflflflfhfhfifi(OCICICICDCOCTCRCTCICDC) TRUE IF MULTI-PORT R IS PRESENT TRUE FOR POWER INTO SYSTEM (MAXU‘l) MAXIMUM R3PORTS ALLOWED MAXIMUM SOURCES ALLOWED (FROM SOLNBK) LIST OF NODES OF ONE-PORT R'S LIST OF BONDS ON R'S W/CAUSALITY LIST OF BONDS ON SOURCES W/CAUSALITY POINTER FOR DI,DO,U,V VECTORS R-FIELD INPUT VECTOR (Di) R-FIELD OUTPUT VECTOR (Do) EFFORT VECTOR (SORTED FROM Di AND Do) FLOW VECTOR (SORTED FROM Di AND Do) STORAGE FOR 844 MATRIX SENSITIVITY ARRAY d(Vi)/d(Rj) DELTA-R VECTOR SYSTEM INPUT VECTOR (FROM SOLNBK) SYSTDI OUTPUT VECTOR NOTE: MAXR MUST BE GREATER THAN MAXU. PARAMETER (MAXR325) PARAMETER (MAXRU3MAXR‘MAXU) PARAMETER (MAXUU3MAXU‘MAXU) LOGICAL MLTPRT,POWRIN(MAXU) COMMON lSTATBl/ MLTPRT,POWRIN COMMON [STATB2/ INLST(MAXR),IRLST(MAXR),ISLST(MAXU) COMMON /STATB3/ DI(MAXR),DO(MAXR),EFRT(MAXR).FLOW(MAXR). + OR(MAXR),IPDU(MAXR).V(MAXU) COMMON ISTATB4/ S4(MAXUU).IPS4(MAXUU).LENS4. + C SN(MAXRU).IPSN(MAXRU).LENSN C C C C CENDST‘IBKOO0.0.0...0.0...OOOOOOOOOOOOOOOOOOOOOOO0.000000000000000C C ENPORT STATIC MODULE C C CSTDRVR >>>>>>>>>>>>>>>>>>>>>> STDRVR <<<<<<<<<<<<<<<<<<<<<<<<<<<HELP. STATIC ' CALL RHFILE(FNAME) ELSEIF (ANS.EQ.'X') THEN] CALL PROCED(PROCFG) RETURN 31 ELSE WRITE(‘,‘)' “‘ THIS IS NOT A VALID OPTION.’ ENDIF FULL-.FALSE. GO TO 100 END C C CENDSTDRVR C C C CSTRDUC )>>>>>)>>>>>>>>>)>>>)> STRDUC <<<<<<<<<<<<((<<<<(<(<<((<<)>)>)>)>>>>>)>>>>)>> STSGET <<<<<<<<<<<<<<<((<((<<<((((( C SUBROUTINE STSGET(SIJ.IPSIJ,S, IPS.L1.L2) OGOOO 34 C C C-- PROGRAMMER: D.R.REED (SPRING 1984) C C C -STSGET'EXTRACTS AN SIJ SUB-MATRIX FROM THE JUNCTION C STRUCTURE MATRIX S (ALL IN SPARSE FORM). C C C-- DECLARATIONS C C DIMENSION SIJ(‘).IPSIJ(‘).S(‘).IPS(‘) C C cOOOSTSGETOOOOOtoOOOOOOOOOOtoOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOC C C DO 10 I-L1,L2 SIJ(I-L1+1)=S(I) IPSIJ(I-L1+1)‘IPS(I) 10 CONTINUE RETURN END C C CMSTSGET C C c CSTINPT >>>>>>>>>>>>>>>>>>>>>> STINPT <<<<<<<<<<<<<<<<<<<<<<<<<<<)>)>>))>>>)))>))>>>> STSOLN <<<(<<<<<<<<<<<<<<((((((<<()>>)>)>>>>>>>)>>)>>> STCALC <((((((<(((((<(<<(<(<<(<((<))))>>>>>>)>)>>>>>>> STSENS (<<((<((<<(<(<<(<(<<<(((((<(C C C SUBROUTINE STSENS C C C-- PROGRAMMER: D.R.REED (SPRING 1984) C C C-- STSB‘IS SEOWS mE SEWSITIVITIES FOR C ENPORT'S STATIC MODULE. C C C-- DECLARATIONS C C SINSERT SYBGBK SINSERT CLASEx SINSERT SOLNER SINSERT STATBK C c CRARACTER‘I OTYPE CHARACTER”; INODE CEARACTER‘S IEOND C C COOOsrsgnsOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOC C C C--- PRINT SENSITIVITIES WRITE(‘,1000) 1000 FORMAT(/.7X.‘SENSITIVITIES...') DO 200 NS-1.NFS IF (ISLST(NS).GT.0) TEEN OTYPEs'E' ELSE OTYPEE'F' ENDIF IBOND-IBNAM(ABS(ISLST(NS))) WRITE(‘.'(1X)') DO 100 NRF1.NFL IF (INLST(NR).EQ.0) GO TO 100 INODEFIELNAM(INLST(NR)) WRITE(‘,2000)OTYPE.IBOND(1:NCEARS(IBOND))F + INODE(1:NCEARS(INODE)).SN((NS-1)‘NFL+NR) 2000 FORMAT(' d',A1,'('.A,')/d(',A,') = ',1PE11.4) 100 CONTINUE 200 CONTINUE IF (MLTPRT) WRITE(‘.3000) 3000 FORMAT(/' SENSITIVITIES ASSOCIATED WITE MULTIPORT'. + ' R"SARENOT AVAILABLE.') RETURN END C C CENDSTSENS C C C 41 CSTPRED >>>>>>>>>>>>>>>>>>>>>> STPRED <(<<(<<(<((<(((<(<<<((<<<(<(C C C SUBROUTINE STPRED C C C-- PROGRAMMER: D.R.REED (SPRING 1984) C C C--- STPRED PREDICTS STATIC SYSTEM SOLUTIONS USING TEE CALCULATED C SENSITIVITIES AND A USER SUPPLIED DELTAPR.VECTOR. C C C-- DECLARATIONS C C SINSERT SIEGER SINSERT CLASRK SINSERT RDUCEK SINSERT SOLNER SINSERT UTILBK SINSERT STAIER c C LOGICAL FULL,NEwLIN.ENDLIN,PREFLG CHARACTER” ANS,ITYPE.OTYPE CHARACTER"; INODE CRARACTER‘B IBOND CEARACTER¢7O STRING REAL DV(MAXU) C C c0.ts‘rpmtttttttt0.0.00.0.0.0.00..00000OOOOOOOOOOOOOOOOOOOOOO0.00C C C C—-- INITIALIZE FULL=.TRUE. RLO--1.0E+10 RBI: 1 .0E+1O NEWLIN-.TRUE. DO 1 NS-1.MAXU 1 DV(NS)=0.0 PREFLG=.FALSE. C-- BE SURE TEEREyARE ONE-PORT R ELEMENTS TO VARY DO 10 NRF1.NFL 10 IF (INLST(NR).NE.O) GO TO 100 C-- OOPS. NO ONEPPORT R'S TO VARY. RETURN TO STDRVR WRITE(‘.9000) 9000 FORMAT(/' NO ONE-PORT R PARAMETERS TO VARY.') IF (MLTPRT) WRITE(‘.9010) 9010 FORMAT(' VARYING OF MULTIPORT R"S IS NOT AVAILABLE.') RETURN C C--- PRINT PREDICTOR OPTIONS 100 CONTINUE IF (FULL) TEEN WRITE(‘.1000) 1000 FORMAT(/' PREDICTOR OPTIONS' II 0 /' L: LIST TEE dR VECTOR' /' M: MODIFY TEE dR VECTOR' /' S: SET ALL dR VALUES' + + + + 42 + /' G: GET TEE PREDICTED SYSTEM SOLUTION' + I' D: DISPLAT PREDICTED SYSTEM SOLUTION' + I' E: EELP' * I' X: EXIT PREDICTOR (‘DEFAULT)' + I! 0) STRING" ENTER OPTION (X):' ELSE WRITE(‘.'(1X)') STRINGB' PREDICTOR OPTIONS (L,M,S,G,D,E,X,(FULL)):' ENDIF c c--- REQUEST AND GET SELECTED OPTION CALL PROMPT(STRING) NEWLIN-J‘RUE. ANS=' ' CALL GEND