Does the order of magnitude of the variables in the non linear constraints influence the solution in fmincon?

2 次查看(过去 30 天)
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

采纳的回答

Matt J
Matt J 2019-9-26
编辑:Matt J 2019-9-26
Well, clearly the feasible set gets smaller as C_Ter gets smaller. Possibly you have made C_Ter so small that the feasible set is empty.
  4 个评论
wiem abd
wiem abd 2019-9-29
编辑:wiem abd 2019-9-29
Thank you Matt for your answer.
I chnaged the values of C_Ter as :
C_Ter=5*10^7:5*10^7:20e+07
The problem has always a feasible point. However, I get this message
Local minimum possible. Constraints satisfied.↵↵fmincon stopped because the size of the current step is less than↵the default value of the step size tolerance and constraints are ↵satisfied to within the default value of the constraint tolerance.
When I keep changing the values of the initial point with the newly found value, I reach the following state :
Error using barrier
Nonlinear constraint function is undefined at initial point. Fmincon cannot continue.
Matt J
Matt J 2019-9-29
Local minimum possible. Constraints satisfied.↵↵fmincon stopped because the size of the current step is less than↵the default value of the step size tolerance and constraints are ↵satisfied to within the default value of the constraint tolerance.
This one was a good message. It probably means fmincon succeeded.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Solver Outputs and Iterative Display 的更多信息

产品


版本

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by