Home

User`s Guide for SNOPT Version 7.4 - CCoM

image

Contents

1. 1 2 Implementation SNOPT is implemented as a library of Fortran 77 subroutines The source code is compatible with all known Fortran 77 90 and 95 compilers and can be converted to C code by the f2c translator 4 included with the distribution All routines in SNOPT are intended to be re entrant as long as the compiler allocates local variables dynamically Hence they may be used in a parallel or multi threaded envi ronment They may also be called recursively 1 Introduction 5 1 3 The SNOPT interfaces SNOPT contains several interfaces between the user and the underlying solver allowing problems to be specified in various formats New users are encouraged to use the snOptA interface This allows linear and nonlinear constraints and variables to be entered in arbitrary order and allows all nonlinear functions to be defined in one user routine It may also be used with SnadiOpt 7 which provides gradients by automatic differentiation of the problem functions For efficiency reasons the solver routines require nonlinear variables and constraints to come before linear variables and constraints and they treat nonlinear objective functions separately from nonlinear constraints snOptB the basic interface imposes these distinc tions and was used by all versions of SNOPT prior to Version 6 In some applications the objective and constraint functions share data and computation The snOptC interface allows the functions to be co
2. subject to ly lt lt uz lp lt F x lt Up where the upper and lower bounds are constant F x is a vector of smooth linear and nonlinear constraint functions F x and F4 x is one of the components of F to be minimized as specified by the input parameter ObjRow The option Maximize specifies that Fos x should be maximized instead of minimized snOptA reorders the variables and constraints so that the problem is in the form NP Section 1 Ideally the first derivatives gradients of F should be known and coded by the user If only some gradients are known snOptA estimates the missing ones by finite differences Note that upper and lower bounds are specified for all variables and functions This form allows full generality in specifying various types of constraint Special values are used to indicate absent bounds l oo or uj 00 for appropriate j Free variables and free constraints free rows have both bounds infinite Fixed variables and equality constraints have lj uj In general the components of F are structured in the sense that they are formed from sums of linear and nonlinear functions of just some of the variables This structure can be exploited by snOptA see Section 3 3 3 1 Subroutines associated with snOptA snOpta is accessed via the following routines snInit Section 1 6 must be called before any other snOptA routines snSpec Section 7 4 may be called to input a
3. 33 the superbasics limit is too small Some limit was exceeded before the required solution could be found Check the iteration log to be sure that progress was being made If so restart the run using a basis file that was saved or should have been saved at the end of the run If the superbasics limit is too small then the problem appears to be more nonlinear than anticipated The current set of basic and superbasic variables have been optimized as much as possible and a PRICE operation is necessary to continue but there are already Superbasics limit superbasics and no room for any more In general raise the Superbasics limit s by a reasonable amount bearing in mind the storage needed for the reduced Hessian The Reducd Hessian dimension h will also increase to s unless specified otherwise and the associated storage will be about 35 words In some cases you may have to set h lt s to conserve storage The QPSolver CG option will be invoked and the rate of convergence will probably fall off severely EXIT 40 Terminated after numerical difficulties INFO 41 current point cannot be improved INFO 42 singular basis INFO 43 cannot satisfy the general constraints INFO 44 ill conditioned null space basis These conditions arise only after the LU factorization options have been strengthened automatically as much as possible For INFO 41 SNOPT was unable to improve on a non optimal point 1 Subroutines usrfun funobj or func
4. Further j and x values may be included in any order For any j in this list the value x is recorded but the state is unaltered 9 Basis files 105 9 2 Punch and Insert files These files provide compatibility with commercial mathematical programming systems The Punch file from a previous run may be used as an Insert file for a later run on the same problem It may also be possible to modify the Insert file and or problem and still obtain a useful advanced basis The standard MPS format has been slightly generalized to allow the saving and reloading of nonbasic solutions It is illustrated in Figure 3 Apart from the first and last line each entry has the following form Columns 2 3 5 12 1522 25 36 Contents Key Namel Name Value The various keys are best defined in terms of the action they cause on input It is assumed that the basis is initially set to be the full set of slack variables and that column variables are initially at their smallest bound in absolute magnitude or zero for free variables Key Action to be taken during Insert XL Make variable Name basic and slack Name2 nonbasic at its lower bound xU Make variable Name basic and slack Name2 nonbasic at its upper bound LL Make variable Name1 nonbasic at its lower bound UL Make variable Name1 nonbasic at its upper bound SB Make variable Namel superbasic at the specified Value Note that Name1 may be a column name or a row name but on XL and XU lines Name2 m
5. 1 or mode eq 2 then sum 2 0d 0 sum g0bj 1 sum g0bj 2 sum g0bj 3 sum end if end subroutine funobj 4 The snOptB interface 40 Subroutine funcon involves only x1 x2 First we treat the Jacobian as a dense matriz In Fortran it is preferable to access two dimensional arrays column wise as shown Each column of gCon contains two elements even though one of them is zero The Acol indA locA data structure must include these elements as well as other entries belonging to the linear constraints Since funcon is called before funobj we test nState for the first and last entries subroutine funcon amp mode nnCon nnJac neJac amp x fCon gCon nState amp cu lencu iu leniu ru lenru integer amp lencu leniu lenru mode neJac nnCon nnJac nState amp iu leniu double precision amp fCon nnCon gCon nnCon nnJac ru lenru x nnJac character amp cu lencu 8 Toy NLP problem with dense Jacobian integer amp nout double precision amp i x2 nout 9 x1 x 1 x2 x 2 if nState eq 1 then if nout gt 0 write nout end if First entry a This is problem Toy if mode eq 0 or mode eq 2 then fCon 1 x1 2 x2 2 fCon 2 x2xx4 end if if mode ge 1 then gCon 1 1 2 0d 0 x1
6. 4 6 Subroutine HUG e casi aR RH a eae ee 4 2 Dubroutmne SUNG PS ae Example oe be eS ae eed hha deed A twa ee ae 4 9 Constant Jacobian elements o 410 Subroutine SAMEERA eR The sn0ptC interface DI Subroutine SOMO comi o ee ee a wl ae g2 DUDES SETI ao a A A a The npOpt interface 6 1 Subroutines used by mpOpt o o dawee 62 Subroutine ABRE o a ABRA A A A 6 3 User supplied subroutines for npOpt e Ga Subroutine funmobj cee he a ew ra A 6 5 Subroutine Funcom 2 c aai ee be a Ee ae ee es 6 6 Constant Jacobian elements 11 11 12 14 15 21 23 26 29 31 31 31 33 34 39 41 43 43 47 47 50 50 50 7 Optional parameters TA The SPECS file e occ aaa dee bese da gu 7 2 Multiple sets of options in the Specs fille 7 3 SPECS file checklist and defaults o TA AUDE ASDOS ic E ee a e a AE RAR 7 5 Subroutines snSet snSeti snSetr o o o c ner bereri aara Veku 7 6 Subroutines snGet snGetc snGeti snGetr 7 7 Description of the optional parameters e os sass ceased teuai 8 Output 2 1 The PRINT De cocos 2480 G58 dE Ged AA A ea a g2 We AJOS eration OE ao ioga aek a ae ee ed 8 3 The minor iteration log lt lt ee ee SL Basis factorization statistics so c ce ae ee ae eA eG 38 5 Crash statistics 06064 a eae e e a a Si EXIT cond
7. 83 84 91 92 141 142 Resource limit error iteration limit reached major iteration limit reached the superbasics limit is too small time limit reached Terminated after numerical difficulties current point cannot be improved singular basis cannot satisfy the general constraints ill conditioned null space basis unable to compute acceptable LU factors Error in the user supplied functions incorrect objective derivatives incorrect constraint derivatives Undefined user supplied functions undefined function at the first feasible point undefined function at the initial point unable to proceed into undefined region User requested termination terminated during function evaluation terminated from monitor routine Insufficient storage allocated work arrays must have at least 500 elements not enough character storage not enough integer storage not enough real storage Input arguments out of range invalid input argument basis file dimensions do not match this problem System error wrong number of basic variables error in basis package iter is the number of major iterations performed istate describes the status of the constraints lt r x lt u in problem DenseNP For the jth lower or upper bound j 1 to nctot1 the possible values of istate j are as follows where is the specified Feasibility tolerance 2 1 0 l 2 3 Region 1 The lower bound is violated by more than Region 5 The upper bou
8. Elements that are identically zero need not be included The inequalities l lt f x Asy lt ur and Ig lt Aga Asy lt u2 implied by the constraint functions 4 1 are known as the nonlinear and linear constraints respectively Together these two sets of inequalities constitute the general constraints In general the vectors x and z have different dimensions but they always overlap in the sense that the shorter vector is always the beginning of the other In the example the nonlinear Jacobian variables u v are an ordered subset of the nonlinear objective variables u v w In other cases it could be the other way round whichever is the most convenient but the first way keeps f x smaller Together the nonlinear objective and nonlinear Jacobian variables comprise the nonlinear variables The number of nonlinear variables n is therefore the larger of the dimensions of x and 2 i e ny max n n max nn0bj nnJac 4 The snOptB interface 33 4 3 Problem dimensions The following picture illustrates the problem structure just described nnJac gt nnCon E ss J nn0bj nn0bj The dimensions are all input parameters to subroutine snOptB see the next section For linear programs nnCon nnJac nnObj are all zero If a linear objective term exists i0bj points to one of the bottom rows nnCon lt i0bj lt m The dashed boxes indicate that a
9. Warm start alternative to a cold start Time limit 0 no time limit Major iterations limit 1000 or m if that is more Minor iterations limit 500 or 3m if that is more Major step limit 2 0 Superbasics limit n 1 n number of nonlinear variables Derivative level 3 NOT ALLOWED IN sn0pta Derivative option 1 ONLY FOR snOptaA Derivative linesearch Nonderivative linesearch Function precision 3 0e 13 almost full accuracy Difference interval 5 5e 7 Function precision Central difference interval 6 7e 5 Function precision New superbasics limit 99 controls early termination of QPs Objective row ObjRow row number of objective in F x Penalty parameter 0 0 initial penalty parameter Proximal point method 1 satisfies linear constraints near xo Reduced Hessian dimension 2000 or Superbasics limit if that is less Violation limit 10 0 unscaled constraint violation limit Unbounded step size 1 0e 18 Unbounded objective 1 0e 15 Hessian approximation Hessian full memory default if n lt 75 Hessian limited memory default if ni gt 75 Hessian frequency 999999 for full Hessian never reset Hessian updates 10 for limited memory Hessian Hessian flush 999999 no flushing Frequencies Check frequency 60 test row residuals 4x sl Expand frequency 10000 for anti cycling procedure Factorization frequency 50 100 for LPs Save frequency 100 save basis map LUSOL options LU factor tolerance
10. Z Q 2 2 2 Description of the SQP method 9 The matrix Z is used only as an operator i e it is not stored explicitly Products of the form Zv or Z7g are obtained by solving with B or BT The package LUSOL 12 is used to maintain sparse LU factors of B as the BSN partition changes From the definition of Z we see that the reduced gradient can be computed from BTr IB Z q Ys Str where 7 is an estimate of the dual variables associated with the m equality constraints Ax s b and gz is the basic part of g By analogy with the elements of 77g we define a vector of reduced gradients or reduced costs for all variables in x s a o 4 m so that ds Zq At a feasible point the reduced gradients for the slacks s are the dual variables r The optimality conditions for subproblem QP may be written in terms of d The current point is optimal if d gt 0 for all nonbasic variables at their lower bounds d lt 0 for all nonbasic variables at their upper bounds and d 0 for all superbasic variables ds 0 In practice SNOPT requests an approximate QP solution k Sk Tk with slightly relaxed conditions on dj If ds 0 no improvement can be made with the current BSN partition and a nonbasic variable with non optimal reduced gradient is selected to be added to S The iteration is then repeated with ns increased by one At all stages if the step x s p would cause a basic or superbasic variable to violate
11. and the nonbasic variables remain unaltered until one of them is chosen to become superbasic At a nonoptimal feasible point x s we seek a search direction p such that a s p remains on the set of active constraints yet improves the QP objective If the new point is to be feasible we must have Bp Sps Npy 0 and py 0 Once ps is specified pz is uniquely determined from the system Bp Sps It follows that the superbasic variables may be regarded as independent variables that are free to move in any desired direction The number of superbasic variables ns say therefore indicates the number of degrees of freedom remaining after the constraints have been satisfied In broad terms ns is a measure of how nonlinear the problem is In particular ns need not be more than one for linear problems 2 4 The reduced Hessian and reduced gradient The dependence of p on ps may be expressed compactly as p Zps where Z is a matrix that spans the null space of the active constraints B S Z P I 2 1 0 where P permutes the columns of A I into the order BS N Minimizing q a 4 with respect to ps now involves a quadratic function of ps 9 Zps p ZTH Zps where g and H are expanded forms of g and Hp defined for all variables x s This is a quadratic with Hessian ZTH Z the reduced Hessian and constant vector Zg the reduced gradient If the reduced Hessian is nonsingular ps is computed from the system ZTH Zps
12. gCon 2 1 0 0d 0 gCon 1 2 2 0d 0 x2 gCon 2 2 4 0d 0 x2 3 end if if State ge 2 then if mout gt 0 write nout end if end subroutine funcon Jacobian elements for column 1 Can t be omitted Jacobian elements for column 2 Last entry gt a Finished problem Toy 46 SNOPT 7 4 User s Guide Now we treat the Jacobian as a sparse matrix stored column wise Note that gCon has only 3 entries because we intentionally omit the zero entry in column 1 The first column of the Acol indA locA data structure must also have that entry deleted subroutine funcon amp mode nnCon nnJac neJac amp x fCon gCon nState amp cu lencu iu leniu ru lenru integer amp lencu leniu lenru mode neJac nnCon nnJac nState amp iu leniu double precision amp fCon nnCon gCon neJac ru lenru x nnJac character amp cu lencu 8 integer amp nout double precision amp El x2 nout 9 x1 x 1 x2 x 2 if nState eq 1 then First entry if nout gt 0 write nout a This is problem Toy end if if mode eq 0 or mode eq 2 then fCon 1 x1x x2 x2 2 fCon 2 x2xx x4 end if if mode ge 1 then gCon 1 2 0d 0 x1 Jacobian elements for column 1 gCon 2 2 0d 0 x2 Jacobian elements for column 2 gCon 3 4 0d 0 x2 3 end if if State ge 2 then Last entry if nout gt 0 write nout a gt Finished proble
13. lenrw majIts n nclin amp ncnln iState ntnclintncnln iw leniw double precision amp fObj AC1dA bl n nclin ncnln bu ntnclintncnln amp cMul n nclin ncnln fCon gCon ldg g0bj n amp Hess 1dH rw lenrw x n On entry n is n the number of variables in the problem n gt 0 nclin is m the number of general linear constraints nclin gt 0 6 The npOpt interface 55 ncnin 1dA ldg 1dH is my the number of nonlinear constraints ncnln gt 0 is the row dimension of the array A 1dA gt 1 1dA gt nclin is the row dimension of the array gCon ldg gt 1 1dg gt ncn1n is the row dimension of the array Hess 1dH gt n is an array of dimension 1dA k for some k gt n It contains the matrix A for the linear constraints If nclin 0 A is not referenced In that case A may be dimensioned 1dA 1 with 1dA 1 or it could be any convenient array bl nctot1 bu nctotl contain the lower and upper bounds for r x in problem DenseNP To specify non existent bounds set bl j lt infBnd or bu j gt infBnd where infBnd is the Infinite Bound size default value 107 To specify an equality constraint say r z 8 set b1 j bu j 8 where 8 lt infBnd For the data to be meaningful it is required that b1 j lt bu j for all j funcon funobj are the names of subroutines that calculate the nonlinear constraint func tions f x the objective function fo
14. where 1FMul iw 329 These will be accessible to usrfun if snOptA is called with parameters cu iu ru the same as cw iw rw If you still require workspace elements rw 501 maxru and rw maxrw 1 lenru are set aside for this purpose where maxru iw 2 Similarly for workspace in cw and rw See the Total and User workspace options On exit Status may be used to indicate that you are unable to evaluate f or its gradients at the f nF G neG current x For example the problem functions may not be defined there During the linesearch f x is evaluated at points k apx for various steplengths a where f x has already been evaluated satisfactorily For any such zx if you set Status 1 snOptA will reduce a and evaluate f again closer to xz where it is more likely to be defined If for some reason you wish to terminate the current problem set Status lt 2 contains the computed functions f x except perhaps if needf 0 contains the computed derivatives G x except perhaps if needG 0 These derivative elements must be stored in G in exactly the same positions as implied by the definitions of snOptA s arrays iGfun jGvar There is no internal check for consistency except indirectly via the Verify option so great care is essential 26 SNOPT 7 4 User s Guide 3 7 Example usrfun Here we give subroutine usrfun for the problem minimize 32 529 21 23 24 II subject to x 22
15. xlow n xupp n contain the lower and upper bounds ly and uz on the variables x To specify non existent bounds set xlow j lt infBnd or xupp j gt infBnd where infBnd is the Infinite Bound size default value 10 To fix the jth variable at xj 8 set xlow j xupp j 8 with 8 lt infBna Flow nF Fupp nF contain the lower and upper bounds lp and up on F x To specify non existent bounds set Flow j lt infBnd or Fupp j gt infBnd To make the ith constraint an equality F x 6 set Flow i Fupp i xnames nxname Fnames nFname sometimes contain 8 character names for the variables and problem functions If nxname 1 or nFname 1 then names are not used The printed solution will use generic names for the columns and rows If nxname n and nFname nF the elements xnames j and Fnames 7 should contain the 8 character names of the jth variable and th row of F x n usually contains a set of initial values for x See next xstate n usually contains a set of initial states for each variable x 3 The snOptA interface 17 1 For Cold starts Start 0 or 1 with no basis file provided xstate and x must be defined If there is no wish to provide special information you may set xstate j 0 x j 0 0 for all j 1 n All variables will be eligible for the initial basis Less trivially to say that the optimal value of x will probably be one of its bounds set xstate j 4 and x j xl
16. 00 XL x 17 r 8 1 12608E 00 LL r 6 0 00000E 00 XL x 18 r 9 1 16117E 00 LL r 7 0 00000E 00 XL x 19 r 10 1 19761E 00 LL r 8 0 00000E 00 XU x 20 r 11 1 21394E 00 LL r 9 0 00000E 00 XU x 21 r 12 7 66504E 02 LL x 10 0 00000E 00 XU x 22 r 13 8 77750E 02 UL r 11 0 00000E 00 XU x 23 r 14 8 95733E 02 UL r 12 0 00000E 00 XU x 24 r 15 9 12127E 02 UL r 13 0 00000E 00 XU x 25 r 16 9 26610E 02 UL r 14 0 00000E 00 XU x 26 r 17 9 38453E 02 UL r 15 0 00000E 00 XU x 27 r 18 9 47013E 02 UL r 16 0 00000E 00 XU x 28 r 19 9 51453E 02 UL r 17 0 00000E 00 XU x 29 r 20 9 51023E 02 UL r 18 0 00000E 00 UL x 30 1 16000E 01 UL r 19 0 00000E 00 ENDATA UL r 20 0 00000E 00 ENDATA Figure 3 Format of PUNCH INSERT files Figure 4 Format of Dump Load files References 109 References 1 10 11 12 13 14 15 16 17 18 A R Conn Constrained optimization using a nondifferentiable penalty function SIAM J Numer Anal 10 1973 pp 760 779 10 G B DANTZIG Linear Programming and Extensions Princeton University Press Princeton New Jersey 1963 4 S K ELDERSVELD Large Scale Sequential Quadratic Programming Algorithms PhD thesis Depart ment of Operations Research Stanford University Stanford CA 1991 10 S I FELDMAN D M Gay M W MAIMONE AND N L SCHRYER A Fortran to C converter Com puting Science Technical Report 149 AT amp T Bell Laboratories Murray Hill NJ 1990 4 R FLETCHER An l penalty meth
17. 4 The snOptB interface 49 Errors 0 Counts the number of errors iPrt 0 Suppress print output iSum 0 Suppress summary output call snSeti amp Total character workspace lencw iPrt iSum Errors amp cw ltmpcw iw ltmpiw rw ltmprw call snSeti amp Total integer workspace leniw iPrt iSum Errors amp cw ltmpcw iw ltmpiw rw ltmprw call snSeti amp Total real workspace lenrw iPrt iSum Errors amp cw ltmpcw iw ltmpiw rw ltmprw An alternative way is to call snInit again with arguments lencw leniw lenrw call snInit amp iPrint iSumm cw lencw iw leniw rw lenrw However this has the twin effects of resetting all options to their default values and reprint ing the SNOPT banner unless iPrint 0 and iSumm 0 are set for the Print and Summary files 50 SNOPT 7 4 User s Guide 5 The snOptc interface The snOptC interface is identical to snOptB except that both objective and constraint func tions are provided in a single routine usrfun instead of being computed separately in funobj and funcon This arrangement may be more convenient when the objective and constraint functions depend on common data that is difficult to share between separate routines 5 1 Subroutine sn0ptC Problem NP is solved by a call to subroutine snOptC whose parameters are defined here Note that most machines use double precision declarations as shown but some machines
18. F x f x Az The first neG entries are valid 0 lt neG lt lenG and lenG gt 1 The entries may define the elements of G in any order but subroutine usrfun must define the values of G in exactly the same order lenG is the dimension of the coordinate arrays iGfun jGvar lenG gt 1 neG is the number of nonzero entries in G neG gt 0 nxname nFname give the number of variable and constraint names provided in the character arrays xname and Fname If nxname 1 and nFname 1 no names are provided Generic names will be used in the printed solution Otherwise the values must be nxname n and nFname nF and all names must be provided in xnames and Fnames below ObjAdd is a constant that will be added to the objective row F Objrow for printing pur poses Typically ObjAdd 0 0d 0 ObjRow says which row of F x is to act as the objective function If there is no such row set ObjRow 0 Then snOptA will seek a feasible point such that lp lt F x lt ur and ly lt a lt ug 0 lt ObjRow lt nF Prob is an 8 character name for the problem Prob is used in the printed solution and in some routines that output basis files A blank name may be used usrfun Section 3 6 is the name of a subroutine that calculates the nonlinear portion f x of the vector of problem functions F x f x Az and optionally its Jacobian G x for a given vector x usrfun must be declared external in the routine that calls snOpta
19. Hess must be a positive definite matrix is an initial estimate of the solution iw leniw rw lenrw are integer and real arrays of workspace for npOpt Both leniw and lenrw must be at least 500 In general leniw and lenrw should be as large as possible because it is uncertain how much storage will be needed for the basis factors As an estimate leniw should be about 100 m n or larger and lenrw should be about 200 m n or larger Appropriate values may be obtained from a preliminary run with leniw lenrw 500 If Print level is positive the required amounts of workspace are printed before npOpt terminates with INFO 43 or 44 On exit INFO reports the result of the call to npOpt Here is a summary of possible values Further details are in Section 8 6 Finished successfully 1 optimality conditions satisfied 2 feasible point found 3 requested accuracy could not be achieved 5 elastic objective minimized 6 elastic infeasibilities minimized The problem appears to be infeasible 11 infeasible linear constraints 12 infeasible linear equality constraints 13 nonlinear infeasibilities minimized 14 linear infeasibilities minimized 15 infeasible linear constraints in QP subproblem 16 infeasible nonelastic constraints The problem appears to be unbounded 21 unbounded objective 22 constraint violation limit reached 6 The npOpt interface 57 31 32 33 34 41 42 43 44 45 51 52 61 62 63 71 74 81 82
20. On large problems SNOPT is most efficient if only some of the variables enter nonlinearly or there are relatively few degrees of freedom at a solution i e many constraints are active SNOPT requires relatively few evaluations of the problem functions Hence it is especially effective if the objective or constraint functions and their gradients are expensive to evaluate The source code is re entrant and suitable for any machine with a Fortran compiler SNOPT may be called from a driver program in Fortran MATLAB or C C with the new interface based on the Fortran 2003 standard on Fortran C interoperability A f2c translation of SNOPT to the C language is provided although this feature will be discontinued in the future users should migrate to the new C C interface Keywords optimization large scale nonlinear programming nonlinear constraints SQP methods limited storage quasi Newton updates Fortran software pgill ucsd edu http www CCoM ucsd edu peg elwong ucsd edu http www CCoM ucsd edu elwong walter stanford edu http www stanford edu walter saunders stanford edu http www stanford edu saunders Partially supported by Northrop Grumman Aerospace Systems National Science Foundation grants DMS 1318480 and DMS 1361421 and the National Institute of General Medical Sciences of the National Institutes of Health award U01GM102098 The content is solely the responsibility of the authors and does not necessarily rep
21. Summary file Solution Yes on the Print file Suppress options listing options are normally listed System information No Yes prints more system information Problem specification Minimize opposite of Maximize Feasible point alternative to Max or Min Objective row 1 has precedence over ObjRow snOpta Infinite bound 1 0e 20 Convergence Tolerances Major feasibility tolerance 1 0e 6 x target nonlinear constraint violation Major optimality tolerance 1 0e 6 target complementarity gap Minor feasibility tolerance 1 0e 6 x for satisfying the QP bounds Derivative checking Verify level cheap check on gradients Start objective check at col 1 NOT ALLOWED IN snOptA Stop objective check at col ni NOT ALLOWED IN snOpta Start constraint check at col 1 NOT ALLOWED IN snO0ptA Stop constraint check at col nf x NOT ALLOWED IN snOpta Scaling Scale option 0 No scaling Scale tolerance 0 9 Scale Print default scales are not printed Other Tolerances Crash tolerance 0 1 Linesearch tolerance 0 9 smaller for more accurate search Pivot tolerance 3 7e 11 QP subproblems QPSolver Cholesky default Crash option 3 first basis is essentially triangular used only during elastic mode or 20m if that is more 10 for large LPs Elastic weight Iterations limit 10000 1 0e 4 Partial price 1 64 SNOPT 7 4 User s Guide SQP method Cold start has precedence over argument start
22. compressed to recover unused storage Ideally this number should be zero If it is more than 3 or 4 the amount of workspace available to SNOPT should be increased for efficiency The percentage increase in the number of nonzeros in L and U relative to the number of nonzeros in B or Bs is the number of triangular rows of B or Bs at the top of U The number of nonzeros in U including its diagonals The largest subdiagonal element allowed in L This is the specified LU factor tolerance or a smaller value currently being used for greater stability The largest nonzero element in U The ratio Umax Amax which ideally should not be substantially larger than 10 0 or 100 0 If it is orders of magnitude larger it may be advisable to reduce the LU factor tolerance to 5 0 4 0 3 0 or 2 0 say but bigger than 1 0 As long as Lmax is not large say 5 0 or less max Amax Umax DUmin gives an estimate of the condition number of B If this is extremely large the basis is nearly singular Slacks are used to replace suspect columns of B and the modified basis is refactored The number of triangular columns of B or Bg at the left of L The number of columns remaining when the density of the basis matrix being factorized reached 0 3 The actual maximum subdiagonal element in L bounded by Ltol 92 SNOPT 7 4 User s Guide Akmax The largest nonzero generated at any stage of the LU factorization Values much larger than Amax indicate inst
23. correct values should be set before the call to snMemB subroutine snMemB amp INFO m n neA negCon amp nnCon nnJac nnObj amp mincw miniw minrw amp cw lencw iw leniw rw lenrw integer amp INFO lencw leniw lenrw m mincw miniw minrw n neA amp negCon nnCon nnJac nn0bj iw leniw double precision amp rw lenrw character amp cw lencw 8 The arguments m n neA nnCon nnJac nn0bj define the problem being solved and are identical to the arguments used in the call to snOptB see Section 4 4 For a sequence of problems snMemB may be called once with overestimates of these quantities On entry negCon is the number of nonzeros in the Jacobian gCon negCon lt nnCon nnJac lencw leniw lenrw must be of length at least 500 cw lencw iw leniw rw lenrw are 8 character integer and real arrays of workspace for snMemB 48 SNOPT 7 4 User s Guide On exit INFO reports the result of the call to snMemB Further details are in Section 8 6 Insufficient storage allocated 81 work arrays must have at least 500 elements Finished successfully 104 memory requirements estimated mincw miniw minrw estimate how much character integer and real storage is needed to solve the problem To use snMemB the first step is to allocate the work arrays These may be temporary arrays tmpcw tmpiw tmprw say or the snOptB arrays cw iw rw which will be reallocated after the storage limi
24. each component appears to be correct 2 Individual columns of the problem Jacobian will be checked 3 Options 2 and 1 will both occur in that order 7 Optional parameters 85 1 Derivative checking is disabled Verify level 3 should be specified whenever a new function routine is being developed The Start and Stop keywords may be used to limit the number of nonlinear variables checked Missing derivatives are not checked so they result in no overhead Violation limit T Default 10 This keyword defines an absolute limit on the magnitude of the maximum constraint viola tion after the linesearch On completion of the linesearch the new iterate 7 4 satisfies the condition vil k 1 lt T max 1 v xo 7 3 where xp is the point at which the nonlinear constraints are first evaluated and v x is the ith nonlinear constraint violation v x max 0 l fi a f x us The effect of this violation limit is to restrict the iterates to lie in an expanded feasible region whose size depends on the magnitude of r This makes it possible to keep the iterates within a region where the objective is expected to be well defined and bounded below If the objective is bounded below for all values of the variables then 7 may be any large positive value Warm start Default value of input argument start This parameter indicates that a basis is already specified via the input arrays for SNOPT This option has the same effect
25. for Fortran 90 and C drivers that reallocate workspace if necessary 4 2 Identifying structure in the objective and constraints Consider the following nonlinear optimization problem with four variables x u v w z minimize u v w 3w 52 U U W Z subject to u v w 2 v4 z 4 2u 4v gt 0 with bounds w gt 0 z gt 0 This problem has several characteristics that can be exploited e The objective function is the sum of a nonlinear function of the three variables x u v w and a linear function of potentially all variables zx e The first two constraints are nonlinear and the third constraint is linear e Each nonlinear constraint involves the sum of a nonlinear function of the two variables x u v and a linear function of the remaining variables y w z 32 SNOPT 7 4 User s Guide The nonlinear terms are defined by user written subroutines funobj and funcon which involve only x and z the appropriate subsets of variables For the objective we define the function fo u v w u v w to include only the nonlinear terms The variables x u v w are known as nonlinear objective variables and their dimension n is specified by the snOptB input parameter nn0bj 3 here The linear part 3w 5z of the objective is treated as an additional linear constraint whose row index is specified by the input parameter i0bj Thus the full objective has the form fo x dfr wher
26. it is taken to be minus the Activity Lower limit a the lower bound on the row Upper limit the upper bound on the row Dual activity The value of the dual variable 7 often called the shadow price or simplex multiplier for the ith constraint The full vector 7 always satisfies BIr gp where B is the current basis matrix and gg contains the associated gradients for the current objective function I The constraint number 7 The COLUMNS section Here we talk about the column variables xj 7 1 n We assume that a typical variable has bounds a lt a lt 2 Label Description Number The column number j This is the internal number used to refer to x in the iteration log Colum The name of zj 8 Output 101 State The state of x relative to the bounds a and 3 The various states possible are as follows LL xj is nonbasic at its lower limit a UL xj is nonbasic at its upper limit EQ x is nonbasic and fixed at the value a FR xj is nonbasic at some value strictly between its bounds a lt a lt p BS a is basic Usually a lt x lt SBS x is superbasic Usually a lt x lt A key is sometimes printed before the State to give some additional information about the state of xj A Alternative optimum possible The variable is nonbasic but its reduced gradient is essentially zero This means that if xj were allowed to start moving from its current value there would be no chang
27. j in this case 1 2 2 1 2 2 8 1 3 2 This list must match the integer arrays iGfun and jGvar below If Derivative option 0 is specified some or all of the gradient elements need not be assigned values in G snOptA will estimate them by finite differences 6 The pattern of nonzero elements of the Jacobian G This is a list of coordinates i 7 of the nonzero elements G j held in two integer arrays If i iGfun k and j jGvar k then G k holds Gij In the example the program calling snOptA would include the following iGfun 1 1 row coordinate of G 1 1 0 jGvar 1 2 col coordinate of G 1 iGfun 2 2 row coordinate of G 2 2 0 x 1 jGvar 2 1 col coordinate of G 2 iGfun 3 2 row coordinate of G 3 8 0 x 2 jGvar 3 2 col coordinate of G 3 iGfun 4 3 row coordinate of G 4 2 0 x 1 2 0 jGvar 4 1 col coordinate of G 4 iGfun 5 3 row coordinate of G 5 2 0 x 2 jGvar 5 2 col coordinate of G 5 If Derivative option 0 is specified iGfun and jGvar may be defined automatically by subroutine snJac p 21 14 SNOPT 7 4 User s Guide 3 3 Exploiting problem structure In many cases the vector F x is a sum of linear and nonlinear functions snOptA allows these terms to be specified separately so that the linear part is defined just once by the input arguments iAfun jAvar and A Only the nonlinear part is recomputed at each zx Suppose that ea
28. nonlinear objective function fo 1 may involve either a subset or a superset of the variables in the nonlinear constraint functions f x counting from the left Thus nn0bj lt nnJac or vice versa Sometimes the objective and constraints really involve disjoint sets of nonlinear variables We then recommend ordering the variables so that nnObj gt nnJac and 2 x x where the objective is nonlinear in just the last vector x Subroutine funobj should set g j 0 0 for j 1 nnJac It should then set as many remaining gradients as possible preferably all 34 SNOPT 7 4 User s Guide 4 4 Subroutine sn0ptB Problem NP is solved by a call to subroutine snOptB whose parameters are defined here Note that most machines use double precision declarations as shown but some machines use real The same applies to the user routines funcon and funobj subroutine sn0ptB amp Start m n neA nName amp nnCon nn0bj nnJac amp i0bj ObjAdd Prob amp funcon funobj amp Acol indA locA bl bu Names amp hs x pi rc amp INFO mincw miniw minrw amp ns ninf sInf Obj amp cu lencu iu leniu ru lenru amp cw lencw iw leniw rw lenrw external amp funcon funobj integer amp INFO i0bj lencu lencw leniu leniw lenru lenrw m amp mincw miniw minrw n neA nInf nName nnCon nnJac nn0bj amp nS hs n m indA neA iu leniu iw leniw locA n 1 double precision am
29. of LU factorization B Periodic factorization of the basis B 8 Output 91 m n Elems Amax Density Merit lenL Cmpressns Incres Utri lenU Ltol Umax Ugrwth Ltri densel Lmax BR More careful rank revealing factorization of B using threshold rook pivot ing This occurs mainly at the start if the first basis factors seem singular or ill conditioned Followed by a normal B factorize BS Bs is factorized to choose a well conditioned B from the current B S Followed by a normal B factorize BT Same as BS except the current B is tried first and accepted if it appears to be not much more ill conditioned than after the previous BS factorize The number of rows in B or Bg 66 The number of columns in B or Bs Preceded by or gt respectively The number of nonzero elements in B or Bs The largest nonzero in B or Bs The percentage nonzero density of B or By The average Markowitz merit count for the elements chosen to be the diagonals of PUQ Each merit count is defined to be c 1 r 1 where c and r are the number of nonzeros in the column and row containing the element at the time it is selected to be the next diagonal Merit is the average of n such quantities It gives an indication of how much work was required to preserve sparsity during the factorization The number of nonzeros in L The number of times the data structure holding the partially factored matrix needed to be
30. of a vector y satisfying By ay Wherever possible Step is chosen to avoid extremely small values of Pivot since they cause the basis to be nearly singular In rare cases it may be necessary to increase the Pivot tolerance to exclude very small elements of y from consideration during the computation of Step 90 SNOPT 7 4 User s Guide L U ncp ns The number of nonzeros representing the basis factors L and U Immediately after a basis factorization B LU this is lenL lenU the number of subdiagonal elements in the columns of a lower triangular matrix and the number of diagonal and superdiagonal elements in the rows of an upper triangular matrix Further nonzeros are added to L when various columns of B are later replaced As columns of B are replaced the matrix U is maintained explicitly in sparse form The value of L will steadily increase whereas the value of U may fluctuate up or down Thus in general the value of L U may fluctuate up or down in general it will tend to increase The number of compressions required to recover storage in the data structure for U This includes the number of compressions needed during the previous basis factorization Normally ncp should increase very slowly If not the amount of integer and real workspace available to SNOPT should be increased by a significant amount As a suggestion the work arrays iw and rw should be extended by L U elements The current number of superbasi
31. pi ns contains an estimate of A the vector of Lagrange multipliers shadow prices for the nonlinear constraints The first nnCon components must be defined If nothing is known about A set pi 0 0 i 1 nnCon need not be specified for Cold starts but should retain its value from a previous call when a Warm start is used cu lencu iu leniu ru lenru are 8 character integer and real arrays of user work space They may be used to pass data or workspace to your function routines funcon and funobj which have the same parameters They are not touched by snOptB If the function routines don t reference these parameters you may use any arrays of the appropriate type such as cw iw rw see next paragraph Conversely you should use the latter arrays if funcon and funobj need to access snOptB s workspace cw lencw iw leniw rw lenrw are 8 character integer and real arrays of workspace for snOptB Their lengths lencw leniw lenrw must all be at least 500 In general lencw 500 is appropriate but leniw and lenrw should be as large as possible because it is uncertain how much storage will be needed for the basis factorization As an estimate leniw should be about 100 m n or larger and lenrw should be about 200 m n or larger Appropriate values may be obtained from a preliminary run with lencw leniw lenrw 500 See mincw miniw minrw below on exit On exit hs n m gives the final state of t
32. portion f that happens to be zero at x then it is still necessary to set f a 0 If the linear part A of a nonlinear F x is provided using the snOptA arrays iAFun jAvar A then it must not be computed as part of f 1 3 The snOptA interface 25 needG To simplify the code you may ignore the value of needf and compute f x on every entry to usrfun needf may also be ignored with Derivative linesearch and Derivative option 1 both defaults In this case needf is always 1 and f must always be assigned lenG G lenG concern the calculation of the derivatives of the function f z lenG is the length of the coordinate arrays iGvar and jGfun in the call to snOptA needG indicates if G must be assigned during this call of usrfun e If needG 0 G is not required and is ignored e If needG gt 0 the partial derivatives of f x must be calculated and assigned to G For each k 1 1enG the value of G k should be 0f x 0x where i iGfun k j jGvar k cu lencu iu leniu ru lenru are the character integer and real arrays of user work space provided to snOptA They may be used to pass information into the function routine and to preserve data between calls In special applications the functions may depend on some of the internal variables stored in snOptA s workspace arrays cw iw rw For example the 8 character prob lem name Prob is stored in cw 51 and the dual variables are stored in rw 1FMul onward
33. quasi Newton approximate Hessian QPSolver CG uses an active set method similar to QPSolver QN but uses the conjugate gradient method to solve all systems involving the reduced Hessian e The Cholesky QP solver is the most robust but may require a significant amount of computation if the number of superbasics is large e The quasi Newton QP solver does not require the computation of the R at the start of each QP subproblem It may be appropriate when the number of superbasics is large but relatively few major iterations are needed to reach a solution e g if SNOPT is called with a Warm start e The conjugate gradient QP solver is appropriate for problems with large numbers of degrees of freedom say more than 2000 superbasics Reduced Hessian dimension i Default min 2000 n 1 same as Hessian dimension This specifies that an i x 7 triangular matrix R is to be available for use by the QPSolver Cholesky option to define the reduced Hessian according to RTR ZTH Z The value of i affects when QPSolver CG is activated Save frequency k Default 100 If a New basis file has been specified a basis map describing the current solution will be saved on the appropriate file every kth iteration A Backup basis file will also be saved if specified Scale option a Default 0 Scale tolerance t Default 0 9 Scale Print Three scale options are available as follows 1 Meaning O No scaling This is recommended if it is known th
34. reached 8 Output amp 9 8 3 The minor iteration log IfMinor print level gt 0 one line of information is output to the Print file every kth minor iteration where k is the specified Minor print frequency default k 1 A heading is printed before the first such line following a basis factorization The heading contains the items described below In this description a PRICE operation is the process by which a nonbasic variable denoted by jq is selected to become superbasic in addition to those already in the superbasic set If the problem is purely linear variable jq usually becomes basic immediately unless it should happen to reach its opposite bound and return to the nonbasic set If Partial price is in effect variable jq is selected from App or Ipp the ppth segments of the constraint matrix A I J Label Description Itn The current iteration number LPmult QPmult This is the reduced cost or reduced gradient of the variable jq selected by PRICE at the start of the present iteration Algebraically dj is dj gj nTa for j jq where g is the gradient of the current objective function m is the vector of dual variables for the QP subproblem and a is the jth column of A I Note that dj is the 1 norm of the reduced gradient vector at the start of the iteration just after the PRICE operation LPstep QPstep The step length a taken along the current search direction p The variables x have just been changed to
35. reason you wish to terminate the current problem set mode lt 2 4 The snOptB interface 43 4 7 Subroutine funobj This subroutine must calculate the nonlinear objective function fo x and optionally its gradient g x Ofo x Ox where x is the current value of the objective variables 2 subroutine funobj amp mode nnO0bj amp x fObj g0bj nState amp cu lencu iu leniu ru lenru integer amp lencu leniu lenru mode nn0bj nState iu leniu double precision amp fObj g0bj nn0bj ru lenru x nn0bj character amp cu lencu 8 On entry mode may be set as in funcon nn0bj is the number of variables involved in fo x 0 lt nn0bj lt n These must be the first nnObj variables in the problem x nn0bj contains the nonlinear objective variables x The array x must not be altered nState is used as in funcon cu lencu iu leniu ru lenru are the same as in funcon On exit mode may be set as in funcon to indicate that you are unable to evaluate fo at x If you wish to terminate the solution of the current problem set mode lt 2 f0bj must contain the computed value of fo w except perhaps if mode 1 g0bj nn0bj must contain the known components of the gradient vector g x i e gObj J contains the partial derivative 0fo 0x except perhaps if mode 0 4 8 Example Here we give the subroutines funobj and funcon for the example of Section 4 2 repeated here for conv
36. record solution information in a manner that is more direct and more easily modified In particular no distinction is made between columns and slacks Apart from the first and last line each entry has the form Columns 2 3 5 12 25 36 Contents Key Name Value as illustrated in Figure 4 The keys LL UL BS and SB mean Lower Limit Upper Limit Basic and Superbasic respectively Notes on Dump data 1 A line is output for every variable columns followed by slacks 2 Nonbasic free variables strictly between their bounds are output with key LL Notes on Load data 1 Before a Load file is read all columns and slacks are made nonbasic at their smallest bound in absolute magnitude The basis is initially empty 2 BS causes Name to become basic SB causes Name to become superbasic at the specified Value gt LL or UL cause Name to be nonbasic at the specified Value 5 An entry will be ignored if Name is already basic or superbasic Thus only the first BS or SB line takes effect for any given Name 6 An SB line will not alter the status of Name if the Superbasics limit has been reached but the associated Value will is retained 7 Partial basis Let m be the number of rows in the problem Tf fewer than m variables are specified to be basic the first basis factorization will detect singularity and insert appropriate slacks 8 Too many basics or superbasics If more than m variables are specified basic or more tha
37. so called nonlinear elastic mode The subproblem includes the original QP objective and the sum of the infeasibilities suitably weighted using the Elastic weight parameter In elastic mode some of the bounds on the nonlinear rows elastic i e they are allowed to violate their specified bounds Variables subject to elastic bounds are known as elastic variables An elastic variable is free to violate one or both of its original upper or lower bounds If the original problem has a feasible solution and the elastic weight is sufficiently large a feasible point eventually will be obtained for the perturbed constraints and optimization can continue on the subproblem If the nonlinear problem has no feasible solution SNOPT will tend to determine a good infeasible point if the elastic weight is sufficiently large If the elastic weight were infinite SNOPT would locally minimize the nonlinear constraint violations subject to the linear constraints and bounds Unfortunately even though SNOPT locally minimizes the nonlinear constraint violations there may still exist other regions in which the nonlinear constraints are satisfied Wherever possible nonlinear constraints should be defined in such a way that feasible points are known to exist when the constraints are linearized EXIT 20 The problem appears to be unbounded INFO 21 unbounded objective INFO 22 constraint violation limit reached For linear problems unboundedne
38. the format of Section 9 3 The file will usually have been output previously as a Dump file The file will not be accessed if an Old basis file or an Insert file is specified Log frequency k Default 100 see Print frequency LU factor tolerance t Default 100 0 LP or 3 99 NP LU update tolerance t2 Default 10 0 LP or 3 99 NP These tolerances affect the stability and sparsity of LUSOL s basis factors B LU 12 during refactorization and updating respectively They must satisfy t ta gt 1 0 The matrix L is a product of matrices of the form aa where the multipliers y satisfy u lt ti Smaller values of t favor stability while larger values favor sparsity For certain very regular structures e g band matrices it may be necessary to reduce t and or tg in order to achieve stability For example if the columns of A include a submatrix of the form 2 i 1 2 1 1 2 1 1 2 1 1 2 one should set both t and t2 to values in the range 1 0 lt t lt 2 0 LU partial pivoting Default LU rook pivoting LU complete pivoting The LUSOL factorization implements a Markowitz type search for pivots that locally mini mize the fill in subject to a threshold pivoting stability criterion The rook and complete pivoting options are more expensive than partial pivoting but are more stable and bet ter at revealing rank as long as the LU factor tolerance is not too large say t lt 2 0 When numerical
39. the missing components of G x using finite differences This may simplify the coding of subroutine usrfun However it could increase the total run time substantially since a special call to usrfun is required for each column of the Jacobian that has a missing element and there is less assurance that an acceptable solution will be located If the nonlinear variables are not well scaled it may be necessary to specify a nonstandard Difference interval see below For each column of the Jacobian one call to usrfun is needed to estimate all missing elements in that column if any see the discussion of the option Derivative level At times central differences are used rather than forward differences Twice as many calls to usrfun are then needed This is not under the user s control Difference interval hy Default e 2 1 5e 8 This alters the interval h that is used to estimate gradients by forward differences in the following circumstances e In the initial cheap phase of verifying the problem derivatives e For verifying the problem derivatives e For estimating missing derivatives In all cases a derivative with respect to x is estimated by perturbing that component of x to the value x h1 1 x and then evaluating fo x or f x at the perturbed point The resulting gradient estimates should be accurate to O h1 unless the functions are badly scaled Judicious alteration of h may sometimes lead to greater accurac
40. use real The same applies to the user routine usrfun subroutine sn0ptC amp Start m n neA nName amp nnCon nn0bj nnJac amp i0bj ObjAdd Prob amp usrfun amp Acol indA locA bl bu Names amp hs x pi rc amp INFO mincw miniw minrw amp nS nInf sInf Obj amp cu lencu iu leniu ru lenru amp cw lencw iw leniw rw lenrw external amp usrfun integer amp INFO i0bj lencu leniu lenru lencw leniw lenrw amp mincw miniw minrw m n neA nName nS nInf nnCon amp nn0bj nnJac indA neA hs n m locA n 1 iu leniu amp iw leniw double precision amp Obj ObjAdd sInf Acol neA bl ntm bu ntm pi m amp rc n m ru lenru rw lenrw x n m character amp Start character amp Prob 8 Names nName 8 cu lencu 8 cw lencw 8 All arguments except usrfun are the same as those for snOptB on p 34 A description of usrfun follows 5 2 Subroutine usrfun This subroutine must calculate the nonlinear problem functions fo a and f a and op tionally their derivatives g a and f x The objective derivatives are stored in the output array g0bj Constraint derivatives are stored column wise in the output array gCon Recall that f x is the top left corner of a larger matrix A that is stored column wise in snOptB s input arrays Acol indA locA see 5 The snOptc interface 51 4 2 and Sections 4 3 4 4 Jacobian elements must be stor
41. 0 86666666666656E 00 w w Hi CONRFRFNNOKF WDD WwWwWwwwwww iw uw Figure 2 Format of New and Old basis files for example t4manne hs j State of the jth variable 0 Nonbasic at lower bound 1 Nonbasic at upper bound 2 Superbasic 3 Basic If variable j is nonbasic it may be fixed lower bound upper bound or free infinite bounds or it may be strictly between its bounds In such cases hs j 0 Free variables will almost always be basic A set of lines of the form j Tj written with format i8 1p e24 14 and terminated by an entry with j 0 where j denotes the jth variable and zj is a real value The jth variable is either the jth column or the j n th slack if j gt n Typically hs j 2 superbasic The list includes nonbasic variables that lie strictly between their bounds Loading a New basis file A file that has been saved as an Old basis file may be input at the beginning of a later run as a New basis file The following notes are relevant 1 2 The first line is input and printed but otherwise not used The values labeled M and N on the second line must agree with m and n for the problem that has just been defined The value labeled SB is input and printed but is not used The next set of lines must contain exactly m values hs j 3 denoting the basic variables The list of 7 and x values must include an entry for every variable whose state is hs j 2 the superbasic variables
42. 1 2 0d0 x3 2 3 neG 1 2 0d0 x4 2 4 neG 1 4 0d0 x4 x 3 4 4 end subroutine usrfun 3 The snOptA interface 29 3 8 Subroutine snMemA This routine estimates the size of the workspace arrays cw iw rw required to solve an optimization problem of given dimensions snMemA is not strictly needed in f77 because all workspace must be defined explicitly in the driver program at compile time It is available for users wishing to allocate storage dynamically in f90 or C The actual storage required also depends on the values of the following options Hessian full or Hessian limited memory and Hessian updates Reduced Hessian dimension Superbasics limit If these options have not been set default values are assumed Ideally the correct values should be set before the call to snMemA subroutine snMemA amp INFO nF n nxname nFname neA neG amp mincw miniw minrw amp cw lencw iw leniw rw lenrw integer amp INFO lencw leniw lenrw mincw miniw minrw n neA neG amp nF nFname nxname iw leniw double precision amp rw lenrw character amp cw lencw 8 The arguments nF n nxname nFname neA neG define the problem being solved and are identical to the arguments used in the call to snOptA see Section 3 4 For a sequence of problems snMemA may be called once with overestimates of these quantities On entry lencw leniw lenrw must be of length at least 500 cw lencw iw l
43. 3 2 SNOPTA EXIT 0 finished successfully SNOPTA INFO 1 optimality conditions satisfied Problem name Toy1 No of iterations 7 Objective value 1 0000000008E 00 No of major iterations 7 Linear objective 0 0000000000E 00 Penalty parameter 3 253E 02 Nonlinear objective 1 0000000008E 00 No of calls to funobj 9 No of calls to funcon 9 No of degenerate steps O Percentage 0 00 Max x 2 1 0E 00 Max pi 1 1 2E 01 Max Primal infeas O 0 0E 00 Max Dual infeas 2 8 0E 10 Nonlinear constraint violn 6 4E 09 Max Primal infeas refers to the largest bound infeasibility and which variable is in volved If it is too large consider restarting with a smaller Minor feasibility tolerance say 10 times smaller and perhaps Scale option 0 Similarly Max Dual infeas indicates which variable is most likely to be at a non optimal value Broadly speaking if Max Dual infeas Max pi 1074 then the objective function would probably change in the dth significant digit if optimiza tion could be continued If d seems too large consider restarting with a smaller Major optimality tolerance Finally Nonlinear constraint violn shows the maximum infeasibility for nonlin ear rows If it seems too large consider restarting with a smaller Major feasibility tolerance If the requested accuracy could not be achieved a feasible solution has been found but the requested accuracy in the dual infeasibilities could not be achieved An abnormal termination has occurre
44. 3 99 for NP 100 0 for LP LU update tolerance 3 99 for NP 10 0 for LP LU singularity tolerance 3 2e 11 LU partial pivoting default threshold pivoting strategy LU rook pivoting threshold rook pivoting LU complete pivoting threshold complete pivoting Basis files Old basis file 0 input basis map New basis file 0 output basis map Backup basis file 0 output extra basis map Insert file 0 input in industry format Punch file 0 output Insert data Load file 0 input names and values Dump file 0 output Load data Solution file 0 different from printed solution Partitions of cw iw rw Total character workspace lencw 7 Optional parameters 65 Total integer workspace leniw Total real workspace lenrw User character workspace 500 User integer workspace 500 User real workspace 500 Miscellaneous Debug level 0 for developers Sticky parameters No Yes makes parameter values persist Timing level 3 print cpu times End of SPECS file checklist 7 4 Subroutine snSpec Subroutine snSpec may be called to input a Specs file to specify options for a subsequent call of SNOPT subroutine snSpec amp iSpecs INFO cw lencw iw leniw rw lenrw integer amp iSpecs INFO lencw leniw lenrw iw leniw double precision amp rw lenrw character amp cw lencw 8 On entry iSpecs is a unit number for the Specs file iSpecs gt 0 Typically iSpecs 4 On some systems the file may need t
45. ASH the values Fstate i 0 1 2 3 4 5 have the following mean ing Fstate 1 State of row i during CRASH 0 1 3 Eligible for the basis 3 is given preference 2 4 5 Ignored After CRASH rows for which Fstate i 2 are made superbasic Other rows not selected for the basis are made nonbasic at the value F z or the closest value inside their bounds See the description of Fstate below on exit 2 If Start 0 or 1 and a basis file is provided Fstate and F need not be set 3 For Warm starts Start 2 Fstate 1 nF must be 0 1 2 or 3 perhaps from a previous call Fmul nF contains an estimate of A the vector of Lagrange multipliers shadow prices for the constraints lp lt F x lt us All nF components must be defined If nothing is known about A set all Fmul z 0 0 18 SNOPT 7 4 User s Guide ns need not be specified for Cold starts but should retain its value from a previous call when a Warm start is used cu lencu iu leniu ru lenru are 8 character integer and real arrays of user work space They may be used to pass data or workspace to your function routine usrfun which has the same parameters They are not touched by snOptA If usrfun doesn t reference these parameters you may use any arrays of the appro priate type such as cw iw rw see next paragraph Conversely you should use the cw iw rw arrays if usrfun needs to access snOptA s workspace cw lencw iw len
46. CRASH procedure be used unless an Old basis Insert or Load file is specified Start 1 is the same as 0 but more meaningful when a basis file is given Start 2 Warm start means that xstate and Fstate define a valid starting point perhaps from an earlier call though not necessarily nF is the number of problem functions in F x including the objective function if any and the linear and nonlinear constraints Upper and lower bounds on x can be defined via xLow and xUpp below and should not be included in F nF gt 0 nF is the dimension of the function vector F Since F includes the objective if any and all the general linear and nonlinear constraints there must be at least one row for the problem to be meaningful n is n the number of variables This is the number of columns of G and A n gt 0 16 SNOPT 7 4 User s Guide iAfun lenA jAvar lenA A lenA define the coordinates i j and values A of the nonzero elements of the linear part A of the function F x f x Ax The first neA entries are valid 0 lt neA lt lenA and lenA gt 1 The entries may define the elements of A in any order lenA is the dimension of the arrays iAfun jAvar A that hold i j Aij lenA gt 1 neA is the number of nonzeros in A such that F x f a Ax 0 lt neA lt lenA iGfun lenG jGvar lenG define the coordinates i j of Gij the nonzero elements of the nonlinear part of the derivatives G x A of the function
47. Specs file a list of run time options snSet snSeti snSetr Section 7 5 may be called to specify a single option snGet snGetc snGeti snGetr Section 7 6 may be called to obtain an option s current value snOptA Section 3 4 is the main solver snJac Section 3 5 may be called to find the sparsity structure of the Jacobian usrfun Section 3 6 is supplied by the user and called by snOpta to define the functions F a and ideally their gradients This routine has a fixed parameter list but may have any convenient name It is passed to snOptA as a parameter snMemA Section 3 8 computes the size of the workspace arrays cw iw rw required for given problem dimensions Intended for Fortran 90 and C drivers that reallocate workspace if necessary 12 SNOPT 7 4 User s Guide 3 2 Getting Started Consider the following nonlinear optimization problem with two variables x 1 2 and three inequality constraints minimize T2 11 22 subject to x 423 lt 4 3 1 x 2 22 lt 5 z 2 In the format of problem NPA we have ly lt x lt Uy and lp lt F x lt up as follows MONA oo T2 00 l lt xi 4x2 lt 4 Up 00 x 2 23 5 Let G x be the Jacobian matrix of partial derivatives so that G x OF x Ox gives the gradients of F x as the ith row of G 29 0 1 F x a da and G x 221 8x9 21 2 22 2 11 2 2x2 Now we must provide s
48. T message Very occasionally some nonbasic variables may be outside their bounds by as much as the Minor feasibility tolerance and there may be some nonbasics for which x j lies strictly between its bounds If nInf gt 0 some basic and superbasic variables may be outside their bounds by an arbitrary amount bounded by sInf if scaling was not used xmul ne is the vector of dual variables for the bound constraints 1 lt lt up F nF is the final value of the vector of problem functions F z Fmul nF is the vector of dual variables Lagrange multipliers for the general constraints lp lt F a lt Up 3 The snOptA interface 19 INFO reports the result of the call to snOptA Here is a summary of possible values Further details are in Section 8 6 Oww nr 12 13 14 15 16 21 22 31 32 33 34 41 42 43 44 45 51 52 61 62 63 71 74 81 82 83 84 Finished successfully optimality conditions satisfied feasible point found requested accuracy could not be achieved elastic objective minimized elastic infeasibilities minimized The problem appears to be infeasible infeasible linear constraints infeasible linear equality constraints nonlinear infeasibilities minimized linear infeasibilities minimized infeasible linear constraints in QP subproblem infeasible nonelastic constraints The problem appears to be unbounded unbounded objective constraint violation limit reached Resourc
49. Timing level Default 3 0 suppresses output of cpu times Intended for installations with dysfunctional timing routines 84 SNOPT 7 4 User s Guide Total real workspace maxrw Default lenrw Total integer workspace maxiw Default leniw Total character workspace maxcw Default lencw User real workspace maxru Default 500 User integer workspace maxiu Default 500 User character workspace maxcu Default 500 These options may be used to confine SNOPT to certain parts of its workspace arrays cw iw rw The arrays are defined by the last six parameters of SNOPT The Total options place an upper limit on SNOPT s workspace They may be useful on machines with virtual memory For example some systems allow a very large array rw lenrw to be declared at compile time with no overhead in saving the resulting object code At run time when various problems of different size are to be solved it may be sensible to restrict SNOPT to the lower end of rw in order to reduce paging activity slightly However SNOPT accesses storage contiguously wherever possible so the benefit may be slight In general it is far better to have too much storage than not enough If SNOPT s user parameters ru lenru happen to be the same as rw lenrw the nonlinear function routines will be free to use ru maxrw 1 lenru for their own purpose Similarly for the other work arrays The User options place a lower limit on SNOPT s workspac
50. User s Guide for SNOPT Version 7 4 Software for Large Scale Nonlinear Programming Philip E GILL and Elizabeth WONG Department of Mathematics University of California San Diego La Jolla CA 92093 0112 USA Walter MURRAY and Michael A SAUNDERS Systems Optimization Laboratory Department of Management Science and Engineering Stanford University Stanford CA 94305 4121 USA January 2015 Abstract SNOPT is a general purpose system for constrained optimization It minimizes a linear or nonlinear function subject to bounds on the variables and sparse linear or nonlinear constraints It is suitable for large scale linear and quadratic programming and for linearly constrained optimization as well as for general nonlinear programs SNOPT finds solutions that are locally optimal and ideally any nonlinear functions should be smooth and users should provide gradients It is often more widely useful For example local optima are often global solutions and discontinuities in the function gradients can often be tolerated if they are not too close to an optimum Unknown gradients are estimated by finite differences SNOPT uses a sequential quadratic programming SQP algorithm Search di rections are obtained from QP subproblems that minimize a quadratic model of the Lagrangian function subject to linearized constraints An augmented Lagrangian merit function is reduced along each search direction to ensure convergence from any starting point
51. ability growth The ratio Akmax Amax Values much larger than 100 say indicate instability bump The size of the block to be factorized nontrivially after the triangular rows and columns of B or Bs have been removed dense2 The number of columns remaining when the density of the basis matrix being factorized reached 0 6 The Markowitz pivot strategy searches fewer columns at that stage DUmax The largest diagonal of PUQ DUmin The smallest diagonal of PUQ condU The ratio DUmax DUmin which estimates the condition number of U and of B if Ltol is less than 5 0 say 8 5 Crash statistics If Major print level gt 10 the following items are output to the Print file when Start Cold and no basis file is loaded They refer to the number of columns that the CRASH procedure selects during several passes through A while searching for a triangular basis matrix Label Slacks Description The number of slacks selected initially Free cols The number of free columns in the basis Preferred The number of preferred columns in the basis i e hs j 3 for some j lt n Unit Double Triangle Pad The number of unit columns in the basis The number of double columns in the basis The number of triangular columns in the basis The number of slacks used to pad the basis 8 Output 93 8 6 EXIT conditions When any solver or auxliliary routine in the SNOPT package terminates a message of the fol
52. acobian matrix associated with nonlinear constraints The nonzeros are stored column wise A pair of values Acol k indA k contains a matrix element and its corresponding row index The array locA is a set of pointers to the beginning of each column of A within Acol and indA Thus for j 1 n the entries of column j are held in Acol k 1 and their corresponding row indices are in indA k 1 where k locA j and 1 locA j 1 1 Note Every element of Acol must be assigned a value in the calling program In general elements in the nonlinear part of Acol see the notes below may be any dummy value e g zero because they are initialized at the first point that is feasible with respect to the linear constraints If Derivative level 2 or 3 the nonlinear part of Acol may be used to define any constant Jacobian elements If funcon does not define all entries of gCon the missing values will be obtained from Acol 1 It is essential that locA 1 1 and locA n 1 neA 1 2 The Jacobian f x forms the top left corner of Acol and indA see Section 4 2 If a Jacobian column j 1 lt j lt nnJac contains any entries Acol k indA k associated with nonlinear constraints 1 lt indA k lt nnCon those entries must come before any entries belonging to linear constraints 36 SNOPT 7 4 User s Guide 3 The row indices indA k for a column may be in any order subject to Jacobian entries appearing firs
53. actorized but singularity persisted For INFO 43 the basic variables x have been recomputed given the present values of the superbasic and nonbasic variables A step of iterative refinement has also been applied to increase the accuracy of x but a row check has revealed that the resulting solution does not satisfy the QP constraints Ax s b sufficiently well For INFO 44 during computation of the reduced Hessian ZTH Z some column s of Z continued to contain very large values In all cases the problem must be badly scaled or the basis must be pathologically ill conditioned without containing any large entries Try Scale option 2 if it has not yet been used EXIT 50 Error in the user supplied functions INFO 51 incorrect objective derivatives INFO 52 incorrect constraint derivatives There may be errors in the subroutines that define the problem objective and constraints If the objective derivatives appear to incorrect a check has been made on some individual elements of the objective gradient array at the first point that satisfies the linear constraints At least one component G k or g0bj j is being set to a value that disagrees markedly with its associated forward difference estimate Ofo Ox The relative difference between the computed and estimated values is 1 0 or more This exit is a safeguard because SNOPT will usually fail to make progress when the computed gradients are seriously inaccurate In the pro
54. ails are in Section 8 6 DJUN 12 13 14 15 16 21 22 31 32 33 34 41 42 43 44 45 51 52 61 62 63 72 73 74 81 82 83 84 Finished successfully optimality conditions satisfied feasible point found requested accuracy could not be achieved elastic objective minimized elastic infeasibilities minimized The problem appears to be infeasible infeasible linear constraints infeasible linear equality constraints nonlinear infeasibilities minimized linear infeasibilities minimized infeasible linear constraints in QP subproblem infeasible nonelastic constraints The problem appears to be unbounded unbounded objective constraint violation limit reached Resource limit error iteration limit reached major iteration limit reached the superbasics limit is too small time limit reached Terminated after numerical difficulties current point cannot be improved singular basis cannot satisfy the general constraints ill conditioned null space basis unable to compute acceptable LU factors Error in the user supplied functions incorrect objective derivatives incorrect constraint derivatives Undefined user supplied functions undefined function at the first feasible point undefined function at the initial point unable to proceed into undefined region User requested termination terminated during constraint evaluation terminated during objective evaluation terminated from monitor routine Insufficient s
55. all subsequent iterates satisfy the linear constraints Such a strategy allows linear constraints to be used to define a region in which the functions can be safely eval uated SNOPT proceeds to solve NP as given using search directions obtained from the sequence of subproblems QP If a QP subproblem proves to be infeasible or unbounded or if the dual variables m for the nonlinear constraints become large SNOPT enters elastic mode and thereafter solves the problem NP minimize fo z ye v w x subject to L lt f z vt w lt u v gt 0 w gt 0 A z where y is a nonnegative parameter the elastic weight and f x ye v w is called a composite objective the penalty function for the nonlinear constraints The value of y may increase automatically by multiples of 10 if the optimal v and w continue to be nonzero If y is sufficiently large this is equivalent to minimizing the sum of the nonlinear constraint violations subject to the linear constraints and bounds A similar l formulation of NP is fundamental to the S QP algorithm of Fletcher 5 See also Conn 1 The initial value of y is controlled by the optional parameter Elastic weight p 72 3 The snOptA interface 11 3 The snOptA interface The snOpta interface accepts a format that allows the constraints and variables to be defined in any order The optimization problem is assumed to be in the form NPA minimize Fosj x
56. all variables and constraints The jth constraint may be defined as an equality by setting 1 uj If certain bounds are not present the associated elements of l or u may be set to special values that are treated as oo or 00 Free variables and free constraints free rows have both bounds infinite 1 1 Problem types If folx is linear and f x is absent NP is a linear program LP and SNOPT applies the primal simplex method 2 Sparse basis factors are maintained by LUSOL 12 as in MINOS 18 If only the objective is nonlinear the problem is linearly constrained LC and tends to solve more easily than the general case with nonlinear constraints NC For both nonlinear cases SNOPT applies a sparse sequential quadratic programming SQP method 8 using limited memory quasi Newton approximations to the Hessian of the Lagrangian The merit function for steplength control is an augmented Lagrangian as in the dense SQP solver NPSOL 11 14 In general SNOPT requires less matrix computation than NPSOL and fewer evaluations of the functions than the nonlinear algorithms in MINOS 16 17 It is suitable for nonlinear problems with thousands of constraints and variables and is most efficient if only some of the variables enter nonlinearly or there are relatively few degrees of freedom at a solution i e many constraints are active However unlike previous versions of SNOPT there is no limit on the number of degrees of freedom
57. an independent absolute limit on the total number of minor iterations summed over all QP subproblems Minor feasibility tolerance t Default 1 0e 6 SNOPT tries to ensure that all variables eventually satisfy their upper and lower bounds to within the tolerance t This includes slack variables Hence general linear constraints should also be satisfied to within t Feasibility with respect to nonlinear constraints is judged by the Major feasibility tolerance not by t e If the bounds and linear constraints cannot be satisfied to within t the problem is declared infeasible Let sInf be the corresponding sum of infeasibilities If sInf is quite small it may be appropriate to raise t by a factor of 10 or 100 Otherwise some error in the data should be suspected e Nonlinear functions will be evaluated only at points that satisfy the bounds and linear constraints If there are regions where a function is undefined every attempt should be made to eliminate these regions from the problem For example if f x y x1 log z2 it is essential to place lower bounds on both variables If t 1 0e 6 the bounds x gt 107 and x2 gt 1074 might be appropriate The log singularity is more serious In general keep x as far away from singularities as possible e If Scale option gt 1 feasibility is defined in terms of the scaled problem since it is then more likely to be meaningful e In reality SNOPT uses t as a feasibility tolerance
58. ap 7 2 It is an estimate of the degree of nonoptimality of the reduced costs Both Feasbl and Optimal are small in the neighborhood of a solution MeritFunction is the value of the augmented Lagrangian merit function see 2 3 This L U BSwap ns CondHz Penalty function will decrease at each iteration unless it was necessary to increase the penalty parameters see Section 2 As the solution is approached Merit will converge to the value of the objective at the solution In elastic mode the merit function is a composite function involving the con straint violations weighted by the elastic weight If the constraints are linear this item is labeled Objective the value of the objective function It will decrease monotonically to its optimal value The number of nonzeros representing the basis factors L and U on completion of the QP subproblem If nonlinear constraints are present the basis factorization B LU is computed at the start of the first minor iteration At this stage LU lenL lenU where lenL the number of subdiagonal elements in the columns of a lower triangular matrix and lenU is the number of diagonal and superdiagonal elements in the rows of an upper triangular matrix As columns of B are replaced during the minor iterations LU may fluctuate up or down but in general will tend to increase As the solution is approached and the minor iterations decrease towards zero LU will reflect the number of nonzer
59. ar and nonlinear slacks 2 2 Major iterations The basic structure of the SQP algorithm involves major and minor iterations The major iterations generate a sequence of iterates xx that satisfy the linear constraints and converge to a point that satisfies the nonlinear constraints and the first order conditions for optimality At each x a QP subproblem is used to generate a search direction toward what will be the next iterate x 41 The constraints of the subproblem are formed from the linear constraints A x s 0 and the linearized constraint Fur f we a k sn 0 where f x denotes the Jacobian matrix whose elements are the first derivatives of f x evaluated at x The QP constraints therefore comprise the m linear constraints f 2 T Sn f k f re re AT s 0 where x and s are bounded above and below by u and l as before If the m x n matrix A and m vector b are defined as a TE ana v Le 4 Fen then the QP subproblem can be written as QP minimize q x k 9 xp a He a zp S subject to Ar s b I lt lt u where q x xx is a quadratic approximation to a modified Lagrangian function 8 The matrix Hz is a quasi Newton approximation to the Hessian of the Lagrangian A BFGS update is applied after each major iteration If some of the variables enter the Lagrangian linearly the Hessian will have some zero rows and columns If th
60. ary file Superbasics limit 1 Default n 1 This places a limit on the storage allocated for superbasic variables Ideally should be set slightly larger than the number of degrees of freedom expected at an optimal solution For linear programs an optimum is normally a basic solution with no degrees of freedom The number of variables lying strictly between their bounds is no more than m the number of general constraints The default value of i is therefore 1 For nonlinear problems the number of degrees of freedom is often called the number of independent variables Normally need not be greater than n 1 where n is the number of nonlinear variables For many problems i may be considerably smaller than n This will save storage if n is very large Suppress parameters Normally SNOPT prints the Specs file as it is being read and then prints a complete list of the available keywords and their final values The Suppress Parameters option tells SNOPT not to print the full list System information No Default System information Yes The Yes option provides additional information on the progress of the iterations including Basis Repair details when ill conditioned bases are encountered and the LU factorization parameters are strengthened Time limit 1 Default 0 This places a limit of cpu seconds on the time used for solving the problem The default value i 0 implies that no cpu limit is imposed
61. as the input arguments start 2 for snOptA and start Warm for snOptB and snOptc If specified as an optional parameter this value has precedence over the value of the input argument start This allows the start parameter to be changed at run time using the Specs file 86 SNOPT 7 4 User s Guide 8 Output Subroutine snInit specifies unit numbers for the Print and Summary files described in this section The files can be redirected with the Print file and Summary file options or suppressed 8 1 The PRINT file If Print file gt 0 the following information is output to the Print file during the solution process All printed lines are less than 131 characters e A listing of the Specs file if any e A listing of the options that were or could have been set in the Specs file e An estimate of the working storage needed and the amount available e Some statistics about the problem being solved e The storage available for the LU factors of the basis matrix e A summary of the scaling procedure if Scale option gt 0 e Notes about the initial basis resulting from a CRASH procedure or a basis file e The major iteration log e The minor iteration log e Basis factorization statistics e The EXIT condition and some statistics about the solution obtained e The printed solution if requested The last five items are described in the following sections 8 2 The major iteration log If Major print level gt 0 one lin
62. at x and the constraint matrix and Jacobian never have very large elements say larger than 100 1 Linear constraints and variables are scaled by an iterative procedure that attempts to make the matrix coefficients as close as possible to 1 0 see Fourer 6 This will sometimes improve the performance of the solution procedures 2 All constraints and variables are scaled by the iterative procedure Also an additional scaling is performed that takes into account columns of A I that are fixed or have positive lower bounds or negative upper bounds If nonlinear constraints are present the scales depend on the Jacobian at the first point that satisfies the linear constraints Scale option 2 should therefore be used only if a a good starting point is provided and b the problem is not highly nonlinear 82 SNOPT 7 4 User s Guide Scale tolerance t affects how many passes might be needed through the constraint matrix On each pass the scaling procedure computes the ratio of the largest and smallest nonzero coefficients in each column pj max aij min Jaij aij 0 If max p is less than t times its previous value another scaling pass is performed to adjust the row and column scales Raising t from 0 9 to 0 99 say usually increases the number of scaling passes through A At most 10 passes are made Scale Print causes the row scales r i and column scales c j to be printed The scaled matrix coefficients are a
63. ating the approximate Hessian SNOPT uses a quasi Newton approximation to the Hessian of the Lagrangian A BFGS update is applied after each major iteration The default value depends on n1 the number of nonlinear variables see p 7 For npOpt n is the number of variables For snOptB and snOptc n is the larger of nnObj and nnJac the number of nonlinear objective and Jacobian variables For snOptA n is determined by the implicit values of nn0bj and nnJac determined after the constraints and variables are reordered If Hessian full memory is specified the approximate Hessian is treated as a dense matrix and the BFGS updates are applied explicitly This option is most efficient when the number of nonlinear variables n is not too large say less than 75 In this case the storage requirement is fixed and one can expect Q superlinear convergence to the solution Hessian limited memory should be used on problems where n is very large In this case a limited memory procedure is used to update a diagonal Hessian approximation H a limited number of times Updates are accumulated as a list of vector pairs They are discarded at regular intervals after H has been reset to their diagonal Hessian frequency i Default 999999 If Hessian Full is selected and i BFGS updates have already been carried out the Hessian approximation is reset to the identity matrix For certain problems occasional resets may improve convergence but in general th
64. ave already been computed 98 SNOPT 7 4 User s Guide For INFO 61 and 62 SNOPT was unable to proceed because the functions are undefined at the initial point or the first feasible point For INFO 63 repeated attempts to move into a region where the functions are not defined resulted in the change in variables being unacceptably small At the final point it appears that the only way to decrease the merit function is to move into a region where the problem functions are not defined EXIT 70 User requested termination INFO 71 terminated during function evaluation INFO 72 terminated during constraint evaluation INFO 73 terminated during objective evaluation INFO 74 terminated from monitor routine These exits occur when Status lt 1 is set during some call to the user defined routines SNOPT assumes that you want the problem to be abandoned immediately EXIT 80 Insufficient storage allocated INFO 81 work arrays must have at least 500 elements INFO 82 not enough character storage INFO 83 not enough integer storage INFO 84 not enough real storage SNOPT cannot start to solve a problem unless the character integer and real work arrays are at least 500 elements If the storage arrays cw iw rw are not large enough for the current problem an estimate of the additional storage required is given in messages preceding the exit The routine declaring cw iw rw should be recompiled with larger di
65. axed problems as long the above precautions are taken Acknowledgements We are grateful to Alan Brown of the Numerical Algorithms Group UK for his helpful comments on the documentation for SNOPT We also thank Tom Aird Arne Drud David Gay Rocky Nelson and Ulf Ringertz for their feedback while running SNOPT on numerous examples 108 SNOPT 7 4 User s Guide NAME Manne 10 DUMP LOAD LL x 1 3 05000E 00 BS x 2 3 12665E 00 SB x 3 3 21443E 00 SB x 4 3 30400E 00 SB x 5 3 39521E 00 SB x 6 3 48787E 00 SB x 7 3 58172E 00 SB x 8 3 67642E 00 SB x 9 3 77156E 00 BS x 10 3 86667E 00 LL x 11 9 50000E 01 BS x 12 9 68423E 01 BS x 13 9 97801E 01 BS x 14 1 02820E 00 BS x 15 1 05967E 00 BS x 16 1 09227E 00 BS x 17 1 12608E 00 BS x 18 1 16117E 00 NAME Manne 10 PUNCH INSERT BS x 19 1 19761E 00 LL x 1 3 05000E 00 BS x 20 1 21394E 00 XL x 2 r 1 3 12665E 00 BS x 21 7 66504E 02 SB x 3 3 21443E 00 BS x 22 8 77750E 02 SB x 4 3 30400E 00 BS x 23 8 95733E 02 SB x 5 3 39521E 00 BS x 24 9 12127E 02 SB x 6 3 48787E 00 BS x 25 9 26610E 02 SB x 7 3 58172E 00 BS x 26 9 38453E 02 SB x 8 3 67642E 00 BS x 27 9 47013E 02 SB x 9 3 77156E 00 BS x 28 9 51453E 02 XL x 10 r 2 3 86667E 00 BS x 29 9 51023E 02 LL x 11 9 50000E 01 UL x 30 1 16000E 01 XL x 12 r 3 9 68423E 01 LL x 1 0 00000E 00 XL x 13 r 4 9 97801E 01 iL 2 0 00000E 00 XL x 14 r 5 1 02820E 00 LL r 3 0 00000E 00 XL x 15 r 6 1 05967E 00 LL r 4 0 00000E 00 XL x 16 r 7 1 09227E 00 LL r 5 0 00000E
66. blems but setting r 0 1 or 0 01 may be helpful when rapidly vary ing functions are present A good starting point may be required An important application is to the class of nonlinear least squares problems 4 In cases where several local optima exist specifying a small value for r may help locate an optimum near the starting point 78 SNOPT 7 4 User s Guide Minimize Default Maximize Feasible point The keywords Minimize and Maximize specify the required direction of optimization It applies to both linear and nonlinear terms in the objective The keyword feasible point means Ignore the objective function while finding a feasible point for the linear and nonlinear constraints It can be used to check that the nonlinear constraints are feasible without altering the call to SNOPT Minor iterations limit k Default 500 If the number of minor iterations for the optimality phase of the QP subproblem exceeds k then all nonbasic QP variables that have not yet moved are frozen at their current values and the reduced QP is solved to optimality Note that more than k minor iterations may be necessary to solve the reduced QP to optimality These extra iterations are necessary to ensure that the terminated point gives a suitable direction for the linesearch In the major iteration log a t at the end of a line indicates that the corresponding QP was artificially terminated using the limit k Note that Iterations limit defines
67. c p 21 when Derivative option 0 is specified and usrfun does not provide any gradients 3 The snOptA interface 15 3 4 Subroutine snOptA Problem NPA is solved by a call to subroutine snOptA whose parameters are defined here Note that most machines use double precision declarations as shown but some machines use real The same applies to the function routine usrfun and all other routines subroutine snOptA amp Start nF n nxname nFname amp ObjAdd ObjRow Prob usrfun amp iAfun jAvar lenA neA A amp iGfun jGvar lenG neG amp xlow xupp xnames Flow Fupp Fnames amp x xstate xmul F Fstate Fmul amp INFO mincw miniw minrw amp nS ninf sInf amp cu lencu iu leniu ru lenru amp cw lencw iw leniw rw lenrw external amp usrfun integer amp INFO lenA lencu lencw lenG leniu leniw lenru lenrw amp mincw miniw minrw n neA neG nF nFname nInf nS amp nxname ObjRow Start iAfun lenA iGfun lenG iu leniu amp iw leniw jAvar lenA jGvar lenG xstate n Fstate nF double precision amp ObjAdd sInf A lenA F nF Fmul nF Flow nF Fupp nF amp ru lenru rw lenrw x n xlow n xmul n xupp n character amp Prob 8 cu lencu 8 cw lencw x 8 amp Fnames nFname 8 xnames nxname 8 On entry Start is an integer that specifies how a starting point is to be obtained Start 0 Cold start requests that the
68. c j r z and the scaled bounds on the variables and slacks are lj 1 c j aj uj c j where c j r j n ifj gt n Solution Yes Solution No Solution If Optimal Infeasible or Unbounded Solution file f Default 0 The first three options determine whether the final solution obtained is to be output to the Print file The file option operates independently if f gt 0 the final solution will be output to file f whether optimal or not e For the Yes and If Optimal options floating point numbers are printed in 16 5 format and infinite bounds are denoted by the word None e For the file option all numbers are printed in 1p e16 6 format including infinite bounds which will have magnitude infBnd default value 1 000000e 20 e To see more significant digits in the printed solution it is sometimes useful to make f refer to the Print file i e the number specified by Print file Start Objective Check at Column k Default 1 Start Constraint Check at Column k Default 1 Stop Objective Check at Column l Default n4 Stop Constraint Check at Column l Default nY These keywords are not allowed in the snOptA interface The default values depend on nj and n the numbers of nonlinear objective variables and Jacobian variables see p 32 If Verify level gt 0 these options may be used to abbreviate the verification of in dividual derivative elements computed by subroutines funobj funcon and usrfun For exa
69. c variables The heading is not printed if the problem is linear cond Hz See the major iteration log The heading is not printed if the problem is linear 8 4 Basis factorization statistics If Major print level gt 10 the following items are output to the Print file whenever LUSOL 12 factorizes the basis B or the rectangular matrix Bs B S y before solution of the next QP subproblem Gaussian elimination is used to compute sparse factors L and U where PLP and PUQ are lower and upper triangular matrices for some permutation matrices P and Q Stability is ensured as described under the LU options page 75 IfMinor print level gt 10 the same items are printed during the QP solution whenever the current B is factorized Label Description Factorize The number of factorizations since the start of the run Demand Itn Nonlin Linear Slacks A code giving the reason for the present factorization O First LU factorization 1 The number of updates reached the Factorization frequency 2 The nonzeros in the updated factors have increased significantly 7 Not enough storage to update factors 10 Row residuals too large see the description of Check frequency 11 Ill conditioning has caused inconsistent results The current minor iteration number The number of nonlinear variables in the current basis B The number of linear variables in B The number of slack variables in B B BR BS or BT factorize The type
70. ced In that case gCon may be dimensioned 1dg 1 with ldg 1 In general gCon need not be initialized before the call to npOpt However if Derivative level 3 any constant elements of gCon may be initialized Such elements need not be reassigned on subsequent calls to funcon see Section 6 6 cMul nctot1 is an array that need not be initialized if npOpt is called with a Cold start the default 56 SNOPT 7 4 User s Guide Otherwise the ordering of cMul is the same as for bl bu and istate For a Warm start the components of cMul corresponding to nonlinear constraints must contain a multiplier estimate The sign of each multiplier should match istate as follows If the ith nonlinear constraint is defined as inactive via the initial value istate j 0 j n nclin i then cMul j should be zero If the constraint r x gt is active istate j 1 cMul j should be non negative and if r x lt uj is active istate j 2 cMul j should be non positive If necessary npOpt will change cMul to match these rules Hess 1dH is an array of dimension 1dH k for some k gt n Hess need not be initialized x n if npOpt is called with a Cold Start the default and will be taken as the identity For a Warm Start Hess provides the initial approximation of the Hessian of the Lagrangian i e H i j 0 L 2 A 01 0x where L x A fo x f x and A is an estimate of the optimal Lagrange multipliers
71. cess it may expend considerable effort before terminating with INFO 41 above For INFO 51 Check the function and gradient computation very carefully in usrfun or funobj A simple omission such as forgetting to divide fo by 2 could explain the discrepancy If fo or a component Of 0x is very large then give serious thought to scaling the function or the nonlinear variables If you feel certain that the computed g0bj j is correct and that the forward difference estimate is therefore wrong you can specify Verify level 0 to prevent individual elements from being checked However the optimization procedure may have difficulty For INFO 52 at least one of the computed constraint derivatives is significantly different from an estimate obtained by forward differencing the constraint vector f x of problem NP Follow the advice for INFO 51 trying to ensure that the arrays F and G are being set correctly in usrfun or funcon EXIT 60 Undefined user supplied functions INFO 61 undefined function at the first feasible point INFO 62 undefined function at the initial point INFO 63 unable to proceed into undefined region The parameter Status snOptA or mode snOptB snOptC npOpt was assigned the value 1 in one of the user defined routines usrfun funobj or funcon This value is used to indicate that the functions are undefined at the current point SNOPT attempts to evaluate the problem functions closer to a point at which the functions h
72. ch component of F x is of the form F x fila D gt Aazars j l where f x is a nonlinear function possibly zero and the elements A are constant The nF xn Jacobian of F x is the sum of two sparse matrices of the same size F x G a A where G x f x and A is the matrix with elements A The two matrices must be non overlapping in the sense that every element of the Jacobian F x G x A is an element of G x or an element of A but not both For example the function 3x21 e244 a 4x4 23 25 Elx 2 23 sin 24 325 T T3 can be written as e 2 x4 r2 424 321 3 25 F x f a Az 13 sin La T2 325 0 1 T3 in which case 3 e r 2r 1 e2 4 1 Bay 0 1 213 cost 3 1 0 0 0 0 can be written as F x f x A G x A where 0 er 2r 0 e2 4 0 3 0 1 0 1 G x 0 0 2x3 costa 0 A 0 1 0 0 3 0 0 0 0 0 1 0 1 0 0 The nonzero elements of A and G are provided to snOptA in coordinate form The elements of A are entered as triples i j Aij in the arrays iAfun jAvar A The sparsity pattern of G is entered as pairs i j in the arrays iGfun jGvar The corresponding entries Gij any that are known are assigned to appropriate array elements G k in the user s subroutine usrfun The elements of A and G may be stored in any order Duplicate entries are ignored As mentioned iGfun and jGvar may be defined automatically by subroutine snJa
73. d 2x3 4x4 T2 2 IV 4 plus bounds on x This problem has 4 variables a nonlinear objective function 2 nonlinear constraints and 1 linear constraint The vector of functions is 311 5 2 x z3 a 21 r 2 F 2 2x3 4x4 Ta r The Jacobian of F is the matrix 34 2 a1 3 24 5 2 a1 23 24 2 1 23 24 hee 1 0 223 2x4 y 0 0 2 4 0 1 4x3 We can write F x f x Az and F x f x A G x A where 3x1 a1 3 24 0 5 0 0 2 2 T3 T4 Jj 0 0 0 f a 0 a AS on Ge oP A at 0 1 0 0 and G is the non overlapping matrix 342 a 3 24 0 2 4 234 24 2 a1 23 24 _ 0 0 223 204 SS 0 0 0 0 0 0 0 dad The calling program must assign many parameters for input to snOptA including nF 4 n 4 ObjRow 1 neA 5 neG 6 lenG 6 gt neG Some of these parameters are passed to subroutine usrfun next page Note that usrfun works only with the nonlinear variables 11 13 14 that appear in f and G The array f is set to f x excluding the term Ax which is evaluated separately by snOptA The array G is set to all nonzero entries of G x excluding the matria A For illustration we test needF and needG to economize on function and gradient eval uations even though they are cheap here Note that Nonderivative linesearch would have to be specified otherwise all entries would have needG 1 We also test State to print a message on the first and last entries 3 The snOptA int
74. d but SNOPT is within 10 of satisfying the Major optimality tolerance Check that the Major optimality tolerance is not too small 8 Output 95 EXIT 10 The problem appears to be infeasible INFO 11 infeasible linear constraints INFO 12 infeasible linear equalities INFO 13 nonlinear infeasibilities minimized INFO 14 infeasibilities minimized This exit occurs if SNOPT is unable to find a point satisfying the constraints When the constraints are linear the output messages are based on a relatively reliable indicator of infeasibility Feasibility is measured with respect to the upper and lower bounds on the variables and slacks Among all the points satisfying the general constraints Ax s 0 there is apparently no point that satisfies the bounds on x and s Violations as small as the Minor feasibility tolerance are ignored but at least one component of x or s violates a bound by more than the tolerance When nonlinear constraints are present infeasibility is much harder to recognize cor rectly Even if a feasible solution exists the current linearization of the constraints may not contain a feasible point In an attempt to deal with this situation when solving each QP subproblem SNOPT is prepared to relax the bounds on the slacks associated with nonlinear rows If a QP subproblem proves to be infeasible or unbounded or if the Lagrange multiplier estimates for the nonlinear constraints become large SNOPT enters
75. de nnCon nnJac neJac x fCon gCon nState cu lencu iu leniu ru lenru integer lencu leniu lenru mode neJac nnCon nnJac nState iu leniu double precision fCon nnCon ru lenru x nnJac character amp cu lencu 8 141 double precision gCon nnCon nnJac Dense Choose ONE of these double precision gCon neJac Sparse On entry mode indicates whether fCon or gCon or both must be assigned during the present call of funcon 0 lt mode lt 2 This parameter can be ignored if Derivative linesearch is selected the default and if Derivative level 2 or 3 In this case mode will always have the value 2 and all elements of fCon and gCon must be assigned except perhaps constant elements of gCon Otherwise snOptB will call funcon with mode 0 1 or 2 You may test mode to decide what to do e If mode 2 assign fCon and the known components of gCon e If mode 1 assign the known components of gCon fCon is ignored e If mode 0 only Con need be assigned gCon is ignored nnCon is the number of nonlinear constraints nnCon gt 0 These must be the first nnCon constraints in the problem nnJac is the number of variables involved in f x 0 lt nnJac lt n These must be the first nnJac variables in the problem neJac is the number of nonzero elements in gCon If gCon is stored as a two dimensional array then neJac nnCon x nnJac x nnJac contains the nonlinear Jacobian variables x The array x must n
76. difficulties are encountered SNOPT automatically reduces the LU toler ances toward 1 0 and switches if necessary to rook or complete pivoting before reverting to the default or specified options at the next refactorization With System information Yes relevant messages are output to the Print file LU complete pivoting is the default for the npOpt interface LU density tolerance ty Default 0 6 LU singularity tolerance ta Default e2 3 2e 11 The density tolerance t is used during LUSOL s basis factorization B LU Columns of L and rows of U are formed one at a time and the remaining rows and columns of the 16 SNOPT 7 4 User s Guide basis are altered appropriately At any stage if the density of the remaining matrix exceeds t the Markowitz strategy for choosing pivots is terminated and the remaining matrix is factored by a dense LU procedure Raising t towards 1 0 may give slightly sparser factors with a slight increase in factorization time The singularity tolerance tz helps guard against ill conditioned basis matrices After B is refactorized the diagonal elements of U are tested as follows if U lt te or U lt t2 max U the jth column of the basis is replaced by the corresponding slack variable This is most likely to occur after a restart Major feasibility tolerance Er Default 1 0e 6 This specifies how accurately the nonlinear constraints should be satisfied The default value of 1 0e 6 is a
77. e 0 only 0bj and Con need be assigned g0bj and gCon are ignored nn0bj is the number of variables involved in fo x 0 lt nn0bj lt n These must be the first nnObj variables in the problem nnCon is the number of nonlinear constraints nnCon gt 0 These must be the first nnCon constraints in the problem nnJac is the number of variables involved in f x 0 lt nnJac lt n These must be the first nnJac variables in the problem nnL is max nn0bj nnJac the number of nonlinear variables These must be the first nnL variables in the problem neJac is the number of nonzero elements in gCon If gCon is stored as a two dimensional array then neJac nnCon x nnJac 52 SNOPT 7 4 User s Guide x nnL contains the nonlinear variables x The array x must not be altered nState indicates the first and last calls to usrfun If nState 0 there is nothing special about the current call to usrfun If nState 1 snOptC is calling your subroutine for the first time Some data may need to be input or computed and saved If nState gt 2 snOptcC is calling your subroutine for the last time You may wish to perform some additional computation on the final solution In general the last call is made with nState 2 INFO where INFO indicates the status of the final solution In particular if nState 2 the current x is optimal if nState 3 the problem appears to be infeasible if nState 4 the problem appears to be unb
78. e not counting the first 500 elements Again if SNOPT s parameters ru lenru happen to be the same as rw lenrw the function routines will be free to use ru 501 maxru for their own purpose Similarly for the other work arrays Unbounded objective value fmax Default 1 0e 15 Unbounded step size Omax Default 1 0e 18 These parameters are intended to detect unboundedness in nonlinear problems They may not achieve that purpose During a linesearch fo is evaluated at points of the form z ap where x and p are fixed and a varies if fo exceeds fmax or a exceeds Omax iterations are terminated with the exit message Problem is unbounded or badly scaled If singularities are present unboundedness in fo x may be manifested by a floating point overflow during the evaluation of folx ap before the test against fmax can be made Unboundedness in x is best avoided by placing finite upper and lower bounds on the variables Verify level l Default 0 This option refers to finite difference checks on the derivatives computed by the user provided routines Derivatives are checked at the first point that satisfies all bounds and linear constraints l Meaning 0 Only a cheap test will be performed requiring 2 calls to usrfun for snOptA and 2 calls to funcon and 3 calls to funobj for snOptB 1 Individual gradients will be checked with a more reliable test A key of the form OK or Bad indicates whether or not
79. e 11 The relative function precision er is intended to be a measure of the relative accuracy with which the nonlinear functions can be computed For example if f x is computed as 1000 56789 for some relevant x and if the first 6 significant digits are known to be correct the appropriate value for eg would be 1 0e 6 7 Optional parameters 73 Ideally the functions f x or F a should have magnitude of order 1 If all functions are substantially less than 1 in magnitude eg should be the absolute precision For example if f x 1 23456789e 4 at some point and if the first 6 significant digits are known to be correct the appropriate value for er would be 1 0e 10 e The default value of e is appropriate for simple analytic functions e In some cases the function values will be the result of extensive computation possibly involving an iterative procedure that can provide rather few digits of precision at reasonable cost Specifying an appropriate Function precision may lead to savings by allowing the linesearch procedure to terminate when the difference between function values along the search direction becomes as small as the absolute error in the values Feasibility tolerance t Default 1 0e 6 see Minor feasibility tolerance Hessian dimension i Default min 2000 n 1 see Reduced Hessian dimension Hessian full memory Default Full if n lt 75 Hessian limited memory These options select the method for storing and upd
80. e coordinates i j of Gij the nonzero elements of neG INFO mincw the nonlinear part of the derivatives G x A of the function F x f x Az The actual elements of G are assigned in subroutine usrfun is the number of nonzero entries in G neG gt 0 reports the result of the call to snJac Finished successfully 102 satisfactory coordinates were found Undefined user supplied functions 61 user indicates that the functions are undefined at the initial point User requested termination 71 user requested termination by returning mode lt 1 from usrfun Insufficient storage allocated 82 not enough 8 character workspace to solve the problem 83 not enough integer workspace to solve the problem 84 not enough real workspace to solve the problem miniw minrw say how much character integer and real storage is needed to build the arrays i j Aij and i j Gij If INFO 82 83 or 84 these values may be used to define better values of lencw leniw or lenrw If INFO 82 the work array cw lencw was too small snJac may be called again with lencw mincw If INFO 83 or 84 the work arrays iw leniw or rw lenrw are too small snJac may be called again with leniw or lenrw suitably larger than miniw or minrw 3 The snOptA interface 23 3 6 Subroutine usrfun Your own version of subroutine usrfun is where you define the nonlinear portion f x of the problem functions F x f x Az along with its gradi
81. e in the objective function The values of the basic and superbasic variables might change giving a genuine alternative solution The values of the dual variables might also change D Degenerate x is basic but it is equal to or very close to one of its bounds Infeasible x is basic and is currently violating one of its bounds by more than the Feasibility tolerance N Not precisely optimal x is nonbasic Its reduced gradient is larger than the Major optimality tolerance Note If Scale option gt 0 the tests for assigning A D I N are made on the scaled problem because the keys are then more likely to be meaningful Activity The value of the variable x Obj Gradient gj the jth component of the gradient of the linear or nonlinear objective function If any x is infeasible gj is the gradient of the sum of infeasibilities Lower limit a the lower bound on zj Upper limit the upper bound on zgj Reduced gradnt The reduced gradient dj gj Taj where a is the jth column of the constraint matrix or the jth column of the Jacobian at the start of the final major iteration M J The value m j Note If two problems are the same except that one minimizes fo x and the other maximizes fo x their solutions will be the same but the signs of the dual variables 7 and the reduced gradients d will be reversed 8 8 The SOLUTION file The information in a printed solution Section 8 7 may be output as a Sol
82. e is output to file number f If Minor print level gt 0 a line of the QP iteration log is output every Ath iteration The default f is obtained from subroutine snInit s parameter iPrint Set f 0 to suppress output to the Print file Proximal point method i Default 1 i 1 or 2 specifies minimization of lx xo or 4 x xo 3 when the starting point xo is changed to satisfy the linear constraints where xp refers to nonlinear variables Punch file f Default 0 If f gt 0 the final solution obtained will be output to file f in the format described in Section 9 2 For linear programs this format is compatible with various commercial systems QPSolver Cholesky Default QPSolver CG QPSolver QN This specifies the method used to solve system 2 2 for the search directions in phase 2 of the QP subproblem QPSolver Cholesky holds the full Cholesky factor R of the reduced Hessian ZTH Z As the minor iterations proceed the dimension of R changes with the number of superbasic 7 Optional parameters 81 variables If the number of superbasic variables needs to increase beyond the value of Reduced Hessian dimension the reduced Hessian cannot be stored and the solver switches to QPSolver CG The Cholesky solver is reactivated if the number of superbasics stabilizes at a value less than Reduced Hessian dimension QPSolver QN solves the QP using a quasi Newton method similar to that of MINOS In this case R is the factor of a
83. e limit error iteration limit reached major iteration limit reached the superbasics limit is too small time limit reached Terminated after numerical difficulties current point cannot be improved singular basis cannot satisfy the general constraints ill conditioned null space basis unable to compute acceptable LU factors Error in the user supplied functions incorrect objective derivatives incorrect constraint derivatives Undefined user supplied functions undefined function at the first feasible point undefined function at the initial point unable to proceed into undefined region User requested termination terminated during function evaluation terminated from monitor routine Insufficient storage allocated work arrays must have at least 500 elements not enough character storage not enough integer storage not enough real storage 20 SNOPT 7 4 User s Guide Input arguments out of range 91 invalid input argument 92 basis file dimensions do not match this problem System error 141 wrong number of basic variables 142 error in basis package mincw miniw minrw say how much character integer and real storage is needed to solve ns the problem If Print level gt 0 these values are printed If snOptA terminates because of insufficient storage INFO 82 83 or 84 the values may be used to define better values of lencw leniw or lenrw If INFO 82 the work array cw lencw is too small snOptA may be called aga
84. e nonlinear variables appear first then only the leading n rows and columns of the Hessian need be approximated where n is the number of nonlinear variables 8 SNOPT 7 4 User s Guide 2 3 Minor iterations Solving the QP subproblem is itself an iterative procedure Here the iterations of the QP solver SQOPT 10 form the minor iterations of the SQP method SQOPT uses a reduced Hessian active set method implemented as a reduced gradient method similar to that in MINOS 16 At each minor iteration the constraints Ax s b are partitioned into the form BIs Szs Nay where the basis matrix B is square and nonsingular and the matrices S N are the remaining columns of A I The vectors s 3 amp y are the associated basic superbasic and nonbasic variables components of x s The term active set method arises because the nonbasic variables xy are temporarily frozen at their upper or lower bounds and their bounds are considered to be active Since the general constraints are satisfied also the set of active constraints takes the form IAN S gt I a Ty where zy represents the current values of the nonbasic variables In practice nonbasic vari ables are sometimes frozen at values strictly between their bounds The reduced gradient method chooses to move the superbasic variables in a direction that will improve the objec tive function The basic variables tag along to keep Ax s b satisfied
85. e of information is output to the Print file every kth minor iteration where k is the specified Print frequency default k 1 Label Description Itns The cumulative number of minor iterations Major The current major iteration number Minors is the number of iterations required by both the feasibility and optimality phases of the QP subproblem Generally Minors will be 1 in the later iterations since theoretical analysis predicts that the correct active set will be identified near the solution see Section 2 Step The step length a taken along the current search direction p The variables x have just been changed to x ap On reasonably well behaved problems the unit step will be taken as the solution is approached nCon The number of times subroutines usrfun or funcon have been called to evaluate the nonlinear problem functions Evaluations needed for the estimation of the derivatives by finite differences are not included nCon is printed as a guide to the amount of work required for the linesearch Feasible is the value of rowerr the maximum component of the scaled nonlinear con straint residual 7 1 The solution is regarded as acceptably feasible if Feasible is less than the Major feasibility tolerance In this case the entry is con tained in parenthesis 8 Output 87 Optimal If the constraints are linear all iterates are feasible and this entry is not printed is the value of maxgap the maximum complementarity g
86. e printed solution is given in Section 8 In general numerical values are output with format 16 5 The maximum record length is 111 characters including the first carriage control character To reduce clutter a dot is printed for any numerical value that is exactly zero The values 1 are also printed specially as 1 0 and 1 0 Infinite bounds 10 or larger are printed as None Note If two problems are the same except that one minimizes an objective fo x and the other maximizes f x their solutions will be the same but the signs of the dual variables mi and the reduced gradients d will be reversed The ROWS section General linear constraints take the form l lt Ax lt u The ith constraint is therefore of the form a lt alx lt B and the value of afz is called the row activity Internally the linear constraints take the form Ax s 0 where the slack variables s should satisfy the bounds l lt s lt u For the ith row it is the slack variable s that is directly available and it is sometimes convenient to refer to its state Slacks may be basic or nonbasic but not superbasic Nonlinear constraints a lt f x aTx lt 8 are treated similarly except that the row activity and degree of infeasibility are computed directly from f x afz rather than s Label Description Number The value n 2 This is the internal number used to refer to the ith slack in the iteration log Row The name
87. e them if mode 0 Use the input parameter nState to test for special actions on the first or last entries While the function routines are being developed use the Verify option to check the computation of gradient elements that are supposedly known The Start and Stop options may also be helpful The function routines are not called until the linear constraints and bounds on x are satisfied This helps confine x to regions where the nonlinear functions are likely to be defined However be aware of the Minor feasibility tolerance if the functions have singularities near bounds Set mode 1 if some of the functions are undefined The linesearch will shorten the step and try again Set mode lt 2 if you want snOptB to stop 4 The snOptB interface 41 4 6 Subroutine funcon This subroutine must compute the nonlinear constraint functions f x and optionally their gradients f x where x is the current value of the Jacobian variables x The jth column of the Jacobian matrix f x is the vector Of Ox For small problems or large dense ones it is convenient to treat the Jacobian as a dense matrix and declare gCon as a two dimensional array gCon stored column wise in Fortran It is then simple to compute the Jacobian by rows or by columns For sparse Jacobians it is essential to use a one dimensional array gCon to conserve storage amp amp amp amp amp amp subroutine funcon mo
88. e x is the first nnObj variables fo x is defined by subroutine funobj and d is a constant vector that forms row i0bj of the full Jacobian matrix Choosing i0bj 4 we think of the problem as minimize utuv w s4 U U W 2 84 subject to u u w 2 vt z 4 2u 4v gt 0 3w 5z Sa with bounds w gt 0 z gt 0 co lt s4 lt where s4 is treated implicitly as the 4th slack variable Internal to snOptB slacks s s2 and s3 are associated with the first three constraints with s and sa fixed at 0 and 0 lt s3 lt oo Similarly for the constraints we define a vector function f u v to include just the nonlinear terms In this example f u v u v and fa u v vt The number of nonlinear constraints the dimension of f is specified by the input parameter nnCon 2 The variables 2 u v are known as nonlinear Jacobian variables with dimension nY specified by nnJac 2 Thus the constraint functions and the linear part of the objective have the form f x Ay ies 2 4 1 where x is the first nnJac variables f x is defined by subroutine funcon and y contains the remaining variables i e y w z in the example The full Jacobian is of the form f a As as Ag Aa with the Jacobian of f always appearing in the top left corner of A The sparsity pattern of f x and the constant matrices A2 Az A4 are input column wise via the array parameters Acol indA locA
89. ed in gCon in the same order as the corresponding parts of Acol indA locA For small problems or large dense ones it is convenient to treat the Jacobian as a dense matrix and declare gCon as a two dimensional array gCon which is stored column wise in Fortran It is then simple to compute the Jacobian by rows or by columns For problems with sparse Jacobians it is essential to use a one dimensional array gCon in order to conserve storage Thus funcon should use just one of the declarations double precision gCon nnCon nnJac double precision gCon neJac according to convenience subroutine usrfun amp mode nn0bj nnCon nnJac nnL neJac amp x fObj g0bj fCon gCon amp nState cu lencu iu leniu ru lenru integer amp lencu leniu lenru mode nnObj nnCon nnJac nnL neJac amp nState iu leniu double precision amp fObj fCon nnCon gObj mn0bj ru lenru x nnL character amp cu lencu 8 111 double precision gCon nnCon nnJac Dense Choose ONE of these double precision gCon neJac Sparse On entry mode indicates which combination of fCon gCon f0bj and g0bj must be assigned during the present call of usrfun snOptC will call usrfun with mode 0 1 or 2 You may test mode to decide what to do e If mode 2 assign f0bj fCon and the known components of gObj and gCon e If mode 1 assign the known components of g0bj and gCon f0bj and fCon are not required and are ignored e If mod
90. edG 0 on entry to usrfun 3 If not all gradients are known you must specify Derivative option 0 You should still compute as many gradients as you can It often happens that some of them are constant or even zero 4 Again if the known gradients are expensive don t compute them if needG 0 on entry to usrfun 5 Use the input parameter Status to test for special actions on the first or last entries 6 While usrfun is being developed use the Verify option to check the computation of gradients that are supposedly known 7 usrfun is not called until the linear constraints and bounds on g are satisfied This helps confine x to regions where the functions f x are likely to be defined However be aware of the Minor feasibility tolerance if the functions have singularities on the constraint boundaries 8 Set Status 1 if some of the functions are undefined The linesearch will shorten the step and try again 9 Set Status lt 1 if you want snOptA to stop 24 SNOPT 7 4 User s Guide subroutine usrfun amp Status n x amp needf nF f amp needG lenG G amp cu lencu iu leniu ru lenru integer amp lencu lenG leniu lenru n needf needG nF Status amp iu leniu double precision amp f nF G lenG ru lenru x n character amp cu lencu 8 On entry Status indicates the first and last calls to usrfun If Status 0 there is nothing special about the current call to usrfun If S
91. efined If for some reason you wish to terminate the current problem set mode lt 2 must contain the computed value of fo x except perhaps if mode 1 g0bj nn0bj must contain the known components of the gradient vector g x i e gObj J contains the partial derivative fo x except perhaps if mode 0 fCon nnCon contains the computed constraint vector f x except perhaps if mode 1 gCon nnCon nnJac or gCon neJac contains the computed Jacobian f x except per haps if mode 0 These gradient elements must be stored in gCon in exactly the same positions as implied by the definitions of snOptC s arrays Acol indA locA There is no internal check for consistency except indirectly via the Verify option so great care is essential 6 The npOpt interface 53 6 The npOpt interface The npOpt interface is designed for the solution of small dense problems The calling se quences of npOpt and its associated user defined functions are designed to be similar to those of the dense SQP code NPSOL Gill et al 11 For the case of npOpt it is convenient to restate problem NP with the constraints reordered as follows DenseNP minimize folx x subject to L lt Arx lt u f x where l and u are constant lower and upper bounds fp is a smooth scalar objective function A is a matrix and f x is a vector of smooth nonlinear constraint functions f a The interface npOpt is designed to
92. elements of fCon corresponding to positive values of needc need to be set and similarly for the known components of gCon e If mode 1 the knowm components of the rows of gCon corresponding to positive values in needc must be set Other rows of gCon and the array fCon will be ignored e If mode 0 the components of fCon corresponding to positive values in needc must be set Other components and the array gCon are ignored ncnln is the number of nonlinear constraints i e the dimension of fCon The actual parameter ncnln is the same Fortran variable as that input to npOpt and must not be altered by funcon n is the number of variables i e the dimension of x The actual parameter n is the same Fortran variable as that input to npOpt and must not be altered by funcon ldg is the leading dimension of the array gCon ldg gt 1 and ldg gt ncn1n needc is an array of dimension at least ncnln containing the indices of the elements of fCon or gCon that must be evaluated by funcon needc can be ignored if every constraint is provided x is an array of dimension at least n containing the values of the variables x for which the constraints must be evaluated x must not be altered by funcon nState has the same meaning as for funobj 6 The npOpt interface 61 On exit mode may be set as in funobj fCon is an array of dimension at least ncn1n that contains the appropriate values of the nonlinear constraint functions If needc i is n
93. enience with generic variables 2 minimize x1 22 23 323 524 subject to r 23 2 a la 4 2x1 4x2 gt 0 and z3 gt 0 z4 gt 0 This problem has 4 variables 3 nonlinear objective variables 2 nonlinear Jacobian variables 2 nonlinear constraints 1 linear constraint and two bounded variables The objective has some linear terms that we include as an extra free row with infinite bounds The calling program must assign the following values 44 SNOPT 7 4 User s Guide m 4 n 4 nnCon 2 nn0bj 3 nnJac 2 i0bj 4 Subroutine funobj works with the nonlinear objective variables v1 2 3 Since x3 occurs only linearly in the constraints we have placed it after the Jacobian variables x 12 For interest we test mode to economize on gradient evaluations even though they are cheap here Note that Nonderivative linesearch would have to be specified otherwise all entries would have mode 2 subroutine funobj amp mode nnObj amp x fObj gObj nState amp cu lencu iu leniu ru lenru integer amp mode nn0bj nState lencu leniu lenru iu leniu double precision amp fObj x nn0bj gObj mn0bj ru lenru character amp cu lencu 8 Toy NLP problem from the SNOPT User s Guide double precision sum sum x 1 x 2 x 3 if mode eq 0 or mode eq 2 then f0bj sum sum end if if mode eq
94. eniu ru lenru amp cw lencw iw leniw rw lenrw external amp usrfun integer amp INFO iPrint iSumm nF n neA lenA neG lenG mincw amp miniw minrw lencu lencw leniu leniw lenru lenrw amp iAfun lenA jAvar lenA iGfun lenG jGvar lenG amp iu leniu iw leniw double precision amp A lenA x n xlow n xupp n ru lenru rw lenrw character amp cu lencu 8 cw lencw 8 On entry Most arguments are identical to those of snOpta lenA is the dimension of the arrays iAfun jAvar A that hold i j Aij lenA gt 1 lenA should be an overestimate of the number of elements in the linear part of the Jacobian The value lenA nF x n is an upper bound on the length of A 22 SNOPT 7 4 User s Guide lenG isthe dimension of the coordinate arrays iGfun and jGvar that define the nonlinear Jacobian elements i j Gij lenG gt 1 lenG should be an overestimate of the number of elements in the nonlinear part of the Jacobian The value lenG nF x n is an upper bound on the length of iGfun and jGvar On exit iAfun lenA jAvar lenA A lenA define the coordinates i j of the nonzero elements neA of the linear part A of the function F x f x Az The first neA entries define the row and column indices 7 iAfun k and j jAvar k and elements Aj A k for k 1 neA is the number of nonzeros in A such that F x f x Ax neA gt 0 iGfun lenG jGvar lenG define th
95. eniw rw lenrw are 8 character integer and real arrays of workspace for snMemA On exit INFO reports the result of the call to snMemA Further details are in Section 8 6 Insufficient storage allocated 81 work arrays must have at least 500 elements Finished successfully 104 memory requirements estimated mincw miniw minrw estimate how much character integer and real storage is needed to solve the problem To use snMemA the first step is to allocate the work arrays These may be temporary arrays tmpcw tmpiw tmprw say or the snOptA arrays cw iw rw which will be reallocated 30 SNOPT 7 4 User s Guide after the storage limits are known Here we illustrate the use of snMemA using the same arrays for snMemA and snOptA Note that the snMemA arrays are used to store the optional parameters and so any temporary arrays must be copied into the final cw iw rw arrays in order to retain the options The work arrays must have length at least 500 so we define ltmpcw 500 ltmpiw 500 ltmprw 500 As with all SNOPT routines snInit must be called to set default options call snInit amp iPrint iSumm cw ltmpcw iw ltmpiw rw ltmprw This installs ltmpcw ltmpiw ltmprw as the default internal upper limits on the snOptA workspace see Total real workspace p 84 They are used to compute the boundaries of any user defined workspace in cw iw or rw The next step is to call snMemA to obtain mincw miniw minrw as
96. ent elements Gj x Of x Ox This subroutine is passed to snOptA as the external parameter usrfun A dummy subroutine is needed even if f x 0 and all functions are linear In general usrfun should return all function and gradient values on every entry except perhaps the last This provides maximum reliability and corresponds to the default setting Derivative option 1 The elements of G x are stored in the array G 1 1lenG in the order specified by snOptA s input arrays iGFun and jGvar see Section 3 7 In practice it is often convenient not to code gradients snOptA is able to estimate them by finite differences using a call to usrfun for each variable x for which some Of x 0z needs to be estimated However this reduces the reliability of the optimization algorithm and it can be very expensive if there are many such variables zj As a compromise sn0ptA allows you to code as many gradients as you like This option is implemented as follows Just before the function routine is called each element of the derivative array G is initialized to a specific value On exit any element retaining that value must be estimated by finite differences Some rules of thumb follow 1 For maximum reliability compute all gradients 2 If the gradients are expensive to compute specify Nonderivative linesearch and use the value of the input parameter needG to avoid computing them on certain entries There is no need to compute gradients if ne
97. ented Lagrangian merit function not printed if there are no nonlinear constraints The summary line may include additional code characters that indicate what happened during the course of the major iteration 88 SNOPT 7 4 User s Guide Code Meaning Central differences have been used to compute the unknown components of the objective and constraint gradients A switch to central differences is made if either the linesearch gives a small step or x is close to being optimal In some cases it may be necessary to re solve the QP subproblem with the central difference gradient and Jacobian During the linesearch it was necessary to decrease the step in order to obtain a maximum constraint violation conforming to the value of Violation limit The norm wise change in the variables was limited by the value of the Major step limit If this output occurs repeatedly during later iterations it may be worthwhile increasing the value of Major step limit If SNOPT is not in elastic mode an i signifies that the QP subproblem is infeasible This event triggers the start of nonlinear elastic mode which remains in effect for all subsequent iterations Once in elastic mode the QP subproblems are associated with the elastic problem NP y bbs 99 If SNOPT is already in elastic mode an i indicates that the minimizer of the elastic subproblem does not satisfy the linearized constraints In this case a feasible point for the usua
98. entry buffer is a string to be decoded Restriction len buffer lt 72 snSet or lt 55 snSeti ivalue rvalue iPrint iSumm Errors snSetr Use snSet if the string contains all relevant data For example call snSet Iterations 1000 iPrint iSumm Errors is an integer value associated with the keyword in buffer Use snSeti if it is convenient to define the value at run time For example itnlim 1000 if m gt 500 itnlim 8000 call snSeti Iterations itnlim iPrint iSumm Errors is a real value associated with the keyword in buffer For example factol 100 0d 0 if illcon factol 5 0d 0 call snSetr LU factor tol factol iPrint iSumm Errors is a file number for printing each line of data along with any error messages iPrint 0 suppresses this output is a file number for printing any error messages iSumm 0 suppresses this output is the cumulative number of errors so it should be 0 before the first call in a group of calls to the option setting routines On exit cw len Errors cw iw leniw rw lenrw hold the specified option is the number of errors encountered so far 7 Optional parameters 67 7 6 Subroutines snGet snGetc snGeti snGetr These routines obtain the current value of a single option or indicate if an option has been set amp amp amp amp amp amp amp amp integer function s
99. environment this usually denotes the screen On some systems the file may need to be opened before snInit is called If iSumm lt 0 there will be no Summary file output cw lencw iw leniw rw lenrw must be the same arrays that are passed to other SNOPT routines They must all have length 500 or more On exit Some elements of cw iw rw are given values to indicate that most optional parameters are undefined 2 Description of the SQP method 7 2 Description of the SQP method Here we summarize the main features of the SQP algorithm used in SNOPT and introduce some terminology used in the description of the library routines and their arguments The SQP algorithm is fully described by Gill Murray and Saunders 9 2 1 Constraints and slack variables Problem NP contains n variables in x Let m be the number of components of f x and A x combined The upper and lower bounds on those terms define the general constraints of the problem SNOPT converts the general constraints to equalities by introducing a set of slack variables s 81 82 8m For example the linear constraint 5 lt 2x1 312 lt 00 is replaced by 2x1 312 s 0 together with the bounded slack 5 lt s lt 00 Problem NP can be written in the equivalent form minimize fo z T S er O e x subject to Ue s 0 I lt p lt u The general constraints become the equalities f a sy 0 and A x s 0 where s and Sy are the line
100. eoretical properties of an augmented Lagrangian merit function in Advances in Opti mization and Parallel Computing P M Pardalos ed North Holland North Holland 1992 pp 101 128 4 10 P E GILL W Murray AND M H WRIGHT Practical optimization Academic Press Inc Harcourt Brace Jovanovich Publishers London 1981 58 B A MURTAGH AND M A SAUNDERS Large scale linearly constrained optimization Math Program 14 1978 pp 41 72 4 8 A projected Lagrangian algorithm and its implementation for sparse nonlinear constraints Math Program 16 1982 pp 84 117 4 MINOS 5 5 User s Guide Report SOL 83 20R Department of Operations Research Stanford University Stanford CA Revised 1998 4
101. erface 27 11 11 subroutine usrfun amp Status n x amp needF nF f amp needG lenG G amp cu lencu iu leniu ru lenru integer amp lencu lenG leniu lenru n needF needG nF Status amp iu leniu double precision amp f nF G lenG x n ru lenru character amp cu lencu 8 Computes the nonlinear objective and constraint terms for the toy problem featured in the SNOPT user s guide integer amp neG Obj Out double precision amp sum x1 x3 x4 Out 15 Output unit number Obj 1 Objective row of F if Status eq 1 then First if Out gt 0 write 0ut a This is problem Toy else if Status ge 2 then Last if Out gt 0 write 0ut a Finished problem Toy return end if x1 x 1 x3 x 3 x4 x 4 sum xi x3 x4 if meedF gt 0 then f 0bj 3 0d0 x1 sum 2 2 x3 2 x4 2 3 Linear constraint omitted 4 x4 4 end if neG 0 if meedG gt 0 then neG neG 1 G neG 2 0d0 sum 3 0d0 iGfun neG Obj Not used but included for clarity jGvar meG 1 Not used neG neG 1 28 SNOPT 7 4 User s Guide G neG iGfun neG jGvar neG neG G neG iGfun neG jGvar neG neG G neG iGfun neG jGvar neG neG G neG iGfun neG jGvar neG neG G neG iGfun neG jGvar neG end if 2 0d0 sum Obj 3 neG 1 2 0d0 sum Obj 4 neG
102. estimates of the storage needed by snOptA call snMemA amp INFO nF n nxname nFname neA neG amp mincw miniw minrw amp cw ltmpcw iw ltmpiw rw ltmprw The output values of mincw miniw minrw may now be used to define the lengths of the snOptA work arrays lencw mincw leniw miniw lenrw minrw These values may be used in f90 or C to allocate the final work arrays for the problem One last step is needed before snOptA is called The current upper limits 1tmpcw 1tmpiv ltmprw must be replaced by the estimates mincw miniw minrw This can be done using the option setting routine snSeti as follows Errors 0 Counts the number of errors iPrt 0 Suppress print output iSum 0 Suppress summary output call snSeti amp Total character workspace lencw iPrt iSum Errors amp cw ltmpcw iw ltmpiw rw ltmprw call snSeti amp Total integer workspace leniw iPrt iSum Errors amp cw ltmpcw iw ltmpiw rw ltmprw call snSeti amp Total real workspace lenrw iPrt iSum Errors amp cw ltmpcw iw ltmpiw rw ltmprw An alternative way is to call snInit again with arguments lencw leniw lenrw call snInit amp iPrint iSumm cw lencw iw leniw rw lenrw However this has the twin effects of resetting all options to their default values and reprint ing the SNOPT banner unless iPrint 0 and iSumm 0 are set for the Print and Summary files 4 The s
103. ey should not be necessary Hessian Full memory and Hessian frequency 10 have a similar effect to Hessian Limited memory and Hessian updates 10 except that the latter retains the current diagonal during resets 14 SNOPT 7 4 User s Guide Hessian updates 1 Default 10 If Hessian Limited memory is selected and BFGS updates have already been carried out all but the diagonal elements of the accumulated updates are discarded and the updating process starts again Broadly speaking the more updates stored the better the quality of the approximate Hessian However the more vectors stored the greater the cost of each QP iteration The default value is likely to give a robust algorithm without significant expense but faster convergence can sometimes be obtained with significantly fewer updates e g i 5 Insert file f Default 0 If f gt 0 this references a file containing basis information in the format of Section 9 2 The file will usually have been output previously as a Punch file The file will not be accessed if an Old basis file is specified Infinite bound r Default 1 0e 20 If r gt 0 r defines the infinite bound infBnd in the definition of the problem constraints Any upper bound greater than or equal to infBnd will be regarded as plus infinity and similarly for a lower bound less than or equal to infBnd If r lt 0 the default value is used Iterations limit i Default max 10000 20m This
104. f J 1 there is no reason to specify X 1 unless the objective contains more nonlinear variables than the Jacobian A typical line of output is 3 1 250000D 01 BS 1 1 00000E 00 4 2 00000E 00 which would mean that x3 is basic at value 12 5 and the third column of the Jacobian has elements of 1 0 and 2 0 in rows 1 and 4 Major print level 0 suppresses most output except for error messages Major step limit r Default 2 0 This parameter limits the change in x during a linesearch It applies to all nonlinear prob lems once a feasible solution or feasible subproblem has been found 1 A linesearch determines a step a over the range 0 lt a lt 8 where 8 is 1 if there are nonlinear constraints or the step to the nearest upper or lower bound on z if all the constraints are linear Normally the first steplength tried is ay min 1 8 2 In some cases such as f x ae or f x ax even a moderate change in the components of x can lead to floating point overflow The parameter r is therefore used to define a limit r 1 z p where p is the search direction and the first evaluation of f a is at the potentially smaller steplength a min 1 8 6 3 Wherever possible upper and lower bounds on x should be used to prevent evalua tion of nonlinear functions at meaningless points The Major step limit provides an additional safeguard The default value r 2 0 should not affect progress on well behaved pro
105. f input argument start Requests that the CRASH procedure be used to choose an initial basis unless a basis file is provided via Old basis Insert or Load in the Specs file 7 Optional parameters 69 This parameter has the same effect as the input arguments start 0 for snOptA and start Cold for snOptB and snOptc If specified as an optional parameter this value has precedence over the value of the input argument start This allows the start parameter to be changed at run time using the Specs file Crash option 1 Default 3 Crash tolerance t Default 0 1 Except on restarts a CRASH procedure is used to select an initial basis from certain rows and columns of the constraint matrix AmI The Crash option i determines which rows and columns of A are eligible initially and how many times CRASH is called Columns of I are used to pad the basis where necessary 1 Meaning 0 The initial basis contains only slack variables B I 1 CRASH is called once looking for a triangular basis in all rows and columns of A 2 CRASH is called twice if there are nonlinear constraints The first call looks for a triangular basis in linear rows and the iteration proceeds with simplex iterations until the linear constraints are satisfied The Jacobian is then evaluated for the first major iteration and CRASH is called again to find a triangular basis in the nonlinear rows retaining the current basis for linear rows 3 CRASH is called up t
106. finished successfully SNJAC INFO 102 Jacobian structure estimated Nonlinear constraints 2 Linear constraints 1 Nonlinear variables 2 Linear variables o Jacobian variables 2 Objective variables 0 Total constraints 3 Total variables 2 The user has defined 0 out of 4 first derivatives Major Minors Step nCon Feasible Optimal MeritFunction nS Penalty 0 2 1 5 0E 01 1 0E 00 1 0000000E 00 2 1 1 1 0E 00 2 0 0E 00 1 0E 00 9 0016883E 13 2 2 2 1 0E 00 4 5 0E 01 2 5E 01 1 0000000E 00 3 O 1 0E 00 5 5 0E 01 1 8E 02 9 7904716E 01 2 6E 02 4 O 1 0E 00 6 2 8E 02 6 3E 03 1 0005949E 00 2 6E 02 5 O 1 0E 00 7 9 6E 05 2 4E 05 1 0000000E 00 4 1E 01 6 O 1 0E 00 8 1 1E 09 2 7E 10 1 0000000E 00 8 7E 01 6 O 1 0E 00 8 1 1E 09 2 7E 10 1 0000000E 00 8 7E 01 SNOPTA EXIT 0 SNOPTA INFO 1 Problem name sntoy No of iterations 5 No of major iterations 6 Penalty parameter 8 708E 01 No of calls to funobj 40 Calls with modes 1 2 known g 8 No of degenerate steps 0 Max x 2 1 0E 00 Max Primal infeas 5 4 4E 15 Nonlinear constraint violn 2 2E 09 finished successfully optimality conditions satisfied Objective 1 0000000003E 00 Linear obj term 1 0000000003E 00 Nonlinear obj term 0 0000000000E 00 No of calls to funcon 40 Calls with modes 1 2 known g 8 Percentage 0 00 Max pi 3 1 0E 00 Max Dual infeas 2 2 7E 10 9 Basis files 108 9 Basis files A basis file may be saved at the end of a run in order to restart the run if
107. for satisfying the bounds on and s in each QP subproblem If the sum of infeasibilities cannot be reduced to zero the QP subproblem is declared infeasible SNOPT is then in elastic mode thereafter with only the linearized nonlinear constraints defined to be elastic See the Elastic options 7 Optional parameters 79 Minor print level k Default 1 This controls the amount of output to the Print and Summary files during solution of the QP subproblems The value of k has the following effect O No minor iteration output except error messages gt 1 A single line of output each minor iteration controlled by Print frequency and Summary frequency gt 10 Basis factorization statistics generated during the periodic refactorization of the basis see Factorization frequency Statistics for the first factorization each major iteration are controlled by the Major print level New basis file f Default 0 If f gt 0 a basis map will be saved on file f every kth iteration where k is the Save frequency The first line of the file will contain the word PROCEEDING if the run is still in progress A basis map will also be saved at the end of a run with some other word indicating the final solution status New superbasics limit 1 Default 99 This option causes early termination of the QP subproblems if the number of free variables has increased significantly since the first feasible point If the number of new superbasics is greater t
108. g Basis files Section 9 allow restarts Unit numbers for the Specs Print and Summary files are defined by inputs to subroutines snInit and snSpec The other SNOPT files are described in Sections 8 and 9 6 SNOPT 7 4 User s Guide 1 5 Overview of the package SNOPT is normally accessed via a sequence of subroutine calls For example the interface snOptA is invoked by the statements call snInit iPrint iSumm call snSpec iSpecs call snoptA Start nF n where snSpec reads a file of run time options if any Also individual run time options may be hard wired by calls to snSet snSeti and snSetr 1 6 Subroutine snInit Subroutine snInit must be called before any other SNOPT routine It defines the Print and Summary files prints a title on both files and sets all user options to be undefined Each SNOPT interface will later check the options and set undefined ones to default values subroutine snInit amp iPrint iSumm cw lencw iw leniw rw lenrw integer amp iPrint iSumm lencw leniw lenrw iw leniw character amp cw lencw 8 double precision amp rw lenrw On entry iPrint defines a unit number for the Print file Typically iPrint 9 On some systems the file may need to be opened before snInit is called If iPrint lt 0 there will be no Print file output iSumm defines a unit number for the Summary file Typically iSumm 6 In an interactive
109. han 2 the nonbasic variables that have not yet moved are frozen and the resulting smaller QP is solved to optimality In the major iteration log a T at the end of a line indicates that the QP was terminated early in this way Objective Row Default value of snOptA argument ObjRow This option is intended for snOptA only and may be used to specify which row of the input argument F is to act as the objective function If specified as an optional parameter this value takes precedence over the input argument ObjRow This allows the ObjRow to be changed at run time using the Specs file Old basis file f Default 0 If f gt 0 the starting point will be obtained from this file in the format of Section 9 1 The file will usually have been output previously as a New basis file The file will not be acceptable if the number of rows or columns in the problem has been altered Partial price i Default 10 LP or 1 NP This parameter is recommended for large problems that have significantly more variables than constraints It reduces the work required for each pricing operation when a nonbasic variable is selected to become superbasic e When i 1 all columns of the constraint matrix A J are searched e Otherwise A and J are partitioned to give i roughly equal segments A I j 1 to i If the previous pricing search was successful on Aj Ij the next search begins on the segments A 1 j41 All subscripts here are mod
110. handle problems for which the objective and constraint gra dients are dense i e they do not have a significant number of elements that are identically zero A typical invocation of npOpt is call npInit iPrint iSum call npSpec iSpecs call npOpt n nclin ncnln where npSpec reads a set of optional parameter definitions from the file with unit number iSpecs Figure 1 illustrates the feasible region for the jth pair of constraints 0 lt r x lt uj The quantity is the optional parameter Feasibility tolerance The constraints 0 lt rj lt uj are considered satisfied if r lies in Regions 2 3 or 4 and inactive if r lies in Region 3 The constraint r gt 4 is considered active in Region 2 and violated in Region 1 Similarly r lt uj is active in Region 4 and violated in Region 5 For equality constraints L uj Regions 2 and 4 are the same and Region 3 is empty D 4a O O SAO ail oE eA l Uj rilx Figure 1 Illustration of the constraints l lt r x lt uj The bounds j and uj are considered satisfied if r w lies in Regions 2 3 or 4 where 6 is the feasibility tolerance The constraints r x gt 4 and r x lt uj are both considered inactive if r w lies in Region 3 54 SNOPT 7 4 User s Guide 6 1 Subroutines used by npOpt npOpt is accessed via the following routines npInit Section 1 6 must be called before any other npO
111. he variables and slacks as follows hs j State of variable j Usual value of x j 0 nonbasic b1 j 1 nonbasic bu j 2 superbasic Between b1 j and bu 7 3 basic Between b1 j and bu Basic and superbasic variables may be outside their bounds by as much as the Minor feasibility tolerance Note that if scaling is specified the feasibility tolerance applies to the variables of the scaled problem In this case the variables of the original problem may be as much as 0 1 outside their bounds but this is unlikely unless the problem is very badly scaled Check the Primal infeasibility printed after the EXIT message Very occasionally some nonbasic variables may be outside their bounds by as much as the Minor feasibility tolerance and there may be some nonbasics for which x j lies strictly between its bounds If nInf gt 0 some basic and superbasic variables may be outside their bounds by an arbitrary amount bounded by sInf if scaling was not used x n m is the final variables and slacks x s pi m is the vector of dual variables 7 Lagrange multipliers for the general constraints rc n m is a vector of reduced costs y A I yr where g is the gradient of the objective if x is feasible or the gradient of the phase 1 objective otherwise The last m entries are 7 38 SNOPT 7 4 User s Guide INFO reports the result of the call to snOptB Here is a summary of possible values Further det
112. in with lencw mincw If INFO 83 or 84 the work arrays iw leniw or rw lenrw are too small snOptA may be called again with leniw or lenrw suitably larger than miniw or minrw The bigger the better because it is not certain how much storage the basis factorization needs is the final number of superbasic variables nInf sInf give the number and the sum of the infeasibilities of constraints that lie outside one of their bounds by more than the Minor feasibility tolerance before the solution is unscaled If any linear constraints are infeasible x minimizes the sum of the infeasibilities of the linear constraints subject to the upper and lower bounds being satisfied In this case nInf gives the number of variables and linear constraints lying outside their bounds The nonlinear constraints are not evaluated Otherwise x minimizes the sum of the infeasibilities of the nonlinear constraints subject to the linear constraints and upper and lower bounds being satisfied In this case nInf gives the number of components of F x lying outside their bounds by more than the Minor feasibility tolerance Again this is before the solution is unscaled 3 The snOptA interface 21 3 5 Subroutine snJac If you set Derivative option 0 and your function routine usrfun provides none of the derivatives in G you may call subroutine snJac to determine the input arrays iAfun jAvar A iGfun jGvar for snOptA These define the pattern of nonzeros
113. in the Jacobian matrix A typical sequence of calls is call snInit iPrint iSumm call snJac INFO iPrint call snSet Derivative option 0 call snOptA Start nF n The Derivative option could also be set in the Specs file Subroutine snJac determines the sparsity pattern for the Jacobian and identifies the constant elements automatically To do so snJac approximates F x at three random perturbations of the given initial point x If an element of the approximate Jacobian is the same at all three points then it is taken to be constant If it is zero it is taken to be identically zero Since the random points are not chosen close together the heuristic will correctly classify the Jacobian elements in the vast majority of cases G x Az In general snJac finds that the Jacobian can be permuted to the form Az Ag where A2 A3 A4 are constant Note that G x might contain elements that are also constant but snJac must classify them as nonlinear This is because snOptA removes linear variables from the calculation of F by setting them to zero before calling usrfun A knowledgeable user would be able to move such elements from usrfun s F x and enter them as part of iAfun jAvar A for snOpta subroutine snJac amp INFO iPrint iSumm nF n usrfun amp iAfun jAvar lenA neA A amp iGfun jGvar lenG neG amp x xlow xupp mincw miniw minrw amp cu lencu iu l
114. ine or some of the 2 s in the map did not have a corresponding j xj entry following the map 8 Output 99 EXIT 140 System error INFO 141 wrong number of basic variables INFO 142 error in basis package These conditions may arise while the basis is being factorized INFO 141 should not happen The wrong SNOPT source files may have been compiled or arguments of incorrect type may be used in the call to the SNOPT interface Check that all integer variables and arrays are declared integer in your calling program and that all real variables and arrays are declared consistently They should be double precision on most machines For INFO 142 a preceding message describes the error in more detail One such message says that the current basis has more than one element in row 7 and column j This could be caused by an error in the input parameters i e the arrays A iAfun jAvar iGfun and jGvar for snOptA or indA Acol and locA for snOptB and snOptc 8 7 Solution output At the end of a run the final solution is output to the Print file in accordance with the Solution keyword Some header information appears first to identify the problem and the final state of the optimization procedure A ROWS section and a COLUMNS section then follow giving one line of information for each row and column The format used is similar to certain commercial systems though there is no industry standard An example of th
115. is the maximum number of minor iterations allowed i e iterations of the simplex method or the QP algorithm summed over all major iterations Itns is an alternative keyword Linesearch tolerance t Default 0 9 This controls the accuracy with which a steplength will be located along the direction of search each iteration At the start of each linesearch a target directional derivative for the merit function is identified This parameter determines the accuracy to which this target value is approximated e must be a real value in the range 0 0 lt t lt 1 0 e The default value t 0 9 requests just moderate accuracy in the linesearch e If the nonlinear functions are cheap to evaluate a more accurate search may be ap propriate try t 0 1 0 01 or 0 001 The number of major iterations might decrease e If the nonlinear functions are expensive to evaluate a less accurate search may be appropriate If all gradients are known try t 0 99 The number of major iterations might increase but the total number of function evaluations may decrease enough to compensate e If not all gradients are known a moderately accurate search remains appropriate Each search will require only 1 5 function values typically but many function calls will then be needed to estimate missing gradients for the next iteration 7 Optional parameters 75 Load file f Default 0 If f gt 0 this references a file containing basis information in
116. itions s s eosa s ee eR a RA RAR Aa a AR ed Saf Solna UE oka ees eae ke Re ee be a ta 88 The SOLUTION Ble e c o cerre eee iia ea a eG 89 The SUMMARY file sc bbe eg ner be aA 9 Basis files 9 1 New and Old basis files oe n c ea ee ae sm AAA ee 4 2 Punch and Insert DES e o oa da Rae Re eae RHR a 9 3 Dump and Load files 22 24 4044 5 28 See ee A eS 9 4 Restarting modified problems lt lt eee eee ee ee References Index 4 SNOPT 7 4 User s Guide 1 Introduction SNOPT is a general purpose system for constrained optimization It minimizes a linear or nonlinear function subject to bounds on the variables and sparse linear or nonlinear constraints It is suitable for large scale linear and quadratic programming and for linearly constrained optimization as well as for general nonlinear programs of the form NP minimize folz x subject to L lt f x lt u Arx where x is an n vector of variables l and u are constant lower and upper bounds fo x is a smooth scalar objective function A is a sparse matrix and f x is a vector of smooth nonlinear constraint functions f 2 An optional parameter Maximize may specify that fo x should be maximized instead of minimized Ideally the first derivatives gradients of folx and f x should be known and coded by the user If only some of the gradients are known SNOPT estimates the missing ones by finite differences Upper and lower bounds are specified for
117. iw rw lenrw are 8 character integer and real arrays of workspace for snOptA Their lengths lencw leniw lenrw must all be at least 500 If variable and function names are specified in xnames and Fnames then lencw must be at least 500 n nF otherwise lencw 500 is appropriate Arguments leniw and lenrw should be as large as possible because it is uncertain how much storage will be needed for the basis factorization As an estimate leniw should be about 100 m n or larger and lenrw should be about 200 m n or larger Appropriate values may be obtained from a call to snMemA Section 3 8 or from a preliminary run of snOptA with lencw leniw lenrw 500 See mincw miniw minrw below on exit On exit x n contains the final values of the variables x xstate n gives the final state of the variables as follows xstate j State of variable j Usual value of x 0 nonbasic xlow 7 1 nonbasic xupp 2 superbasic Between xlow j and xupp 7 3 basic Between xlow j and xupp j Basic and superbasic variables may be outside their bounds by as much as the Minor feasibility tolerance Note that if scaling is specified the feasibility tolerance applies to the variables of the scaled problem In this case the variables of the original problem may be as much as 0 1 outside their bounds but this is unlikely unless the problem is very badly scaled Check the Primal infeasibility printed after the EXI
118. l QP subproblem may or may not exist An extra evaluation of the problem functions was needed to define an acceptable positive definite quasi Newton update to the Lagrangian Hessian This modifica tion is only done when there are nonlinear constraints This is the same as M except that it was also necessary to modify the update to include an augmented Lagrangian term No positive definite BFGS update could be found The approximate Hessian is unchanged from the previous iteration The approximate Hessian has been reset by discarding all but the diagonal el ements This reset will be forced periodically by the Hessian frequency and Hessian updates keywords However it may also be necessary to reset an ill conditioned Hessian from time to time The approximate Hessian was reset after ten consecutive major iterations in which no BFGS update could be made The diagonals of the approximate Hessian are retained if at least one update has been done since the last reset Otherwise the approximate Hessian is reset to the identity matrix A self scaled BFGS update was performed This update is used when the Hessian approximation is diagonal and hence always follows a Hessian reset The minor iterations were terminated because of the Minor iterations limit The minor iterations were terminated because of the New superbasics limit The QP subproblem was unbounded A weak solution of the QP subproblem was found The Superbasics limit was
119. lank lines and comments may be used to improve readability A comment begins with an asterisk anywhere on a line All subsequent characters on the line are ignored The Begin line is echoed to the Summary file 7 2 Multiple sets of options in the Specs file The keyword Skip allows you to collect several sets of options within a single Specs file In the following example only the second set of options will be input Skip Begin options Scale all variables End options Begin options 2 Scale linear variables End options 2 The keyword Endrun prevents subroutine snSpec from reading past that point in the Specs file while looking for Begin 7 Optional parameters 63 7 3 SPECS file checklist and defaults The following example Specs file shows all valid keywords and their default values The keywords are grouped according to the function they perform Some of the default values depend on e the relative precision of the machine being used The values given here correspond to double precision arithmetic on most current machines e 2 22 x 107168 BEGIN checklist of SPECS file parameters and their default values Printing Major print level 1 1 line major iteration log Minor print level 1 1 line minor iteration log Print file specified by subroutine snInit Summary file specified by subroutine snInit Print frequency 100 minor iterations log on Print file Summary frequency 100 minor iterations log on
120. lowing form is output to the Print and Summary files SOLVER EXIT e exit condition SOLVER INFO i informational message where e is an integer that labels a generic exit condition and i labels one of several alternative informational messages For example SNOPT may output SNOPTA EXIT 20 the problem appears to be unbounded SNOPTA INFO 21 unbounded objective where the exit condition gives a broad definition of what happened while the informational message is more specific about the cause of the termination The integer 7 is the value of the output argument INFO The integer e may be recovered from INFO by changing the least significant digit to zero Possible exit conditions for SNOPT follow O Finished successfully 10 The problem appears to be infeasible 20 The problem appears to be unbounded 30 Resource limit error 40 Terminated after numerical difficulties 50 Error in the user supplied functions 60 Undefined user supplied functions 70 User requested termination 80 Insufficient storage allocated 90 Input arguments out of range 100 Finished successfully associated with SNOPT auxiliary routines 110 Errors while processing MPS data 120 Errors while estimating Jacobian structure 130 Errors while reading the Specs file 140 System error Exit conditions 0 20 arise when a solution exists though it may not be optimal A basis file may be saved and the solution is output to the Print or Solution files if requested If e
121. lution Otherwise nName n m and all names must be provided is m the number of nonlinear constraints nnCon gt 0 is n the number of nonlinear objective variables nnObj gt 0 is n the number of nonlinear Jacobian variables If nnCon 0 then nnJac 0 If nnCon gt 0 then nnJac gt 0 says which row of A is a free row containing a linear objective vector c If there is no such row i0bj 0 Otherwise this row must come after any nonlinear rows so that nnCon lt i0bj lt m is a constant that will be added to the objective for printing purposes Typically ObjAdd 0 0d 0 is an 8 character name for the problem Prob is used in the printed solution and in some routines that output basis files A blank name may be used is the name of a subroutine that calculates the vector of nonlinear constraint func tions f x and optionally its Jacobian for a specified vector x the first nnJac elements of x funcon must be declared external in the routine that calls snOptB For a detailed description of funcon see Section 4 6 is the name of a subroutine that calculates the objective function fo x and op tionally its gradient for a specified vector x the first nn0bj elements of x funobj must be declared external in the routine that calls snOptB For a detailed description of funobj see Section 4 7 Acol neA indA neA locA n 1 define the nonzero elements of the constraint matrix A 4 2 including the J
122. m Toy end if end subroutine funcon 4 The snOptB interface 47 4 9 Constant Jacobian elements If all constraint gradients Jacobian elements are known Derivative level 2 or 3 any constant elements may be given to snOptB in the array Acol if desired The Jacobian array gCon is initialized from the appropriate elements of Acol If any are constant and have the correct value funcon need not reassign them in gCon Note that constant nonzero elements do affect fCon Thus if Jij is assigned correctly in Acol and is constant a linear term gCon i 7 x 7 or gCon x j must be added to fCon i depending on whether gCon is a two or one dimensional array Remember if Derivative level lt 2 unassigned elements of gCon are not treated as constant they are estimated by finite differences at significant expense 4 10 Subroutine snMemB This routine estimates the size of the workspace arrays cw iw rw required to solve an optimization problem of given dimensions snMemB is not strictly needed in f77 because all workspace must be defined explicitly in the driver program at compile time It is available for users wishing to allocate storage dynamically in f90 or C The actual storage required also depends on the values of the following options Hessian full or Hessian limited memory and Hessian updates Reduced Hessian dimension Superbasics limit If these options have not been set default values are assumed Ideally the
123. mbined in one user routine Finally npOpt is an interface that accepts problem data written in the same format as the dense SQP code NPSOL It permits NPSOL users to upgrade with minimum effort A summary of the SNOPT interfaces follows snOptA Section 3 is recommended for new users of SNOPT The variables and constraints may be coded in any order Nonlinear objective and constraint functions are defined by one user routine May use SnadiOpt to compute gradients snOptB Section 4 is the basic interface to the underlying solver Nonlinear constraints and variables must appear first A nonlinear objective is defined separately from any nonlinear constraints sn0ptC Section 5 is the same as snOptB except the user combines the nonlinear objective and constraints into one routine npOpt Section 6 accepts the same problem format as NPSOL It is intended for moderate sized dense problems as is NPSOL 1 4 Files Every SNOPT interface reads or creates some of the following files Print file Section 8 is a detailed iteration log with error messages and perhaps listings of the options and the final solution Summary file Section 8 9 is a brief iteration log with error messages and the final solution status Intended for screen output in an interactive environment Specs file Section 7 is a set of run time options input by snSpec Solution file Sections 8 7 8 8 keeps a separate copy of the final solution listin
124. me as before all other things being equal The value of X may lie outside its new set of bounds but there will be minimal loss of feasibility or optimality for the problem as a whole If X was previously fixed it is likely to be nonbasic at its lower bound which happens to be the same as its upper bound Increasing its upper bound will not affect the solution In contrast if X is nonbasic at its upper bound and if that bound is altered the starting values for an arbitrary number of basic variables could be changed since they will be recom puted from the nonbasic and superbasic variables This may not be of great consequence but sometimes it may be worthwhile to retain the old solution precisely To do this one can make X superbasic at the original bound value For example if x is nonbasic at an upper bound of 5 0 which has now been changed insert a line of the form j 5 0 near the end of an Old basis file or the line SB X 5 0 near the end of an Insert or Load file The Superbasics limit must be at least as large as the number of variables involved even for purely linear problems The same effect can be obtained when calling sqOpt with Warm or Hot Starts Simply set hs j 2 for the appropriate j Sequences of problems Whenever practical a series of related problems should be ordered so that the most tightly constrained cases are solved first Their solutions will often provide feasible starting points for subsequent rel
125. mensions lencw leniw lenrw If rw is not large enough be sure that the Reduced Hessian dimension is not unreasonably large EXIT 90 Input arguments out of range INFO 91 invalid input argument INFO 92 basis file dimensions do not match this problem These conditions occur if some data associated with the problem is out of range For INFO 91 at least one input argument for the interface is invalid The Print and Summary files provide more detail about which arguments must be modified For INFO 92 an Old basis file could not be loaded properly In this situation new basis files cannot be saved and there is no solution to print On the first line of the Old basis file the dimensions m and n are different from those associated with the problem that has just been defined You have probably loaded a file that belongs to another problem If you are using snOptA and you have added elements to A iAfun and jAvar or iGfun and jGvar you will have to alter m and n and the map beginning on the third line a hazardous operation It may be easier to restart with a Punch or Dump file from an earlier version of the problem The basis file state vector will not match the current problem if for some reason the Old basis file is incompatible with the present problem or is not consistent within itself The number of basic entries in the state vector i e the number of 3 s in the map is not the same as m on the first l
126. mple e If the first 100 objective gradients appeared to be correct in an earlier run and if you have just found a bug in funobj that ought to fix up the 101 th component then you might as well specify Start Objective Check at Column 101 Similarly for columns of the Jacobian e If the first 100 variables occur nonlinearly in the constraints and the remaining vari ables are nonlinear only in the objective then funobj must set the first 100 components of g to zero but these hardly need to be verified The above option would again be appropriate 7 Optional parameters 83 Sticky parameters No Default Sticky parameters Yes User defined optional parameters may be modified so that they lie in a sensible range For example any tolerance specified as negative or zero will be changed to its positive default value Specifying Sticky parameters No will result in the original user defined parameters being reloaded into workspace after the run is completed If a second run is made immediatly following a call with Sticky parameters Yes e g with the Hot start option then any modified parameter values will persist in workspace for the second run Summary file f Summary frequency k Default 100 If f gt 0 the Summary file is output to file f If Minor print level gt 0 a line of the QP iteration log is output every Ath minor iteration The default f is obtained from subroutine snInit s parameter iSumm Set f 0 to suppress the Summ
127. n is found at iteration 2050 or if the iteration limit is 2050 the final basis on file 12 will correspond to iteration 2050 but the last basis saved on file 11 will be the one for iteration 2000 Central difference interval r Default el 3 6 0e 6 When Derivative option 0 with the snOptA interface or Derivative level lt 3 with snOptB or sn0ptC the central difference interval r is used near an optimal solution to obtain more accurate but more expensive estimates of gradients Twice as many function evaluations are required compared to forward differencing The interval used for the jth variable is hj r 1 x The resulting derivative estimates should be accurate to O r unless the functions are badly scaled Check frequency k Default 60 Every kth minor iteration after the most recent basis factorization a numerical test is made to see if the current solution x satisfies the general linear constraints including linearized nonlinear constraints if any The constraints are of the form Ax s b where s is the set of slack variables To perform the numerical test the residual vector r b Ax s is computed If the largest component of r is judged to be too large the current basis is refactorized and the basic variables are recomputed to satisfy the general constraints more accurately Check frequency 1 is useful for debugging purposes but otherwise this option should not be needed Cold Start Default value o
128. n Superbasics limit are specified superbasic the excess will be made nonbasic before iterations begin 9 4 Restarting modified problems Sections 9 1 9 3 document three distinct starting methods Old basis Insert and Load files which may be preferable to any of the cold start CRASH options The best choice depends on the extent to which a problem has been modified and whether it is more convenient to specify variables by number or by name The following notes offer some rules of thumb Protection In general there is no danger of specifying infinite values For example if a variable is specified to be nonbasic at an upper bound that happens to be 00 it will be made nonbasic at its lower bound Conversely if its lower bound is oo If the variable is free both bounds infinite it will be made nonbasic at value zero No warning message will be issued 9 Basis files 107 Default Status If the status of a variable is not explicitly given it will initially be nonbasic at the bound that is smallest in absolute magnitude Ties are broken in favor of lower bounds and free variables will again take the value zero Restarting with different bounds Suppose that a problem is to be restarted after the bounds on some variable X have been altered Any of the basis files may be used but the starting point obtained depends on the status of X at the time the basis is saved If X is basic or superbasic the starting point will be the sa
129. nGet buffer Errors cw lencw iw leniw rw lenrw subroutine snGetc buffer cvalue Errors cw lencw iw leniw rw lenrw subroutine snGeti buffer ivalue Errors cw lencw iw leniw rw lenrw subroutine snGetr buffer rvalue Errors cw lencw iw leniw rw lenrw character buffer integer Errors ivalue lencw leniw lenrw iw leniw character cvalue 8 cw lencw 8 double precision rvalue rw lenrw On entry buffer Errors cw len is a string to be decoded Restriction len buffer lt 72 is the cumulative number of errors so it should be 0 before the first call in a group of calls to option getting routines cw iw leniw rw lenrw contain the current options data On exit snGet cvalue ivalue rvalue Errors is 1 if the option contained in buffer has been set otherwise 0 Use snGet to find if a particular optional parameter has been set For example if i snGet Hessian limited memory Errors then i will be 1 if SNOPT is using a limited memory approximate Hessian is a string associated with the keyword in buffer Use snGetc to obtain the names associated with an MPS file For example for the name of the bounds section use call snGetc Bounds MyBounds Errors is an integer value associated with the keyword in buffer Example call snGeti Iterations limit itnlim Errors is a real value associated with the keywo
130. nOptA the following information 1 The index of the objective row Here ObjRow 1 2 The upper and lower bounds on x The vectors and uz are input as arrays infBnd 1 1d 20 xlow 1 0 0 xlow 2 infBnd xupp 1 infBnd xupp 2 infBnd where infBnd represents infinity It must be at least as large as the Infinite Bound default value 107 3 The upper and lower bounds on F x The vectors lp and up are also in arrays Flow 1 infBnd Flow 2 infBnd Flow 3 infBnd Fupp 1 infBnd Fupp 2 4 0 Fupp 3 5 0 Note that the objective row must have infinite bounds to make it a free row 3 The snOptA interface 13 4 A subroutine usrfun that computes F x For this example usrfun would contain the assignments F 1 x 2 The objective row F 2 x 1 2 4 0 x 2 2 F 3 x 1 2 0 2 x 2 2 5 As many elements of G x as possible Ideally Derivative option 1 should be spec ified and subroutine usrfun should compute all derivatives of F x Elements that are identically zero may be omitted Here usrfun could include the following additional assignments They compute all Gij row wise excluding G11 0 G 1 1 0 G 1 2 G 2 2 0 x 1 G 2 1 G 3 8 0 x 2 G 2 2 G 4 2 0 x 1 2 0 G 3 1 G 5 2 0 x 2 G 3 2 The elements of G may be stored in any order row wise column wise or more ran domly The ordering implies a list of coordinates i
131. nOptB interface 31 4 The snOptB interface snOptB is the basic user interface with arguments identical to versions of SNOPT up to Version 5 3 4 The optimization problem is assumed to be in the form NP p 4 with the data ordered so that nonlinear constraints and variables come first A typical invocation is call snInit iPrint iSumm call snSpec call snOptB Start m n ne Subroutine snOpt is identical to snOptB and the analogous call provides compatibility with previous versions of SNOPT call snOpt Start m n ne 4 1 Subroutines used by snOptB snOptB is accessed via the following routines snInit Section 1 6 must be called before any other snOptB routines snSpec Section 7 4 may be called to input a Specs file a list of run time options snSet snSeti snSetr Section 7 5 may be called to specify a single option snGet snGetc snGeti snGetr Section 7 6 may be called to obtain an option s current value snOptB snOpt Section 4 4 are the main solvers They are identical funcon funobj Sections 4 6 4 7 are supplied by the user and called by snOptB They define the constraint and objective functions and ideally their gradients They have a fixed parameter list but may have any convenient name They are passed to snOptB and snOpt as parameters snMemB Section 4 10 computes the size of the workspace arrays cw iw rw required for given problem dimensions Intended
132. nal parameters The performance of each SNOPT interface is controlled by a number of parameters or op tions Each option has a default value that should be appropriate for most problems Other values may be specified in two ways e By calling subroutine snSpec to read a Specs file Section 7 1 e By calling the option setting routines snSet snSeti snSetr Section 7 5 The current value of an optional parameter may be examined by calling one of the routines snGet snGetc snGeti snGetr Section 7 6 7 1 The SPECS file The Specs file contains a list of options and values in the following general form Begin options Iterations limit 500 Minor feasibility tolerance 1 0e 7 Solution Yes End options We call such data a Specs file because it specifies various options The file starts with the keyword Begin and ends with End The file is in free format Each line specifies a single option using one or more items as follows 1 A keyword required for all options 2 A phrase one or more words that qualifies the keyword only for some options 3 A number that specifies an integer or real value only for some options Such numbers may be up to 16 contiguous characters in Fortran 77 s I F E or D formats terminated by a space or new line The items may be entered in upper or lower case or a mixture of both Some of the keywords have synonyms and certain abbreviations are allowed as long as there is no ambiguity B
133. nd is violated by more than Region 3 Both bounds are satisfied by more than Region 2 The lower bound is active to within 6 Region 4 The upper bound is active to within Region 2 Region 4 The bounds are equal and the equality constraint is satisfied to within These values of istate are labeled in the printed solution as follows 58 SNOPT 7 4 User s Guide Region 1 2 3 4 5 2 4 istate j 2 1 0 2 1 3 Printed solution LL FR UL EQ fCon is an array of dimension at least ncnln If ncnln 0 fCon is not accessed and may then be declared to be of dimension 1 or the actual parameter may be any convenient array If ncnln gt 0 fCon contains the values of the nonlinear constraint functions f x i 1 ncn1n at the final iterate gCon contains the Jacobian matrix of the nonlinear constraints at the final iterate i e gCon i j contains the partial derivative of the ith constraint function with respect to the jth variable i 1 ncnln 7 1 n See the discussion of gCon under funcon in Section 6 5 cMul contains the QP multipliers from the last QP subproblem cMul j should be non negative if istate j 1 and non positive if istate j 2 fObj is the value of the objective f x at the final iterate g0bj n contains the objective gradient or its finite difference approximation at the final iterate Hess 1dH contains an estimate of H the He
134. ne funobj amp mode n x fObj gU0bj nState integer amp mode n nState double precision amp fObj x n g0bj n On entry mode is set by npOpt to indicate which values are to be assigned during the call of funobj If Derivative level 1 or Derivative level 3 then all components of the objective gradient are defined by the user and mode will always have the value 2 If some gradient elements are unspecified npOpt will call funobj with mode 0 1 or 2 e If mode 2 assign f0bj and the known components of g0bj e If mode 1 assign all available components of g0bj fObj is not required e If mode 0 only f0bj needs to be assigned g0bj is ignored n is the number of variables i e the dimension of x The actual parameter n will always be the same Fortran variable as that input to npOpt and must not be altered by funobj x n isan array containing the values of the variables x for which fo must be evaluated The array x must not be altered by funobj nState allows the user to save computation time if certain data must be read or calculated only once If nState 1 npOpt is calling funobj for the first time If there are nonlinear constraints the first call to funcon will occur before the first call to funobj On exit mode may be used to indicate that you are unable or unwilling to evaluate the objective function at the current x Similarly for the constraint functions During the linesearch the functions are e
135. necessary or to provide a good starting point for some closely related problem Three formats are available They are invoked by options of the following form New basis file 10 Backup file 11 Punch file 20 Dump file 30 The file numbers should be in the range 1 99 or zero for files that are not wanted New basis and Backup basis files are saved in that order every kth iteration where k is the Save frequency New basis Punch and Dump files are saved at the end of a run in that order They may be re loaded using options of the following form Old basis file 10 Insert file 20 Load file 30 Only one such file will actually be loaded with the order of precedence as shown If no basis files are specified one of the Crash options takes effect Figures 2 4 illustrate the data formats used for basis files 80 character fixed length records are suitable in all cases 36 character records would be adequate for Punch and Dump files The files shown correspond to the optimal solution for the economic growth model MANNE which is problem t4manne in the SNOPT distribution The problem has 10 nonlinear constraints 10 linear constraints and 30 variables Selected column numbers are included to define significant data fields 9 1 New and Old basis files These files may be called basis maps They contain the most compact representation of the state of each variable They are intended for restarting the solution of a problem at a point that
136. neral these subroutines should return all function and gradient values on every entry except perhaps the last This provides maximum reliability and corresponds to the default setting Derivative level 3 40 SNOPT 7 4 User s Guide In practice it is often convenient not to code gradients snOptB is able to estimate gradients by finite differences by making a call to funcon or funobj for each variable x whose partial derivatives need to be estimated However this reduces the reliability of the optimization algorithms and it can be very expensive if there are many such variables xj As a compromise sn0ptB allows you to code as many gradients as you like This option is implemented as follows Just before a function routine is called each element of the gradient array is initialized to a specific value On exit any element retaining that value must be estimated by finite differences Some rules of thumb follow 1 2 For maximum reliability compute all function and gradient values If the gradients are expensive to compute specify Nonderivative linesearch and use the input parameter mode to avoid computing them on certain entries Don t compute gradients if mode 0 If not all gradients are known you must specify Derivative level lt 2 You should still compute as many gradients as you can It often happens that some of them are constant or even zero Again if the known gradients are expensive don t comput
137. nlinear constraints in NP If k Sk Tx denotes the current solution estimate and Zk Sk Tk denotes the QP solution the linesearch determines a step az 0 lt ag lt 1 such that the new point Tk 1 Tk Tk Tk Skit Sk t Qk Sk Sk 2 4 Tk 1 Tk Tk Tk 10 SNOPT 7 4 User s Guide gives a sufficient decrease in the merit function 2 3 When necessary the penalties in D are increased by the minimum norm perturbation that ensures descent for M 14 As in NPSOL sy is adjusted to minimize the merit function as a function of s prior to the solution of the QP subproblem For more details see 11 3 2 6 Treatment of constraint infeasibilities SNOPT makes explicit allowance for infeasible constraints First infeasible linear constraints are detected by solving the linear program FP minimize e7 v w T U W x lt lt gt gt subject to l lt PR u v gt 0 w gt 0 where e is a vector of ones and the nonlinear constraint bounds are temporarily excluded from l and u This is equivalent to minimizing the sum of the general linear constraint violations subject to the bounds on x The sum is the norm of the linear constraint violations In the linear programming literature the approach is called elastic programming The linear constraints are infeasible if the optimal solution of FP has v 4 0 or w 0 SNOPT then terminates without computing the nonlinear functions Otherwise
138. o be opened before snSpec is called On exit cw lencw iw leniw rw lenrw contain the specified options INFO reports the result of calling snSpec Here is a summary of possible values Finished successfully 101 Specs file read Errors while reading Specs file 131 No Specs file specified iSpecs lt 0 or iSpecs gt 99 132 End of file encountered while looking for Specs file snSpec encountered end of file or Endrun before finding Begin see Section 7 2 The Specs file may not be properly assigned 133 End of file encountered before finding End Lines containing Skip or Endrun may imply that all options should be ignored 134 Endrun found before any valid sets of options gt 134 There were i INFO 134 errors while reading the Specs file 66 SNOPT 7 4 User s Guide 7 5 Subroutines snSet snSeti snSetr These routines specify an option that might otherwise be defined in one line of a Specs file amp amp amp amp amp amp amp amp amp subroutine snSet buffer iPrint iSumm Errors cw lencw iw leniw rw lenrw subroutine snSeti buffer ivalue iPrint iSumm Errors cw lencw iw leniw rw lenrw subroutine snSetr buffer rvalue iPrint iSumm Errors cw lencw iw leniw rw lenrw character buffer integer Errors ivalue iPrint iSumm lencw leniw lenrw iw leniw double precision rvalue rw lenrw character amp cw lencw 8 On
139. o three times if there are nonlinear constraints The first two calls treat linear equalities and linear inequalities separately As before the last call treats nonlinear rows before the first major iteration If i gt 1 certain slacks on inequality rows are selected for the basis first If i gt 2 numerical values are used to exclude slacks that are close to a bound CRASH then makes several passes through the columns of A searching for a basis matrix that is essentially triangular A column is assigned to pivot on a particular row if the column contains a suitably large element in a row that has not yet been assigned The pivot elements ultimately form the diagonals of the triangular basis For remaining unassigned rows slack variables are inserted to complete the basis The Crash tolerance allows the starting procedure CRASH to ignore certain small nonzeros in each column of A If amax is the largest element in column j other nonzeros aij in the column are ignored if a lt max X t To be meaningful t should be in the range 0 lt t lt 1 When t gt 0 0 the basis obtained by CRASH may not be strictly triangular but it is likely to be nonsingular and almost triangular The intention is to obtain a starting basis containing more columns of A and fewer arbitrary slacks A feasible solution may be reached sooner on some problems For example suppose the first m columns of A form the matrix shown under LU factor
140. od for nonlinear constraints in Numerical Optimization 1984 P T Boggs R H Byrd and R B Schnabel eds Philadelphia 1985 SIAM pp 26 40 10 R FOURER Solving staircase linear programs by the simplex method 1 Inversion Math Program 23 1982 pp 274 313 81 E M Gertz P E GILL AND J MUETHERIG User s guide for SnadiOpt A package adding automatic differentiation to Snopt Report NA 01 1 Department of Mathematics University of California San Diego 2001 5 P E GILL W MURRAY AND M A SAUNDERS SNOPT An SQP algorithm for large scale constrained optimization SIAM J Optim 12 2002 pp 979 1006 4 7 SNOPT An SQP algorithm for large scale constrained optimization SIAM Rev 47 2005 pp 99 131 7 User s guide for SQOPT Version 7 Software for large scale linear and quadratic programming Numerical Analysis Report 06 1 Department of Mathematics University of California San Diego La Jolla CA 2006 8 P E GILL W MURRAY M A SAUNDERS AND M H WRIGHT User s guide for NPSOL Version 4 0 a Fortran package for nonlinear programming Report SOL 86 2 Department of Operations Research Stanford University Stanford CA 1986 4 10 53 Maintaining LU factors of a general sparse matriz Linear Algebra Appl 88 89 1987 pp 239 270 4 9 75 90 A practical anti cycling procedure for linearly constrained optimization Math Program 45 1989 pp 437 474 72 Some th
141. of the ith row 100 SNOPT 7 4 User s Guide State The state of the ith row relative to the bounds a and P The various states possible are as follows LL The row is at its lower limit a UL The row is at its upper limit 6 EQ The limits are the same a BS The constraint is not binding s is basic A key is sometimes printed before the State to give some additional information about the state of the slack variable A Alternative optimum possible The slack is nonbasic but its reduced gradient is essentially zero This means that if the slack were allowed to start moving from its current value there would be no change in the objective function The values of the basic and superbasic variables might change giving a genuine alternative solution The values of the dual variables might also change D Degenerate The slack is basic but it is equal to or very close to one of its bounds I Infeasible The slack is basic and is currently violating one of its bounds by more than the Feasibility tolerance N Not precisely optimal The slack is nonbasic Its reduced gradient is larger than the Major optimality tolerance Note If Scale option gt 0 the tests for assigning A D I N are made on the scaled problem because the keys are then more likely to be meaningful Activity The row value afz or f x afz for nonlinear rows Slack activity The amount by which the row differs from its nearest bound For free rows
142. on may be returning accurate function values but inaccurate gradients or vice versa This is the most likely cause Study the comments given for INFO 51 and 52 and check that the coding of the problem functions is correct 2 The function and gradient values could be consistent but their precision could be too low For example accidental use of a real data type when double precision was intended would lead to a relative function precision of about 10 instead of something like 10715 The default Major optimality tolerance of 10 would need to be raised to about 1073 for optimality to be declared at a rather suboptimal point Of course it is better to revise the function coding to obtain as much precision as economically possible 3 If function values are obtained from an expensive iterative process they may be ac curate to rather few significant figures and gradients will probably not be available One should specify Function precision t Major optimality tolerance vt 8 Output 97 but even then if t is as large as 1075 or 107 only 5 or 6 significant figures the same exit condition may occur At present the only remedy is to increase the accuracy of the function calculation For INFO 42 the first factorization attempt found the basis to be structurally or nu merically singular Some diagonals of the triangular matrix U were deemed too small The associated variables were replaced by slacks and the modified basis ref
143. one of its bounds a shorter step x s ap is taken one of the variables is made nonbasic and ns is decreased by one The process of computing and testing reduced gradients dy is known as pricing a term introduced in the context of the simplex method for linear programming Pricing the jth variable means computing dj gj ar where a is the jth column of A TI If there are significantly more variables than general constraints i e n gt gt m pricing can be computationally expensive In this case a strategy known as partial pricing can be used to compute and test only a subset of dy Solving the reduced Hessian system 2 2 is sometimes expensive With the option QPSolver Cholesky an upper triangular matrix R is maintained satisfying RTR Z7HZ Normally R is computed from ZTH Z at the start of phase 2 and is then updated as the BSN sets change For efficiency the dimension of R should not be excessive say ns lt 1000 This is guaranteed if the number of nonlinear variables is moderate Other QPSolver options are available for problems with many degrees of freedom 2 5 The merit function After a QP subproblem has been solved new estimates of the NP solution are computed using a linesearch on the augmented Lagrangian merit function T M cr 8 1 fola a f a sx 4 Fle 8x D fl sw 2 3 where D is a diagonal matrix of penalty parameters D gt 0 and m now refers to dual variables for the no
144. onzero and mode 0 or 2 the value of the ith constraint at x must be stored in fCon i The other components of fCon are ignored gCon is an array of declared dimension 1dg k where k gt n It contains the appropriate elements of the Jacobian evaluated at x See the discussion of mode and gCon above mode may be set as in funobj 6 6 Constant Jacobian elements If all constraint gradients Jacobian elements are known i e Derivative Level 2 or 3 any constant elements may be assigned to gCon one time only at the start of the optimization An element of gCon that is not subsequently assigned in funcon will retain its initial value throughout Constant elements may be loaded into gCon either before the call to npOpt or during the the first call to funcon signalled by the value nState 1 The ability to preload constants is useful when many Jacobian elements are identically zero in which case gCon may be initialized to zero and nonzero elements may be reset by funcon Note that constant nonzero elements do affect the values of the constraints Thus if gCon i 7 is set to a constant value it need not be reset in subsequent calls to funcon but the value gCon i j x j must nonetheless be added to fCon i It must be emphasized that if Derivative level lt 2 unassigned elements of gCon are not treated as constant they are estimated by finite differences at non trivial expense 62 SNOPT 7 4 User s Guide 7 Optio
145. os in the LU factors at the start of the QP subproblem If the constraints are linear refactorization is subject only to the Factorize frequency and LU will tend to increase between factorizations The number of columns of the basis matrix B that were swapped with columns of S to improve the condition of B The swaps are determined by an LU fac torization of the rectangular matrix Bs B S y with stability being favored more than sparsity The current number of superbasic variables An estimate of the condition number of RTR an estimate of ZTH Z the reduced Hessian of the Lagrangian It is the square of the ratio of the largest and small est diagonals of the upper triangular matrix R which is a lower bound on the condition number of RT R Cond Hz gives a rough indication of whether or not the optimization procedure is having difficulty If e is the relative precision of the machine being used the SQP algorithm will make slow progress if Cond Hz becomes as large as 71 2 108 and will probably fail to find a better solution if Cond Hz reaches e 4 10 To guard against high values of Cond Hz attention should be given to the scaling of the variables and the constraints In some cases it may be necessary to add upper or lower bounds to certain variables to keep them a reasonable distance from singularities in the nonlinear functions or their derivatives is the Euclidean norm of the vector of penalty parameters used in the augm
146. ot be altered 42 SNOPT 7 4 User s Guide nState indicates the first and last calls to funcon If nState 0 there is nothing special about the current call to funcon If nState 1 snOptB is calling your subroutine for the first time Some data may need to be input or computed and saved Note that if there is a nonlinear objective the first call to funcon will occur before the first call to funobj If nState gt 2 snOptB is calling your subroutine for the last time You may wish to perform some additional computation on the final solution Note again that the last call to funcon will occur before the last call to funobj In general the last call is made with nState 2 INFO 10 where INFO is the integer returned by snOptB see p 38 In particular if nState 2 the current x is optimal if nState 3 the problem appears to be infeasible if nState 4 the problem appears to be unbounded if nState 5 an iterations limit was reached If the functions are expensive to evaluate it may be desirable to do nothing on the last call The first executable statement could be if nState ge 2 return cu lencu iu leniu ru lenru are the character integer and real arrays of user work space provided to snOptB They may be used to pass information into the function routines and to preserve data between calls In special applications the functions may depend on some of the internal variables stored in snOptB s works
147. ounded if nState 5 an iterations limit was reached If the functions are expensive to evaluate it may be desirable to do nothing on the last call The first executable statement could be if nState ge 2 return cu lencu iu leniu ru lenru are the character integer and real arrays of user work space provided to snOptC They may be used to pass information into the function routine and to preserve data between calls In special applications the functions may depend on some of the internal variables stored in snOptC s workspace arrays cw iw rw For example the 8 character prob lem name Prob is stored in cw 51 and the dual variables are stored in rw 1xMul onward where 1xMul iw 316 These will be accessible to usrfun if snOptC is called with parameters cu iu ru the same as cw iw rw If you still require user workspace elements rw 501 maxru and rw maxrwt1 lenru are set aside for this purpose where maxru iw 2 Similarly for workspace in cw and rw See the Total and User workspace options On exit mode f0bj may be used to indicate that you are unable or unwilling to evaluate the problem functions at the current z During the linesearch the functions are evaluated at points of the form x k apk after they have already been evaluated satisfactorily at xx For any such a if you set mode to 1 snOptC will reduce a and evaluate the functions again closer to k where they are more likely to be d
148. ow j or xstate j 5 and x j xupp j as appropriate A CRASH procedure is used to select an initial basis The initial basis matrix will be triangular ignoring certain small entries in each column The values xstate j 0 1 2 3 4 5 have the following meaning xstate 7 State of variable j during CRASH 0 1 3 Eligible for the basis 3 is given preference 2 4 5 Ignored After CRASH variables for which xstate j 2 are made superbasic Other variables not selected for the basis are made nonbasic at the value x j or the closest value inside their bounds See the description of xstate below on exit 2 If Start 0 or l and a basis file is provided xstate and x need not be set 3 For Warm starts Start 2 xstate and x must be defined and all xstate j must be 0 1 2 or 3 perhaps from a previous call F nF sometimes contains a set of initial values for the functions F x See next Fstate nF sometimes contains a set of initial states for the problem functions F 1 For Cold starts Start 0 or 1 with no basis file provided Fstate and F must be defined If there is no wish to provide special information you may set Fstate i 0 F i 0 0 for all i 1 nF All rows will be eligible for the initial basis Less trivially to say that the optimal value of row i will probably be one of its bounds set Fstate i 4 and F i Flow i or Fstate i 5 and F i Fupp i as appropriate During CR
149. p Obj ObjAdd sInf Acol neA bl ntm bu ntm pi m amp rc n m ru lenru rw lenrw x n m character amp Start character amp Prob 8 cu lencu 8 cw lencw 8 Names nName 8 On entry Start is a character string that specifies how a starting point is to be obtained Cold Cold start requests that the CRASH procedure be used unless an Old basis Insert or Load file is specified Basis file is the same as Start Cold but more meaningful when a basis file is given Warm Warm start means that hs defines a valid starting point probably from an earlier call though not necessarily m is m the number of general constraints This is the number of rows in the full matrix A in 4 2 m gt 0 Note that A must have at least one row If your problem has no constraints or only upper and lower bounds on the variables then you must include a dummy row with sufficiently wide upper and lower bounds See Acol indA locA below n is n the number of variables excluding slacks This is the number of columns in A n gt 0 4 The snOptB interface 35 neA nName nnCon nn0bj nnJac i0bj Obj Add Prob funcon funobj is the number of nonzero entries in A including the Jacobian for any nonlinear constraints neA gt 0 is the number of column and row names provided in the character array Names If nName 1 there are no names Generic names will be used in the printed so
150. pace arrays cw iw rw For example the 8 character prob lem name Prob is stored in cw 51 and the dual variables are stored in rw 1xMul onward where 1xMul iw 316 These will be accessible to both funcon and funobj if snOptB is called with parameters cu iu ru the same as cw iw rw If you still require user workspace elements rw 501 maxru and rw maxrwt1 lenru are set aside for this purpose where maxru iw 2 Similarly for workspace in cw and rw See the Total and User workspace options On exit fCon nnCon contains the computed constraint vector f x except perhaps if mode 1 gCon nnCon nnJac or gCon neJac contains the computed Jacobian f x except per mode haps if mode 0 These gradient elements must be stored in gCon consistently with the arrays Acol indA locA that define the sparsity pattern of f x and Aa in 4 2 excluding the elements of Az There is no internal check for consistency except indirectly via the Verify option so great care is essential may be used to indicate that you are unable to evaluate f or its gradients at the current x For example the problem functions may not be defined there During the linesearch f x is evaluated at points k apx for various steplengths a where f x has already been evaluated satisfactorily For any such zx if you set mode 1 sn0ptB will reduce a and evaluate f again closer to x where it is more likely to be defined If for some
151. ppropriate when the linear and nonlinear constraints contain data to about that accuracy Let rowerr be the maximum nonlinear constraint violation normalized by the size of the solution It is required to satisfy rowerr max viol z lt er 7 1 where viol is the violation of the ith nonlinear constraint i 1 nnCon In the major iteration log rowerr appears as the quantity labeled Feasib1 If some of the problem functions are known to be of low accuracy a larger Major feasibility tolerance may be appropriate Major iterations limit k Default max 1000 m This is the maximum number of major iterations allowed It is intended to guard against an excessive number of linearizations of the constraints If k 0 both feasibility and optimality are checked Major optimality tolerance Ed Default 1 0e 6 This specifies the final accuracy of the dual variables On successful termination SNOPT will have computed a solution x s m such that maxComp max Comp 7 lt a 7 2 j where Comp is an estimate of the complementarity slackness for variable j j 1l in m The values Comp are computed from the final QP solution using the reduced gradients dj gj Taj where g is the jth component of the objective gradient a is the associated column of the constraint matrix A I and v is the set of QP dual variables Comp l f d minu x 1 if dj lt 0 In the major iteration log maxComp appea
152. pt routines npSpec Section 7 4 may be called to input a Specs file a list of run time options npSet npSeti npSetr Section 7 5 may be called to specify a single option npGet npGetc npGeti npGetr Section 7 6 may be called to obtain an option s current value npOpt Section 6 is the main solver funcon funobj Section 6 3 are supplied by the user and called by npOpt They define the constraint functions f x and objective function fo x and ideally their gradients They have a fixed parameter list but may have any convenient name They are passed to npOpt as parameters npMem in distribution file np021ib f computes the size of the workspace arrays iw and rw required for given problem dimensions Intended for Fortran 90 drivers that reallocate workspace if necessary 6 2 Subroutine npOpt In the following specification of npOpt we define r x as the vector of combined constraint functions r x x A x f x and use nctotl to denote a variable that holds its dimension nctotl n nclin ncnln Note that most machines use double precision declarations as shown but some machines use real The same applies to the user routines funcon and funobj subroutine npOpt amp n nclin ncnln 1dA ldg 1dH amp A bl bu funcon funobj amp INFO majIts iState amp fCon gCon cMul fObj g0bj Hess x amp iw leniw rw lenrw external amp funcon funobj integer amp INFO 1dA ldg 1dH leniw
153. rd in buffer Example call snGetr LU factor tol factol Errors is the number of errors encountered so far 68 SNOPT 7 4 User s Guide 7 7 Description of the optional parameters The following is an alphabetical list of the options that may appear in the Specs file and a description of their effect In the description of the options we use the notation of the problem format NP to refer to the objective and constraint functions Backup basis file f Default 0 This is intended as a safeguard against losing the results of a long run Suppose that a New basis file is being saved every 100 iterations and that SNOPT is about to save such a basis at iteration 2000 It is conceivable that the run may be interrupted during the next few milliseconds in the middle of the save In this case the basis file will be corrupted and the run will have been essentially wasted The following example eliminates this risk Old basis file 11 or 0 Backup basis file 11 New basis file 12 Save frequency 100 The current basis will then be saved every 100 iterations first on file 12 and then immediately on file 11 If the run is interrupted at iteration 2000 during the save on file 12 there will still be a usable basis on file 11 corresponding to iteration 1900 Note that a New basis will be saved at the end of a run if it terminates normally but there is no need for a further Backup basis In the above example if an optimum solutio
154. resent the official views of the funding agencies Contents 1 Introduction LI Problemi types oie i eh we ae e eh ee ee a Ee ee LUZ Implementar a a ee ee Pe ee ee 13 The SNOPT IES kc ek RRA ER A ee i aa Ue Bale ns eS PR Rae AOS Ske ee sae oe Be we 15 Overview of the package oa etoso sucr deu esa da teno RES 16 Subroutine sola celia koane e e aka E oi ba Rae e Description of the SQP method 2 1 Constraints and slack variables es oe sa oseca sep ae Sna 22 Major iterations c o one ae p ae ea ae Re Hee a eaan 243 Ninot METALIONS gt c ies mena i a a a A 2 4 The reduced Hessian and reduced gradient oaoa 20 The m ri MAGON esea ee a OY A a ea a ea PS ek 2 6 Treatment of constraint infeasibilities uaua The snOptaA interface 3 1 Subroutines associated with snOptA o a a ee o o e eae RS 3 3 Exploiting problem structure s aso 2 06666 5b eee aas adatu SA Subroutine en0pth o oq ace ca aca aie a a ee ee a 20 Dubra SHIGE fo Oe eae ee A ee E a a e O E 30 Subrogtine usr sa o scce koe ra e hai eR eS oo Ezampe usri e ceca eaa dr dd poai AA 3 6 Subroutine snMemA s ssena aso russia sadawa The sn0ptB interface 4 1 Subroutines used by snOptB 4 2 Identifying structure in the objective and constraints 4 3 Problem dimensi ns ccoo lt lt dee eee eee bee o 4 4 Subroutine enDptB au eu e ew ee ee 4 5 User supplied routines required by snOptB
155. rs as the quantity labeled Optimal Major print level p Default 00001 This controls the amount of output to the Print and Summary files each major iteration Major print level 1 gives normal output for linear and nonlinear problems and Major 7 Optional parameters 77 print level 11 gives addition details of the Jacobian factorization that commences each major iteration In general the value being specified may be thought of as a binary number of the form Major print level JFDXbs where each letter stands for a digit that is either O or 1 as follows s a single line that gives a summary of each major iteration This entry in JFDXbs is not strictly binary since the summary line is printed whenever JFDXbs gt 1 b BASIS statistics i e information relating to the basis matrix whenever it is refactor ized This output is always provided if JFDXbs gt 10 Tk the nonlinear variables involved in the objective function or the constraints X D Tx the dual variables for the nonlinear constraints F F x the values of the nonlinear constraint functions J J x the Jacobian matrix To obtain output of any items JFDXbs set the corresponding digit to 1 otherwise to 0 If J 1 the Jacobian matrix will be output column wise at the start of each major iteration Column j will be preceded by the value of the corresponding variable x and a key to indicate whether the variable is basic superbasic or nonbasic Hence i
156. set of initial states for each variable x or for each variable and slack x s See next x n m usually contains a set of initial values for x or x s 1 For Cold starts Start Cold or Basis file with no basis file provided the first n elements of hs and x must be defined If there is no wish to provide special information you may set hs j 0 x j 0 0 for all j 1 n All variables will be eligible for the initial basis Less trivially to say that the optimal value of variable j will probably be equal to one of its bounds set hs j 4 and x j b1 j or hs j 5 and x j bu j as appropriate A CRASH procedure is used to select an initial basis The initial basis matrix will be triangular ignoring certain small entries in each column The values hs j 0 1 2 3 4 5 have the following meaning hs j State of variable j during CRASH 0 1 3 Eligible for the basis 3 is given preference 2 4 5 Ignored After CRASH variables for which hs j 2 are made superbasic Other entries not selected for the basis are made nonbasic at the value x j or the closest value inside their bounds See the description of hs below on exit 2 If Start Cold or Basis file and a basis file is provided hs and x need not be set 3 For Warm starts all of hs 1 n m must be 0 1 2 or 3 and all of x 1 n m must have values perhaps from some previous call 4 The snOptB interface 37
157. ss is detected by the simplex method when a nonbasic variable can be increased or decreased by an arbitrary amount without causing a basic variable to violate a bound A message prior to the EXIT message will give the index of the nonbasic variable Consider adding an upper or lower bound to the variable Also examine the constraints that have nonzeros in the associated column to see if they have been formulated as intended Very rarely the scaling of the problem could be so poor that numerical error will give an erroneous indication of unboundedness Consider using the Scale option For nonlinear problems SNOPT monitors both the size of the current objective function and the size of the change in the variables at each step If either of these is very large as judged by the Unbounded parameters see Section 7 7 the problem is terminated and declared unbounded To avoid large function values it may be necessary to impose bounds 96 SNOPT 7 4 User s Guide on some of the variables in order to keep them away from singularities in the nonlinear functions The second informational message indicates an abnormal termination while enforcing the limit on the constraint violations This exit implies that the objective is not bounded below in the feasible region defined by expanding the bounds by the value of the Violation limit EXIT 30 Resource limit error INFO 31 iteration limit reached INFO 32 major iteration limit reached INFO
158. ssian of the Lagrangian at x x contains the final estimate of the solution 6 3 User supplied subroutines for npOpt The user must provide subroutines that define the objective function and nonlinear con straints The objective function is defined by subroutine funobj and the nonlinear con straints are defined by subroutine funcon On every call these subroutines must return appropriate values of the objective and nonlinear constraints in fObj and fCon The user should also provide the available partial derivatives Any unspecified derivatives are ap proximated by finite differences see Section 7 for a discussion of the optional parameter Derivative level Just before either funobj or funcon is called each element of the cur rent gradient array g or gCon is initialized to a special value On exit any element that retains the given value is estimated by finite differences For maximum reliability it is preferable for the user to provide all partial derivatives see Chapter 8 of Gill Murray and Wright 15 for a detailed discussion If all gradients cannot be provided it is similarly advisable to provide as many as possible During the development of subroutines funobj and funcon the Verify parameter p 84 should be used to check the calculation of any known gradients 6 The npOpt interface 59 6 4 Subroutine funobj This subroutine must calculate the objective function fo x and optionally the gradient g x subrouti
159. standard Difference interval see below If i 0 or 1 SNOPT will estimate missing elements of the Jacobian For each column of the Jacobian one call to funcon is needed to estimate all missing elements in that column if any If Jacobian sparse and the sparsity pattern of the Jacobian happens to be Ok s where indicates known gradients and indicates unknown elements SNOPT will use one call to funcon to estimate the missing element in column 2 and another call to estimate both missing elements in column 3 No calls are needed for columns 1 and 4 At times central differences are used rather than forward differences Twice as many calls to funobj and funcon are then needed This is not under the user s control Derivative linesearch Default Nonderivative linesearch At each major iteration a linesearch is used to improve the merit function A Derivative linesearch uses safeguarded cubic interpolation and requires both function and gradient values to compute estimates of the step ax If some analytic derivatives are not provided or a Nonderivative linesearch is specified SNOPT employs a linesearch based upon safeguarded quadratic interpolation which does not require gradient evaluations A nonderivative linesearch can be slightly less robust on difficult problems and it is recommended that the default be used if the functions and derivatives can be computed at approximately the same cost If the gradients are ver
160. stion could there be more than one local optimum When the constraints are linear and the objective is known to be convex e g a sum of squares then all will be well if we are minimizing the objective a local minimum is a global minimum in the sense that no other point has a lower function value However many points could have the same objective value particularly if the objective is largely linear Conversely if we are maximizing a convex function a local maximum cannot be expected to be global unless there are sufficient constraints to confine the feasible region Similar statements could be made about nonlinear constraints defining convex or concave regions However the functions of a problem are more likely to be neither convex nor concave Our advice is always to specify a starting point that is as good an estimate as possible and to include reasonable upper and lower bounds on all variables in order to confine the solution to the specific region of interest We expect modelers to know something about their problem and to make use of that knowledge as they themselves know best One other caution about Optimality conditions satisfied Some of the variables or slacks may lie outside their bounds more than desired especially if scaling was requested Some information concerning the run can be obtained from the short summary given at the end of the print and summary files Here is an example from the problem Toy discussed in Section
161. t Subroutine funcon must define the Jacobian entries gCon in the same order except gCon does not contain elements in linear constraints 4 If your problem has no constraints or just bounds on the variables you may include a dummy free row with a single zero element by setting Aco1 1 0 0 indA 1 1 locA 1 1 and locA j 2 for j 2 n 1 This row is made free by setting its bounds to be bl n 1 infBnd and bu n 1 infBnd where infBnd is typically 1 0e 20 see the next paragraph b1 n m bu n m contain the lower and upper bounds l and u on the variables and slacks x s The first n entries of bl bu hs and x refer to the variables x The last m entries refer to the slacks s To specify non existent bounds set b1 j lt infBnd or bu j gt infBnd where infBnd is the Infinite Bound size default value 10 To fix the jth variable at x 6 set b1 j bu j 6 with 8 lt infBnd To make the ith constraint an equality si 6 set bl n i bu n i 6 For the data to be meaningful it is required that b1 j lt bu j for all j Names nName sometimes contains 8 character names for the variables and constraints If nName 1 Names is not used The printed solution will use generic names for the columns and row If nName n m Names j should contain the 8 character name of the jth variable j 1 n m If j n i the jth variable is the ith row hs n m usually contains a
162. tatus 1 snOpta is calling your subroutine for the first time Some data may need to be input or computed and saved If Status gt 2 snOpta is calling your subroutine for the last time You may wish to perform some additional computation on the final solution In general the last call is made with Status 2 INFO 10 where INFO is the integer returned by snOptA see p 19 In particular if Status 2 the current x is optimal if Status 3 the problem appears to be infeasible if Status 4 the problem appears to be unbounded if Status 5 an iterations limit was reached If the functions are expensive to evaluate it may be desirable to do nothing on the last call The first executable statement could be if Status ge 2 return n is n the number of variables as defined in the call to snOpta x n contains the variables x at which the problem functions are to be calculated The array x must not be altered needf nF f nF concern the calculation of f z nF is the length of the full vector F x f x Az as defined in the call to snOpta needf indicates if must be assigned during this call of usrfun e If needf 0 f is not required and is ignored e If needf gt 0 the components of f a corresponding to the nonlinear part of F x must be calculated and assigned to f If F x is linear and completely defined by Aj then the associated value of fi x is ignored and need not be assigned However if F x has a nonlinear
163. tolerance i e a tridiagonal matrix with entries 1 2 1 To help CRASH choose all m columns for the initial basis we would specify Crash tolerance t for some value of t gt 0 5 Derivative level 1 Default 3 This keyword is used by the snOptB snOptC and npOpt interfaces It should not be used when calling snOptA The keyword Derivative level specifies which nonlinear function gradients are known analytically and will be supplied to SNOPT by the user subroutines funobj and funcon 70 SNOPT 7 4 User s Guide 1 Meaning 3 All objective and constraint gradients are known 2 All constraint gradients are known but some or all components of the objective gra dient are unknown 1 The objective gradient is known but some or all of the constraint gradients are un known 0 Some components of the objective gradient are unknown and some of the constraint gradients are unknown The value 3 should be used whenever possible It is the most reliable and will usually be the most efficient If i 0 or 2 SNOPT will estimate the missing components of the objective gradient using finite differences This may simplify the coding of subroutine funobj However it could increase the total run time substantially since a special call to funobj is required for each missing element and there is less assurance that an acceptable solution will be located If the nonlinear variables are not well scaled it may be necessary to specify a non
164. torage allocated work arrays must have at least 500 elements not enough character storage not enough integer storage not enough real storage 4 The snOptB interface 39 Input arguments out of range 91 invalid input argument 92 basis file dimensions do not match this problem System error 141 wrong number of basic variables 142 error in basis package mincw miniw minrw say how much character integer and real storage is needed to solve ns the problem If Print level gt 0 these values are printed If snOptB terminates because of insufficient storage INFO 82 83 or 84 the values may be used to define better values of lencw leniw or lenrw If INFO 82 the work array cw lencw was too small snOptB may be called again with lencw mincw If INFO 83 or 84 the work arrays iw leniw or rw lenrw are too small snOptB may be called again with leniw or lenrw suitably larger than miniw or minrw The bigger the better because it is not certain how much storage the basis factorization needs is the final number of superbasic variables nInf sInf give the number and the sum of the infeasibilities of constraints that lie outside Obj 4 5 their bounds by more than the Minor feasibility tolerance before the solution is unscaled If any linear constraints are infeasible x minimizes the sum of the infeasibilities of the linear constraints subject to the upper and lower bounds being satisfied In this case nInf gi
165. ts are known Here we illustrate the use of snMemB using the same arrays for snMemB and snOptB Note that the snMemB arrays are used to store the optional parameters and so any temporary arrays must be copied into the final cw iw rw arrays in order to retain the options The work arrays must have length at least 500 so we define ltmpcw 500 ltmpiw 500 ltmprw 500 As with all SNOPT routines snInit must be called to set default options call snInit amp iPrint iSumm cw ltmpcw iw ltmpiw rw ltmprw This installs ltmpcw ltmpiw ltmprw as the default internal upper limits on the snOptB workspace see Total real workspace p 84 They are used to compute the boundaries of any user defined workspace in cw iw or rw The next step is to call snMemB to obtain mincw miniw minrw as estimates of the storage needed by snOptB call snMemB amp INFO m n neA negCon amp nnCon nnJac nnObj amp mincw miniw minrw amp cw ltmpcw iw ltmpiw rw ltmprw The output values of mincw miniw minrw may now be used to define the lengths of the snOptB work arrays lencw mincw leniw miniw lenrw minrw These values may be used in f90 or C to allocate the final work arrays for the problem One last step is needed before snOptB is called The current upper limits 1tmpcw ltmpiw ltmprw must be replaced by the estimates mincw miniw minrw This can be done using the option setting routine snSeti as follows
166. ulo i 80 SNOPT 7 4 User s Guide e Ifa reduced gradient is found that is larger than some dynamic tolerance the variable with the largest such reduced gradient of appropriate sign is selected to become superbasic If nothing is found the search continues on the next segments Aj 2 Lj 2 and so on e Partial price T or T 2 or T 3 may suit time stage models with T time periods Pivot tolerance t Default 2 3 3 7e 11 During solution of QP subproblems the pivot tolerance is used to prevent columns entering the basis if they would cause the basis to become almost singular e When z changes to ap for some search direction p a ratio test determines which component of x reaches an upper or lower bound first The corresponding element of p is called the pivot element e Elements of p are ignored and therefore cannot be pivot elements if they are smaller than the pivot tolerance t e It is common for two or more variables to reach a bound at essentially the same time In such cases the Feasibility tolerance provides some freedom to maximize the pivot element and thereby improve numerical stability An excessively small Feasibility tolerance should therefore not be specified e Toa lesser extent the Expand frequency also provides some freedom to maximize the pivot element Hence an excessively large Expand frequency should not be specified Print file f Print frequency k Default 100 If f gt 0 the Print fil
167. used by SNOPT increases from 30 to in steps of 30 k For nonlinear models the same procedure is used for iterations in which there is only one superbasic variable Cycling can occur only when the current solution is at a vertex of the feasible region Thus zero steps are allowed if there is more than one superbasic variable but otherwise positive steps are enforced Increasing k helps reduce the number of slightly infeasible nonbasic variables most of which are eliminated during a resetting procedure However it also diminishes the freedom to choose a large pivot element see Pivot tolerance Factorization frequency k Default 100 LP or 50 NP At most k basis changes will occur between factorizations of the basis matrix e With linear programs the basis factors are usually updated every iteration The default k is reasonable for typical problems Higher values up to k 100 say may be more efficient on problems that are extremely sparse and well scaled e When the objective function is nonlinear fewer basis updates will occur as an optimum is approached The number of iterations between basis factorizations will therefore increase During these iterations a test is made regularly according to the Check frequency to ensure that the general constraints are satisfied If necessary the basis will be refactorized before the limit of k updates is reached Feasible point see Minimize Function precision ER Default 3 7
168. ust be a row name In all cases row names indicate the associated slack variable and Value is recorded in x The key SB is an addition to the standard MPS format to allow for nonbasic solutions Notes on Punch Data 1 Variables are output in natural order For example on the first XL or XU line Name1 will be the first basic column and Name2 will be the first row whose slack is not basic The slack could be nonbasic or superbasic 2 LL lines are not output for nonbasic variables whose lower bound is zero 3 Superbasic slacks are output last Notes on Insert Data 1 Before an Insert file is read column variables are made nonbasic at their smallest bound in absolute magnitude and the slack variables are made basic 2 Preferably an Insert file should be an unmodified Punch file from an earlier run on the same problem If some rows have been added to the problem the Insert file need not be altered The slacks for the new rows will be in the basis 3 Entries will be ignored if Namel is already basic or superbasic XL and XU lines will be ignored if Name2 is not basic 4 SB lines may be added before the ENDATA line to specify additional superbasic columns or slacks 5 An SB line will not alter the status of Namei if the Superbasics limit has been reached However the associated Value will be retained 106 SNOPT 7 4 User s Guide 9 3 Dump and Load files These files are similar to Punch and Insert files but they
169. ution file accord ing to the Solution file option which may refer to the Print file if so desired Infinite bounds appear as 107 rather than None Other numerical values are output with format 1p e16 6 A Solution file is intended to be read from disk by a self contained program that extracts and saves certain values as required for possible further computation Typically the first 14 records would be ignored Each subsequent record may be read using 102 SNOPT 7 4 User s Guide format i8 2x 2a4 1x al 1x a8 5e16 6 i7 adapted to suit the occasion The end of the ROWS section is marked by a record that starts with a 1 and is otherwise blank If this and the next 4 records are skipped the COLUMNS section can then be read under the same format There should be no need for backspace statements 8 9 The SUMMARY file If Summary file gt 0 the following information is output to the Summary file It is a brief form of the Print file All output lines are less than 72 characters e The Begin line from the Specs file if any e The basis file loaded if any e A brief Major iteration log e A brief Minor iteration log e The EXIT condition and a summary of the final solution The following Summary file is from the example of Section 3 2 using Major print level 1 and Minor print level 0 SNOPT 7 4 1 1 Jan 2015 Nonzero derivs Jij 5 Non constant Jij s 4 SNJAC EXIT 100 Constant Jij s 1
170. valuated at points of the form x k app after they have already been evaluated satisfactorily at xy For any such 2 if you set m ode to 1 npOpt will reduce a and evaluate the functions again closer to k where they are more likely to be defined If for some reason you wish to terminate the current problem set mode lt 2 fObj must contain the computed value of fo x except perhaps if mode 1 g0bj must contain the assigned components of the gradient vector g x i e gObj j con tains the partial derivative Ofo x Ox except perhaps if mode 0 60 SNOPT 7 4 User s Guide 6 5 Subroutine funcon This subroutine must compute the nonlinear constraint functions f x and optionally their derivatives A dummy subroutine funcon must be provided if there are no nonlin ear constraints The ith row of the Jacobian gCon is the vector Of 0x1 0f Ox2 Of OXy subroutine funcon amp mode ncnln n ldg amp needc x fCon gCon nState integer amp mode ncnln n ldg nState needc double precision amp x n fCon gCon ldg On entry mode is set by npOpt to request values that must be assigned during each call of funcon mode will always have the value 2 if all elements of the Jacobian are available i e if Derivative level is either 2 or 3 see Section 7 If some elements of gCon are unspecified npOpt will call funcon with mode 0 1 or 2 e If mode 2 only the
171. ves the number of components of A x lying outside their bounds The nonlinear constraints are not evaluated Otherwise x minimizes the sum of the infeasibilities of the nonlinear constraints subject to the linear constraints and upper and lower bounds being satisfied In this case nInf gives the number of components of f x lying outside their bounds by more than the Minor feasibility tolerance Again this is before the solution is unscaled is the final value of the nonlinear part of the objective function If nInf 0 Obj is the nonlinear objective if any If nInf gt 0 but the linear constraints are feasible then Obj is the nonlinear objective If nInf gt 0 and the linear constraints are infeasible Obj is zero Note that Obj does not include contributions from the constant term ObjAdd or the objective row if there is one The final value of the objective being optimized is ObjAdd x n i0bj Obj where i0bj is the index of the objective row in A User supplied routines required by snOptB The user must provide subroutines to define the nonlinear parts of the objective function and nonlinear constraints They are passed to snOptB as external parameters funobj and funcon A dummy subroutine must be provided if the objective or constraints are purely linear Be careful when coding the call to snOptB the parameters are ordered alphabetically as funcon funobj The first call to each function routine is also in that order In ge
172. was reached by an earlier run on the same problem or a related problem with the same dimensions Perhaps the Iterations limit was previously too small or some other objective row is to be used or the bounds are different As illustrated in Figure 2 the following information is recorded in a New basis file 1 A line containing the problem name the iteration number when the file was created the status of the solution Optimal Soln Infeasible Unbounded Excess Itns Error Condn or Proceeding the number of infeasibilities and the current objective value or the sum of infeasibilities 2 A line containing the OBJECTIVE RHS RANGES and BOUNDS names M m the number of rows in the constraint matrix N n the number of columns in the constraint matrix and SB the number of superbasic variables Any undefined names will be printed with a blank entry 3 A set of n m 1 80 1 lines indicating the state of the n column variables and the m slack variables in that order One character hs j is recorded for each j 1 n m as follows written with format 80i1 104 SNOPT 7 4 User s Guide Manne 10 ITN 30 Optimal Soln NINF 0 OBJ 2 670098627178E 00 OBJ RHS RNG BND M 20 N 30 SB 7 03222222230333333333333333333100000000001111111111 21442990995402E 00 48787725533622E 00 67642838933707E 00 30400385655585E 00 77158182629954E 00 39521914186007E 00 58172235348761E 00 05000000000000E 00 12665036215043E 0
173. x ap If a variable is made superbasic during the current iteration SBS gt 0 Step will be the step to the nearest bound During Phase 2 the step can be greater than one only if the reduced Hessian is not positive definite nInf The number of infeasibilities after the present iteration This number will not increase unless the iterations are in elastic mode SumInf If nInf gt 0 this is sInf the sum of infeasibilities after the present iteration It usually decreases at each nonzero Step but if nInf decreases by 2 or more SumInf may occasionally increase In elastic mode the heading is changed to Composite Obj and the value printed decreases monotonically rgNorm The norm of the reduced gradient vector at the start of the iteration It is the norm of the vector with elements d for variables j in the superbasic set During Phase 2 this norm will be approximately zero after a unit step The heading is not printed if the problem is linear LPobjective QPobjective Elastic QPobj The QP objective function after the present iteration In elastic mode the heading is changed to Elastic QPobj In either case the value printed decreases monotonically SBS The variable jq selected by PRICE to be added to the superbasic set SBS The superbasic variable chosen to become nonbasic BS The variable removed from the basis if any to become nonbasic Pivot If column a replaces the rth column of the basis B Pivot is the rth element
174. x and optionally their gradients for a speci fied n vector x The arguments funcon and funobj must be declared as external in the routine that calls npOpt See Sections 6 3 6 5 istate nctotl is an integer array that need not be initialized if npOpt is called with the Cold Start option the default For a Warm start every element of istate must be set If npOpt has just been called on a problem with the same dimensions istate already contains valid values Otherwise istate j should indicate whether either of the constraints r a gt 4 or r a lt uj is expected to be active at a solution of DenseNP The ordering of istate is the same as for b1 bu and r x i e the first n components of istate refer to the upper and lower bounds on the variables the next nclin refer to the bounds on A x and the last ncnln refer to the bounds on f x Possible values for istate follow 0 Neither r x gt 4 nor r lt uj is expected to be active 1 r x gt L is expected to be active 2 rjlx lt uj is expected to be active 3 This may be used if uj Normally an equality constraint r x 0 uj is active at a solution The values 1 2 or 3 all have the same effect when b1 j bu j If necessary npOpt will override the user s specification of istate so that a poor choice will not cause the algorithm to fail gCon ldg is an array of dimension 1dg k for some k gt n If ncnln 0 gCon is not referen
175. xit conditions 80 100 occur during the first basis factorization the primal and dual variables x and pi will have their original input values Basis files are saved if requested but certain values in the printed solution will not be meaningful We describe each exit message from SNOPT and suggest possible courses of action EXIT 0 finished successfully INFO 1 optimality conditions satisfied INFO 2 feasible point found from option Feasible point only INFO 3 requested accuracy could not be achieved These messages usually indicate a successful run Basis files are saved and the solution is printed and or saved on the Solution file For INFO 1 the final point seems to be a solution of NP This means that x is feasible it satisfies the constraints to the accuracy requested by the Feasibility tolerance the reduced gradient is negligible the reduced costs are optimal and R is nonsingular In all cases some caution should be exercised For example if the objective value is much better than expected SNOPT may have obtained an optimal solution to the wrong problem Almost any item of data could have that effect if it has the wrong value Verifying that the problem has been defined correctly is one of the more difficult tasks for a model 94 SNOPT 7 4 User s Guide builder It is good practice in the function subroutines to print any data that is input during the first entry If nonlinearities exist one must always ask the que
176. y Dump file f Default 0 If f gt 0 the last solution obtained will be output to the file with unit number f in the format described in Section 9 3 The file will usually have been output previously as a Load file 72 SNOPT 7 4 User s Guide Elastic weight w Default 104 This keyword determines the initial weight y associated with problem NP y on p 10 At major iteration k if elastic mode has not yet started a scale factor o 1 g r lloo is defined from the current objective gradient Elastic mode is then started if the QP subproblem is infeasible or the QP dual variables are larger in magnitude than o w The QP is re solved in elastic mode with y opw Thereafter major iterations continue in elastic mode until they converge to a point that is optimal for problem NP y If the point is feasible for NP v w 0 it is declared locally optimal Otherwise y is increased by a factor of 10 and major iterations continue If y has already reached a maximum allowable value NP is declared locally infeasible Expand frequency k Default 10000 This option is part of the EXPAND anti cycling procedure 13 designed to make progress even on highly degenerate problems For linear models the strategy is to force a positive step at every iteration at the expense of violating the bounds on the variables by a small amount Suppose that the Minor feasibility tolerance is 6 Over a period of k iterations the tolerance actually
177. y expensive relative to the functions a nonderivative linesearch may give a significant decrease in computation time If Nonderivative linesearch is selected snOptA signals the evaluation of the line search by calling usrfun with needG 0 Once the linesearch is completed the problem functions are called again with needF 0 and needG 0 If the potential savings provided by a nonderivative linesearch are to be realized it is essential that usrfun be coded so that the derivatives are not computed when needG 0 7 Optional parameters 71 The selection of Nonderivative linesearch for snOptB means that funobj and funcon are called with mode 0 in the linesearch Once the linesearch is completed the problem functions are called again with mode 2 If the potential savings provided by a nonderivative linesearch are to be realized it is essential that funobj and funcon be coded so that the derivatives are not computed when mode 0 Derivative option 1 Default 1 This option is intended for snOptA only and should not be used with any other interface The Derivative option specifies which nonlinear function gradients are known analytically and will be supplied to snOptA by the user subroutine usrfun 1 Meaning O Some problem derivatives are unknown 1 All problem derivatives are known The value 1 should be used whenever possible It is the most reliable and will usually be the most efficient If i 0 snOptaA will estimate

Download Pdf Manuals

image

Related Search

Related Contents

General Operators Manual v01_0      Un train pour Johannesburg  Samsung Galaxy mini 2 User Manual    Benutzerhandbuch  IE-78K0S-NS インサーキット・エミュレータ UM  Mac OS ® X Snow Leopard  Savi® Office WO100 Sistema de Auricular Sem Fios  

Copyright © All rights reserved.
Failed to retrieve file