ImageVerifierCode 换一换
格式:DOCX , 页数:21 ,大小:524.61KB ,
资源ID:70767      下载积分:10 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bingdoc.com/d-70767.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(排队论的matlab仿真(包括仿真代码).docx)为本站会员(wj)主动上传,冰点文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰点文库(发送邮件至service@bingdoc.com或直接QQ联系客服),我们立即给予删除!

排队论的matlab仿真(包括仿真代码).docx

1、Wireless NetworkExperiment Three:Queuing TheoryABSTRACTThis experiment is designed to learn the fundamentals of the queuing theory. Mainly about the M/M/S and M/M/n/n queuing models.KEY WORDS: queuing theory, M/M/s, M/M/n/n, Erlang B, Erlang C.INTRODUCTIONA queue is a waiting line and queueing theor

2、y is the mathematical theory of waiting lines. More generally, queueing theory is concerned with the mathematical modeling and analysis of systems that provide service to random demands. In communication networks, queues are encountered everywhere. For example, the incoming data packets are randomly

3、 arrived and buffered, waiting for the router to deliver. Such situation is considered as a queue. A queueing model is an abstract description of such a system. Typically, a queueing model represents (1) the systems physical configuration, by specifying the number and arrangement of the servers, and

4、 (2) the stochastic nature of the demands, by specifying the variability in the arrival process and in the service process. The essence of queueing theory is that it takes into account the randomness of the arrival process and the randomness of the service process. The most common assumption about t

5、he arrival process is that the customer arrivals follow a Poisson process, where the times between arrivals are exponentially distributed. The probability of the exponential distribution function is ft=e-t.l Erlang B modelOne of the most important queueing models is the Erlang B model (i.e., M/M/n/n

6、). It assumes that the arrivals follow a Poisson process and have a finite n servers. In Erlang B model, it assumes that the arrival customers are blocked and cleared when all the servers are busy. The blocked probability of a Erlang B model is given by the famous Erlang B formula,where n is the num

7、ber of servers and A=/ is the offered load in Erlangs, is the arrival rate and 1/ is the average service time. Formula (1.1) is hard to calculate directly from its right side when n and A are large. However, it is easy to calculate it using the following iterative scheme:l Erlang C modelThe Erlang d

8、elay model (M/M/n) is similar to Erlang B model, except that now it assumes that the arrival customers are waiting in a queue for a server to become available without considering the length of the queue. The probability of blocking (all the servers are busy) is given by the Erlang C formula,Where =1

9、 if An and =An if An. The quantity indicates the server utilization. The Erlang C formula (1.3) can be easily calculated by the following iterative schemewhere PB(n,A) is defined in Eq.(1.1).DESCRIPTION OF THE EXPERIMENTS1. Using the formula (1.2), calculate the blocking probability of the Erlang B

10、model. Draw the relationship of the blocking probability PB(n,A) and offered traffic A with n = 1,2, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100. Compare it with the table in the text book (P.281, table 10.3).From the introduction, we know that when the n and A are large, it is easy to calculate the blo

11、cking probability using the formula 1.2 as follows. PBn,A= APB(n-1,A)m+APB(n-1,A)it use the theory of recursion for the calculation. But the denominator and the numerator of the formula both need to recurs( PBn-1,A) when doing the matlab calculation, it waste time and reduce the matlab calculation e

12、fficient. So we change the formula to be : PBn,A= APB(n-1,A)n+APB(n-1,A)=1n+APBn-1,AAPBn-1,A=1(1+nAPBn-1,A) Then the calculation only need recurs once time and is more efficient.The matlab code for the formula is: erlang_b.m%*% File: erlanb_b.m % A = offered traffic in Erlangs. % n = number of trunc

