Вы находитесь на странице: 1из 13

. .

MATLAB

2004



. ..

. .

MATLAB


2004

62-52
32.965
MATLAB
/ .. . . . : . . - .
. -, 2004. 93 .


MATLAB.
, , , .
.

. 58. . 7. .: 11 .

: - . .. ,
. . , . ..

. ..
, 2004 .


..
1. , , .
1.1 . ,

1.2. ...........................
1.3. .
1.4.
1.4.1.
..
1.4.2. ..
2. ..
2.1. ,

2.2. ...
2.3.
2.4. .
2.4.1.

2.4.2.
Simulink
2.4.3.
.
2.5.
cc ,
( )
2.6.
.
3.
3.1. (
).
3.2.
.
3.3. ...
3.4.
( ).
3.5.
..
3.6.
.
4. , , .
4.1. .
4.2.
4.2.1.
..

5
7
7
8
8
9
9
11
13
13
14
15
18
19
20
23
30
31
32
32
34
35
36
37
38
39
40
40
40

4.2.2. . .
4.2.3. ............................................
4.2.4. .
() .
5. ....
5.1.

5.2.

5.3. ,
.
5.4. ...
5.5. .
5.6. ..
5.6.1. .
5.6.2. .
5.7. Sisotool.
6. ,
, ...
7.

8. ...
9. ........
10. ........
11.
( )
12.

..
13. .
13.1.
.
13.2. -

13.3.

1. MATLAB

..
2. MATLAB.
......

41
43
44
46
47
49
51
51
52
52
52
52
53
54
56
57
57
58
59
59
61
61
62
63
66
75
92

2.

W1 (s ) =

10
s 2 + 2s + 1

; W2 (s ) =

1
.
s+1

:
W(s ) = W1 (s) + W2 (s ) .
MATLAB:
>> w1=tf([10],[1 2 1]); w2=tf([1],[1 1]);
w=w1+w2
Transfer function:
s^2 + 12 s + 11
--------------------s^3 + 3 s^2 + 3 s + 1
:
parallel(w1,w2)
.

W(s ) .

:
:

W1 (s ) =

6s 2 + 11

s 3 + 3s 2 + 3s + 1
W(s ) = W1 (s) + W2 (s ) .

; W2 (s ) =

1
.
s+1

2.2.

s+1
;
s+2

W1 (s ) =
:

W2 (s ) =

1
500s

W(s ) = W1 (s )W2 (s ) .

>> w1=tf([1 1],[1 2]); w2=tf([1],[500 0 0]);

w=series(w1,w2)
Transfer function:
s+1
-----------------500 s^3 + 1000 s^2
:
>>w=w1*w2
.

W(s ) .

2.3.
(. 2.1)
:
F(s)
G (s)

E(s)

W1 ( s )

W 2 (s )

H (s )

. 2.1

Y (s)

W1 (s ) =

s +1
;
s+2

W2 (s ) =

1
500 s 2

; H(s ) = 2.

.
1. (. 2.2): H(s) = 1.
G (s)

E(s)

W1 ( s )

W 2 (s )

Y (s)

. 2.2

( s ) =

Y(s )
G (s )

W(s )
1 m W(s )

, W(s) = W1 (s) W2 (s).

>> w1=tf([1 1],[1 2]);w2=tf([1],[500 0 0]);


w=series(w1,w2)
Transfer function:
s+1
[1] feedback
-----------------
500 s^3 + 1000 s^2
>> sys=feedback(w,[1],-1)

-1

Transfer function:
s+1
-------------------------500 s^3 + 1000 s^2 + s + 1
>> sys=feedback(w,[1],+1)

+ 1

Transfer function:
s+1
-------------------------500 s^3 + 1000 s^2 - s 1
feedback
(+ ), .
:
w=w1*w2; sys=w/(1+w); minreal(sys)

minreal .
2. (. 2.3).
H(s) = 2.
G (s )

E (s )

W 2 (s )

W 1 (s )

Y (s )

H (s )

. 2.3

Y ( s)
W ( s)
, W(s) = W1 (s) W2 (s).
( s ) =
=
G( s) 1 + W ( s)H ( s)
>> w1=tf([1 1],[1 2]); w2=tf([1],[500 0 0]); h=tf([2],[1]);
w=series(w1,w2);
sys=feedback(w,h)
Transfer function:
s+1
---------------------------500 s^3 + 1000 s^2 + 2 s + 2

(s ) .

3.

1
E( s )
(s ) =
=
, W(s) = W1 (s) W2 (s).
e
G (s ) 1 + W (s )H (s )
, . 2.4.
w e=1

G (s )

H (s )

W 1 (s )

E (s )

Y (s )

W 2 (s )

. 2.4
H(s) = 2.
>> w1=tf([1 1],[1 2]);w2=tf([1],[500 0 0]);h=tf([2],[1]);
w=series(w1,w2);
wh=series(w,h);

we=tf([1],[1]);
syse=feedback(we,wh)
Transfer function:
500 s^3 + 1000 s^2
----------------------------

e (s ) .

500 s^3 + 1000 s^2 + 2 s + 2

4.
( s) =
f

Y (s)
F ( s)

W2 ( s )
1 + W ( s)H ( s)

, W(s) = W1 (s) W2 (s).

. 2.5. G (s)= 0.
F (s)
G (s)

E (s)

W 2 (s )

W1 ( s )

Y (s)

H (s )
. 2.5
, . 2.6.
F (s)

W 2 (s )

W1 ( s )

H (s )

-1

. 2.6
>> w1=tf([1 1],[1 2]);w2=tf([1],[500 0 0]);h=tf([2],[1]);
w1h=series(w1,h);
sysf=feedback(w2,w1h)
Transfer function:
s+2
--------------------------- (s ) .

500 s^3 + 1000 s^2 + 2 s + 2

Y (s)

4.2.
4.2.1.

:

p (s) = s5+2s4+2s3+4s2+11s+10 = 0.
:
>> p=[1 2 2 4 11 10];
r=roots(p)
r=
0.8950 + 1.4561i
0.8950 - 1.4561i
-1.2407 + 1.0375i
-1.2407 - 1.0375i
-1.3087

,
.
4.2.2. .

W (s ) =

5
(s + 1) 3

? ,
.
:
>> den1= conv ([1 1],[1 1]); den= conv ([den1],[1 1])
den =
1 3 3 1
: (s + 1) 3
>> nyquist([0 0 0 5],[1 3 3 1])

(. 4.1)

<0

=0
>0

. 4.1
>> margin([0 0 0 5],[1 3 3 1])

(. 4.2)

. 4.2
. . 4.2. :
>> [mag,phase,w]=bode([0 0 0 5],[1 3 3 1]);
magdb=20*log10(mag);
[w,mag,magdb,phase], pause
>> [Wm,Wp,Wcg,Wcp]=margin(mag,phase,w)

Wm =
1.6033

()

Wp =
17.4782

()

Wcg =
1.7329

Wcp =
1.3858

cp

:
>> den1= conv ([1 1],[1 1]); den= conv ([den1],[1 1]);
sys=tf([5], den);
margin(sys)
, . 4.2.