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

📄 ga_plot34.m

📁 书籍代码:遗传演算法原理与应用_活用MATLAB(Source Code)
💻 M
字号:
% GA_plot34.m
% Plot time responses under plant varaitions

% PenChen Chou, 7-9-2001

Emin=10000;
K=10;a1=3;a2=2;
[tout, X, Y]=sim('ex34_dpid',[0 4]); % see [tout and yout]
yout=Y(:,2); Err=Y(:,3); N=length(Err); PI=Err(N); Stop=sum(Y(:,4));
figure(2);subplot(231);plot(tout,yout);
title('K=10;a1=3;a2=2');

K=5; a1=1.5; a2=1;
[tout, X, Y]=sim('ex34_dpid',[0 4]); % see [tout and yout]
yout=Y(:,2); Err=Y(:,3); N=length(Err); PI=Err(N); Stop=sum(Y(:,4));
figure(2);subplot(232);plot(tout,yout);
title('K=5;a1=1.5;a2=1');

K=5; a1=6; a2=1;
[tout, X, Y]=sim('ex34_dpid',[0 4]); % see [tout and yout]
yout=Y(:,2); Err=Y(:,3); N=length(Err); PI=Err(N); Stop=sum(Y(:,4));
figure(2);subplot(233);plot(tout,yout);
title('K=5;a1=6;a2=1');

K=5; a1=1.5; a2=4;
[tout, X, Y]=sim('ex34_dpid',[0 4]); % see [tout and yout]
yout=Y(:,2); Err=Y(:,3); N=length(Err); PI=Err(N); Stop=sum(Y(:,4));
figure(2);subplot(234);plot(tout,yout);
title('K=5;a1=1.5;a2=4');

K=20; a1=1.5; a2=1;
[tout, X, Y]=sim('ex34_dpid',[0 4]); % see [tout and yout]
yout=Y(:,2); Err=Y(:,3); N=length(Err); PI=Err(N); Stop=sum(Y(:,4));
figure(2);subplot(235);plot(tout,yout);
XC=['Time(s), Kp=' num2str(Kp), ',Ki=' num2str(Ki),...
        ',Kd=' num2str(Kd)];
xlabel(XC)
title('K=20;a1=1.5;a2=1');

K=20; a1=6; a2=4;
[tout, X, Y]=sim('ex34_dpid',[0 4]); % see [tout and yout]
yout=Y(:,2); Err=Y(:,3); N=length(Err); PI=Err(N); Stop=sum(Y(:,4));
figure(2);subplot(236);plot(tout,yout);
title('K=20;a1=6;a2=4');

K=10;a1=3;a2=2;

⌨️ 快捷键说明

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