LEACH in wireless sensor networks
2016-08-23
0 0 0
no vote
Other
Earn points
clear all
xm=100;
ym=100;
sink.x=0.5*xm; %location of sink on x-axis
sink.y=0.5*ym; %location of sink on y-axis
n=100 %nodes
P=0.1; %probability of cluster heads
Eo=0.5; %initial energy
ETX=50*0.000000001; %tx energy
ERX=50*0.000000001; %rx energy
Efs=10*0.000000000001; %free space loss
Emp=0.0013*0.000000000001; %multi path loss
%Data Aggregation Energy
EDA=5*0.000000001; %compression energy
a=1; %fraction of energy enhancment of advance nodes
rmax=5000 %maximum number of rounds
do=sqrt(Efs/Emp); %distance do is measured
Et=0; %variable just use below
A=0;
for i=1:1:n
S(i).xd=rand(1,1)*xm; %generates a random no. use to randomly distibutes nodes on x axis
XR(i)=S(i).xd;
S(i).yd=rand
xm=100;
ym=100;
sink.x=0.5*xm; %location of sink on x-axis
sink.y=0.5*ym; %location of sink on y-axis
n=100 %nodes
P=0.1; %probability of cluster heads
Eo=0.5; %initial energy
ETX=50*0.000000001; %tx energy
ERX=50*0.000000001; %rx energy
Efs=10*0.000000000001; %free space loss
Emp=0.0013*0.000000000001; %multi path loss
%Data Aggregation Energy
EDA=5*0.000000001; %compression energy
a=1; %fraction of energy enhancment of advance nodes
rmax=5000 %maximum number of rounds
do=sqrt(Efs/Emp); %distance do is measured
Et=0; %variable just use below
A=0;
for i=1:1:n
S(i).xd=rand(1,1)*xm; %generates a random no. use to randomly distibutes nodes on x axis
XR(i)=S(i).xd;
S(i).yd=rand
matlab
Related Source Codes
GMSK Linear Receiver
0
0
no vote
NSGA-II algorithm
0
0
no vote
NSGA-III multi-objective optimization algorithm
0
0
no vote
Compressed sensing example
0
0
no vote
CFAR detector example
0
0
no vote
No comment