²é¿´: 3001  |  »Ø¸´: 4

kubilife

гæ (СÓÐÃûÆø)

[½»Á÷] matlabÓÅ»¯º¯Êý£¨±ÈÈçfmincon£©µÄ¾ßÌåʵÏÖ´úÂëÄܲ»ÄÜ¿´µ½ ÒÑÓÐ1È˲ÎÓë

matlabÓÅ»¯º¯Êý£¨±ÈÈçfmincon£©µÄ¾ßÌåʵÏÖ´úÂëÄܲ»ÄÜ¿´µ½£¬Èç¹û²»Äܵϰ£¬cpexµÄËã·¨¾ßÌå´úÂëÓа취¿´µ½Âð£¿ÏëѧϰÕâЩ³ÉÊìÈí¼þµÄË㷨ʵÏÖ´úÂë
»Ø¸´´ËÂ¥

» ²ÂÄãϲ»¶

» ±¾Ö÷ÌâÏà¹Ø¼ÛÖµÌùÍÆ¼ö£¬¶ÔÄúͬÑùÓаïÖú:

ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

wurongjun

ר¼Ò¹ËÎÊ (Ö°Òµ×÷¼Ò)

¡ï
Сľ³æ: ½ð±Ò+0.5, ¸ø¸öºì°ü£¬Ð»Ð»»ØÌû
¿ÉÒÔ¿´µ½!
ÃüÁî´°¿Ú:  type fmincon
¼´¿É¿´µ½´úÂë!
ÉÆ¶ñµ½Í·ÖÕÓб¨,È˼äÕýµÀÊDz×É£.
2Â¥2016-05-27 18:24:41
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

kubilife

гæ (СÓÐÃûÆø)

ÒýÓûØÌû:
2Â¥: Originally posted by wurongjun at 2016-05-27 18:24:41
¿ÉÒÔ¿´µ½!
ÃüÁî´°¿Ú:  type fmincon
¼´¿É¿´µ½´úÂë!

¿´ÆðÀ´ÂÒÂҵģ¬¸Ð¾õ×îºËÐĵĴúÂëÊÇ¿´²»µ½µÄ

