大连理工大学
过程控制工程大作业
课程名称: 过程控制工程
学院(系): 电子信息与电气工程
专 业:
班 级:
学 号:
学生姓名:
2020 年 6 月 13 日
Jeremy
1.低阶系统
程序代码:
% For process G=2*exp(-5s)/(8s+1)
warning off
close all
clear all
clc
figure
syms st Ts s y
% system parameters
kp=2;
st=5;
tao=8;
Ts=200; % sampling time
f0=100;% sampling frequency
h=1; % Magnitude of the step input change
sim('StepresponseforFOPDT')
plot(t,y)
hold on
% Choice of the frequnecy shift factor----a
a=0.1;
y1=exp(-a*t).*y;
display(y1(end)) % display the last damping value
plot(t,y1, 'r')
legend('real process output','damped output')
% FOPDT Algorithm using s=a
format long
a=0.6; T0=50; % y(T0*f0)*exp(-a*T0)=0
f0=100; % sampling frequency
Gwa=[]; Auw=[]; Fauw=[];
j=sqrt(-1);
s=a;
Tf=t(1: round(T0*f0)); % computation time
ew=exp(-s*Tf);
y2=y(1: round(T0*f0));
u2=u(1: round(T0*f0));
Gs=trapz(Tf,y2.*ew)*s/h; % Step response
dsG1=trapz(Tf,(1-s*Tf).*y2.*ew)/h; % the first derivatives of step
response
dsG2=trapz(Tf,(s*Tf-2).*Tf.*y2.*ew)/h; % the second derivatives of step
response
Q1=dsG1/Gs;
Q2=(dsG2*Gs-dsG1^2)/Gs^2;
tao=(s*Q2+sqrt(Q2))/(1-s^2*Q2) % s^2*Q2-1=-0.8888<0
st=-Q1-tao/(tao*s+1)
kp=Gs*(tao*s+1)*exp(st*s)
format long
syms wu
fun=inline('-3.0*wu-atan(2*wu)+pi')
wu=fsolve(fun,[0.5],optimset('TolFun', 0.1e-4, 'Display','iter'))
运行结果:
4.122307244770161e-09
tao =
7.999796509272135
st =
5.000017090379248
kp =
1.999971156670988
fun =
内联函数:
fun(wu) = -3.0*wu-atan(2*wu)+pi
Norm of First-order Trust-region
Iteration Func-count f(x) step optimality radius
0 2 0.733069 3.42 1
1 4 0.00156281 0.214049 0.145 1
2 6 5.1276e-09 0.0108071 0.000261 1
3 8 5.3883e-20 1.96463e-05 8.46e-10 1
wu =
0.724875342832606
仿真:
2.高阶系统辨识
程序代码:
% For process G=1/((-s+1)*(s+1)^5)*exp(-s)
close all
clear all
clc
warning off
figure(1)
- 1
- 2
- 3
- 4
前往页