[ KAIST ] in KIDS 글 쓴 이(By): guest (guest) <210.113.56.232> 날 짜 (Date): 2003년 7월 12일 토요일 오전 09시 20분 10초 제 목(Title): Re: constraint에 대한 질문 하나. MC로 풀려는 이유가 특별한 것이 없다면, 삽질 맞아요. 좋은 최적화 알고리즘 많은데, 계산량 많은 MC로 풀면 같은 문제를 푸는 더 많은 시간과 노력이 들어갑니다. @ 매트랩 constr 함수 추천. 아래는 help constr 에서 나온 결과. >> help constr CONSTR Finds the constrained minimum of a function of several variables. CONSTR has been replaced with FMINCON. CONSTR currently works but will be removed in the future. Use FMINCON instead. X=CONSTR('FUN',X0) starts at X0 and finds a constrained minimum to the function which is described in FUN (usually an M-file: FUN.M). The function 'FUN' should return two arguments: a scalar value of the function to be minimized, F, and a matrix of constraints, G: [F,G]=FUN(X). F is minimized such that G <= zeros(size(G)). X=CONSTR('FUN',X,OPTIONS) allows a vector of optional parameters to be defined. For more information type HELP FOPTIONS. X=CONSTR('FUN',X,OPTIONS,VLB,VUB) defines a set of lower and upper bounds on the design variables, X, so that the solution is always in the range VLB <= X <= VUB. X=CONSTR('FUN',X,OPTIONS,VLB,VUB,'GRADFUN') allows a function 'GRADFUN' to be entered which returns the partial derivatives of the function and the constraints at X: [gf,GC] = GRADFUN(X). Use OPTIONS(9)=1 to check analytic gradients in GRADFUN against numeric gradients during the first iteration. X=CONSTR('FUN',X,OPTIONS,VLB,VUB,'GRADFUN',P1,P2,...) passes the problem-dependent parameters P1,P2,... directly to the functions FUN and GRADFUN: FUN(X,P1,P2,...) and GRADFUN(X,P1,P2,...). Pass empty matrices for OPTIONS, VLB, VUB, and 'GRADFUN' to use the default values. [X,OPTIONS]=CONSTR('FUN',X0,...) returns the parameters used in the optimization method. For example, OPTIONS(10) contains the number of function evaluations used. [X,OPTIONS,LAMBDA]=CONSTR('FUN',X0,...) returns the Lagrange multipliers at the solution X in the vector LAMBDA. [X,OPTIONS,LAMBDA,HESS]=CONSTR('FUN',X0,...) returns the quasi-Newton approximation to the Hessian matrix at the solution X. |