网络ns2仿真实验分析(RED、丢包率、端到端延迟、吞吐量)附源码分组的端口号。(10) dst addr:目的地址,格式为 node port,其中node代表分组发送节点的id,pot表示发送分组的端口号。(11) seg num:分组的序列号。(12) okt id:分组的唯标识符。3n2与n3之间的RED队列的半均队列长度与当前队列长度随时间的变化如下图所示:torrent and ave"吧 e PED CueL旧300era已n15000ANA图2平均队列长度与当前队列长度随时问变化的曲线图4运行结果中显示CBR流量总共发包550,丢失16,丢包率为:0.029。丢包率随时间的变化如下图所示:packets of lost rate。045graph自04,03500自020.015图3丢包率随时间变化的关系图5CBR流量的吋延随时间的变化如下图所示:1u彐r10.14心01Q。0图4端到端时延随时间变化的关系图6.节点n2的平均吞吐量随时间的变化如下图所示100T图5节点n2的吞吐量随时间变化的关系头7.结果分析:从RED的图示中,可以看出队列的大小波动变化不是很大,在处理突发的包时冇一定的优势。从丟包率、时延和吞吐量的变化图中,可以看出当丟包率增加时,端到端之问的时延也在增加,而吞吐量则下降,丟包率、时延和吞吐量在表示网络性能的好坏时有一定的关系、相关代码1.络拓扑仿真脚木 simulator:tcl:#Create a simulator objectset ns [new Simulator]#Define different colors for data flows for NAM)Sns color 1 BlueSns color 2#Open the nam trace fileset nt lopen out. nam wSns namtrace-all Snfset nd [open out. tr wISns trace-all Snd#Define a finish procedureproc finish仆}{global ns nf ndSns flush-traceclose Snfclose sndexec nam out. namkit o#Create four nodesset no [Sns node]et n1 [Sns nodelset n2 [Sns nodeset n3 [ns node]#Create links between the nodesSns duplex-link Sn0 Sn2 2Mb 10ms DropTailSns duplex-link Sn1 Sn2 2Mb 10ms DropTailSns duplex- link Sn2 Sn3 1.7Mb 20ms RED#Set queue Size of link (n2-n3 to 100Sns queue-limit Sn2 Sn 3 100#Give node position(for NAm)Sns duplex-link-op SnO Sn2 orient right-downSns duplex-link-op Sn1 Sn2 orient right-upSns duplex-link-op $n2 Sn3 orient right#Monitor the queue for link(n2-n3 .( for NAM)Sns duplex-link-op Sn2 Sn 3 queuePos 0.5#Setup a TCP connectionset tcp new Agent/TCPISns attach-agent Sno Stcpset sink [new Agent/TCPSinkSns attach-agent sn3 SinkSns connect stcp SinkStcp set fid 1#Setup a FTP over TCP connectionset ftp [new Application/FTPlSftp attach-agent StcpSftp set type FTPfsetup a UdP connectionset udp [new Agent/UDP]Sns attach-agent Sn1 udpset null [new Agent/Nul]Sns attach-agent Sn3 SnullSns connect Udp SnullUdp set fid_ 2#Setup a CBr over UDP connectionset cbr [new application/Traffic/ CBRIScbr attach-agent UdpScbr set type CBrScbr set packet size 1000Scbr set rate 1mbScbr set random false#Schedule events for the cbr and ftp agentsSns at0.1 Scbr startSns at 1.0"Sftp start"Sns at 40.0"Sftp stop"Sns at 4.5"Scbr stop"#Detach tcp and sink agentsSns at 50 Sns detach-agent $no stcp; Sns detach-agent sn3 Sink"Sns at 50.0 finish#monitor n2 and n3 queueset redg [[sns link Sn2 Sn3] queueset traceq lopen redQueue tr wSredg trace curgSredg trace aveSredg attach Strace#Run the simulationns rur2.RED的数据处理脚本:SgreparedQueue. tr>averagetrStrep“Q" reqUeuetr> current tr(中 reqUeue tr为跟踪n2和n3队列产生的文件)然后使用 gnuplot工具使用 average tr和 current, tr绘制队列随时间变化的曲线3.丢包率数据awk处理脚本 graph rostRate,awvk#count the packet lost rate of cBri=0;vente=S2;from Node =$3toNode=s4:pitT$7srcAddr=$9dstAddr=$10gNum = $11if (fromNode ==1 & toNode ==2&& event==+i totalNum++timeArr[i=timesrate[i]= float)(drop Num/tif(fid==2&& event==d")dropNum++ENDprintf("#number of packet sent: %od, lost: %d"totalNum, dropNum)printf( #lost rate of packets: %f",dropNum/totalNumfor(j=0; j
照坐标变换必须遵循的原则,依矩阵变换法则。对电机矢量控制中Clarke变换公式的系数、压万进行详细数学推导,对伺服系统的设计具有一定的借鉴意义。白钩生等;Cake变换中系数2/3的推导8Clarke逆变换:v2c-C ig =c2√33结论C22按照矢量坐标变换必须要遵循原则,依矩阵变换法则,经过以上数学矩阵详细推导,矢量坐标因此: Clarke变换(或3/2变换)式为Cuke变换系数应为/3参考文献[I]王晓明,王玲,电动机的DSP控制——m公司DSP应用M]北京:北京航空航天大学出版社,2004√(上接第73页)在采用传统P控制器的速度调节系统中,速度和电化对该速度调节系统的影响。机转矩的超调量较大,速度的超调量甚至能达到40%。而使用模糊自适应PI控制器的速度调节系统参考文献中,速度和电机转矩曲线较平滑,振动较小,说明[1]陈荣永磁同步电机控制系统M]北京:中国水利水电出版该控制系统具有较好的鲁棒性和稳定性。其上升时社,2009间、超调量和调节时间均较小,这说明采用模糊自[2]王秀和.永磁电机[M].北京:中国电力出版社,200[3]刘贤兴,卜言柱,胡育文,等.基于精确线性化解耦的永磁同适应P控制器具有更好的跟随性和抗扰性。步电机空间矢量调制系统[J].中国电机工程学报,2007,27模糊自适应控制器能够根据负载转矩和速度的(30):S559突变,通过模糊控制实时地修正K,和K,使其适应[4]梁文毅,章玮,娄飞容.永磁同步电动机伺服系统模糊控制器系统的变化,使电机平稳地运行。设计[J].微电机,2007,40(1):4850[5] Marco Tursini, Francesco Parasiliti, Zhang Daqing. Real-time Gain结语Tuning of PI Controllers for High-performance PMSM Drives [J]IEEE Transactions on Industry Applications, 2002, 38(4)仿真结果验证了采用模糊自适应P控制器的控1018-1026制系统比采用传统PI控制器的控制系统具有更好稳[6 Liu Xuepeng, Immune Pl Control on PMSM Speed Regulating System定性和鲁棒性。模糊控制具有更好的适应性和灵活[C]. Proceedings of the 7 th World Congress on Intelligent Control性,能根据外部信息进行智能判断。and Automation, 2008: 6891-6896本文的不足之处在于只考虑了外部环境的变化,[7] Francesco Parasiliti, Marco Tursini, Zhang Daqing. On-line Selftuning of PI Controllers for High Performance PMSM Drives[C]并未考虑系统本身参数的变化。由于永磁同步电机Conf. Rec. IAS Annu. Meeting, 1996: 1619-1625.的电阻和电感分别受运行温度和磁饱和程度的影响,[8]李渊,何风有,余跃,等.永磁同步电机摸糊滑模控制系统的因此,下一步的研究将集中在电机电阻和电感的变研究[打].微电机,2010,43(4):5860Clarke变换中系数(√)2/3的推导旧WANFANG DATA文献链接作者:白钧生,冯浩,白新力,李攀, BAI Yunsheng, FENG Hao, BAI Xinli, LI Pan作者单位:白钧生, BAI Yunsheng(中国飞机强度研究所,西安,710065),冯浩, FENG Hao(西北工业大学电子信息学院,西安,710129),白新力,李攀, BAI Xinli, LI Pan(西安微电机研究所,西安710077)刊名微电机 ISTIC PKU英文刊名:Micromotors年,卷(期):2012,45(7)参考文献(1条)1.王晓明;王玲电动机的DSP控制-TI公司DSP应用2004本文链接http://d.g.wanfangdata.comcn/periodiCalwdj201207019.aspx