-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathksopt_optimize.m
21 lines (21 loc) · 1.03 KB
/
ksopt_optimize.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
function [x, fval, exitflag, output] = ksopt_optimize(fun, x_0, A, b, Aeq, beq, lb, ub, nonlcon, options, varargin)
%OPTIMIZE call nlopt with unconstrained algorithm to solve optimization problem
% Input:
% fun: objective function to minimize
% x_0: initial value or matrix of initial values or StartPointSet of initial values to start optimization from
% A: matrix of linear inequlity constraints
% b: upper limits for linear inequality constraints
% Aeq: matrix for linear equality constraints
% beq: upper limits for linear equality constraints
% lb: fixed lower bounds on x
% ub: fixed upper bounds on x
% nonlcon: nonlinear inequality and equality constraints
% options: settings for optimization
% varargin: additional arguments for objective function
% Output:
% x: optimal value
% fval: function value at optimal value
% exitflag: optimization result indicator
% output: structure with information about optimization
error('KSOPT:optimize', 'KSOPT is only available as compiled mex file.');
end