% FOR AWGN. Now changed to JSAC model (Oct 7, 10) See
% findtotalpowerWithInterference for ISTC model
function [Ptotal] = findtotalpowerWithInterference2(Pt2)
% I know Pt, gamma, pe, and I find power required.
global Ractual;
global Pt p RChUse Rdec Enode;

Rdec = Ractual;

Pt = Pt2;



[sigmaggopt,nmax] = maxnforptAndInterference2();

l = log(nmax)/log(4);% assuming a maximum degree alpha = 4.

l=max(1,l);

Pd = Enode * Rdec * l/RChUse;%RRange.^2 + p(2).*RRange + p(3);


Ptotal = Pt + Pd;



