G DOCUMENTATION AND USER INSTRUCTIONS OF PROGRAM `OPTIMIZE' Appendix G contains the documentation for the program OPTIMIZE dis- cussed in Chapters 3. It gives some information about the general features and use of the programs. G-1 G-2 G. Documentation and user instructions of program OPTIMIZE G. Documentation and User Instructions of Program OPTIMIZE G.1 Program Documentation G.1.1 Overview of the Program Program OPTIMIZE deals with minimization of a non-linear function subject to non-linear constraints. It uses the sequential quadratic programming (SQP) based on the algorithm developed by Powell [1] OPTIMIZE program is already implemented in SANOPT-S and SANOPT-F programs. It is an independent and separate computer program which can be used for solving user dened optimization problems. G.1.2 Block Structure and Main Routines A modular approach is adopted, in that separate subroutines are employed to perform the various operation required in optimization. Each module in turn is composed of one or more subroutines relevant only to its own needs and, in some cases, of subroutines which are common to several modules. Control of the modules is held by the main or master segment. The main segment of the program structure for OPTIMIZE is given in Figure G.1. FIMA DESVAL OPTIMIZE SQPSET FDFCDC FIMA Fig. G.1. Main block diagram of program OPTIMIZE. 1. FIMA handles the le management. This subroutine open and close the necessary data les. 2. DESVAL is a user supplied subroutine which includes the optimizaiton control parameters. These parameters are the number of design variable, number of constraints and bounds of the design variables and constraints. 3. SQPSET is carry out sequential quadratic programming based on the algorithm developed by Powell [21] G.2 Input instructions G-3 4. FDFCDC is a user supplied subroutine. It computes the objective function, constraints and their derivatives. G.1.3 File Structures Program OPTIMIZE uses the following channel for output: unit 1 contains the results of the optimization. These are values of the optimum design variables, objective function and constraints at the optimum solution. G.2 Input Instructions There is no input data le for program OPTIMIZE. However, the user has to supply two subroutines which are DESVAL and FDFCDC. Subroutine DESVAL: contains the control parameter for optimization problem to be solved. The following parameters must be dened in the subroutine: ndvab ncons necon xdvab(idvab) xlowb(idvab) xuppb(idvab) number of design variable number of inequality constraint number of equality constraint initial values of the design variables, idvab = 1; : : : ; ndvab lower limits of the design variables, idvab = 1; : : : ; ndvab upper limits of the design variables, idvab = 1; : : : ; ndvab Subroutine FDFCDC: computes the objective function and constraints for optimization problem to be solved. The following parameters must be dened in the subroutine: f(1) f(icons) d(idvab) d(idvab) objective function constraint, icons = 2; : : : ; ncons derivative of the objective function, idvab = 1; : : : ; ndvab derivative of the constraint, idvab = ndvab+1; : : : ;ndvabncons G-4 G. Documentation and user instructions of program OPTIMIZE G.3 Specimen User Supplied Subroutines and Output Data File In this section user supplied subroutines and output data le are provided for a selection of the numerical examples presented in the text. This information will be of assistance to readers who wish to run the program contained in the book on their own computer. G.3.1 Example Problem denition: The objective function is to minimize nonlinear function of the design variables x ( ) = sin(x1 x2 ) + 2 exp (x1 + x2 ) + F x ( ) which is a F x 1 exp (x1 + x2 ) (G:1) subject to inequality constraints 2 x1 +10 + x2 0 x1 + 2x2 0 2 x2 3 x1 (G:2) and bounds on the design variables 1 1 x1 x2 +1 +1 (G:3) A typical user supplied subroutines for OPTIMIZE is displaced in Table G.1 and G.2. The output le of the program for the problem dened above is given in Table G.3. Table G.1. c c c c c c c The FORTRAN computer program listing of the subroutine DESVAL. subroutine desval (ndvab,ncons,necon,xdvab,xlowb,xuppb) Argument variables integer ndvab, ncons, necon real*8 xdvab(*), xlowb(*), xuppb(*) Local variables real*8 bigbn G.3 Specimen User Supplied Subroutines and Output Data File G-5 c bigbn = 1.0d20 c c*** problem setup: control variables c ndvab = 2 ncons = 3 necon = 0 c c*** problem setup: design variables with bounds c xdvab(1) = 1.d0 xdvab(2) = 2.d0 c xlowb(1) = -bigbn xlowb(2) = -bigbn c xuppb(1) = bigbn xuppb(2) = bigbn c return end Table G.2. c c c c c c The FORTRAN computer program listing of the subroutine FDFCDC. subroutine fdfcdc(x,f,d) Argument variables real*8 real*8 f(*), x(*) d(*) Local variables real*8 ccos, cexp c c*** function c ccos = dcos(x(1)*x(2)) cexp = dexp(x(1)+x(2)) f(1) = dsin(x(1)*x(2)) + 2*cexp + 1/cexp c c*** function derivatives c d(1) = x(2)*ccos + 2*cexp - 1/cexp G-6 G. Documentation and user instructions of program OPTIMIZE d(2) = x(1)*ccos + 2*cexp - 1/cexp c c*** constraints c f(2) = -x(1)**2-x(2)**2 + 1d0 f(3) = -x(1)**3+x(2) f(4) = x(1)+2d0*x(2) c c*** constraints derivatives c d(3) = -2.d0*x(1) d(4) = -2.d0*x(2) d(5) = -3.d0*x(1)**2 d(6) = 1.d0 d(7) = 1.d0 d(8) = 2.d0 c return end Table G.3. The output of the OPTIMIZE for example problem. _____ _____ _______ _____ _______ _____ ______ _______ | | |_____] | | | | | | ____/ |______ |_____| | | __|__ | | | __|__ /_____ |______ Optimization Program Copyright (c) E. Hinton, J. Sienz and M. Ozakca Swansea, 1988 - 2003 file created: Fri Sep 27 15:37:41 2002 solution: number of calls of fdfcdc: function value at the solution: -0.8264473889 0.5630139549 11 0.2389516015D+01 constraint values at the solution: -0.2664535259D-14 0.1127490155D+01 0.2995805209D+00 References G-7 References [1] Powell, M.J.D., Algorithms for nonlinear constraints that use Lagrangian functions, Math. Progr., 14, 224-248, 1978. G-8 G. Documentation and user instructions of program OPTIMIZE
© Copyright 2025 Paperzz