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

2 Ansichten (letzte 30 Tage)
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

Akzeptierte Antwort

Matt J
Matt J am 26 Sep. 2019
Bearbeitet: Matt J am 26 Sep. 2019
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 Kommentare
wiem abd
wiem abd am 29 Sep. 2019
Bearbeitet: wiem abd am 29 Sep. 2019
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 am 29 Sep. 2019
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.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Systems of Nonlinear Equations finden Sie in Help Center und File Exchange

Produkte


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by