% Computer Man Collage For computer studies %
% Telecommunication Department %
% Project Name : Modern techniques for location base services %
% Submitted by : %
% Abubaker Mohamed Ibrahim 2005-06052 %
% Khalid Waleed Mohamed 2005-06046 %
% Supervisor : %
% Co-supervisor %
% Project Thesis Submitted in Partial Fulfillment For the Degree of
% BSC.(HON)IN Telecommunication Engineering Department%
% At Computer Man Collage for Computer Studies %
% Observed Time Difference (OTD) %
% Real Time Difference (RTD) %
% Geometric Time Difference (GTD) %
m = 1 ; %m is the number of the mobile in the network%
BTS = 3; % BTS is the number of the BTS in the network%
Time_A = 100:125 ;
index = randperm(26) ;
Time_A = 10^-6*Time_A(index);
Mx_position = round(70*(rand(1,m)));
My_position = round(70*(rand(1,m)));
Bx_position = [ 10 90 50 ];
By_position = [ 20 20 90 ];
plot(Bx_position,By_position,'or');
hold on
grid
axis([0 100 0 100]);
BTS_x = 2+Bx_position;
BTS_y = 2+By_position;
text(BTS_x,BTS_y,'BTS');
plot(Mx_position,My_position,'ms');
hold on
grid
MS_x= 2+Mx_position;
MS_y= 2+My_position;
text(MS_x,MS_y,'ms');
grid
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%______________________________________________
% First Hyberbol between BTS1 and BTS3
% d3 - d1 = 3*10^5*(t3 - t1)
B = randperm(26);
DistanceM_3_1 = 3*10^5*(abs(Time_A(B(1))-Time_A(B(2))));
% 2g = Distance between BTS1 & BTS3.
g = sqrt((Bx_position(1)-Bx_position(3))^2+(By_position(1)-By_position(3))^2)/2;
% 2a = 2g - (d3-d1)
a1 = (2*g - DistanceM_3_1)/2;
% b = sqrt(g^2 - a^2)
b1 = sqrt(g^2 - a1^2);
% x^2/b1^2 - y^2/a1^2 = 1;
% First = solve('x^2/a^2 - y^2/b^2 = 1');
%__________________________________________
%Second Hyberbol Between BTS2 and BTS3
% d3 - d2 = 3*10^5*(t3 - t2)
B = randperm(26);
DistanceM_3_2 = 3*10^5*(abs(Time_A(B(1))-Time_A(B(2))));
% 2g = Distance between BTS2 & BTS3.
g2 = sqrt((Bx_position(2)-Bx_position(3))^2+(By_position(2)-By_position(3))^2)/2;
% 2a = 2g - (d3-d2)g1
a2 = (2*g2 - DistanceM_3_2)/2;
% b = sqrt(g^2 - a^2)
b2 = sqrt(g2^2 - a2^2);
% x^2/b2^2- y^/a2^=1 ;
%solve x^2/b2^2- y^/a2^=1 ;