.


:




:

































 

 

 

 


. 1.




1. .

2. .

3. .

4. k, kd, k -, - ϲ-.

5. (, , ).

6. .

7. .

 


 

MATLAB.

MatLab - . MatLab, , , .

MatLab , MATLAB for Windows ( 4.0), Matlab, :

Signal Processing Toolbox " ",

Optimization Toolbox "",

Neural Network Yoolbox " ",

Control System Yoolbox" ";

SplineToolbox "";

SIMULINK (Dynamic System Simulation Software) " "

MatLab , , , toolbox ( ). , m-, . - MatLab MATLAB for Windows ( 4.0), - Matlab, Signal.

MatLab .

matlab

Matlab

Matlab . : ACOT, PLOT, EIG, CEIL, CUMSUM, BALANCE, MAX, SORT, SUM, MIN, RATS.

:

1: F(x) .

0,01.

ABS - ABS() . -, ABS() , .

PLOT - . PLOT(X,Y) X ( - , - ). X Y , , .

:

x = -10:0.01:10;

y=acot(x)+2*(x-2).^2-abs(4*x-3);

Warning: Divide by zero.

(Type "warning off MATLAB:divideByZero" to suppress this warning.)

> In C:\MATLAB6p5\toolbox\matlab\elfun\acot.m at line 8

plot(x,y);

EIG

EIG (A, B) , A .

[V,D]=E1G(A,B) D, , V, , A*V=B*V*D.

2: .

a =

1.0000 1.2000 2.0000

1.2000 1.0000 0.4000

2.0000 0.4000 2.0000

b =

1 -1 2

1 2 1

2 0 3

eig(a,b)

ans =

0.6693

2.0000

2.3307

>>a=[1 1.2 2;1.2 1 0.4;2 0.4 2];

>> [v,d]=eig(a);

>> eig(a)

ans =

-0.8649

0.9128

3.9521

>> [v,d]=eig(a)

v =

-0.7780 -0.1099 0.6186

0.3960 -0.8502 0.3470

0.4878 0.5149 0.7049

d =

-0.8649 0 0

0 0.9128 0

0 0 3.9521

ROUND

ROUND (). , , .

CEIL(A)

ceil(). , , .

3: .

round (). :

a=[1 1.2 2;1.2 1 0.4;2 0.4 2];y=round(a)

y =

1 1 2

1 1 0

2 0 2

ceil().

a =

1.0000 1.2000 2.0000

1.2000 1.0000 0.4000

2.0000 0.4000 2.0000

ceil(a)

ans =

1 2 2

2 1 1

2 1 2

RATS

rats(A) .

4: . . ( 2 ).

:

a=[1 1.2 2;1.2 1 0.4;2 0.4 2]

a =

1.0000 1.2000 2.0000

1.2000 1.0000 0.4000

2.0000 0.4000 2.0000

>> c=rats(a)

c =

1 6/5 2

6/5 1 2/5

2 2/5 2

5: (, , ). :

a =

3 1 1

1 2 3

-2 5 -2

b =

1 -1 2

1 2 1

2 0 3

1) : c=a+b

c =

4 0 3

2 4 4

0 5 1

2) : c=a*b

c =

6 -1 10

9 3 13

-1 12 -5

3) :

3.1) c=a/b

c =

-13.0000 -6.0000 11.0000

8.0000 5.0000 -6.0000

9.0000 7.0000 -9.0000

c=b/a

c =

-0.0577 0.4423 -0.3654

0.3462 0.3462 0.1923

0.2115 0.7115 -0.3269

3.2) c=a\b

c =

0.1923 -0.6346 0.5385

0.4615 0.0769 0.6923

-0.0385 0.8269 -0.3077

c=b\a

c =

-31 13 -25

6 -2 6

20 -7 16

CUMSUM - CUMSUM(X) X. - , CUMSUM(X) , n- n X. X CUMSUM(X) , .

6: . :

a =

3 1 1

1 2 3

-2 5 -2

cumsum(a), , . :

a=[3 1 1;1 2 3;-2 5 -2];cumsum(a)

ans =

3 1 1

4 3 4

2 8 2

BALANCE.

BALANCE , , .. .