13、ked channels. % Pb is the result blocking probability. %*function Pb = erlang_b( A,n ) if n=0 Pb=1; % P(0,A)=1 else Pb=1/(1+n/(A*erlang_b(A,n-1); % use recursion erlang(A,n-1) endendAs we can see from the table on the text books, it uses the logarithm coordinate, so we also use the logarithm coordin

14、ate to plot the result. We divide the number of servers(n) into three parts, for each part we can define a interval of the traffic intensity(A) based on the figure on the text books : 1. when 0n10, 0.1A10.2. when 10n20, 3A20.3. when 30n100, 13A120.For each part, use the “erlang_b” function to calcul

15、ate and then use “loglog” function to figure the logarithm coordinate.The matlab code is :%*% for the three parts.% n is the number servers.% A is the traffic indensity.% P is the blocking probability.%*n_1 = 1:2;A_1 = linspace(0.1,10,50); % 50 points between 0.1 and 10.n_2 = 10:10:20;A_2 = linspace

16、(3,20,50); n_3 = 30:10:100; A_3 = linspace(13,120,50); %*% for each part, call the erlang_b() function.%*for i = 1:length(n_1) for j = 1:length(A_1) p_1(j,i) = erlang_b(A_1(j),n_1(i); end end for i = 1:length(n_2) for j = 1:length(A_2) p_2(j,i) = erlang_b(A_2(j),n_2(i); end end for i = 1:length(n_3)

17、 for j = 1:length(A_3) p_3(j,i) = erlang_b(A_3(j),n_3(i); end end %*% use loglog to figure the result within logarithm coordinate.%*loglog(A_1,p_1,k-,A_2,p_2,k-,A_3,p_3,k-);xlabel(Traffic indensity in Erlangs (A) ylabel(Probability of Blocking (P) axis(0.1 120 0.001 0.1) text(.115, .115,n=1) text(.6

18、, .115,n=2) text(7, .115,10) text(17, .115,20) text(27, .115,30) text(45, .115,50) text(100, .115,100) The figure on the text books is as follow:We can see from the two pictures that, they are exactly the same with each other except that the result of the experiment have not considered the situation

19、 with n=3,4,5,12,14,16,18.2. Using the formula (1.4), calculate the blocking probability of the Erlang C model. Draw the relationship of the blocking probability PC(n,A) and offered traffic A with n = 1,2, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100. From the introduction, we know that the formula 1.4 i

20、s : PCn,A=nPB(n,A)n-A(1-PB(n,A)Since each time we calculate the PBn,A, we need to recurs n times, so the formula is not efficient. We change it to be: PCn,A=nPB(n,A)n-A(1-PB(n,A)=1n-A(1-PB(n,A)nPB(n,A)=1(An+n-AnPBn,A) Then we only need recurs once. PBn,A is calculated by the “erlang_b” function as s

21、tep 1.The matlab code for the formula is : erlang_c.m%*% File: erlanb_b.m % A = offered traffic in Erlangs. % n = number of truncked channels. % Pb is the result blocking probability. % erlang_b(A,n) is the function of step 1.%*function Pc = erlang_c( A,n ) Pc=1/(A/n)+(n-A)/(n*erlang_b(A,n);endThen

22、to figure out the table in the logarithm coordinate as what shown in the step 1.The matlab code is :%*% for the three parts.% n is the number servers.% A is the traffic indensity.% P_c is the blocking probability of erlangC model.%*n_1 = 1:2;A_1 = linspace(0.1,10,50); % 50 points between 0.1 and 10.

23、n_2 = 10:10:20;A_2 = linspace(3,20,50); n_3 = 30:10:100; A_3 = linspace(13,120,50); %*% for each part, call the erlang_c() function.%*for i = 1:length(n_1) for j = 1:length(A_1) p_1_c(j,i) = erlang_c(A_1(j),n_1(i); %erlang_c end end for i = 1:length(n_2) for j = 1:length(A_2) p_2_c(j,i) = erlang_c(A

24、_2(j),n_2(i); end end for i = 1:length(n_3) for j = 1:length(A_3) p_3_c(j,i) = erlang_c(A_3(j),n_3(i); end end %*% use loglog to figure the result within logarithm coordinate.%*loglog(A_1,p_1_c,g*-,A_2,p_2_c,g*-,A_3,p_3_c,g*-);xlabel(Traffic indensity in Erlangs (A) ylabel(Probability of Blocking (P

25、) axis(0.1 120 0.001 0.1) text(.115, .115,n=1) text(.6, .115,n=2) text(6, .115,10) text(14, .115,20) text(20, .115,30) text(30, .115,40)text(39, .115,50) text(47, .115,60)text(55, .115,70)text(65, .115,80)text(75, .115,90)text(85, .115,100)The result of blocking probability table of erlang C model.T

26、hen we put the table of erlang B and erlang C in the one figure, to compare their characteristic. 10010-1The line with * is the erlang C model, the line without * is the erlang B model. We can see from the picture that, for a constant traffic intensity (A), the erlang C model has a higher blocking p

27、robability than erlang B model. The blocking probability is increasing with traffic intensity. The system performs better when has a larger n.ADDITIONAL BONUSWrite a program to simulate a M/M/k queue system with input parameters of lamda, mu, k.In this part, we will firstly simulate the M/M/k queue

28、system use matlab to get the figure of the performance of the system such as the leave time of each customer and the queue length of the system.About the simulation, we firstly calculate the arrive time and the leave time for each customer. Then analysis out the queue length and the wait time for each customer use “for” loops. Then we let the input to be lamda = 3, mu = 1

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2