Can you please help me to figure out the problem with this optimization ? Starting from the given initial point, I obtain the message :
'Solver stopped prematurely.↵↵fmincon stopped because it exceeded the function evaluation limit,↵options.MaxFunctionEvaluations = 3000 (the default value).'
When I use the given value for f, the constraint is no longer defined in the considered point and I get the following message
'Error using barrier Nonlinear constraint function is undefined at initial point. Fmincon cannot continue.'
An interesting remark is that that value of the initial point x0=0.6*b is a local minimum for the objective function @(f)0 and with the same non linear constraints when C_Ter=5*1e+11.
Does this refer to a problem of order of magnitude of my variables?
clear all;%%%%%%% simulation parameters
n=20 m=5; power_BS = 20 N0=10e-10;fb = 0.18*1e+6 n_RB = 100 bandwidth= 100*1e+6; b_v=fb*n_RB/n;radius_BS = 500; b=b_v*rand(n,1); d_sq=radius_BS*rand(n+m,1).^2;h=exprnd(1,n+m,1)./(d_sq); SNR=h*power_BS/N0; C_Ter=5*1e+6;p=[];x0=[52.8827; 45.0967; 45.3726; 46.4245; 53.6886; 1.2579*ones(15,1)] % initial point
epsilon=(2e-4);%objective=@(f)0
objective=@(f) obj(f,n,b,SNR);lb=zeros(n,1);ub=b;%opts = optimset('Display','iter','Algorithm','interior-point', 'MaxIter', 100000, 'MaxFunEvals', 100000);
options = optimoptions('fmincon','Display','iter','Algorithm','sqp');[f,fval,exitflag,output] = fmincon(objective,x0,[],[],[],[],lb,ub,@(f)mycon_Taylor(f,SNR,n,m,bandwidth,epsilon,C_Ter,x0,b))p=[p,-fval];
where
function fun = obj(f,n,b1,SNR)%UNTITLED3 Summary of this function goes here
% Detailed explanation goes here
fun=-sum((b1-f).*log(1+(SNR(1:n)./((b1-f)))))end
and
function [c,ceq] = mycon(f,SNR,n,m,bandwidth,epsilon,C_Ter,a,b)% Compute nonlinear inequalities at x.
c=[sum(f)- bandwidth;(1/epsilon)-sum(f(1:m)'*log(1+(SNR(n+1:n+m)./f(1:m))));(sum(f(1:m)'*log(1+(SNR(n+1:n+m)./f(1:m))))+sum((b-a).*log(1+(SNR(1:n)./(b-a)))-(f-a).*log(1+(SNR(1:n)./(b-a)))+(SNR(1:n).*(f-a))./(b-a+SNR(1:n)))-C_Ter)];ceq=[];end
Actually, I deduced the initial point by solving the problem without the last non linear constraint through the following function :
function [c,ceq] = mycon(f,SNR,n,m,bandwidth,epsilon,b)% Compute nonlinear inequalities at x.c=[sum(f)- bandwidth;(1/epsilon)-sum(f(1:m)'*log(1+(SNR(n+1:n+m)./f(1:m))))];ceq=[];end
Best Answer