# This is the output for my dvs(dynamic voltage scalling) optimization, plz check the output and inform whether output is wrong or right

(manohara) #1
``````n = 8;
i = 1:n;
Ceff = 0.03*ones(n,1);
Vth = 0.36*ones(n,1);
Vmin = 0.6*ones(n,1);
Vmax = 1.5*ones(n,1);
alpha = 1.2*ones(n,1);
Fmax = [1900e6*ones(n,1)]';
k = (((Vmax - Vth).^alpha)/Vmax)*ones(n,1);
P = [2400 2400 2400 2400 9600 7800 4800 4800];
D = [2400 2400 2400 2400 4000 4000 4800 4800];
C = [35 40 165 165 570 570 180 720];
F = [800e6 1000e6 1200e6 1400e6 1600e6 1800e6 2000e6 2200e6];
%V = [0.9 1 1.1 1.2 1.3 1.4 1.5 1.6];
Fmin = [min(F)*ones(1,n)];
M = Ceff * Fmax;
N = C(i) * M;
%N = constant1( Ceff, Fmax, C )
S = [F./Fmax];
Smin = Fmin/Fmax;
emin = C./Smin;
e = C./S;
cvx_begin gp
variable V(i)
for i = 1:n;
E(i) =  sum(N(i).*(V(i).^2));
end
minimize (E(i))
subject to
for i = 1:n
T1 = (e./P);
end
for i = 1:n;
T2 = (( P - D)/P).*e;
end
for i = 1:n;
T3 = T2/D;
T = T1+T2+T3;
end
T <= 1;
e = emin;
M = (V(i)-Vth)
%G = M^1.2
k*V(i) <= S(i);
Vmin <= V(i) <= Vmax;
cvx_end
fprintf(1,'\nThe  energy consumed %3.2f.\n',cvx_optval);
%disp('Optimal Voltage levels are: '), V
``````

## RESULT Calling SDPT3 4.0: 80650 variables, 2 equality constraints

num. of constraints = 2
dim. of linear var = 3
dim. of free var = 80647 *** convert ublk to lblk

SDPT3: Infeasible path-following algorithms

## number of iterations = 8 primal objective value = -1.81132058e+00 dual objective value = -1.81132058e+00 gap := trace(XZ) = 1.85e-08 relative gap = 4.01e-09 actual relative gap = -1.15e-09 rel. primal infeas (scaled problem) = 4.21e-13 rel. dual " " " = 1.43e-08 rel. primal infeas (unscaled problem) = 0.00e+00 rel. dual " " " = 0.00e+00 norm(X), norm(y), norm(Z) = 1.3e+00, 2.0e+00, 2.0e+00 norm(A), norm(b), norm© = 3.0e+00, 1.9e+00, 3.0e+00 Total CPU time (secs) = 0.64 CPU time per iteration = 0.08 termination code = 0 DIMACS: 4.2e-13 0.0e+00 1.4e-08 0.0e+00 -1.1e-09 4.0e-09

Status: Solved
Optimal value (cvx_optval): +5.01714e+10

The energy consumed 50171400004.34.

(Mark L. Stone) #2

How are forum readers supposed to know whether this is wrong or right, because we don;t know what you are trying to do.

Nevertheless, several things look suspicious.

The objective `minimize (E(i))` , winds up being `minimize (E(in)` because i has its last value from the preceding for loop.

The for loops to set T1, T2, T3, T each do the same thing n times, i.e., as though there were not for loops.

It doesn’t look like

``````  e = emin;
M = (V(i)-Vth)
``````

affects anything in the optimization problem.
+++++++++++++

``````  k*V(i) <= S(i);
Vmin <= V(i) <= Vmax;
``````

only constrain for the value i = n, because that is the value i has (last value of preceding for loop) at the time these statements appear

cvx_optval is a very large number. If, when you fix the formulation of the problem cvxx_optval comes out to be a similarly large number, you may wish to change the units used to that cvx_optval comes out within a few orders of magnitude of 1, which might reduce the numerical challenges to the solver.

There may be many more things which are wrong. I recommendt you examine these, and especially play attention to indexing.