系统建模与仿真习题2及答案Word文档下载推荐.docx
《系统建模与仿真习题2及答案Word文档下载推荐.docx》由会员分享,可在线阅读,更多相关《系统建模与仿真习题2及答案Word文档下载推荐.docx(19页珍藏版)》请在冰豆网上搜索。
![系统建模与仿真习题2及答案Word文档下载推荐.docx](https://file1.bdocx.com/fileroot1/2022-12/12/5f6c1922-a765-46db-97d1-7d4e26f4d6f0/5f6c1922-a765-46db-97d1-7d4e26f4d6f01.gif)
(2)
由于
方法1:
将
转换为近似多项式。
s=tf('
s'
);
G=(24*s+36)/(s^2*(s+1)^3);
[num,den]=pade(2,2);
G1=feedback(tf(num,den)*G,1)
结果:
24s^3-36s^2-36s+108
------------------------------------------------------------
s^7+6s^6+15s^5+19s^4+36s^3-33s^2-36s+108
方法2:
将G*Gc/(1+G*Gc*H)中的分母中的
G1=feedback(G,tf(num,den));
G1.iodelay=2
24s^3+108s^2+180s+108
exp(-2*s)*-------------------------------------------------------------------------------
s^7+6s^6+15s^5+19s^4+36s^3-33s^2-36s+108
2.假定系统为:
请检查该系统是否为最小实现,如果不是最小实现,请从传递函数的角度解释该模型为何不是最小实现,并求其最小实现。
A=[-9-26-240;
1000;
0100;
011-1];
B=[1;
0;
0];
C=[0112];
D=0;
G=ss(A,B,C,D);
sys=tf(G)
Gmin=minreal(sys)
G1=ss(Gmin)
sys=zpk(G)
传递函数表示:
s^2+4s+3
---------------------------------------------
s^4+10s^3+35s^2+50s+24
最小实现后的传递函数模型:
1
---------------------
s^2+6s+8
最小实现后的状态方程:
a=
x1x2
x1-6-2
x240
b=
u1
x10.5
x20
c=
y100.5
d=
y10
Continuous-timemodel.
不是最小实现的原因是分子分母没有对消
Zero/pole/gain:
(s+1)(s+3)
-----------------------
(s+1)(s+2)(s+3)(s+4)
3.双输入双输出系统的状态方程:
(1)试将该模型输入到MATLAB空间,并求出该模型相应的传递函数矩阵。
(2)将该状态空间模型转化为零极点增益模型,确定该系统是否为最小实现模型。
如果不是,请将该模型的传递函数实现最小实现。
(3)若选择采样周期为
,求出离散后的状态方程模型和传递函数模型。
(4)对离散的状态空间模型进行连续变化,测试一下能否变回到原来的系统。
A=[2.25-5-1.25-0.5;
2.25-4.25-1.25-0.25;
...
0.25-0.5-1.25-1;
1.25-1.75-0.25-0.75];
B=[46;
24;
22;
02];
C=[0001;
0202];
D=[00;
00];
G=ss(A,B,C,D)
Gtf=tf(G)
x1x2x3x4
x12.25-5-1.25-0.5
x22.25-4.25-1.25-0.25
x30.25-0.5-1.25-1
x41.25-1.75-0.25-0.75
u1u2
x146
x224
x322
x402
y10001
y20202
y100
y200
Transferfunctionfrominput1tooutput...
s^2+3s+2.25
#1:
---------------------------------------------------------
s^4+4s^3+6.25s^2+5.25s+2.25
4s^3+14s^2+22s+15
#2:
----------------------------------------------
Transferfunctionfrominput2tooutput...
2s^3+6.5s^2+7.75s+3.75
--------------------------------------
12s^3+32s^2+37s+17
Gtf=zpk(G)
sys=minreal(Gtf)
Zero/pole/gainfrominput1tooutput...
(s+1.5)^2
------------------------
(s+1.5)^2(s^2+s+1)
4(s+1.5)(s^2+2s+2.5)
---------------------------
Zero/pole/gainfrominput2tooutput...
2(s+1.5)(s^2+1.75s+1.25)
-------------------------------
12(s+1)(s^2+1.667s+1.417)
--------------------------------
说明不是最小实现模型,最小实现模型如下:
--------------
(s^2+s+1)
4(s^2+2s+2.5)
----------------------
(s+1.5)(s^2+s+1)
2(s^2+1.75s+1.25)
-----------------------
(3)
G1=ss(A,B,C,D);
G2=tf(G1);
s1=c2d(G1,0.1)
s2=c2d(G2,0.1)
x11.192-0.4455-0.1013-0.04215
x20.20080.6124-0.1058-0.01884
x30.01526-0.034990.8849-0.09054
x40.1147-0.1622-0.019730.9279
x10.38330.5527
x20.19060.3694
x30.18790.1764
x40.0048330.1927
Samplingtime:
0.1
Discrete-timemodel.
0.004833z^3-0.003645z^2-0.004467z+0.003463
---------------------------------------------------
z^4-3.617z^3+4.908z^2-2.962z+0.6703
0.3908z^3-1.038z^2+0.9242z-0.2754
0.1927z^3-0.5181z^2+0.465z-0.1392
1.124z^3-3.078z^2+2.817z-0.8611
(4)
s1=c2d(G,0.1);
sys1=d2c(s1)
x41.387e-0152
4.假设系统的传递函数模型为:
系统状态的初始值为
,假设系统的输入为
。
(1)将该传递函数模型转化为状态空间模型。
(2)利用公式
求解
的状态以及系统输出的解析解。
(3)根据上述的解析解作出
时间区间的状态以及系统输出曲线。
(4)采用lsim函数方法直接作出
时间区间的状态以及系统输出曲线,并与(3)的结果作比较。
num=[12];
den=[122];
G=tf(num,den);
sys=ss(G)
x1-2-2
x210
x12
y10.51
于是系统的状态空间方程为:
symstt1x
A=[-2-2;
10];
B=[2;
C=[0.51];
x0=[1;
-2];
C1=expm(A*t);
C2=int((expm(A*(t-t1)))*B*exp(-2*t1),'
t1'
0,t);
x=C1*x0+C2;
x1=x(1,:
)
x2=x(2,:
y=C*x
x1=
exp(-t)*cos(t)+3*exp(-t)*sin(t)-2*(cos(t)^2+sin(t)^2-cos(t)*exp(t))/exp(t)^2
x2=
-exp(-t)*sin(t)-2*exp(-t)*cos(t)+(cos(t)^2+sin(t)^2+exp(t)*sin(t)-cos(t)*exp(t))/exp(t)^2
y=
-3/2*exp(-t)*cos(t)+1/2*exp(-t)*sin(t)-(cos(t)^2+sin(t)^2-cos(t)*exp(t))/exp(t)^2+(cos(t)^2+sin(t)^2+exp(t)*sin(t)-cos(t)*exp(t))/exp(t)^2
y=C*x;
m=0:
0.1:
10;
x=subs(x,{t},{m});
%给syms定义的变量t赋值
y=subs(y,{t},{m});
plot(m,x1,m,x2,m,y);
legend('
x1'
'
x2'
y'
gridon
t=0:
u=exp(-2*t);
[y,x]=lsim(A,B,C,D,u,t,x0);
plot(t,x(:
1),t,x(:
2),t,y);
5.已知矩阵
(1)取
,利用expm(At)函数绘制求
的状态转移矩阵,看运行的速度如何?
(2)采用以下程序绘制
的状态转移矩阵的曲线,看运行的速度如何?
A=[01-1;
-2-33;
21-2];
2;
Nt=length(t);
fork=1:
Nt
F(:
:
k)=expm(A*t(k));
end
z=reshape(F,[9,Nt]);
plot(t,z)
grid
title('
系统的状态转移矩阵'
symst
-233;
Q=expm(A*t)
计算结果复杂,速度慢!