
% Copyright 2015 The MathWorks, Inc.

function [vals,derivs] = sdoExampleCostFunctionWithLog(params)
% Get the value of x from the parameter object
x = params.Value; 

% Compute the cost and constraint violations
vals.F    = x.^2;         % Cost
vals.Cleq = x.^2-4*x+1;   % Non-linear inequality violation
vals.leq  = 2*x/3-3;      % Linear inequality violation
vals.Log = x;             % Any additional evaluation information

% Compute the cost and constraint violations
derivs.F    = 2.*x;     % Cost gradient
derivs.Cleq = 2.*x-4;   % Non-linear inequality gradient
end