[T,Ab]=BALANCE(A) T, , Ab= T\A*T. BALANCE(A) Ab.

7: .., .

a =

3 1 1

1 2 3

-2 5 -2

>>balance(a)

ans =

3 1 1

1 2 3

-2 5 -2

MAX - MAX(X) X () - -, . [Y,I] = () Y , I .

MIN - MIN .

8: .

a =

3 1 1

1 2 3

-2 5 -2

max() min(), .

[y,i]=max(a)

y =

3 5 3

i =

1 3 2

[y,i]=min(a)

y =

-2 1 -2

i =

3 1 3

SORT

SORT(X) X . [Y,I] = SORT(X) I, ( , ) Y). X , Y=(I). X , .

9: . : a=[3 1 1;1 2 3;-2 5 -2];

sort(), .

sort(a)

ans =

-2 1 -2

1 2 1

3 5 3

SUM

SUM(X) X . X SUM(X) - X. SUM(D/AG(X)) X.

10. - .

:

a =

-13 -8 -3 2 7

0 -1 7 -3 -13

-13 -8 3 4 -1

-13 -9 4 -1 -6

-26 -17 7 3 -7

- sum(), . sum() - . :

a=[-13 -8 -3 2 7;0 -1 7 -3 -13;-13 -8 3 4 -1;-13 -9 4 -1 -6;-26 -17 7 3 -7];

y=sum(a)

y =

-65 -43 18 5 -20

11. . :

b_1=[-2.8;-26.3;-16.8;-29.1;-45.9]

b_1 =

-2.8000

-26.3000

-16.8000

-29.1000

-45.9000

b_2=[-1.8;-26.1;-15.8;-29.77;-46.9]

b_2 =

-1.8000

-26.1000

-15.8000

-29.7700

-46.9000

:

a =

-13 -8 -3 2 7

0 -1 7 -3 -13

-13 -8 3 4 -1

-13 -9 4 -1 -6

-26 -17 7 3 -7

b1 : 1=[A, b1]. b1, .. -.

