,,,
:
" "
Matlab (c Simulink) , , . . 1.1, - . 1.1. .
1.
. 1.1.
1.1
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
|
a1 |
0,1 | 0,1 | 3 | 0,3 | 0,4 | 0,8 | 1 | 2 | 2 | 2 |
a2 |
0.1 | 0,3 | 0,2 | 0,5 | 0,6 | 1,2 | 3 | 3 | 4 | 6 |
k1 |
0,1 | 0,015 | 0,4 | 5 | 3 | 0,48 | 1,5 | 1 | 4 | 24 |
k2 |
0,1 | 2 | 1 | 0,03 | 0,08 | 2 | 2 | 6 | 2 | 0,5 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
|
a1 |
3 | 0,8 | 0,9 | 0,9 | 0,9 | 1,2 | 3 | 4 | 4 | 5 |
a2 |
7 | 0,4 | 0,5 | 0,7 | 0,9 | 1,8 | 2 | 3 | 5 | 6 |
k1 |
0,5 | 0,5 | 2 | 0,12 | 0,5 | 0,1 | 4 | 2 | 6 | 4 |
k2 |
42 | 0,24 | 0,025 | 0,25 | 0,02 | 1,6 | 0,5 | 3 | 2 | 5 |
- .
( ) :
- ; ; I(p) ; (I(p) -).
,
i‑ j‑ , i‑ - j‑ .
,
k‑ k‑ . , . 1.2.2 1.2.3.
,
i‑ j‑ , i‑ j‑ .
Matlab , .
: (. . 1.1) - , . (, ) .
: 4 , , 4 , .
, 8 , , (. . , , -, , -, - , , -, ).
5 .
1) - w_h_init.m, :
%
%
% mdl‑
t_end = 1; %
h_max = 0.01; %
%
a1 = 2;
a2 = 3;
k1 = 1;
k2 = 6;
t_end h_max , , .
2), 3) Simulink w.mdl h.mdl, (. 1.2 1.3).
Simulation Parameters, Simulation\Simulation parameters , mdl‑ (. 1.4).
. 1.4.
, - , State-Space Continuous Simulink. . . , Create Subsystem Edit Ctrl+G.
. 1.5.
. 1.6.
-
( -) Step Pulse Generator Sources. , , - ( 1), .. , .
ࠠ
. 1.7. :
Pulse Generator; Step
MATLAB Fcn Function&Tables Clock.
. 1.8. Matlab Fcn,
, , , Mtlab To Workspace Sinks, , . .
. 1.9. To Workspace
( Scope Sinks).
4), 5) - w_stop.m h_stop.m, , , Figure.
% ( w_stop.m)
%
close all
figure
plot (t_, w11_s, 'r-', t_, w11_vm, 'b', t_, w11_a, 'm .')
grid on
xlabel ('t, c')
ylabel('w11')
title (' w11 ')
legend ('w11‑struct', 'w11‑VM', 'w11‑analit', 0)
figure
plot (t_, w21_s, 'r-', t_, w21_vm, 'b', t_, w21_a, 'm .')
grid on
xlabel ('t, c')
ylabel('w21')
title (' w21 ')
legend ('w21‑struct', 'w21‑VM', 'w21‑analit', 0)
figure
plot (t_, w12_s, 'r-', t_, w12_vm, 'b', t_, w12_a, 'm .')
grid on
xlabel ('t, c')
ylabel('w12')
title (' w12 ')
legend ('w12‑struct', 'w12‑VM', 'w12‑analit', 0)
figure
plot (t_, w22_s, 'r-', t_, w22_vm, 'b', t_, w22_a, 'm .')
grid on
xlabel ('t, c')
ylabel('w22')
title (' w22 ')
legend ('w22‑struct', 'w22‑VM', 'w22‑analit', 0)
% ( h_stop.m)
%
close all
figure
plot (t_, h11_s, 'r-', t_, h11_vm, 'b', t_, h11_a, 'm .')
grid on
xlabel ('t, c')
ylabel('h11')
title (' h11 ')
legend ('h11‑struct', 'h11‑VM', 'h11‑analit', 0)
figure
plot (t_, h21_s, 'r-', t_, h21_vm, 'b', t_, h21_a, 'm .')
grid on
xlabel ('t, c')
ylabel('h21')
title (' h21 ')
legend ('h21‑struct', 'h21‑VM', 'h21‑analit', 0)
figure
plot (t_, h12_s, 'r-', t_, h12_vm, 'b', t_, h12_a, 'm .')
grid on
xlabel ('t, c')
ylabel('h12')
title (' h12 ')
legend ('h12‑struct', 'h12‑VM', 'h12‑analit', 0)
figure
plot (t_, h22_s, 'r-', t_, h22_vm, 'b', t_, h22_a, 'm .')
grid on
xlabel ('t, c')
ylabel('h22')
title (' h22 ')
legend ('h22‑struct', 'h22‑VM', 'h22‑analit', 0)
Matlab, (m‑), .
(- ) - m‑ Simulink.
w_h_init.m Matlab (Workspace).
w.mdl . .
Simulink w_stop.m. , Edit\Copy Figure, - , MS Word.
. 1.3.3 1.3.4, h.mdl h_stop.m.
. w_h_init.m w_stop.m (h_stop.m) , mdl‑ m‑. :
- , mdl- m ;
- mdl‑;
- :
set_param ('w', 'InitFcn', 'w_h_init')
set_param ('w', 'StopFcn', 'w_stop')
set_param ('h', 'InitFcn', 'w_h_init')
set_param ('h', 'StopFcn', 'h_stop')
- Simulink mdl‑ Edit\Update Diagram .
: , , , .
.
(, ).
w(t) h(t), 8 .
.
4, , .
, - ( ), - () , . , . 2.1.
2.1
|
||
1 | ||
2 | ||
3 | ||
4 | - | |
5 | ||
6 | - | |
7 | ||
8 | ||
9 |
, . 2.1, 69.
.
.
.
.
() - . .
- .
.
, , 2 3 . , . .
().
: , - . , - , , , ; , (/) ; , , ( ); (, , , , .
- Matlab. , TF_zv.m :
%
%
function W = TF_zv (N_zv, inp_param)
p = tf('p');
switch N_zv
case 1, % , N_zv = 1, inp_param = [k]
k = inp_param(1);
W = k/p;
case 2, % , N_zv = 2, inp_param = [k, T]
k = inp_param(1);
T = inp_param(2);
W = k/(T*p+1);
case 3, % , N_zv = 3, inp_param = [k, T]
k = inp_param(1);
T = inp_param(2);
W = (k*p)/(T*p+1);
case 4, %- , N_zv = 4, inp_param = [T1, T2]
T1 = inp_param(1);
T2 = inp_param(2);
W = (T1*p+1)/(T2*p+1);
case 5, % , N_zv = 5, inp_param = [k, T, ksi]
k = inp_param(1);
T = inp_param(2);
ksi = inp_param(3);
W = k/(T^2*p^2+2*ksi*T*p+1);
case 6, %- 1‑ ., N_zv = 6, inp_param = [T1, T2]
T1 = inp_param(1);
T2 = inp_param(2);
W = (1‑T1*p)/(1+T2*p);
case 7, % 1‑ ., N_zv = 7, inp_param = [k, T]
k = inp_param(1);
T = inp_param(2);
W = k/(T*p‑1);
case 8, % 2‑ ., N_zv = 8, inp_param = [k, T, ksi]
k = inp_param(1);
T = inp_param(2);
ksi = inp_param(3);
W = k/(T^2*p^22*ksi*T*p+1);
case 9, % , N_zv = 9, inp_param = [T, ksi1, ksi2]
T = inp_param(1);
ksi1 = inp_param(2);
ksi2 = inp_param(3);
W = (T^2*p^2+2*ksi1*T*p+1)/(T^2*p^2+2*ksi2*T*p+1);
end
%end of function TF_zv
Matlab .
. 2.1, N_zv TF_zv. inp_param ; . switchcase, N_zv .
- . , kol_zv.m :
% :
%
clear all
%
clc
%
set (0,'ShowHiddenHandles', 'on')
delete (get(0,'Children'))
% (N_zv = 5)
% .
% inp_param = [k, T, ksi] (. TF_zv.m)
% k
W_11 = TF_zv (5, [1,1,0.707]);
W_12 = TF_zv (5, [2,1,0.707]);
W_13 = TF_zv (5, [3,1,0.707]);
%
W_21 = TF_zv (5, [1,0. 354,0.707]);
W_22 = TF_zv (5, [1,0. 707,0.707]);
W_23 = TF_zv (5, [1,1. 414,0.707]);
% ksi
W_31 = TF_zv (5, [1,0. 5,0.3]);
W_32 = TF_zv (5, [1,0. 5,0.5]);
W_33 = TF_zv (5, [1,0. 5,0.7]);
% T ksi
W_41 = TF_zv (5, [1,0. 3,0.3]);
W_42 = TF_zv (5, [1,0. 5,0.5]);
W_43 = TF_zv (5, [1,0. 7,0.7]);
% k
%
ltiview({'bode'}, W_11,'b-', W_12,'r-', W_13,'k-')
%
ltiview({'nyquist'}, W_11,'b-', W_12,'r-', W_13,'k-')
% w(t)
ltiview({'impulse'}, W_11,'b-', W_12,'r-', W_13,'k-')
% h(t)
ltiview({'step'}, W_11,'b-', W_12,'r-', W_13,'k-')
% T
%
ltiview({'bode'}, W_21,'b-', W_22,'r-', W_23,'k-')
%
ltiview({'nyquist'}, W_21,'b-', W_22,'r-', W_23,'k-')
% w(t)
ltiview({'impulse'}, W_21,'b-', W_22,'r-', W_23,'k-')
% h(t)
ltiview({'step'}, W_21,'b-', W_22,'r-', W_23,'k-')
% ksi
%
ltiview({'bode'}, W_31,'b-', W_32,'r-', W_33,'k-')
%
ltiview({'nyquist'}, W_31,'b-', W_32,'r-', W_33,'k-')
% w(t)
ltiview({'impulse'}, W_31,'b-', W_32,'r-', W_33,'k-')
% h(t)
ltiview({'step'}, W_31,'b-', W_32,'r-', W_33,'k-')
% T ksi
%
ltiview({'bode'}, W_41,'b-', W_42,'r-', W_43,'k-')
%
ltiview({'nyquist'}, W_41,'b-', W_42,'r-', W_43,'k-')
% w(t)
ltiview({'impulse'}, W_41,'b-', W_42,'r-', W_43,'k-')
% h(t)
ltiview({'step'}, W_41,'b-', W_42,'r-', W_43,'k-')
Matlab .
: m‑ TF_zv, . 2.3.1, kol_zv.m TF_zv.m .
ltiview, , , , (, .. plot).
.
ltiview , . . grid.
LTI Viewer File\Print to Figure, Figure, , Edit\Copy Figure.
- ( ) . . , - ( , , , ), .
1. , , : , , , . , ( ) .
2. ( 8 ).
: , , .
, . 2.2.
, . 2.3.3.
.
.
: - - , .
4, , .
, .
, () . . 3.1. , . 3.1.
3.1
|
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
|
1 |
T1 |
0,5 | 0,5 | 1,0 | 1,0 | 2,0 | 2,0 | 3,0 | 3,0 | 5,0 | 5,0 |
T2 |
0,1 | 0,1 | 0,2 | 0,2 | 0,4 | 0,4 | 0,6 | 0,6 | 1,0 | 1,0 | |
T3 |
0,5 | 1,0 | 1,0 | 2,0 | 2,0 | 4,0 | 3,0 | 6,0 | 5,0 | 10,0 | |
2 |
T1 |
1 | 1 | 2 | 2 | 4 | 4 | 6 | 6 | 8 | 8 |
T2 |
0,02 | 0,1 | 0,04 | 0,2 | 0,08 | 0,4 | 0,12 | 0,6 | 0,16 | 0,8 | |
3 |
T1 |
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
T2 |
4,705 | 9,41 | 14,15 | 18,82 | 23,53 | 28,23 | 32,94 | 37,64 | 42,35 | 47,05 | |
|
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
|
1 |
T1 |
0,25 | 0,25 | 0,5 | 0,5 | 1,0 | 1,0 | 2,0 | 2,0 | 4,0 | 4,0 |
T2 |
0,1 | 0,1 | 0,2 | 0,2 | 0,4 | 0,4 | 0,8 | 0,8 | 1,6 | 1,0 | |
T3 |
2,0 | 3,0 | 4,0 | 6,0 | 8,0 | 120 | 16 | 24 | 32 | 48 | |
2 |
T1 |
10 | 10 | 20 | 20 | 40 | 40 | 60 | 60 | 80 | 80 |
T2 |
0,2 | 1 | 0,4 | 2 | 0,8 | 4 | 1,2 | 6 | 1,6 | 8 | |
3 |
T1 |
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
T2 |
5,671 | 11,34 | 17,01 | 22,68 | 28,36 | 34,03 | 38,70 | 45,37 | 51,04 | 56,71 |
:
.
() .
() - , , .
, . k , ( ), .
% (
% ), prog.m
%
clear all
%
clc
%
set (0,'ShowHiddenHandles', 'on')
delete (get(0,'Children'))
% #20
T1_s1 = 4;
T2_s1 = 1;
T3_s1 = 48;
K_s1 = 1;
T1_s2 = 80;
T2_s2 = 8;
K_s2 = 1;
T1_s3 = 10;
T2_s3 = 56.71;
K_s3 = 1;
%
p = tf('p');
R_s1 = K_s1*(T1_s1*p+1);
Q_s1 = (T2_s1*p+1)*(T3_s1*p‑1)*p;
W_s1_r = R_s1/Q_s1;
W_s1_z = R_s1/(Q_s1+R_s1);
R_s2 = K_s2*(T1_s2*p+1)^2;
Q_s2 = (T2_s2*p+1)^2*p^3;
W_s2_r = R_s2/Q_s2;
W_s2_z = R_s2/(Q_s2+R_s2);
R_s3 = K_s3;
Q_s3 = (T1_s3^2*p^2+1)*(T2_s3*p+1)^3;
W_s3_r = R_s3/Q_s3;
W_s3_z = R_s3/(Q_s3+R_s3);
%
sys_num = 1;
%
switch sys_num
case 1,
%
ltiview({'bode'}, W_s1_r);
%
ltiview({'nyquist'}, W_s1_r);
%
ltiview({'step'}, W_s1_z);
%
[zeros_s1_z, poles_s1_z, koef_s1_z] = zpkdata (zpk(W_s1_z), 'v');
poles_s1_z
case 2,
%
ltiview({'bode'}, W_s2_r);
%
ltiview({'nyquist'}, W_s2_r);
%
ltiview({'step'}, W_s2_z);
%
[zeros_s2_z, poles_s2_z, koef_s2_z] = zpkdata (zpk(W_s2_z), 'v');
poles_s2_z
case 3,
%
ltiview({'bode'}, W_s3_r);
%
ltiview({'nyquist'}, W_s3_r);
%
ltiview({'step'}, W_s3_z);
%
[zeros_s3_z, poles_s3_z, koef_s3_z] = zpkdata (zpk(W_s3_z), 'v');
poles_s3_z
end
Matlab .
sys_num , . LTI Viewer, .
-, 1 ( k 1). , . k,
(k=k);
(k=k);
(k=k) 10 .
, .
k , k . :
, , ;
(-1, j0) , , ;
, ;
.
.
k=1, , k= k, k, k (.. 1+ + 3 ). . . .
. 3.3.2 3.3.4 2 3.
4, , .
. .
, 3, ( . 4.1 ).
4.1 (. . 3.1)
|
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
|
1 | 2 | 3 | 1 | 2 | 3 | 1 | 2 | 3 | 1 |
|
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
|
2 | 3 | 1 | 2 | 3 | 1 | 2 | 3 | 1 | 2 |
() - .
, .. ( ) - . .
- .
. 4.2.1 4.2.2 (.. + ) .
.
.
, , () () , , 2 3, .
-,
. Simulink ,
.
1 (sys1_mod.mdl) . 4.1 4.2,
m‑ (sys1.m) :
%
% #1
%
%
clear all
%
clc
%
set (0,'ShowHiddenHandles', 'on')
delete (get(0,'Children'))
% mdl‑
h_max = 0.01;%
t_end = 20; %
%
%
p = tf('p');
% #1 #20
T1_s1 = 4;
T2_s1 = 1;
T3_s1 = 48;
%
disp (' #1 ');
disp([' ' num2str (T1_s1) '*p+1'])
disp ('');
disp([' (' num2str (T2_s1) '*p+1)*(' num2str (T3_s1) '*p‑1)*p']);
R_s1 = T1_s1*p+1;
Q_s1 = (T2_s1*p+1)*(T3_s1*p‑1)*p;
W_s1_r = R_s1/Q_s1
% ss‑ ( % A, B, C, D)
sys1_r = ss (W_s1_r);
[A_s1_r, B_s1_r, C_s1_r, D_s1_r] = ssdata (sys1_r);
disp (' A, B, C, D ');
A_s1_r
B_s1_r
C_s1_r
D_s1_r
%
[zeros_s1_r, poles_s1_r, koef_s1_r] = zpkdata (zpk(W_s1_r), 'v');
disp (' ');
zeros_s1_r
poles_s1_r
%
% c poles_s1_r
disp ('C. . - ( )');
poles_s1_r_dp = eig([-47/48 1/48 0; 1 0 0; 0 1 0])
% (
% )
disp (' ');
poles_s1_z_g = [-2+2*j; -22*j; -0.25]
% L,
% . .
[L_s1, PREC_s1, MESSAGE_s1] = PLACE (A_s1_r, B_s1_r, poles_s1_z_g);
disp (' ');
L_s1
%
A_s1_z = A_s1_r-B_s1_r*L_s1;
% B, C, D
B_s1_z = B_s1_r;
C_s1_z = C_s1_r;
D_s1_z = D_s1_r;
% ss‑
sys1_z = ss (A_s1_z, B_s1_z, C_s1_z, D_s1_z);
% (
% )
W_s1_z = tf (sys1_z);
[num_s1, den_s1] = tfdata (W_s1_z, 'v');
disp (' ');
%
% ,
% , ..
%
Kv_s1 = den_s1 (length(den_s1))/num_s1 (length(num_s1))
% ss‑
B_s1_z = Kv_s1*B_s1_r;
sys1_z = ss (A_s1_z, B_s1_z, C_s1_z, D_s1_z);
%
%( )
[zeros_s1_z_f, poles_s1_z_f, koef_s1_z_f] = zpkdata (zpk(sys1_z), 'v');
disp (' ');
zeros_s1_z_f
poles_s1_z_f
%,
%
figure
plot (real(poles_s1_r), imag (poles_s1_r), 'rs', real (zeros_s1_r), imag (zeros_s1_r), 'ro')
hold on
plot (real(poles_s1_z_f), imag (poles_s1_z_f), 'bs', real (zeros_s1_z_f),
imag (zeros_s1_z_f), 'bo', 'MarkerSize', 14)
grid on
title (' ')
xlabel ('real(z)');
ylabel ('imag(z)');
legend ('poles of sys1 (razomk)', 'zeros of sys1 (razomk)',
'poles of sys1 (zamkn)', 'zeros of sys1 (zamkn)', 0);
% c
ltiview({'step'}, sys1_z, t_end);
grid on
%
open_system ('sys1_mod.mdl');
%
sim ('sys1_mod');
Matlab .
, :
( );
ss‑ A, B, C, D;
;
;
, ;
(.. ).
.
( ): , , , Matlab; .
, , Simulink, .
. 4.1. Simulink
ࠠ
. 4.2. : ; State-Space
- , , , . State-Space , . , Matlab place. Simulink, . - .
, LTI Viewer ( LTI Viewer . ) tp s ( ). () 5%. umax Simulink. , . 4.2, 4.3 4.4.
: , 2‑ , ; , , .
, -, ( ); -, , , ; -, , ( ). , , , .
, p1,2 = a jb ( , tp3/|a|), |b|/|a| .
4.2.
4.3.
0.05 | 0.075 | 0.15 | 0.5 | 1.5 | ||
0.1 | 0.15 | 0.3 | 1.0 | 3.0 | ||
, |
||||||
0.1 | 0.15 | 0.3 | 1.0 | 3.0 | ||
0.1 | 0.15 | 0.3 | 1.0 | 3.0 | ||
, |
||||||
0.5 | 0.75 | 1.5 | 5 | 15 | ||
0.1 | 0.15 | 0.3 | 1.0 | 3.0 | ||
, |
4.4
0.07 | 0.1 | 0.15 | 0.3 | 0.8 | ||
0.7 | 1 | 1.5 | 3 | 8 | ||
, % |
||||||
0.35 | 0.5 | 0.75 | 1.5 | 4 | ||
0.7 | 1 | 1.5 | 3 | 8 | ||
, % |
, Matlab. .
: t = 6 , s1520%. , , , .
, . .
4, , .
1. .. / .. , .. . .: , 1975. 768 .
2. / . .. . .: , 1986. . 1. 367 .
3. / . .. . .: , 1968. . 1. 424 .
4. .. / .. . .: , 1989. 304 .
5. .. / .. . .: , 1977. 560 .
6. .. / .. . .: , 1971. 472 .
7. . / . , . , . . .: , 1970. 620 .
8. . 5- ., . . / . .. . .: , 1978. 512 .
9. . 2- ., . . / . .. . .: , 1979. 545 .
10. . Simulink 4. / . . .: , 2002. 528 .
11. . Matlab: / . . .: , 2001. 560 .
12. .. Matlab 5.3/6.x / .. . .: -, 2002. 736 .
13. .. Control System Toolbox. MATLAB 5 / .. , .. ; . . .. . .: -, 1999. 287 .
: " " Matlab (c
Copyright (c) 2024 Stud-Baza.ru , , , .