欢迎光临散文网 会员登陆 & 注册

控制系统仿真(MATLAB版)(六)

2020-10-22 00:22 作者:永远的修伊  | 我要投稿

控制系统时域运动响应分析

>> A = [-2 -2.5 -2.5;1 0 0; 0 1 0]; 

>> B = [1;0;0];

>> C = [0 1.5 1];

>> D = 0;

>> x0 = [2 2 0];

>> G = ss(A,B,C,D);

>> initial(G,x0)


initial conditions

>> A = [-0.2 0.5 0 0 0 ;0 -1.5 1.6 0 0 ;0 0 -14.3 85.8 0;0 0 0 -33.3 100;0 0 0 0 -10];

>> B = [0;0;0;0;30];

>> C = [1,0,0,0,0];

>> D = 0;

>> G = ss(A,B,C,D)


G =

 

  A = 

          x1     x2     x3     x4     x5

   x1   -0.2    0.5      0      0      0

   x2      0   -1.5    1.6      0      0

   x3      0      0  -14.3   85.8      0

   x4      0      0      0  -33.3    100

   x5      0      0      0      0    -10

 

  B = 

       u1

   x1   0

   x2   0

   x3   0

   x4   0

   x5  30

 

  C = 

       x1  x2  x3  x4  x5

   y1   1   0   0   0   0

 

  D = 

       u1

   y1   0

 

Continuous-time state-space model.


>> impulse(G)

impulse response

>> G = tf([5 8],[1 4 6 3 3]);

>> step(G)


>> s = tf('s');

>> G = 143.7*(s+1.5)/((s^2+2*s+5)*(s^2+10*s+26)*(s+1.7))


G =

 

                     143.7 s + 215.5

  -----------------------------------------------------

  s^5 + 13.7 s^4 + 71.4 s^3 + 188.7 s^2 + 303.4 s + 221

 

Continuous-time transfer function.


>> zpk(G)


ans =

 

               143.7 (s+1.5)

  ---------------------------------------

  (s+1.7) (s^2 + 10s + 26) (s^2 + 2s + 5)

 

Continuous-time zero/pole/gain model.


>> pzmap(G)

零极点


>> [p,z] = pzmap(G)


p =

  -5.0000 + 1.0000i

  -5.0000 - 1.0000i

  -1.0000 + 2.0000i

  -1.0000 - 2.0000i

  -1.7000 + 0.0000i

z =

   -1.5000

判断出主导极点                 

p =

  -5.0000 + 1.0000i

  -5.0000 - 1.0000i

  -1.0000 + 2.0000i

  -1.0000 - 2.0000i

  -1.7000 + 0.0000i

   用主导极点简化原系统(高阶系统降阶),注意开环增益的变化

转换后如下

>> G1 = 147.3/26*(s+1.5)/((s+1.7)*(s^2+2*s+5))

G1 =

        5.665 s + 8.498

  ---------------------------

  s^3 + 3.7 s^2 + 8.4 s + 8.5


Continuous-time transfer function.


>> zpk(G1)


ans =

 

      5.6654 (s+1.5)

  ----------------------

  (s+1.7) (s^2 + 2s + 5)

 

Continuous-time zero/pole/gain model.

                         

勉强能接受

     

>> G = tf(500,conv([1 10 50],[1 10]))


G =

 

             500

  --------------------------

  s^3 + 20 s^2 + 150 s + 500

 

Continuous-time transfer function.


>> zpk(G)


ans =

 

            500

  -----------------------

  (s+10) (s^2 + 10s + 50)

 

Continuous-time zero/pole/gain model.


>> pzmap(G)

>> 

>> [p,z] = pzmap(G)

p =

 -10.0000 + 0.0000i

  -5.0000 + 5.0000i

  -5.0000 - 5.0000i

z =

  0×1 empty double column vector

主导极点

p =

 -10.0000 + 0.0000i

  -5.0000 + 5.0000i

  -5.0000 - 5.0000i

降阶

>> G1 = tf(50,[1 10 50])


G1 =

 

        50

  ---------------

  s^2 + 10 s + 50

>> step(G,G1)

>> t = 0:0.01:4*pi;

