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

. .

. .

-
-
2005

681.3.06(075.8)
32.973.26-018.273
52

52

. ., . .
MATLAB . .: -,
2005. 3 2 0 : .
ISBN 5-94157-595-5

MATLAB. , . . .
, ,
,

681.3.06(075.8)
32.973.26-018.273

:

.

02429 24.07.00. 12.07.05.


60901/,. . . , . 20.
4000 . No 1196
"-", 194354, -, . , 5.
-
Ne 77.99.02.953..006421.11.04 11.11.2004 .
.

" ""
199034, -, 9 , 12

ISBN 5-94157-595-5

. ., . R, 2005
, "-", 2005

11

1. MATLAB

15

1.1. MATLAB
1.1.1. Command Window
1.1.2. Workspace
1.1.3. Current Directory
1.1.4. Command History
1.1.5. Launch Pad
1.2.
1.2.1. File
1.2.2. Edit
1.2.3. View
1.2.4. Web
1.2.5. Window
1.2.6. Help
1.3.

16
16
18
19
20
20
21
21
23
24
24
25
25
25

-.

'.

2. MATLAB

27

2.1.
2.1.1.
2.1.2.
2.1.3.
2.2. , ,
2.2.1. MATLAB
2.2.2.

27
27
29
31
32
32
34


2.3.
2.3.1.
2.3.2.
2.3.3.
2.3.4.

35
36
36
37
38

3.

39

3.1.
3.2.
3.2.1.
Layout
Tools
3.2.2.
3.3. ,

3.4.
3.4.1.
3.4.2.
3.4.3.

39
41
43
43
44
44

4.

61

4.1.
4.2.
4.3.
4.4.
4.5.
4.6.
4.7.

61
64
65
66
69
72
77
80
82
83
83
85
87
87








4.7.1. fmin ('fun', xl, 2)
4.7.2. fmin ('fun', xl, x2, options)
4.8.
4.8.1.
Laplace(F)
Laplace(F,s)
Laplace(F,w,s)
4.8.2.

4.8.3.

45
47
48
51
54

88
90

5.

93

5.1.
5.1.1.
5.1.2.
5.1.3.
5.1.4.
5.1.5.
5.1.6.
5.2.
5.2.1. -
5.2.2. - ( )
5.2.3.
5.2.4.
5.2.5.
5.2.6.
5.2.7.
5.3.

93
94
98
99
100
101
102
104
104
106
107
109
109
112
113
114

6.

116

6.1.
,
6.2.
6.2.1.
6.2.2.
6.2.3.

:













6.3.
6.3.1.

116
118
118
119
121
121
122
122
123
123
124
125
126
126
127
129
132
133
134
135
138


7.

140

7.1.
7.1.1. plot(x,y)
7.1.2. plot (x,y,s)
7.1.3. plot(xl,yl,sl, x2,y2,s2, ...,xn,yn,sn)
7.1.4.

7.1.5.
7.1.6.
7.2.

140
141
142
146

8.

156

8.1.

8.1.1. ( )
8.1.2.
8.1.3.
8.1.4. ( )
8.1.5.
8.2.
MATLAB
8.2.1.
solveQ
8.2.2.
\ fzero()
8.2.3.
rootsQ
8.2.4.

8.3.
8.3.1.



8.3.2.
8.3.3.
8.4.
MATLAB
8.4.1.

150
151
152
153

156
156
157
159
161
162
166
166
169
174
175
175
182
186
186
188
188
190
190
191


8.4.2. .... 192
8.4.3.
solve()
194
8.5.

196
cqs()
198
8.6.
199
1.

199
2.

204
9. ....

205

9.1.
9.2.

9.2.1.
9.2.2.
9.2.3.
9.3.
9.3.1.
9.3.2.




9.3.3.
9.4.

205

10.

206
206
208
209
210
210
212
212
212
213
213
216

220

10.1.
220
10.1.1.
221
10.1.2.
221
10.1.3. ()
222
10.2. MATLAB. 223
10.2.1.
223
cumtrapz(x,y)
226
trapzfy)
228
trapz(x,y)
229

10.2.2.

()
quad('fim',a,b)
quad('fun',a,b,tol)
ablquad('fun',a,b,c,d)
quad8('fun',a,b)
,
10.3.
10.3.1. intQ

10.3.2.
10.3.3.
10.4.
11.

11.1.
11.1.1.



11.1.2.
11.1.3.
11.2. .
11.2.1.
11.2.2.
11.2.3. -
11.2.4.
11.3. , ()
11.3.1. isqcurvefitO
11.3.2.
11.3.3.
12.

12.1.
12.2. MATLAB

12.2.1. tf()
12.2.2. poleQ zeroQ

231
231
232
232
233
234
236
236
239
240
241
248
248
250
250
254
255
256
257
257
258
258
262
264
265
267
267
270
272
274
274
275
275
277


12.2.3. rootsQ wpolyQ
279
12.2.4. convQ
280
12.2.5. polyvalQ
281
12.3.
283
12.3.1.
283
12.3.2. pzmapO
284
12.3.3. seriesQ
286
12.3.4. parallelQ
287
12.3.5. feedbackO
288
12.3.6. minrealQ
292
12.4.
293
12.4.1. step()
295
12.5.
296
12.5.1. -
299
12.5.2.
300
12.6.
302
12.6.1.

'.
303
12.6.2.
G(S)
303
12.6.3.

304
12.6.4.
304
12.6.5.
304
12.6.6. ... 306
12.6.7.

306
12.6.8.

308
12.6.9.


308
12.7.

309
12.7.1. 1
309
12.7.2. 2
314
....:
314

315

318


.
,
Mathematica, Maple, Derive, Mathcad, MATLAB .
.
, ,
.
MATLAB
:
;
,
, ( , ,
);

(Maple, Mathcad, MS Excel) MATLAB,
,
, .
MATLAB
, .

12

MATLAB.
.
, . .
.
, . :
,
MATLAB, ;
: ;
MATLAB;
MATLAB,
( , ,
. .);

;
.

, , , .
, , .
MATLAB.
MATLAB
,
.

. -

13

,
.
, ,
. .

: , , , .
MATLAB
, ,
.
, ,
, .

MATLAB
MATLAB, , . ,
, ,
, ,
.

( ) , . , , :
;
;
;
;
;
;

.
.
.

16

, .

1.1. MATLAB

. .

1.1.1. Command Window


Command Window ( ) . (. 1.1) , , , .

.
.

=2+3

<Enter>.
. 1.1.
, .
MATLAB. ,
<> <i>.

