⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 chap2_figs7_13and14.m

📁 无线通讯系统的matlab仿真程序;主要包括同步
💻 M
字号:
% Chap2_Figs7_13and14.m
clc, clear all, close all

a=10; b=2; c=4; d=12;
T=0.00005;
T=0.0001;
tfinal=1.5;
nfinal=round(tfinal/T);
max_x1=1; max_x2=1;
t=0:T:tfinal-T;

x10(3)=1; x20(3)=2;
x10(1)=2; x20(1)=4;
x10(2)=5.5; x20(2)=8;
x10(4)=8; x20(4)=11;

for i=1:4 
  x1(1)=x10(i); x2(1)=x20(i);
    for n=1:nfinal-1
      x1(n+1)=x1(n)+T*x1(n)*(a-b*x2(n));
      x2(n+1)=x2(n)+T*x2(n)*(c*x1(n)-d);
    end % n
 
  figure(1)
  hold on
  
  switch i
    case 1        
         plot(x1,x2,'b')
         plot(x10(1),x20(1),'.b','MarkerSize',13)
     case 2 
         plot(x1,x2,'r')
         plot(x10(2),x20(2),'.r','MarkerSize',13)
    case 3
         plot(x1,x2,'g')
         plot(x10(3),x20(3),'.g','MarkerSize',13)         
    case 4
         plot(x1,x2,'k')
         plot(x10(4),x20(4),'.k','MarkerSize',13)
    end  
    
  axis([0 12 0 20])
    
  figure(2)
    subplot(2,1,1)
    hold on
    
    switch i
    case 1
        plot(t,x1,'b')
        text(0.26,5.2,'a')
    case 2 
        plot(t,x1,'r')
        text(1.17,7,'b')
    case 3
        plot(t,x1,'g')
        text(0.95,9,'c')
    case 4
        plot(t,x1,'k')
        text(0.64,10.5,'d')
  end 
        
    axis([0 1.5 0 12])
    ylabel('\itx_{\rm1}','FontSize',11)
    title('Sustained Oscillations of \itx_{\rm1} \rmfor Nonlinear Second Order System','FontSize',11)
    
    subplot(2,1,2)
    hold on
    
    switch i
    case 1
        plot(t,x2,'b')
        text(0.38,9,'a')
    case 2 
        plot(t,x2,'r')
        text(1.27,12.5,'b')
    case 3
        plot(t,x2,'g')
        text(1.03,16.2,'c')
    case 4
        plot(t,x2,'k')
        text(0.72,19.1,'d')
  end 
  
    axis([0 1.5 0 21])   
    xlabel('\itt','FontSize',11)
    ylabel('\itx_{\rm2}','FontSize',11)
    title('Sustained Oscillations of \itx_{\rm2} \rmfor Nonlinear Second Order System','FontSize',11)
     
end % i

figure(1)
xlabel('\itx_{\rm1}','FontSize',11)
ylabel('\itx_{\rm2}','FontSize',11)
title('Closed Orbits of Nonlinear Second Order System','FontSize',11)  
text(6.5,19,'\ita \rm= 10, \itb \rm= 2, \itc \rm= 4, \itd \rm= 12','FontSize',11)
text(06.5,17,'\itx_{\rm1,e} = d/c = 3, \itx_{\rm2,e} = a/b = 5','FontSize',11)
x1e=d/c; x2e=a/b;
plot([x1e],[x2e],'+k')
text(4.68,5,'a') 
text(6.4,5,'b') 
text(8.33,5,'c') 
text(9.86,5,'d') 
text(1,18.9,'Initial State: \itx_{\rm1}\rm(0), \itx_{\rm2}\rm(0)','FontSize',11)
plot([0.75],[19.2],'.k','MarkerSize',13)
text(10,15,'(\itx_{\rm1,e},\itx_{\rm2,e}\rm)','FontSize',11)
plot([9.7],[15],'+k')

figure(2)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -