function [User,Cells,BS,Beta] = parameter_def_rate_backhaul(User,Cells,BS,Sim,Chn)

%this function defines constant parameters to be used in optimizing the
%user rate and backhaul for compression under fixed Tx BF's

Beta = zeros(Sim.Num_Cell,Sim.Num_BS,Sim.Num_Cell,Sim.Num_User);

for c = 1:Sim.Num_Cell  
    for ik = 1:length(Cells(c).Scheduled_User)
        k = Cells(c).Scheduled_User(ik);
        
        User(c,k).signal_u_k = norm((User(c,k).chn)'*User(c,k).beam_tx)^2/Sim.snr_gap;
        
        User(c,k).intf_plus_noise_v_k = Sim.noise;        
        for cc = 1:Sim.Num_Cell
            for ikk = 1:length(Cells(cc).Scheduled_User)
                kk = Cells(cc).Scheduled_User(ikk);
                
                if ( (cc ~= c) || (kk ~= k) )
                    User(c,k).intf_plus_noise_v_k = User(c,k).intf_plus_noise_v_k + norm((User(c,k).chn)'*User(cc,kk).beam_tx)^2;
                end

            end
        end       
        
        for cc = 1:Sim.Num_Cell
            for bb = 1:Sim.Num_BS
                
                Beta(cc,bb,c,k) = Sim.sqr_gap * BS(cc,bb).compression_power * norm(Get_Chn(Chn, [cc bb], c,k, Sim))^2;

            end
        end
    end       
end


for c = 1:Sim.Num_Cell
    for b = 1:Sim.Num_BS
            
            BS(c,b).current_min_compression_bkhaul = log2(1 + Sim.sqr_gap * BS(c,b).compression_power / (BS(c,b).total_power_budget - BS(c,b).bf_power));
            
    end
end