, .
( <Enter>) .
,
. [],
[TJ- -

MATLAB

17

, . View |
Dock Command Window ( | ). ,
, ()
.

~3J

D GS

ach Cecba. Type "htlp toolbox_paiA_cache" tot

, eLecc '-1UTLAB Help" Ito Uie Hlp .

-li-Li

lujj-j

I*,

-.>& ''



.
. 1.1.
, , MATLAB .

18

1.1.2. Workspace
.
. ,
.

Simulink



. 1.2. Workspace

MATLAB

19

( )
.
Workspace ( ) ,
(. 1.2). ,
- .

( ).

1.1.3. Current Directory


Current Directory ( )
, MATLAB
(. 1.3).
tWOw
IMp "
f-te E* V
ew
i W
ab V
M

M G
cm+o

Import Oats..

"
TUJI

uaiftg Toolbox P

i
Urn

. double

5etP$...
. Preference*..,
1

It.

aet stAiced

Type "help tuolbox^path cftche" tot BOIC info.

select 'I UTLfcB Help" from the Kelp menu.

-+

* setup...
Print....

1
.0.,

..:
..

E**MATIAB

i M

x-2+3

:^Sfv i j

J$

. 1.. Current Directory

20

, ,
, ( ).
, ,
, . , . ,
. ,
, (
), .
?
.

1.1.4. Command History


,
Command Window ( ), , Command History (
). ? , Command History ( ), ,
, .
Command History ( ).
.
.
.

1.1.5. Launch Pad


Launch Pad ( )
,
, MATLAB. . Start (), MATLAB.

MATLAB

21

1.2.
MATLAB. ,
.
.
, . ,

.
MATLAB :
File () ;
Edit () ;
View () ;
Web - ;
Window () ;
Help () MATLAB.
, .

1.2.1. File
.
.
New ()
, :
M-File (-) , ;
,
Figure ()
. , , ;
Model () Simulink;

22

G U I (Graphical User
interface), .
Open () .
Current
Directory ( ).
Close Current Directory ( ) .
Import Data ( )
MATLAB ( ,
, . .).
Save Workspace As ( )
.
(Workspace). . ,
mat.
Save Workspace As ( ),
save _.mat.
Import Data ( ), load _.
Set Path ( )
. (,
) MATLAB . , MATLAB
.
( ),
, .
MATLAB .
Set Path ( ).
( ).

MATLAB

23

Add Folder (
), Add With Subfolders (
). ,
, .
Save .
Preferences () MATLAB.
: Page Setup ( ),
Print () Print Selection ( )
, .
File () .
.
Exit MATLAB () .

1.2.2. Edit
Undo (), Redo (), Cut (),
(), Paste (), Select All ( )
Find ()
.
.
Paste Special ( ) (, MS Excel),
.
Clear Command Window ( ) .
Clear Command History ( )
.
Clear Workspace ( )
.

24

1.2.3. View
MATLAB . ,
, .
View ().
Desktop Layout ( )

.
Undock () ( ) () . Dock () . .

.

.
.
Current Directory Filter ( ) -. Current Directory ( ) .
Workspace View Options ( )
Workspace ( ).
.

1.2.4. Web
Web , ,
- . , , . .

MATLAB

25

, MATLAB File Exchange (),


MATLAB
.

1.2.5. Window
.
, ( ). Close All
( ) , .

1.2.6. Help
MATLAB
.

1.3.
.

.
:
New file () ;
Open file () ;
Cut ()
;
()
;
Paste ()
;
Undo () ;

26

Workspace Browser ( )
;
Path Browser ( )
;
New Simulink Model ( Simulink)
Simulink;
Help Window () .

MATLAB
2.1.
, . MATLAB . . ,
MATLAB . ,
* /
. ,
. * ./. MATLAB
(\ . \).
,
, 6.
help ops.

2.1.1.
MATLAB:

( ) ;

[ ] ;

{ } ;
. ;

28

,- ;
: ;
, ();
.. ;
. . . ;
% ;

! ;

= ;

' .

: ; .
:
i:k [i, i + 1, i + 2, ..., ], , 1:5
[12 3 4 5];
i : j : k i : k, j > 0, k > i

<0, i > k;

(:, i) i- ;
M(i,:) i- ;
(:,:) (:);

M(i:k) M ( i ) , M ( i + i ) , M(i+2), ..., M(k);

M(:,i,k)
M(:,k);

M(:,i),

M(:,i+1),

M(: , i + 2 ) , ...,

M(:) ;
(:,:, ) - .
( ) , ,
. : sin(x), (x-i)/(x+i), x(v), x(i),
M(A,B), M(:,i).

MATLAB

29

[ ] , : [12 3 4], [1,2,3; 3 5 2].


{ } .
(.)
. ,
. :

3.2, .15, 2 . * 1 ( ) + . 2 - . / ( ) .

(,-) , .
(,)
.
(%)
.
(=)
: =[1 2 3 4 5], x=cos(a), =2.5.
(') ,
, : Y='x+exp(-a)+i=o\
(!) ,
.
(..) , (
).
( ) (...) . .

2.1.2.
.
, 1 (True),
0 (False).

30
. 2.1.

2.1.

eq

==

~=

It

<

<

gt

>

>

le

<=

<=

ge

>=

>=

= ~=
. .
<, <=, >, >= .
. 2.2.
2.2.

ans =

5==5

eq(5, 5)

1
3~=3

ne(3, 3)

ans =
0

2+3i==2+i

eq(2+3i, 2+i)

ans =
0

2+3i==2+3i

eq(2+3i, 2+3i)

ans =
1

2+3i~=2+3i

ne(2+3i, 2+3i)

ans =
0

MA TLAB

31
2.2 ()

ans -

3.2O.21

lt(3.2<3.21)

2.3+8i<2.4+i

l t ( 2 . 3 + 8 i , 2.4+i)

ans =
1

3.8-3i>5+i

g t ( 3 . 8 - 3 1 , 5+i)

ana =
0

3<2.999

ans =

l e ( 3 , 2.999)

3>=2.999

ans =

g e ( 3 , 2.999)

2.1.3.
: (), (),
(), .
. 2.3.
2.3.

and

&

or

not

xor

2.1
3 |
ans =

''
1

32

'X ' I~'X '


ans
- 1

'x'&~'x'
ans =
0

xl=[l,2,a,4];
x2=[l,0,0,1];
and(xl,x2)

xl&x2

xl|x2

~xl

~x2

ans =

1 0
0
or(xl,x2)

ans =

1 1
not(xl)

ans =

0
0
not(x2)

ans =
0
1 1
xor(xl,x2)
ans =
0
1 1

, ,
, 1.

2.2. , ,

2.2.1. MATLAB
MATLAB , , .
,
( ).

MATLAB

33_

MATLAB:
: i
j ;
;
;
+ , + - .
. MATLAB . .
:
format chort (5 );
format chort e (5 , 3 );
format lonq (15 );
format lonq e
(15 , 3 );
format hex ;
format bank (2
).
| 2.2
5/7 .
:

format chort0.7143;

format chort e7.1429e-00l;

format lonq0.71428571428571;

format lonq e7.142857342857143e-00l;

format bank 0.71.

2 3. 1196

34

2.2.2.
, . ,
. , . MATLAB
31.
,
() .

.
MATLAB clear, :
clear ;
clear ;
clear .
,
. MATLAB
:
pi ;
inf ;
ans , : ans=;
NaN (Not a Number);
eps
52

reaimin (2

1022

);

reaimax (2

1022

).

{ 2.3
pi/2
ans =
1.5708

MATLAB

35

sin(1.2)/sin(O)
ans =
inf
(2-2)/(1-1)
ans =
NaN
eps
ans =
2.2204e-016
realrain
ans =
2.2251e-308
realmax
ans =
1.7977e3O8

, , . .
.
.

2.3.
"" .
, , = 2 + sin () - 1 .
, . ,
, solve . 5.
. , ,
. , ,
, .

36

2.3.1.

<Enter>. MATLAB :
c i c ,
;

home d c ;
echo on all -;
echo off all -;
echo <_> on ;
echo <_> of
;
echo <_> ;
more on ;
more off .

2.3.2.

MATLAB
, .
, ,
.
MATLAB : .
,
, , .
.

NaN, , ,
0/0 /.

MA TLAB

37

"Warning:
Devide by Zero".
, 10" 10 .
,
,
.
MATLAB
.
<> <i> , , , . , ~ +2 -1
0 2 0.2.
:

=0:0.2:2;
=*(-)+2-1

: - 2 + 1 .
,
<t>, .
<Enter> .
<> <<>
. <Ctrl>+<>>,
<Ctrl>+<<>
.

2.3.3.
.
save, :
safe fname
fname.mat;

38

safe fname x ;
safe fname x, y, z , , z.
save ,
.
. , , , ,
. . , .
,
.

. .
,
.
diary.
savt
. load.

2.3.4.
MATLAB quit, exit
<Ctrl>+<0>.
, , . ,
, , ,
, . ,
.



.
,

.

3.1.
MATLAB Command Window ( ) ,
.
MATLAB, .
,

,
. , ,
,
. :
;
;

40

;
;

.
.

, .
.
1.
. , .
: , .

| - i function mn
im
i um and zero
Equato
in

1
0.8
0.6
0.4
0.2
0
-0.2
-0.4 \
0.6
-0.8.
-1
-3

f
I'/

}
I

(7 Grd
iX
IS GidY

Style
-

'

'

. .1.

41_

2. ,
, .
3.
.
4. , ,
(,
, ).
,
. 3.1.

3.2.
,
File | New | GUI ( | | GUI').
, . 3,2.
1GIJIDI Quc
ik Start
Create New GUI . Open Exs
itn
i Q GUI
Recenty opened files:
->. D \MATLAB6p5\woA
ribook fig
, D:\MATUB6pS\worWbook.fig
D:Wrchwe\DAQ\SoundRecorderDemo\worKtprojects\283terc\phase2\daq2axisfield.fig
^D:rchive\DAQ\SoundRecorderDemo\wo[|flprojectsU83\srrtphasendaq2axis.flg
$. DHMATLAB6p5\worktoook1 .fig
, D:WATLA,B6p5\worktoook3.dB
. D:\MATLAB6p5lworWbook2.fig
^ D:iMATlAB6p5\external\external_ai:t<1 .fig

. .2.

Graphical User Interface .

42

: Create New GUI ( GUI) Open


Existing GUI ( GUI).
, , Blank
GUI (Default) ( GUI ( )) GUIDE
Templates ( GUI). . GUIDE (. 3.3). ,
, .
GUIDE.

J untitledJin
File Edti Ve
iw ' Layout Toosl [jelp
D *

n|.xj

!

ftp

. 3.3. GUIDE

43

3.2.1.
.
.
,
MATLAB, 1.
, .
Edit | Duplicate ( | )

.
View | Property Inspector ( | ) .
. ||.
View | Object Browser ( | )
(), .
. \*\.
View | - Editor ( | m-)
,
, .
.
, .

Layout
Layout | Snap to Grid ( | ) ,
.
Layout ()
,
.

44

Tools
Tools | Run ( | ) . . |>.|.
Tools | Align Objects ( | ) , .

Tools | Grid and Rulers ( | ) , ,


.
/
.
Tools | Menu Editor ( | )
. Tools | Tab Order Editor ( |
<Tab>) ,
<> .
Tools | GUI Options ( | GUI)
.
.

3.2.2.
(.
. 3.3):
[ It | ,
;
;

45

[j ;
[5 ;
[] ;
[ ;
\ ;
-;

;
[ 5 ] ( );
f 3] ;
] .

3.3. ,

Blank GUI (Default) ( GUI (no
)) GUIDE Templates ( GUI), File | New | GUI ( |
| GUI), , fig . ,
, ,
. ,
.
? fig- ,
, m-
.
, , callback.

46


(),
.
. ,
. . (), m- . ,
Callback.
. "". [ ,
. . , : , . . ,
. Tag . . Tag
myButton. m-
:

Executes on button press in myButton

( , );
function myButton_Callback(hObject, eventdata, handles);
% hObject handle t o myButton ;

% eventdata reserved ;
% handles s t r u c t u r e with handles ,

.
():
function myButton_Callback(hObject, eventdata, handles)

"".

47_

, %.
myButtoncallback ,
callback myButton. ,
. .
-
. () . ,
, ,
. , , . GUI MATLAB, [8, 9].
.
. (,
Callback ).
hobject, .
. handles,
,
().
.

3.4.
" ".
GUI, .
,
. 3.2.
:
;

48

;
.

3.4.1.
:
,
. () , [gj| (Property Inspector). :
1. .
2. ( ).
3.
( ).
4. (
).
5. Tag .
( Tag ( ) .
, ,
.)
6. string
( ).

. Tag
edEquation, edlnterval,
, s t r i n g
(. 3.4).

49

Hrfiir^fcnSiUBff8?
-. |

! I BuQ
!nDo*nFc)i
| CDal
Qee
lteFcn
Enabe
l
Idnfl
N
liame
tiSz'e
or.tjni:

MS; Sans Serfi


^j

- Ho
ra
lintaA
lg
lnment
n
iteruptb
ie
l
LsItboxTop
[5 8 28.79 7.2 1.531
|D 01 0.1|

-Teg
Taoflp Slimj

. 3.4.
. . , Tag btnPlot,
string Plot. ["] . (
...\Work), .
.
(, sin(x)), (-3, ) . , , .
,
.
m- , |-S^| . ,

50


View Callbacks | Callback ( Callback- |
Callback). m-
, Callback,
btnPiot. ,
.
:
%
Executes on button press in btnPiot.
function btnPlot_Callback(hObject, eventdata, handles);
% hObject
handle to btnPiot (see GCBO);
% eventdata reserved to be defined in a future version of
MATLAB;
% handles
structure with handles and user data (see GUIDATA
interval=str2num(get(handles.edlnterval,'String'));
f=inline(get(handles.edEq,'String'));
fplot(f,interval);
Co .
.
get(handles.edlnterval,'String')
get ()
( string) (
).
handles, . handles handles. edlnterval.
str2num() ,
interval.
inline
get :
inline(get(handles.edEq,'String'))


( ). inline () , , .
, . ,

51


f(2), inline f.
fpiottf, interval) f (interval) .

MATLAB.
| ^ | ,
(, sin(x)) (, -, ), . , . 3.1.
.
MATLAB.
.

3.4.2.
Min Zero (. . 3.1}. , . ,
Tag string . , ,
Min btnMin, Zero btnZero. ,
, ,
.

. Min.

.
m-
, callback btnMin. . :

52

%
Executes on button press in btnMin.
function btnMin_Callback(hObject, eventdata, handles)
% hObject
handle to btnMin (see GCBO)
% eventdata reserved to be defined in a future version of
MATLAB
% handles structure with handles and user data (see GUIDATA)
interval=str2num(get(handles.edlnterval,'String'));
xl=interval(1);
x2=interval(2);
f=inline(get(handles.edEq, 'String')) ;
x=fminbnd(f,xl,x2) ;
y=f (x);
plot(x,y,'r.','MarkerSize',25);

.
interval=str2num(get(handles.edlnterval, 'String')) ;

-, .
- interval no
xl 2 :
xl=interval(1);
x2=interval(2) ;

f=inline(get(handles.edEq,'String'));
edEquation :
x=fminbnd(f,xl, x2)
fminbndo,
. :
y=f(x);

53

f .
plot :
plot(x,,'.','MarkerSize',25)

, . ,
plot ' . ' ( . red, . ). MarkerSize.
btnzero .
Callback btnzero
:
%
Executes on button press in btnZero
function btnZero_Callback(hObject, eventdata, handles)
% hObject
handle to btnZero (see GCBO)
% eventdata reserved to be defined in a future version of
MATLAB
% handles
structure with handles and user data (see
GUIDATA)
interval=str2num(get(handles.edlnterval,'String'));
xl=interval(1);
x2=interval(2);
f=inline(get(handles.edEq,'String'});
x=fzero(f,(xl+x2)/2);
y=f (x);
plot(x,y,'g.','MarkerSize',25)


() .

x=fzero(f,(xl+x2)/2);
f zero (). -

54

(. 8). f zero
,
, .

.

3.4.3.
, , . CheckBox (. .
). (. 3.5)
Tag string.
Gridx ; cbY GridY
.
:
%
Executes on button press in cbX.
function cbX_Callback(hObject, eventdata, handles)
% hObject
handle to cbX (see GCBO)
% eventdata reserved to be defined in a future version of
MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of cbX
if get(hObject,'Value')
set(gca,'XGrid','on')
else
set(gca,'XGrid','off')
end
%
Executes on button press in cbY.
function cbY_Callback(hObject, eventdata, handles)
% hObject
handle to cbY (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB
% handles
structure with handles and user data (see
GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of cbY


if

55

get(hObject,'Value')
set(gca,'YGrid','on')

else
set(gca,'YGrid','off)
end

, . if...else,
s e t (gca, ' X G r i d ' , ' o n ' ) s e t (gca, ' X G r i d ' , ' o f f ' ) . -

,
get(hobject, 'Value'). value .
0 1. , set (gca, 'XGrid', 'on') (
), set (gca, 'XGrid', 'of f')
else ( ).
set (). set () . gca ( )
XGrid ( ) ' on' () 'off ().

( MATLAB
Popup Menu). ,
List Box, . .
.
Radio
Button () slider ( ), MATLAB.

, .
, ,
.
Tag ( pmstyle, pmwidth
pmCoior). string

56

. string
(. 3.5),
.
<Enter>.

1#

tb,*ai>

BamgDelaled
- BusvAcUon

1 H.T.M

Posto
in - SaeictmnHgihnght
" Strn
ig
Ta9
Toop
tiSnlng
"UC
l cneltMenu.
Untis

^jcenl

[89.8 2.92318.
-r j on
wjcopupmemj
prnColor
,
I
Mil ioi
4 fltti^SB

. 3.5.


. callback
. :
%
Executes on selection change in pmStyle.
function pmStyle_Callback(hObject, eventdata, handles)
% hObject
handle to pmStyle (see GCBO)
% eventdata reserved to be defined in a future version of
MATLAB
% handles

structure with handles and user data (see GUIDATA)

57

% Hints: contents = get(hObject,'String') returns pmStyle


contents as cell array
% contents{get(hObject,'Value')} returns selected item from
pmStyle
Num=get(hObject,'Value');
switch Num
case 1
set(handles.line,'LineStyle','-') ;
case 2
set(handles.line, 'LineStyle', '
case 3

');

set(handles.line,'LineStyle',':');
case 4
set(handles.line,'LineStyle','-.');
end
%

Executes on selection change in pmWidth.

function pmWidth_Callback(hObject, eventdata, handles)


% hObject

handle to pmWidth (see GCBO)

% eventdata

reserved to be defined in a future version of

MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = get(hObject,'String') returns pmWidth
contents as cell array
% contents{get(hObject,'Value')} returns selected item from
pmWidth
Num=get(hObject,'Value');
switch Num
t
case 1
set(handles.line,'LineWidth',1);
case 2
set(handles.line,'LineWidth',2);
case 3
set(handles.line,'LineWidth',3);
case 4
set(handles.line,'LineWidth', 4) ;
end
%
Executes on selection change in pmColor.
function pmColor_Callback(hObject, eventdata, handles)
% hObject
handle to pmColor (see GCBO)
% eventdata
MATLAB

reserved to be defined in a future version of

58

% handles structure with handles and user data (s GUIDATA)


% Hints: contents = get(hObject, 'String') returns pmColor
contents as cell array
% contents(get(hObject,'Value')} returns selected item from
pmColor
Num=get(hObject,'Value');
switch Num
case 1
set(handles.line,
case 2
set(handles.line,
case 3
set(handles.line,
case 4
set(handles.line,
case 5
set(handles.line,
case 6
set(handles.line,
case 7
set(handles.line,
end

'Color' ,'cyan');
'Color' ,'red');
'Color' ,'green');
'Color' ,'blue');
'Color' ,'magenta') ;
'Color' , 'yellow');
'Color' ,'white');

Num=get(hObject,'Value');

value Num. value , .


switch...case , . :
switch Num
case 1
set(handles.line,'LineStyle','-');
case 2
set(handles.line,'LineStyle','');
case 3
set(handles.line,'LineStyle',':');

59

case 4
set(handles.line,'LineStyle','-.');
end


LineStyle, LineWidth Color . , , handles. line, callback. line
. , - , handles .
Callback btnPlot.
%
Executes on button press in btnPlot.
function btnPlot_Callback(hObject, eventdata, handles)
% hObject
handle to btnPlot (see GCBO)
% eventdata reserved to be defined in a future version of
MATLAB
% handles structure with handles and user data (see GUIDATA)
cla
interval=str2num(get(handles.edlnterval, 'String'));
f=inline(get(handles.edEq,'String'));
[x,y]=fplot(f,interval);
handles.line=plot(x, y, 'c-') ;
guidata(gcbo, handles) ;
hold on

.
[x, y]=fplot (f, interval) ;
fploto
.

handles.line=plot(,, ' - ' ) ;

,
plot () line handles.
, fplot () .

60


guidata(gcbo,handles) ;
handles , .
cla .
. , , Equation. static Text ( S ) . string
,
Tag, . ,
(,
FontName, Fontsize),
.



,
, , , , .
.
.

4.1.
, , . :
;
;
;

.
MATLAB
subs (), :
s u b s ( f , ,

xl)

62

:
f , ;
f;
xi ,
f.
xl : : : ,
xl, , xl.

f(x):

1.
syms.
2. xl.
3. -

f(x).

4. subs.
5. <Enter>.
i 4.1

= xl [0; 1] h = 0.2 ,
xl = [0, 0.5, 1, 2, 5].
:
syms , xl, ;
xl = 0 : 0.2 : 1;
= ();
subs(, , xl)
ans

1.0000
1.2214
1.4918
xl = [ 0, 0.5, 1, 2, 5 ];
= ();
subs(, , xl)
ans =
1.0000
1.6487
2.7183

1.8221

2.2255

7.3891

148.4132

2.7183

63

subs
.
, ,
=

[() ;.2;.

()].

MATLAB , subs. :
1.
syms.
2. .
3. , .
4. <Enter>.
5. ' ().
.
; 4.2

, sinx, cosx , [0; I], 0.2.


.
:

syms , ;
= 0 : 0.2 : 1;
= [ ; ( ) ; s i n ( x ) ; c o s ( x ) ]

0
1.0000
0
1.0000
'
0
0.2000

0.2000
1.2214
0.1987
0.9801

0.4000
1.4918
0.3984
0.9211

0.6000
1.8221
0.5646
0.8253

1.0000
1.2214

0
0.1987

1.0000
0.9801

0.8000
1.2255
0.7174
0.6967

1.0000
2.7183
0.8415
0.5403

64

4
0.4000
0.6000
0.8000
1.0000

1.4918
1.8221
1.2255
2.7183

0.3984
0.5646
0.7174
0.8415

0.9211
0.8253
0.6967
0.5403

4.2.


MATLAB sum cumsumt),
:
sum(x)
cumsum(x)
.
, sum(x) . , ,
.
cumsum(x) .
.
j 4.3

= 1 :

3 "

1000;

sum(x)

s =
500500

= [ 1,

4,

s = sum(x)

9,

16,

25 ]

.2;

s =
97 9

= [ 1,

s = sum(x)

2,

3,

4,

; 2,

3,

4,

5 ; 3,

4,

5,

6 ; 4,

5,

6,

7 ];

10

>: > s
s

65

14

18

22

- cumsum(x)

=
1

12

15

10

14

18

22

4.3.


prod( ) cumprodf ),
:
prod(x)
cumprod(x)
.
, prod(x)
. , ,

.
cumprod(x) .
.
; 4.4

:
1 10;
[1,4/9,16,25];

[1,4, 9,16,25];

2,3,4,5; 3,4,5,6; 4,5,6,7].


. 1196

[1,2,3,4,-

66

= 1 : 10;
= prod(x)
=
3628800

= [ 1, 4, 9, 16, 25 ];
= prod(x)
=
14400

= [ 1, 4, 9, 16, 25 ]. 2 ;
= prod(x)
=
207360000
=
=
=
1
2
6
24

[ 1, 2, 3, 4 ; 2, 3, 4, 5 ; 3, 4, 5, 6 ; 4 , 5, 6, 7 ];
cumprod(x)
2
6
24
120

3
12
60
360

4
20
120
840

4.4.
MATLAB
:
diff(f,

, )

:
f ;
( );
( n=i).
:
1.
sums ().

67

2. f .
3. diff(f,x,n) .
4. <Enter>.
.
| 4.5


: cos : . :
sybs , ;
= * cos (x) ;
diff(y, x)
ans =
- sin (x) * + cos (x)
diff(, , 3)
ans =
sin (x) * x 3 cos (x)

diff(f,x,n) , .

4.6

:
= 2,
= *
X
2 .

syms

yl = * 2;
2 = ;
= ( - * 5)

+ log

( + ) * /

(3);

_6S

zl = diff (yl, x)
zl =
2 * a * x
z2 = diff (y2, x, 3)
z2 =
* log (n)3
z3 = diff (y3, x)
z3 =
-5 * a * 4 * exp (-a * 5) + a * xA(a-l) / (aAn + )
+ 3 * a * /4

.
diff , diff (f),
.
f , .
, f , , , .
,
,
.
I 4.7
.
syms
a
diff( +
ans =
2 * b
diff(a +
ans =
3
diff( *
ans =

diff( *
ans =
*w

b
2)

* 3)

w + * 3)

* w + 3)

w;

69

f .
,
,
.
! 4.8
syms ;

= [ * s i n ( x ) ; 5 ; ( * )
d i f f (, )
ans =
cos (x) * + s i n (x)
5 * "4
* ( * )

];

4.5.
.
4.9
,,.., ,

; , ,

...,..,.,.,'.;..,*


sinx
=
X
, [0; 1], 0.2. :

= 0 : 0.2 : 1;
= sin (x)./

=
NaN

0.9933

0.9735

0.9411

0.8967

0.8415

.
=, .
, 0/0

sin 0 _
0

70


.
, .
,
, 0/0, 0/,
/, /.
MATLAB limit ,
:
limit(f, x, xO)
:
f , ;
f;
.
= =. MATLAB inf.
I 4.10

:
=

sinx

(- . - >
= X

0 - )
lnx
:

syms x;

l i m i t ( s i n ( x ) / x , , 0)
ans =
1

- 0,

> ,
> 1.

71


limit((1 - (-))./, , inf)
ans =

limit((1 - )./log (x)), , 1)


ans =
-1

. 4.1 .
MATLAB.
4.1.

(1+)7

00

(ax + b'Y

00

NaN

00

1--"'
log(l-/)
1-"
an
1-""
2 0

In a
a

2--

72

4.1 ()

-
In (jc-uf + 1)

- 2 In

10

-2

4.6.

= /()

x) =

(*)

\ J(a)

f(a)

+ ....

y = f(x),

f{a)

> f'(a)>

f"(a)>

f(a) -

.
= 0 :

2!


MATLAB Taylor (), :
Taylor (f(x), x, xO, n)

73

:
f () , ;
f (x);
,
f ();
.
:
1.
syms().
2. y = f(x).
3. Taylor (, ,,).
4. <Enter>.

>, =sin;c,

= sinh ,

sinjc

I 4.11

= - 5.
:

syms , y l , 2, , 4, 5, , ;
y l = s i n ( x ) ; 2 = ( ) ; = s i n h ( x ) ;
4 = (3 * + 1) (2 2 + 5 + 1) ;

74
5 =
zl =
zl =
x z2 =
z2 =
1 +
z3 =
z3 =
x +
z4 =
z4 1 z5 =
z5 =

4
log(x); = sin(x)./;
Taylor(yl, x, 0, 5)
1/6 . x A 3
Taylor (y2, x, 0, 5)
x + 1/2 . 2 + 1/6 , x"3 + 1/24 . 4
Taylor(y3, x, 0, 5)
1/6 . 3
Taylor (y4, x, 0, 5)
2 * x + 8 . x"2 - 36 . 3 + 164 . 4
Taylor(y5, x, 0, 5)

.
z6 = Taylor (, x, 0, 5)
z6 =
1 - 1/6 . 2 + 1/120 . 4

, sinx
sinhx , Taylor
= 5. ,
sin : .
5 - In = , In 0 .
:
?
?
?
.

75

,
.
. ,
,
.
.
.
1. , .
:
.
. ~'.
:

"
, ,
, :
!
, , = 1.5* = 0.01 .

! = ! = 1.5 100.

, 6 .
2. , . , .
3. .
.

76

, , :
,
;
;
.
.
4.12
= = 3, 4, 5:
2

2
3
4

24
2
6
2
3
, -\
+ + +
2
6
24
120

= , 4
5
2 h=o. 2.
,

MATLAB :

>>
>>

syms . , , 4,
X = 0 : 0.2 : 2;

= ();

- 1 + + . 2./2 + .~ 3. /6;
4 = 1 + + . 2./2 + . 3. /6 + . ./24;

5 - 1 + + . 2./2 + . 3. /6 + . 4./24 + . 5./120;


z - [ ; ; ; 4; 5 ];
Z'

Z =
X

0
0. 2000

1.0000
1.2214

1.0000
1.2213

4
1.0000
1.2214

5
1.0000
1.2214


0.4000
0.6000
0.8000
1.0000
1.2000
1.4000
1.6000
1.8000
2.0000

1.4918
1.8221
2.2255
2.7183
3.3201
4.0552
4.9530
6.0496
7.3891

1.4907
1.8160
2.2053
2.6667
3.2080
3.8373
4.5627
5.3920
6.3330

77
1.4917
1.8214
2.2224
2.7083
3.2944
3.9974
4.8357
5.8294
7.0000

1.4918
1.8220
2.2251
2.7167
3.3151
4.0422
4.9231
5.9869
7.2667

, = 3, 4, 5 , .
,
. , .
. 11.

4.7.

(
) - f(x)
. MATLAB
diff(f, x)
solve('fun',

x)

, ,
f ().

MATLAB .

78

| 4.13

: = . .
.
1.
.

xi < < 2

= 0 : 0.1 : 3 ;
. . * (-) ;
p l o t (, )

. 4.1.
. 4.1 ,
0.5 < < 1.5.
> figure 1
File Edit Ve
iw Insert loob Desktop Wn
idov
kj
- A

0.4 r~
0.35
0.3
0.25
0.2

0.15
0.1

0.05
0

0.5

1.5"

. 4.1. -

2.5

79

2. = ~ :
syms , , z;
z = d i f f (, )
z =
(-) - (-)

3. :
solve('(-)
ans =
1

- * (-) = 0 ' , )

4. :
1;

= . * (-)

=
0.3679

MATLAB ,
, . fmin ()
.
MATLAB
:
fmin ('fun', xl, x2)
fmin ('fun', xl, x2, options)
fmin ('fun', xl, x2, options, PI, ..., P10)

'fun' , ;

xl, 2
'fun 1 ;
options , , : options (1) , options (2) -

80

( l e - 0 4 ) , options (14) ( 500).

4.7.1. fmin ('fun', x1, x2)


' fun' xl < < 2.
.
| 4.14


= 2-4 + 6,
.
. xl < < 2, :

= 0 : 0 . 1 : 6;
= 2 . - 4 . + 6;
p l o t ( x , )

. 4.2.
. 4.2 , X,
, 2 < < 4.
fmin('fun',xi,x2):
- fmin ( ' 2
=
2.5288

- 4 * + 6',

2, 4)

= 2.5288;

= 2 . - 4 * + 6
Y =
1.6557

81

File. Edit Ve
i w Insert Toosl Desktop Wn
idow Hep
l

. 4.2. ^ = 2 - 4x + 6

,
(2.5288, 1.6557).
fmine fun 1 ,xi,x2) y = f(x).
= f(x)

{ 4.15

= ~ :
syms x;
1
fminC-x * exp (-X) , 0.5, 1.5)
ans =
1

82

4.7.2. fmin ('fun', x1, x2, options)


.
! 4.16

== 2 - Ax + 6.

syms x;

[, o p t i o n s ] = fmin('2. x - 4 * x + 6' , 2, 4, [0.1 e - 8])


X=
2.5288
options =
columns 1 thround 10
0 0.0001 0.0001 0.0000 0 0 0 1.6557 0 11.0000
columns 11 thround 18
0
0
0 500.000 0 0.0000 0.10000 0

,
1.6557,
(11), (500 ).
MATLAB
. :
fmins('fun', 0)
[, options] = fmins('fun', x0)
fmins('fun', xO, options)

'fun' =

/([,2,...,);

0 ;
options .

83

:
options (1) ;
options (2)
( 1-04);
options (14) ( 200, ).

4.8.

,
f(x), , .
, z-.
, MATLAB.

4.8.1.
f(x)

L{f{x)}=]f{x)e-"dx,

(4.1)

f(x) , .
/,
:
L{f(t)}

= ]f(t)e-dt.

(4.2)

84

(4.2) :

, _ lae-,,d
0

Z(sin(cof)) = Jsin(<B/)g ''dt = -

- :

('0) i- t = 0.
:

,
. :
(4.3)
->0


. .

85

MATLAB / ( / )
:
Laplace (F) F;
Laplace (F, s) (4.2);
Laplace (F,, s) .

Laplace(F)
F /, (4.2). F /
, F.
.
4.17
F = .
:
syms a;
Laplace(a)
ans =
s2
. ,

(4.2):

86

F /, Laplace (F)
:

nl

,
, , = 2,
Laplace (F) . ,
F .
| 4.18

f{t} = a + bc, .. /. Laplace (F):


syms
a
b

t
Laplace (a + * )
ans =

Laplace( + d * )
ans =

Laplace (a + d * w)
ans =

77
Laplace( + w * t)
ans =

77

87

, Laplace (F) . , d, w, t, . .
. t .

Laplace(F,s)
Laplace (F). ,

F .
I 4.19

L a p l a c e ( 3 . 5 , s)
ans =

Laplace(F,w,s)
,
F . :
(4.4)

4.20
>> gyms
a
b

Laplace(a, t, s)
ans

t;

a
s

Laplace(t * exp (-a * t), t, s)

88

(s + a)2
l a p l a c e (a + b * , b , s)
ans =

4.8.2.


, . .

. X,
,
= 2 .
:
50 ,
( );
5, , ;
s2 ,
, .
, .
:

dt

1 W

(0) = 1, ] (0) = 2 (0) = 0, :

=0

' .
.
s2 . (/) , -

90

t,
sQ s], . .

MATLAB
(. 8).
:
s2

Xs + 2X

, (4.3)

.v->0
:
, + 2/. + 2

t. ,
, 4
, . . X - , = = 0.8 .

4.8.3.

t.

91

1
^

5+

\ F{s)e"ds.

(4.5)

' 5-(


.
.
MATLAB iLapiace (), :
iLaplace(L(s), t)
:
L (s) ;
t - f (t).
:
1.
syms ().
2. his),
3. iLapiace (L (s), t ) .
4. <Enter>.

.
[ 4.21

a +b s

syms a b

L = (a + b * s) / 2 ;
iLapiace(L, t)

L;

92

ans =
a t + b
4.22

(s) .
X = . = 1.

(s):
syms s t P;
P = (s"2 + 5 * s
iLaplace (P, t)
ans =

+ 4) / ( s * (sA2 + 5 * s + 5) ) ;

4
1 - 1
/ ? -1
- + - U > cos h ( - / 5 0 + ^ e " 2 ' sin h ( -

. .

\v
L i


:
;
;
.
.

5.1.
fun(x),
fun , , . , . ,

.
: <Enter>.
, .
MATLAB.

94

5.1.1.

abs () .

, . ,
.
\ 5.1

abs (x)
:
Yl=[-3,5], Y2=[2, -3, 2+3i, i ] ,
Y3=[2, -3; 1, 2+3i; -2, -5].
:
Yl=[-3,5];
Y2=[2, -3,
Y3=[2, -3;
abs(Yl)
ans =
3
5
abs(Y2)
ans =
2.0000
abs(Y3)
ans =
2.0000
1.0000
2.0000

2+3i, i];
1, 2+3i; -2, -5]

3.0000

3.6056

1.0000

3.000
3.6056
5.0000

exp(x) .

, . , :
2 =ex (cosjv + /sin>),
z = + iy .

95

\ 5.2

[ 1 2 3 4 5], [2.5+71, - 1 , 1],


[-1, 0.1, i ; 3+1.2i, -i, 5; - 0.5, 0.5, 2].
:
Yl = [1, 2, 3, 4, 5);
Y2 = [2.5+ 7i, -1, 1];
Y3 = [-1, 0.1, i; 3+1.2i, - i , 5; - 0.5, 0.5, 2];
exp(Yl)
ans =
2.7183 7.3891 20.0855 54.5982 148.4132
exp(Y2)
ans =
9.1844 + 8.0037i
0.3679
exp(Y3)
ans =
l.Oe+002*
0.0037
0.0111
0.0728+0.1872i
0.0054-0.0084i
0.0061
0.0165

2.7183

0.0054+0.0084i
1.4841
0.0739

log (x), loglO (x), log2 (x).


, 10, 2.
, .
. z = x + iy , :
log(z) = log(abc(z) + i atan2 (y,x))
! 5.3

log(x), loglO(x), iog2 (x) x:


x=[l 2 3 4 5], x=l+2i, x=-5.

96

5
:
Y1 = [1 2 3 4 5];
Y2 = l+2i;
Y3 = -5;
log (YD
ans =
0
0.6931
1.0986
1.3863
loglO(Yl)
ans =
0
0.3010
0.4771
0.6021
log2(Yl)
ans =
0
1.0000
1.5850 - 2.0000
log(Y2)
ans =
0.8047 + 1.107-li
loglO(Y2)
ans =
0.3495 + 0.4808i
log2(Y2)
ans =
1.1610 + 1.59731
log(Y3)
ans =
1.6094 + 3.1416i
logl0(Y3)
ans =
0.6990 + 1.3644i
log2(Y3)
ans =
2.3219 + 4.5324i

1.6094

0.6990

2.3219

s q r t (x) .
, . ,
.
,
.

97

I 5.4

:
x l = -7, 2 = [ 1 , 2,
= [ 1 , 3, 5; - 2 , i ,

3+4.5i],
4;

7, 3, 1 ] .

xl = -7;

2 = [1 2 3 + 4 . 5 i ] ;
= [1 3 5; -2 i 4; 7 3 1 ] ;

sqrt(xl)
ans =
0+2.6458i
sqrt(x2)
ans =
1.0000
1.4142
2.0504+1.0973i
sqrt(x3)
ans
1.0000
1.7321
0 + 1.4142i
0.7071 + 0 . 7 0 7 H
2.6458
1.7321

2.2361
2.0000
1.0000

mod (x, ) .
! 5.5

,
xl=5, yl=3;

x2=-12, y2=7; x3=8+4i, =2.

:
zl=mod(xl,yl)
ans =
2
z2=mod(x2,y2)
ans =
2
z3=mod(x3,y3)
ans
4 3. 1196

98

5.1.2.
sinx, cos ;, tgx, ctgx, sec :,
cosec x MATLAB :
sin(x)

tg(x)

s e c (x)

cos()

cot(z)

esc(x)

x , , .

.
; 5.6

sin([l,2,0,pi/2])
arts =
0.8415
0.9093
0
1.0000
cos([-0.6, pi/6, pi/2])
ans =
0.8253
0.8660
0.0000
tan([2+3i, pi/2, 0])
ans =
1.06+16
-0.000.0 + O.OOOOi
1.6363
0
cot([l, pi/2, 3, 4])
ans =
0.6421
0.0000
-7.0153
0/8637
sec([l, 2, 2.5; -1, 3, 2.1; 0.5, 6, -2])
ans
1.8508
-2.4030
-1.2482
1.8508
-1.0101
-1.9808
1.1395
1.0415
-2.4030
csc([i, 0, -2, pi/4])
ans
0
-0.8509i
inf
-1.0998
1.4142

99

5.1.3.

arcsinx,
arccosx,
arctg x, arcctg x, arcsec x, arccosec x MATLAB :
asin(x)
acos(x)

atan(x)
acot(x)

asec(x)
acsc (x)

x , .
, , . , asin(x) acos (x) [-1; 1]. asin(x)
; , a acos(x) [0;]. -

L 2 2J
, [-1; 1],
asin(x) acos (x) .
,
.
5.7
a s i n ( [ 1 , 0, - 2 , - 0 . 5 ] )
ans =
1.5708
0
1.5708 - 1.31701
-0.5236
a c o s ( [ 1 , 0, - 2 , - 0 . 5 , i ] )
ans =
0 1.5708
3.1416 - 1.3170i
2.0944
1.5708 - 0.8814i
a t a n ( [ l , 0, 2 , - 0 , 5 , i ] )
ans =
-0.7854
0
1.1071
-0.4 636
NAN + NANi
a c o t ( [ - l , 0, 2, - 0 . 5 + i ] )
ans =
-0.7854
1.5708
0.4636
-1.1071
NAN + NANi

100
asec([1,
ans =

acsc([l,
ans =
1.5708

5
0, 2, -0.5])
0 + infi
1.0472
0, 2, -0.5,, i])
NAN-infi

0.5236

3.1416-1.3170i

-1.5708 + 1.3170i

0 - 0.8814i

5.1.4.
sh x, ch x, th x, cth x, sch x, csch x
:
sinh(x)
cosh(x)

tanh(x)
coth(x)

sech(x)
csch(x)


:
sh x =

ex-e~x

ch x-th x =
cth x =

'
* = 3T"7'
e +1
2
csch x =

s c h

, , . .

101

\ 5.8

sinh([,

1,

- 1 , 0.7,

1,

- 1 , 2,

5])

ans =

cosh([0,

1.1752

-1.1752

0.7586

74.2032

3+0.51])

ans =
1.0000

tanh([0,

1.5431
1,

1.5431

- 1 , 0.7,

3.7622

8.8352 + 4 . 8 0 2 8 i

5])

ans =

coth([0,

0.7616
1,

-0.7616

- 1 , 2,

0.6044

ans =

inf

0.9999

3+0.5i])

sech([O,

1,

1.3130

-1.3130

- 1 , 0.7,

5])

1.0373

1.0027 -

0.0042i

ans =
1.0000

csch([O,

0.6481
1,

0.6481

- 1 , 2,

0.7967

0.0135

3+0.5i])

ans =
inf

0.8509

-0.8509

0.2757

0.0874 -

0..0480i

5.1.5.
arsh*, arch*, arthx,
arcth x, arsch x, arcsch x MATLAB
:
asinh(x)
acosh(x)

atanh(x)
acoth(x)

asech(x)
acsch(x)

:
arsh = In(v* +1 + I,
2

a r c h (x) = i a r o o o s (x),
a r t h (x) = - i a r c t a n ( i x ) ,
a r c t h (x) = - i a r c c o t ( - i x ) ,

102

5
arsch(x) = iarccos(1/x),
2

arcsch x = In

Jx

+ 1 sh(x) + 1
x

x ,
.
, .
5.9
asinh( [0, 1, -3, 2+3i] )
arts =

0.8814
-1.8184
1.9686 + 0.9647i
acosh([0, 1, -3, 2+3i])
ans =
0 + 1.5708i
0
1.7627 + 3.1416i
1.9834 + l.OOOli
atanh([0, 1, -3, 2+3i] )
ans =
0
NaN + NaNi
-0.3466 + 1.5708i
0.1469 + 1.3390i
acoth([0, 1, -3, 2+3i])
ans =
0 + 1.5708i
NaN + NaNi
-0.3466
0.1469 - 0.2318i
asech([0, 1, -3, 2+3i])
ans =
inf
0
0 + 1.9106i
0.2313 - 1.4204i
acsc(([0, 1, -3, 2=3i])
ans =
NaN + NaNi
0.8814
-0.3275
0.1574 - 0.2300i

5.1.6.
:
z = a + .
MATLAB :
abs(z)
imaq(z)
phase(z)
real(z)
.
conj(z)

103

abs (z) :
= /2 + 2 .
reai(z) imag(z)
.
conj (z) - Z.
phase (z)
a
= arctg.
b
z , . z
, , .
I 5.10
;,.. _,.,.;

\
......, , .,
,.,,,
abs([2, 3+2i, 5i, -1+i])
ans =
2
3.6056
5
1.4142
real([-3+2i, 2-3i])
ans =
-3
2
imaq([-3+2i, 2-3i])
ans =
2
-3
conj([-3+2i, 2-3i])
ans =
-3.0000-2.OOOOi
2.0000+30000i
phase([-3+2i, 2-3i])
ans =
2.5536
5.3004

.,,

104

5.2.


.
, ,
. . [9, 15, 16].
MATLAB .
,
.
MATLAB . .
<Enter> .
, .
, . .

5.2.1. -
- .
:

. -
,
:

{ + 1)=(),
(1) = (2) = 1,

105

- , , .
- MATLAB
.
- :
gamma (n) ,
.
i 5.11

- [0,, 1, 2, ,
-3, 4.2].
:
=[0, 1, 2, 6, - 3 , 4.2])
ans inf
1.0000
1.0000

120.0000

inf

7.7567

, - 0 -3
( i n f ).
,

gamma(n)=(n-l)!
, , 5!, gamma()
: gamma (6).

106

MATLAB - :
gammainc(x, n)
gammaln(n)

gammainc(x,n)
, .

.
gammaln(n) gamma (n).
5.12
gammainc(3, 2)
ans =
0.8009
gammaln([2, 3.5, 7.3, 15])
ans =
0
1.2010
7.1479
25.1912
gammaln([2, 3; 7.3, 1; 4, 12.5])
ans =
0
0.6931
7.1479
0
1.7918
18.7343

5.2.2. -
( )
- :

. -
-:

107

MATLAB :
b e t a ( x , )
b e t a i n c ( z , x, )
b e t a l n ( x , )

beta (, ) - , .
betainc(z,x,y) -
, . z [0; 1].
betaln(x,y)
.
:

":

! 5.13
b e t a ( 2 , 4)
ans =
0.0500
b e t a i n c ( 0 . 5 , 2, 4)
ans =
0.0125
b e t a l n ( 2 , 4)
ans =
-2.9957

5.2.3.
MATLAB :
erf (x) , :
2
erf(x)- \e'2dt;

108

erfc(x) , :
erfc(x) = I -erf (x) = -=
4%\

\/dt;

erfcx (x) ,
:
erfcx [) = erfc(;c);
erfinv(x) -1 < < 1.
,
. ( ).
5.14

=[2 -. 4.5 .6]. .


:
erf () .
ans =
0.9953
erfc(x)
ans =
0.0047
erfcx(x)
ans =
. 0.2554
erfinv(x)
ans =
NaN

-0.3286

1.0000

0.6039

1.3286

0.0000

0.3961

1.4537

0.1225

0.5678

NaN

0.5951

-0.2725

(NaN) =2 =4.5.
.

109

5.2.4.

. MATLAB ,
:

MATLAB :
expint(x)
, ,
, .
I 5.15
e x p i n t ( [ 1 , 2, - 3 , 6 . 2 , 2+31])
ans =
0.2194 0.0489 - 9 . 9 3 3 8 - 3 . 1 4 1 6 i
0.0003
e x p i n t ( [ 1 . 2 , 3; 2, 7 . 5 ; l - 2 i , 0.7])
ans =
0.1564
0.0130
0.0489
0.0001
-0.1268 + 0 . 0 3 5
0.3738

0.0248 + 0 . 0 2 0 3 i

5.2.5.

110

Ai(x, ) = 0 :

I
6 ->3 6
Ai(x, ) =
2

{) !

- ( .

Bi(jt, ?)

(: +'

3 4/3

= 0

, )-

| / 3 4

^2/3
5

Dx

(3*)!

///

MATLAB
:
airy(z) ;
airy (k, z) .
:
z , ,
,
;
:

= , airy (z);

k=i ;

=2 ;

= .

MATLAB .
| 5.16
=[0, 3.2, -3.2, 2+3i];
airy()
ans =
0.3550
0.0046
0.4174
airy(0,y)
ans =
0.3550
0.0046
0.4174
airy(l,y)
ans =
-0.2500
-0.0085
0.0650
airy(2,y)
ans =
0.6149
19.5870
-0.0539
airy(3,y)
ans =
0.4483
33.2577
-0.7541

+ O.OOOOi

0.0081 + 0.1312i

+ O.OOOOi

0.0081 + 0.1312i

- O.OOOOi

0.0967 - 0.2320i

- O.OOOOi

-0.3964 - 0.5697i

+ O.OOOOi

0.3495 - 1.1053i

5.2.6.
:

()='L
2"!

(-\)
dx"

MATLAB , :
leqendre(n,

),

:
, 256;
,
-1 < < 1 .

+ \
.
.
5.17
;;
leqender(3, 0.5)
ans =
-0.4375
-0.3248
5.6250
-9.7428
leqender(3, [-0.5, 0.2, 0.1])
ans
0.4375
-0.2800
-0.1475
1.1758
-0.3248
1.4179
-5.6250
2.8800
1.4850
-9.7428
-14.1091
-14.7756

113

5.2.7.
:

d2

y(z)

L .
JL (JC) J, (z) . :

2)

- on
\

F(Z + k + \) -;

JL(z)cos(Ln)-J(^
sin (Ln)
,
:

MATLAB
:
bessei j (n, z) ;
bessely (n, z) .
z , , - , .

114

.
z , .
5.18
=[2, 1,5];
>> --21, 3,5] ;
besselj(,)
ans =
-0.2611 - 0.7623i
bessely(A,)
ans =
-0.7512
0.1240i

0.3391

0.3247

0.2611

-0.4537

.
[9, 15, 16].

5.3.
, ,
.
, ,
, . , .
1. m- New
M-File ( m-).
2.
f u n c t i o n Z = ()

function , , . z
. .
3. ( ).
Z = ()/

115

.
-.
4.
Save ()

.
. File name (
) .
Save ().
5. -.
z=exp(x) /x .

:
z=expxp(i). z=exp(i)/i.

MATLAB , , . , ,
. [9].


6.1.
,
.
. , .
6.1

V=[l,2,-3,-7,12]
V=[3 2+3i l - 2 i -5]

<Enter>. , .
:

-
3.0000

12

2.0000 + 3.0000i

1.0000 - 2.0000i

-5.0000

, , , .
,
(,-).

117

\ 6.2

=[1 - 2 3 ; 2

3 -4;-3

4 5]

<Enter> '
:
1
2
-3

-2
3
4

3
-4
5

M=[7-2
:

7.0000 - 2.0000i
1.0000
l.OOOOi

1.,0000 + l.OOOOi
2,.0000
2 .0000

12 .0000
7.0000
.00001
1

, , .

" V"

,.

j 6.3
V=[l:4]
v =
1

=[1:3;2:4;7:9]
=

1 2
2 3
7 8

3
4
9

, 1.
, , :

118
V=[l:0.2:2]
V =
1.0000
1.2000
1.4000
1. 6000
M = [ 1 : 0 . 2 : 1 . 8 ; 2 : 0 . 4 : 3 . 6 ; 1:5]
V=
1.0000
1.2000
1.4000
1. 6000
2.0000
2.4000
2.8000
3. 2000
1.0000
2.0000
3.0000
4. 0000

1,,8000

2.0000

1.8000
3.6000
5.0000

6.2.
MATLAB :
;
;
;
.

6.2.1.


(
).
\ 6.4

V=[l 2 3 7 12];
V(4)
V=
7
>> -[1,3,7; 2 6 12; -4 8 3 ] ;
M(l,3)
=

119

. <Enter> .
I 6.5

i ..

........i

, .
( ) 12, ,
( 12), -7.
:
V(3) = 12
v(3) =
1
2 12

(2,3)

12

= -7

=
1 3
2

7
6 - 7

6.2.2.


.
.

(.-),
:
(:, ) ;
(,:) .
\ 6.6

:
=
1

120

6
2
3

7
12

4
-7

.
:

(:,2)

1
3

(3,
=

12

-7

:)

12

. . .
. .
| 6.7

:
Vl=[l 2 3],V2=[3 -2 1],V3=[7 6 2].
. . :

M=[V1; V2; V3]

vi, v2, v3:


=
1 2
3-2
7
6

3
1
2

. 6x6.
: +, -5 *2.

121

:
Z=[M, +3;: -5, *2]
z 2
3
4
5
1
1
1
6
3 -2
6
2
10
9
7
-3
-2
4
2
-4
-7
-4
-4
6
-2
1
-3
14
12
2

6
4
5
6
2
4

6.2.3.



det{M)
,
.
"

"-;

:-

| 6.8

"

=[2 3 - 1 ; 1 -6 2 ; 1 3 5 ] ;
det(M)
ans =
-90
M=[l+2i, 3, - 2 . 5 ; i , - 1 , 5; 3, 5, 0 ] ;
det(M)
ans =
12.5000 - 62.5000i

MATLAB, , ,
.
,
.

122


,
, .

: ', .
! 6.9

:
"2
3-4
5

7
2

1 -5

=[1 2 7 ;

Z=M'

3 -4 2 ;

5 1 -5] ;

Z =
1

2 - 4
7

1
2 - 5


.
trace , :
trace(M)
.
\ 6.10

..;

I
;

: =[2 - 1 ; 2 4 8; 1 -2 3].
2, 4, 3, 9.

123

:
= [ 2 , 6 , - 1 ; 2 , 4 , 8 ; 1 , - 2 , 3] ;
Z=trace(M)
Z=
9


,
:
invO, :
inv(M)
.
| 6.11

=[1, - 1 , 3 ; 2, 1 1 , 7; - 3 , 5, 4 ] ;
Z=inv(M)

Z=
0.0539
-0.1737
0.2575

0.1138
0.0778
-0.0120

-0.2395
-0.0060
0.0778


:
eye (n) ;
eye(m,n) mxn

;
eye (size ()) , .

124

! 6.12

= (3)

= ( 3 , 4 )

=[1 1 2

3;

0
0
0
2, 2, - 3 ,

, 1,

3,

0;

1,

2,

3,

4];

Z = e y e ( s i z e (

Z =
1

0
0
1
0

0
0
0
1




:
ones (n) , :
ones (m, n) mxn;
ones (size ()) , .
| 6.13

M=ones(3)

=
1

125

M=ones(3,4)

=
1
1
1

1
1
1

1
1
1

1
1
1

= [ 3 , 2,

Z= o n e s ( s i z e ( M ) )

1,

7;

6,

1,

-2,

4];

Z =
1



:
zeros (n) ;
zeros (m,n) mxn
;
zeros (size (M)) , .
I 6.14

: , ...............
M=zeros(3)

,,

M=zeros (3,4)

=
0

3;

=[1, 2,

M=zeros(size(M))

0
0

2,

3,

4; 3,

4,

5] ;

126


[; \. :
linspace (a,b) 100 ,
[a; b\;
linspace (a,b,n) , [; ].
I 6.15
R=linspace(l,2)
R =
1.0000
1.0101
R=linspace(l,10,5)
R =
1.0000
3.2500

1.0202

5.5000

1.9899

7.7500

2.0000

10.0000


:
flipir (M)
;
f lipud (M) .
6.16
= [ 1 , 2, 3 , 4 ; 3 , 1, 4, 2]
='
1 2
3
4
3
1 4
2

Z=flipir(M)
Z =
4
3
2
1
2
4
1 3


W=flipud(M)
W=
3
1 4
1 2
3

127_

2
4

MATLAB , v, , ,
! , . .
V. :
perms(V)
v , .
! 6.17
,

. !

=
7

1 7
1

1
2

2
2

1 7
7


MATLAB ,
v .
:
M=diaq (v, ) , v. = 0 , > 0 -
, < 0 - .
;
M=diaq(V) ,
v;
v=diaq(M,K) - v -
;

128

v=diaq(M)
v.

\ 6.18
V=[l, 0, 2, - 7 ] ;
M=diaq(V,0)
M=
0
0
0
0
0
0
0
0
0
2
0
-7
0
0
0
Z=diaq(V, -2)
Z =
0
0
0
0
0
0
1
0
0
0
0
0
0
0
2
0
0
0
V=diaq(M, 0)

0
0
0
0
0
-7

0
0
0
0
0

0
0
0
0
0
0

1
0
2
-7
M=[l,

2,

- 3 , 5;

V=diaq(M,1)
2
4
2
V=diaq(M)

-2,

4,

7;

1,

0,

4,

-2];

129


MATLAB , ,
[0; 1].
:
rand (n)
rand(m,n)
rand(m,n,p,...) ;
rand (size ()) ;
rand , , < t > ( rando) <Enter>, [0; 1],
;
rand state') , 35 , .
.
:
rand s t a t e ' , ) ;
rand state *,s) S.
6.19

Z=rand(4)
Z =
0.9797
0.4449
0.9568
0.6946
0.5226
0.2714
0.6213
0.8801
0.2523
0.8757
0.7948
0.1730
M=[l, 2, :3; 2 , 4 , 1 ] ;

Z=rand(size(M))
5 3. 1196

0.7373
0.1365
0.0118
0.8929

130

z=
0.6614
0.2844

0.4692
0.0648

0.9883
0.5828

, .

.
:
X=rand(800, 1);
Y=rand(800, 1);
plot(X, Y, ' . ' )
. 6.1.
Fle
i Edti Ve
iw Insert Toosl
ss . ;.<a>

Desktop

0.9
0.8 ' ' ': '.
0.7
0.6 *

0.5"
*
0.4
0.3
0.2
0.1
v

* *

'

; . " ,

0.1 0.2

:;---.*V \% "

' '
.. **

Help

:: D

"

Window

. '., ** .- ... *
*''."
."-.' ' .*.

***:

. .

. /

..%

'

:
t

*'.-

" .

* '

\ : ' :

'

i.:

0.3

0.4

0.5

0,6

0.7

0.B

0.9

. 6.1. ,

MATLAB
, ,

13j_

, , 1.
:
randn , <> <Enter>,
;
randn (n) ;
randn (m,n) mxn;
randnfm,n,p...)
;
randn (size ()) ;
;
randn('state')
;
randn('state',) () ;
randn (' s t a t e ' , s) s.
| 6.20
Z=randn(2, 3)
Z =
0. 7104
0.7853
0. 9508
0.4353

0. 7073
0. 1.381

.
:
Y=randn(n,l);
hist(y,m)
n , m
.

132
6.21


m = 100.

= 20000

Y=randn(20000,1);
hist(Y,100)

. 6.2.
Fife Ed* Ve
i w [nsert Toosl Desktop Wn
idow Hep
l
D :>: S ; k : - Q <"/ ! ? D

BOO

Ik

500

400

300

200

100
-5

-A'

-Jill
3-2

1 2

. 6.2.


,
,
.
rot (), :
rot90(M, )

133

:
;
,
, 90.
= 1, 90, = 2 180
. .
.
= 1 :
rot90(M)
6.22

= [ 1 , 2,

Z=rot90(M,2)

3;

2,

3,

4;

3,

4,

5] ;

Z 5



:
t r i l () ,
;
t r i i (, )
-;

triu(M) ;
triu(M,K) ,
- .
6.23

= [ 1 , 4,

3;

=
1 4

7,

2,

2;

6,

1,

5]

134
7
2
2
6
1
5
(M)
Z-tril
z =
1
0
0
7
2
0
6
1
5
z - t r i l (M, 1)
z =
0
0
0

4
0
0

3
2
0


MATLAB , , .
.
, , nxn(n>3),
,
.
:
magic(n)
.
6.24
M=magic(3)
=

8
3
4

5
9

1 6
7
2

135

6.3.


, : , , ,
, ,
, .

(. 6.1).
6.1. MATLAB

plus

( )

1+2

minus

( )

1-2

times

Ml.*2

mtimes

1*2

mpower

power

mzdivide

1/2

mldivide

1\2

rdivide

. /

Ml./2

ldivide

Ml.\2

1.

136

:
1 2
= 2
2

1 , N= 1 5

1 4

, . 6.1,
, :
3
plus(M,N) = 3
5

2 8
8 5
4

-1
2
minus(M, N) = 1 -2

2
-3

-1

-2

~2

15"

19

25

16"

mtimes(M, N) = 10

18

19

times(M,N) = 2

15

17

17

14

"15

13

27"

"l

25'

mpower(M, 2) = 10

14

17

power (M, 2) = 4

12

11

27_

16

0.9

0.7

-0.5"

mrdivide(M, N) = -0.14

0.18

0.7

1.02

0.26

-0.1

0.9524

2. 5714

-0.3810"

mldivide(M, N) = -0.4286

0. 1429

1.5714

0.3810

-0 5714

0.0476

0.5
rdivide(M,N) = 2
0.6667

inf

1.667'

0.6

0.25

0.3333

ldivide(M,N) =

137

0.6

0.5

1.6667

1.5

0.25

, .
6.25

=[1 2 5 ; 2 3 ].; 2 1 4 ]
N=[2 0 3 ; 1 5 4 ; 3 3 1]

.*N =

2 =

"2

15'

15

15

13

27"

10

14

17

12

11

27

.
.
""""
' !"->
;. vv,...-.-.......-.-..;..--~."..-..
;,-.
:
i 6.26
:
Vl=[l, 2, 4, 7];
V2=[-2, 3, 1, 5]
:
V1+V2
[-1 5 5 12]
Vl-V2=[3 - 1 3 2]
Vl.*V2=[-2 6 4 35]
1 . 2 = [ 1 4 1 6 49]

...........3
\

138
V1/V2=1.1O2 6

Vl\ V2 =
-0.2857

0.4286

0.1429

0.7143

VI./V2=[-0.5000

0.6667 4.0000 1.4000]

VI.\V2=[-2.0000

1.5000 0.2500 0.7143]

6.3.1.

\, '\
sinx .
| 6.27

N : N- [1 5 7 9 ].
In N, e N , sin N.
:
N=[1, 3, 5, 7, 91;
Z=log(N)
0 1.0986
Z=exp(N)
Z=
1.0

Z =

1.6094

1.9459

2.1972

+ 003

0.0027
Z=sin(N)

0.0201

0.1484

0.8415

0.1411

-0.9589

1.0966

0.6570

8.1031

0.4121

| 6.28

: =[1, 2, 7; 3, -2, 6].


: In , " , + 2 + 2 .

139

=[1, 2, 7; 3, -2, 6];


Z=log(K)

0.6931
1.0986
0.6931
Z=exp(-K)
Z =
0.1353
0.3679
0.0498
7.3891
A
Z=exp(K)+2*K+K. 2
Z 1.0 + 003
0.0057
0.0154
0.0351
0.0001

3.1416i

0.0009
0.0025

1.1596
0.4514

1.19459
1.7918

MATLAB
.
, ,
; ;
,
.
,
.

.
MATLAB , , [9].

7.1.
:
p l o t ( x , )
p l o t ( x , , s)
p l o t ( x l , yl, si,

x2, y2, s2,

. . . , xn, yn,

sn)

141

:
, ;
, ;
s ; ,
, ;
xi, 2,..., ,
;
yi, 2, ..., , .

.

7.1.1. plot(x,y)

= /() , .
. :
/ ( ) = 0;
(,
, , );
;
.
i 7.1

I.;

= -9

+ 6.


3*-9 + 6 = 0
.

142

= 0 : 0.1 : 3.5;
= 3. - 9 . + 6;
p l o t (x,y)

. 7.1. ,
. : 0.5 < xi < 1.5, 2 < 2 < 3.
1.5 < < 2.5.
.
File Ed Ve
iw Insert Toosl PesWo
tp Wnidow Hep
l

0.5

1.5.

2.5

. 7.1. = -9 + 6

7.1.2. plot (x,y,s)


plot (x, ) , ,
, . . . s
.

143

. 7.1 MATLAB.
7.1.

-.

+
*
S
D
V,

--

, < , >

,
, ,

s , : , ,
.
:
p l o t ( x , , ' [ ' R ' , . ' , ' - . ' ] )

(R),
(*), (-.).
. 7.2 = 3 - 9 + 6,
.
! 7.2

,
, .
. 7.2.

144

ex
File
D

1
Vs
w Insert TooslDeskotp Wnidow
H

'

25
20
15
i

10

5
-

" *

'

"

'

* -

1.5

. 7.2. s
7.2.

22

7,5

68

24

108

32

137

47

255

93

315

120

390

134

405

144

685

245

700

260

1100

380

145

:
R , ;

V , .

.
. .
V = f{R)
.
plot (x,y,s).
:

=[22, 68, 108, 137, 255, 315, 390, 405, 685, 700, 1100];
= [ 7 . 5 , 24, 32, 47, 93, 120, 134, 144, 254, 260, 3 8 0 ] ;
plot(,, ['1, .,'-.'])

. 7.3.
File Edti Ve
iw Insert Toosl Desktop

W
nidow Hee
t
'*: O B

400
350

300

250

200
150

100

50
n
0

200

400

600

800

1000

1200

. 7.3.

146

. 7.3 , : V = a + bR. ,
.

7.1.3.
plot(x1fy1,s1, x2,y2,s2, ...,xn,yn,sn)

.
:
Xi i- , ;
yt i- ;
Si i- .
. MATLAB
.
YiUi) .
, , .
, m- MATLAB.
.
. 7.3.
7.2 . = f(x)

6.2

4.1

1.9

0.6

.
:

= [ 1

=[6.2,

4.1,

4] ;

plot(x,

1.9,

0.6];

' .-q')

<Enter> .

147


, , :

title ('Our plot')


xlabel ('X axis')
ylabel ('Y axis')
grid on


. 7.4.
",

Curert : j L> WATLUftSpMwwt;

Using Toolbo* Path Cache.

32 double aicay
32 double array

Type " h e l p toolbox_^p*tJi c a c h e " foi

To s e t t a c t e d , s e l e c t "1 Help" (com the Help aenu.


tl 2 J 4]:
{6.2, 4 . 1 , 1.9,
(x, y, . - # ' ]

0.6];

..^ '

.[6.2,

4.1, J.9,

(x, ,

tllle

a.6];

-.-')

!'(hii plot-)

J J

* 01

. 7.4. . 7.3

, . 7.5.
()
z^x), plot () :
p l o t ( x , , ,

z)

148

= [ 1 , 2, 3, 4, 5 ] ;
y=cos(x);
z=exp(-x);
p l o t (, , , z) .

, hold on.
.
hold off.

File Ed* Veiw Insert Tools Desktop Wn


idow Hep
l

.^

. 7.5. , . 7.3
, ezpiot (),
:
A

f='2*x 2+3*x+l'
e z p i o t (f,

, )

149

f , , ,
.
.
plot (xi,yi,si,x2,y2,s2,... ,sn,yn, sn)
,
: , ,
, .
! 7.3

:
,
. 7.2.
Be
l Edti Ve
iw Insert Tccsl Desktop vimdow Hep
l
B} Q S . . *. f) ( | OS
400
350
300

250
200 -

150

100
50 -

0
0

200

400

BOO

1200

. 7.6.

150

V-f[R)
.
:
R=[22, 68, 108, 137, 255, 315, 390, 405, 685, 700, 1100];
V=[7.5, 24, 32, 47, 93, 120, 134, 144, 254, 260, 380];
F = 0.33 * R + 0.37;
plot(R,V,R,F)
, . 7.6.
, . .

7.1.4.


:

;
- ;
;
.
MATLAB
:
loglogx(...)
semilogx(...)
semilogy(...)

loglog ()
, semilogx ,
semilogy () .

plot'().

151

7.1.5.

MATLAB :
p o l a r (0, )
p o l a r ( 0 , , )
:
0 (0);
, (0);
s , plot ().

| 7.4

' *

'

'

- :

"

2
sin

Fife Edit Veiw Insert Tools Desktop Wn


idow Hepl

. 7.7.

152

t = 0 : pi/40:2 . pi;
polar(t,2./sin(5*t))

. 7.7.

7.1.6.
, v
. :
N - hist(Y)
N = hist (Y, M)
N = hist (Y, X)
[N,X] = h i s t ( . . .)
:
Y , , ;
;
.
hist (..) ,
, .
7.5

,
. randn (m, n).
:

= - 3 . 5 : 0.2 : 3 . 5 ;
= randn(10000,1);
hist(,)

. 7.8.

153

File Edit view Insert Toosl Desktop Wkd


i ow Hep
l

. 7.8. ,
,
.

7.2.
MATLAB . ,
.

z = f(x, )

, .
:
[X,Y] = m e s h g r i d ( x , )
[X,Y] - meshgrid(x)
[X,Y,Z] = meshgridfx, , z)

154

meshgrid(x,y) ,
, Y,
z = f(x, ) .
, Y . :
[X,Y] = meshgrid (1:0.2:1.6, 12:0.5:14)
X
1
1
1
1

1.2
1.2
1.2
1.2

1 .4
1 .4
1 .4
1 .4

1.6
1.6
1.6
1.6

12
12.5
13
13.5
14

12
12.5
13
13.5
14

12
12 .5
12
12..5
14

12
12.5
13
13.5
14

Y =

[X,Y,Z] = m e s h g r i d ( x , , z)

.
:
plot3(x,
plot3(X,
plot3(X,
plot3(xl,

, z)
Y, Z)
Y, Z, S)
y l , z l , s i , x2, y2, z2, s2,

. . . , xn, yn, zn, sn)

:
x, , z ;
, Y, z ;
s ,
plot ().

155


.
p l o t 3 ( x l , y l , z l , s l , x 2 , y 2 , z 2 , s 2 , . . . , x n , yn, zn,sn)
.
; 7.6

z = In + In
[4; 4] h = 0.1.
:
[X,Y] = meshgrid([-4:0.1:4]);
Z = log (X) + log (Y) ;
plot3(X,Y,Z)
. 7.9.
Fe
li Edti We Insert Toosl Desktop Wnidow Hep
l

. 7.9. z = lnx+\ny



8.1.

,
.

.

8.1.1.
( )
. , / ( ) = 0 [;].
:

/ ( ) , (
,). / ( ) - / ( , ) < 0 ,

1_57_

[;*,], [^;*i]'
/ ( ) - / ( , ) < 0 . ,
[b; ,],

[;,].
:

flf + X,
-,

-
2

/ ( ) - / ( , ) < 0

/(Z>)-/(jt|)<0. b
JC = X? / ( ^ ) - / ( ' 2 ) < 0 . .

:
/ ( * ) < S | / ( ) - / ( . _ , ) | < 8 ,

8 .

.
.

8.1.2.
:
:
._. _ / ( ) / < 0 / ( 6 ) / > ,
*~[&, f(a)f(a)>0

/(*)/'()<0.

158

:
,

0 = ,
0 = .

""'

\--\\-

|/(*)-

:
[a; b\ ;
/ ( a ) , f(b)

/ ( ) = 0 -

;
f(a),

f(b)

/ () a w \
f(x)-Q,

n = 1,2,...;

.
, .

:
[a; b] ;
/ " ();
, f(x).
, .


.

159

:
;

.
,
\ - _ , | < ,

[ ; _|], . .
. , \ - *_,
,
.

/ ( ) < , ,
f(x)

, .

f(x) -
, ,
.

8.1.3.
. , f(x) / ( ) = 0.

.
( ,) .
/(*,) , ( x , , / ( x | ) j . 2

160

= 0 .. -

, ,
:
k - * n - i N 8 |/)|
:

f'(xn_])

-\

/(V.)

f(x)

(8.1)
:,,,, .

, ,
f{x)

\a;b\. -

, 0
. xQ =, 0 =
.
:
:
0

fa, f(a)f"(a)>0

[, f(a)f(a)<0

f(b)f(b)>

f(b)f'(b)<0,

0.

\-,^\<

\/()\<.

, :
[a; b] ;
;

161

,
.
, .
:
, f(x)

/(JC) = O -

. , 2\-~ +5 = 0
, . . \ .
, .
, . .
0, , 2,..., / ( * ) , . : .

8.:4.
( )

.
|-_,|< | / ( * ) | <

f(x) - 0.
.
,
, .
.
)

- , -

, *) .
. 1196

162

-*.

('-)

, {^ - ^

< , . . -

.
:
:
=

[, f(a)f"(a)>0

f(b)f(b)<

[, f(a)f"(a)<0

f(b)f"(b)>0.

/ ( < / ) - / ( * _ , )

(-_,)/(,)

'

0 = a,
:0 = b.

:
~


. .
.

8.1.5.
/ ( ) = 0 ~>[). [a, b\ -

163

0, .

2,

...,

, = >(0 ) , 2 = (,),..., = ( ^ ; , ) .

, .

:
?
,
?
?
, .
.

-<(_^ ,, 2, ...,

, . . limx,, =x , 11WO
f(x) = 0.
2
,
[a; Z>]
'(<1. 0
[, ].
.
.
1. =<(_,) ,
/ ( * ) = 0 , .

164
2. .

->[) y = q(x) . ;c =xF(j>). = ?():


1

dx___

<fy_ '() '


dx

dy

dy

yn=f{yn-\)

<1
. ,

= *{), = ().
3. .
, /(JC) = O
= (() '()|>1, .. .
g ( x ) * 0
g(x). :
f{x)-g{x)

=0

x=

x-f(x)-g(x).

y(x) =

x-f(x)-g(x).

g(x) ,
'() < 1 [; ].

165_

F -*,.-! P


|;-: , | < ('()\< .
/ ( * ) = 0 :

< 0 < ;

=

_,?) | ' ( ) | < - ;

,
.
, ,
,

, f(x),
, . .

""
.

166

, , ,
.
, MATLAB.

8.2.

MATLAB

MATLAB
: solve (), f zero (), roots ().

. .

8.2.1.
solveQ
solve :
s o l v e ( ' f () ' , )

:
' f ( x ) ' , ;
.
/ ( ) = 0 .
, / () = 0.
.
symso,
,
.
solve () .

167

8.1

:
sin + -1 = 0.
:

Y = solve('sin(x)

+ -

1 = 1)

<Enter> :
Y=
0.510973
solve
f(x)-Q
.
I 8.2


2 - 4 + 3 = 0 .
:

Y = solve('2. -

4 * + 3 =

0')

Y =
1.418
3.413

.
solve ,
/ ( ) = 0. .
i 8.3

:
- I = 0.

168

.
:

Y = solve('sin(x)

+ l o g ( x ) + ()

- 1 = 0 ' )

<Enter> :
Y=
3.055 - 1.71447 i
, , , ,
: =.47.
solve () ,
, .
1 8.4

:
2-3(-)

= 0.

:
> -3*(-)=0')

Log( (3*a-3*b) /log (2)


solve () .
. .
. 8.1 . solve ()
, .

169

8.1.

0.555

+ 4siruc-2 = 0

0.463

2sin(ln*) = 0

1(4-2-) + ; - 2 = 0

1.2774

-!+2-2 = 0
2

8.2.2.

fzeroQ
f zero () :
f z e r o C f () ',
f z e r o t ' f () ',
fzero('f()',
fzero('f (x)',
fzeroCf (x)',

)
[xl, 2])
, t o l , t r a c e )
[xl, x2], t o l )
[xl, x 2 ] , t o l , t r a c e )

' f ()' , ;

() ;

[xl, 2] ;

tol ;
trace .
.
I 8.5

2 - 4 x + xsin,x = 0,
, -1 =4.

170

= fzero('2^x - 4 * + * s i n ( x ) ' ,

1)

0 . 3 4 7 8

= fzero('2 x - 4 * + * sin(x)',
Y=
4.4761

4)

i 8.6


fzero('y(x)',

[xl,x2])

. 8.1 .
File Edti Veiw Imer

T o o l s

D e s k t o p

W i n d o w

H e l p

l o g ( 4 - 2

x ) + x

- 2

40
35

\
>

30
25
20

15
"'

10

,.

0
-6

- 5

- 4

"

"

- 3

- 2

- 1

X
\

: . :

. 8.1. 1(4-2) + 2 - 2 = 0

171

. 8.1 , :
[0;-1],[1; 1.5], [1.5; 1.95].
:

[0,-1]);

[1,1.5]);

[1.5,1.95]);

XI = f z e r o ( ' l o g ( 4 - 2 * ) + 2 - 2 \

2 = f z e r o ( ' l o g ( 4 - 2 * ) + 2 - 2 ' ,

2 = f z e r o ( ' l o g ( 4 - 2 * ) + 2 - 2 ' ,
X = [xl,x2,x3]

<Enter> :

0.594

1.2774

1.9001

. [1.5; 1.95] , [1.5; 2], [1.5; 1.9], .


:
[1.5; 2] log(4-2x) =2 (log 0);
[1.5; 1.9] ,
1.9001, . .
.
[:,; -, ], . f(x)

[,; 2 ]
| 8.7

172

[0; -1]
tol = [0.1,0.01,0.001,0.0001,0.00001,0.000001]
:

[0,-1,0.1]);

[0,-1], 0.01);

XI = f z e r o ( ' l o g ( 4 - 2 * ) + 2 - 2 ' ,

2 - f z e r o { 4 o g ( 4

5 = f z e r o ( ' l o g ( 4 - 2 * ) + 2 - 2 ,
X = [Xl,x2,x3,x4,x5]

- 2 * ) + 2 - 2 ' ,

[ 0 , - 1 ] , 0.00001);

<Enter> :
-0.6367

-0.5906

-0.5994

-0.5994

-0.5945

-0.5945


. , , ,
toi=o.oi, , toi=o.ooooi.

8.8
..!....... ,,...

,' .. .,.;,..

,.


In (4 - 2) + 1 - 2 = 0
[0;-l]
( 50).
:
f z e r o ( ' l o g ( 4 - 2 * ) + 2 - 2 ' , [ 0 , - 1 ] , 50)
ans =
Funt-count

f ()
1
0
-0.613706
2
-1
0.791759
3
-0.436657
-0.225557
4
-0.634142
0.0638411
5
-0.590577
-0.00619106


6
7
8
ans =
-0. 5945

-0. 594428
-0. 594518
-0. 594516

173

-0. 0.000141692
1.45892 e 008
-3. 13434 e 006

10 6 ( ) 8 .
, fzero ()
/ ( ) = 0. .
y-f(x)

. f zero
, .
: MATLAB
,
. solve()
, . .
. f zero .

. .
MATLAB
, :

;

f zero tol;

s o l v e (' f (x) ' ) .

, solve (' f ()')


,

174

8.2.3.
rootsQ
roots () :
roots(z)
z .
.
; 8.9


= 25 - * + 5* + 2+1 + 3.
:

Y = roots([2

-35173])

1.2189 +
1.2189 -0.2719 +
-0.2719 -0.3940.

1.4110
1.4110
1.0105
1.0105

i
i
i
i
t

, = 0.
| 8.10

'

- 1
. :
z = [ l

= r o o t s (z)

-1];

175

<Enter> :
Y =
-0.8090
-0.8090
-0.3090
-0.3090
0.3090
0.3090
1
0.8090
0.8090

+
+
+
-

0.5878
0.5878
0.8511
0.8511
0.8511
0.8511

i
i
i
i
i
i

+ 0.5878 i
- 0.5878 i

roots (z) , .

8.2.4.


. 8.2.
. 8.3.

8.3.

,
.
.
. , , ,
,
.

8.2.
/

xi-a = 0

xs+(b-

)* - + 2 + ax(b-a)-a2b

, = , 2 = - 1 ' 3 , = 6

, = , 2 = - , X) =

=0

( = 0, = 0)

* + 2 (1 + ) + (4 -1) - 2(1 + ) - 4 = 0

= -, 2 = - , 3 = -, 45 = /

, = 1, 2 = 1, 3 = - 2 , 4= -2

8.2 ()
/

+(>~) -
2

' 5

-'

+ 3=0

, = - 7 ^ ,
,=-, X,

>0,

,,=3

3 = 3 , 4 5 = /(-6) 3

2 =

>0:

, = 3 , 2> = i*Ja ,

* , , 2 = ^ . ^ =

|2

+2 -2 = 0

/2

4 , , -

_2,/

4,5

2"'
"2

108 |/6 .
2

, 3 =1

1 + 5 - 2 - =

12= , 3 = 1, 4

6' -
74.

- 5 = ~

\8

8 '

//5

N1

8.2 ()
/

2'-2(

=s
12

\( + )i
( + )
2
1 = s
+ l , x ,2>3
,=s
i +l t

In 2
In 2
In 2

+ ) = 0

In sin - 2 = 0

JC, =asine 2 ",

10

-2"-2 = 0

11

sin ax + cos ax = 0

12

sinar + tgox = 0

13

^+ 1

x=

x2,=n-asine2a

In2a
2

In 2a
In 2a
*i=^-'*2,=J~

, =

5
4a

4a

,
a

,
x2J=a

4a

False

5k.
.
.
,, = i , -, 4 = i , x . 6 = i
12
3 4
5 6
2a
'
2a
'
2a

179

+1
II

j
el

._
t^
+1

m
1

^_

| -
1
CN
_

1
4

2.3

(N

~>

^ 1

&

(N

-' _g
II
^~

II

II

-
>;

>>

1
II

II

II

- I

II

s
X
V

I-O

+1

+1

0
1
II

tan

"

8.3.

4 -4: 3 -1- 2 +:-4 =

2sin(ln|A:|) = 0

-51+

arctg(tgx) = O

00

: 5 -- + 0.2 = 0

4^-^1-2

3 - 0.2JC 2 + 0 . 5 * + 1 . 5 = 0

sin (sin :)

'0-1 = 0

2 - 4 = 0

;8 + 2:-1.5 = 0

jr!+2x-2 = 0

* 4 - 2 : 2 + 8 + 1 = 0

1: + (: + 1) =0

arctg(jr-2) + x = 0

x2 +4 s i n x - 2 = 0

-1(7-4-)

4.5 = 0

6; 8 -2; + 3 = 0

10

3.5- - 2.8: + 7.5* - 2.5 = 0

00

00

8.3 ()

11

5 + 4 + 3 + 2 + + 1 =

12

\.55 +

13

X
"6+2-18 = 0

2 4 - 3 . 5 : 2 + 3 = 0

! ( 4 - 2 ) + 2 - 2 = 0

14

17"-157+134113+9-7 = 0

3*-9 + 1 = 0

15

4 + 2' - 1 = 0

2 + In 2 x - 5.6 = 0

16

- 2 1 2 + 55 = 0

2 r + e t - 5 x +l = 0

17

1 + 2 / + + 4 4 + 53 + 6 2 + 7 + 8 = 0

= +1.5 = 0

18

8 7 - 7 6 + 6 5 - 54 + 43 - 2 + 2 -1 = 0

y - ( - D

=o

19

50-1 = 0

x+lgx-0.5 = 0

20

+ 6" + - 4 + - 2 + -1 = 0

2x!-e-r+5 = 0

-2\=0

00

182


.
.
MATLAB .

.
MATLAB.

8.3.1.

:

ailxr+a21x2+...+a2nxn=b2,

(8.2)

{, 2> ,
/- - (/ = 1, 2, ..., ; j = 1, 2, ...,
), , /- , /-1,2, ..., .
,
( = ),
(),
(>).
(8.2) , 2, ..., ,
(8.1)
.
,
.

. ,

183

,
.
. , .
.

, + 22 - , = 1
! 2] + 2+ 3 = 2
[, + 22 + = 5
: = , 2 = 1, 3 = 1, . . .

j 2] + 4*2 - 23 = 2
[, + 22 + , = 5
, :
, + 2 - 2,
22 -, = - 1 ,
. . .
. .

X, + 2X2- = 1
2*, + 4X2- 2xj = 2
, + 6x2 - :3 - 3
.
,
2, 3.

184


. : .
,
.
,
,
.

.
, .
.
|| ,
.
:

, , = 10, N - 970 .
',, 2, ..., . ,

- . :
.
,
.
.
(8.2) :

185

2,,Xn+hla22>

2 =
= ,, +22

+ ... + _1_|

(8.3)

+bjam.

: aik = , i 1, 2,..., , = \,
2,..., , + \.
(8.3) :
]

=<](],2,...,),

2=(?2(],2,...,),

[ 0 ) , ^2 0) , ..., ^ .
, (8.4), :
= | (^1

V-C)
2

0)

(0)

,2

(0))
,..., (0)\

(8.5)

(0) v(0)
,2 ,...,
])

\ , 2^, ..., ^
, . , - .

:
\0), {20), ..., {0) ?
?
?

186


. .


, ] (/=1,2, ..., ),
,
. , bi
h
bn
, *-, ..., *-.



:

.

. , , .
. :
2| + 2 + , = 1
[ -7, - 2> + 43 = 6
8.*! + 2 3*3 =12
11
15
: = 5, 2= - , 3 = .
,
. . .

187


. .

7
, .
4 .

102

, = 4 .

10

10

.
: , 2 . :
-, + 22 + 83 = 44 .

2_
8

188

.
:
- 22 + 4, = 6

-7:,

, +10:2 + 83 = 10
22

= 44

.


v

(0) _

6
v

>) _ 1

- ~ _ ' 2

(0) _

~ 1 '

~ ""

'


:
+1)

Y
\~"',
( U + 1 )

\"

-,

()

- -

( + l) () , .
:
.
, . .
MATLAB .
, , .

8.3.2.
,
.

189

:
Y

(0) _ .

- .

(0) _
,

-22
:
()

<8 .

+1 .
, +1
2, 3, ..., ; 2 + 1 3 , 4,...,

. . -

:
()
2 ''
(+1)

,
(u+l) _

/r(u+l)

()

()

()\

,2 ,...,
(+1)

,
,
.

190

8.3.3.

22

, 3 . ,
,
1
, . .
.
,
, .
,
.
,
, ,
, . , . .

8.4.


MATLAB

MATLAB:

;

191

;
solve ();
nnls ().

8.4.1.

D , dk , -
( ).
:
D
.
! 8.11

:
2, + 2 - :3 = 1
- 2 + 2:3 =18
I X] i- J * 2 -I- 3 J

:
1
18
3

1 -3

-1

18

_
2
1

2 1 _
1 -1 2
7 5 1

2 1 1
1 -1 18
7 5 3
D

192

:
dxl = [1, 1, -3; 18, - 1 , 2; 3, 5, 1]
dx2 = [2, 1, -3; 1, 18, 2; 7, 3, 1]
dx3 = [2, 1, 1; 1, - 1 , 18; 7, 5, 3]
D = [2, 1, -3; 1, -1, 2; 7, 5, 1]
:

xl = det(dxl) / det(D);
2 = det(dx2) / det(D);
= det(dx3) / det(D);
X = [xl, x2, x3]

6.7111

-9.0222

1.1333

,
, .

8.4.2.

,
, X . :
X = \
X = inv(A)

! 8.12

:
2] + 2 - 3 = 1
, - 2+ 23 = 18
7] +52+

3=3

193


2
= 1
7

-3

-1

= [],2,3]

:
= [2,1,-3; 1,-1,2; 7,5,1];
= [1;18;3];
X = inv (A) *
ans =
6.7111
-9.0222
1.1333

MATLAB , . syms x,
, .
! 8.13

(
:

syms d;
= [a,b; c , d ] ;
= [1;3];
X = i n v () *

7 3. 1196

, + 2 = 1
ex, +dx2=3

194

, :
d

ad - be

ad - be

+
ad -be
ad - be

, .
! 8.14
L... .*:.'; L;1..; ;.

: ....:........

[-, + 22 = 3 - 2
:

= [2,

= [-1;

3+i;

X = inv(A)

3 -

- 1 , 2] ;
2.] ;

X =
-1.76
0.62

+ 0.68

0.66

8.4.3.
solvef)
solve () :
1

solve (fj. , 'f2\


solve ('fi', 'f2',

. . . , 'f n ')
. . . , 'fn\ x lf x2, . . . , xn)

:
' f i' i-Q , /=1,2,..., n;
/-e , / = 1,2, ..., n.
.

195

solve syms
.
.
| 8.15

:
+ +

z =3

+ z = 0.5

syms z;
Y = solve('3*x+y-z=3',

'-5*x+3*y+4*z=l',

'x+y+z=0,5')

<Enter>
:
: [ lxl

sym]

: [ lxl

sym]

z : [ lxl

sym]

, ,
, z.
Y.k, . '
:
Y.X
ans =
-.10714
Y.y
ans =
1.96428
Y.z
ans =
-1.35714

196


vpa (Y. ,)

:
;
.
=5:
vpa(Y.x, 5)
ans =
0.10714
vpa(Y.y, 5)
ans =
1.9642
vpa(Y.z, 5)
ans =
1.3571

8.5.


MATLAB fsolve (), :
fsolve ( ' f i l e ' , xO)
file , -.
-

;;

.....,,,..

| 8.16


:
, + =6.5

197


myfun myfun.m.
:
Funct F = myfun (x)
F - [(1)*(2)+(3)-6.5; (1)*(2)4+(3)-167;
(1)*(2)6+(3)-1470]

= [ 1 ; 1 ; 1 ] ;
X = f s o l v e ( ' m y f u n ' , )

<Enter> :
2.1512
2.9678
0.1157

MATLAB
.
.

.
: b i c q ( ) , cqs(), qmresf), qmr(). -


.
bicq () :
b i c q ( A , )

:
;
.
.

, . (20

198

),
( 6).
. :
bicq(A,B,toi) toi;
bicq(A,, tol,maxit) toi
.
! 8.17

:
fl.5*, +2.7*2+0.75*3=1.8
6JC,

3* = - 1

2+

X] + 12 -

43 = 3

bicq() tol-1.-4 maxit=15.


:

= [1.5

= [1.8;

2.7

0.75

-1

3 ;

-4

];

-1; 3];

yl

2 =

= b i c q ( A , ) ;

= b i c q ( A , B , 0 . 0 0 0 1 , 1 5 ) ;

Y = [yl,

bicq(A,B,0.0001);
y2,

Y =
-0.2524

-0.2524

0.6949

0.6949

-0.2524
0.6949

0.4030

0.4030

0.4030

. , .

cqs()
cqs () :
c q s (,

c q s (, ,

toi)

cqs(,

toi,

maxit)

199_

. ( ).
:
;
;
.

| 8.18

cqs() . ,
cqs(,)

.
, 8.16, bicq (), a cqs (). , .
qmreso qmr()
, [9].
, bicq . .

8.6.


MATLAB.

1.

. 8.4 , , .

8.4.

JO.8*,+1.1*2-7.2* =5.2

1.5*,- 0.8*2+ 4.25*. =5.1


1

["6.7*,-0.6*2 + 0.83* =6.8

1.2*,+7.18*2- 3.2:3=4.2
0

[1.2*,-5.4*2+ 0.54* =-3.2

-1.32*, + 2.15*2 + 7.6, = -1.4


3

J2.62x,+6.1x2-4.12*3=5.6

0.5 -10.2*2 -3.62* =-2.05


4

[6.4*, -0.73*2 + 2.1*3=3.8

j-1.76*, + 6.52 -0.87x3 =2.85

|-1.07*,+3.8*2-1.5* =-1-2

[0.65JC, + 0.87, - 8.73 = 5.56

[2.7*,-3.1*,+4.2* =-7.5

[9.2-1.84 2 +0.7*3 =-3.2


|-6.17, +8.52 -2.873 =-3.75

4.3*,-1.2*2+10.3*3=4.2

= - 5 -6

3.2*,-2.31*2-8.4*3=6.1

|8.3*,-2.84* 2 -1.5*=-6.5
[

3.09*, +1.23*2 - 4

[12.4*,-0.56*2+4.2* =6.3

-*,+2.3* 2 -3.4* = - 2 . 3
0.21*,+0.43*2-6.3*3=3.6

|.2+6.2*2+3.54* =5.1
[-0.31*,-0.52*2+ 3.6* =-2.1

10

| -0.65*. + 4.4*2 +1.5* = 1.5


[1.5*,+2.1*2-2.8* = 1.7

8.4 ()

1.2,+1.062 + 6.7 3 =2.12


11

13

15

4.2*, -6.3 2 -, =-1.1

9.7*, + 0 . 3 5 * 2 - 1 . 8 4 * = 2 . 1 5
4.64*, -7.1*2-4.3*3=1.5

12

0.6,+6.8 2 -0.82=0.83

0.32*,+3.48*2-3.3 3 =-3.1

6.5*,+2.34 2 +1.4 3 =2.8

2.8,+4.3*2-3.7 3 =5.1

0.5,+ 7.3* 2 -2.4*3 =-3.8


8.6, + 0.342 - 6.43 = 0.64

.54, + 2.32 + 3.7=1.54

6, +0.13*2-0.67*3 = 1.9

1.5,-2.6 2 + 7=-11.2

3.8,+1.25 2 -4.3 = 6.4

6.6*,+1.3 2 -1.24=5.3

16

0.38,-0.64 2 -3.2 3 = 5.4

0.85*, -8.4*2 + 4 . 7 3 = 1.6

6.2*, -0.52*2+2.3* =-1.8


17

-4.2,+3.4 2 -0.5* 3 = 0.7

0.63*, - 0.54*2 +1.7*3 =3.6


0.65,+4.4 2 + 0.153 = 2.3

18

0.2,+0.8 2 + 3.6 3 =3.2

1.5*, + 0.22 + 4.1* = 2.8

[12*, + 4.22-0.8* =-5.4

8.4xi-0.25*2+3.1*3 =-5.7
19

-0.45*, + 8.24*2 + 4.8*3 =

14

-0.3*,+ t 6.1* 2 -1.54*j =3.3


-6.8*, + 1.2*2-7*3=4.5

20

[-1.6*, -4.3* 2 +"8.4* = 12,2

8.5.


fsin(jc, +X,)-1.24, =0.1
2
+

{*, = 1
hg(Xlx2+0.2) = xf
JO.6:*,2 + 2x\ = 1

11

x, = 0.67

* 2 =0.52

jtg (*i-*2) -4^=0

x, = -0.5

[, + 2 =1
2

L +x 2 -3 = 0
3

x, = 0.88

:, =1.08

JC, = 0.74

[sinx, + 2sinx, =1
[2sin3jc,+3sin3jr2=0,3

x2 = 0.06

:2 = 0.6

; 2 =1.4

JsinAr, -JC2 =1.3

x,=1.8

[cos^-x, =-0.82

x2=-0.35

[sin(;t2 +1)-, =1.2


[2:2 +COS.X, = 2
JCOS(JC 2 - l ) + jr,
[

x, = 0.95

[x, +^ -4 = 0

10

12

- C O S J C ,

=0.5

|- 2 : 2 -: 2 -9 = 0
[,2 - \ +10 = 0
I AT, + 2 |:2 = 0
[ s i n f x , + x , ) - - 2 . 4 x + 3.2 = 0
[lxxx\-Ax2-

7.5 = 0

{.v -3V2+4.5 =0
[sin*+ 2 cos - 0.8 = 0
[^+,-4.5 = 0
ft)

8.5 ()

13


\1+12-6]+3
\>-\-62

, = 0.52

=0

14

=2

:2=-0.37

15

17

19

{*2+*-** = 0
\,+^- = 0

Jjr, 2 x 2 -8jt,+5.5 = 0
[,2+3^2-10 = 0
| '+2: 2 1: 1 -3 = 0
\*-

,+5.4 = 0


1^-^-18.75 =0
[*, + 2 - 8.25 = 0

, = -0.7
16
2 =-0.35

18

20

[jcf+3x^-4 = 0
\\ sin :, + \ sin JT, +1 = 0
[2^+e(X!+X2)-4 = 0

fsinjCj +3.5sin.x 2 - 1 = 0
[2sin3jc + 3 s i n 2 x 2 - 0 . 4 = 0

204

, .


, .
3, 10
20 . .

2.


(. 8.5).
(


( 17 19).
.
,
.

9.1.

:
/ = /(*)

(9.1)

{) = .
_ = (), ,
, .
.
-

n)

/ =f(x,y,y',...,/-">)

(9.2)

, :

(9.3)

206


- , . .
'=1, y'l=y2t...,
'_2 = _] .
:
~\>
'\ = .
(9.4)
-2=-\
y(n)=f{x,y,yx,...,yn_x).

(9.1)
= ((,), , . , .
. .
:
. .

9.2.


9.2.1.

-
(9.2) (9.3) -

207

pa. ,
.
jy = (p(x) :

(9.5)
(

X o ) +

(9.5) ,
'(0),...,

])

^"~ (0)

(0),

, ..

. , -\ (
) .
(9.5) ' (0), ("

( 0 ),..., ' (' ),...

jv (n) (x 0 ) (9.2), , , ',..., {~) .


" + | > ( 0 ),..., yik)[x0),...
(9.2)
X = XQ ,

208

(9.5) .

9.2.2.

:
y" + P{x)y' + Q(x)y = R{x)

{9.6)

(0) = 0, '(0 ) = '.


(9.6):
(9.7)
=0

.
{),

Q{x),

=0

(9.8)
=0

=0

209

(9.7):
v'(x) = Ync

(99)

"~ ,

y"(x) = Yjn(n-\)cnx'"2

(9.10)

=2

(9.7), (9.8), (9.9), (9.10)


(9.6). :

/,=2

/,=0

-1

-0

=0

=0

. 0 , . (9.11)
.

.

9.2.3.


:

(9.1)

. (*) - () + J / ( * . -\ ) d x '
*<>
0 () , f(xtyn_x)

(9.12)

, (-1)-
.

210

, .
(0).

9.3.

9.3.1.

' = f(x,y)
{) =
. 9.1.
9.1.

0 yQ . 0 h :
, = 0 + h,
, = , + h,

0, , ,
.
>> = (),
, :

211

= , = 0 + h :

+ , :
( )

()+(]

*, - 0 = h, (jr0) = / ( * 0 , ^ 0 ) ,

,, , (]),

V i ' -\)

, , 2, ..., . 9.1
:
( )
(9-13)
(9.13) ,
f(x, ) h .

212

h2.
.

9.3.2.

, .
. .



y' = f(x,y)
{) =
:

, . .

/ .

h
2

f+l

213

,
.

(9.16) )+\^ , , .
.V+i =,+/{,) :

<.

(9.17)

(9.16) (9.17) , . (9.13) (/' + 1)- , .


. (9.17).
3 .

9.3.3.
,
.
.
:

214

, :

, = f y'{x,y)dx= J f(x,y)dx.

=/

f{x,y)dx.

:
= ,+ { ~xi)f

(^,) = , + (*/ ,)

,
.
:

= \+

,
.
.
:

=,+ I f (*>
,

= ,

(9.18)

'=!

Pi , q ; K^h) ,
f(x,y)

h; :

215

/;, a , p
.
(q = 3) :

K^hf(xi+h,yi+Ki+2K2).


, :

(9.19)

216

h'l+] . 5.

9.4.

MATLAB
.

ode23 () ode45 (), :
[t,
[t,
[t,
[t,

x]=ode23('fun\
x]=ode45('fun\
x]=ode23('fun\
x]=ode45('fun',

to, tf, xO)


tO, tf, xO)
tO.tf.xO, tol, trace)
tO.tf.xO, tol, trace)

:
'fun' m-,
;
to ;
tf ;
;
t o l , , ode23()
l.e-, ode45() l.e-6;
trace .

, . . .
ode ()
, , .

217


MATLAB :
1. , m- .
2. ode ().
3. <Enter>.

.
. plot [t, x].
I 9.1


() .
. . a = 0.1 1/ , / = 1.2 1/. .
:
1 ;
2 , ;
3 , ;
4 ,
.

:

218

dt

= (/) - ( + ) 2 (t) + 23 (/),

dt

dt

J W

} /' - ,
/ = 1,2,3,4.
, , .

:

.
1. m- .
sisdu.m, :
Function CMO=sisdu(t,p)
yl=-0.1.*P(l)+1.2.*P(2);
2=0.1.*(1)-1.3.*(2)+2.4.*(3);
=0.1.*(2)-2.5.*(3)+3.6.*(4);
4=0.1.*(3)-3..*(4);
=[1,2,,4];

2. ode :

t0=0; tf=0;x0=[l,0,0,0];
[t,P]=ode23('sisdu'jtO, tf,xO)

219

3. .
<Enter> :
t
0
0.0008
0.0048
0.0248
0.0907
0.1858

(1)
1
0.9999
0.9995
0.9976
0.9914
0.9885

(2)
0
0.0001
0.0005
0.0024
0.0085
0.0164

(3)
0
0.0000
0.0000
0.0000
0.0000
0.0001

(4)
0
0.0000
0.0000
0.0000
0.0000
0.0000

2.2571
3.6429
4.7109
5.9984

0.9210
0.9202
0.9201
0.9200

0.0758
0.0765
0.0767
0.0767

0.0031
0.0032
0.0032
0.0032

0.0001
0.0001
0.0001
0.0001

,
plot ():

plot(t,P)

:
, 6 ;
" ;
(\) + {2) + />(3) = 0.9999 .

1 0



10.1.

MATLAB , . .
:
;
;

.
. . , simplify factor . ,

.
.
MATLAB. MATLAB

.

221

.

, .
.

10.1.1.
:
-1

\f{x)dx

i=0

(10.1)

:
h ;

= 0, 1,2, ..., \
-

, -

h
, b .
,
.
, .

10.1.2.
:
-1

(.2)
4=1

:
0

-;

-;

h .

10

222

10.1.3. ()
:
jf(x)dx

= -(y0 +4

(10.3)


4, 2. , .
:

h
= -(yo+4yl+2y2+4y3+2yi+4y5+...

2yn_]+yn).

, 1.
: , , .

[a; b\. .
8 .
. ,
h
: .
,
, , h
,
h
h
. .
2
4

MATLAB
.

223

MATLAB,
, ,
(, ). ,
MATLAB,
.

10.2.
MATLAB
MATLAB , ()
.
.

10.2.1.
MATLAB , .

cumtrapz()

,

. ,

.
,
(),
( ) . . ,
(
).
. h = 1 ,

224

10

,
h.
j 10.1
()

: = [1,2,3,4,5,,7,8,9,10].
jy(x)dx.

a = 1, 6 = 1 , 2 , 3,..., 10.

:

= [ 1 , 2, 3,4, 5, 6, 7, 8, 9 , 1 0 ] ;
cumtrapz ()

<Enter> :
ans =
0 1.5000 4.0000
7.5000
31.5000
40.0000 49.5000

12.0000

17.5000

(10.2):

2
.
2

2 2
2

24.0000

225

10

= - + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + ==49.5.
2
2

.
,
10

\{~ + \nx + \}dx.

cumtrapz(),
10 , .

:

=1:1:10;
y=x*exp(x)+log(x)+l;
cumtrapz()

<Enter> :
ans
1 .+005
0
0 .0731

0. 0001
0. 2307

0. 0005
0. 7147

0. 0019
2. 1806

0.0067

0.0226

.
..
:

f( + In + \)dx = "(-1)+xlrix .
,
(
), :
8 3. 1196

226

10

0
6593.42

8.775
20883.34

169 .34
43, ,4 67
64844, 45
198261 .22

601.7

2027.89


cumtrapz ().
10.2
() .
= [1,2,3; 2, 3,4; 3,4, 5; 4,5,6] ;
cumtrapz()
ans =
0
1. 5
4
7. 5

0
2. 5
6
10. 5

0
3. 5
8
13. 5

cumtrapz(x,y)

()

, , - .
.
\ 10.3
() :
=[1,3,7,9,10],=[1,3,5,7,9].


.
:

=[1,3,7,9,10];

=[1,3,5,7,9];

cumtrapz(,)

227

<Enter> :
ans =

20

32

40

f-
S, :

:
(_] ;
^ /> i+\
;
[9; 10] [,; ].
:
[l; 3]:

[3; 7]:

[7; 9]:
U

[9; 10]:

228

10

, cumtrapz(x,y) h.
| 10.4

() :
( ) = [1 3 5; 3 5 7; 4 6 8; 4 7 9; 5 7 10]

: =[1,3, 7, 9,10].
.
cumtrapz (x,y) :

=[1 3 7 9 1 0 ] ;
=[1 3 5; 3 5 7; 4 6 8; 4 7 9;
cumtrapz(,)

5 7 10];

<Enter> :
ans =
0
4
18
26
30.5

0
8
30
43
50

0
12
42
59
68.5

trapz(y)

\y(x)dx.

()

() , .

229

[ 10.5

,
() :
=[1,3,5,7,9]..

:
=[1 3 5 7 9);

trapz()
ans =
20

I 10.6

() , :
= [ 1 3 5;
3 5 7;
4 8; 4 7 9;
t r a p z ()
ans =
<
14
23
31.5

5 7 10];

trapz(x,y)
() . , .
! 10.7
{)

: =[1 3 7 9 1 0 ] , = [ 1 3 5 7 9 ] .

.
:

=[1 3 7 9 10];
=[1 3 5 7 9];
trapz(x,}

230

10

<Enter> :
ans =
40
j 10.8

() =[1 3 7 9 ],

= [1 3 5; 3 5 7; 4 6 8; 4 7 9; 5 7 10].

,
trapz (x, ).
:
=[1 3 7 9 1 0 ] ;
=[1 3 5; 3 5 7; 4 6 8; 4 7 9;
trapz(x,y)
ans =
30.5
50
68.5

5 7 10];

trapz () trapz (, )
{). .
! 10.9


() = + lnx + l .
I
10 0.5.
:
= 1 : 0 . 5 : 10;
=.*exp(x)+log(x)+l;
trapz()
ans=
4.057 + 005

231

trapz (x,y)
ans =
2.0328 + 005

,
trapz (, ) .

10.2.2.

()

(10.3). MATLAB :
t
quad('fun', a,
quad('fun', a,
quad('fun', a,
ablquad('fun',
ablquad('fun',
ablquad('fun',

b)
b,
b,
a,
a,
a,

tol)
tol, trace)
b, c, d)
b, c, d, tol)
b, c, d, tol, trace)

' f u n ' , ;

, ;
tol , ,
toi=i0e-3;
, d () ;
trace , , .
.

232

10

quad('fun',a,b)

\f{x)dx

, 10~3.
f{x)

MATLAB.
(.' 10.10

;.']

:
f{x) = + 2 + 2 sin - 5 .

:
='()+.2+2*1()-5';
quad (, 1,5)

<Enter> :
ans =
167.5415
:

q u a d ( ' ( ) + . 2 + 2 * 1 ( ) - 5 ' , 1,5)

<Enter> .

quad('fun',a,b,tol)
quad('fun\a,b,tol) tol
, le-n. tol=l.e-3.


""

I 10.11
=.._...
".

'

"

"

""

.........:

233

: ......

.....,....;....:..;.....

i
I

:
f(x) =
ex+x2+2smx-5.
1 5 1(7.
:
quad('exp(x)+x.*2+2*sin(x)-5',1,5, le-7)
<Enter> :
ans =
167.5415
, 10.10,
10 3 . ,
4 .
.

ablquad('fun',a,b,c,d)

ablquad('fun',a,b,,d)

:
' fun' ;
, ;
, d .
10.12

:
2

+ -2.

23
\\z(x,y)dxdy.

10

234

10

ablquad(z,l,2,0,3)

<Enter> :
ans =
10
, 1(3.
. toi=ie-7.
:

ablquad(z,l,2,0,3,l-e-7)

<Enter> :
ans =
10
, .

quad8('fun',a,b)
.

. ,
quad('fun',a,b, tol, trace).
MATLAB.
.
.
| 10.13

:
() = + 2~ + sinh (x) - 1 2 .

235

0 10
, () . trapz(x,y), quad('fun',a,b), quad8('fun',a,b).
(10~3).
. 10.1.
10.1. ,


1.3404x104 /i = l

trapz(x,y)

1.3629x104 h = 0.5
1.3404x10" /z = 0.1
1.3394x104 = 0.01

quad fun',0,10)

1.3394x10"

quad8('fun', 0,10)

1.3394x10"

:
*

-\2.

,
0 10, 1.339422738x104.
,
.
,
^ = 0.01 .

236

10

10.3.

10.3.1. int()

MATLAB i n t o , :
int(())
i n t ( y ( x ) , , )

:
() ;
, .

. ,

:
;
;

;
;
;
.

:
1.
syms.
2. ;
y=f(x);
3. int (), , int (, , ), [a; b\.
4. <Enter>.

237

.
\ 10.14
:
Ydx-

J
:
syms x;
=/(1+ 2);
int(Y)
ans =
1/2*1(1+2)

\ 10.15
:
f

dr
+ 2.

,
.
:
syms ;
=/(+* 2);
int(y)
ans =
1/(2*)*1(+*2)
I 10-16

238

10

.
:
syms ;
=/(1+2);

int(y,a,b)
ans =
l/2*log(1+2)-l/2*log(l+aA2)

10.17
:

-.

, . .
:
syms d;
y=x/(c+d*xA2);

int(y,a,b)
ans =
l / 2 d * (log (c+b A 2*d) - l o g (c+a"2*d) )

I 10.18

f *- A
1

syms x ;
=/(1+2);

239

i n t ( y , 1,5)
ans =
l/2*log(13)


<Enter>. :
ans =
1.2825

10.3.2.
, .
j 10.19

-:

2 dx.

syms x;

=/(1-2);

Z=int()
Z =
-l/2*log(-1)-1/2*1(+1)

int(Z)
ans =
-l/2*log(x-l)*(-1)+-1/2*1(+1)*(+1)

, int ()
- .
:

syms x;
=/(1-2);

240

10

int (int(y) )
ans =
-l/2*log(x-l)*(x-l)+x-l/2*log(x+l)*(x+1)

10.3.3.


int () ,
.
| 10.20

*sinh(5;t)
:
syms x;
y=x/sinh(5*x);
int(y,0,inf)
ans =
1 2/100

, a :

I
dx.
I s'm
s'mh(ax)
:
syms ;
y=x/sinh(a*x);
i n t (, 0 , i n f )
ans =

. , .

241

, . ,
.
:
syms ;
y = x / s i n h ( a b s () *) ;

int(y,0,inf)
abs =

1 2/(4* 2)

i n t o . .
I 10.21

:
syms ;
=1/(x+sqrt(2+2))3;
int(y,O,inf)
ans
3/(8*/2)

abs (a),
. . .

10.4.


MATLAB. . ,
.
, ,

242

10

. , .
simplify
factor ().

,

, , (. 10.2
10.3).
, ,
. ,
, ; .
10.2.

4
3

1(1 -)"
1
jx'-[(x + \)dx
0

(1--1
{-\)

1
+

+1
,2-1

dx

{\+
6

4 7

60

-.2

0 - 1 X
1

1
0

xs'mxdx

sin I-cos 1 = 0.301

243

10.2 ()

\xcosxdx
0

cosl-sinl-1

1
\x"\nxdx
0

10

1 1,
fx In* ,
dx
J \+ x

1
(n + \f
-0.0386

10.3.

1
2

'ln(l + ^ 2 )
2 V
>

h-x

1
2
-arctgx

J 1 + jc

f X 2dx
2
h+x

arctg*

\dx

1+x

In ,
VI + x 2

[ " d x
^{a + bxf

2
i v o +
rfr

2(2a + to)
Uac -b2\\la + bx + ex2

10

244

10.3 ()

2(b2x2-4abx-8a2)

dx

10

11

aNa + cx2 1
1 , yla + cx2 -4a

In

!
J
shx-

12
Chx
f
13 shjc-chx
J

24
2

\\ x

14
sinxcos2^^
15 Jsi

v
. i ____
4o I,3 2a) 4 8a
cos*

16

sin5

17 [ !
18
19

+ sinx
J

1 + cosx

ix'{x-\

dx

X
*g2

245

10.3 ()

20

(Arsin.t ,
<&
J
COS" X

* -InftgfA" + 7 C ll
cos*
^ 1,2 A))

21

22

jccosjc abc

j sin
. *' cos**
2

. j +ln(tgA')
2n x
.

sinjc2
2

23
24

rsin * ,

1
4
J
cos x

e'W
lna-1

ja e~"dx

1
Incf-1

10.4.

( + 1 + - 4
00

!
0

f *
Jsinh(ax)

>8

dx

J(e-irX*-i)

4.2
3

, 26-
In

246

10
10.4 ()

a"(a-\)\

6
0
00

n2

dx

4a2

s i n h ( a x )

00

\ x "*

p e '

n\
2p"
In 2

'

10

dx

dx

? ^
J inVi 1

11

n2
2a
, 9>0

12

x ' ^ ' ^ d x

wl/t"""" , k>0

j.

-l
2

13

14

15

16

-
9

16as

247

10.4 ()

17

18

19

( + Vx2 + 2 ]

l(ac-b2

-7te

\ +

20

2 In 2

21

|(22-1)

22

4 V
rdx

23

24

2 +i

" e-"x

ax

812

w!

12

1 1



11.1.
[13].
.
y = f(x)
(), .
f(x)

. <()
MATLAB
.
. (), , .
:
.
, , ~>[)
y-f{x)
(. 11.1).

249

. 11.1. ,
. 11.1 = /()

- (:).
, ,
->[)

= /()

(. 11.2).

()

. 11.2. ,

250

11

, , ,
= /() .
, , . ,
= /(), , . , ,
.
.

:
;
; ,
.
.

11.1.1.


. .
()
.
.


y = f(x) .
.
.

. 11.3.

>\

. 11.3. = "

= + \.
. 11.4.

. 11.4. = + \

251

11

252
-

. 11.5

. 11.5. - =

= .
. 11.6.
k

>\

=\
<

. 11.6. y =

253

.
11.1
. 11.1.
= ().
11.1. fix)
X

25

7.7

3.9

2.4

1.6

25
7.69
3.86
2.37
1.62

X
6
7
8
9
10

()

1.2

1.19

0.9

0.915

0.73

0.729

0.6

0.59

0.5

0.499

. 11.7.
. 11.7 , >() =
<0. , : q(x) = 2.5x] 7 .
() . 11.1.

)
20
10

10

. 11.7. = f[x], . 11.1

11

254

. 11.8 ()
(), . 11.1.

()
30
20
10

10

. 11.8. ()
( )
, :
,
f(x).


.
.

= .
:
In = \ + x\nb .

In = Y,

255

Y = \na + X\nb.

= .
:
In - In + In .
\ny = Y, \nx-X

Y = \na + bX.

y = Y,
In x = X . :
Y=a+bX.
-
X
+
:

,
--.

7 = , -,

Y - + .


. -
- f(x) , .

11

256
.
; 11.2

,
. 11.2.
11 .2. / W
X

2.2

6.5

12.8

21.1

31.4

43.7

58

. 11.3 .
11.3.
X

2.2

6.5

12.8

21.1

31.4

43.7

58

(1)

4.3

6.3

8.3

10.3

12.3

14.3

(2)

, .
, , . .
= 0 + + 2 .
:



, ,
. : SIMPLE FORMULA, TableCurve, Curve Expert.

257

.
[13].

11.1.2.

.
. MATLAB

:
;
;
.

11.1.3.
:
;
;
.

.

.
S, :

,6 = - 1 0 0 % ,
'
9 3. 1196

( 1 1 )

258

11

, = ^ ( , ) - ( , ) ;

(,) , ;

(,) ;
, ;

, .
8 8
. .

11.2. .

11.2.1.


. solve ().
8.
.
I 11.3

= /() . 11.4, L [13].



H = f{L).
, , .

259

11.4.

L,

20

30

40

50

60

70

80

90

100

9.8

12.8

15.8

18.6

21.3

23.5

25.3

26.5

27.4

, .
- f(L)

. 11.9.

30
20
10

50

100

. 11.9. , . 11.4
, H = f(L)

, . , :


. (20; 9.8), (50; 18.6),
(90; 26.5).

260

11

MATLAB.
:

syms

t;

MATLAB:

yl='9,8=a+20b+ 202';

y2='18.6=a+50b+502c';

='26.5=+90-902';

[bl,b2fb3]=solve(yl,y2,y3)

<Enter>
:

=
2.56
2=
0.389
3=
-0.00137

subs(yl, {a,b,c}, (,2,}) ;

subs(y2, {a,b,c}, {,2,}) ;

subs(y3, {a,b,c},

{,2,})

<Enter> subs
:
9.8 = 9.8

18.6 = 18.6

26.5 = 26.5

261

, :
2

H(L) = -0.00137Z. + 0.3891 + 2.56 .


. 11.10.

30
20
10

50

100

. 11.10.
. 11.10 ,
, , .
, /():
Pl=subs(2.56+0.389*t-.. .
0.00137*t~2,t, [20,30,40,50,60,70,80,90,100])
<Enter> :

1 =
9.79
26.47

12.99
15.92
27.76

18.585

20.968

23.077

24.91

() :

=[9.8, 1 2 . 8 , 1 5 . 8 , 1 8 . 6 , 2 1 . 3 , 2 3 . 5 , 2 5 . 3 , 2 6 . 5 , 2 7 . 4 ] ;

11

262

e=sum((p-pl). 2);
E=sqrt(e)/length(P)
' =
0.0879
ymin=niin (P) ;
d=E/ymin*100
d =
0.8967

(
0,9%) , .

11.2.2.

fsolve (),
:
f solve ( ' f i l e ' ,

0)

:
;

' f i l e ' m-, .

.
11.4

[13]. f(x)

. 11.5.
11.5. = / ( )
X

6,5

20

53,5

167

473

1470

263

.
, .
. 11.11.

1500
1000
500

. 11.11. , . 11.5

. 11.11 , = /()

= + .
,
,
= 1, 4, 6.
:
+ = 6.5
4

+ = 167
6+ = 1470

myfun.m
Save () File ()
.

264

11

:
Function F=myfun(x)

F = [ x ( l ) * x ( 2 ) + x ( 3 ) - 6 . 5 ; x ( l ) *x(2) 4+ (3)-167;

(1)*(2) 6+(3)-1470];

fsolve ():

xO=[l; 1; 1];
x=fsolve('myfun',

xO)

<Enter> :

X
2.1512
2.9678
0.1157

:
() = 2.1512-2.9678 +0.1157 .

11.2.3. -
MATLAB spline (). :
Yi = s p l i n e (x, ,

xj

:
;
;
Xi y-f(x)

, .
y-f(x)

.
spline ()
. .
.

265

\ 11.5

. 11.5.
= 1.5, 2.5, 3.5, 4.5, 5.5.
:

= [ 1 , 2 , 3 , 4 , 5 , 6 ] ;

=[6.5,20,53.5,167,473,1470];

xi=[1.5,2.5,3.5,4-5,5.5];

y i = s p l i n e ( x , ,

xi)

<Enter> :
yi 15.233

29.7667

98.7

270.9958

847.7542

11.6

* = 1, 2, 3, 4, 5.
=1.5, 1.8,2.3,3,3.5.
:
=[1,2,3,4,5];
xi=[1.5,

1.8,

yi=spline(x,

2.3,

3,

3.5];

sin(x),xi)

<Enter> :
1.022

0.9843

0.7358

0.1411

-0.3414.

: sinx
.

11.2.4.
i n t e r p i o . :
y j = i n t e r p l (x,

xir

266

11

:
, ;
4 , ;
,
.
:

'nearest';

' linear' ;
'cubic' ;
' spline' .
, .
.

,
I 11.7
-/()

. 11.6.
11.6.

.V

2.5

3.7

8.4

11.7

20

27

38

1.4

2,7

5,6

7,5

9,1

13,2

15.3

= 3, 4, 6, 10,25,30.
:

=[2.5, 3.7, 8.4, 11.7, 20, 27, 38];


=[1.4, 2.7, 5.6, 7.5, 9.1, 13.2, 15.3];
xi=[3,4, 6, 10, 25, 30] ;
yi=interpl(, , xi);
%
/
yi=interpl(, , xi, 'linear'); %
yi=interpl(, , xi, 'nearest');!
yi=interpl(, , xi, 'cubic'); %

yi=interpl(, , xi, 'spline ;

267

%
%

:

1..9417 2.8851

4.1191

6.5212

12.0286

13.7727

2.7

5.6

13.2

13.2

4.2606

6.3449

12.2020

14.0582

6.5662

11.8137

15.1007


1.4

2.7


1.9884

2.9419


1.9912 2.9666

4.3323

,
. ?
.
interpi () () . .

11.3. ,
()
11.3.1. IsqcurvefitO
, .
MATLAB IsqcurvefitO, :
coef=lsqcurvefit (f, 0, , )

:
, ;
0 ;
f , .

11

268

.
11.8
G 5" . 11.7.
11.7.

S,
G,
. .

30

40

6.36 6.85

50

60

7.34 7.84

70

80

90

100

120

8.08

8.32

8.57

8.70

8.82

8.94


, .
G = f(S),

. 11.7,

. 11.12.

G
10

100

. 11.12.
. 11.12 ,
:
G = a + bS + cS2.
, Isqcurvef i t ().

269


MATLAB
lsqcurvefit ():

=[30,40,50,60,70,80,90,100,110,120]

= [ 6 . 3 6 , 6 . 8 5 , 7 . 3 4 , 7 . 8 4 , 8 . 0 8 , 8 . 3 2 , 8. 57, 8 . 7 0 , 8. 82, 8 . 9 4 ] ;

=[1,1,1];

f = i n l i n e { ' ( 3 ) * . 2 + ( 2 ) * + ( 1 ) ', ' \ ' ' ) ;

coef=lsqcurvefit(f,x0,a,b)

<Enter>
:
coef =
4.4747

0.0719

-0.0003

:
G = 4.4747 + 0.0719S - .2.
d
, (11.1):

=[30,40,50,60,70,80,90,100,110,120];

y=subs('4.4747+0.0719*t+0.0003*tA2', ' t ' , x ) ;

fl=y;

f2=b;

e=fl-f2;

E=sqrt(s)/length(f2);
d=E/min(f2)*100

<Enter> :
=
0.0231

d=0.3633%


.
lsqcurvefit () .
- ,
, .

270

11

11.3.2.
MATLAB
poiyfit , :
polyfit(x,

, )

:
;
;
.
poiyfit ()
.
y = f(x)

.
poiyfit ().
; 11.9

, poiyfit ().
. 11.7.
:

=[30,40,50,60,70,80,90,100,110,120];
=[6.36,6.85,7.34,7.84,8.08,8.32,8.57,8.7,8.82,8.94];
p = p o l y f i t ( x , , 2)

<Enter>
:
-0.003

0.0719

4.4747


:
<p(G) = 4.4747 + 0.07195 - 0.0( 2 .
.

271

()
.
MATLAB .
:
polyval(p, x)
:
;
.
.
f=poiyvai(p,x) <Enter>. :
f =
6,3695
8.5780

6.884
8.7412

7.34
8.8457

7.7373
8.8917

8.0761

8.3564

,
, G(S) . ,

.
MATLAB . diff (), :
diff(v, n)
:
v

();

272

11

11.10
.
,
diff (). MATLAB :

=[6.36,6.85,7.34,7.84,8.08,8.32,8.57,8.7,8.82,8.94];
diff(,1)
ans 0.49 0.49
0.5
0.24 0.24 0.25
0.13 0.12 0.12
diff(, 2)
ans =
0
0.01
-0.26
0
0.01
-0.12
-0.01
0

,
. 11.8.

11.3.3.


icubic (), :
yi=icubic(x,

Xi)

:
, , ,
, ;
Xi ,
; xt .
! 11.11

. 11.11

, = 2 , 5 , 7, 13, 17.

273

11.8. = f(x)
X

12

15

18

10

14

19

MATLAB :

=[1 3 6 9 12 15 1 8 ] ;
=[1 2 5 8 10 14 1 9 ] ;
x i = [ 2 5 7 13 1 7 ] ;
y i = i c u b i c ( x , , x i )

<Enter>
:
yi =
1.1246

3.0928

5.3590

10.7824

17.1211

icubicO interpio
'cubic 1 'spline' . .
interpl ()
'cubic' :
yi =

1.3524

3.8953

6.1111

11.0778

17.3666

1 2



12.1.
.
:
( ) ;
;
.
:
;
;
.
.

, ( ), (
, , ) .
MATLAB.

275

MATLAB
:
;
;

.
MATLAB :
( );
;
(
, );
,

.

MATLAB .
MATLAB,
.

12.2. MATLAB


12.2.1. tf()
:
tf(n, m)
:
;
.

12

276


.
\ 12.1


S3+2S

+l

: n=[2,5], m=[i,o,2, l ] .
m , S2 .
G{S)

=[2,5];
=[1,0,2,1] ;
qs=tf(,)

<Enter> :
Transfer function:
2 s + 5
3

+ 2 s + 1

qs=tf(n,m)
:

qs=tf([2 5],[1 0 2 1])

,
( ), (;).
<Enter>.

. 12.1.


I.JMATLA8
Eile Edit $ew Wefe Wn
idow
D G?
'-,-:
n>[2,5]
n
2

277

3( X|
: ! ? ! Curent Driecto
&
ry*:165*1
.

m=[l,0,2,1]

m
1 0

Transfer function:
2s+ 5

3 + 2 s + 1

<j '
-^StartJ

' 1

. 12.1.

12.2.2. poleQvi zeroQ


, , G(S). :
pole(qS)
zero(qS)
qs , tf.
,
, .
I 12.2

; i
,
12.1.

12

278

MATLAB :
qs=tf([2 5],[1 0 2 1]);
P=pole(qs)
<Enter> :

Z =

0.2267 + 1.4677i
0.2267 - 1.4677i
-0.4534
z=zero(qs)
-2.5

. 12.2.

Edit View Web Window Help

-Q'GSr

#"*

Using Toolbox Path Cache.

Current Directory: JD:WIATLAB6p5twork

"3J

Type "help toolbox_path_cache" Eor more Info.

To get started, select "HATLAB Help" from the Help menu.

qS-CC([2 S ] , [ 1 0 2 1])

Transfer function:
2 3+ 5
s"-3 + 2 3 + 1

P=pole(qS)

P 0.2267 + 1 46771
0.2267 - 1 46771
-0.4534

. 12.2.

279

12.2.3. rootsQ poly()


, ,
. :
roots()
poly(r)

:
;
.
j 12.3
3 + 3S2 + 4

.
=[1 4]
:
= [13 0 4];
= roots()
=
-3.3553
0.1777 + 1.0773i
0.1777 - 1.07731
= poly ()
=
1.0000
3.0000

0.0000

4.0000

. 12.3.
roots () poly ()
, -
pole () zero () .

12

280
} LAB
File Edit View Web Window Help
G& | jv ' "> c'

: i ? j Current Directory: j D:WATLAB6p5\<vork

P=[l 3 0 4]

-3.3553
0.1777 + 1.07731
0.1777 - 1.0773i

1.0000

3.0000

0.0000

4.0000

. 12.3.

12.2.4. convQ
. :
conv(P, q)
, q P(S) q(S).
! 12.4

= 5+ 4
MATLAB :

=[3

q=[l

1] ;

4];

281

G=conv(P, q)
3

14

G = 3S +\4S +9S + 4.
. 12.4
File

Ve
i w Web Wn
i dow Uep
l
> t* ,%
D
P-[3 2 1)
Edit

f : Current Directory: |D:WATLAB6p5Work

Jll j
-

P
3

4]
4
l

G=conv(P, 4)
=

14

!J
. 12.4.

12.2.5. polyvalQ

. :
polyval(n,)

:
;
S.

12

282
12.5


P(S) = 3S2 +2S + ]
S = -2 .
:
=[3 2 1 ] ;
Z=polyval(n,
Z=
9

-2)

. 12.5.
.

-|1 |

File Edit View Web Window Help


E? j jfc ^

<|

' i ? I Current Directory: | D:(ATL AB6p5\wor k

n=[3 2 1]

n
3

Z=polyval(n,-2)

!
Start j
. 12.5. noj

283

12.3.

12.3.1.

+.
! 12.6


10
Sz+2S

_ ,
+5

2S2+l2S +
S* + 3SZ + IS + 5

:
nl=[10];
ml=[l 2 5];
zl=tf(nl,ml)
Transfer function:
10
sA2 + 2 s + 5
n2=[2 12 15] ;
m2=[l 3 7 5];
z2=tf(n2,m2)
Transfer function:
2 s A 2 + 12 s + 15
sA3 + 3 sA2 + 7 s + 5
G=zl+z2
Transfer function:
2 4 + 26 s A 3 + 79 2 + 160 s + 125
5 + 5 4 + 18 3 + 34 2 + 45 s + 25

. 12.6.

,
-, *, /.

12

284
> ATI
File di(

\iew

Web

Windc*

i Current Directory. |:|65\

^[

n l = [ 1 0 ] ; m l " [ l 2 5 ] ; Z l - t f ( n l , ml)

Transfer

function:

10

> + 2s + 5
n2[2 12 15]; 2-[1 3 7 Sit Z2-t(n2, m2)
): function:
2 2 + 12 s + 15
s A 3 + 3 2 + 7 s 4- 5

G-Z1+Z2
ransfei: function:
2 4 + 26 8 3 + 79 '2 + 160 s + 125

S A S + 5 S A 4 + 18 3 3 + 34 2 + 45 s + 25

. 12.6.

12.3.2. pzmapO
pzmapO S.
:
pzmap(G)
G .
| 12.7

S
6S5 +18.S"4 + 25S3 + 15S2 + 4 5 + 12
G(S) = - 5
S + 6S4 + \4S* +\6S2+9S

285

PIU_.II.P.._._
File /Edit View Wefe Window lielp
. D Sr
'1 IP- " ' - \ \ ' f ; Current Directory: | D;WATLAB6p5\work
n=[6 18 25 75 4 12]; u=[l 6 14 16 9 2 ] ;
qtf(n, m)
Transfer
function:
A
A
A
6 J 5 + 18 s 4 + 25 S 3 + 75 2 1 4 3 + 12

[AMATIAB

- 16
s*5 + 6 s 4 + 14 3 3 H

sA2 + 9 3 + 2

pzmap(q)

. 12.7.

- i n ! ^f

"

IQ &

>

Real Axis

. 12.8.

286

12

:
n=[6 18 25 75 4 12];
m=[l 6 14 16 9 2];
q=tf (n,m)
Transfer function:
6 5 + 18 s A 4 + 25
S"5 + 6 s-4
pzmap(q)

14

+ 16 2 + 9 s + 2


. 12.7, . 12.8 () () 5". ,
, G(S) . , - 1 .

12.3.3. seriesQ
series ()
,
. :
series(ql, q2)
ql q2 .
I 12,8
.; ,..,

.....

'.

. 12.9.
R(S)

u(s)

Y(S)

<h(s)

. 12.9.

287

:
|

u(s)

s+\

R(S)

S+ 2

Y(S)_
U(S)

5S2

:
nl=[l 1] ;
ml=[l 2] ;
ql=tf (nl
m2=[5 0 0];
q2=tf (n2 ,m2);
G=series (ql,q2)
Transfer function:
s+ 1
5 s"3 + 10 sA2
, , .

12.3.4. parallel?)
parallel
, ,
:
parallel(ql, q2)
ql q2
.
12.9
. 12.10.

12

288

. 12.10. ,

R(S)

:
nl=[l 1];
ml=[l 3 1];
ql=tf(nl,ml);
n2=[l 2];
2=[1 1 3 ] ;
q2=tf(2,2);
G=parallel(ql,q2)
Transfer f u n c t i o n :
2 s

+ 7 sA2 +
A

s + 5

+ 4 s 3 + 7 s 2 + 10 s + 3

12.3.5. feedbackQ
feedback
.

289

:
feedback(q, qoc, 1)
:
qoc ;
1 (-1 ,
+1 ).
! 12.10

. 12.11

. 12.11.

:
G(S)

S+2

5S

, 1.
:

G(S)

. 1196

290

12

, tf () G, (S) G7 (S),
series ()
feedback
.
:
nl=[l 1] ;
ml=[l 2] ;
ql=tf(nl,ml)
Transfer function:
s +1
s +2
n2=[l];
m2=[5 0 0];
q2=tf(n2,m2)
Transfer function:
1

q=series(ql,q2)
Transfer function:
s + 1
5 s~3 + 10 s A 2
feedback(q,[1])
Transfer function:
s + 1
5 s~3 + 10 s"2 + s + 1

. 12.12.

291

> MATLAB *
0

View Web Window Help

? , ..

t*

'

Current Directory: |D:lMATLAB6p5\work

n l = [ l 1 ] ; m l = [ l 2 ] ; q l = t ( n l , ml)
Transfer function:
3 + 1

0 0 ] ; q 2 = t ( n 2 , m2
Transfer function:
1

l, q2)
Transfer function:
3 + 1
5 3*3 + 10 3*2

feedback(q,

Transfer

[1])

function:
s + 1

S s*3 + 10 3*2 + s + 1

. 12.12.

12.11
. 12.13.

G(S) =

292

12

U(S)

. 12.13.

:

:
nl=[l 1];
ml-tl 2];
ql=tf(nl,ml);
n2=[l 0.5];
m2=[l];
q2=tf(n2,m2);
freeback(ql,q2,-l)
Transfer function:
s + 1
s A 2 + 2.5 s + 2.5

12.3.6. minrealQ
minreaio . :
minreal(G)
G .
12.12

: " !

G(S) = -

S2 +4S + 3
2

+S +2S + 2'

293

,
.
. G[S)

MATLAB -

minreal (). :

= [ 1 4 3] ;

= [ 1 1 2 2] ;

q=tf(n,m);

mineral(q)

Transfer
s

function:

+ 3

12.4.


:
,
;

;
step ().
MATLAB.

Y(s)
,
(, ) .
MATLAB ezpiot (), :
ezplot(Y(t), xn, xk)

294

12

:
Y(t) , ;ie ( );
xn, xk , /.
1 12.13

'

<;

^TLAB
:

Y='0.5*exp(0.5*t)';
ezplot (Y, 0,3)
I^i^mmmII I ! n m
i ri inn" i
File Edit Veiw Insert Tools Desktop Wn
idow Hep
l

in

0.5 exp(0.51)
2.2
2

1.8

1.4 !
1.2

0.8
0.6
0.4
0
'..:'

0.5
'.

1
...

1.5
t

2.5 " 3

. 12.14.

295

<Enter>
(. 12.14) /, [03].

12.4.1. stepO
step () . ,
:
step(q, t)
:
q ;
t .
.
, , ,
[,

t]= step(q,

t)


plot(t,). step{q,t) t, , :
t=[0:0.1:3]
. . 0 3 0.1.
; 12.14

. j

,
:
2

2S + 2.5S + 5402
:
nl=[5400];

=[2 2.5

5402];

296

12

q=tf(nl,ml)
Transfer function:
5400
2 s~2 + 2.5 s + 5402
t=[0:0.005:3];
[y,t]=step(q,t);
plot(t,y)

,
. 12.15.
-> Figure No. I
Be Edti Item Insert Tods W
nidow Hep
l
2
1.8
1.6
-41
1,2
1
0.8
0.6
0.4
0.2
0

0.5

2.5

. 12.15.

12.5.

-
MATLAB bode (), :

297

bode(sys)

sys .

.
|

'

| 12.15

, :
? \ .
5(25 + 1)
:

=[0.5 1 ] ;
=[2 1 0 ] ;
sys=tf(n,m);
bode(sys)

<Enter> (. 12.16).
"./." . ,
.

l o g s p a c e ( a , b , )

:
;
;
[; \.
bode () :
bode(sys, w)

12

298
File Eot Ve
i w Insert Toosl Desktop Wn
idow Hep
l

Bo* Daigram

Frecu
j ency (racf/sec)

. 12.16.

view

D G?'

Insert
:

Tools Desktop Window

fe;..W

-vi t

. .

Bode Diagram

. 127.

299

:
N=[0.5 1];

=[2

s y s = t f (N, ) ;

0] ;

W=logspace(-l,3,200);
bode(sys,W)

<Enter> (. 12.17).
, logspaceO
( =-1, = ) 10, . . 1, 103,
0,13 /.

12.5.1. -

-
. . MATLAB

nyquist(sys)

sys .
! 12.16

, :
3

S +2S +S
+ 0.S
:

N=[0.5];

=[1

s y s = t f (N, ) ;

nyquist(sys)

0.5];

<Enter>
, . 12.18.

300

12
_-JE|*J

Fe
li Ed* Ve
iw Insert Tods Desktop W
nidow Hep
l
DB

Nyqusit Daigram

. 12.18.

12.5.2.
-
. ,
7V = tgcp .

. MATLAB :
nichols(sys, w)

:
sys ;
w ,
.

301

| 12.17

:
1
:
=[1];
=[0.2 1.2 1 0];
sys=tf(n,m);
w=logspace(-1,1,400);
nichols(sys,w);
ngrid

<Enter> (. 12.19).

File Edti Ve
iw Insert Toosl Desktop Wn
idow Hep
l

-223"
-4 00 " 35
Open-Loop Phase deg)

-0

. 12.19.

302

12

ngrid
.

12.6.

. 12.20.
u2{s)

R(S)
G

Y(S)
G

. 12.20.

:
=_,,

GJS)=

:
, =10, 2=5,

7J =1.5, , =3.5, 3 = 4 . 7 .

:
, ;
.
:
1.

2. .
3. S.
4. .

303

5. , , .
6.
.

12.6.1.


, . MATLAB
. =
():

Kl=10;
2=5;

1=1.5;

2=3.5 ;

3=4.7;

nl=[Kl] ; ml-MI zl=tf(nl,ml);


2=[2] ; m2=[Tl 1 0 ] ; z 2 = t f ( n 2 , m 2 ) ;

=[2 1 ] ;

G=zl*z2*z3

Transfer

m3=[T3 1 ] ;

z3=tf(n3,m3);

function:

175 s + 50

7.05 sA3 + 6.2 sA2 + s


, G[S) .
zi*z2*z3.

12.6.2.
G{S)
:

P=pole (G)

=
0

12

304

-0.6667
-0.2128
N0=zero(G)

.
.
.
roots (). G(S)

1755* + 50 roots ():


ql=[175 50];
N0=roots(ql)
N0 =
-0.2857

12.6.3.

:
pzmap(G)
' S () ().
. 3,
.
. 12.21.

12.6.4.
, , . .
.

12.6.5.
, s t e p o .

305

Fle
i Ed Veiw Insert Toosl Desktop Wnido:w Hep
l
? a I T s a

--O- <-.--

-->

. 12.21.

35EHB S D
Fle
i Edti Vw
l Irisert
sTlaa T ' F ;

Tools Desktop' Wir

: DS
Se
tp Response

;:

1
1

iCOG

'
T
m
i e (sec)0 S5 40
. 12.22.

306

12

,
.

step(G)

(. 12.22) ,
.
.

12.6.6.


.
GOS
G(S)
:
GOS =

G(S)
G(S)'

MATLAB
feedback (), :
GOS=freeback(G, [1])
Transfer function:
175 s + 50
7.05

6.2 s A 2 + 176 s

50

12.6.7.

,
S.

307

POpole(GOS)
PO =
-0.2967 + 4.97061
-0.2967 - 4.9706i
-0.2860
pzmap(GOS)
(. 12.23) S

Fe
li Edti V
eiw n
Isert Toosl Desko
tp W
nd
iow Hep
l

Pole-Zero Map

. 12.23.

,
, .

308

12

12.6.8.



step(GOS)
, (. 12.24).

1.8

15

. 12.24.
.15, 1.8.

12.6.9.



, .

309


7 = 2 , 0.5, 0.1 :
- 2 12
;
= 0.5
2.5;

= 0.1 3 . 3
1.35 .
.

12.7.



.

, .
.

12.7.1. 1
- . 12.25.

,
. , . 12.6.

12

310
ux{s)

R(S)

Y(S)

G3(S)

G,(S)

. 12.25.
Goc
:


.
1
-&-,
]
, - 2 0 , K2=2,

G2(s) =

S(T2S + \)

,-1.5, 2=2, 3 =5.4, 4 = 2 . 5 .

, = 3 0 , K2=5,

K3=\2,

, = 2 . 5 , 2 - 0 . 8 .

AT, - 3 2 , 2 =16, = 2 . 5 , 7] =1.5, 2 = 5 , 3 =1.5, 4 - 2 .

311

4
S(T2S + \)
K,=20,

G J S ) ,
' TAS + \

7] =1.5, 7, = 3 , 7 , =0.5, 4 =1.4.

K2=25,

(S)

^ ,

Gl

S(T2S + \)

AT, = 2 0 , ^ 2 =10, ^ = 1 5 , T{ = 2 , 2 =1.5, 3 =0.5.


6
> 0 2

AT, =15, K2=20,

(S)

,G,{S)

K3 = 7 , 7J = 2 , 2 = 0 . 5 , 3 = 3 , 4 =1.4.

Kx =12, AT2 = 15 , 7] =1.4, 2 = 0 . 4 , 3 = 2 , 4 = 5 .


8
\\, G2(S) =

, G 3 (S) =

, = 5, K2 = 15, = 12 , Tx = 0.8, 2 = 0.5 , T3 = 2 .


9

Kt = 2 0 , K2=25,

7; =1.5, 2 = 3 , 3 =0.5, 4 =1.4

312

12

10

= 5, /: 2 = 3 5 , 2] =0.5, , = 2 , , =3.2, 4 =1.5 , 5 =0.2.


11

^, = 100 , 2 = 5.6, 7] = 3 , 2 = 0.5 , 3 = 2.5, 4 = 5 , 5 = 2 .


12

* , = , :2 = 2 0 , A:3 =6.7,7] = 2 , 7 ; = 0 . 5 , r 3 = 0 . 1 .
13
5(715+ 1)
| = 5, 2 = 7, ^ 12, 7j = 0.5, 7^2 = 1.5 , 3 = 2, 7^ = 1 .f
14
S(T2S + \)
= 5 , 2 = 7 , # = 1 0 ' \ =1-2, 52 = 3 - 2 ' =1-8, 7; = 2
15
, G 2 (5)
, 3()
2
3
,
T2S + \
= 2 , 2 = 8, = 12 , 7] = 2, 2 = 3.5, 3 = 0.2, 4 = 0.5

313

16

s)
Kl = 20, 2=\2,

S +\

0.5,

J3(o)

*i

I)

= 0.1, = 0.1,

= 2.

17
IV )

7,5 + 1

' S (T,S + 1

s)

I)

A' ("]

+ ),

, = 5 , ^ 2 = 1 0 0 , ^ 3 = 1 - 5 ' 4 = 0 . 2 , 2 = 2 , , =1.2, 4 = 4 . 2 .
18

, = 12, :, = 50, 3 = 2 , = 0.5, 2 = 1.5 , 73 = 2, 4 = 2.5 .


19

^12,

2= 5, 3 =50,^=2,1-,

=0.5, 3 =3.5, 4 =2.5.

20
T2S
Kx = 5 , K2 = 70, = 12, 7] = 0.5, T2 = 2 , 3 = 1.5 .
21
1

G, (5 ) = - ^ - , G7 (S) = ^

2 (

+ 1)

, G3 (S) = ^,( 4 5 + 1),

^ , = 5 , ^ 2 = 5 0 , AT,-.?, }=.5,2=\.5,

