diff --git a/data.h5 b/data.h5 index 0c5bae7..df4cd5d 100644 Binary files a/data.h5 and b/data.h5 differ diff --git a/figs/Heterogeneous/Sub1_N.png b/figs/Heterogeneous/Sub1_N.png index 0820ed1..e4b1c28 100644 Binary files a/figs/Heterogeneous/Sub1_N.png and b/figs/Heterogeneous/Sub1_N.png differ diff --git a/figs/Heterogeneous/Sub1_T.png b/figs/Heterogeneous/Sub1_T.png index ead146b..93338d4 100644 Binary files a/figs/Heterogeneous/Sub1_T.png and b/figs/Heterogeneous/Sub1_T.png differ diff --git a/figs/Heterogeneous/Sub1_f.png b/figs/Heterogeneous/Sub1_f.png index 1ad64d4..dc518c1 100644 Binary files a/figs/Heterogeneous/Sub1_f.png and b/figs/Heterogeneous/Sub1_f.png differ diff --git a/figs/Heterogeneous/Sub2_Tau.png b/figs/Heterogeneous/Sub2_Tau.png index 3d9ea5a..e868d6c 100644 Binary files a/figs/Heterogeneous/Sub2_Tau.png and b/figs/Heterogeneous/Sub2_Tau.png differ diff --git a/figs/Heterogeneous/Sub2_p.png b/figs/Heterogeneous/Sub2_p.png index 2c56504..7f1a2f4 100644 Binary files a/figs/Heterogeneous/Sub2_p.png and b/figs/Heterogeneous/Sub2_p.png differ diff --git a/figs/Heterogeneous/Sub3_eq.png b/figs/Heterogeneous/Sub3_eq.png index 1f5aad3..73f3a41 100644 Binary files a/figs/Heterogeneous/Sub3_eq.png and b/figs/Heterogeneous/Sub3_eq.png differ diff --git a/figs/Heterogeneous/Sub3_obj.png b/figs/Heterogeneous/Sub3_obj.png index 56a1f60..ac2f58b 100644 Binary files a/figs/Heterogeneous/Sub3_obj.png and b/figs/Heterogeneous/Sub3_obj.png differ diff --git a/figs/Homogeneous/Sub1_N.png b/figs/Homogeneous/Sub1_N.png index 493a509..5d88544 100644 Binary files a/figs/Homogeneous/Sub1_N.png and b/figs/Homogeneous/Sub1_N.png differ diff --git a/figs/Homogeneous/Sub1_T.png b/figs/Homogeneous/Sub1_T.png index b5d208b..ce39270 100644 Binary files a/figs/Homogeneous/Sub1_T.png and b/figs/Homogeneous/Sub1_T.png differ diff --git a/figs/Homogeneous/Sub1_f.png b/figs/Homogeneous/Sub1_f.png index 19f989d..b187293 100644 Binary files a/figs/Homogeneous/Sub1_f.png and b/figs/Homogeneous/Sub1_f.png differ diff --git a/figs/Homogeneous/Sub2_Tau.png b/figs/Homogeneous/Sub2_Tau.png index 1141fe3..2417899 100644 Binary files a/figs/Homogeneous/Sub2_Tau.png and b/figs/Homogeneous/Sub2_Tau.png differ diff --git a/figs/Homogeneous/Sub2_p.png b/figs/Homogeneous/Sub2_p.png index dc87d52..c653f26 100644 Binary files a/figs/Homogeneous/Sub2_p.png and b/figs/Homogeneous/Sub2_p.png differ diff --git a/figs/Homogeneous/Sub3_eq.png b/figs/Homogeneous/Sub3_eq.png index d6630a2..83ff31f 100644 Binary files a/figs/Homogeneous/Sub3_eq.png and b/figs/Homogeneous/Sub3_eq.png differ diff --git a/figs/Homogeneous/Sub3_obj.png b/figs/Homogeneous/Sub3_obj.png index 2815331..97c2a06 100644 Binary files a/figs/Homogeneous/Sub3_obj.png and b/figs/Homogeneous/Sub3_obj.png differ diff --git a/figs/Sub1_N.png b/figs/Sub1_N.png index 0820ed1..e4b1c28 100644 Binary files a/figs/Sub1_N.png and b/figs/Sub1_N.png differ diff --git a/figs/Sub1_T.png b/figs/Sub1_T.png index ead146b..93338d4 100644 Binary files a/figs/Sub1_T.png and b/figs/Sub1_T.png differ diff --git a/figs/Sub1_f.png b/figs/Sub1_f.png index 1ad64d4..dc518c1 100644 Binary files a/figs/Sub1_f.png and b/figs/Sub1_f.png differ diff --git a/figs/Sub2_Tau.png b/figs/Sub2_Tau.png index 3d9ea5a..e868d6c 100644 Binary files a/figs/Sub2_Tau.png and b/figs/Sub2_Tau.png differ diff --git a/figs/Sub2_p.png b/figs/Sub2_p.png index 2c56504..7f1a2f4 100644 Binary files a/figs/Sub2_p.png and b/figs/Sub2_p.png differ diff --git a/figs/Sub3_eq.png b/figs/Sub3_eq.png index 1f5aad3..73f3a41 100644 Binary files a/figs/Sub3_eq.png and b/figs/Sub3_eq.png differ diff --git a/figs/Sub3_obj.png b/figs/Sub3_obj.png index 56a1f60..ac2f58b 100644 Binary files a/figs/Sub3_obj.png and b/figs/Sub3_obj.png differ diff --git a/julia/Main.jl b/julia/Main.jl index 5cdc1f4..a338852 100644 --- a/julia/Main.jl +++ b/julia/Main.jl @@ -37,6 +37,7 @@ function main() Theta, Theta1 = zeros(Numb_kaps), zeros(Numb_kaps) Obj, Obj1 = zeros(Numb_kaps), zeros(Numb_kaps) + Obj_E, Obj_T = zeros(Numb_kaps), zeros(Numb_kaps) d_eta = zeros(Numb_kaps) # println("Numb_kaps: ", Numb_kaps) @@ -55,7 +56,7 @@ function main() ### Sub3 ### Theta[k], Obj[k] = Solving_sub_prob3(T_cmp[k],E_cmp[k],T_com[k],E_com[k]) - Theta1[k], Obj1[k], d_eta[k] = Solving_sub3(T_cmp1[k],E_cmp1[k],T_com1[k],E_com1[k]) + Theta1[k], Obj1[k], Obj_E[k], Obj_T[k], d_eta[k] = Solving_sub3(T_cmp1[k],E_cmp1[k],T_com1[k],E_com1[k]) # println("\n---->> Check Sub3 Solution: ", check([Theta], [Theta1])) # ### Global ### diff --git a/julia/Plots_Figs.jl b/julia/Plots_Figs.jl index cef7ce3..1c573e9 100644 --- a/julia/Plots_Figs.jl +++ b/julia/Plots_Figs.jl @@ -125,19 +125,27 @@ function plot_sub3_cvx(kaps, Theta, Theta1, Obj, Obj1, T_cmp1, E_cmp1, T_com1, E # savefig(string(folder,"Sub3_obj.png")) x = collect(1.e-5:0.001:0.99) - obj = zeros(size(x)[1]) - id = 9 + obj = zeros(size(x)[1]) + glob_cost_iter = zeros(size(x)[1]) + glob_numb_iter = zeros(size(x)[1]) + id = 19 println("Convex for kappa: ", kaps[id]) for i=1:size(x)[1] obj[i] = 1/(1 - x[i])* (E_com1[id] - log(x[i])*E_cmp1[id] + kaps[id] * (T_com1[id] - log(x[i])*T_cmp1[id])) + glob_cost_iter[i] = E_com1[id] - log(x[i])*E_cmp1[id] + kaps[id] * (T_com1[id] - log(x[i])*T_cmp1[id]) + glob_numb_iter[i] = 1/(1 - x[i]) + # obj[i] = obj_E[i] + obj_T[i] end - plot(x, obj,linestyle="-",color="k", label=string("\$\\kappa\$ =", kaps[id])) + plot(x, obj,linestyle="-",color="k", label=string("Objective: \$\\kappa\$ =", kaps[id])) + plot(x, glob_cost_iter,linestyle="--",color=colors[2], label=string("\$E_{glob} + \\kappa * T_{glob}\$")) + plot(x, glob_numb_iter,linestyle="--",color=colors[3], label=string("\$ 1/(1 - \\Theta)\$")) # println(x) - plot(Theta1[id], Obj1[id],color="r", marker=markers[1], markersize=marker_size) + plot(Theta1[id], Obj1[id],color="r", marker=markers[2], markersize=marker_size) legend(loc="best",fontsize=legend_fontsize-2) xlabel("\$\\Theta\$",fontsize=label_fontsize1+1) - ylabel("Objective",fontsize=label_fontsize1+1) + # ylabel("Objective",fontsize=label_fontsize1+1) + yscale("log") tight_layout(pad=0.5, w_pad=0.5, h_pad=0.5) savefig(string(folder,"Sub3_obj.png")) println("Theta: ", minimum(Theta1), " - ", maximum(Theta1)) diff --git a/julia/Setting.jl b/julia/Setting.jl index cea781f..e645ebb 100644 --- a/julia/Setting.jl +++ b/julia/Setting.jl @@ -18,8 +18,8 @@ S_n = 10e3 *8 #10KB, weight params size (-> bits), and gradient => 10K nats ### COMMUNICATIONS PARAMS ### Ptx_Max = 1. Ptx_Min = 0.1 -N0 = 1e-12 # -> Decrease BW -> Increase Theta -BW = 20e6 #Mhz -> Increase BW -> Increase Theta +N0 = 1e-10 # -> Decrease BW -> Increase Theta +BW = 1e6 #Mhz -> Increase BW -> Increase Theta Dist_min = 2 #2m Dist_max = 50 #50m diff --git a/julia/Solving1.jl b/julia/Solving1.jl index e7d88ab..f24a8c5 100644 --- a/julia/Solving1.jl +++ b/julia/Solving1.jl @@ -437,7 +437,8 @@ function Solving_sub3( T_cmp, E_cmp, T_com, E_com) println("Roots: ", Thetas) Obj = 1/(1 - rs_Theta) * (E_com - log(rs_Theta)*E_cmp + kappa * (T_com - log(rs_Theta)*T_cmp)) - + Obj_E = 1/(1 - rs_Theta) * (E_com - log(rs_Theta)*E_cmp) + Obj_T = 1/(1 - rs_Theta) *(T_com - log(rs_Theta)*T_cmp) if (DEBUG > 0) println("fx: ", fx(rs_Theta)) println("Theta: ", rs_Theta) @@ -446,5 +447,5 @@ function Solving_sub3( T_cmp, E_cmp, T_com, E_com) # println("Test sub3:", abs(log(rs_Theta) + 1/rs_Theta - 1/eta)) - return rs_Theta, Obj, 1/eta + return rs_Theta, Obj, Obj_E, Obj_T, 1/eta end diff --git a/setting.h5 b/setting.h5 index 8b96a56..b4efe84 100644 Binary files a/setting.h5 and b/setting.h5 differ