# The reason why variable y always cannot be optimized

Hello everyone. The following problem is solved by SCA method. However, the variable y always cannot be optimized. The code is as follows:
G1=[2751500866382.23;446808118241.926;326257521174.188;119205179806.157;165561170834.964;552998169457.887;65920638147.0425;1384098869451.64;70931293899.4374;239837026208.236];
G2=[282941933.951478;282943715.633436;282943973.230548;282934076.208799;282934916.773623;282943536.993081;282945118.896877;282938821.315665;282932539.145752;282935763.819671];
N=10;
vepsilon=500e3ones(N,1);
lambda=2000
ones(N,1);
T_off=[5.05858218005831;3.46021631866850;7.45379891387635;1.83424878510173;1.61592161750176;5.98499798271207;5.79409612139907;4.51517450060601;5.08574278575306;7.33088217643273];

``````F1=32e9;
F2=32e9;
F3=0.5e9;
B=1e6;
para=log(2);
kesai=1;

x1_ba_last=-6*ones(N,1);
x2_ba_last=-4*ones(N,1);
sum_value_last=0;
t=1;
while (kesai>1e-10&&t<10)
cvx_begin
variables   x1_ba(N,1) x2_ba(N,1)  p1(N,1) p2(N,1)  tao1_ba(N,1) tao2_ba(N,1) f1_ba(N,1)  f2_ba(N,1);
``````

Status: Solved
Optimal value (cvx_optval): +4.9187
The optimal value of variable p1, p2 is provided as ：
p1=[0.0001;0.00088;0.00083;0.001795;0.001664;0.00043;0.00349;0.000208;0.003435;0.00089];
p2=[0.9941;0.9854;0.9928;0.9981;0.9932;0.9474;0.9954;0.9955;0.9925;0.9956];

## However, if we adopt p1=0.5 and p2=0.5, the result is

Status: Solved
Optimal value (cvx_optval): +4.15158
Can you help me to analyze it? Thanks!

In general, when you use SCA you’re on your own. It is not guaranteed to converge to anything, let alone a global or even local optimum of the original (non-convex) problem. SCA can converge to a solution which is not a global optimum. It appears that happened to you.

Also, having very large (magnitude) input data is usually not a good thing from the standpoint of reliable algorithm (solver) performance. Nor is very small magnitude (but non-zero) input data.

Thank you for your kind reply, Mark. Did you mean the value of G1 and G2 are too large?

Yes, among many others. Try to choose units to make numbers closer to 1 in magnitude.

Thank you very much, Mark!