n. V ‘4 ~ Fl;~_u.r.‘-'-"‘ J" “Kim“; 3“ ‘ :revu. ' - A o 3'71, ‘ I ‘ ‘1)?» .y A. ' 431.. -\;.r: In». $~1m1~. ‘.h!.' 4 Mg.“ . -n u: #1 .. u 5‘: ~ 30%! Jig‘m' :p - U.- “N,” , I); fitté In}- a .. . .1. .K 2%..» a (guy-'7 -; rm was-wt: ;~*.:.*':¢:~r..~3‘:wr , "'4‘?“ ‘- “mitt-Ami, '7 - .u .m “u 4...; .~ .,. ‘ 4 !-..1. 5-.» ‘ 3'4 Lac-flau‘Jl 1‘ ”m; a u~u7c .‘ L ‘11.“. ‘-‘ . «.25 w. uptdz'r’“ ‘ i3 ’. -5; sen;- ‘ I u ,. ‘r‘ 4 L... 3} . 3971‘??- .. ”42' 3-4... _ A “a“, n.:. " ”\mtv_l-ar.o~. ‘Luot‘4—JH > .. s -. rMU-II ‘ . 32.1. l“ .- r. : mug“ .. am“ an. J 14:. a :3 LT"- 5‘ .‘n - . «In: ' V7. 7.. and" u, .. .r 1 ~ . 1.4. ~ .‘1' l ' ' .. .. - - " . (w .llh“l "“‘"’ ‘ f 4.1-, g 3,. 2’ “L9,: . a. ‘3‘. fun; xi}: «.1 . ~ ( elm? Ia-t # . ":1 mm..-“ . 1‘: V .. can?!” A“ .kh «and I ‘ “z. 4.”; . ... , 30p wk: .J‘u';"““"’;, .. w.“ u.,3£,. ...~., . Illllji'liljill?1i"'lllill'llll'llllllill 1 93 00882 5717 l | I This is to certify that the thesis entitled DYNAMIC MODEL OPTIMIZATION USING COMPUTATIONAL TECHNIQUES presented by Mark Lee Davis has been accepted towards fulfillment of the requirements for JAMS— degree in _Me_chan1cal Engineering \jvu’iz t /‘6’L—( Major professor ”1/, L/ Date 2/24/92 0-7639 MS U is an Affirmative Action/Equal Opportunity Institution Michigan State 1 LEBRARY 3 University PLACE IN RETURN BOX to remove this checkout from your record. TO AVOID FINES return on or before date due. DATE DUE DATE DUE DATE DUE | |__ | II MSU Is An Afflnnetlve Action/Equal Opportunity Institution cMMmG-nt DYNAMIC MODEL OPTIMIZATION USING COMPUTATIONAL TECHNIQUES By Mark Lee Davis A THESIS Submitted to Michigan State University in partial fulfillment of the requirements for the degree of MASTER OF SCIENCE Department of Mechanical Engineering 1992 ABSTRACT DYNAMIC MODEL OPTIMIZATION USING COMPUTATIONAL TECHNIQUES BY Mark Lee Davis Simulation modeling software can create and solve a set of differential equations and provide numerical results of the system state responses. Optimization software can explore a design space, searching for a feasible solution which best satisfies a given cost function. Our objective is to establish an interface between these two types of software packages, so the strengths of each are joined in an effort to reduce design time while ensuring accuracy. A specific interface between modeling and optimization software has been established using ENPORT for simulation and OPTDESBYU for optimization. By using this interface dynamic responses can be optimized with respect to system design variables for any bond graph model. Design time can be reduced while maintaining confidence in the results. DEDICATION To my devoted and loving wife Diana and My sons Mark, Brian and Eric ACKNOWLEDGMENTS I would like to begin by expressing my appreciation to the College of Engineering, the Department of Mechanical Engineering and the CASE Center for the support that made this opportunity of a lifetime possible. My thanks go to the CASE Center staff consultants who, with great satisfaction, answered my many questions. I would like to thank Dr. Clark Radcliffe for both his service as a committee member and also his valuable input to the final thesis document. Finally I wish to express my thanks to professors Ronald Rosenberg and Alejandro Dfaz my co-advisors. With the wisdom and guidance displayed by these men this accomplishment was possible. TABLE OF CONTENTS LIST OF TABLES .................................................................................................. viii LIST OF FIGURES ................................................................................................ ix NOMENCLATURE ............................................................................................... xi 1 INTRODUCTION 1 1.1 Motivation ................................................................................................... l 1.2 Basic Problem .............................................................................................. l 1.3 Organization of Thesis ................................................................................ 2 2 CURRENT STATUS 3 2.1 Simulation Using EN PORT ........................................................................ 3 2.2 Optimization Using OPTDES ..................................................................... 4 2.3 Interfacing ENPORT and OPTDES ............................................................ 5 2.3.1 Describing the Interface Connection .................................................. 6 3 AN APPLICATION EXAMPLE 8 3.1 Introduction ................................................................................................. 8 3.2 Design Problem Considerations .................................................................. 8 3.3 Bond Graph Design ..................................................................................... 13 3.4 Optimization Problem ................................................................................. 14 3.4.1 Objective Functions .......................................................................... 14 3.4.2 Model and Optimization Parameters ................................................ 15 3.5 Results ......................................................................................................... 17 3.5.1 Problem 1 Summary ......................................................................... 17 3.5.2 Problem 2 Summary ......................................................................... 21 3.5.3 Problem 3 Summary ......................................................................... 26 3.6 Discussion .................................................................................................. 3O vi 4 CONCLUSIONS . 31 4.1 Summary ...................................................................................................... 31 4.2 Recommendations ....................................................................................... 31 APPENDICES A DESIGN AND IMPLEMENTATION CONSIDERATIONS 33 A.l Introduction ................................................................................................ 33 A2 Design Variables ........................................................................................ 33 A3 Analysis Functions ..................................................................................... 34 AA General Model Design ............................................................................... 36 B MULTIPLE FORCING SYSTEM PROBLEM 38 B.1 Introduction ................................................................................................ 38 B.2 Posing the MFS Optimization Problem ..................................................... 38 B.3 AF-Vector Build for the MFS Problem ..................................................... 39 B.4 Setting Up the MFS Problem In OPTDES ................................................ 39 B.5 Determining the Objective Function Value ............................................... 40 B.6 Summarizing the MFS Optimization Problem .......................................... 40 C USER WRITTEN SUBROUTINES AND SAMPLES 42 Cl Introduction ................................................................................................ 42 C2 User Written Generator (U SRGEN.FOR) ................................................. 42 CS User Written Menu (U SRMEN.FOR) ....................................................... 45 CA User Written AF—Vector Build (U SRAFN.FOR) ...................................... 48 D HOW TO USE THE OPTIMIZATION INTERFACE 51 DJ Introduction ................................................................................................ 51 D2 Executing the DSMOPT Command File ................................................... 51 D3 Executine ANAPRE .................................................................................. 63 E MANAGING THE INTERFACE SYSTEM 69 El Interface Directory ..................................................................................... 69 E2 OPTDES Directory .................................................................................... 69 E3 Command File DSMOPT Maintenance ..................................................... 7O vii F INTERFACE COMPUTER PROGRAMS 71 El Introduction ................................................................................................ 71 F2 ANASUB.FOR .......................................................................................... 72 F3 DSMOPTCOM ......................................................................................... 102 R4 SYSPRMEDT ........................................................................................... 11 1 RS SYSDATEDT ........................................................................................... 113 R6 CDESZDPT ............................................................................................... 115 G APPLICATION EXAMPLE DATA 117 G] Introduction ................................................................................................ 117 G.2 Input Vector (U) Datafiles ......................................................................... 117 GB ENPORT Output Files ............................................................................... 121 G4 Optimization Datafiles ............................................................................... 131 6.5 ANAPRE Data Entry ................................................................................. 137 G6 Signal Generator Bond Graph ................................................................... 138 LIST OF REFERENCES ....................................................................................... 140 Table 3.4.1 Table 3.4.2.1 Table 3.4.2.2 Table 3.4.2.3 Table 3.5.1.1 Table 3.5.2.1 Table 3.5.3.1 Table 3.6.1 Table G.5.l LIST OF TABLES Problem Characterization Analysis Variables Performance Measurements Analysis Functions Problem 1 Results Problem 2 Results Problem 3 Results Problem 2 Results Comparison ANAPRE Data Entry List viii 14 15 15 16 17 21 26 30 137 Figure 1.2.1 Figure 2.1.1 Figure 2.2.1 Figure 2.3.1 Figure 2.3.2 Figure 2.3.1.1 Figure 3.2.1 Figure 3.2.2 Figure 3.2.3 Figure 3.2.4 Figure 3.3.1 Figure 3.5.1.1 Figure 3.5.1.2 Figure 3.5.1.3 Figure 3.5.2.1 Figure 3.5.2.2 Figure 3.5.2.3 Figure 3.5.2.4 Figure 3.5.3.1 Figure 3.5.3.2 Figure 3.53.3 LIST OF FIGURES Mechanical Positioner ENPORT Data Flow - OPTDES Data Flow ENPORT - OPTDES Connection Interface Function ENPORT - OPTDES- INTERFACE Connection” .... ...... ...... 5 D.O.F. Suspension System Road Profile 1 - Severe Bump _ - Road Profile 2 - Highway Condition No. 1 Road Profile 3- Highway Condition No. 2 - 5 DOF Bond Graph Objective Function and Active Constraint Responses to Initial Design Variables: Problem 1 Objective Function and Active Constraint Responses to Optimal Design Variables: Problem 1 Objective Function Iteration History: Problem 1 ......... Objective Funtion Response to Initial Design Variables: Problem 2 ..... Active Constraint Response to Initial Design Variables: Problem 2 Objective Function and Active Constraint Responses to Optimal Design Variables: Problem 2 Objective Function Iteration History: Problem 2 .............. .. Objective Funtion Response to Optimal Design Variables: Problem 3 Active Constraint Response to Optimal Design Variables: Problem 3 - - ..... Objective Function Iteration History: Problem 3.. 18 19 20 -22 23 24 25 -27 -28 Figure A.3.1 Figure A.4.1 Figure B.3.1 Figure D.3.1 Figure F.1.1 Figure G.6.1 X Performance Evaluation Data Flow 35 User Entry of System Parameters 37 Example of MFS AF-Vector 39 Branching Tree for ANAPRE Execution 64 ENPORT, OPTDES and INTERFACE Data Flow ........... 71 Signal Generator Bond Graph 139 AF AV DV MFS NFF aaaaga OF OP PM PM NFFCN NOMENCLATURE ANALYSIS FUNCTION ANALYSIS VARIABLE DEGREES OF FREEDOM DESIGN VARIABLE EFFORT/FLOW MULTIPLE FORCING SYSTEM NUMBER OF FORCING FUNCTIONS FORCING FUNCTION NUMBER NAMED PARAMETER NUMBER OF PERFORMANCE MEASUREMENTS NUMBER OF INPUT VARIABLES NUMBER OF STATE VARIABLES NUMBER OF OUTPUT VARIABLES OBJECTIVE CONSTRAINT OBJECTIVE FUNCTION OBJECTIVE PERFORMANCE PERFORMANCE MEASUREMENT PERFORMANCE MEASUREMENT METHOD STATE VARIABLE INITIAL CONDITIONS ENPORT MODEL OUTPUT RESPONSE xi 1.1 1.2 CHAPTER 1 INTRODUCTION Motivation Simulation software can create and solve a set of differential equations and provide numerical results of the system state responses. Optimization software can explore the design space, searching for a feasible solution which best satisfies a given cost function. In general simulation software does not have the capability to systematically search a design space for an optimal solution. The user must do this by hand, guessing design variable changes. Similarly, optimization software is not capable of assembling and solving a set of differential equations; this task must be done by the user. Each of these software package types has limitations in providing a complete service to the design engineer. Our objective is to establish an interface between these two types of software packages. By doing so the strengths of each will be joined in an effort to reduce design time while ensuring accuracy. Basic Problem In dynamics design considerations often relate to controlling the transient or steady state response for an excited system. The desired response will be a function of the individual system components and their inter-relationships. Hence changing component values will alter the system response. Consider a mechanical position control system. 1.3 r’ xm F(t) K1 \ _. Mass VVW§ +§ C1 \ «SESVEQ EV? W\ Figure 1.2.1 Mechanical Positioner Typical design objectives include minimizing settling time or rise time, setting displacements, and so on. Each objective requires a particular design. The design variables of this system might be the spring, mass and damper parameters. These parameters will typically be bounded by design limitations. The question then becomes "Which combination of design variables best meets the objective?" Optimization is a systematic process of searching for the feasible design which best satisfies an objective function. In a 1-DOF problem like this analytical results may be obtainable. However, in multi-DOF problems analytical solutions are not easily found and the search space becomes very large. With our interface it is possible to optimize a multi-DOF model relative to a specific objective with proven computational techniques. Organization of the Thesis In chapter 2 an overview of modeling and optimization software is discussed. The advancement made by the interface software is described. An example illustrating use of the interface is presented in chapter 3. The problem is a 5 DOF suspension system posed and solved 3 different ways. Chapter 4 will conclude the report with a summary and recommendations. In the appendices the reader will find discussion detailing the interface. In appendix A design considerations made in ENPORT [1] and OPTDES [2] will be discussed. Appendix B will discuss a special class of problem where the system is driven by multiple inputs. To expand the interface capablilites the user can create their own program model which can be used with the ENPORT model. These user written subroutines are discussed in appendix C. Appendix D is the users guide. CHAPTER 2 CURRENT STATUS 2.1 Simulation Using ENPORT ENPORT is a modeling and simulation software package which aids in the performance assessment of dynamic systems. ENPORT is based on bond graph theory. It combines a set of standard block diagrams and bond graph elements to build system models. With ENPORT the user can create output files of the state equations describing the model behavior. This software is typical of simulation packages in that it is capable of determining the state response of an N-DOF system but does not explore the design space in search of an optimal design solution. Given a specific set of design variables, ENPORT generates a set of output responses. . ENPORT Y I I NP MODEL DESIGN RESPONSE VARIABLE OUTPUT VALUES Figure 2.1.1 ENPORT Data Flow With ENPORT the user must enter a set of design variables by hand, then examine the system response to determine design changes. To provide a convenient way to search the design space ENPORT can describe the set of design variables using named-parameters (NP). By changing the NP vector the user can study new 4 designs. By examining the output responses (Y) the user can determine if the new design is better, feasible, and which changes can improve the model performance. Optimizing with simulation software is obviously burdensome to the design engineer. 2.2 Optimization Using OPTDES OPTDES is a design optimization software package. Within OPTDES many optimization algorithms for exploring the design space are offered. The user can control the design search by changing the step size, convergence tolerance, and other parameters. The design space can be scaled, which improves algorithm performance and identifies active constraints more simply. OPTDES provides many post- processing features. OPTDES is typical of most optimization software in that it passes a set of independent design variable values (AV) to the model and receives a set of analysis function values (AF) back from the model. To start the optimization process the user provides an initial design point (AVG) and the final optimized design is returned (AVf). AF . , AV ----- -| MODEL —----. (ANAFUN) mi}... visa. RESPONSE VALUES OUTPUT L—‘i OPTDES Avfi QAV0 I USER I Figure 2.2.1 OPTDES Data Flow The analysis functions are used to evaluate the performance of the model to determine the best feasible design. With OPTDES the user must develop and program the set of equations describing the model. The equations program name used with the OPTDES software is ANAFUN. In an N-DOF problem this process will require much time and allows for errors to creep into in the model. When 5 designing, an engineer requires accuracy and speed in building a model, which optimization software does not provide. 2.3 Interfacing ENPORT and OPTDES The interface is intended to combine the equation solving capabilities of ENPORT with the design space exploration power of OPTDES. By doing this models built in ENPORT can be optimized. I MODEL MODEL DESIGN RESPONSE VARIABLE OUTPUT VALilES AF | AV OPTDES I AVr i iAVo LUSELJ Figure 2.3.1 ENPORT - OPTDES Connection FIGURE 2.3.1 illustrates the ideal interface between ENPORT and OPTDES. This figure shows the relationships between the AV and NP vectors and the Y and AF vectors. The ENPORT model receives a set of design variables (AV/NP) from OPTDES and returns the analysis functions (Y IAF) for evaluating the system performance. The purpose of the interface is to make the transition from the variable forms AV to NP and Y to AF. 6 As seen from FIGURE 2.3.2 the NP and AV vectors are the same. This allows the ENPORT model to receive design variables directly. Output from the Y I MODEL 4 I (ENPORT) OPTDES I Aw i LAV. mu Figure 2.3.2 Interface Function ENPORT model is a function of time. As a result the time response must be evaluated to provide OPTDES with the analysis functions in the proper format, a constant value (i.e. AB = max IX(t)I). 2.3.1 Describing the Interface Connection Enport has the capability of generating a Fortran file defining a set of N coupled first-order differential equations from the system graph model. This ENPORT file can be used to calculate the state derivatives for a given set of initial conditions. Within OPTDES (in subroutine ANAFUN) is an integration routine (4th order Runge-Kutta) which can call the ENPORT Fortran file and produce a time response of the system. 7 MODEL l g Y i LNP IINTERFACE I (ANAFUN) AF OPTDES } AV l Afo HIVo LUSERJ Figure 2.3.1.1 ENPORT - OPTDES - INTERFACE Connection OPTDES passes the design variables to the interface through the AV vector. The interface calls the ENPORT Fortran file, passing the design variables through the NP vector. ENPORT returns a time history to the interface through the Y vector. The interface now evaluates the time history and returns the analysis function values to OPTDES through the AF vector. One consideration in designing this link was to establish a standardized call to the ENPORT Fortran file, which makes this connection possible for any bond- graph model. In addition this connection will work with any filcname given to the ENPORT Fortran file. This allows for a library of models to be created from which the user can select one for optimization. 3.1 3.2 CHAPTER 3 AN APPLICATION EXAMPLE Introduction To illustrate the capabilities of the interface the design of a 5-DOF suspension system was used. The problem posed here is a re-creation of the one given by Haug and Arora [3]. In their solution they employed analytical methods to determine the state equations and the derivatives of the design functions with respect to the design variables. Using computational methods this model was optimized. With this interface the state equations will be generated by ENPORT. OPTDES will then determine the necessary gradients to explore the design Space. With the interface the design engineer is responsible for building the bond-graph in ENPORT and posing the optimization problem in OPTDES. As we shall see the results obtained for the objective function using the design interface were within 5% of those obtained by Hang and Arora for each problem. Design Problem Considerations The following schematic illustrates the 5 DOF suspension system being designed. Figure 3.2.1 5 D.O.F. Suspension System The system is excited by tire displacements due to interaction with the road surface. Three surfaces were considered representing a severe bump and two different highway conditions. For modeling purposes the tire displacement profiles were differentiated one time. The result is a velocity profile of the tire input The velocity can be modeled as a source of flow into the ENPORT model. The following velocity profiles were used. fife—o 6m 5.50 4.50 10 velocity _profile {iii—— / \ // NX=>IA I I I I ~71...__./ 0.” 0.40 0.50 0.80 we Figure 3.2.2 Profile 1 - Severe Bump his-ft 6m. 11 velocity _profile 5.00 4.00 3.00 2.00 1.00 aco— 4.00 ' -3.oo 4.00 em Figure 3.2.3 Profile 2 - Highway Condition No. 1 VM his-ft 1.20 LN 0.80 0.60 0.40 0.20 -0.40 «0.60 0.80 4.00 4.20 12 velocity _profile / 0.00 \ 0.20' 0.40 0.60 Figure 3.2.4 Profile 3 - Highway Condition No. 2 0.80 1.00 13 3.3 Bond Graph Design The bond-graph model of Figure 3.3.1 was built in ENPORT. This model represents the suspension system. SFl represents velocity input to the front tire and SF2 is velocity input to the rear tire. 12 Illéiaklmoct—JiicF—mai 211 522 ‘45-! t-z I. T c3 at C2 . 30 ,. / _ 20 R3vl'lls'rl‘IOE—EAITRF3 Tarzl—A’AOBl—iral—fi-Rz M M .f $25 ea IS? A! 15 - r4 Iv”— 1r l—“L ssq \ 5“! M / \\ CS=o< ES 522::— «33:5 3.3 ear. . ..- ION.O IIIZHJm “ozmwmq o moas mzHB oo.q om.m ov.m om.H oo.o Harmom.mt Hormom.m o~.o ~o+mom.wt ~c+mom.m 2H.m wzfizom mmummuma mm; \No 19 _ Ease...— umezata> 5.89 .2525 o. mom—Samoa BREE—cu e>=o< ES 522::— oEer O 2.3 2:5 0 mafia mzHe oo.v om.m ov.~ om.H --.0m.0 Illzflfi ”ozmwmq om.o oo.o Sumom .wt Simon .w 3.0 < ~o+mcm .N... Nc+mom.u zdm vflummumfl ~m\m \mo ozHA¢Um 255.00 250.00 245.00 2401!) 235.“) 230.00 225.0) 220.“) 215.00 210.“) 205.00 200.00 195.“) 19011) Objective_Function 20 0.“) LI!) 2.“) 3.1!) 4.1!) 5.00 6.“) Figure 3.5.1.3 Objective Function Iteration History: Problem 1 7.“: 21 3.5.2 Problem 2 Summary The results (see Table 3.5.2.1) in problem 2 are very similar with a 3.4% difference in seat force values. The front damper values had the largest difference of 39.4%. These results were produced using the GRG algorithm in 7 iterations (see Figure 3.5.2.5). Road profile 2 produced the highest seat force at initial DV values. Figure 3.5.2.1 illustrates the initial seat force response. The active seat force for optimized DV values is created by road profile 3. Figure 3.5.2.3 shows the optimized seat force response. The active constraint is the rear tire compression for road profile 3. Figures 3.5.2.2 and 3.5.2.3 shows the tire compression for initial and optimized DV values respectively. Table 3.5.2.1 Problem 2 Results OPTDES PERCENT AV "AUG 8‘ “ORA RESULTS DIFFERENCE Cl 600.0 600.0 "-00 C2 2400.0 2400.0 0.00 C3 2400.0 2400.0 0.00 R1 107.2 105.0 - 2.1 R2 551.0 333.9 - 39.4 R3 453.7 439.6 - 3.1 OBJ FCN 94.1 97.3 3.4 NVNWCNFO Q3\O \RC 22 N .5395 "832...; :32 3::— o. amp—88¢ 5225.,— 95339 3.3 2:»: Ila: . m 5sz...: o moH« mSHe oo.v o~.m ov.~ om.H ow.o oo.o mm.HI / / \2 as- \ . I I / \ .... L L\ 3.0 /.\ N MCH« mnfiom mm.H mvumouam mm\m \No 23 oo.H ~ 5039..— "8_aa_..a> :38: 3::— o. 8:88: 33.3.80 o>=o< 3.3 2:2... .II 3 .o 5233 o Mafia mzHa om.o om.o . 0¢.o om.o oo.o o>.HI No.HI vm.on vm.o No.H HI fleas ma :quG .2525 3 82.88: 2:38.80 «>33. Ea cote—5m «>38an 3.? 2&3 . --..Omd III—34m "szwmq o~.H ammo Nb.o .mv.o _ v~.o oo.o goo. ...- ... no. c). ens" cu". m”. .... .... .... ... .3 .... ..... “u "u .... u .a ..u ..u ..u .... .. ... ... ...... ..H ... ...> >>> >7. .........:.f......;..\/ I < ...< ...< . . 8-8%? I m. ... .... ... ... .. as... .... .... I: m. .. ... .... ...I.. ...... m... .... ...... ...... .... 2.....- .... .... ...u ..o.. u... .6. uh. No +Wmm . H zim wzHgmom Houmfluam was \No 210.00 200.00 190.0) 180.00 170.“) 16011) 150.1» 140.11) 130.00 120.00 1 10.00 100.“) 90.00 25 Objective_Funcdon 0.00 1.00 2.00 31!) 40) 5.00 Figure 3.5.2.4 Objective Function Iteration History: Problem 2 6.“) 7.1!) 26 3.5.3 Problem 3 Summary The results for problem 3, see Table 3.5.3.1, show a difference in seat force values of approximately 4%. The AV values were very close except for the rear damper which had a 205% difference. In this problem the dependent constraints bounding the feasible set were not active at the optimal design point. The active constraints were the simple bounds for each DV at the optimal design point. Each spring was at its lower bound and each damper was at its upper bound. Figure 3.5.3.1 illustrates the seat force for initial DV values. Figure 3.5.3.1 shows the seat force for optimized DV values. These results were produced using the GRG algorithm after 8 iterations (see Figure 3.5.3.3). In this problem, as in problem 1, the front spring displacement constraint is violated (see Figure 3.5.1.1) for the initial DV values. Figure 3.5.3.2 shows the front spring displacement for the optimized DV values. Table 3.5.3.1 Problem 3 Results Av HAUG & ARORA Sguiiiss nfigrfigim Cl 600.0 6004) 0'00 (:2 2400.0 2400-0 0'00 C3 2400.0 2400.0 0.00 R1 559.0 600.0 6-84 R2 941.3 960.0 1.99 R3 3140 960.0 205.00 33% 77.6 74.4 - 4.11 27 m .539..— "mozatér :38: .5536 8 8.533— .855... o>=ooEO 3:3” 2:3... II E . m 52mm”: 0 mod. mzHe oo.v om.m oc.m om.H om.o oo.o mm.Hu mm.oa \ , \ > :5- \ / / \ / .... mm.o N moax ma<0m mm.H mvHHNuHN Nm\m \No 28 n Ease...— ”moEatsw :wfiofi 352.5 3 mom—.88: 23.3.80 0.53. 2.3 2:2,.— o moa« mzHe oo.v om.m ov.~ om.H .IIION.O "ozmwmq om.o oo.o om.o| om.ml 8.7 ./ om.H om.m HI moa« mag Maximum Value Average Value RMS Value Minimum Value Absolute Maximum Value Absolute Minimum Value Any combination of these can be selected for a problem. The size and order of the AF vector is a function of the output vector,Y, and the number of PMS selected. The subroutine ANAFUN will call subroutine perform to evaluate the model response (Y vector). 35 III-null“ PM.“ PMa PM.- PMs Pm. PM“ PERFORM (PERFORMANCE EVALUATOR) .4 1y , Y - ANAFUN MODEL (INTERFACE) (ENPORT) - NP * * AVf AV0 Figure A.3.1 Performance Evaluation Data Flow Perform will call any of the PM subroutines depending on which methods are selected. Perform will also call the PMM subroutines in the order they were selected. In each PMM subroutine the output response is analyzed and PM values are returned. The PMs are on a one to one basis with the Y vector. PM(1) Y0) PM(2) Y(2) PM(n)I Yin) As the PMM subroutines are called the PM vectors are assembled to form the AF vector AA 36 PM % PM Hence the size of the AF vector is #AF members = # Y members " #PMMs selected The AF vector is sorted first by PM then by PM. Therefore, if PMM = 2 AF = 6 and AF will be sorted as AF(l) = PM(l) AF(2) = PM(2) ------ For PMM(l) AF(3) = PM(3) AF(4) = PM(l) AF(S) = PM(2) I ----- For PMM(2) AF(6) = PM(3) The size and order of AF must be known for setting constraints in SETUP. As a service to the user an option to view the AF vector is available when executing the interface software. General Model Design Up to this point the discussion has centered around building a specific model for a specific optimization problem. However, using the named-parameter option to its fullest extent the user can build generalized models to solve many different optimization problems. The named-parameter option can be used to define physical parameters besides design variables. These physical parameters are passed values using the system input vector U. These values are entered once before optimizing and remain fixed. They are not design variables. Referring to figure 2.3.1.1 and 37 MODEL ANAPRE (ENPORT) f (USER) ‘1 1“" “1 |' ANAFUN ‘ e I (INTERFACE) 1 AF | Av OPTDES I AVfI iAVo LIISELJ Figure A.4.l User Entry of System Parameters expanding this diagram to the one seen in Figure A.4.1. In this figure it can be seen that subroutine ANAFUN will call subroutine ANAPRE. This call is made one time to collect information necessary to execute the optimization process. At this point the user can enter information which profiles the bond graph model being optimized. Consider the mechanical position control system in Figure 1.1.1. Suppose F(t) and m are fixed and K1 and C1 are the DVs. The ENPORT model could be built accordingly and optimized. Now suppose the mass was changed to a new fixed value. A new model would be generated using the new mass value. On the other hand a general bond graph can be created identifying the mass using the named- parameter option. The mass is identified as a member of the U vector (declared as external in ENPORT). Now the user can simply re-enter a new mass value, thru ANAPRE, to execut a new optimization problem in lieu of creating a new bond graph. The U vector values can be entered using a datafile or interactively. See appendix D.2 EXECUTING ANAPRE for details. Also see appendix E.2 for creating an interactive menu. It is recommended that the user begin by entering data using a datafile. APPENDIX B MULTIPLE FORCING SYSTEM PROBLEM APPENDIX B MULTIPLE FORCING SYSTEM PROBLEM (MFS) 8.1 Introduction This is a special class of problem and requires the usage of a general model design. Suppose the mechanical positioner is designed to minimize settling time. In addition the postioner can cycle at two different frequencies; 60 and 30 hertz (assume a constant amplitude). Now the system must be optimized to satisy two different forcing functions. In this case the same force is applied at two different natural frequencies such as F1(t) = Fosin out F 2(t) = Fosin (th The best design possible is when the system has the same settling time at each frequency. B.2 Posing the MFS Optimization Problem The problem would be posed as Min ‘1‘ where ‘I’ = Max {t1, t2} t1 = Settle time at 01 t2 = Settle time at (112 Subject to Constraints “"jkmin < “"jk <°'J and Simple Bounds egmin‘ 98 < egmax kmax where 1,2, .. l; l = no. of forcing systems 1,2, m; m = no. of performance mess. methods 38 8.3 B.4 39 1,2, .. n; n = no. of performance measurements ktll constraint response for the jth performance measurement method for the ith forcing system. Gg = gth design variable. k @jk AF-Vector Build for the MFS Problem This type of problem adds another dimension to the AF vector. For each set of driving conditions subroutine ANAFUN will be repeated, hence the AF vector will grow in magnitude of order n. The user must be aware of this to pose the optimization problem in CONVEN and SETUP. Consider the example in appendix A.3. With two forcing systems the AF vector would now have 12 members #AF = { 2(=I) x 2(=m) X 3(=n) } AF(l) = PM(l) AF(2) = PM(2) , ----- PMM(l) . = M13) NFF(l) AF(4) = PM(l) AF(S) .-. PM(2) I ----- PMM(2) * = M13) AF(7) = PM(l) AF(8) = PM(2) ..... PMM(l) . = M13) NFF(2) AF(10) = PM(l) AF(ll) = PM(2) ~ ..... PMM(2) " AEQZL_=JM13) Figure B.3.l Example of MFS AF Vector Setting up the MFS Problem in OPTDES Now suppose the third PM is used to measure the objective performance then the objecitve function set, 9, is Q = {AF(3), AF(6), AF(9), AF(12)} ‘I' = Max {0} To solve this problem an additional AF member is required. This member is ‘1’. Hence, from Figure B.3.1 the additional AF member is AF(13) = ‘I‘ Also an additional AV member is required. This value will be referred to as A. A is used as the objective function. Now using the mechanical positioner where C1 and K1 are the AVs then the additional AV member is 40 AV(3) = A A must have an arbitrary initial value (A0) that is at least greater than all members of the objective function set. Then in this example A0 > Max {0} This initial value for A0 is entered the same as all AV values when CONVEN is executed. Now in SETUP A can have bounds of 0in - A where i=1, j=3, k=l AF (6) = ¢"k - A where 1:], i=3, k=2 AF(9) = oijk - A where i=2, j=3, k=l AF(12) = ¢'jk - A where i=2, i=3, k=2 AF(l3) = ‘1’ = A2 A is an independent variable which must be lowered to minimized ‘I’. A will have lower bounds set by the constraint set 9. These OCs, Q, will become active as A is lowered. The OCs are functions of the AVs. Hence the optimization algorithm will adjust the AVs to lower the OC values in order to lower A. 3.6 Summarizing the MFS Optimization Problem These calculations are performed internally and are based on responses entered by the user when executing the optimization software. Therefore the user is not responsible for understanding or setting up this calculation process. The user must be aware that they are posing an MFS problem. They must know which PM is 41 measuring the OP and how to determine the proper AV and AF sizes. To summarize the user must do the following for ANAPRE - Enter the number of forcing systems (NFF) - Enter the size of the Objecive Function Set (generally equals NFF) - Enter index No. for PM member measuring the OP CONVEN - Calculate and enter the size of the AV vector #AV = #NP + l - Calculate and enter the size of the AF vector #AF = #PMM it #PM x #NFF + l SETUP - Declare the additional AF member as the Objective Function - Set the additional AV member with the proper bounds in SETUP Internal calculations are based on entries to these prompts. See appendix 0.5 to see how this information was entered for the application example in chapter 3. The multiple forcing system procedure described here was used in problem 2. Note that in problem 3 of the application example the objective function set size was 1. In this problem the first forcing system was used to determine constraints only. The overall technique previously described to determine the objective function is not necessry. Now AV and AF are determined as follows: #AV = #NP #AF = #PMM x #PM x #NFF. APPENDIX C USER WRITTEN SUBROUTINES AND SAMPLES APPENDIX C USER WRITTEN SUBROUTINES C.l Introduction These options are available to expand the capabilities of the interface as requirements become more sophisticated. With this option the user can write E/F models, create menus for an interactive session and build the AF vector to desired specifications. The checkfile option should be used when debugging these subroutines. C.2 User Written Generator (USRGEN.FOR) This subroutine is used to model Effort/flow systems. USRGENFOR must be written to return the instantaneous Effort/flow value for each source. When creating the ENPORT Fortran file each source of effort or flow is identified as a single external source. Hence if there are 2 sources of flow (as in the application example in chapter 3) driving the model USRGEN will generate and return a U(l) and U(2) value. USRGEN can also be used in MFS problems. The subroutine statement must be written as: SUBROUTINE USRGEN (NFFCN,T,U) Where focn = forcing system No. t = time U = U - vector focn and t are passed to USRGEN and U is returned. A sample program is included. This sample will generate the road profiles used in the application example in chapter 3. C.2.l Sample Program: USRGEN 42 FORTRAN FILE USRGEN.FOR WRITTEN BY MARK DAVIS 43 C. *************************************************************** c.----Subroutine USRGEN: c. c.---Purpose: This subroutine serves as an interface between the c. subroutine Anasub.for and the user. This user may c. code in values or equations to describe external c. inputs to the system. c. c.---Variables used: c. Passed variables c. -------------------------------------- c. T - The instantaeous time c. U - The external function vector c. c. Local variables c. -------------------------------------- c. tlag - Time lag between front and rear wheels c. trl a Initial response time for the rear wheel C. tr2 = Second phase response time for the rear wheel 0. tf2 - Second phase response time for the front wheel c. tt - Initial phase response time with time delay c. subroutine USRGEN(nffcn,t,u) c. C. Define passed variables c. double precision t,u(1) c. 0. Define local variables c. double precision tlag, trl, tr2, tf2, tt, wl, w2, + MASS(20),TF(20) c. REAL sp, wb, 11, 12, ya Integer iwave, nffcn Common lextmen/ sp(10), wb(10), 11(10), 12(10), ya(10), iwave(10) c. c. Determine velocity input for the front wheel. The time .488 c. represents the c. phase shift necessary for the second cos function to begin c. at 180 degrees. c. This will match the asymptotes of the two functions. .48 is c. of the second cos function. c. c. Natural frequencies c. pi - 3.14159265d0 . wl - pi*sp(nffcn)/ll(nffcn) w2 - pi*sp(nffcn)/12(nffcn) c. c. Periodic times 0. t1 - 11(nffcn)/sp(nffcn) t2 - (11(nffcn)+12(nffcn))/sp(nffcn) c. 0. Front wheel initial velocity 0. Ifin - Iwave(nffcn) 44 DO 10 ISW - 1,Ifin 10 c. 20 C. 00000 000 IPER - ISW IF(t .le. isw*t2)goto 20 continue t1 - iper*t1+(iper-l)*t2 t2 - iper*t2 if (t .lt. t1) then u(l) - -Ya(nffcn)*w1*sin(wl*t) elseif (t .le. t2) then u(l) = Ya(nffcn)*w2*sin(w2*(t-tl)) else u(l) - 0. endif . Determine velocity input for the rear wheel. The is a time . lag between these inputs equal to: time lag a (wheel basel/(Speed of car) tlag - wb(nffcn)/sp(nffcn) trl - t1 + tlag tr2 - t2 + tlag if (t .lt. tlag) then u(2) - 0 elseif (t .lt. trl) then tt - t - tlag u(2) - -Ya(nffcn)*w1*sin(w1*tt) elseif (t .le. tr2) then u(2) - Ya(nffcn)*w2*sin(w2*(t-trl)) else u(2) - 0. endif . SET REMAINING EXTERNAL INPUTS MASS(1)-9.01 MASS(2)-139.75 MASS(3)-3416.7 MASS(4)'3.0 MASS(5)'3.0 TF(1)-.8333333 TF(2)-3.333333 TF(3)-6.666667 0(3) -MASS(1) 0(4) -MASS(2) 0(5) -MASS(3) 0(6) -MASS(4) 0(7) -MASS(S) 0(8) -TF(l) 0(9) -TF(2) 0(10)-TF(3) return end 45 Q3 User Written Menu (USRMEN.FOR) This subroutine is used to read in values necessary to execute USRGEN. The option is available to the user to enter data via the keyboard or by data files. A common storage file must be used to pass data from USRMEN to USRGEN. The name and formatting of the common file is left to the programmer. This file does not receive or return any variables via the subroutine statement. This file must also include the integration variable common statement INTVAR if data is collected for multi-forcing system (NFF = # of forcing functions) COMMON/INTVAR/Tl,T2,h,XIN(20),NX,NY,NS,NU,NFF,IEND,UAF A sample program written to operate in conjunction with USRGEN is included. This sample is written to be used with the generator described in C2. C.3.l Sample Program: USRMEN FORTRAN FILE USRMEN.FOR WRITTEN BY MARK DAVIS 46 . *************************************************************** .----Subroutine USRMEN ----Purpose: This subroutine allows the user to create a more interactive model of the external inputs. This program can be called from anapre allowing for different conditions to be used without re-programming subroutine ENPGEN. .----Variables used: Passed variables sp = vehicle speed wb - wheelbase of vehicle 11 - lst length of road undulation 12 - 2nd length of road undulation Ya - amplitude of road undulation isw - number operiods 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Subroutine USRMEN c. . c. Define passed variables c. Dimension sp(10),wb(10),ll(10),12(10),ya(10),iwave(10) Character iagn*l Real sp, wb, 11, 12, ya Integer iwave c. Common lintvar/ T1,T2,h,xin(20),nx,ny,ns,nu,nff,iend,uaf Common /extmen/ sp, wb, 11, 12, ya, iwave c. ' do 20 i - 1,nff 10 Write (*,102) 1 Write (*,100) Read (*,*) sp(i), wb(i), 11(i), 12(i), ya(i), iwave(i) write (*,101) sp(i), wb(i), 11(i), 12(i), ya(i), + iwave(i) Read (*,200) iagn If (iagn .eq. 'y') goto 10 20 continue c. 100 format (lx,'Enter the following simulation parameters',/, + 1x,'. ' 1 - Vehicle Speed',/. + 1x,’ 2 - Wheelbase’,/, + 1x,’ 3 - Half-wavelength # 1',/, + lx,’ 4 - Half-wavelength # 2',/, + lx,’ 5 - Amplitude’,/, + 1x,’ 6 - No. of periods',/. + 131' '.$) 101format(1x,'You entered the following simulation parameters’,/, + lx,’ Vehicle Speed =',f7.2,/, + 1x,’ Wheelbase =',f7.2,/, + 1x,’ Half-wavelength #1 =',f7.2,/, + lx,’ Half-wavelength #2 =',f7.2,/, + 1x,’ Amplitude -',4X,f3.1,/: + lx,’ No. of periods =',4x,i3,//, + 1x,’Do you wish to re-enter these values’,/, + 1x,’ y - yes n = no',/, + 1X,’ 'rs) 47 102 format (1x,’Your are entering loading conditions no.',i3) C. 200 format (al) C. return end 48 Q4 User Written AF - Vector Build (USRAFN.FOR) This subroutine allows the user to build the AF-vector as desired. This subroutine is used independently of the other user 'written subroutines. The subroutine statement must read as: SUBROUTINE USRAFN(NFFCN,NPM,AV,AF) Where NFFCN = Forcing system Number NPM = Number of Performance Measurements AV = Analysis Variable Vector AF = Analysis function Vector Variables NFFCN, NPM, and AV are passed to USRAFN and AF is returned. A sample is included. This sample was written to use with an MFS problem. In this sample the AF vector is the size of the PM vector. Each PM value is compared for each forcing system and only the worst case value is returned. This is just one idea for how this subroutine could be used. C.4.l Sample Program: USRAFN FORTRAN FILE USRAFN.FOR WRITTEN BY MARK DAVIS 49 C‘k'k'k‘k*********************************************************** C.----Subroutine USRAFN C. c.----Purpose: This subroutine determines the maximum value from c. the objective function set. In addition all AF C. components which are elements of the obj fcn set C. will have their return values calculated. C. In addition the objective function value used by c. optdes will be calculated. C. C.----Variables used: c. Passed variables C. -------------------------------------- C. af - the analysis function array c. ny - number of output variables C. nff - number of forcing functions C. npm - number of performance variables C. nobj- size of objective function C. subroutine USRAFN(NFFCN,NPM,AV,AF) c. C. Define passed variables C. Dimension zf(lO),af(1),av(l),dumaf(10,10,100),obfcn(10) Double Precision dumaf, af, av Real zf, amax, acur Integer rfact, ncont, npm, naf, iavn, obfcn C. Common /intvar/ T1,T2,h,xin(20),nx,ny,ns,nu,NFF,IEND,UAF Common /objfcn/ nobj,obfcn,icstr,iavn C. - c. Determine repeating factor and number of calculated af C. constraints .rfact = npm*ny C. C. Set AF vector c. If (obfcn(1) .lt. 0) then C. C. Sort the af vector C. . C. i - num of forcing functions C. j a num of performance criteria C. k - num of output variables C. - do 20 i = l,nff do 20 j - 1,npm do 20 k = l,ny iaf - (i-1)*ny*npm +(j-l)*ny + k 20 dumaf(i,j,k) = af(iaf) c. C. Re-Initialize af C. do 22 i=1,nff*npm*ny 22 af(i)=0 C. C. Determine max values for each constraint 50 do 35 j - 1,npm do 30 k = 1,ny naf - (j-1)*npm + k amax - dumaf(l,j,k) do 25 i - 1,nff acur = dumaf(i,j,k) if(acur .gt. amax)then af(naf) = acur**2 else af(naf) = amax**2 endif 25 continue 30 continue 35 continue C. C. Set the AF vector obj fcn constraints C. C. Set obj fcn C. AF(rfaCt+1) = AV(iavn)**2 C. ELSE C. C. Determine obj fcn subset c. Do 50 i=l,nobj iaf - obfcn(i) 50 zf(i) - af(iaf) C. C. Determine Max value C. amax - zf(l) Do 55 i-1,nobj if(zf(i) .gt. amax)then amax - zf(i) else amax = amax endif 55 continue C. C. Set the AF vector obj fcn constraints Do 60 i-1,nobj iaf - obfcn(i) 60 AF(iaf) a AF(iaf) - AV(iavn) c O n C. Set the Obj Fcn value C. AF(rfact+1) - AV(iavn)**2 C. ENDIF C. return end APPENDIX D HOW TO USE THE OPTIMIZATION INTERFACE D.l D.2 APPENDIX D HOW TO USE THE OPTIMIZATION INTERFACE Introduction The entire interface is menu driven. All aspects of the design problem can be executed from the top level command file DSMOPT. When either CONVEN or CDESIGN are invoked subroutine ANAPRE will be executed. The following directions will explain how to execute and use the Design Simulation and Model Optimization Interface in a DEC VAX/V MS environment. Executing the DSMOPT Command File At the command prompt enter > @dsmopt (rot and the following menu appears: tit...tfitttttttitit.titttttttttttttttitttttttt "' MAIN MENU " tittttttttttttttttttt*tttt‘ttttttttttttttttttt " Please make the following selection "‘ " Enter E = execute ENPORT " " D = create/edit DATA FILES "' * O = execute OPTDES * " C = execute CHECKFILE ‘ " X = exit the session " t0.$0.0.ttfitttttttttttfittttfitttltttttfitttfitttt At this point the user will begin the menu selection process. To leave DMSOPT enter X. The preceding options will be discussed separately. 51 52 11.2.1 Invoking ENPORT .ltttittttfittttttfitCCOO.##t‘lfit.tttttfittttfiitt * MAIN MENU ‘ Cttttitttltltttttttittttttttltfittfifitttttlttttt ‘ Please make the following selection " ‘ Enter E = execute ENPORT ‘ " ‘ D = create/edit DATA FILES "‘ “ O = execute OPTDES " " C = execute CHECKFILE " ‘ X = exit the session " fittttitttttttttttttit...tttttttttttttttttttltt From the main menu select option E Following is a transcript of the ENPORT session. ‘ 53 6.1.1.2 ENPORT State Equations File **************************************** **************************************** ** ** ** ENPORT—7 ** ** ** ** BOND GRAPH/BLOCK DIAGRAM ** ** PROCESSOR ** ** for ** ** NONLINEAR SYSTEMS ** ** ** ** Version 3.3 ** ** ** ** Developed by ** ** Rosencode Associates ** ** Lansing, Michigan ** ** ** **************************************** **************************************** (C)1989. Rosencode Associates Inc. All rights reserved. Date: 01/20/92 Time: 14:30:09 *Comment. The trapping mode has been turned off/on at this point. Utilities options Menu, Command, Trap, Debug, Return? (full): R ENPORT-7 options Initialize for a new model or load an existing model Title input or modification Graph description or modification Equation description for nodes Solve for the time response of the system Display the results File the model for later reference Return to the operating system from ENPORT Manage the file directory Utilities- mode_set, trap, debug, terminal Optimize the design Help Enter option (R): F ”WUMMQHH moo: 54 Filer options E: write Enport model file write System equations to file matrix-x eXeC file write matrix-x User_code_block file write ACSL input file write Adams DIFP function file Return to main menu Help mwuyqu 2 H p. ('9‘ 0 Enter option (R): 0 *** Please select some output variables or you will get no output from Matrix-x. Output list (Y) options A: Add variables to current list D: Delete variables from current list E: set current list to Empty S: Show current list H: Help R: Return Enter option (R): A Ready to add output variables. (Enter blank line to quit.) Enter output variable: F.1M Enter output variable: E.1M Enter output variable: Q.ZQ Enter output variable: 0.30 Enter output variable: 0.40 Enter output variable: Q.SQ Enter output variable: Output list Add, Delete, Empty, Show, Help, Return? (full): S There are 7 output variables (Y). Y( 1): Q.1Q Y( 2): F.1M Y( 3): E.1M Y( 4): Q.2Q Y( 5): 0.30 Y( 6): Q.4Q Y( 7): Q.SQ Output list Add, Delete, Empty, Show, Help, Return? (full): R 55 Please define the INPUT variable types for the Matrix-x file. Types Enter Enter Enter Enter Enter Enter Enter Enter Enter Enter Enter Enter Enter Enter Enter Enter Enter Enter Enter Enter Enter Enter Enter are time type type type type type type type type type type type type "E": external input (to the block), “I": internal input (within block), "R": RP vector input. for for for for for for for for for for for for for for for for for for for for for for for 468 28 488 498 68 518 88 98 218 228 238 298 258 288 248 548 558 578 588 E.5W E.2W E.1W B.4W HHHHHHHHHHHHHHHHHHHHHHH Please define the Named-Parameter types for the Matrix-x file. Types Enter Enter Enter Enter Enter Enter Enter Enter Enter Enter Enter Enter Enter Enter Enter are type type type type type type type type type type type type type type type "E": external (to block), internal (within block), "I": "R": for for for for for for for for for for for for for for for RP vector. W1 W2 PHIl PHIZ PHI3 PHI4 T1 T2 T3 T4 T5 AMPl AMPZ AMP3 PHIS NMMMMMMMMMMMMMM u: rial-M vlufifiruEEEE-DLEEEEEEEEEE U" 0) Enter type for PHI6 Enter type for C1 Enter type for C2 Enter type for C3 Enter type for C4 Enter type for C5 Enter type for R1 Enter type for R2 Enter type for R3 Enter type for R4 Enter type for R5 Enter type for 11 Enter type for 12 Enter type for 13 Enter type for I4 Enter type for IS Enter type for SE1 Enter type for SE2 Enter type for SE3 Enter type for SE4 Enter type for SE5 Enter type for TF1 Enter type for TF2 Enter type for TF3 NMMMMMMMMMMMMHHQEEHHEEEM Please enter a model file name for Matrix-x (MODELO): EXMPLl The title to be written to the file is: 5 Dof Suspension System W/Variable Flow Source - WO/Grav. Effects Is that okay? (Y): User_Code_Block file written: EXMPL1.USR MATSETUP.DAT file written: EXMPL1.DAT RP definition file written: EXMPL1.RPD Filer options adams_Diff, Return, Help? (full): R 1m bltbifill‘IlIOIIIIllllll I! MLTGESDDIR . Mano-Wu . n1. 57 ENPORT-7 options I: Initialize for a new model or load an existing model T: Title input or modification : Graph description or modification : Equation description for nodes ° Solve for the time response of the system Display the results ° File the model for later reference : Return to the operating system from ENPORT : Manage the file directory‘ Utilities- mode_set, trap, debug, terminal Optimize the design Help Enter option (R): R ”MOVING EEOC!!! Do you want to leave ENPORT? (N): Y 58 0.2.2 Creating/Editing Data Files The main menu appears titfit.tOtttttttfittttOttitttttttltfiltttt.ttfittfi "' MAIN MENU ' Cttttifi#tttttttttttttttlCOOCCOOCCOOCCCOOOCCOOC * Please make the following selection * "' Enter E = execute ENPORT ’ * D = create/edit DATA FILES " "' O = execute OPTDES " "‘ C = execute CHECKFILE "' " X = exit the session ' tfitttfittttittttttttltfitttfittttititttitttfiti... From the main menu select 12. The next menu appears tttttttttttttlittttttttttttttttttttttttttftitl How many Data files are you creating conditions must be described by a separate data file. titttttttttit!titt*Citt*ttlttttttttttttttttttt O O O O O t . * Note: Each set of system driving . Q Enter number Now suppose the model is optimized analyzing its behavior for two different flow models. This will require two data files. Each data file has a set of members which describe one flow model. If beginning this problem then 2 would be an appropriate response. To edit an existing file then 1 is the correct response. The next menu appears #****#**t.itCtttittiitfittttttfitittttttttttttit Create/Edit datafile No: X Please enter Datafile Name Example: DRSYSl (limit 6 char) O O O O O O O O O O O O Note: Do not enter filetype .dat ittit.ittit!ti##ttttttttttt*Cttttttttttttttttt Enter filename 59 If you are creating a new file then enter a unique name. If you wish to edit an existing file then enter the name of that file. Note: '1' Do not enter filetype (.dat will be assigned) ‘1' Limit names to six (6) characters The following verification menu appears ......tttfitltttfiCCOOCCCOOOCOCOCOOOCOOOCOO ‘ You Entered: FFFFFF " . um__ C ‘ Is this correct (Y or N) ‘ OOQOOOOitCitittOtCOOOCIOOOCOOCCOOOCOOOOOO When Y is selected an active editing mode is invoked. Enter the data and save the files. Use edit commands for the DEC/V AX operating system. If creating U-Vector data files then enter data as a column vector with 1 entry per line. If you are creating an experimental data file enter the data as an array. The first column must be time (T) and the following columns represent a time history for each input variable. If an input is zero for a particular analysis then zero's must be entered. This process will be repeated based on the entry for the number of data files being created. D.2.3 Executing OPTDES The following menu appears tilttttttfittttfitttiititttttfi..tttfitlttfitiilttt " MAIN MENU ' OOCOQCOCOOOCOOCCCCCCfitttttttttttltttttfiitttttt " Please make the following selection ‘ "' Enter E = execute ENPORT " "' D = create/edit DATA FILES " ‘ O = execute OPTDES ‘ " C = execute CHECKFILE " " X = exit the session "' itOCOOOOOOOCOOOICOOOQOOOOCOOOOOCOOOQOOOC.0...‘ From the main menu select option Q. The following menu appears ttfittttiltttttttttttttttttttitttttitittttttfitt " Please enter model name from ENPORT " t t ‘ Example: MODELO " t t " Note: Do not include filetype " .#.##*#*t.*tittttltt*tttttt#tlOtttttlttttttfifit Enter the system state equations filename created in EN PORT. Note: Do not enter filetype (handled internally) The following verification menu appears ttttttttttt##0##tit.ttttttttttttttttttttittttt You entered: . i "' FF FFFF . 4: Is this correct (y or n) tittttttttttttttitttfitttttttttttttttttttCit... Upon continuation the file management process occurs. The following menu appears. 61 **##***##**t##t***#**¢**¥*#***¢¥t*$t##ttifittfit " OPTIMIZATION MENU " Otttfitfitttfitfittfitttttit.Cttttttfifififittfittfifitttfi ‘ Select one of the following options " " C = compile all program " ‘ I = compile individual programs " " L = link to optimization files " * S = create setup executable "‘ " RC = run CONVEN.EXE "‘ " RS = run SETUP.EXE " " RD = run CDESIGNEXE " " M = return to main menu " ' X = exit the session “ Cttttttttttttttt*tttfittOtttttttttttttttttttttt At this point any user written subroutines must be compiled. Two choices are available to do this C and I. If C is entered all subroutines are compiled and this menu will re-appear. If I is entered then the following menu appears: Otttfittfittittittttfitttttfittttfifitttt.tttlttfitti * The number of programs to be compiled "' tttttttttttttttttttttttt##tttttttttltttttttttt Then the following menu appears Qt!*0tt.13*ttt03“.O.titOtttttttttttttttttfitfii ‘ Enter the program name " tttttfitttttttttttttttttltttttttttltttttttttttt This prompt will be repeated based on your previous response. 62 At this point all files are compiled and the optimization menu re-appears: OtfittitttttltittttttiltfitittfittfiitlttttfitOi... " OPTIMIZATION MENU "‘ OOOOOCOOOOOCOOOCOOCOtCt...tiltttttttttlfiltfilfit " Select one of the following options " "' C = compile all program ‘ "' I = compile individual program " "' L = link to optimization files ‘ ‘ S = create setup executable "' * RC = run CONVEN.EXE "' " R8 = run SETUP.EXE "' " RD = run CDESIGN.EXE * ’ M = return to main menu "' ‘ X - exit the session ‘ t.tittCtitt0“t#00tttttfitttttttttttt¢tttl##1## QntinnJe At this point option L must be entered even if no programs were compiled. This is necessary to link the model file to the optimization software. This is only necessary once if the model file has not changed. Two messages will appear to verify that the CONVEN and CDESIGN executable files have been created. The menu will re-appear. Qntims This option is only necessary once to create the SETUP executable file. QntienBS: This option executes CONVEN. This will create the initial design point. QntionBS This option executes SETUP. This will define the design space. OntionBD This option executes CDESIGN. This will perform the optimization process. QntinnM Returns the user to the main menu. Cation}! Exits the user from DMSOPT. D.2.4 D.3 63 CONVEN, SETUP and CDESIGN all execute OPTDES software. When CONVEN and CDESIGN are selected the ANAPRE subroutine will be invoked. This is a pre-processor used to set up the optimization problem (see Executing ANAPRE). After each program has ran the optimization menu will re-appear. Executing the Checkfile From the main menu select option (I, it...titttttfittttt¢ttit.tfiflifittfitttttttttttitt " MAIN MENU " tfitttittitfitiit!C##Ottit##ifitttttfifittttfittfitfil ‘ Please make the following selection ‘ " Enter E = execute ENPORT ‘ " D = create/edit DATA FILES " * O = execute OPTDES " "' C = execute CHECKFILE "‘ * X = exit the session " *#¢¢*.**ttttittttit**##***#*tittttitfitttlttllt Checkfile executes ANAMAIN which assists in constructing the user-written subroutines. ANAMAIN is a menu driven program which will determines a set of performance measurements for a given set of analysis variables. Once the subroutines are returning the correct values for a given input then the optimization software can be executed. ANAMAIN is much like executing CONVEN except results are obtained quicker. The user will prompted for the no. of AV's and their values. The subroutine ANAFU N will be executed and a set of AF values will be returned. No changes in executing ANAPRE are required. Executing ANAPRE ANAPRE is a pre-processing subroutine used to collect information necessary for executing the interface software. This program will be called when CONVEN and CDESIGN are executed. An overview of how ANAPRE is executed is as follows. D.3.l 64 ANAPRE_ SYSTEM PARAMETERS EXTERNAL FORCING INTEGRATION PARAMETERS INITIAL CONDITIONS .LILAIEL. ENTER I.C.'s PERFORMANCE MEASUREMENT METHODS ._IL_£MM5-L_UPPER BOUNDS JLINEELI L_OB.IECT IVE FUNCTIONS .__If_QBJsNEL INDEX NUMBERS .....ILOBJENEL INDEX NUMBERS AF VECTOR BUILD |_IL_Ans_=_L DISPLAY AF VECTOR Figure 0.3.1 Branching Tree for ANAPRE Execution The following instructions are for entering data using ANAPRE. These prompts will be seen following OPTDES messages when either CONVEN or CDESIGN have been executed. System Parameters The following menu will appear: Number of State Variables (NX) X Number of Output Variables (NY) Y Number of External Inputs (NU) U Number of Forcing Conditions (NFF) F Default values for X, Y, and U will be obtained from the summary xxx.rpd file. If this file is unavailable then the default values will be zero. F will have a default value of 1. Values for X,Y and U can be obtained from the system state equations file if they are unknown (See ENPORT user's manual appendix C). D3. 65 D.3.2 External Forcing If NU is greater than 0 then the model is being driven by a set of external inputs. The following sub-menu will appear: EntcLExtemaLEarametm E = Enport Model Generator 0 = User Written Generator D = Experimental Data The following menus will appear for each response. Enter E Enter Datafile Information Name of Datafile No (x) Enter 11 Do you wish to use your own menu (Y or N) If X then subroutine USRMEN is invoked If N then Enter Datafile Information Name of Datafile No (x) Enter [2 Enter Datafile Information Name of Datafile No (x) Number of Data Pts for File No: (x) In each case the user is entering the name of the datafile which is housing the U-Vector values. These prompts will be repeated based on the entry for NFF. When using experimental data these files must be edited to accommodate when (To .ne. 0). If option D was entered the program will continue. If options E or U were entered the following menu will appear: Please select one of the following - Continue View the data entered Re-enter the data files ”<0 II 111 C will continue the program V will display the data entered as it is stored in the 125, matrix. The above menu will re-appear. 66 R will re-initialize 125, and all data files must be re-entered. The above menu will re—appear. D.3.3 Integration Parameters The following prompt will appear: Initial Time Value (To) Ending Evaluation Time (ET) Number of Integration Steps To can be greater 0 FT must be greater than To The number of integration steps must be less than 1024 After this information is entered the following message will appear: The Integration Step Size (H) is: X D.3.4 Initial Conditions The following menu will appear: Enterlnitialflanditinnsflnrm N The default is N and will appear. To continue press enter. To enter initial conditions enter Y. When initial conditions are entered the following prompt will appear. Initial Conds for State Variable i: Where i is a counter displaying index number for the corresponding state variable. It is important to know how ENPORT has ordered the state variables to enter the lC's correctly. The order can be viewed in ENPORT where IC's are set or the state equation file can be edited to view how the X—Vector is ordered. This prompt will be repeated until i=NX. D.3.5 D.3.6 67 Performance Measurement Methods The following menu will appear: EmumummmmmmMmmmmummmuummm Maximum Displacement Ave DiSplacement RMS Value Minimum Displacement Absolute Max Disp Absolute Min Disp zxmw>z II II II II 11 11 Enter the appropriate letters (no spaces or delimiters required). Selections will be verified. For each PMM selected a value for each PM will be calculated. Hence, more constraints could be created than will be used. Therefore, understanding how the AF-Vector is built is important when selecting constraints in SETUP. Objective Functions If NFF is greater than 1 then menus gathering information about the objective function will appear. If NFF is equal to one then proceed to the AF build message. The following prompt will appear if NFF > 1: i Objective Function Set Size i The default value i is equal to NFF. If the set size entered is greater than 1 then additional prompts will appear. One of two cases will occur: Case 1: Ifsetsizei: lom3fl l datafile with nu,ny and nx values open(unit-12,fi1e-'zzzzzz.dat’,form-'formatted', statusa’unknown') read (12,*,end-10)NNU,NNY,NNX Close(unit=12) C. Prompt the user for the number of state variables C 000 10 Write(*,118) Write(*,100) NNX Read (*,200) NX if(NX .eq. 0)then NX - NNX else NX - NX endif . Prompt the user for the number of output variables Write(*,101) NNY Read (*,201) NY if(NY .eq. 0)then NY - NNY else NY = NY endif 78 C. C. Prompt the user for the Number of external source parameters. C. If NU>0 then call enpmen. Enpmen will prompt for the data C. files describing each set of external forcing systems (nff). C. Write(*,109) NNU Read (*,201) nu if(NU .eq. 0)then NU - NNU else N0 - N0 endif C. C. Prompt the user for the number of forcing functions C. inf - l Write(*,112) INF Read (*,201) NFF if(nff .eq. 0)then nff - inf else nff - nff endif Call ENPMEN if NU>0 If (nu .gt. 0) call enpmen Prompt the user for the intial start time 0.3000 000 5 Write(*,119) Write(*,lOZ) Read (*,202) t1 . Prompt the user for the and evaluation time 000 Write(*,103) Read (*,203) t2 . Prompt the user for the integration step size 000 Write(*,104) Read (*,200) nstep H - (t2 - tl)/nstep Write(*,121) H . Calculate the number of integration steps to use 000 0 0 ZS = T2/H NS = ZS IEND - (T2 - Tl)/H . Prompt the user for initial conditions on the state variables 000 79 acond - 'N' 48 Write(*,114) acond Read (*,207) acond if(acond .eq. ' ')then acond - 'n' goto 60 elseif(acond .eq. 'y' .or. acond .eq. 'Y')then goto 49 elseif(acond .eq. 'n' .or. acond .eq. 'N')then goto 60 else goto 48 endif 49 ivar - 0 do 50 icond-l,nx ivar - icond Write(*,105) ivar Read (*,205) xin(icond) 50 continue C. C. Select Performance Measurement Methods C. 60 write (*,110) read (*,208) Ipar C. locl loc2 loc3 loc4 locS loc6 loc7 index(ipar,'m') index(ipar,'a') index(ipar,'r') index(ipar,’v') index(ipar,’s') index(ipar,'x’) index(ipar,'n’) NPM - 0 IF (LOC1 .GT. NPM) NPM IF (LOC2 .GT. NPM) NPM IF (LOC3 .GT. NPM) NPM IF (LOC4 .GT. NPM) NPM IF (LOCS .GT. NPM) NPM IF (LOC6 .GT. NPM) NPM IF (LOC7 .GT. NPM) NPM LOC1 LOCZ LOC3 LOC4 LOCS LOC6 LOC7 LOC8 - LOC1 + LOCZ + LOC3 + LOC4 + LOCS + Loc6 + Loo? IF (LOC8 .EQ. 0) THEN WRITE(*,111) ipar GOTO 60 ELSE Continue ENDIF If (LOC4 .gt. 0)then Do 62 I-1,ny 62 Cmax(i) - 0 80 C. Enter the upper bounds necessary for using the maximum C. violation calculation. C. 65 000 0000 mOOOOOO 05000 . Call . Call . View C. C. Write(*,107) Do 65 Inx-1,ny Write(*,lOB) Inx Read (*,*) Cmax(inx) Else Continue Endif for objective function size only if multiple external forcing systems or more than 1 perf meas method is being used. If (nff .gt. 1) Goto 66 If (nff .le. 1) Goto 67 . Prompt the user for the objective function number Note: This is only necessary if the objective function is the max/min of a set of constraints. This is typical for problems with multiple external driving systems. Write(*,120) Write(*,ll3) nff*npm Read (*,201) nobj if(nobj .eq. 0)then nobj - nff else nobj - nobj endif subroutine enpobj to determine the objective function set If (nobj .gt. 1) Call Enpobj(npm) the Analysis function build afbld = 'N' If (Nobj .gt. 1)then nmem.- nff*npm*ny + l Else nmem - nff*npm*ny Endif Write(*,122) nmem, afbld Read (*,207) afbld if(afbld .eq. ' ')then afbld = 'n' elseif(afbld .eq. 'y' .or. afbld .eq. 'Y')then call afbild(AV,AF,NMEM) elseif(afbld .eq. 'n' .or. afbld .eq. 'N')then continue else goto 67 endif Prompt the user to see if they wish to re-edit the af vector 81 me Uaf - 'N' Write(*,106) uaf Read (*,207) UAF if(UAF .eq. ' ')then UAF - 'n' elseif(UAF continue elseif(UAF continue else goto 68 endif .********************Print Switches are Off******************** . Set print switches .****************The Default Setting is Left on**************** do 70 i-1,20 idbgr(i) - 2 .eq. 'y' .or. UAF .eq. ’Y')then .eq. 'n' .or. UAF .eq. 'N')then 00000000000000010 C) law-'N' Write(*,117)isw Read (*,207)isw If (isw .eq. ' isw - 'n' goto 78 Elseif(isw .eq. goto 78 ElseIf (isw .eq. Write(*,115) Read (*,207) ISW Do 74 i-1,4 Write(*,116) i Q N) ')then 'n’ .or. isw .eq. 'N’)then ’y')then 000000000000000000000004 74 read(*,*) idbgr(i) else goto 72 endif 78 continue .*******************End Print Switches************************* 118 format(' ',///////. + ' Enter System Driving Parameter Values',/, + I ................................................ + _________________ I 100 format(llx,’Number of State Variables (NX) ’,12,' ',$) 101 format(llx,'Number of Output Variables (NY) ',12,’ ’.$) 112 format(llx,'Number of Forcing Conditions (NFF) ',I2,' ’.$) 109 format(llx,'Number of External Inputs (N0) ',12,' ',$) C.*************************************************************** 119 format(' ',/, ' + ' Enter Integration Parameter Values',/, + I ................................................ + ----------------- ') 102 format(llx,'Initial Time Value (T0) '.$> 103 format(llx,'Ending Evaluation Time (TF) '.$) 104 format(llx,'Number of Intergration Steps '.$) 121 format(",//,5x,'The Integration Step Size (H) is:',e12.6) 82 C.************************************************************** 106 format(' '1/( + ’ Are You Using Subroutine USRAFN (Y or N)',/, + I .............................................. + """""" 'r/r + ' '.a2.' us) C.************************************************************** 110 format(’ ’,/, +' Enter the Performance Measurement Methods to be used',/, +1 ....................................................... + TTTTTTTTTT 'i/I + 11x,’ M - Maximum Displacement ',/. + 11x,’ A - Ave Displacement ’,/. + llx,’ R - RMS Value ', + 11x,’ v - Max Violation Integral ',/. + 11x,’ S - Minimum Displacement ',/, + 11x,’ X - Absolute Max Disp ',/, + 11x,’ N - Absolute Min Disp ’./, + 118.’ ’.$) 111 format(llx,'You Entered ',a7,’ None of’,/, + 11x,'These are Valid Try Again’) 107 format(llx,'You must enter the upper bound limits to use',/, + 11x,’ the maximum violation performance option.',/, + 11X,' -------------------------------------------- ') 108 format(13x,'0pper Bound for Perf. Meas. #:',i3,': ',$) C.*************************************************************** 120 format(' ',/. +' Enter Objective Function & Constraint Information',/, +l ....................................................... + __________ I) . 113 format(llx,'Objective Function Set Size ',i2,' '.$) C.*************************************************************** 114 format(’ ',/, + ' Enter Initial Conditions (Y or N) ’,/, + I ................................................ + TTTTTTTTT 'r/r ... I - 232/ 1's) 105 format(llx,'Initial Conds for State Variable',i3,': ',$) Co**************************************************************** 115 format(llx,’ lst switch prints AF vector' ,/, + 11x,’ 2nd switch prints YRR history in solvrk' ,/, + 11x,’ 3rd switch prints perform call' ,/. + 11x,’ 4th switch prints yperf build of af’) 116 format(l3x,’ Enter setting for switch number',i3,/, + 13x,’ 1 - on 2 = off '35) 117 format(' ',/, + ' Set print switches on to view builds (Y or N) ',/, + ............................................... + --------- 'r/r + I ’,32,' '($) 122 format(' ',/, + ' Do You Wish to View the AF-Vector Format (Y or N) ',/, + ................................................ + --------- 'I/I + ' No of members:',i3,' ',a2,' ',$) 000 000 0 00000000 000000000000 1200 1201 2202 2203 2204 2205 2207 £208 83 format (i4) format (i4) format (e6.0) format (e6.0) format (e4.2) format (e8.2) format (a1) format (37) return end - ************************************************************** SUBROUTINE ANAPOS INTEGER NYY, NYCNT PARAMETER (NYY=20, NYCNT-4096) COMMON /RESOUT/ TV(NYCNT)pyout(NYY,NYCNT) COMMON /INTVAR/ T1,T2,H,XIN(20),NX,NY,NS,NU,NFF,IEND,UAF RETURN END -'************************************************************** SUBROUTINE ANAGRA COMMON /INTVAR/ T1,T2,H,XIN(20),NX,NY,NS,NU,NFF,IEND,UAF RETURN END ************************************************************** ‘************************************************************** OPTIMIZATION SUBROUTINES ‘************************************************************** ‘************************************************************** -—-- SUBROUTINE PERFORM ---- PURPOSE: DEFINE THE DYNAMIC PERFORMANCE OF THE SYSTEM ---- OUTPUT VARIABLE: YPERF(I,J) = DATA ARRAY OF EACH DESIGN VARIABLE PERFORMANCE I - PERFORMANCE VARIABLE J = DESIGN VARIABLE O O O O OOOOOOOOOOOOOOOOOOOOOO ---- SYSTEM +-++-+ + PERFORMANCE VARIABLES YMAX(I YMIN(I YABS(I YINT(I TMAX(I TMIN(I TABS(I YMEAN( YRMS(I YOVR(I SUBROUTINE PERFO CHARACTER Ipar*7 INTEGER DBUG, NY 84 ) = SYSTEM RESPONSE MAXIMUM DEFLECTION ) ‘ SYSTEM RESPONSE MINIMUM DEFLECTION ) = ABSOLUTE MAXIMUM DEFLECTION ) - INTEGRAL FOR MAXIMUM DEFLECTION ) - TIME AT WHICH MAX VALUE OCCURS ) - TIME AT WHICH THE MIN VALUE OCCURS ) - TIME AT WHICH ABS MAX VALUE OCCURS I) ' SYSTEM RESPONSE MEAN VALUES ) = SYSTEM RESPONSE ROOT MEAN SQUARE VALUES ) = PERCENT OVERSHOOT OF YMAX VS. YMEAN RM(NFFCN,AV,AF,NPM) PERF, NYY, NYCNT, NFFCN, NPM PARAMETER (NYPERF-S, NYY-ZO, NYCNT=4096) DOUBLE PRECISION DOUBLE PRECISION DOUBLE PRECISION COMMON /INTVAR/ COMMON /RESOUT/ COMMON /OBJFCN/ COMMON /EXTOUT/ COMMON /TRACER/ COMMON /PAROPT/ PERF - IDBGR(3) PRFO - IDBGR(4) IF(PERF CALL PMAX(YMAX, YPERF(NYY,NYPERF), AV(l), AF(l), ZOUT(2,NYY,NYCNT) YMAX(NYY), TMAX(NYY), YMEAN(NYY), YRMS(NYY), YSST(NYY), YOVR(NYY), YLIN(NYY), YOFF(NYY), TOFF(NYY), RTIM(NYY), YERR(NYY), YEXP(NYY), YMIN(NYY), TMIN(NYY), TSMAX(NYY) TSMIN(NYY), YPP(NYY,2), TPP(NYY,2), YINT(NYY), YABS(NYY), TABS(NYY), YNAB(NYY), TNAB(NYY) T1,T2,H,XIN(20),NX,NY,NS,NU,NFF,IEND,UAF TV(NYCNT), YOUT(NYY,NYCNT) NOBJ,OBFCN(10),ICSTR,IAVN ZOUT IDBGR(20) IPAR .EQ. 1)PRINT *,'CALLING PMAX' TMAX,TSMAX,YPP,TPP,YABS,TABS,YINT) 85 IF(PERF .EQ. l)PRINT *,’CALLING PMEAN’ CALL PMEAN(YMEAN) C IF(PERF .EQ. l)PRINT *,’CALLING PRMS' CALL PRMS(YRMS) C IF(PERF .EQ. l)PRINT *,'CALLING POVR' CALL POVR(YMAX,YMEAN,YOVR) C IF(PERF .EQ. l)PRINT *,'CALLING PMIN’ CALL PMIN(TMAX,YMIN,TMIN,TSMIN,YNAB,TNAB) C locl - index(ipar,’m') loc2 - index(ipar,'a') loc3 - index(ipar,'r’) loc4 - index(ipar,'v') loc5 - index(ipar,’s') loc6 - index(ipar,'x') loc7 - index(ipar,'n') C. DO 25 IVAR - 1,NY IF (locl .ne. 0) goto 10 17 IF (Loc2 .ne. 0) goto 11 18 IF (loc3 .ne. 0) goto 12 19 IF (loc4 .ne. 0) goto 13 20 IF (locS .ne. 0) goto 14 21 IF (loc6 .ne. 0) goto 15 22 IF (loo? .ne. 0) goto 16 goto 25 C. 10 YPERF(IVAR,LOC1) - Ymax(IVAR) GOTO 17 11 YPERF(IVAR,LOC2) - YMEAN(IVAR) GOTO 18 12 YPERF(IVAR,LOC3) - YRMS(IVAR) GOTO 19 13 YPERF(IVAR,LOC4) - Yint(IVAR) GOTO 20 14 YPERF(IVAR,LOC5) - YMIN(IVAR) GOTO 21 15 YPERF(IVAR,LOC6) = Yabs(IVAR) GOTO 22 16 YPERF(IVAR,LOC7) - Ynab(IVAR) C 25 CONTINUE C C BUILD THE AF VECTOR C NPM - 0 IF (LOC1 .GT. NPM) NPM - LOC1 IF (LOC2 .GT. NPM) NPM - LOC2 IF (LOC3 .GT. NPM) NPM - LOC3 IF (LOC4 .GT. NPM) NPM - LOC4 IF (LOCS .GT. NPM) NPM - LOCS IF (LOC6 .GT. NPM) NPM - LOC6 IF (LOC7 .GT. NPM) NPM - LOC7. 86 C Ibeg - (nffcn-1)*npm + 1 Ifin = nffcn*npm IPY - 0 C DO 40 IY - Ibeg,Ifin ipy - ipy + 1 DO 40, IP-1,ny I - (IY - l)*ny + IP C C Dbugging aid If(Prfo .eq. 1) + write(*,*)'this is yperf’,yperf(ip,ipy) c 40 AF(I) - YPERF(Ip,Ipy) C Dbugging aid DBUG - 2 IF(DBUG.EQ.2)GOTO 1 CALL YPRFRM(YPERF,NYPERF,NYY) 1 CONTINUE C. C. C. RETURN END C. C. NOTES C. NEED TO DETERMINE confidence interval for THE CALCULATED C. RESULTS BASED ON ENOUGH DATA POINTS TAKEN. C. **********************‘k*************************************** C.----SUBROUTINE PMAX c. C.----PURPOSE C. THIS SUBROUTINE WILL DETERMINE THE MAXIMUM VALUES C. FOR THE SYSTEM RESPONSE VARIABLES C. SUBROUTINE PMAX(YMAX,TMAX,TSMAX,YPP,TPP,YABS,TABS,YINT) C. INTEGER dbugZ, NYY, NYCNT PARAMETER(NYY=20, NYCNT-4096) C. DOUBLE PRECISION YMAX(1), TMAX(1), TSMAX(1), YPP(NYY,1), + TPP(NYY,1), YABS(1), TABS(1), YINT(1) C. . COMMON /INTVAR/ T1,T2,H,XIN(NYY),NX,NY,NS,NU,NFF,IEND,UAF COMMON /RESOUT/ TV(NYCNT), YOUT(NYY,NYCNT) COMMON /MAXVAL/ CMAX(NYY) C. dbugZ - 2 87 DO 10 IVAR=1,NY 20 10 30 40 ZMAX - -10000 ZTMX - 0 DO 20 IMAX-1,IEND IF(ZMAX.LT.YOUT(IVAR,IMAX))THEN ZTMX - TV(IMAX) ZMAX - YOUT(IVAR,IMAX) ELSE ZTMX - ZTMX ZMAX - ZMAX ENDIF CONTINUE TMAX(IVAR) - ZTMX YMAX(IVAR) - ZMAX CONTINUE DO 40 IVAR=1,NY Zabs - -10000 ZTab - 0 DO 30 IMAX-1,IEND IF(Zabs .LT. abs(YOUT(IVAR,IMAX)))THEN ZTab = TV(IMAX) Zabs - abs(YOUT(IVAR,IMAX)) ELSE ZTab - ZTab Zabs - Zabs ENDIF CONTINUE Tabs (IVAR) - ZTab Yabs(IVAR) - Zabs CONTINUE IMXV - 2 ITIM - (tZ/H) + 1 Do 45 Ivar-1,ny sumodd - 0. sumeve - 0. Do 50 Isuma2,Itim-1,2 Cout - abs(Yout(ivar,Isum)) Sumodd - Sumodd + Cout - Cmax(Ivar) + abs(Cout - Cmax(Ivar)) if(IMXV .eq. 1) print *,'summodd-',sumodd,’cout-',cout,'cmax-',cmax(ivar) continue Do 60 Isum93,Itim-2,2 Cout - abs(Yout(Ivar,Isum)) Sumeve - Sumeve + Cout - Cmax(ivar) + abs(Cout - Cmax(Ivar)) if(IMXV .eq. 1) print *,'sumeve-’,sumeve,’cout-’,cout,'cmax=',cmax(ivar) continue C0 - abs(Yout(Ivar,1)) Ct - abs(Yout(Ivar,Itim)) 0 00000000 20 10 88 F0 - C0 - Cmax(Ivar) + abs(CO - Cmax(Ivar)) FT - Ct - Cmax(Ivar) + abs(Ct - Cmax(Ivar)) if(IMXV .eq. 1)print *,’F0=',f0,’ FT=',ft Yint(IVAR) - (F0 + FT + 4*Sumodd + 2*Sumeve) * (H/3) return end . ********‘k‘k‘k*‘k‘k‘k*‘k*‘k'k'k*******************************~k********** .----SUBROUTINE PMIN .----PURPOSE THIS SUBROUTINE WILL DETERMINE THE MINIMUM VALUES FOR THE SYSTEM RESPONSE VARIABLES SUBROUTINE PMIN(TMAX,YMIN,TMIN,TSMIN,YNAB,TNAB) DOUBLE PRECISION YMIN(l), TMIN(l), TMAX(1), TSMIN(1), YNAB(1) , TNAB(1) INTEGER dbugZ, NYY, NYCNT PARAMETER(NYY-20, NYCNT34096) COMMON /INTVAR/ T1,T2,H,XIN(20),NX,NY,NS,NU,NFF,IEND,UAF COMMON /RESOUT/ TV(NYCNT), YOUT(NYY,NYCNT) dbugZ - 2 DO 10 IVAR-1,NY ZMIN - 10000 ZTMN - 0 IST = (TMAX(IVAR)/H)+1 DO 20 IMIN-1,IEND IF (ZMIN .GT. YOUT(IVAR,IMIN)) THEN ZTMN - TV(IMIN) ZMIN - YOUT(IVAR,IMIN) ELSE ZTMN - ZTMN ZMIN - ZMIN ENDIF CONTINUE TMIN(IVAR) - ZTMN YMIN(IVAR) - ZMIN CONTINUE DO 40 IVAR-1,NY Zabs - 10000 ZTab a 0 30 40 0 0 0 00000000 30 35 89 DO 30 IMIN-1,IEND IF(Zabs .GT. abs(YOUT(IVAR,IMIN)))THEN ZTab - TV(IMIN) Zabs - abs(YOUT(IVAR,IMIN)) ELSE ZTab - ZTab Zabs - Zabs ENDIF CONTINUE TNAB(IVAR) - ZTab YNAB(IVAR) - Zabs CONTINUE return end . ************************************************************** .----SUBROUTINE PMEAN .----PURPOSE THIS SUBROUTINE WILL DETERMINE THE MEAN VALUE OF THE OUTPUT VARIALBLES SPECIFIED IN THE YOUT VECTOR. SUBROUTINE PMEAN(YMEAN) DOUBLE PRECISION YMEAN(1), YSUM INTEGER NSO, NYY, NYCNT PARAMETER(NYY=20, NYCNT=4096) DOUBLE PRECISION YMEAN1(NYY) COMMON /INTVAR/ T1,T2,H,XIN(20),NX,NY,NS,NU,NFF,IEND,UAF COMMON /RESOUT/ TV(NYCNT), YOUT(NYY,NYCNT) imn - 2 ITIME - (T2)/(H) IBEG - (T1/H)+1. ISTO - IBEG + 2 ISTE - ISTO + 1. AVET - (T2 - T1) DO 40 INY-1,NY SUMODD - 0.0 SUMEVE = 0.0 DO 30 ISUM=ISTO,ITIME-1,2 SUMODD 8 SUMODD + (YOUT(INY,ISUM)) SUMEVE ' SUMEVE + (YOUT(INY,ISUM)) F0 - (YOUT(INY,IBEG)) FT - (YOUT(INY,ITIME)) 40 C. C. 90 IF(IMN .EQ.1) + PRINT *,’THIS IS THE FINAL TIME',TV(ITIME),TV(ITIME-1) YMEAN(INY) - (l/AVET)*(F0 + FT + 4*SUMODD + 2*SUMEVE)*(H/3) return end C. **'k********************************************************** 0 00000 .----SUBROUTINE PRMS .----PURPOSE: TO DETERMINE THE ROOT MEAN SQUARE VALUE OF THE OUTPUT DATA. SUBROUTINE PRMS(YRMS) INTEGER NYY, NYCNT PARAMETER(NYY=20, NYCNT-4096) DOUBLE PRECISION YRMSl(NYY) DOUBLE PRECISION YSST(1), YRMS(1), YNUM COMMON /INTVAR/ T1,T2,H,XIN(20),NX,NY,NS,NU,NFF,IEND,UAF COMMON /RESOUT/ TV(NYCNT), YOUT(NYY,NYCNT) IRMS - 3 ITIME = (TZ/H) IBEG - (Tl/H)+1. ISTO 3 IBEG + 2 ISTE B ISTO + 1 AVET 8 t2 - t1 DO 20 INY-1,NY SUMODD - 0.0 SUMEVE = 0.0 DO 10 ISUM?ISTO,ITIME-1,2 IF(IRMS.EQ.1)WRITE(*,*)'SUMODD-',SUMODD SUMODD - SUMODD + abs (YOUT(INY, ISUMH DO 15 ISUM=ISTE,ITIME-2,2 IF(IRMS.EQ.1)WRITE(*,*)’SUMEVE=',SUMEVE SUMEVE 3 SUMEVE + abs (YOUT(INY, ISUM)) F0 - abs(YOUT(INY,IBEG)) FT = abs(YOUT(INY,ITIME)) IF(IRMS.EQ.2)WRITE(*,*)’FO-',F0,' FT-',FT,' SUMODD-’,SUMODD, ' SUMEVE=',SUMEVE,' ITIME-',TV(ITIME) YRMS(INY) =(1/AVET)*(F0 + FT + 4*SUMODD + 2*SUMEVE)*(H/3) IF(IRMS.LE.2)WRITE(*,*)'YRMSl=',YRMSl(1),’ YRMSB',YRMS(1) RETURN END 91 C.************************************************************** C.----SUBROUTINE POVR C:----PURPOSE: TO DETERMINE THE PERCENT OVERSHOOT C. SUBROUTINE POVR(YMAX,YMEAN,YOVR) : DOUBLE PRECISION YMAX(1), YMEAN(1), YOVR(1) INTEGER NYY, NYCNT PARAMETER(NYY=20, NYCNT=4096) COMMON /INTVAR/ T1,T2,H,XIN(20),NX,NY,NS,NU,NFF,IEND,UAF COMMON /RESOUT/ TV(NYCNT), YOUT(NYY,NYCNT) DO 10 IVAR = 1,NY IF(YMEAN(IVAR).ne.0)THEN YOVR(IVAR)-((YMAX(IVAR)-YMEAN(IVAR))/(YMEAN(IVAR)))*100. ELSE YOVR(IVAR) - 100. ENDIF 10 CONTINUE RETURN END C. C.*************************************************************** C.*************************************************************** C. C. DEBUGGING PROGRAMS C. C.*************************************************************** C.*************************************************************** c SUBROUTINE YRESLT c INTEGER NYY, NYCNT PARAMETER(NYY-20, NYCNT-4096) c COMMON/INTVAR/tl,t2,h,xin(20),NX,NY,NS,NU,NFF,IEND,UAF COMMON/RESOUT/TV(NYCNT), YOUT(NYY,NYCNT) C write(*,*) ' TIME position THIS IS YRESLT ' write(*,*)NX,NY,NS,NU,IEND c do 120 idv-1,IEND write(*,*)TV(IDV),' ',yout(1,idv),' ',YOUT(2,IDV) 120 continue return end 92 C *************************************************************** C subroutine yprfrm(YPERF,NYPERF,NYY) C . DOUBLE PRECISION YPERF(NYPERF,1) C COMMON /INTVAR/ T1,T2,H,XIN(20),NX,NY,NS,NU,NFF,IEND,UAF C DO 40 IY - 1,NY DO 40 IP - 1,NYPERF 40 write(*,*) YPERF(IP,IY) C return end C. c C**************************************************************** C subroutine maxchk(ayout,ymax) double precision ayout,ymax(1) c write (*,*)’ayout -’,ayout,’ ymax =',ymax(1) c return end C**************************************************************** c subroutine MINCHK(XMIN,YMIN) double precision XMIN,YMIN(1) c write (*,*)'XMIN =',XMIN,’ YMIN =',YMIN(1) c return end C**************************************************************** c.----Subroutine ENPGEN: GENERATOR = -U- vector c. c.----Purpose: This subroutine is the standard interface which c. extracts the appropriate U-vector from DS when c. multiple forcing systems are used. Subroutine ENPGEN(nffcn,t,u) c. C. Define passed variables c. Double Precision t,U(1),dtim,ctim,tratio,uratio Integer nffcn,icnt,inxt Character Icls*l c. Common /intvar/ T1, T2, h, xin(20), nx,ny,ns, nu, NFF, IEND, UAF Common /drvsys/ DS(1500, 10), ICLS c. c write(*,’(a)')'icls in enpgen',icls If (Icls .eq. 'e' .or. Icls .eq. 'E') Goto 10 If (Icls .eq. 'u' .or. Icls .eq. 'U') Goto 30 If (Icls .eq. 'd' .or. Icls .eq. 'D') Goto 50 10 12 54 56 90 C91 93 Do 12 j-1,nu U(j) - DS(j,nffcn) Goto 90 Call Usrgen(nffcn,t,u) Goto 90 Continue Icnt - (nffcn-1)*(nu+1) + 1 nend - (nffcn-1)*(nu+1) + nu Ctim - 0 Dtim - 0 i - 1 do while (t .gt. dtim) dtim - DS(i,icnt) i - i + 1 write(*,*)'t-’,t,' dtims',dtim,' i-',i enddo inxt - i + 1 ctim - DS(inxt,icnt) tratio - (t - dtim)/(ctim - dtim) write(*,*)’ctim-',ctim,' tratio-',tratio if(t .gt. 0) then uratio - ((dtim — t)/t) else uratio - 0 endif If(uratio .lt. .02)then m - 0 do 54 j-icnt,nend k - j+1 m - m+l u(m) - DS(i,k) else m - 0 do 56 j-icnt,nend k - j+1 m - m+1 u3 - ds(inxt,k) - ds(i,k) u(m) = tratio*u3 + ds(i,k) endif thtinue do 91 j-l,nu write(*,*)u(1),u(2) return end 94 c .*************************************************************** c.----Subroutine ENPMEN c. c.----Purpose: This subroutine is the standard interface used for c. entering the parameters for multiple driving c. systems. To use this subroutine the user mmst set c. up a datafile for each driving system. Each c. datafile is 1 U vector. These datafiles are then c. read into an array (D8) which is nothing more than c. a set of column U vectors. Each column is then c. passed to ENPGEN as required for analysis. c. subroutine ENPMEN c. c. Define passed variables c. Dimension fname(lO), ndpt(10) Character fname*30, isel*l Real DS Integer ndpt c. Common /intvar/ T1,T2,h,xin(20),nx,ny,ns,nu,NFF,IEND,UAF Common /drvsys/ DS(1500,10), ICLS c. Write(*,108) 5 Write(*,104) Read (*,201) Icls If (Icls .eq. 'e' .or. Icls .eq. 'E’)Then goto 10 Elseif(Icls .eq. 'u' .or. Icls .eq. 'U’)then goto 30 Elseif(Icls .eq. 'd' .or. Icls .eq. 'D')then goto 50 Else goto 5 Endif c. 10 do 12 i-1,10 do 12 j-1,1500 12 ds(j,i) - 0 c. Write(*,109) lend-1 If(ICLS .eq. ’d’ .or. ICLS .eq. ’D')Iend = 2 do 16 i=1,nff Write(*,106) i Read (*,200) fname(i) Open (12,file=fname(i),status='unknown’) do 15 j=1,nu Icnt - i*Iend - (Iend - 1) do 14 k-1,Iend Read (12,204,end-16) DS(j,icnt) Icnt - Icnt + 1 14 Continue 15 Continue Close(12) 16 Continue 95 c. 18 Write (*,101) Read (*,201) isel If (isel .eq. ’c' .or. isel .eq. 'C') goto 90 If (isel .eq. 'v' .or. isel .eq. 'V') goto 20 If (isel .eq. 'r' .or. isel .eq. 'R') goto 10 goto 18 c. cccccc20 Do 22 i-1,nff 20 Write (*,102) (fname(i), i=l,nff) DO 24 j=1,nu 24 Write (*,103) j,(DS(j,k), k=1,nff) cccccc Write (*,*) ' ’ cccccc22 continue goto 18 C. 30 Write(*,105) Read (*,201) isel If(Isel .eq. ’y' .or. Isel .eq. 'Y')Then goto 32 Elseif(Isel .eq. 'n’ .or. Isel .eq. ’N’)Then goto 32 c. Else goto 10 Endif c. 32 Call Usrmen ’ Goto 90 c. 50 do 52 i=1,10 do 52 j-1,1500 52 ds(j,i) - 0. c. Write(*,109) do 53 i-l,nff write(*,106)i read (*,200)fname(i) Write(*,107)i 53 read (*,205)ndpt(i) c. do 58 k=1,nff open(unit-12,file=fname(k),forme'formatted’,status='unknown') m - (k-1)*(nu+1) + 1 1 = m + nu do 56 j - l,ndpt(k) 56 Read (12,*,end=57) (DS(j,i),i=m,l) 57 Close (unit-12) 58 Continue c. c do 60 j=1,ndpt(1) c60 write(*,*)ds(j,1),ds(j,2),ds(j,3),ds(j,4),ds(j,5),ds(j,6) c 90 continue 101 102 103 108 104 105 109 106 107 C. 200 201 204 205 OOOOOOOOOOOOOOOOOOOO +-++-+ + +-+ + +-+ +-+ +-+ + + 96 format (17x,'Please select one of the following',/, l7x,’ C - Continue',/, 17x,’ V - View the data entered’,/, 17x,’ R - Re-enter the datafiles’,/, 17X,’ '13) format (17x,' ’,//,20x,'DS Matrix Build’,/, 1x,’File Names: ’,a12,’ ',a12,' ’,a12,' ',a12, ' ',a12,' ',a12,//, 5x,’ ------------------------------------------- ') format (3x,’U comp t',i3,'-',e11.5,' ',e11.5,' ',e11.5, ' ',e11.5,' ',e11.5,' ',e11.5) format (llx,' ’,/, 13x,'Enter System Driver Parameters',/, 13x,’ ------------------------------------------ ') format (17x,'How is The Forcing System Being Modeled':/; 17x,’ ---------------------------------------- , , l7x,’ E - Enport model generator',/, l7x,’ U - User written generator',/, l7x,’ D - Experimental data',/, 17x,’ ',$) format (13x,'Do you wish to use your own menu',/, 13x,’ Y - Yes N = No ',/, 13xr' . 'rS) format (17x,'Enter Datafile Information ') format (17x,' Name of File NO:',12,' ',$) format (17x,' Number of Data Pts for File NO:',i2,' ’,$) format (a30) format (a1) format (d12.5) format (14) return end . **************************‘k‘k‘k****‘k**************‘k‘k‘k‘k'k‘k‘k‘k‘k‘k‘k‘k‘k‘k‘k . ‘k*************************‘k‘k‘k‘k‘k******************************** .----Subroutine ENPAFN .--—-Purpose: This subroutine determines the maximum value from the objective function set. In addition all AF components which are elements of the obj fcn set will have their return values calculated. In addition the objective function value used by optdes will be calculated. .----Variab1es used: Passed variables af - the analysis function array ny - number of output variables nff - number of forcing functions npm - number of performance variables nobj- size of objective function Subroutine ENPAFN(NPM,AV,AF) 97 c. c. Define passed variables c. Dimension zf(lO), af(l), av(l), dumaf(10,10,100) Double Precision dumaf, af, av Real zf, amax, acur Integer rfact, ncont, npm, naf, nobj, obfcn, icstr, iavn c. Common lintvar/ T1,T2,h,xin(20),nx,ny,ns,nu,NFF,IEND,UAF Common /objfcn/ nobj,obfcn(10),icstr,iavn c. c. Determine repeating factor and number of calculated af c. constraints. rfact - npm*ny ncont - npm*ny*nff c. c. Set AF vector C. If (obfcn(1) .lt. 0) then c. c. Sort the af vector c. c. i - num of forcing functions c. j - num of performance criteria c. k - num of output variables c. do 20 i - 1,nff do 20 j - 1,npm do 20 k - 1,ny iaf - (i-1)*ny*npm +(j-1)*ny + k 20 dumaf(i,j,k) - af(iaf) c. C. Determine max values for each constraint c. do 35 j - 1,npm do 30 k - l,ny naf - (j-1)*npm + k amax - dumaf(1, j,k) do 25 i - 1,nff acur - dumaf(i,j,k) if(acur .gt. amax)then zf(naf) - acur else . zf(naf) - amax endif 25 continue 30 continue 35 continue c. c. Set the AF vector obj fcn constraints e. do 40 i-icstr,ncont,rfact 40 AF(i) - AF(i) - AV(iavn) c. 98 c. Set obj fcn c. ‘ AF(ncont+1) - AV(iavn)**2 c. ELSE c. c. Determine obj fcn subset c. Do 50 i-1,nobj iaf - obfcn(i) 50 zf(i) - af(iaf) c. c. Determine Max value c. amax - zf(l) Do 55 i-1,nobj if(zf(i) .gt. amax)then amax - zf(i) else amax - amax endif 55 continue c. c. Set the AF vector obj fcn constraints c. Do 60 i-1,nobj iaf - obfcn(i) 60 AF(iaf) - AF(iaf) - AV(iavn) c. c. Set the Obj Fcn value c. AF(ncont+1) - AV(iavn)**2 c. ENDIF c. return end c .*************************************************************** c.----Subroutine enpobj c. c.----Purpose: This subroutine sets the objective function value c. to be the maximum of the ith constraint for a set c. of j' forcing functions. (where j' - 1,2...j c. forcing functions). This subroutine should be c. used when multiple forcing functions are used for c. analysis. c. c.----Variables used: c. Passed variables c. -------------------------------------- c. NOBJ - determines the size of the c. objective function set. c. obfcn - the objective function set. c. icstr - the ith performance measurement. c. iavn - analysis variable number c. used for the obj fcn. 99 C. subroutine enpobj(npm) c. c. Define passed variables c. Integer npm, nobj, obfcn, icstr, iavn c. Common lintvar/ T1,T2,h,xin(20),nx,ny,ns,nu,NFF,IEND,UAF Common lobjfcn/ nobj,obfcn(10),icstr,iavn c. do 5 i-l,10 5 obfcn(i)-0 c. c. If (nobj .eq. nff*npm) then obfcn(l) - -1 Else Write(*,104) Write(*,102) Read (*,200) iavn Do 10 i-1,nobj Write(*,101) i 10 Read (*,200) obfcn(i) Endif c. c. c. If(obfcn(1) .lt. 0)then Write(*,104) Write(*,102) Read (*,200) iavn Write(*,103) Read (*,200) icstr Else Continue Endif c. 104 format (' ',/, + 11x,'Enter Index Numbers for the Following',/, + 11x,’ ----------------------------------------- ') 101 format (11x,' ',/, + 11x,'AF Objective Function Set Member',i3,’ ',$) 102 format (11x,'AV Objective Function Comparator ’,$) 103 format (11x,'Perf Meas used as the Obj Fcn ',$) c. 200 format (i3) c. return end C. ************************************************************** C.—---Subroutine Matwr C. Subroutine MATWR(string) C Character String*72 C. Write (*,100) string 100 100 Format (a72) return end C************************************************************* C C O 000 01 .----Subroutine afbild C. Subroutine afbild(AV,AF,NMEM) DOUBLE PRECISION AV(lO), AF(100) . Call data dialogue subroutine INTEGER NYY, NYCNT, NFF, NDX, INDX, obfcn, nobj, iavn, NPM, NMEM, icstr PARAMETER(NYY-20, NYCNT=4096) DIMENSION FCN(nyy). CSTR(100) CHARACTER FCN*32, IPAR*5, AGN*1, CSTR*2 Common /objfcn/ nobj,obfcn(10),icstr,iavn COMMON /INTVAR/ T1,T2,H,XIN(20),NX,NY,NS,NU,NFF,OS,IEND COMMON /PAROPT/ IPAR locl - index(ipar,'m') loc2 - index(ipar,'a') loc3 - index(ipar,’r') loc4 - index(ipar,'v') loc5 - index(ipar,'s') loc6 - index(ipar,'x’) loc7 - index(ipar,’n') if (locl .gt. 0) fcn(locl) if (loc2 .gt. 0) fcn(loc2) if (loc3 .gt. 0) fcn(loc3) if (loc4 .gt. 0) fcn(loc4) if (loc5 .gt. 0) fcn(loc5) if (loc6 .gt. 0) fcn(loc6) if (loc7 .gt. 0) fcn(loc7) ’maximum value' 'mean value' ’root mean square’ 'max violation' 'minimum.va1ue ' 'absolute max ' 'absolute min ' NPM - 0 if(locl .gt. npm) npm - locl if(loc2 .gt. npm) npm - loc2 if(loc3 .gt. npm) npm = loc3 if(loc4 .gt. npm) npm - loc4 if(locS .gt. npm) npm - loc5 if(loc6 .gt. npm) npm - 1006 if(loc7 .gt. npm) npm = loc7 Ifin - fo*Ny DO 5 I-1,fo*Npm*Ny Cstr(I) = ' ' 101 If (Nobj .eq. 1) Then Write(*,105) Read (*,200) icstr cstr(icstr) - ’*' Elseif (obfcn(1) .lt. 0) Then . Do 10 i-Icstr,fo*Npm*Ny,Ny 10 Cstr(I) - ’**’ Else Do 15 I-1,10 Indx - Obfcn(I) If(Indx .ne. 0) + Cstr(Indx)-’**’ 15 Continue Endif c. Ip - 1 Do 25 j-1,fo Do 25 i-1,Npm,l c IP - (j-1)*Ny*Npm + (I-l)*NY + 1 c IEP - (j-l)*Ny*Npm + i*ny Write(*,104)fcn(i) Do 20 K=1,NY Write(*,106) Cstr(Ip), Ip, K 20 Ip - Ip + 1 25 Continue c. If (Nobj .eq. 1) Then Write(*,108) Else Write(*,103)nmem Write(*,107) Endif c. 103 format(le,’ *AF(’,i2,’) Objective Function’) 104 format(Sx,a32) 105 format(llx,’Enter AF Index # of the Objective Function’) 106 format(le,a2,’AF(’,iZ,’) Y-Output(’,i2,’)’) 107 format(’ ’,/,10x,’** - Objective Function Set Member’) 108 format(’ ',/,10x,’* - Objective Function’) C. 200 format(i4) C. RETURN END C . *‘k‘k'k‘k‘k'k‘k‘k‘k'k‘k'k'k'k*********************************‘k‘k'k'k‘k'k'k‘k‘k'k‘k‘k‘k 102 F.3 DSMOPT.COM This is the DEC command file that controls the interface environment. From this file the user can execute any phase of the model building or optimization process desired. COMPUTER PROGRAM DSMOPT.COM WRITTEN BY I* ! It I l I l* I I* l I* I 3 It I I I I I I I I l* I I I i $. $ $ $. $ $ $* S S $ $ $ $ $. $. $. $ $. $. $. $ $. $. $. $. $. $! $! $! $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ 103 ************************************************************** ----Filename: DSMOPT.COM *************************************************************** ----Purpose: Provide user with menu driven interface between the ENPORT simulation/modeling software and OPTDES.BYU optimization software. ************************************************************** -—--Written BY: Mark Davis *************************************************************** —---Date Commissioned: September 20, 1991 *************************************************************** ----External Files: ENPMOD.EDT — SYSPRM.EDT - SYSDAT.EDT CDE82.0PT - ENPLIN.USR *************************************************************** ----Setup: When installed this command file must have two symbol-names changed: OPTFI - Directory name where OPTDES Subroutines reside. USEFI - Directory name where INTERFACE Subroutines reside. ENPFI - Directory name where ENPORT model files reside *************************************************************** ----Modification History: Date Programmer Description of Changes *************************************************************** set noverify optfi - "PROJECT6:[optdes]" usefi - "user3:[davism.ca1tech]" dir _nam - f$directory() enpfi - dir _nam fi_exist - f$file_attributes("usrgen.for","uic") the _message -- f$message($status) good _gen - f$extract(10, 10, the _message) f good_gen .eqs. "NOSUCHFILE" then goto usegen genfi - enpfi goto chkmen usegen: genfi - usefi chkmen: fi_exist - f$file_attributes("usrmen.for","uic") the _message -- f$message($status) good_ men - f$extract(10, 10, the _message) if good4men .eqs. "NOSUCHFILE" then goto usemen menfi - enpfi goto chkafn usemen: menfi - usefi (DUTUMMJD{OUMMMDiDUMMWfl£DUMMHD <0£DODUMMWD£0000PMt {DUDUMMJW{DUI (DUGUMMJDIDUMMMD{D(OUDU> indana: count - 1 write sys$output write sys$output write sys$output write sys$output inquire numcom loopl: write write sys$output sys$output write sys$output write sys$output inquire prog 109 ******************************************N * The number of programs to be compiled*" ******************************************N ******************************************N * Enter the program name *" ******************************************N fortran/debug/nooptimize ’prog’.for if count .eq. numcom then goto optdes count - count + 1 goto loopl linana: if lnkchk .eq. 2 then goto lnkmsg delete ’enpfi’conven.exe:* link/executable-’enpfi’conven ’optfi’conven.obj, - write sys$output write sys$output write sys$output ’optfi’consub.obj, - ’optfi’meneds.obj, - ’optfi’menutl.obj, - ’optfi’menpro.obj, - ’optfi’menout.obj, - ’optfi’sysvms.obj, - ’usefi’anasub.obj, - 'enpfi'zzzzzz.obj, - 'genfi’usrgen.obj, - ’menfi’usrmen.obj, - ’afnfi’usrafn.obj II has been created " II Executable file CONVEN delete ’enpfi’cdesign.exe:* ! cdesZ/options 1ink/executab1e=’enpfi’cdesign — write sys$output write sys$output write sys$output del zzzzzz.for;* del zzzzzz.obj:* lnkchk - 2 goto optdes lnkmsg: write sys$output write sys$output write sys$output write sys$output ’usefi’anasub.obj, ’genfi’usrgen.obj, ’afnfi’usrafn.obj, ’enpfi’zzzzzz.obj, - ’menfi’usrmen.obj, - ’usefi’cdesZ/options II Executable file CDESIGN has been created " The files have been linked already. You " must return to the main menu to create a " new executable file. " mmmmmm MMMMMMMMM 110 if choice .eqs. "C" then goto chkfi if choice .eqs. "0" then goto optdes goto again creset: link/executable-’enpfi'setup 'optfi’setup.obj, write sys$output " write sys$output " write sys$output " goto optdes enditt: del zzzzzz.dat;* endit: exit ’optfi’dissub.obj, ’optfi’varsub.obj, ’optfi’funsub.obj, ’optfi’comsub.obj, ’optfi’sdbsub1.obj, ’optfi’sdbsub2.obj, ’optfi’menset.obj, ’optfi’meneds.obj, ’optfi'menutl.obj, 'optfi’menpro.obj, ’optfi’menout.obj, ’optfi’sysvms Executable file SETUP has been created" 113 F5 SYSDAT.EDT This is the DEC command edit file. This file will execute a series of edit commands. These commands are used to edit the ENPORT .DAT output file to read the number of state variables, outputs, and inputs when ANAPRE is executed. COMPUTER PROGRAM SYSPRM.EDT WRITTEN BY MARK DAVIS 112 set nofnf set nonum set nosummary set noverify del 24 thru 400 del 1 thru 17 sub/outputs/OUTPUTS (Y-VECTOR)/1 thru lOO/notype sub/INPUTS/INPUTS (U-VECTOR)/1 thru lOO/notype SU/STATES/STATES (X-VECTOR)/1 THRU lOO/NOTYPE ex zzzzzz.dat set set set set del del del del 114 nofnf nonum nosummary noverify 24 thru 400 22 20 1 thru 18 ex zzzzzz.dat 1 15 E6 CDESZ.OPT This is the DEC command options file. This file is used when an executable line is to long for exection from within the command file. This file contains all the names of the subroutines used for linking with ANASUBFOR to create the executable file CDESIGN.EXE. COMPUTER PROGRAM CDESZ.OPT WRITTEN BY MARK DAVIS PROJECT6: PROJECT6: PROJECT6: PROJECT6: PROJECT6: PROJECT6: PROJECT6: PROJECTS [optdes]design. [optdes]calsub. [optdes]profun. [optdes]params. [optdes]setvar.obj, [optdeslexplor.obj, [optdes]grgalg2.obj, obj, - obj, obj, obj, :[optdes]qpsolv.obj, PROJECT6: PROJECT6: PROJECT6: PROJECT6: PROJECT6: PROJECT6: PROJECT6: PROJECT6: [optdes]lpsolv.obj, [optdes]approx2.obj, [optdes]combin1.obj, [optdes]plosub.obj, [optdeslscrtek.obj, [optdes]meneds.obj, [optdes]menpro.obj, [OPTDES]sysvms.obj 116 PROJECT6: PROJECT6: PROJECT6: PROJECT6: PROJECT6: PROJECT6: PROJECT6: PROJECT6: PROJECT6: PROJECT6: PROJECT6: PROJECT6: PROJECT6: PROJECT6: [optdes]displa.obj, [optdes]propro.obj, [optdes]runa1g.obj, [optdes]histor.obj, [optdes]grgalgl.obj, [optdes]sqpalg.obj: [optdes]slpalg.obj, [optdes]approxl.obj, [optdes]tolers.obj, [optdes]combin2.obj, [optdes]grasub.obj, [optdes]penHP.obj, - [optdes]menut1.obj, [optdes]menout.obj, APPENDIX G APPLICATION EXAMPLE DATA APPENDIX G APPLICATION EXAMPLE DATA G.l Introduction The following information was used to execute the application example solved in chapter 3. The input vector information describes the operating parameters of the bond graph. Items such as mass, trf, frequencies and amplitudes are set from these data files. The ENPORT output files are generated by ENPORT when the Fortran file is generated. The optimization data files were generated from OPTDES. These files contain information describing the setup of the optimization problem G.2 Input Vector (U) Datafiles These data files profile the bond graph model used in the application example. 117 DATA FILE PROF LDAT WRITTEN BY MARK DAVIS HI—‘I—‘OOOOI—‘Dw 1. 4. .67 118 .9270000 .81750000 .0000000000 .0 .5000000 .8666667 .8 .12 .067 387 638 094 -l.638 9. 500000 8666667 01 139.75 3416.7 mwooooooww 000000 .0 .83300000000 .33330000000000 .66667000000 DATA FILE PROF2.DAT WRITTEN BY MARK DAVIS 119 11 3 770 8 00 . 2000770 ...... 0 6000001 DATA FILE PROF3.DAT WRITTEN BY MARK DAVIS 1% a o 4 n7 ”an 54 9 . 6 fl 0 29 3 1 6 336 2 000000130.000910000000836 .000 e no so 0 e o .8 e 034 ooooooooo to. 0.. 101010080.10913330000003 121 0.3 ENPORT Output Files I These files were produced by ENPORT. They describe the bond graph model. The .USR file contains the state equations written in compilable fortran code. The remaining data files contain information about the structure of the bond graph model. FORTRAN FILE USRGLUSR GENERATED FROM ENPORT 122 C****** MATRIXx User Code_Block file written by ENPORT *********** C _ C File Name: USER01.USR C C 5 Dof Suspension System W/Variable Flow Source - WO/Grav. C Effects C SystemLBuild User_Code_Block USR01 C C***************************************************************** C SUBROUTINE USR01(INFO,T,U,NU,X,XDOT,NX,Y,NY,RP,IP) C IMPLICIT DOUBLE PRECISION (A-Z) CHARACTER STRNG*8 DOUBLE PRECISION T, U(*), X(*), XDOT(*), Y(*), RP(*) INTEGER IP(*), INFO(4), NU, NX, NY, I LOGICAL INIT, STATE, OUTPUT EXTERNAL MATWR C C***************************************************************** C INIT - INFO(Z).NE.0 STATE - INFO(3).NE.0 OUTPUT - INFO(4).NE.O C C---- Check the problem size... C 0 IF (INIT) THEN STRNG-I****I IF (NU.NE.29) STRNG-’inputs.’ IF (NX.NE.10) STRNG-’states.’ IF (NY.NE. 6) STRNG-’outputs.’ IF (STRNG.NE.'****’) THEN INFO(1) - -2 CALL MATWR(’ ’) CALL MATWR(’ *** Error calling USR01.’) CALL MATWR(’ Incorrect number of ’//STRNG) RETURN ENDIF ENDIF C C---- Get the time and the states X... C IF (STATE.OR.OUTPUT) THEN' TIME- T 050 P5M Q3Q P2M P3J PlM 010 020 P4M Q40 X( 1) X( 2) X( 3) X( 4) X( 5) X( 6) 'X( 7) 123 W1 - U( 1) W2 - U( 2) PHIl - U( 3) PHI2 - U( 4) PHI3 - U( 5) PHI4 - U( 6) T1 - U( 7) T2 - U( 8) T3 - U( 9) T4 - U(10) T5 - U(11) AMPl - U(12) AMP2 - U(13) AMP3 - U(14) PHIS - U(15) PHI6 - U(16) Il - U(l7) 12 - U(18) I3 - U(19) I4 - U(20) I5 - U(21) SE1 - U(22) SE2 - U(23) SE3 - U(24) SE4 - U(25) SE5 - U(26) TF1 - U(27) TF2 - U(28) TF3 - U(29) C C C1 - RP( 1) C2 - RP( 2) C3 - RP( 3) R1 - RP( 4) R2 - RP( 5) R3 - RP( 6) C C---- Evaluate the system equations... C C4 - 1.80000E+04 C5 - 1.80000E+04 R4 - 6.00000E+01 R5 - 6.00000E+01 S468 - AMP3 * SIN( W1 *TIME ) $28 - AMPl * SIN( W1 *TIME ) C ...... STEP IF (TIME .GE. Tl ) THEN S488 - 1.00000E+00 ELSE S488 - 0. ENDIF S498 - AMP2 * SIN( W2 *TIME ) C ...... 124 STEP IF (TIME .GE. 0.00000E+00) SSS - PHIZ ELSE SSS - 0. ENDIF $518 - AMP2 * COS( STEP IF (TIME .GE. 0.00000E+00) SBS - PHIl ELSE S88 - 0. ENDIF STEP IF (TIME .GE. T2 ) S9S - -1.00000E+00 ELSE S9S - 0. ENDIF STEP IF (TIME .GE. 0.00000E+00) SZlS - PHI3 ELSE $218 - 0. ENDIF 822$ - AMPl * COS( STEP IF (TIME .GE. 0.00000E+00) $238 - PHI4 ELSE 823$ - 0. ENDIF STEP IF (TIME .GE. T4 $298 - -1.00000E+00 ELSE 329$ - 0. ENDIF STEP IF (TIME .GE. 0.00000E+00) $253 - PHI5 ELSE 825$ - 0. ENDIF STEP IF (TIME .GE. 0.00000E+00) 828$ - PHIS ELSE $288 - 0. ENDIF STEP IF (TIME .GE. T3 ) $248 - -1.00000E+00 ELSE 824$ - 0. ENDIF THEN W2 THEN THEN THEN W1 THEN ) THEN THEN THEN THEN *TIME *TIME ) i C ...... 125 STEP IF (TIME .GE. T5 ) THEN $548 - 1.00000E+00 ELSE 854$ - 0. ENDIF STEP IF (TIME .GE. T3 ) THEN 855$ - 1.00000E+00 ELSE $558 - 0. ENDIF 857$ - 1.00000E+00 558$ - 1.00000E+00 E5W - SE5 E2W - SE2 E1W - SE1 E4W - SE4 MTFl - TF1 MTF2 - TF2 MTF3 - TF3 SlOS - 1.00000E+00 *SZS *S488 8118 - 1.00000E+00 *S49S *SSS $123 - -1.00000E+00 *SSlS *SBS S308 - 1.00000E+00 *S4SS *SZlS S318 - 1.00000E+00 *SZZS *8238 $378 - 1.00000E+00 *SZSS *S498 S365 - -1.00000E+00 *5288 *SSIS $158 - 1.00000E+00 * S463 +1.00000E+00 .00000E+00 +1.00000E+00 * S455 * * S448 - 1.00000E+00 * S303 * * * I H +1.00000E+00 .00000E+00 +1.00000E+00 $388 I ...: S34S - 1.00000E+00 *SZ4S *S44S S338 - 1.00000E+00 *S44S *3548 S398 - 1.00000E+00 *SSSS *8385 ESQ - C5 * QSQ F5M - (1./ I5 ) * P5M E3Q - C3 * Q3Q F2M - (1./ 12 ) * P2M F3J - (1./ I3 ) * P3J FlM - (l./ Il ) * PlM ElQ - C1 * QlQ E2Q - C2 * Q2Q F4M - (1./ I4 ) * P4M E4Q - C4 * Q4Q F1R1 - 1.00000E+00 *MTFl *F3J F2R1 - 1.00000E+00 *MTF2 *F3J F3R1 - 1.00000E+00 *MTF3 *F3J SlSS - 1.00000E+00 *S483 *S4SS 817$ - 1.00000E+00 *S9S *S45S S408 - 1.00000E+00 *829S *S38S 818$ - 1.00000E+00 * SlSS +1.00000E+00 * Sl7S 8198 S358 S418 S428 F4VS F5VS F5V ESF F3V E3F F1V E1F1 F2V E2F F4V E4F ESV E3V EIV E2V E4V E1R2 E2R2 E3R2 S438 356$ 853$ S328 $138 $148 $18 8208 838 S48 SSS 8508 S78 3528 ESVM ESVS 1.00000E+00 .00000E+00 1.00000E+00 .000002+00 1.00000E+00 .OOOOOE+00 1.00000E+00 .OOOOOE+00 1.00000E+00 1.00000E+00 1.00000E+00 -l.00000E+00 R5 -1.00000E+00 +1.00000E+00 -1.00000E+00 R3 1.00000E+00 -1.00000E+00 +1.00000E+00 R1 1.00000E+OO +1.00000E+00 -1.00000E+00 R2 1.00000E+00 -1.00000E+00 R4 1.00000E+00 +1.00000E+00 1.00000E+00 +1.00000E+00 1.00000E+00 +1.00000E+00 1.00000E+00 +1.00000E+00 1.00000E+00 +1.00000E+00 1.00000E+00 1.00000E+00 1.00000E+00 838$ 8388 S443 S448 S458 S458 S468 S468 S488 S488 S498 S495 851$ 851$ ESV ESV ******** (I) w w (0 *Sl9S *S428 *ElV *E2V *E3V * FSQ FSF ESM FSW F3VS FSVM E3R1 E3T E3VS F30 F3F E2M F2W F2T F3T F1T F3R2 F2R2 E3J F1R2 ElRl E1VM ElT FIVM ElM F1W FlQ F1F1 E2R1 E2T E2VS F2Q F2F E4M F4W FZVS F4VM E4VM E4VS F4Q F4F ENDIF F5V F5V -1.00000E+00 +1.00000E+00 -1.00000E+00 F5M F5M FSM E3V E3V E3V F3V F3V -1.00000E+00 -1.00000E+00 -1.00000E+00 -1.00000E+00 F2M F2M F2M F2M F3J F3J 1.00000E+00 -1.00000E+00 -l.00000E+00 F3J E1V E1V E1V FlM 1.00000E+00 -1.00000E+00 FlM F1V F1V E2V E2V E2V F2V F2V -1.00000E+00 +1.00000E+00 -1.00000E+00 F4M F4M F4M E4V E4V F4V F4V *fi** 127 ESW E3V ESV E2W E2V E3V E1V E3R2 E2R2 E1R2 E1V E1W E4W E2V E4V 128 C C---- Store the state derivatives XDOT... C IF (STATE) THEN XDOT( 1) - F5V XDOT( 2) - E5M XDOT( 3) - F3V XDOT( 4) = E2M XDOT( 5) - E3J XDOT( 6) - ElM XDOT( 7) - F1V XDOT( 8) - F2V XDOT( 9) - E4M XDOT(lO) - F4V ENDIF C C--—- Store the output list Y... C IF (OUTPUT) THEN Y( 1) - 010 Y( 2) - ElM Y( 3) - 020 Y( 4) ' 030 Y( 5) - Q40 Y( 6) = QSQ ENDIF C RETURN END C C**************************************************************** DATA FILE USR01.RPD GENERATED FROM ENPORT 129 // MATRIXx RP-name exec file written by ENPORT // // File name: USER01.RPD // // Assignment of U and NP variables for RP use Cl - 1.20000E+03 C2 - 3.60000E+03 C3 - 3.60000E+O3 R1 - 1.20000E+02 R2 - 3.00000E+02 R3 - 3.00000E+02 // RP( 1) - C1 RP( 2) - C2 RP( 3) - C3 RP( 4) - R1 RP( 5) - R2 RP( 6) - R3 // End of the file. DATA FILE USR01.DAT GENERATED FROM ENPORT 130 // Matrix-x MATSETUP file written by ENPORT. // // File name: USER01.DAT // // // Create a superblock ENPSUP BUILD EDIT SUPER-BLOCK ENPSUP 0 // // Define user_code_block DEFINE BLOCK 2 USER CODE BLOCK BLOCK NAME ENPUSR NUMBER OF INPUTS 29 NUMBER OF OUTPUTS 6 NUMBER OF STATES 10 PARAMETER ENTRY 1 Y 6, 0 // RP Parameters .2000E+03 .6000E+03 .6000E+03 .2000E+02 .0000E+02 .0000E+02 wwwaH // Initial conditions .0000E+00 .0000E+00 .0000E+00 .0000E+00 .0000E+00 .0000E+00 .0000E+00 .0000E+00 .0000E+00 .0000E+00 0000000000 // // Define connections CONNECT BLOCKS EXTERNAL OUTPUT 6 2 Y // // Return to main menu TOP // // End-of-file 131 6.4 Optimization Datafiles These datafiles were produced by OPTDES. They describe the optimization problem set up for each problem solved in the application example. DATA FILE FINAL LDAT GENERATED FROM OPTDES AV 1200.000000 AV 3600.000000 AV 3600.000000 AV 120.0000000 AV 300.0000000 NROWV "U'U'U'U'U'U

qur4 E mmewwpwwpwwHH "U'U'U'U'U'U NROWV HFJF‘HPJP‘ - 6 135 000000 4 conl 4 con2 4 con3 4 con4 4 con5 4 con6 4 con7 7 obj fcn 4 con8 4 con9 U'l con10 U'l conll NDF - MINIMUM 600.0000000 2400.000000 2400.000000 24.00000000 60.00000000 60.00000000 COEFF .000000000 .000000000 .000000000 .000000000 .000000000 .000000000 12 NROWF - MAXIMUM 6000.000000 12000.00000 12000.00000 600.0000000 960.0000000 960.0000000 12 o "l #1 OmdmmfiwNH * IDCD~JOKUHbLuhahnfib4PJF‘HWJFJP‘PHHIJPJP‘fi DJF‘H NJHw: 0

n He 95. .2 $85 .a I <~ cum .3 .5..- ...§ 3.. . v To I 23. a. . IS. 5:: . x l E an as . o LIST OF REFERENCES [1] Rosenberg, R., The ENPORT Reference Manual, 7th Edition, Rosencode Associates, Lansing ML, 1990. [2] Bailing, R., and Free, and J., Parkinson, A., OPT DESBYU User's Manual, Release 4.0, Design Synthesis, INC, Provo, UT, 1989. [3] Hang, 13.1., and Arora, J .S., Applied Optimal Design, Mechanical and Structural Systems, John Wiley & Sons, 1979. 140 NSTRTUE I|II| IIIIII III I||I IIIIIII III II III IIIII II III III