3=2,4=0.8.

314

12

22

Kx = 5 , 2

^ 3 = 8 , 7] = 2 , 2 = 0 . 5 , , =0.8, 4 =1.5

23
T3S +1)
3 = 1 2 , , =0.5, 2 = 2 . 5 , 7=:

24

,=1,

2=2%, =\2,

=2, 2 = 0 . 8 , , =0.5, 4 = 3 .

25

= 3 . 5 ; / : 2 = 3 2 , ^ 3 = 8 , 7J =1.5, 2 = 2 , 3 =0.5, , = 3 .

12.7.2. 2

. . , :
;
;
- ;
- ;

315

;
(
, );
.
MATLAB Control System Toolbox.
.



. 12.1.
"" .
, .
12.1.

1,3,7,11

2,5,8,10

3, 6, 9, 11

4, 2, 5, 8

1,4,5,9

10

1,4,6, 10

2, 6, 8, 9

3, 5, 7, 8

1,4,8,11

2, 3, 6, 9

11

12

13

14

15

3,6,8,10

4, 5, 9, 11

1,4,7,10

2,5,8,11

3, 6, 7,9

16

17

18

19

20

4, 7, 9, 11

1,4.6,10

2, 6, 7, 9

3,5,8,11

4,7,8,10

21

22

