N = 10+1;
parent = [0:N-1];
Rsource = 0.1;
l = 1*ones(N-1,1);
alpha = 1*ones(N-1,1);
beta = 1*ones(N-1,1);
gamma = 1*ones(N-1,1);
Cload = [0; ones(N-1,1)];
Wmin = 1;
Wmax = 10;
Amax = 50;
children = cell(N,1);
leafs = [];
for node = [1:N]
children{node} = find(parent == node);
if isempty(children{node})
leafs(end+1) = node;
end
end
disp('Generating the tradeoff curve...')
Darray = []; widths = [];
for Amax = [10.05 10.5 11 12:2:20 22.5 25:5:60]
fprintf( 'Amax = %5.2f: ', Amax );
cvx_begin gp quiet
variable w(N-1)
variable T(N)
minimize( max( T(leafs) ) )
subject to
R = alpha.*l./w;
R = [Rsource; R];
C_bar = beta.*l.*w + gamma.*l;
C_bar = [0; C_bar];
C_tilde = cvx( zeros(N,1) );
for node = [1:N]
C_tilde(node,1) = Cload(node);
for k = parent(node)
if k > 0; C_tilde(node,1) = C_tilde(node,1) + C_bar(k); end;
end
for k = children{node}
C_tilde(node,1) = C_tilde(node,1) + C_bar(k);
end
end
C_total = C_tilde;
for node = N:-1:1
for k = children{node}
C_total(node,1) = C_total(node,1) + C_total(k,1);
end
end
R(1)*C_total(1) <= T(1,1);
for node = 2:N
R(node)*C_total(node) + T(parent(node),1) <= T(node,1);
end
sum(w.*l) <= Amax;
Wmin <= w <= Wmax;
cvx_end
fprintf('delay = %3.2f\n',cvx_optval);
Darray = [Darray cvx_optval];
widths = [widths w];
end
Amax = [10.05 10.5 11 12:2:20 22.5 25:5:60];
A11ind = find(Amax == 11);
A20ind = find(Amax == 20);
A35ind = find(Amax == 35);
A50ind = find(Amax == 50);
figure, clf
plot(Darray,Amax, ...
Darray(A11ind),Amax(A11ind),'ro',...
Darray(A20ind),Amax(A20ind),'ro',...
Darray(A35ind),Amax(A35ind),'ro',...
Darray(A50ind),Amax(A50ind),'ro');
xlabel('Elmore delay D'); ylabel('Amax');
disp('Optimal tradeoff curve plotted.')
figure, clf
w1 = widths(:,A50ind);
w2 = widths(:,A35ind);
w3 = widths(:,A20ind);
w4 = widths(:,A11ind);
plot_four_tapers(w1,w2,w3,w4);
Generating the tradeoff curve...
Amax = 10.05: delay = 255.72
Amax = 10.50: delay = 241.04
Amax = 11.00: delay = 228.67
Amax = 12.00: delay = 209.98
Amax = 14.00: delay = 184.90
Amax = 16.00: delay = 168.19
Amax = 18.00: delay = 156.01
Amax = 20.00: delay = 146.74
Amax = 22.50: delay = 137.78
Amax = 25.00: delay = 130.82
Amax = 30.00: delay = 120.77
Amax = 35.00: delay = 113.95
Amax = 40.00: delay = 109.06
Amax = 45.00: delay = 105.43
Amax = 50.00: delay = 102.96
Amax = 55.00: delay = 101.76
Amax = 60.00: delay = 101.60
Optimal tradeoff curve plotted.