% Author: Housam Binous
% Dynamic and control of a tank using the genetic algorithm toolbox
% National Institute of Applied Sciences and Technology, Tunis, TUNISIA
close all
close all hidden
clear
clc
global t1 h sys X par2
%obtaining step response and transfer function of the tank
[t1 h]=ode45(@tank,[0:1:500],0);
par=fminsearch(@obj,[3,0.4]);
figure(1)
plot(t1,h,'r')
hold on
num=[1];
den=[par(1),par(2)];
disp('transfer function of tank')
sys=tf(num,den)
[y t2]=step(sys,0:1:500);
plot(t2,y,'b')
% using genetic algorithm to obtain the real PID controller
% parameters (gain, integral and derivative time constants)
binousga2;
disp('PID controller parameters:')
par2=X
% tranfer function of PID controller
num=[par2(2) 1];
den=[par2(2) 0];
pid1=tf(num,den);
num=[par2(3) 1];
den=[0.1*par2(3) 1];
pid2=tf(num,den);
disp('transfer function of PID controller')
pid=par2(1)*pid1*pid2
% plotting results of feedback loop
% tank's height set point is equal to 2
sys_series=series(pid,sys);
sys_controlled=feedback(sys_series,1);
u=2*ones(501,1);
[y1 t3]=lsim(sys_controlled,u,0:0.01:5);
figure(2)
plot(t3,y1,'g')
% running simulink to check result
sim('binous')
hold on
plot(t4,y4,'r')
没有合适的资源?快使用搜索试试~ 我知道了~
基于遗传算法工具箱和fminsearch商业化控制坦克高度附matlab代码
共13个文件
m:5个
png:2个
mat:2个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 95 浏览量
2022-10-12
14:33:42
上传
评论
收藏 41KB ZIP 举报
温馨提示
1.版本:matlab2019a,不会运行可私信 2.领域:【控制】 3.内容: 基于遗传算法工具箱和fminsearch商业化控制坦克高度附matlab代码 4.适合人群:本科,硕士等教研学习使用
资源推荐
资源详情
资源评论
收起资源包目录
【控制】基于遗传算法工具箱和fminsearch商业化控制坦克高度附matlab代码 上传.zip (13个子文件)
binous.slxc 5KB
binousga2.m 939B
Main.m 1KB
DTGA.gif 16KB
tank.m 329B
obj.m 567B
obj2.m 829B
slprj
sim
varcache
binous
varInfo.mat 664B
tmwinternal
simulink_cache.xml 312B
checksumOfCache.mat 392B
2.png 9KB
binous.mdl 19KB
3.png 7KB
tank
共 13 条
- 1
资源评论
天天Matlab科研工作室
- 粉丝: 3w+
- 资源: 7259
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功