23

24

25

1,5,6,9

2, 7, 9, 11

3,4,7,10

4,5,7,9

1,6,9,11

12

316

.
1
(5)=) 7 = 0.5;

TS
TS+

) 7 = 5.

Y(S) =

T2S
7,5 + 1
) 7, = 1, 72 = 0.2 .

) 7] =0.2, 7 2 = 1 ;
3

7,5

) 7, =1.5, 7 2 =0.3.

) 7, =0.3, 72 =1.5;
4
Y(S) =

75 + 1
) : = 50, 7 = 1.

) : = 10, = 0.2;
5
7(5)) 7 = 0.5;

1
75 + 1
) 7 = 4.

6
5(75 + 1)
) " = 10, 7 = 0.2;

317

7
Y(S)
= V ;
S
) = 100.

) = 10;
8

KS

= 1 0 , i, = (J. 1 , 2

' j

= 1 UU , ij = U. 1 , 2

9
(5).)

= 10, 7] =0.1, 2 =0.5, 3 =1;

= 10, 7J =0.8, 2 =0.5, 3=\.

10
2

S (T2S
) = 2 0 , 7] = 0 . 5 , 2 =1 ;

+ \)

) = 2 0 , 7] = 1 , 2 = 0.5.

11

= 10,75=0.1,72=0.7,^=1.5;

= 20 , = 1, 2 = 2 , 3 = 3 .


1. ., . Matlab.
.: , 1999.
2. . ., . . . .: , 1990.
3. . ., . . . .: , 1987.
4. . Matlab. . .: , 2000.
5. . , . . , 2. .: , 1971.
6. . ., . . . .: , 1970.
7. ., . . .:
, 2002.
8. ., .
Matlab. . .: , 2001.
9. . . .: , 2001.
10. . ., . ., . . . .: ,1996.
11. , . , . . . : , 2002.

319

12. . ., . .
. : , 1972.
13. ., . . . .: -,
2004.
14. A. Derive . .: -,
2005.
15. . . Matlab 5.x. .:
-, 2000.
16. .
Matlab 5.x. ML: -, 1999.

17. . . . .: , 1972.
18. ., ., .
: . . .: , 1980.

-
*
190005, -, ., 29

.




10.00 20.00

-
.: (812)251-41-10, e-mail: trade@techkniga.com