(a^2+pow_pos(norm(A-B),2))^(1/2)
as
norm([a;norm(A-B)])
Disciplined convex programming error:
Cannot perform the operation norm( {mixed convex/constant},
2 )
(a^2+pow_pos(norm(A-B),2))^(1/2)
as
norm([a;norm(A-B)])
Disciplined convex programming error:
Cannot perform the operation norm( {mixed convex/constant},
2 )
A-B is convex. a is constant. Then “Cannot perform the operation norm( {mixed convex/constant},
2 )”
Given you have
||f(x)||
then f must be an affine expression of the variables e.g. x. Most likely that is your mistake.
I have one more question to ask you.When I used the MoSEk solver, "Status: inaccurately /Unbounded Optimal Value (CVX_OPtVAL): +Inf
" would appear after several iterations.
MOSEK Version 9.1.9 (Build date: 2019-11-21 11:34:40)
Copyright © MOSEK ApS, Denmark. WWW: mosek.com
Platform: Windows/64-X86
MOSEK warning 57: A large value of 1.9e+09 has been specified in c for variable ‘’ (241).
MOSEK warning 57: A large value of 1.1e+09 has been specified in c for variable ‘’ (482).
MOSEK warning 57: A large value of 3.7e+08 has been specified in c for variable ‘’ (723).
MOSEK warning 57: A large value of 2.1e+09 has been specified in c for variable ‘’ (964).
MOSEK warning 57: A large value of 2.8e+09 has been specified in c for variable ‘’ (1205).
MOSEK warning 57: A large value of 1.8e+08 has been specified in c for variable ‘’ (1446).
MOSEK warning 57: A large value of 8.5e+08 has been specified in c for variable ‘’ (1687).
MOSEK warning 57: A large value of 1.8e+09 has been specified in c for variable ‘’ (1928).
Problem
Name :
Objective sense : min
Type : CONIC (conic optimization problem)
Constraints : 5151
Cones : 2516
Scalar variables : 10430
Matrix variables : 0
Integer variables : 0
Optimizer started.
Presolve started.
Linear dependency checker started.
Linear dependency checker terminated.
Eliminator started.
Freed constraints in eliminator : 2518
Eliminator terminated.
Eliminator started.
Freed constraints in eliminator : 0
Eliminator terminated.
Eliminator - tries : 2 time : 0.00
Lin. dep. - tries : 1 time : 0.02
Lin. dep. - number : 0
Presolve terminated. Time: 0.05
Problem
Name :
Objective sense : min
Type : CONIC (conic optimization problem)
Constraints : 5151
Cones : 2516
Scalar variables : 10430
Matrix variables : 0
Integer variables : 0
Optimizer - threads : 4
Optimizer - solved problem : the primal
Optimizer - Constraints : 1786
Optimizer - Cones : 2515
Optimizer - Scalar variables : 7902 conic : 7664
Optimizer - Semi-definite variables: 0 scalarized : 0
Factor - setup time : 0.01 dense det. time : 0.00
Factor - ML order time : 0.00 GP order time : 0.00
Factor - nonzeros before factor : 9.71e+04 after factor : 1.29e+05
Factor - dense dim. : 85 flops : 3.92e+07
ITE PFEAS DFEAS GFEAS PRSTATUS POBJ DOBJ MU TIME
0 2.4e+03 5.2e+06 1.5e+07 0.00e+00 -1.102051416e+10 -1.103596091e+10 1.0e+00 0.08
1 5.0e+02 1.1e+06 6.9e+06 -1.00e+00 -1.102049804e+10 -1.103594426e+10 2.1e-01 0.17
2 1.4e+02 3.0e+05 3.6e+06 -1.00e+00 -1.102043530e+10 -1.103587896e+10 5.7e-02 0.19
3 6.6e+01 1.4e+05 2.5e+06 -9.99e-01 -1.101982274e+10 -1.103525861e+10 2.7e-02 0.20
4 4.4e+01 9.3e+04 2.0e+06 -9.98e-01 -1.101751760e+10 -1.103294366e+10 1.8e-02 0.20
5 3.9e+01 8.2e+04 1.9e+06 -9.97e-01 -1.101516700e+10 -1.103059338e+10 1.6e-02 0.22
6 2.3e+01 5.0e+04 1.5e+06 -9.97e-01 -1.100606393e+10 -1.102147821e+10 9.6e-03 0.23
7 1.2e+01 2.6e+04 1.1e+06 -9.96e-01 -1.098394721e+10 -1.099933128e+10 5.0e-03 0.25
8 2.1e+00 4.4e+03 4.4e+05 -9.92e-01 -1.076479248e+10 -1.077986494e+10 8.6e-04 0.27
9 4.5e-01 9.6e+02 1.9e+05 -9.63e-01 -1.028231643e+10 -1.029669984e+10 1.9e-04 0.28
10 1.5e-01 3.3e+02 1.1e+05 -9.06e-01 -9.643779833e+09 -9.657245007e+09 6.3e-05 0.30
11 6.0e-02 1.3e+02 5.9e+04 -8.33e-01 -8.784402969e+09 -8.796619866e+09 2.4e-05 0.31
12 2.6e-02 5.4e+01 3.4e+04 -7.33e-01 -7.841014303e+09 -7.851830667e+09 1.0e-05 0.33
13 6.6e-03 1.4e+01 1.3e+04 -6.05e-01 -5.726811014e+09 -5.734416620e+09 2.7e-06 0.33
14 1.9e-03 4.0e+00 4.1e+03 -3.98e-01 -3.925056082e+09 -3.929717536e+09 7.6e-07 0.34
15 4.4e-04 9.3e-01 8.5e+02 -8.01e-02 -2.311147994e+09 -2.313056929e+09 1.8e-07 0.36
16 6.2e-05 1.3e-01 6.1e+01 4.84e-01 -1.406055710e+09 -1.406407353e+09 2.5e-08 0.38
17 9.6e-06 2.0e-02 3.8e+00 9.04e-01 -1.233861119e+09 -1.233917985e+09 3.9e-09 0.39
18 3.6e-07 7.7e-04 2.9e-02 9.78e-01 -1.202157238e+09 -1.202159416e+09 1.5e-10 0.41
19 1.4e-07 1.2e-04 1.8e-03 1.00e+00 -1.201094251e+09 -1.201094596e+09 2.3e-11 0.41
20 1.4e-07 1.2e-04 1.8e-03 1.00e+00 -1.201094251e+09 -1.201094596e+09 2.3e-11 0.45
21 1.4e-07 1.2e-04 1.8e-03 1.00e+00 -1.201094251e+09 -1.201094596e+09 2.3e-11 0.47
Optimizer terminated. Time: 0.53
Interior-point solution summary
Problem status : UNKNOWN
Solution status : UNKNOWN
Primal. obj: -1.2010942514e+09 nrm: 2e+07 Viol. con: 6e-01 var: 2e-05 cones: 1e-05
Dual. obj: -1.2010945965e+09 nrm: 3e+09 Viol. con: 0e+00 var: 1e+02 cones: 0e+00
Optimizer summary
Optimizer - time: 0.53
Interior-point - iterations : 22 time: 0.50
Basis identification - time: 0.00
Primal - iterations : 0 time: 0.00
Dual - iterations : 0 time: 0.00
Clean primal - iterations : 0 time: 0.00
Clean dual - iterations : 0 time: 0.00
Simplex - time: 0.00
Primal simplex - iterations : 0 time: 0.00
Dual simplex - iterations : 0 time: 0.00
Mixed integer - relaxations: 0 time: 0.00
Status: Inaccurate/Unbounded
Optimal value (cvx_optval): +Inf
Lo =
1.0e+03 *
1.7566
-0.0000
Mosek provided a warning about large values in the input data. It appears the scaling of the input data is bad. Try to improve it.by changing units, so that non-zero input data is within s small number of orders of magnitude of 1.
I’ve given you an initial set of values that I can solve for.The problem above arises when we solve it the second time.
Ql = Qr;
t1l=t1f;
t2l=t2f;
l = 0;
tol = tolerance;
Lo = [];
for l = 1: 1000
Qlt = repelem(Ql,1,1,K);
J = H^2 + sum( (Qlt - w).^2 ,1);
J = reshape(J, [N,K] );
I = P.dB2dec(beta0)(alpha/2)log2(exp(1)) ./ (J . (dB2dec(sigma_2) * J .^(alpha/2) + P.dB2dec(beta0)));
A = log2(1 + (P.dB2dec(beta0)) ./ (dB2dec(sigma_2) * J .^(alpha/2)) );
cvx_clear
cvx_begin %quiet
cvx_solver mosek
variables Q(2,N)
variable lo(1)
variable t1(N)
variable t2(N)
expression LO(K)
expression Ef(1,N)
expression Ef2(1,N)
expression WPT(1,N)
expression WPT2(1,N)
maximize lo %%
subject to:
for k = 1 : K
for m=1:N
Rlb =Bdelta_t( A(m,k) - I(m,k) * pow_pos(norm( Q(:,m) - u(:,k)),2) + I(m,k) * pow_pos(norm( Ql(: , m ) - u(:,k)),2));
LO(k) = LO(k) + Xr(m,k) * Rlb;
end
LO(k)>=D(k); %(10b)
end
sum(LO)>=lo;
for m = 2: N
norm(Q(:,m) - Q(:,m-1)) <= Dmax;%(1)
end
norm(Q(:,1) - Q(:,N)) <= Dmax;
Q(1,1) == Q(1,N);
Q(2,1) == Q(2,N);
for m=2:N
norm([H;Q(:,m)-Gr(:,m)])+(-rel_entr(1,t1l(m)))/afa+(t1(m)-t1l(m))/(afa*t1l(m))<=0;
end
for m=2:N
2*t2(m)+t1(m)^2+Ps^2+(t1l(m)+Ps)^2-2*(t1l(m)+Ps)*(t1(m)+Ps)<=0;
end
Ef(1,1)=0;
Ef2(1,1)=0;
WPT(1,1)=0;
WPT2(1,1)=0;
for m=2:N
Ef(1,m)=Ef(1,m-1)+0.5*M*delta_t*pow_pos(norm(Q(:,m) - Q(:,m-1),2),2)/delta_t^2;
WPT(1,m)=WPT(1,m-1)+delta_t*(c1*t2(m)+c2*t1(m)+c3);
0-E0-WPT(1,m)+Ef(1,m)<=0;
Ef2(1,m)=Ef2(1,m-1)+0.5*M*delta_t*((-pow_pos(norm(Ql(:,m)-Ql(:,m-1)),2)+2*(Ql(:,m)-Ql(:,m-1))'*(Q(:,m)-Q(:,m-1)))/(delta_t^2));
WPT2(1,m)=WPT2(1,m-1)+delta_t*(c1*t2(m)+c2*t1(m)+c3);
Ef2(1,m)-WPT2(1,m)>=0;
end
cvx_end
%%
figure(1)
hold on
plot(Q(1,:),Q(2,:), ‘-.’);
hold on
Lo = [Lo;lo/B]
Ql = Q;
t1l=t1;
t2l=t2;
if (l >= 2) &&(Lo(l) - Lo(l-1)<0.01)
break;
end
end