过程控制系统2-6

过程控制2-6

我的实现:

  1. 使用作图法:先根据算出的阶跃响应数值,一阶线性插值拟合,然后计算斜率,得到拐点(120,7.4),斜率约0.092。推得 τ = 39.28 , T = 217.676 τ=39.28,T=217.676 τ=39.28,T=217.676 。图片粘贴上去有点失真。
    在这里插入图片描述

  2. 使用计算法
    还是先一阶线性插值,然后计算h=0.63,0.39时t的数值,根据
    T = 2 ∗ ( t 2 − t 1 ) T = 2*(t2-t1) %计算时间常数 T=2(t2t1)
    τ = 2 ∗ t 1 − t 2 τ = 2*t1 -t2 %计算延迟时间 τ=2t1t2
    计算时间常数、延迟时间:
    T = 96.1 T = 96.1 %计算时间常数 T=96.1
    τ = 68.15 τ = 68.15 %计算延迟时间 τ=68.15

  3. 对比综合:
    对计算得到的数值在SIMULINK里面进行仿真,在外部.m文件调用,得到如下两图,上面的是计算法得到的,下面的是作图法得到的。相对而言,作图法效果更好。

在这里插入图片描述

在这里插入图片描述

% 作业2-6
% @Author:轩笑鹄
% @Date: 20214619:15
% 参考链接:https://ww2.mathworks.cn/matlabcentral/answers/349598-error-using-griddedinterpolant-the-grid-vectors-must-contain-unique-points
tw = 10;% 输出无变化的时间
t =[10 20 40 60 80 100 120 140 160 180 200 220 240 260 280 300 320 340 360 380 400]-tw;
h1 =[0.00 0.20 0.80 2.00 3.60 5.40 7.40 9.30 11.00 12.60 13.60 14.40 15.10 15.75 16.35 16.85 17.25 17.55 17.75 17.90 18.00];
hh = h1/h1(length(h1)); %转换成无量纲形式
% 绘制单位阶跃响应曲线
plot(t,hh,'r-');

h1 = 0.39; t1 = interp1(hh,t,h1)+tw %一维线性插值计算hh=0.39时的时间t1
h2 = 0.63; t2 = interp1(hh,t,h2)+tw %一维线性插值计算hh=0.63时的时间t2

T = 2*(t2-t1)   %计算时间常数
tao = 2*t1 -t2  %计算延迟时间

t =[0 10 20 40 60 80 100 120 140 160 180 200 220 240 260 280 300 320 340 360 380 400];
h1 =[0 0.00 0.20 0.80 2.00 3.60 5.40 7.40 9.30 11.00 12.60 13.60 14.40 15.10 15.75 16.35 16.85 17.25 17.55 17.75 17.90 18.00];

simOut = sim('exp2_6_mod.mdl',400)
figure(2)
plot(t,h1,'r-',simOut.tout,simOut.yout{1}.Values.data,'b--');
legend('原系统','近似系统');
POINT = 500;
tt =linspace(0,400,POINT);
h2 = interp1(t,h1,tt) ;

figure(3)
t_dif = tt(2:POINT);
h_dif = diff(h2);
plot(tt,h2,'g-');
hold on
y = 0.092*(tt-120)+7.4;
plot(tt,y,'b-');
hold on
xx = linspace(0,400,POINT);
yy= linspace(20,20,POINT);
plot(xx,yy,'r-')
axis([0 400 0 20])

simOut = sim('exp2_6_mod2.mdl',400)
figure(4)
plot(t,h1,'r-',simOut.tout,simOut.yout{1}.Values.data,'b--');
legend('原系统','近似系统');
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值