[ ·¢×ÔÊÖ»ú°æ http://muchong.com/3g ]
3Â¥2016-05-27 23:33:51
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

wurongjun

ר¼Ò¹ËÎÊ (Ö°Òµ×÷¼Ò)

¡ï
Сľ³æ: ½ð±Ò+0.5, ¸ø¸öºì°ü£¬Ð»Ð»»ØÌû
ÒýÓûØÌû:
3Â¥: Originally posted by kubilife at 2016-05-27 23:33:51
¿´ÆðÀ´ÂÒÂҵģ¬¸Ð¾õ×îºËÐĵĴúÂëÊÇ¿´²»µ½µÄ
...

ÄÚÖú¯ÊýµÄ¿´²»µ½!
Õâ¸ö¿ÉÒÔ¿´µ½°¡!
function [X,FVAL,EXITFLAG,OUTPUT,LAMBDA,GRAD,HESSIAN] = fmincon(FUN,X,A,B,Aeq,Beq,LB,UB,NONLCON,options,varargin)
%FMINCON Finds the constrained minimum of a function of several variables.
%   FMINCON solves problems of the form:
%       min F(X)  subject to:  A*X  <= B, Aeq*X  = Beq (linear constraints)
%        X                       C(X) <= 0, Ceq(X) = 0   (nonlinear constraints)
%                                LB <= X <= UB            
%                                                           
%   X=FMINCON(FUN,X0,A,B) starts at X0 and finds a minimum X to the function
%   FUN, subject to the linear inequalities A*X <= B. FUN accepts input X and
%   returns a scalar function value F evaluated at X. X0 may be a scalar,
%   vector, or matrix.
%
%   X=FMINCON(FUN,X0,A,B,Aeq,Beq) minimizes FUN subject to the linear equalities
%   Aeq*X = Beq as well as A*X <= B. (Set A=[] and B=[] if no inequalities exist.)
%
%   X=FMINCON(FUN,X0,A,B,Aeq,Beq,LB,UB) defines a set of lower and upper
%   bounds on the design variables, X, so that the solution is in
%   the range LB <= X <= UB. Use empty matrices for LB and UB
%   if no bounds exist. Set LB(i) = -Inf if X(i) is unbounded below;
%   set UB(i) = Inf if X(i) is unbounded above.
%
%   X=FMINCON(FUN,X0,A,B,Aeq,Beq,LB,UB,NONLCON) subjects the minimization to the
%   constraints defined in NONLCON. The function NONLCON accepts X and returns
%   the vectors C and Ceq, representing the nonlinear inequalities and equalities
%   respectively. FMINCON minimizes FUN such that C(X)<=0 and Ceq(X)=0.
%   (Set LB=[] and/or UB=[] if no bounds exist.)
%
%   X=FMINCON(FUN,X0,A,B,Aeq,Beq,LB,UB,NONLCON,OPTIONS) minimizes with the
%   default optimization parameters replaced by values in the structure OPTIONS,
%   an argument created with the OPTIMSET function.  See OPTIMSET for details.  Used
%   options are Display, TolX, TolFun, TolCon, DerivativeCheck, Diagnostics, GradObj,
%   GradConstr, Hessian, MaxFunEvals, MaxIter, DiffMinChange and DiffMaxChange,
%   LargeScale, MaxPCGIter, PrecondBandWidth, TolPCG, TypicalX, Hessian, HessMult,
%   HessPattern. Use the GradObj option to specify that FUN also returns a second
%   output argument G that is the partial derivatives of the function df/dX, at the
%   point X. Use the Hessian option to specify that FUN also returns a third output
%   argument H that is the 2nd partial derivatives of the function (the Hessian) at the
%   point X.  The Hessian is only used by the large-scale method, not the
%   line-search method. Use the GradConstr option to specify that NONLCON also
%   returns third and fourth output arguments GC and GCeq, where GC is the partial
%   derivatives of the constraint vector of inequalities C, and GCeq is the partial
%   derivatives of the constraint vector of equalities Ceq. Use OPTIONS = [] as a
%   place holder if no options are set.
%  
%   X=FMINCON(FUN,X0,A,B,Aeq,Beq,LB,UB,NONLCON,OPTIONS,P1,P2,...) passes the
%   problem-dependent parameters P1,P2,... directly to the functions FUN
%   and NONLCON: feval(FUN,X,P1,P2,...) and feval(NONLCON,X,P1,P2,...).  Pass
%   empty matrices for A, B, Aeq, Beq, OPTIONS, LB, UB, and NONLCON to use the
%   default values.
%
%   [X,FVAL]=FMINCON(FUN,X0,...) returns the value of the objective
%   function FUN at the solution X.
%
%   [X,FVAL,EXITFLAG]=FMINCON(FUN,X0,...) returns a string EXITFLAG that
%   describes the exit condition of FMINCON.  
%   If EXITFLAG is:
%      > 0 then FMINCON converged to a solution X.
%      0   then the maximum number of function evaluations was reached.
%      < 0 then FMINCON did not converge to a solution.
%   
%   [X,FVAL,EXITFLAG,OUTPUT]=FMINCON(FUN,X0,...) returns a structure
%   OUTPUT with the number of iterations taken in OUTPUT.iterations, the number
%   of function evaluations in OUTPUT.funcCount, the algorithm used in
%   OUTPUT.algorithm, the number of CG iterations (if used) in OUTPUT.cgiterations,
%   and the first-order optimality (if used) in OUTPUT.firstorderopt.
%
%   [X,FVAL,EXITFLAG,OUTPUT,LAMBDA]=FMINCON(FUN,X0,...) returns the Lagrange multipliers
%   at the solution X: LAMBDA.lower for LB, LAMBDA.upper for UB, LAMBDA.ineqlin is
%   for the linear inequalities, LAMBDA.eqlin is for the linear equalities,
%   LAMBDA.ineqnonlin is for the nonlinear inequalities, and LAMBDA.eqnonlin
%   is for the nonlinear equalities.
%
%   [X,FVAL,EXITFLAG,OUTPUT,LAMBDA,GRAD]=FMINCON(FUN,X0,...) returns the value of
%   the gradient of FUN at the solution X.
%
%   [X,FVAL,EXITFLAG,OUTPUT,LAMBDA,GRAD,HESSIAN]=FMINCON(FUN,X0,...) returns the
%   value of the HESSIAN of FUN at the solution X.
%
%   Examples
%     FUN can be specified using @:
%        X = fmincon(@humps,...)
%     In this case, F = humps(X) returns the scalar function value F of the HUMPS function
%     evaluated at X.
%
%     FUN can also be an inline object:
%        X = fmincon(inline('3*sin(x(1))+exp(x(2))'),[1;1],[],[],[],[],[0 0])
%     returns X = [0;0].
%
%   See also OPTIMSET, FMINUNC, FMINBND, FMINSEARCH, @, INLINE.

%   Copyright 1990-2001 The MathWorks, Inc.
%   $Revision: 1.27 $  $Date: 2001/04/06 19:26:10 $

defaultopt = struct('Display','final','LargeScale','on', ...
   'TolX',1e-6,'TolFun',1e-6,'TolCon',1e-6,'DerivativeCheck','off',...
   'Diagnostics','off',...
   'GradObj','off','GradConstr','off',...
   'HessMult',[],...% HessMult [] by default
   'Hessian','off','HessPattern','sparse(ones(numberOfVariables))',...
   'MaxFunEvals','100*numberOfVariables',...
   'MaxSQPIter',Inf,...
   'DiffMaxChange',1e-1,'DiffMinChange',1e-8,...
   'PrecondBandWidth',0,'TypicalX','ones(numberOfVariables,1)',...
   'MaxPCGIter','max(1,floor(numberOfVariables/2))', ...
   'TolPCG',0.1,'MaxIter',400);
% If just 'defaults' passed in, return the default options in X
if nargin==1 & nargout <= 1 & isequal(FUN,'defaults')
   X = defaultopt;
   return
end

large = 'large-scale';
medium = 'medium-scale';

if nargin < 4, error('FMINCON requires at least four input arguments'); end
if nargin < 10, options=[];
   if nargin < 9, NONLCON=[];
      if nargin < 8, UB = [];
         if nargin < 7, LB = [];
            if nargin < 6, Beq=[];
               if nargin < 5, Aeq =[];
               end, end, end, end, end, end
if isempty(NONLCON) & isempty(A) & isempty(Aeq) & isempty(UB) & isempty(LB)
   error('FMINCON is for constrained problems. Use FMINUNC for unconstrained problems.')
end

if nargout > 4
   computeLambda = 1;
else
   computeLambda = 0;
end

caller='constr';
lenVarIn = length(varargin);
XOUT=X(;
numberOfVariables=length(XOUT);

switch optimget(options,'Display',defaultopt,'fast')
case {'off','none'}
   verbosity = 0;
case 'iter'
   verbosity = 2;
case 'final'
   verbosity = 1;
otherwise
   verbosity = 1;
end

% Set to column vectors
B = B(;
Beq = Beq(;

[XOUT,l,u,msg] = checkbounds(XOUT,LB,UB,numberOfVariables);
if ~isempty(msg)
   EXITFLAG = -1;
   [FVAL,OUTPUT,LAMBDA,GRAD,HESSIAN] = deal([]);
   X(=XOUT;
   if verbosity > 0
      disp(msg)
   end
   return
end
lFinite = l(~isinf(l));
uFinite = u(~isinf(u));


meritFunctionType = 0;
mtxmpy = optimget(options,'HessMult',defaultopt,'fast');
if isequal(mtxmpy,'hmult')
   warnstr = sprintf('%s\n%s\n%s\n', ...
            'Potential function name clash with a Toolbox helper function:',...
            'Use a name besides ''hmult'' for your HessMult function to',...
            'avoid errors or unexpected results.');
   warning(warnstr)
end

diagnostics = isequal(optimget(options,'Diagnostics',defaultopt,'fast'),'on');
gradflag =  strcmp(optimget(options,'GradObj',defaultopt,'fast'),'on');
hessflag = strcmp(optimget(options,'Hessian',defaultopt,'fast'),'on');
if isempty(NONLCON)
   constflag = 0;
else
   constflag = 1;
end
gradconstflag =  strcmp(optimget(options,'GradConstr',defaultopt,'fast'),'on');
line_search = strcmp(optimget(options,'LargeScale',defaultopt,'fast'),'off'); % 0 means trust-region, 1 means line-search

% Convert to inline function as needed
if ~isempty(FUN)  % will detect empty string, empty matrix, empty cell array
   [funfcn, msg] = optimfcnchk(FUN,'fmincon',length(varargin),gradflag,hessflag);
else
   errmsg = sprintf('%s\n%s', ...
      'FUN must be a function or an inline object;', ...
      ' or, FUN may be a cell array that contains these type of objects.');
   error(errmsg)
end

if constflag % NONLCON is non-empty
   [confcn, msg] = optimfcnchk(NONLCON,'fmincon',length(varargin),gradconstflag,[],1);
else
   confcn{1} = '';
end

[rowAeq,colAeq]=size(Aeq);
% if only l and u then call sfminbx
if ~line_search & isempty(NONLCON) & isempty(A) & isempty(Aeq) & gradflag
   OUTPUT.algorithm = large;
   % if only Aeq beq and Aeq has as many columns as rows, then call sfminle
elseif ~line_search & isempty(NONLCON) & isempty(A) & isempty(lFinite) & isempty(uFinite) & gradflag ...
      & colAeq >= rowAeq
   OUTPUT.algorithm = large;
elseif ~line_search
   warning(['Large-scale (trust region) method does not currently solve this type of problem,',...
         sprintf('\n'), 'switching to medium-scale (line search).'])
   if isequal(funfcn{1},'fungradhess')
      funfcn{1}='fungrad';
      warnstr = sprintf('%s\n%s\n', ...
         'Medium-scale method is a Quasi-Newton method and does not use',...
         'analytic Hessian. Hessian flag in options will be ignored.');
      warning(warnstr)
      
   elseif  isequal(funfcn{1},'fun_then_grad_then_hess')
      funfcn{1}='fun_then_grad';
      warnstr = sprintf('%s\n%s\n', ...
         'Medium-scale method is a Quasi-Newton method and does not use',...
         'analytic Hessian. Hessian flag in options will be ignored.');
      warning(warnstr)
   end   
   hessflag = 0;
   OUTPUT.algorithm = medium;
elseif line_search
   OUTPUT.algorithm = medium;
   if issparse(Aeq) | issparse(A)
      warning('Cannot use sparse matrices with medium-scale method: converting to full.')
   end
   if line_search & hessflag % conflicting options
      hessflag = 0;
      warnstr = sprintf('%s\n%s\n', ...
         'Medium-scale method is a Quasi-Newton method and does not use analytic Hessian.',...
         'Hessian flag in options will be ignored (user-supplied Hessian will not be used).');
      warning(warnstr)
      if isequal(funfcn{1},'fungradhess')
         funfcn{1}='fungrad';
      elseif  isequal(funfcn{1},'fun_then_grad_then_hess')
         funfcn{1}='fun_then_grad';
      end   
   end
   % else call nlconst
else
   error('Unrecognized combination of OPTIONS flags and calling sequence.')
end


lenvlb=length(l);
lenvub=length(u);

if isequal(OUTPUT.algorithm,medium)
   CHG = 1e-7*abs(XOUT)+1e-7*ones(numberOfVariables,1);
   i=1:lenvlb;
   lindex = XOUT(i)<l(i);
   if any(lindex),
      XOUT(lindex)=l(lindex)+1e-4;
   end
   i=1:lenvub;
   uindex = XOUT(i)>u(i);
   if any(uindex)
      XOUT(uindex)=u(uindex);
      CHG(uindex)=-CHG(uindex);
   end
   X( = XOUT;
else
   arg = (u >= 1e10); arg2 = (l <= -1e10);
   u(arg) = inf*ones(length(arg(arg>0)),1);
   l(arg2) = -inf*ones(length(arg2(arg2>0)),1);
   if min(min(u-XOUT),min(XOUT-l)) < 0,
      XOUT = startx(u,l);
      X( = XOUT;
   end
end

% Evaluate function
GRAD=zeros(numberOfVariables,1);
HESS = [];

switch funfcn{1}
case 'fun'
   try
      f = feval(funfcn{3},X,varargin{:});
   catch
      errmsg = sprintf('%s\n%s\n\n%s',...
         'FMINCON cannot continue because user supplied objective function', ...
         ' failed with the following error:', lasterr);
      error(errmsg);
   end
case 'fungrad'
   try
      [f,GRAD(] = feval(funfcn{3},X,varargin{:});
   catch
      errmsg = sprintf('%s\n%s\n\n%s',...
         'FMINCON cannot continue because user supplied objective function', ...
         ' failed with the following error:', lasterr);
      error(errmsg);
   end
case 'fungradhess'
   try
      [f,GRAD(,HESS] = feval(funfcn{3},X,varargin{:});
   catch
      errmsg = sprintf('%s\n%s\n\n%s',...
         'FMINCON cannot continue because user supplied objective function', ...
         ' failed with the following error:', lasterr);
      error(errmsg);
   end
case 'fun_then_grad'
   try
      f = feval(funfcn{3},X,varargin{:});
   catch
      errmsg = sprintf('%s\n%s\n\n%s',...
         'FMINCON cannot continue because user supplied objective function', ...
         ' failed with the following error:', lasterr);
      error(errmsg);
   end
   try
      GRAD( = feval(funfcn{4},X,varargin{:});
   catch
      errmsg = sprintf('%s\n%s\n\n%s',...
         'FMINCON cannot continue because user supplied objective gradient function', ...
         ' failed with the following error:', lasterr);
      error(errmsg);
   end
case 'fun_then_grad_then_hess'
   try
      f = feval(funfcn{3},X,varargin{:});
   catch
      errmsg = sprintf('%s\n%s\n\n%s',...
         'FMINCON cannot continue because user supplied objective function', ...
         ' failed with the following error:', lasterr);
      error(errmsg);
   end
   try
      GRAD( = feval(funfcn{4},X,varargin{:});
   catch
      errmsg = sprintf('%s\n%s\n\n%s',...
         'FMINCON cannot continue because user supplied objective gradient function', ...
         ' failed with the following error:', lasterr);
      error(errmsg);
   end
   try
      HESS = feval(funfcn{5},X,varargin{:});
   catch
      errmsg = sprintf('%s\n%s\n\n%s',...
         'FMINCON cannot continue because user supplied objective Hessian function', ...
         ' failed with the following error:', lasterr);
      error(errmsg);
   end
otherwise
   error('Undefined calltype in FMINCON');
end

% Evaluate constraints
switch confcn{1}
case 'fun'
   try
      [ctmp,ceqtmp] = feval(confcn{3},X,varargin{:});
      c = ctmp(; ceq = ceqtmp(;
      cGRAD = zeros(numberOfVariables,length(c));
      ceqGRAD = zeros(numberOfVariables,length(ceq));
   catch
      if findstr(xlate('Too many output arguments'),lasterr)
          if isa(confcn{3},'inline')
              errmsg = sprintf('%s%s%s\n%s\n%s\n%s', ...
                  'The inline function ',formula(confcn{3}),' representing the constraints',...
                  ' must return two outputs: the nonlinear inequality constraints and', ...
                  ' the nonlinear equality constraints.  At this time, inline objects may',...
                  ' only return one output argument: use an M-file function instead.');
          elseif isa(confcn{3},'function_handle')
              errmsg = sprintf('%s%s%s\n%s%s', ...
                  'The constraint function ',func2str(confcn{3}),' must return two outputs:',...
                  ' the nonlinear inequality constraints and', ...
                  ' the nonlinear equality constraints.');
          else
              errmsg = sprintf('%s%s%s\n%s%s', ...
                  'The constraint function ',confcn{3},' must return two outputs:',...
                  ' the nonlinear inequality constraints and', ...
                  ' the nonlinear equality constraints.');
          end
         error(errmsg)
      else
         errmsg = sprintf('%s\n%s\n\n%s',...
            'FMINCON cannot continue because user supplied nonlinear constraint function', ...
            ' failed with the following error:', lasterr);
         error(errmsg);
      end
   end
   
case 'fungrad'
   try
      [ctmp,ceqtmp,cGRAD,ceqGRAD] = feval(confcn{3},X,varargin{:});
      c = ctmp(; ceq = ceqtmp(;
   catch
      errmsg = sprintf('%s\n%s\n\n%s',...
         'FMINCON cannot continue because user supplied nonlinear constraint function', ...
         ' failed with the following error:', lasterr);
      error(errmsg);
   end
case 'fun_then_grad'
   try
      [ctmp,ceqtmp] = feval(confcn{3},X,varargin{:});
      c = ctmp(; ceq = ceqtmp(;
      [cGRAD,ceqGRAD] = feval(confcn{4},X,varargin{:});
   catch
      errmsg = sprintf('%s\n%s%s\n\n%s',...
         'FMINCON cannot continue because user supplied nonlinear constraint function', ...
         'or nonlinear constraint gradient function',...
         ' failed with the following error:', lasterr);
      error(errmsg);
   end
case ''
   c=[]; ceq =[];
   cGRAD = zeros(numberOfVariables,length(c));
   ceqGRAD = zeros(numberOfVariables,length(ceq));
otherwise
   error('Undefined calltype in FMINCON');
end

non_eq = length(ceq);
non_ineq = length(c);
[lin_eq,Aeqcol] = size(Aeq);
[lin_ineq,Acol] = size(A);
[cgrow, cgcol]= size(cGRAD);
[ceqgrow, ceqgcol]= size(ceqGRAD);

eq = non_eq + lin_eq;
ineq = non_ineq + lin_ineq;

if ~isempty(Aeq) & Aeqcol ~= numberOfVariables
   error('Aeq has the wrong number of columns.')
end
if ~isempty(A) & Acol ~= numberOfVariables
   error('A has the wrong number of columns.')
end
if  cgrow~=numberOfVariables & cgcol~=non_ineq
   error('Gradient of the nonlinear inequality constraints is the wrong size.')
end
if ceqgrow~=numberOfVariables & ceqgcol~=non_eq
   error('Gradient of the nonlinear equality constraints is the wrong size.')
end

if diagnostics > 0
   % Do diagnostics on information so far
   msg = diagnose('fmincon',OUTPUT,gradflag,hessflag,constflag,gradconstflag,...
      line_search,options,defaultopt,XOUT,non_eq,...
      non_ineq,lin_eq,lin_ineq,l,u,funfcn,confcn,f,GRAD,HESS,c,ceq,cGRAD,ceqGRAD);
end


% call algorithm
if isequal(OUTPUT.algorithm,medium)
   [X,FVAL,lambda,EXITFLAG,OUTPUT,GRAD,HESSIAN]=...
      nlconst(funfcn,X,l,u,full(A),B,full(Aeq),Beq,confcn,options,defaultopt, ...
      verbosity,gradflag,gradconstflag,hessflag,meritFunctionType,...
      CHG,f,GRAD,HESS,c,ceq,cGRAD,ceqGRAD,varargin{:});
   LAMBDA=lambda;
   
   
else
   if (isequal(funfcn{1}, 'fun_then_grad_then_hess') | isequal(funfcn{1}, 'fungradhess'))
      Hstr=[];
   elseif (isequal(funfcn{1}, 'fun_then_grad') | isequal(funfcn{1}, 'fungrad'))
      n = length(XOUT);
      Hstr = optimget(options,'HessPattern',defaultopt,'fast');
      if ischar(Hstr)
         if isequal(lower(Hstr),'sparse(ones(numberofvariables))')
            Hstr = sparse(ones(n));
         else
            error('Option ''HessPattern'' must be a matrix if not the default.')
         end
      end
   end
   
   if isempty(Aeq)
      [X,FVAL,LAMBDA,EXITFLAG,OUTPUT,GRAD,HESSIAN] = ...
         sfminbx(funfcn,X,l,u,verbosity,options,defaultopt,computeLambda,f,GRAD,HESS,Hstr,varargin{:});
   else
      [X,FVAL,LAMBDA,EXITFLAG,OUTPUT,GRAD,HESSIAN] = ...
         sfminle(funfcn,X,sparse(Aeq),Beq,verbosity,options,defaultopt,computeLambda,f,GRAD,HESS,Hstr,varargin{:});
   end
end
ÉÆ¶ñµ½Í·ÖÕÓб¨,È˼äÕýµÀÊDz×É£.
4Â¥2016-05-28 19:00:25
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

kubilife

гæ (СÓÐÃûÆø)

ÒýÓûØÌû:
4Â¥: Originally posted by wurongjun at 2016-05-28 19:00:25
ÄÚÖú¯ÊýµÄ¿´²»µ½!
Õâ¸ö¿ÉÒÔ¿´µ½°¡!
function  = fmincon(FUN,X,A,B,Aeq,Beq,LB,UB,NONLCON,options,varargin)
%FMINCON Finds the constrained minimum of a function of several variables.
%   FMINCON sol ...

àÅ£¬Õâ¸ö¿ÉÒÔ¿´µ½£¬µ«ÊÇÕâÀïÃæÆäÖÐÓÐЩ×Óº¯ÊýºÃÏñ¾Í¿´²»µ½ÁË£¬matlab»¹ºÃµã£¬cplexµÄ×Óº¯Êý´ò¿ª¾ÍÖ»ÓÐ˵Ã÷Îĵµ
5Â¥2016-05-28 19:23:48
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû
Ïà¹Ø°æ¿éÌø×ª ÎÒÒª¶©ÔÄÂ¥Ö÷ kubilife µÄÖ÷Ìâ¸üÐÂ
×î¾ßÈËÆøÈÈÌûÍÆ¼ö [²é¿´È«²¿] ×÷Õß »Ø/¿´ ×îºó·¢±í
[¿¼ÑÐ] 323Çóµ÷¼Á +3 ÍÝСͰ 2026-03-18 3/150 2026-03-20 22:54 by JourneyLucky
[¿¼ÑÐ] Çóµ÷¼Á£¬Ò»Ö¾Ô¸:ÄϾ©º½¿Õº½Ìì´óѧ´óѧ £¬080500²ÄÁÏ¿ÆÑ§Ó빤³Ìѧ˶£¬×Ü·Ö289·Ö +4 @taotao 2026-03-19 4/200 2026-03-20 22:14 by JourneyLucky
[¿¼ÑÐ] ҩѧ383 Çóµ÷¼Á +3 ҩѧchy 2026-03-15 5/250 2026-03-20 22:11 by ÔÆÓÎÖØÑô
[¿¼ÑÐ] Ò»Ö¾Ô¸»ªÖÐũҵ071010£¬×Ü·Ö320Çóµ÷¼Á +3 À§À§À§À§À¤À¤ 2026-03-20 3/150 2026-03-20 20:38 by ѧԱ8dgXkO
[¿¼ÑÐ] ²ÄÁÏѧÇóµ÷¼Á +4 Stella_Yao 2026-03-20 4/200 2026-03-20 20:28 by ms629
[¿¼ÑÐ] 281Çóµ÷¼Á£¨0805£© +14 ÑÌÏ«Ò亣 2026-03-16 25/1250 2026-03-20 15:47 by yuncha
[¿¼ÑÐ] ÄÜÔ´²ÄÁÏ»¯Ñ§¿ÎÌâ×éÕÐÊÕ˶ʿÑо¿Éú8-10Ãû +5 ÍÑÓ±¶ø³ö 2026-03-16 14/700 2026-03-20 09:30 by kkcoco25
[¿¼ÑÐ] Çóµ÷¼Á +3 °µÓ¿afhb 2026-03-16 3/150 2026-03-20 00:28 by ºÓÄÏ´óѧУÓÑ
[ÂÛÎÄͶ¸å] ÉêÇë»Ø¸åÑÓÆÚÒ»¸öÔ£¬±à¼­Í¬ÒâÁË¡£µ«ÏµÍ³ÉϵÄʱ¼äû±ä£¬¸ø±à¼­ÓÖдÓʼþÁË£¬Ã»»Ø¸´ 10+3 wangf9518 2026-03-17 4/200 2026-03-19 23:55 by babero
[¿¼ÑÐ] ²ÄÁÏÓ뻯¹¤Çóµ÷¼Á +7 Ϊѧ666 2026-03-16 7/350 2026-03-19 14:48 by ¾¡Ë´Ò¢1
[¿¼ÑÐ] 085600²ÄÁÏÓ뻯¹¤Çóµ÷¼Á +6 Ð÷ÐÒÓë×Ó 2026-03-17 6/300 2026-03-19 13:27 by houyaoxu
[¿¼ÑÐ] Ò»Ö¾Ô¸985£¬±¾¿Æ211£¬0817»¯Ñ§¹¤³ÌÓë¼¼Êõ319Çóµ÷¼Á +10 Liwangman 2026-03-15 10/500 2026-03-19 10:25 by Î޼ʵIJÝÔ­
[¿¼ÑÐ] 311Çóµ÷¼Á +11 ¶¬Ê®Èý 2026-03-15 12/600 2026-03-18 14:36 by ÐÇ¿ÕÐÇÔÂ
[¿¼ÑÐ] 0854£¬¼ÆËã»úÀàÕÐÊÕµ÷¼Á +3 ºúÀ±ÌÀ·ÅÌÇ 2026-03-15 6/300 2026-03-18 12:09 by Éϰ¶Éϰ¶¡­¡­..
[¿¼ÑÐ] 301Çóµ÷¼Á +9 yyÒªÉϰ¶Ñ½ 2026-03-17 9/450 2026-03-18 08:58 by Î޼ʵIJÝÔ­
[¿¼ÑÐ] 334Çóµ÷¼Á +3 Ö¾´æ¸ßÔ¶ÒâÔÚ»úÐ 2026-03-16 3/150 2026-03-18 08:34 by lm4875102
[¿¼ÑÐ] 268Çóµ÷¼Á +8 Ò»¶¨ÓÐѧÉÏ- 2026-03-14 9/450 2026-03-17 17:47 by laoshidan
[¿¼ÑÐ] 326Çóµ÷¼Á +5 Éϰ¶µÄСÆÏ 2026-03-15 6/300 2026-03-17 17:26 by ruiyingmiao
[¿¼ÑÐ] ÓÐûÓеÀÌú/ÍÁľµÄÏëµ÷¼ÁÄÏÁÖ£¬¸ø×Ô¼ºÕÐʦµÜÖС« +3 TqlXswl 2026-03-16 7/350 2026-03-17 15:23 by TqlXswl
[¿¼ÑÐ] 288Çóµ÷¼Á +4 Ææµã0314 2026-03-14 4/200 2026-03-14 23:04 by JourneyLucky
ÐÅÏ¢Ìáʾ
ÇëÌî´¦ÀíÒâ¼û