A_1=[a;b_1']

A_1 =

-13.0000 -8.0000 -3.0000 2.0000 7.0000

0 -1.0000 7.0000 -3.0000 -13.0000

-13.0000 -8.0000 3.0000 4.0000 -1.0000

-13.0000 -9.0000 4.0000 -1.0000 -6.0000

-26.0000 -17.0000 7.0000 3.0000 -7.0000

-2.8000 -26.3000 -16.8000 -29.1000 -45.9000

b2 , :

A_2=[a,b_2]

A_2 =

-13.0000 -8.0000 -3.0000 2.0000 7.0000 -1.8000

0 -1.0000 7.0000 -3.0000 -13.0000 -26.1000

-13.0000 -8.0000 3.0000 4.0000 -1.0000 -15.8000

-13.0000 -9.0000 4.0000 -1.0000 -6.0000 -29.7700

-26.0000 -17.0000 7.0000 3.0000 -7.0000 -46.9000

SOLVE

solve, .

12 .

:

MatLab :

[x,y]=solve('acot(x)+2*(y-2)^2=5','y-abs(4*x-3)=3')

x =

0.64631476499002086240204017407305

y =

3.4147409400399165503918393037078

MatLab. MatLab , . MatLab .

. ACOT, PLOT, EIG, CEIL, CUMSUM, BALANCE, MAX, SORT, SUM, MIN. , .

MatLab , , , toolbox ( ).

.

1. .. . .- : , 2003.-128.

2. .. - MATLAB for Windows.-: , 2001.-142.

3. . MATLAB / . ...- .-: , 1994.

Allbest.ru

 


 

1

http://apeshnik.narod.ru/matlab/part1.htm

 

I. MATLAB

 

1. , (+, -).

2. , (*, /).

3. (^).

4. (sqrt): sqrt(16+9)

5. , .

6. %

7. : t=(0:0.5:7)' %

8. (: a = [1 2 3;4 5 6]):

;

;

-;

-.

9. :

, (+, -);

(*);

(inv), (pinv);

(/);

(^);

(').

c : tril().

c : triu().

¾ : fliplr(A).

¾ : flipud(A).

¾ 900 : rot90(A).

¾ 900 : rot90(A,-1).

¾ 900 : rot90(A,k), k = 1, 2,... , 900.

¾ .. .

¾ n: eye(n).

¾ : eye(size(A)).

¾ n´m: ones(n,m). : ones(n).

¾ : ones(size(A)).

¾ n´m: zeros(n,m). : zeros(n).

¾ : zeros(size(A)).

¾ n: pascal(n). -.

¾ : diag(A).

¾ : trace(A).

¾ sum diag: sum(diag(A)).

¾ n (n>2): magic(n).

¾ MATLAB: - , .

¾ : diag(diag(A)).

¾ - : diag(P).

¾ - N: diag(N).

¾ , diag.

¾ : eig(A).

¾ : A = [1 2 3;4 5 6]; A(:,2:3) 2- 3-

¾ rand (, rand(3,4))

¾ randn (, randn(2,5))

¾ : help--.

¾ ( ):

(: [1 2 3;4 5 6].^2) .

.9 .

8. : poly(A).

9. : poly(sym(A)). .

10. ( s): poly(sym(A),sym('s')).

11. .. 1.26, 1.27, 1.28.

12. : poly(eig(A)).

13. , : poly(P).

14. , : poly2sym(P). .

 

II. , , .

 

1. : size(A).

2. : length(P).

3. size , length ( ).

4. : disp(A), disp(P), disp(a), - ( , , =2+3i).

5. : - , isprime(a) 1 (), 0 (). ( ).

6. 2... : primes(a). . primes(a) , 2... .

7. : sign(a). sign , , .

8. : round(a).

9. abs: abs((3-5)/2), abs(-2^3)

 

III. .

 

1. N : factor(N).

2. : sum(P). .

3. : sum(A). , .

4. : prod(P).

5. : prod(A).

6. : perms(P).

 

- -.

 

2-D MATLAB.

 

- , MATLAB m- ( m). - ( ) MATLAB, m-.

 

1. .

 

1.

 

10. MATLAB : = [1 2 3;4 5 6] = [1,2,3;4,5,6];

11. : 1 = ';

12. b = [10 20 30;40 50 60];

13. 1 b: = 1*b;

14. ' 1 b:' disp(' 1 b: ');

15. , Enter;

16. , () ;.

17. .

18. 1-6 -. edit. , . 1-6 - (, Lab1). - .

19. MATLAB.

20. - . - Enter;

21. - edit (, Lab1).

22. - . %. .. % , .. , %, , MATLAB.

23. - . : inv(c).

 

2.

 

, .

:

 

(1)

 

, () , .. .

 

F(t):

 

(2)

 

[0, 1],

 

1. , .

1.1. 18 , 2:

% , 1

% [0, 1]

%

% -

%

1.2. 18 expinv:

p2=rand(18,1);

T=expinv(p2,0.5)

t2=sort(T)

1.3. 18 exprnd:

for k=1:18

y(k)=exprnd(0.5);

end

R=sort(y) % R

1.1, 1.2, 1.3 - , MATLAB m. m- () MATLAB.

 

.

 

() MATLAB DISTTOOL (disttool).

 

DISTTOOL . DISTTOOL : cdf ( ), pdf ( ).

 

() MATLAB RANDTOOL(randtool).

 

RANDTOOL .

 

. 2-D MATLAB.

 

2.1. :

 

t=0:0.01:2*pi; y=3*(1+sin(t)); polar(t,y)

 

2.2. hold on: t=0:0.01:2*pi;y1=3*(1+sin(t));y2=3*(1-sin(t));

 

polar(t,y1),hold on,polar(t,y2,'r')

 

2.3. hold on:

 

t=0:0.01:2*pi;y1=3*(1+sin(t));y2=3*(1-sin(t));

 

y3=3*(1+cos(t)); y4=3*(1-cos(t));

 

polar(t,y1),hold on,polar(t,y2,'r'),polar(t,y3,'g'),polar(t,y4,'k')

 

2.4. :

 

t=0:0.01:2*pi; y=sin(t);

 

plot(t,y),grid

 

2.5. gtext:

 

t=0:0.01:2*pi;y=sin(t);plot(t,y),grid,gtext('t'),gtext('y')

 

% (t y) .

 

2.6. fplot.

 

% sin(t) sin(x) .. :

 

fplot('sin(t)',[-3*pi 3*pi]),grid % MATLAB

 

% sin(t) t -0.7 0.7

 

fplot('sin(t)',[-3*pi,3*pi,-0.7,0.7]),grid

 

% : sin(t), exp(-0.5t), 3cos(t)

 

fplot('[sin(t),exp(-0.5*t),3*cos(t)]',[-1,10,-4 5]),grid

 

: fplot :

 

.

 

2.7. title, xlabel, ylabel:

 

t=0:0.01:2*pi;y=sin(t);

 

plot(t,y),grid,title(''),xlabel(''),

 

ylabel(''),gtext('t'),gtext('y')

 

fplot('[sin(t),3*cos(t)]',[-1,10,-4,5]),grid,title('y_1-sin(t), y_2-3cos(t)'),gtext('y_1'),gtext('y_2')

 

% .

 

2.8. legend:

 

t=0:0.01:2*pi;y1=sin(t);y2=cos(t);

 

plot(t,y1,'r'),grid,hold on,plot(t,y2), legend('s1','c2')

 

2.9. legend :

 

: legend('s1','c2', 2);

 

: legend('s1','c2', 3);

 

: legend('s1','c2', 4);

 

: legend('s1','c2', 1)

 

: legend('s1','c2');

 

: legend('s1','c2', -1);

 

2.10. funtool.

 

MATLAB funtool (Enter). : , , , ..

 

% , .1.:

 

1.

 

(-) (-)

 

y yellow

 

m magenta -

c cyan - r red

g green

b blue ()

w white k black

 

. .2.8, .

 

: .2.8 , 1. fplot, :

 

fplot('sin(t)',[-5,5],'r'),grid, hold on,fplot('3*cos(t)',[-5 5],'g') %

 

% , .2.

2.

 

 

 

( )

point

 

o

circle

 

x

x-mark

 

*

star

 

s

suare

 

d

diamond

 

v

triangle (down)

()

 

^

triangle (up)

()

 

<

triangle (left)

()

 

>

triangle (right)

()

 

p

pentagram

 

h

hexagram

 

-

solid

 

:

dotted

(:)

 

-.

dashdot

-

 

--

dashed

 

 

: .2.7 , 2., .2.8 , 1, 2.

 

3.

 

1.1 1.2 .

 

1- F1:

 

t1=sort(x);

 

F1=1-exp(-2*t1);

 

plot(t1,F1),grid

 

2- F2:

 

p2=rand(48,1);

 

T=expinv(p2,0.5); % 0.5

 

t2=sort(T);

 

F2=1-exp(-2*t2);

 

plot(t2,F2),grid

 

3- F3:

 

p3=rand(48,1);

 

T3=expinv(p2,0.5); % 0.5

 

t3=sort(T3);

 

F3=expcdf(t3,0.5); % expcdf

 

plot(t3,F3),grid

 

4. .

 

:

 

(3)

 

m , t .

 

. . .

 

3- f3:

 

p3=rand(48,1);

 

T3=expinv(p2,0.5); % 0.5

 

t3=sort(T3);

 

f3=exppdf(t3,0.5); % exppdf

 

plot(t3,f3),grid

 

.

 

1. F1, F2, F3 .

 

2. f1, f


 

6

http://apeshnik.narod.ru/matlab/part6.htm

.

 

ss, initial, dss, lsim, MATLAB.

 

: MATLAB . , .

 

 

(1)

 

n- , U r- , Y m- , A n´n , n´r , m´n , D m´r (A, B, C, D ).

 

(1) , .. , ( ) .

 

 

(2)

 

n´n, . [].

 

1. ss.

 

(1) A, B, C, D .

 

. , 3- .

 

%

 

A=[-1.23 0 0;2.5 -0.56 0;0 3 -2.3];

 

B=[4;0;0];

 

C=[0 0 3.3];

 

D=0; % D

 

% s1

 

s1=ss(A,B,C,D)

 

%

 

a =

 

x1 x2 x3

 

x1 -1.23 0 0

 

x2 2.5 -0.56 0

 

x3 0 3 -2.3

 

b =

 

u1

 

x1 4

 

x2 0

 

x3 0

 

c =

 

x1 x2 x3

 

y1 0 0 3.3

 

d =

 

u1

 

y1 0

 

Continuous-time system.

 

% s1

 

eig(s1) % pole

 

ans =

 

-2.3000

 

-0.5600

 

-1.2300

 

%

 

Y.

 

step(s1,15),grid % 0 15 .

 

impulse(s1,12),grid % 0 12 .

 

. :

 

[0 0 1], [0 0 5], [1 0 0], [0 1 0], [1 1 1].

 

% size, dcgain

 

s1=ss(A,B,C,D); %

 

size(s1)

 

State-space model with 1 input(s), 1 output(s),and 3 state(s).

 

% size(s1): 1 , 1 ,

 

dcgain(s1) % s1

 

ans =

 

62.4905

 

% :

 

[0 0 1], [0 0 0.3], [0 0 5], [1 0 0], [0 1 0], [1 1 1].

 

2. .

 

2.1. tf.

 

tf(s1)

 

Transfer function:

 

 

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

 

s^3 + 4.09 s^2 + 4.806 s + 1.584

 

% : 99/1.584=62.5

 

2.2. zpk.

 

zpk(s1)

 

Zero/pole/gain:

 

 

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

 

(s+2.3) (s+1.23) (s+0.56)

 

% :

 

99/(2.3*1.23*0.56)

 

ans =

 

62.4905

 

%

 

3. initial.

 

(1), , ..

 

(3)

 

(3) Y (1) ss ( s1).

 

% s1 (0): .. - [10; 10; 10].

 

% [10; 10; 10]

 

initial(s1,[10;10;10],15),grid % 0 15

 

initial(s1,[10;10;10],[0:0.1:7]),grid % 0 7 0.1

 

% ( ) .

 

% s1 s2

 

A1=[-1.23 0 0;2.5 -0.56 0;0 3 -2.3];

 

B1=[4;0;0];

 

C1=[0 0 3.3];

 

D1=0;

 

A2=[-3 0 0;5 -2.56 0;0 3.3 -1.3];

 

B2=[3;0;0];

 

C2=[0 0 3.3];

 

D2=0;

 

s1=ss(A1,B1,C1,D1);

 

s2=ss(A2,B2,C2,D2);

 

% initial

 

initial(s1,s2,[10;10;10],9),grid,legend('s1','s2')

 

% ( )

 

.

 

¾ (1) (3) initial.

 

¾ initial : [-10,-10,10], [1,1, 10], [10, 10, 1], [1, 1, -1], [0,0,10].

 

¾

 

¾ s1 s2 2: [0,0,-3.3], [0 0 1], [12 13 -10], [5 0 0], [0 5 0]

 

. initial , .

 

4. dss.

 

, , , . MATLAB dss, ss .

 

.

 

(4)

 

(4) :

 

(5)

 

,.

 

(4) . step.

 

%

 

A=[-0.2 0 0;3 -0.5 0;0 6 -1.8];

 

B=[5;0;0]; C=[0 0 1]; D=0;

 

E=[2.5 0 0;0 1.07 0;0 0 1.3];

 

% dss.

 

ds1=dss(A,B,C,D,E);

 

% 0 12.

 

step(ds1,12),grid,title('ds1')

 

% ss A,B,C,D

 

s1=ss(A,B,C,D);

 

step(s1,12),grid,title('s1')

 

% dss ss , dss .

 

.

 

¾ 4 , .. dss: 12=[2.5 0 0;0 1.07 0;1 0 1.3]; E13=[2.5 0 0.7;0 1.07 0;1 0 1.3]; E14=[1.5 0 0.7;0 1.07 0;1 0 1.3]; E16=[0.989 0 0;0 0.989 0;0 0 0.989] : 7 100.

 

¾ , dss, initial impulse.

 

5. lsim.

 

lsim , ss.

 

1. (4) [0 21] .

 

%

 

A=[-0.2 0 0;3 -0.5 0;0 6 -1.8];

 

B=[5;0;0]; C=[0 0 1]; D=0;

 

s22=ss(A,B,C,D); % ss-

 

t=0:0.1:21;

 

u=2*ones(length(t),1); % -, 2

 

%

 

step(s22,22,'k'),grid,hold on,lsim(s22,u,t,[0;0;0],'m.')

 

% step , lsim "" .

 

 

u=10*exp(-0.1*t).*cos(t); %

 

%

 

step(s22,22,'k'),grid,hold on,lsim(s22,u,t,[0;0;0],'m.')

 

2. .

 

(6)

 

(6) , (4), ,

 

MATLAB B=[5 0;0 20;0 0].

 

A=[-0.2 0 0;3 -0.5 0;0 6 -1.8];

 

B=[5 0;0 20;0 0];

 

C=[0 0 1]; D=0;

 

s33=ss(A,B,C,D);

 

dcgain(s33) %

 

ans =

 

500.0000 133.3333

 

%

 

step(s33,21),title(' U_1, U_2')

 

% lsim

 

t=0:0.1:41;

 

u1=ones([length(t),1]);

 

u2=ones([length(t),1]);

 

u=[u1, u2]; % : u=ones(length(t),2)

 

%

 

lsim(s33,u,t,[0;0;0]),grid,title(' 2- ')

 

% 500+133.3333=633.3333

 

.

 

¾ , (500) 200 . step lsim.

 

¾ step lsim : [0,1,0], [1,0,0],[1,1,1].

 

¾ lsim (6) ode45.

 

step.

 

step Y, . plot.

 

(6) :

 

A=[-0.2 0 0;3 -0.5 0;0 6 -1.8];

 

B=[5 0;0 20;0 0];

 

C=[0 0 1]; D=0;

 

s44=ss(A,B,C,D);

 

% s44 A, B, C, D

 

% step

 

[y,t,x]=step(s1,21); % 0 21

 

% y,t,x

 

size(y),size(t),size(x)

 

ans =

 

101 1 2 % Y

 

ans =

 

101 1 % t

 

ans =

 

101 3 2 %

 

Y , ( ). ( ) . 101 .

 

Y, X plot.

 

%

 

plot(t,y(:,1,1),'r'), grid, hold on, plot(t,y(:,1,2)), legend('Y_1','Y_2')

 

%

 

plot(t,x(:,:,1)),grid,legend('X_1','X_2','X_3'),title(' 1- ')

 

%

 

plot(t,x(:,:,2)),grid,legend('X_1','X_2','X_3'),title(' 2- ')

 

% , 2- ( 6 3- ).

 

.

 

¾ step (6) .

 

¾ step (6) . : 2, 10, 20, 0.2.

 

lsim.

 

(6) :

 

% ss- . lsim.

 

[y1,t1,x1]=lsim(s1,u,T,[0;0;0]);%

 

size(y1),size(t1),size(x1)

 

ans =

 

211 1 %

 

ans =

 

211 1 % ( )

 

ans =

 

211 3 %

 

% lsim ()

 

%

 

plot(t1,y1), grid, title(' ')

 

plot(t1,x1), grid, title(' '),legend('x_1','x_2','x_3')

 

.

 

¾ lsim :,,,. , , lsim.

 

¾ [0, 50] : [1, 0, 0], [0, 1, 0], [1, 1, 1].

 

 

impulse.

 

% (6)

 

[Y0,T0,X0]=impulse(s1,25); % 0 25

 

size(Y0),size(T0),size(X0)

 

ans =

 

101 1 2 %

 

ans =

 

101 1 %

 

ans =

 

101 3 2 %

 

%

 

plot(T0,Y0(:,:,1),'r'), grid, hold on, plot(T0,Y0(:,:,2),'m'), legend(' u_1',' u_2')

 

%


 

5

http://apeshnik.narod.ru/matlab/part5.htm

 

 

MATLAB.

 

MATLAB laplace.

 

1.1. syms x y t; %

 

f1 = t; % -;

 

L1 = laplace(f1) % ;

 

f2 = sym('10'); % f2 = 10 ;

 

L2 = laplace(f2) % ;

 

f3 = sym('3')*t + sym('7'); % ;

 

L3 = laplace(f3) % ;

 

f4 = exp(-t); % ( );

 

L4 = laplace(f4) % ;

 

f5 = exp(t); % ( );

 

L5 = laplace(f5) % ;

 

L6 = laplace(exp(t))

 

f6 = sin(x);

 

L6 = laplace(f6) % sin(x);

 

L7 = laplace(cos(x)) % cos(x);

 

.

 

. .

 

:

 

(1)

 

m £ n .

 

tf. % . help tf;

 

2.1. W1:

 

. (2)

 

2.2. MATLAB ( -):

 

W1=tf(12,[1 2 3 1])

 

% :

 

Transfer function:

 

 

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

 

s^3 + 2 s^2 + 3 s + 1

 

2.3.. W2:

 

. (3)

 

MATLAB :

 

W2=tf([3 5 4],[1 2 3 1])

 

% :

 

Transfer function:

 

3 s^2 + 5 s + 4

 

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

 

s^3 + 2 s^2 + 3 s + 1

 

zpk (zero-pole-gain), k gain.

 

, .

 

2.4. , 7.7, . .

 

MATLAB :

 

W3=zpk([],[-3.3,-0.25,-12.7],7.7)

 

% :

 

Zero/pole/gain:

 

7.7

 

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

 

(s+3.3) (s+12.7) (s+0.25)

 

% [],

 

%

 

2.5. , 7.7, .

 

MATLAB :

 

W4=zpk([4,-5],[-3.3,-0.25,-12.7],7.7)

 

% :

 

Zero/pole/gain:

 

7.7 (s-4) (s+5)

 

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

 

(s+3.3) (s+12.7) (s+0.25)

 

2.6. .

 

2.6.1. W4 :

 

% MATLAB :

 

w44=tf(W4)

 

% :

 

Transfer function:

 

7.7 s^2 + 7.7 s - 154

 

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

 

s^3 + 16.25 s^2 + 45.91 s + 10.48

 

2.6.2. :

 

% MATLAB :

 

.

 

W5=tf(10,[1,3,2])

 

% :

 

Transfer function:

 

 

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

 

s^2 + 3 s + 2

 

% , , 10, .

 

% w55:

 

w55=zpk(W5) %

 

%

 

Zero/pole/gain:

 

 

---------

 

(s+2)(s+1)

 

% W2 :

 

w22=zpk(W2) %

 

%

 

Zero/pole/gain:

 

3 (s^2 + 1.667s + 1.333)

 

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

 

(s+0.4302) (s^2 + 1.57s + 2.325)

 

% (1) SISO (single input single output).

 

2.7. .

 

, , . "", , "", , .. ( ).

 

eig.

 

2.7.1. W5 w55.

 

eig(W5) % W5

 

ans =

 

-2

 

-1

 

eig(w55) % w55

 

ans =

 

-2

 

-1

 

% . w55 ,

 

%

 

2.7.2. W2 w22.

 

eig(W2) % W2

 

ans =

 

-0.7849 + 1.3071i

 

-0.7849 - 1.3071i

 

-0.4302

 

eig(w22) %w22 , W2

 

ans =

 

-0.7849 + 1.3071i

 

-0.7849 - 1.3071i

 

-0.4302

 

% . w22.

 

2.7.3. .

 

, 6.78 zpk w66:

 

w66=zpk([],[-6.78,-6.78,-6.78],7)

 

%

 

eig(w66)

 

ans =

 

-6.7800

 

-6.7800

 

-6.7800

 

%

 

2.7.4. .

 

.

 

- zpk.

 

w77=zpk([],[-5+2.3*i,-5-2.3*i,-5.7],6)

 

Zero/pole/gain:

 

 

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

 

(s+5.7) (s^2 + 10s + 30.29)

 

% , -5.7, -: -5+2.3i; -5-2.3i,

 

% i ( j ).

 

, w77, :

 

W77=tf(w77)

 

Transfer function:

 

 

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

 

s^3 + 15.7 s^2 + 87.29 s + 172.7

 





:


: 2015-05-05; !; : 449 |


:

:

- , , .
==> ...

1580 - | 1382 -


© 2015-2024 lektsii.org - -

: 1.75 .