>> ut1 = sin(t+30/180*pi);

>> ut2 = 2*cos(5*t+30/180*pi);

>> sys = 5*tf([1 1],conv([1 0],[1 4 2 3]));

>> lsim(sys,ut1,t)

lsimplot(sys,ut2,t)

>> G1 = tf([1],conv([1 0],conv([1 2 2],[1 6 13])));

>> G2 = tf([1 12],conv([1 0],conv([1 12 100],[1 10])));

>> G3 = tf([0.05 1],conv([1 0],conv([0.0714 1],[0.0125 0.1 1])));

>> G4 = tf([1 -1 -20],conv([1 0],conv([1 1],[1 3])));

>> rlocus(G1)

>> rlocus(G2)

>> rlocus(G3)

>> rlocus(G4)

G1
G2
G3
G4

>> G = tf([1 2 4],conv([1 0],conv([1 4],conv([1 6],[1 1.4 1]))))


G =

 

                s^2 + 2 s + 4

  -----------------------------------------

  s^5 + 11.4 s^4 + 39 s^3 + 43.6 s^2 + 24 s

 

Continuous-time transfer function.


>> zpk(G)


ans =

 

          (s^2 + 2s + 4)

  ------------------------------

  s (s+6) (s+4) (s^2 + 1.4s + 1)

 

Continuous-time zero/pole/gain model.


>> rlocus(G)

>>sgrid

>> G = tf([1 2],conv([1 0],conv([1 4],conv([1 8],[1 2 5]))));

>> zpk(G)

ans =

             (s+2)

  ----------------------------

  s (s+8) (s+4) (s^2 + 2s + 5)

 

Continuous-time zero/pole/gain model.


rlocus实际模型

>> rlocus(G)    %负反馈

负反馈

>> rlocus(-G)  %正反馈

正反馈

>> G = zpk([],[0;-1;-2],1)

G =

 

        1

  -------------

  s (s+1) (s+2)

 

Continuous-time zero/pole/gain model.

>> rlocus(G,1.5)

幅值裕量和相位裕量

>>  G = zpk([],[0 -1 -2],1.5)


G =

 

       1.5

  -------------

  s (s+1) (s+2)

 

Continuous-time zero/pole/gain model.


>> [gm,pm,wg,wp] = margin(G)


gm =


    4.0000



pm =


   41.5340



wg =


    1.4142



wp =


    0.6118


>> margin(G)







>> wn = 0.7;

>> s = tf('s');

>> kesi = [0.1,0.4,1.0,1.6,2.0];

>> for ii = kesi

       figure;

       G = wn^2/(s^2+2*ii*wn*s+wn^2);

       bode(G);

   end

>> 

>> G = 500*tf([0.0167 1],conv([1 0],conv([0.0025 1],conv([0.05 1],[0.001 1])))) ;

>> bode(G)

>> [gm,pm,wg,wp] = margin(G)


gm =


    7.1968



pm =


   45.5298



wg =


  586.6697



wp =


  161.7414


>> margin(G)

>> nyquist(zpk([-1],[-0.8+1.6*j -0.8-1.6*j],3))

kosi = [0.4,0.7,1.0,1.3];

for ii = kosi

      figure;

      G = tf(1,[1 2*kosi 1]);

      nyquist(G);

end

0.4
0.7
1.0
1.3

>> G1 = zpk([],[0 0 1/5 -5],2);

>> G2 = 8*tf([1 1],conv([1 0 0],conv([1 15],[1 6 10])));

>> G3 = zpk([-3],[0 -50 -20 -10],4);

>> A = [0 2 1;-3 -2 0;1 3 4];

>> B = [4;3;2];

>> C = [1 2 3];

>> D = 0;

>> G4 = ss(A,B,C,D);

>> bode(G1)

>> nyquist(G1)

>> bode(G2)

>> nyquist(G2)

>> bode(G3)

>> nyquist(G3)

>> bode(G4)

>> nyquist(G4)

G1
G1
G2
G2
G3
G3
G4
G4


控制系统仿真(MATLAB版)(六)的评论 (共 条)

分享到微博请遵守国家法律