236
ГОСУДАРСТВЕННОЕ УЧРЕЖДЕНИЕ ОБРАЗОВАНИЯ «ИНСТИТУТ ПОДГОТОВКИ НАУЧНЫХ КАДРОВ НАЦИОНАЛЬНОЙ АКАДЕМИИ НАУК БЕЛАРУСИ» ОСНОВЫ ИНФОРМАЦИОННЫХ ТЕХНОЛОГИЙ Под общей редакцией кандидата физико-математических наук, доцента В.В. Шкурко Учебно-методическое пособие для магистрантов и аспирантов физико-математических и технических специальностей Минск 2008

ОСНОВЫ ИНФОРМАЦИОННЫХ ТЕХНОЛОГИЙold.bfigu.ru/books/Основы информацинных... · 4.1 Начало работы с Matlab. Элементарные

Embed Size (px)

Citation preview

  • - ,

    ..

    - -

    2008

  • "

    "

    - ,

    ..

    - ,

    -

    2008

  • 004(075.8) 32.9773

    0-75

    10 28.12.2007

    :

    .. , .. , A.M. , .. , ..

    : ,

    - .. ,

    , , A.M.

    , .. 0-75 : .-. /

    .. [ .] ; . . .. . - : - . . . . , 2008. - 235 .

    ISBN 978-985-6820-13-0.

    , - .

    , , Excel, Matlab Mathematica, - ++.

    004(075.8) 32.9773

    ISBN 978-985-6820-13-0

    , 2008

  • 6

    1 8

    1.1 , , 8

    1.2 , 12

    1.3 22

    1.4 28

    1.5 29

    1.6 30

    1.7 34

    1.8

    37

    1.9 45

    1.10 48

    1.11 () 51

    2 55

    2.1 55

    2.2 56

    2.3 56

    2.4 . - 66

    3 MICROSOFT EXCEL 77

    3.1 Excel 77

    3.2

    Excel 77

    3.3 Excel 87

    3.4 Excel 89 3.5

    89

    3

  • 4 MATLAB 93

    4.1 Matlab.

    Matlab 93

    4.2 Matlab 95

    4.3

    Matlab 96

    4.4 97

    4.5 100

    4.6 Matlab 104

    4.7 109

    4.8 111

    4.9 112

    4.10 113

    4.11 114

    4.12 117

    4.13 119

    4.14 Simulink 123

    5 MATHEMATICA 132

    5.1 Mathematica 132

    5.2 Mathematica. Mathematica 133

    5.3 . 137

    5.4 138

    5.5 139

    5.6 140

    5.7 142

    5.8 143

    5.9 146

    5.10 149

    5.11 150

    5.12 151

    4

  • 5.13 152

    5.14 155

    6 ++ 160

    6.1 - 160

    6.2 ++ 163

    6.3 173

    6.4 ++ 181

    6.5 199

    6.6 217

    6.7 225

    233

    5

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

    , ( , - , ), Windows 95 , , Microsoft Office. , , .

    - , :

    - ( 1): [1-8];

    - ( 2): - [9-16];

    - ( 3-5): Excel [17, 18], Matlab [19-21] Mathematica [22-23] ( , , ..);

    - - ( 6): - , ++ [24-29].

    , ,

    6

  • - 2003-2007 . / , , , - , , .

    1 .. .. (), 2 - .. , 3-5 - .. .. (), 6 - A.M. .

    , , - .

    7

  • 1

    1.1 , ,

    . , . , , , .

    1.1.1

    informatio, , . , , - (, , ..), .

    . , , . , , , .

    XX . , , . , , .

    -, , , ; . .

    -, . .. , .

    .

    , , , , . 8

  • , , , , .

    , (), () . .

    , , (, ).

    . , , . . , , .

    1.1.2

    - . - . .

    , . .

    , , , . .

    1.1.3

    .

    , , , , .

    , :

    - ; - ; - - ; - - ;

    - , , .

    9

  • , , :

    - , ; - , ,

    (-, -); - , ,

    , , .

    , , , . , , , .

    1.1.4

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

    - , . , ; , , , ..

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

    . , , , , .

    10

  • 1.1.5

    , .

    , , , , , , , , , .

    . :

    - , ;

    - .

    .

    , .

    , .

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

    . , . , , .

    , .

    , .

    , , ..

    11

  • . , . . , . . , ,

    1.1.6

    :

    - , , ;

    - ;

    - .

    1.2 ,

    XX , . .

    1.2.1

    , , , , .

    , 1948 . . , .

    , , . , ,

    12

  • , . .

    , .

    : , , , .

    , ( ).

    .

    : , , . ,

    , , . , . .

    , , - , .

    1.2.2

    , , , . , . , .

    , , , , 1834 ., , , , . .

    1948 . , , , .

    , ,

    13

  • . . .

    1948 . , , . .

    , , , . .

    , . .

    , , , , . , , , . , , , . , , , .

    . , , , ; , , , - . , .

    , , . : , . , .

    . 14

  • : .

    , , . . , .

    , 50- . , , , ( ) .

    - . . . , . , , . . , . . .

    , , , .

    . . , . . , . . , . . .

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

    , . . 1956 . . .

    .. . , . , .

    1958 . . . , , .

    15

  • . .

    1958 . . 1958. () .. , , 1959 . . - . . .

    50- . , . .

    . , , , . - . . 1957 . , 1962 . , .

    , , , , , . . , .

    . .

    . :

    - () ,

    - , - ,

    - ,

    - , - , - .

    16

  • , . ( ) :

    - , - , , - , - , - , - .

    60-70- . XX . 80-90- . , , , . () .

    1.2.3

    , , . , , , , , .

    60- . XX . informatigue () information () automatigue () : . computer science ( ).

    60- . XX , - . , , (). 1968 . .. , , . ,

    17

  • .

    .. : , .

    .

    , 70- . XX . , , , . , .

    70- . XX , , , , ..

    1983 . , . " , , , , , , ". . , , , .. .

    , , , . , :

    , .

    , .

    , . , .

    , ,

    18

  • : , , , , .

    , . , , , , , , , , , .

    , .

    .

    1.2.4

    , , .. .

    , (. techne , logos ) () .

    . .

    , , , , . , , , - , - .

    , , , .

    , .

    , , .

    , .

    , - , , , , , , , , .

    19

  • , , () , , , , , .

    , .

    , .

    , , : .

    , () , ( , ) ( ).

    .

    , , , , . , -, , -, .

    , , ( ) , ( ).

    , , () .

    - - .

    :

    - () ; - ;

    - , - ;

    20

  • - ;

    - , ();

    - , , , .

    1.2.5

    , , , . , , . , , : , , . , , : , , .

    , .

    .

    () :

    - () ;

    - (, ) ;

    - , .

    1.2.6

    :

    :

    - (1960-1970- .) .

    21

  • ;

    - ( 1980- .) - , .

    , :

    - ( 60- .) ;

    - ( 70- .) /360. ;

    - ( 80- .) , . ;

    - ( 90- .) . . :

    , ;

    ; .

    1.3

    (), (hardware), (), (software). .

    , , . , , .

    1.3.1 ()

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

    22

  • , . :

    - (); - ; - ; - ; - ; - .

    . , .

    :

    - ( ); - ().

    .

    , , . . .

    , , , , , , , ( ), , , ,

    ..

    , .

    , , , . 100 (1 ). . () , .

    (, . .), , , ..

    23

  • , . , .

    () , , .

    (). Laptop ( ) 5-7 , Notebook ( ) 2-4 Subnotebook 2 .

    , ( ) , . , . .

    , (, -). , . CD/DVD-.

    , : , . , , .

    , , . , . ( ). , .

    , , . , , .

    , , . 24

  • , (PDA Personal Digital Assistant). , . (Palmtop PC) (Pocket PC). , , .

    , , , (), , , . , .

    , , , , , GPS ( ) . , SMS, MMS .

    ( . smartphone ) , .

    , ,

    . , GSM-. , .

    .

    .

    1.3.2

    () .

    , . .

    , , , ,

    25

  • .

    : .

    , .

    , . . , , .

    .

    :

    - ;

    - - ( ); - .

    , , .

    - , (, Norton Commander, Total Commander). .

    ( . utilitas ) , (, , , ..). , , .. .

    , , , .

    ():

    - ; - ; - ;

    - ; - .

    26

  • , . .

    , , .

    () . .

    :

    - ; - ;

    - ; - .

    . :

    - - ;

    - ; - ; - ; - ; - .

    . .

    , , ( ).

    , . :

    - ;

    - ;

    - (, ); - ; - .

    27

  • 1.4

    () , . , , , .

    , , .

    : -

    ;

    - ; - ;

    - , .. .

    , , . , , .

    :

    :

    - , ; - , .

    :

    - , , , ;

    - , , , , , .

    , . , , - .

    :

    - ;

    - . 28

  • .

    , , , () .

    1.5

    .

    , ( ) ( , , ). , .

    , , . , : , ..

    . : .

    (Open Source Software) (Freeware). , , , , .

    (Free Software) .

    , , (, , , , ), () , (Linux, Free BSD .) (Web- Apache, Sendmail .) .

    , :

    - ;

    29

  • - , , ;

    - , , .

    :

    - , - ,

    - .

    , , . (, , , , , .) . . New Margin Venture Caputal, Red Flag Linux (RFL) ( Linux). Red Flag Linux . RFL , , , , , , .

    Siemens, Linux. Windows.

    .

    1.6

    XX , , :

    - ;

    - , ;

    30

  • - , , .

    : - , . . , , .

    , , . , , .

    - .

    1.6.1

    1960- , 70- . 70- .

    - .

    . .

    , .

    , , .

    , , , .

    .

    31

  • .

    :

    - ; - ; - ; - ; - ; - .

    . , , . .

    :

    - ( ) , , ;

    - , ;

    , . , , , , . , . :

    - , ;

    - , , ;

    - , .

    32

  • 1.6.2

    , - , , .. .

    : , , .

    , .

    :

    - , ; - ; - , ;

    - ( , , );

    - - , ;

    - ; - ;

    - ; - ,

    ; - ,

    ;

    - ;

    - ;

    - ;

    - ;

    - - .

    , .. . :

    - (); - (); - (); - ();

    33

  • - ; - ; - , ; -

    (); - ; - ; - (, , ,

    ); - ; - ; - ; - ; - ; -

    .

    . , , :

    - (), , ;

    - (, , , .);

    - ( );

    - .

    1.7

    , , .. , , , . .

    34

  • 1.7.1

    XX . 1966 . , , , , , .

    XX XXI - () . .

    :

    - ;

    - ;

    - ; - ,

    , .

    :

    - ; - ,

    , ;

    - ;

    - (, , ) ;

    - ;

    - , , , ;

    35

  • - , , , .

    . , . , () , , ; , .

    1.7.2

    , , ( ) , , , , .

    , , .

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

    , , , , . , , , ..

    36

  • 1.8

    XX - XXI . , . , .

    . , , .

    : . . . .

    1.8.1

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

    ( ) , , .

    , - .

    (e-government) , 20 . , .

    37

  • .

    , , .

    -. , - , , , , , .

    , :

    - ;

    - ;

    - ;

    - ; .

    : (, , ).

    , , , . 2005 . 200 - 175 , , - . .

    , , , .

    38

  • 1.8.2 .

    . , . . , , , , , .

    - .

    , , , , . . , , , .

    . ( ) . , , , , .

    . , . ; ; ; -, , , -.

    39

  • - , . , ( .), .

    , . ( , , ), ( ).

    .

    , , .

    , , , :

    - , , , ;

    - , , , , .

    .

    , .

    , (), .

    , ,

    40

  • , .

    (), , .

    , , , , .

    , .

    .

    . , , .

    1.8.3

    .

    , , 2003 . , .

    . , , .

    .

    2003-2005 . 2010 . .

    2006-2010 . , , , . ,

    41

  • .

    , , , (, ) .

    . , , , .

    . . .

    web- , (http://president.gov.by/, http://www.government.by/), .

    - . 81- 2003- . 51- 2005- . ( 191 ), 22- .

    , web-, , .

    2002 . , 2005 . . (48-) (50-).

    .

    , , , , .

    1998 . , ,

    42

    http://president.gov.by/http://www.government.by/

  • , .

    , , .

    , , . , , : , , , , .

    , , , .

    (http://www.minedu.unibel.by) , , (http://www.vak.org.by), (http://www.gknt.org.by/), (http://www.ac.by), - .

    - : . - ().

    , ; , , .

    :

    - () - (http://www.pravo.by), ;

    - - ;

    - ,

    43

    http://www.minedu.unibel.byhttp://www.vak.org.byhttp://www.gknt.org.by/http://www.ac.byhttp://www.pravo.by

  • - ;

    - .

    , , , , .

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

    ( ). , , . , , .

    , .

    2004 . 135 , . 129 . 2004 . , . .

    2007 . 200 , . .

    44

  • , , . - .

    , , , . .

    1.9

    : 93 % . .

    , . .

    , (, ).

    . , , , . , , , .

    , . . , , .

    , , , .

    (, ). .

    20% , .

    , , .

    45

  • . . ( ) .

    -.

    ( ) , , , , .

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

    (, ), . , .

    , :

    - ;

    - ;

    - /.

    - . / ( , , , . .) , .

    , . . .

    / . :

    - ;

    - .

    , , , . , -. , , , , .. . 46

  • . ..

    , , , , .

    , , , - . , . , , ..

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

    . , , , , , , , , .

    , . . , . , . . , . , , , . , , .

    : , , , , ,

    47

  • . - ( ), , .

    1.10

    , .

    800 . ? () . 5 . 100 . 160 800 , 8 .

    . , (, , , ..) , .

    , , , , , . , XX .

    () , .

    , , .

    . , , .

    80- ., 90- . XX . , .

    48

  • , , DLI eLib . XXI . Global-Info.

    . , - , , - . , , .

    2005 . , (http://www.theeuropeanlibrary.org/portal/index.html).

    2007 . 23 , , , , , , , , , , , , (), (), , , , , , , , , . 150 , .

    2007 . .

    1995 ., 1996 ., .

    1998 . () - . Web- () (http://www.iis.ru/RDLP/); (http://www.elbib.ru/).

    , http://www.lib.ru. , .

    () (http://feb-web.ru/). - , , .

    ( , , , )

    49

    http://www.theeuropeanlibrary.org/portal/index.htmlhttp://www.iis.ru/RDLP/http://www.elbib.ru/http://www.lib.ruhttp://feb-web.ru/

  • , . 2005. ( http://www.elibra.ru/).

    1996 . http://kn.ihi. / i. -. , . , , , .

    (http://library.by/).

    - , : , , , , .. .

    , , . , , , :

    - , . . , . , , ;

    - , , ;

    - , , ; , ;

    - ;

    - . - ;

    - . , , . ( , , , , , );

    - ;

    - , , ,

    50

    http://www.elibra.ru/http://kn.ihihttp://library

  • .

    :

    - ; - - ,

    ( - 4 2 );

    - ( , );

    - ; - .

    , , . . .

    , .

    , , . .

    , , , . , .

    1.11 ()

    - , . . , , ..

    . , , . ,

    51

  • , .

    , - , .

    1.11.1

    ( , http://elibrary.ru), ( 372 ), . . , .

    on-site Elsevier, Kluwer, Springer , , . . 7611 , 9,5 , . 3664 , , , .

    500 , ( 220 ) .

    : http://www.elibrary.ru/projects/subscription/RussJour_Catalogue_2007.xls.

    , () ( , Science Citation Index Expanded, , , Social Citation Index Derwent). , , , , . .

    , .

    52

    http://elibrary.ruhttp://www.elibrary.ru/projects/subscription/RussJour_Catalogue_2007.xls

  • , , , . , , , .

    1.11.2

    , , , . . (), , 1944 ., , .

    () (). (http://www.diss.rsl.ru/) Web- , , 2004 .

    , ( , ).

    , .

    : , . , , OREL (Open Russian Electronic Library, http://orel.rsl.ru), .

    OREL.

    ( ) ,

    53

    http://www.diss.rsl.ru/http://orel.rsl.ru

  • , . .

    .

    , : OREL Web- ; ; , .

    1 . 2 ? 3 . 4 ? 5 ? 6 . 7 . 8 ? 9 . 10 ? 11 ? 12 ? 13 ? 14 ? 15 ? 16 ? 17 ? 18 . 19 ? 20 ? 21

    . 22 ? 23 ? 24 ? 25 . 26 . 27 . 28 . 29 . 30 . 31 .

    54

  • 2

    2.1

    - , . . , . .

    . ,

    , . , . .

    , . . . :

    - , . , ;

    - , . , ;

    - ; - . ,

    ; - -

    . , - ; - , . : - ,

    , ;

    - .

    .

    , . , .

    , .

    55

  • 2.2

    1 - . , . , , .

    2 ( .) , - .

    3 . . . , , . , .

    2.3

    .

    - , , , ( ).

    2.3.1

    . ( ), - , . . , ( 2.1).

    , . , , -56

    2.1 -

  • : . , , , .

    2 3 2200

    2.

    . 3 100 . 1 . , . ( 1 ).

    ,

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

    . ( 100 1000 ) . , , , , , , . , .

    10

    10 - 10

    11, 10

    3 - 10

    4

    . , 1 2

    , .

    2.3.2

    : - , . .

    ; - . , ,

    , . , , ;

    - . , , . , - , , ;

    57

  • - . 40% , ;

    - .

    2.3.3 ,

    40- . . , , , . , .

    , , , , .

    .

    - 30x30 , . . 900 (30 30 = 900). , ( 33 ).

    900 33 , . , . 33 .

    2.3.4

    ( ), , (2.1).

    X =(1,1,...,n)- ; W = (w1, w2,..., wn) - , wi, ; - ; F .

    2.2.

    (2.1)

    2.2 -

    58

  • . .

    :

    59

    F. i- wi, .

    . ( (2.2)):

    (2.2)

    \W\, \\ - W X, = (W, X) -

    W X. :

    wi , . .

    F . , - . . .

    2.3.5

    F , . .

    :

    . , .

    :

  • . :

    y = kS,

    k - . , .

    . , , . .

    2.3.6

    . . , .

    , , . , , - . , ( 2.3).

    2.3 -

    .

    j-ro (2.3):

    (2.3)

    j - j-ro ; wij - - i- j- .

    60

  • ( 2.4).

    2.4 -

    :

    ( ) :

    . :

    , ,

    2.3.7 .

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

    , .

    , . . , . , - .

    . .

    . : . , , .

    61

  • . , .

    . , .

    . . , .

    ( 2.5).

    2.5 -

    , . , , . - , . , 1 , 0 - . , 33 - . , ( ) . , , .

    2.3.8

    . ( ) . ( -

    62

  • ) , .

    i j, , wij ( 2.6).

    2.6 -

    (2.4):

    wij(t + 1) = wij(t) + yiyj, (2.4)

    t - ; yi yj - i- j- . , wij(t=0) = 0.

    , (. 2.4). 1 . , 1 ( 2.7).

    2.7 -

    , , : - 1 , :

    S=w1lx1+w2lx2-1.

    . .

    , 2.7, (2.5):

    w11(t + 1) = w11(t) + x1y1,

    w21(t + 1) = w21(t) + x2y1, (2.5)

    1(t + 1) = 1(t) - y1. 63

  • .

    2.3.9

    - , S, A R ( 2.8).

    2.8 -

    S . . R . , , .

    , , wij 5 .

    :

    Wij(t + 1) = Wij(t) + xi tj, (2.6)

    xi - i- ; tj - j-o ; - , 0 < 1.

    . , , .

    2.3.10

    . ( 2.9).

    64

  • 2.9 -

    . . , , , . , . .

    .

    2.3.11

    - . .

    , . . . , i- (i + 1)- ; i- (i + j)- .

    .

    , .

    , .

    . , , . , .

    .

    65

  • , . :

    - , ;

    - ;

    - , .

    , , , .

    2.3.12

    - , - . , , , .

    : - , -

    ; - ,

    , . .

    : - , , -

    ; - ; -

    , . : - ,

    ;

    - - .

    2.4 . -

    , -, . ( - , ).

    : , [0, 1), , . 66

  • - (, , , .). , , .

    - : . X, : () = . : n , n X;

    (. . )

    : -

    , .

    2.4.1 -

    S ( 2.10). , = 1. n :

    2.10 -

    , . m , S. , , S m/n. , .

    2.4.2 -

    ( 2.11). , , r2/4 ( r = 1) /4. 1.

    67

  • 2.11 -

    = 1 (0 1,0 1) , (x

    2+

    2 1).

    n , m . , , , (m/n). , , . , (2.7):

    (2.7)

    , :

    2.4.3

    :

    - - ;

    - , .

    , [0,1). - . R, [0, 1), ().

    68

  • , .

    2.4.4

    - , r r1,r2,...,rn R. ri . - , .

    - , . . , [0, 1). (, ).

    : - ;

    ; - . - ,

    . .

    : - , ,

    R; - ,

    .

    . - ,

    r1r2,...,rn R. , i- (i + 1)-. . . (), R. :

    - [0, 1) ;

    - , . . () ;

    - , . . ;

    - , .

    . - .

    69

  • r0. r0 = 0,9876.

    (r02 = 0,97535376).

    r1 = 0,5353. r1 (r12 = 0,28654609)

    . r2 = 0,6546. r22= 0,42850116,

    r3 = 0,8501, r32 = 0,72267001, r4 = 0,2670 . . 1,r2,...

    .

    .

    . . - .

    2.4.5

    X, . .

    xi - ,

    X:

    X \ 2 n

    P1 2 n

    R - , a rj- , . .

    . [0, 1) OR 1, 1+2,

    1+2+3,...,1+2+3+...+n-1 n 1, 2 , . . . , n:

    (2.8)

    , i : i=pi.

    . rj (0 rj 1), i, xi, X .

    . ,

    X 1

    2 n

    p1 p2 pn

    .

    70

  • 1 [0, 1) OR n : 1 - [0,1),

    2 - [1,1+2),

    n - [1+2+...+n-1, 1).

    2 rj R. rj i, xi.

    . 8 X,

    X 3 11 24

    0,25 0,16 0,59

    . 1 [0, 1) OR 0,25;

    0,25 + 0,16 = 0,41 3 : i - [0; 0,25), 2 - [0,25; 0,41), 3 - [0,41; 1).

    2 8 : r1 =0,10; r2 = 0,37; r3 = 0,08; r4 = 0,99; r5 = 0,12; r6 = 0,66; r7 = 0,31; r8 = 0,85.

    r1 = 0,10 1, x1 = 3. r2 = 0,37 2, 2 = 11. : 3 = 3, 4 = 24, x5 = 3, 6 = 24, 7 = 11, x8 = 24.

    2.4.6

    , , , q = 1 - .

    X p1 = , 2 = q. x1 = 1, 2 = 0. , X x1 = 1, ; X = 2 = 0, , . . .

    , A X :

    X 1 0

    . ,

    71

  • , 1 - , rj (j = 1,2,...) R; rj < , ; rj , .

    . 6 , = 0,35.

    . 6 , : r1 =0,10; r2 = 0,36; r3 = 0,08; r4 = 0,99 r5 = 0,12; r6 = 0,06. , rj < 0,35 , rj 0,35 , : , , , , , .

    2.4.7

    , A1,2,...,An , :

    - ; -

    . , 1,2,..., 6,

    , . A1,2,...,An (n>2) ,

    1,2,...,n , .

    . , A1,2,...,n 1,2,...,n, X :

    X 1 2 ... n 1 1 ... n

    X i = i, i.

    . , : p1 = (1) = 0,19; 2 = (A2) = 0,21; 3 = (3) = 0,34; 4 - (A4) = 0,26. , .

    . X,

    X 1 2 3 4

    0,19 0,21 0,34 0,26 , [0, 1)

    : 1 - [0; 0,19), 2 - [0,19; 0,40), 3 - [0,40; 0,74), 4 - [0,74; 1). , -

    72

  • : r1 = 0,66; r2 = 0,31; r3 = 0,85; r4 = 0,63 r5 = 0,73. r1 = 0,66 3, = 3, , 3. . : A3, 2, A4, 3, 3.

    2.4.8 .

    X, F(x) ( 2.12).

    2.12 - F(x)

    Y=F(X), 0 < < 1. Y :

    (2.9)

    F(x) , Y [0, )

    , X [0, x), . .

    P(Y

  • . 3 X, (2, 10).

    . X, (, b), :

    (2.12)

    = 2, b =10, ,

    (2.13)

    , i:

    i= 8ri + 2. , ,

    r1 = 0,11; r2 = 0,17; r3 = 0,66. , X: 1 = 8*0,11+2 = 2,88; 2 = 3,36; 3 = 7,28.

    . X , :

    F{x) = 1-e-x ( >0) ,

    ( ). X.

    . , :

    (2.14)

    i:

    (2.15)

    :

    (2.16)

    ri [0, 1), , 1-rj . , R 1 - R . xi :

    (2.17)

    74

    (2.17)

  • 2.4.9 -

    g(x), (, b). :

    (2.19)

    :

    -. :

    (2.22)

    :

    (2.23)

    . X f() = 2/ (. . X (0, /2)). X :

    (2.24)

    = 0 b = /2:

    (2.25)

    I

    :

    (2.26)

    75

    (2.18)

    X fix), (, b). X :

    :

    (2.20)

    (2.21)

  • n = 10. ri- :

    i 1 2 3 4 5 6 7 8 9 10

    ri 0,865 0,159 0,079 0,566 0,155 0,664 0,345 0,655 0,812 0,332

    i 1,389 0,250 0,124 0,889 0,243 1,043 0,542 1,029 1,275 0,521

    sin X/ 0,978 0,247 0,124 0,776 0,241 0,864 0,516 0,857 0,957 0,498

    :

    2.4.10 -

    - :

    - . , , ;

    - ;

    - , ;

    - , , , .

    , - .

    1 . 2 ? 3 ? 4 . 5 , . 6 ? 7 . 8 ? 9 ? 10 . 11 . 12 ? 13 ? 14 -? 15 -. 16 ? 17 . 18 ? 19 ? 20 -?

    76

  • 3

    MICROSOFT EXCEL

    3.1 Excel

    Microsoft Excel , .. . :

    - ; - ; - ;

    - ( );

    - .

    3.2 Excel

    Excel , ( - ), .

    - , .

    3.2.1

    Excel .

    3.1 - 25 :

    32 48 62 54 59 31 29 47 42 37 51 52 43

    47 61 54 53 41 42 36 48 41 49 57 46

    .

    1 1 " ". 2:26 ( ).

    2 1 ""; 2:7 (20, 30, 40, 50, 60, 70).

    3 , . - , ( ).

    77

  • 4 . - . . : -1:26, - 1:7. ( 1 1 , ), ( ) ( ). , . .

    3.2.2

    Excel , - .

    3.2 - 3.1 : , , , 95- .

    1 C1, 2, 3 "", ". .",

    "". Dl , D2, D3 ,

    , ,

    .

    2 5 ". ". D5

    : , -

    , n - ( n=25).

    D5 : =D2/KOPEH(25).

    3 95-

    : - ; - -

    ( = 0,05,

    95- ) -1 ; -

    . :

    - F6 ,

    - 0,05,

    - 24;

    - 6 " ", 7 -

    " ";

    - D6 ,

    : =D1-F6*D5. D7

    : =D1+F6*D5.

    78

  • 3.3 - 3.1, .

    1 - . . : - 1:26, - . ( 1 ), ( ) ( ). : 95. . . , .

    2 . , , , , - 16. " " -

    (. 3.2). =+16. =3-16.

    3.2.3

    , , , : F- , - t- , t- .

    3.4 - ( ). 25 (. 3.1) 19 :

    48 29 37 32 47 52 38 34 41 32 47 53 42 35 37 29 51 42 53

    , .

    1 Excel. (. 3.1).

    2 1 " ". ( 2-20) .

    3 , ( - ) . F- .

    79

  • - F- . : 1 - 1:26, 2 - 1:20, - 0,05. . . . (.. ) :

    F - F- ;

    P(F

  • 3.2.4 Excel

    , . . .

    3.5 - . :

    , % 13,5 17,0 11,5 16,0 23,0 18,0 9,0 21,0 15,0

    , 200 320 290 200 170 230 280 300 260

    ,

    6,2 8,7 11,2 4,9 3,1 4,5 9,7 4,2 5,1

    , .

    1 . Al, Bl, 1 " ", " ", " ". , , .

    2 2 "R". F2 (r) , : -1 - 2:10, 2 - 2:10.

    3 . . :

    - "t". F3 t- :

    r - , 1; n - ( n=9). F3 : =F2*KOPEH(7)/KOPEHb(l- F2^2);

    - 4 "". F4 . : - 0,05, - 7;

    - 5 "". F5 -

    81

  • . : X - ABS(F3), - 7, - 2;

    - ABS () - , X .

    - t- , ( ). , 0, : . r

  • , . .

    1 . 1 "X", 1 - "Y". 2:11 2:11 .

    2 - . : Y - 1:11, X - 1:11. . , (, 14). . , 3.1.

    - . , .

    3.1 - 3.6

    , , . 0, - 1. 0=3,79, 1=7,88 ( ). , X Y : Y = 3,79 + 7,88 X.

    , F. , ( ).

    83

  • ( =0,05), (.. ). F () 0,015, , 0,05. , X Y . , : (Y =3,79 + 7,88 X) X (.. 2,2; 2,8; ...;3,5), , (21,4; 28,6;...; 21,2).

    - ( F ), , X Y Y = A0 + A1, .. () .

    , -. , . - 0 0,618 > 0,05, A1 - 0,015

  • . ;

    - - . . .

    2 ( ). :

    - ; - ; - , , -

    . - ; (R^2). . , , , ( , ).

    3.7 - 3.5 : Y = 0 + 11 + 22 Y - ( ); X1 - , 2 - (1, 2 - ); A0, 1, 2 - , , . .

    , 3.6. X , (.. ).

    3.2. , (Y) (X1) (2) : Y = 13,543 -0,604X1 + 0,0082. : F 0,034, .. , 0,05. , -, , 0 2 , 1 - . , 1 , , . , - ( , ), 1 - . 2 , -

    85

  • . , , ().

    3.2 - 3.7

    3.8 - (X ). , :

    X 5 10 20 30 40 50 60 Y 48 32 17 14 9 5 2

    X: , , , . .

    1 . 1 "X", Bl - "Y". 2:8 2:8 .

    2 , (. 3.6).

    3 . ( ).

    4 , , ( ), 3.6.

    (R2)

    .

    86

  • 3.3 Excel

    Excel - , - - .

    3.9 - : 60-2 = 0,1.

    1 . , . . , , 1. 1 "X".

    2 2 " ". 2 , : =60*2^1.

    3 - . :

    - , , - 2;

    - . . 0,1;

    - , , - 1;

    - . .

    , , . . 1. =-9,23.

    3.10 - :

    1 . , . , , z. , , 2, 2, D2. Bl, C1, D1 "X", "Y", "Z".

    2 4 " ". 5, 6, 7 , : 5 - =7*B2+48*C2-2*D2, 6 - =17*B2+10*C2-8*D2, 7 - =B2*C2*D2.

    3 D4 " ". D5, D6, D7 (20, 25 1). , 3.3.

    - (X, Y, Z, " " ..), 3.3, . 0 5-7 , .

    87

  • 3.3 - - 3.4 - - 3.10 3.10

    4 . :

    - ; - , / 3.4.

    - , : B2:D2;

    - , . . . , , - ( , ). , 5. (=). D5. . . 6, =, D6. 7, =, D7. ;

    - .

    5 , , . , 3.4. B2:D2.

    - Excel . , - . . , , (, ).

    88

  • 3.4 Excel

    Excel - .

    3.11 - = 5x2-8x+3.

    1 . , . . , , 1. 1 "X".

    2 2 "". 2 , : =5*1^2-8*1+3.

    3 - . :

    - , : 2;

    - , ;

    - , : 1;

    - . 4 , ,

    . 1 , 2 - . : =0,8, =-0,2.

    3.5

    , , , , . . , , . , , . , .

    Excel - .

    3.12 - 1, 2, 3, :

    = 31 + 52 + 23

    :

    89

  • - , . : = 3x1 + 52 + 2x3 > max. , 1x2 + 213 + 23 >= 2500.

    1 . 1, 2, 3. , , 2, 2, D2. B1, C1, D1 "X1", "2", "".

    2 4 " ". 4 : =3*B2+5*C2+2*D2. D4 "max".

    3 5 "". . , 5 : =8*B2+7*C2+2*D2. 5 ( ) , .. "

  • 4 . :

    - : 2;

    - , ;

    - , : B2:D2:

    - . . . , , - ( , ). , , 5, (

  • 3.13 - 3.12 : 1, 2, 3 .

    - . , . B2:D2. "". . , 3.12.

    : 1=20, 2=70, x3=10, E=430.

    3.14 - :

    3.15 - :

    92

  • 4

    MATLAB

    4.1 Matlab. Matlab

    , Matlab.

    Matlab 4.1. , Matlab :

    - (Command Window) - . 4.1 : b;

    - (Workspace) - , Matlab . 4.1 , , b, 91 ;

    - (Command History) - , .

    ( ), , Current Directory: , .

    4.1 - Matlab

    93

  • Desktop, .

    , , . ,

    x=2*pi

    :

    =

    6.2832.

    , .

    , . ,

    x=2*pi;

    , x=2*pi ( ), .

    , , ans. ,

    2*pi

    :

    ans =

    6.2832.

    , , . , .

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

    . , , ( ) . , , .

    94

  • , . , . , X -.

    (, sin), (, pi, inf) .

    . help. , sin : help sin.

    clc.

    4.1 - . 1 10 .

    : 2*pi*10. ans .

    2 "" . , 12 .

    3 8,3. : =8.3. 4 20,

    . : =20; ( , ).

    5 . : =^(1/).

    6 30.

    7 , ans.

    8 . : .

    9 sin /4. : sin(pi/4). 10 sin 45. : sind(45).

    4.2 Matlab

    , Matlab - ( double). - 15 .

    format. : format short - ( ); format long - ; format short , format long - , format short format long, ; format rat - .

    , , :

    95

  • format rat

    ,

    format . fprintf,

    . , fprintf('%6.2f\n',y) , , - . \n , .

    4.2 - .

    4.3 Matlab

    4.3.1

    (.. ) , File - Save Workspace As..., save . .mat. Matlab , , Matlab, .

    File - Open load .

    save load , : save d:\lab\ivanov\rab_oblast.mat.

    , , Current Directory ( ).

    4.3.2 Matlab

    , Matlab ( ), , , . diary _ (, diary d:\lab\ivanov\seansl.txt).

    diary off.

    4.3 - .

    1 diary , .

    96

    file://d:/lab/ivanov/seansl.txt

  • 2 : - kor 5; - tg 45.

    3 (diary off). 4 : kor

    (kor=kor*2). 5 . 6 Matlab. 7 , diary. ,

    diary off. 8 Matlab. 9 .

    4.4

    Matlab . "Matrix Laboratory" ( -" "). , Matlab . 1 x 1 .

    - "" Matlab . ( ) "".

    4.4.1

    : - ; - ( ""); - .

    4.4 - :

    :

    =[3 6 4]

    b=[5 7 9; 6 2 1]

    , . , ; . . , :

    =[3,6,4]

    b=[5,7,9; 6,2,1]

    97

  • 4.5 - (), 0 10 0,1.

    : =0:0.1:10; , (

    101 ) .

    4.6 - 4 x 2 ( , ): , .

    :

    u=zeros(4,2)

    v=ones(4,2)

    w=rand(4,2)

    zeros, ones rand - , , .

    4.4.2 ,

    Matlab , , , , .. , . .

    4.7 - , .

    1 , .

    2 , :

    3 , , . : (2,3). 2. , , - . .

    4 : (2,3)=8. 5 : :(2,:). 6 : (:,3). 7 - v,

    : v=c(:,3). 8 2-3 2-4 w:

    w=c(2:3,2:4).

    98

  • 9 , d :

    10 z, : z=[;].

    , : () ( , ). [_1, _2] , _2 _1 ; [_1; _2] - _2 _1 . . , [, ] [; d] - . .

    4.4.3

    Matlab : . .

    4.8 - . 1 ,

    . 2 , :

    3 b : b=b+l. 4 b, u: u=+b. 5 b ,

    v: v=a.*b. . 6 b: sqrt(b). 7 : z=a*c.

    - : .

    8 b, .. :

    9 : d=det(x). 10 , : xobr=inv(x). 11 , ,

    xobr , . , .. , , - .

    12 : eig(x).

    k=[c,d].

    b=b'.

    99

  • 13 . : [k,s]=eig(x). : - , ; s - , .

    4.9 - : 6x1 + 14x2 + 7x3= 120 3x1 + 5x2 + 9x3 = 175 8x1 +3x2 + 5x3= 100.

    : =

    -1b, - (

    -1 -

    ), b - . ; .

    4.5

    Matlab . .

    y=f(x) lot(,,''), - (- ), , ; '' - , (). , .

    4.10 - y=0,25*+sin(x)-1 * 0 10.

    1 * 0 10 0,1. : =0:0.1:10; ( , ).

    2 : y=0.25*x+sin(x)-l;.

    3 : plot(x,y).

    4.11 - , 4.10.

    1 . 2 Edit - Axes Properties.

    (Property Editor - Axes). X Y X Y ( Label), ( Grid).

    3 Property Editor.

    4 Edit Plot ( ), .

    100

  • - Edit Plot , View Figure Toolbar.

    5 X Y . 6 Y .

    Y. Edit - Current Object Properties, Show Property Editor. Property Editor - Text. More Properties. Property Inspector Rotation 0. Property Inspector Property Editor.

    7 Insert - Text Box, : Y=0,25X+sin(X)-l. , 4.2.

    4.2 - 4.10

    8 Edit - Copy Figure, . Word . Word.

    9 , File - Save. .fig.

    10 . .

    4.12 - y=0,25x+sin(x)-l y=0,25x+cos(x)-l x: 0 10.

    1 0 10 0,1, yl 2 , 4.10.

    2 :

    101

  • plot(x,yl,'b') hold on plot(x,y2,'r') grid on

    'b' 'r' - ( ). hold on , , . grid on .

    3 , .

    4 . ( Edit Plot). . Line Style. Dash.

    5 Y=0,25X+sin(X)-l Y=0,25X+cos(X)-l, 4.11.

    6 : - Insert Legend; - : data1 da-

    ta2 Y=0,25X+sin(X)-l Y=0,25X+cos(X)-l; - .

    . Location - Best ( ).

    7 Word, 4.11. . .

    4.13 - y=0,25x+sin(x)-1 y=0,25x+cos(x)-l 0 10 .

    :

    subplot (1,2,1); plot(x,yl,'b'); text(0,0,'y=0,25x+sin(x)-l') grid on subplot (1,2,2); plot(x,y2,'r'); text(0,0,'y=0,25x+cos(x)-l') grid on

    , .

    subplot(a,b,n) . - , b - , n - , . text(x,y,'cpoa') .

    .

    4.14 - , : r=6cos(3t), t 0 2.

    :

    t=0:0.1:2*pi;

    102

  • r=6*cos(3*t); poIar(t,r)

    polar - . .

    4.15 - :

    x=6cos3t

    y=6sin3t

    t 0 2.

    :

    t=0:0.1:2*pi; x=6*(cos(t)).^3; y=6*(sin(t)).^3; pIot(x,y) grid on

    .

    z=f(x,y). :

    - ; - ,

    z=f(x,y) . meshgrid: [,] = meshgrid(_x, _); ( , , meshgrid, );

    - z=f(x,y) ( z); - z=f(x,y): plot3(x,y,z).

    4.16 - z=x2+y

    2 0

  • 4.3 - 4.16

    4.6 Matlab

    Matlab , , Matlab. Matlab . Matlab.

    "", Matlab "-", Matlab .m. - File - New - M-file, - - File - Open.

    Matlab -: - -.

    4.6.1 -

    - Matlab, .

    , - , - -. - . - -

    104

  • , , -, .

    4.17 - - .

    - - File - New -

    M-file. -. - :

    % [m,n]=size(a); b=a(:,n);

    "%" - . size(_) .

    , size () , - , - . m , , n - .

    - . . . 4.4.2.

    - File - Save. -, , stolbec.m.

    - - .

    -

    -, , . , : =[4 ,8 ,5 ,7 ;3 ,1 ,9 ,5 ;5 ,9 ,6 ,1 ] .

    , , -, , -.

    , -, .. stolbec.

    - : m=3, n=4, b=[7; 5; 1]. - , .

    4.18 - - y=0,25x+sin(x)-l. , .

    105

  • 4.6.2 -

    - , . - ( ), , , .

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

    () - :

    function [_] = (_)

    function - . _ - -, .

    4.19 - - . , . , . , : 1 - , 0 - , -1 - .

    - -, -,

    -. - :

    function [x,kod]=quadur(a,b,c) % % : quadur(a,b,c), x=quadur(a,b,c), |x,k]=quadur(a,b,c) % a,b,c - % - % - (1 - , % 0 - , -1 - ) n=nargin; if n~=3

    (' ') end d=b^2-4*a*c; if d~=0

    x(1)=(-b+sqrt(d)/(2*a); x(2)=(-b-sqrt(d)/(2*a);

    else x=-b/(2*a);

    end

    106

  • if d

  • . .

    4.20 - . : ( ) (-). , , "" ( ) . , , ( ) .

    , , .

    4.21 - . , , . , . , .

    4.22 - . , , . , (). , .

    4.6.3 Matlab

    , Matlab.

    : if _1 _1 elseif _2 _2 else 3 end

    1, 2 _3 - Matlab, .

    108

  • "": for =_::_ end

    , .

    "": while end

    break.

    : switch case _1 _1 case _2 _2

    otherwise end

    _1, _1; _2, __2 .. , , otherwise.

    ( x): =input(' :');

    ( ): disp(' Y '); disp(y)

    4.7

    f()=0 - fzero. :

    fzero('', _)

    fzero('', [ b]),

    '' - f(x)=0 -, f(x);

    _ - , ;

    a, b - , , f(a) f(b) .

    109

  • , fzero . , - ( b).

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

    4.23 - 0,25x+sin(x)-l=0 0 10.

    y=0,25x+sin(x)-l, , . , 4.2.

    - (), :

    function y=fun(x) y=0.25*x+sin(x)-l;

    fun.m.

    :

    x=fzero('fun', 1)

    : =0.8905. , 1 .

    - :

    x=fzero('0.25*x+sin(x)-l',1)

    , :

    x=fzero('fun', 3)

    : =2.8500.

    x=fzero('fun', 5)

    : =5.8128. fzero

    , :

    [x,y,k]=fzero('fun', 1)

    : =0,8905, =0, k=1. - y=0,25x+sin(x)-l (, , , ); - , fzero; r=1 , .

    0,25x+sin(x)-l=0, fzero fzero('', [ b]). , , :

    x=fzero('fun', [0 1])

    110

    http://fun.ni

  • 4.24 - 5x3+8x

    2+1 =0.

    : roots([5,8,0,l]).

    4.8

    - fsolve('_', _), ' ' - - (), ; _ - , .

    fsolve , .

    4.25 - :

    x12 x12 =

    -X1

    x22 x12 =

    -X2.

    :

    x12 x12 -

    -X1 = 0

    x22 x12 -

    -X2 = 0.

    (-), :

    function z=sist_ur(x)

    z=[x(l)^2-x(1)*x(2)- (-(1)); (2)^2+(1)*(2)- exp(-x(2))];

    :

    [x,y,k]=fsolve('sist_ur',[0 0])

    [0 0] - . :

    =

    0.9066 0.4611

    = 1.0-011 * 0.2307 -0.0560

    = 1

    , : x1=0,9066, x2=0,4611. . ,

    1ll

  • , . r - , fsolve; r=1 , .

    - fsolve (, 4.23).

    4.9

    y=f(x) Matlab:

    fminsearch('',x0)

    fminsearch(', a, ),

    '' - f(x), , -, ; x0 - , ; a, b - , .

    y=f(x) , fminsearch fminbnd . , x0, b.

    y=f(x), Matlab fminsearch fminbnd, f(x), -1.

    - fminsearch (. 4.10).

    4.26 - y=0,25x+sin(x)-l 0 10, fminbnd.

    y=0,25x+sin(x)-l, , . 4.2.

    , . :

    [x,y,k]=fminbnd('fun',4,5)

    - fun.m 4.23. 4 5 (, ). : =4,4597, =-0,8533, =1. , =4,4597, =-0,8533. =1 , .

    -, , :

    112

  • function y=fun_minus(x) y=-(0.25*x+sin(x)-l);

    fun_minus.m.

    , 1 2 :

    [x,y,k]=fminbnd('fun_minus',l,2)

    : =4,4597, =0,8533. : =8,1066, = 1,9945.

    4.27 - y=0,25x+sin(x)-1 0 10, fminsearch.

    , ( =4) :

    [x,y,k]=fminsearch('fun_minus',2)

    .

    - - fminsearch fminbnd , , : [x,y,k]=fminsearch('-(0.25*x+sin(x)-l)',2).

    4.28 - = 5 - 2/ - 2 + 10 sin

    5 - 2/x - 2 + 10sin = 0 -10 10.

    4.10

    Matlab fminsearch('*, x0), x0 - , .

    4.29 - : f(x1,2) = (1-5)

    2(2-2)

    2 - (1-5)(2-2).

    -, :

    function f=fun2(x)

    f=(((1)-5)^2)*(((2)-2)^2)-((1)-5)*((2)-2);

    - fun2.m.

    :

    [x,y,k]=fminsearch('fun2',[0 0])

    . : 1=0,3534, 2=1,8924, =-0,2500.

    113

  • 4.11

    3.4. Matlab . , - 4.12.

    4.30 - :

    = 51 + 42 + 123 > max

    21 + 6x2+x3 >= 100 31 +22+ 43

  • Matlab

    linprog(f, a, b, ar, br xmin, xmax)

    f - - , ;

    - -, " " ( );

    b - - -; r - - (

    ); br - - -; Xmin - - ; m - - .

    linprog , , - () linprog -. - ( File - New - M-file) :

    f=[-5;-4;-12]; = [-2,-6,-1;3,2,4;3,2,0;1,0,0;0,-1,0]; b = [-100; 1000; 600; 20; -10]; r = [1, -2,0; 1,1,1]; br = [0; 1]; xmin = [0; 0; 0]; [, , k] = linprog(f, a, b, ar, br, xmin)

    . (.. linprog) , .

    linprog: - x, ; - ( , -1 ); - , linprog (k=l, ).

    (, lp.m), - . 1.

    : x1=20, x2=10, x3=70, E=980. - .

    , , 2 >= 10 , x1

  • . - linprog :

    f=[-5 ; -4; -12]; = [-2,-6, -1;3, 2, 4; 3,2,0]; b = [-100; 1000; 600]; r = [1,-2,0; 1,1,1]; br = [0; 1]; xmin = [0; 10; 0]; xmax = [20; inf; inf]; [x, e, k] = linprog(f, a, b, ar, br, xmin, xmax)

    inf - . , 2 3 .

    - -, linprog :

    linprog(f, , b, [], [],xmin, xmax)

    , - , ([]). linprog, Matlab.

    4.31 - :

    = 0,5x1 + 1,2x2 > min

    x1>=200 2>= 100

    25x1+40x1 >= 20000

    2x1+7x2 = 0, 2 >= 0.

    4.32 - :

    = 20x1 + 252 + 173 -> min.

    4x1 + 52 + 23 >= 400

    x1 + 2 + 43 >= 250 x1 + 2+ 3 = 150

    2x1 + 2+ 3 =0,i=1,...,3.

    116

  • 4.12

    .

    4.33 - :

    1 +x2 + 3 >= 50 31 + 22 = 10 1 = 22

    12 + 2x3 = 100

    22+3

    2 =1000

    i>=0, i=1,...,3.

    Matlab, :

    - ; - ( , )

    , (. 4.11);

    - , -

  • Matlab :

    fmincon('_', 0, a, b, ar, br,xmin, xmax, '_')

    ' _ ' - -, ; 0 - -, ; - - (

    );

    b - - -;

    - - ( );

    br - - -; xmin - -

    ; xmax - -

    ; '_' - - (),

    .

    -, :

    function f=cel_fun(x) f=exp(x(l))/(x(2)*exp(x(3)));

    - cel_fun.m.

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

    function [ner, rav]=nel_ogr(x) ner=[(1)*(2)+(2)*(3)-2000; -(1)*(2)+100]; rav=[x(2)^2+x(3)^2-1000];

    - nel_ogr.m.

    - -, rav - -.

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

    function [ner, rav]=nel_ogr(x) ner=[(1)*(2)+(2)*(3)-2000; -(1)*(2)+100]; rav=[];

    118

  • fmincon. linprog, . -:

    0=[1,1,1]; =[-1, -1, -1; 3,2,0; 0,-1, 0]; b=[-50; 600; -10]; ar=[1,-2,0]; br=[0]; xmin=[0; 0; 0]; [x,e,k]=fmincon('cel_fun',x0,a,b,ar,br,xmin,[],

    'nel_ogr')

    x1 = x2 = 3 = 1 ( x0). fmincon ( , ) , .

    -, , nlp.m. nlp.

    : x1=20, 2=10, 3=30, E=4,5410-6

    .

    - fmincon (. 4.11). .

    4.34 - :

    = x1x2+2x13+223 > min

    x123 = 100

    xi>=0, i=l,...,3.

    4.35 - :

    =5]- 0,2x12 + 2x2 - 0,2x2

    2 -> max

    13x1 + 62= 0.

    4.13

    Matlab , . , . Matlab.

    - ode45. ode45 - :

    119

  • y1'=f1(x,y1,y2,..., yn)

    y2'=f2(x,y1,y2,..., yn)

    yn'=fn(x,y1,y2,..., yn)

    1,2,...,yn.

    ode45 :

    [x,y]=ode45('',[xmin, xmax], 0);

    '' - - (), ;

    xmin, xmax - ; 0 - 1, 2,...,n.

    ode45 : - - ; - n ,

    1, 2,..., n, . .

    4.36 - :

    1 =2+0,12

    2=-1,

    - , : 1(0)=0, 2(0)=1. 1() 2() 0 20.

    -, :

    function f=primer_du1(x,y) f=[y(2)+0.1*x*x; -(1)];

    primer_du1.m.

    ode45. . -:

    [x,y]=ode45(primer_dul',[0, 20], [0,1]); plot(x,y(:,l),'b') hold on plot(x,y(:,2),'r') grid on legend('y1','y2')

    120

  • , ode45 ( 0 20) , : 1() 2(), . plot(x,y(:,l),'b') , .. 1(x). - ( 'b' plot). plot(x,y(:,2),'r') 2(), . , , 4.5.

    -, , resh_du1.m. : resh_du1. , 4.4.

    4.37 - :

    " +0,5y + y3=10sinx,

    - , (0)=0, '(0)=1. () 0 10.

    ,

    , : 1=2, 2 = y' = 1'.

    , ,

    :

    1 = 2

    2 = -0.51 - 13 + l0sinx.

    -, :

    function f=primer_du2(x,y) f=[y(2);-0.5*y(l)-y(l)^3+10*sin(x)];

    primer_du2.m.

    - :

    [x,y]=ode45('primer_du2,,[0,10], [0,1]);

    plot(x,y(:,l)) grid on

    , , : - 1(x), - 2(). , , 1(x)=y(x); 2() . ( 4.5).

    - ode15s, .

    121

  • 4.4 - 4.36 4.5 - 4.37

    4.38 - :

    1 = 2

    2 = -1 +1000(1- 02)2.

    1, 2 - . 1(0)=2, 2(0)=0. 1() 2() 0 3000. odel5s.

    -, :

    function f= primer_du3(x,y) f=[y(2);-y(l)+1000*(l-y(l)^2)*y(2)];

    :

    [x,y]=odel5s('primer_du3',[0, 3000], [2,0]); plot(x,y(:,1),'b') grid on hold on plot(x,y(:,2),'r') grid on

    , odel5s , ode45.

    , 4.6. , . , , 1 2 . , , 4.5 subplot. , 4.7.

    122

  • 4.6 - 4.38 4.7 - 4.38 ( ) ( )

    4.39 - :

    " - = x

    - , : (0)=5, '(0)=12. () 0 10.

    4.14 Simulink

    4.14.1 Simulink

    Simulink , .. , . Simulink : , , , .. Simulink , . Simulink , .

    Simulink simulink. Simulink (Simulink Library Browser).

    Simulink ( Simulink) . Simulink .

    Simulink , , . Simulink, .

    123

  • Simulink . :

    - Sources () - , , : Clock (, ), Constant ( ), Pulse Generator ( ), Random Number ( ), Sine Wave ( ), Step ( ), From File ( ), From Workspace ( Matlab) ..;

    - Sinks () - , , : Display ( ), Scope (), File ( ), Workspace ( Matlab) ..;

    - Continuous ( ): Derivative (), Integrator (), Delay () ..:

    - Math Operations ( ): Add ( ), Divide ( ), Gain ( ), Sum ( , Add), Product ( , Divide), Math Function ( ) ..

    , , Aerospace Blockset ( ), Communications Blockset ( ), Neural Network Toolbox ( ), SimMechanics (), SimPowerSystems ( ) ..

    Simulink File - New - Model. . .

    , , . , , , , ..

    ( , ), , Matlab. , Matlab.

    File - Save. MDL.

    4.14.2 Simulink

    4.40 - , ,

    124

  • 0 10. . 5.

    , 4.8.

    . 1 Simulink Library Browser

    File - New - Model. .

    2 . Uniform random number ( ) Sources, Hit crossing ( ) - Discontinuities, Scope () - Sinks.

    3 Uniform random number (.. ). . : Minimum - 0, Maximum - 10. .

    4 Hit crossing: Hit crossing offset - 5 ( , 5 ) . Hit crossing direction - rising ( , 5 ).

    5 Scope ( , ), . Scope. , ( , ). Parameters ( - ). Number of axes 2. . Scope. .

    6 , 4.8. ( ) . ( 4.8 - Scope) Ctrl. -

    4.8 - 4.40 4.9 - 4.40

    125

  • , , , , Shift.

    7 "Input signal" "Output signal", 4.8. , Signal Properties Signal Name. , Enter.

    8 File - Save. 9 . Simulation ,

    Start. 10 Scope.

    , 4.9. 11 (

    ), Autoscale ( ). 12 Y ,

    -1 3. . Axes Properties. Scope Properties Y-min -1, Y-max - 3. . , Scope .

    13 Word. Edit - Copy Model to Clipboard. Word .

    14 Word. , Scope. Alt -Print Screen, Word .

    15 .

    4.41 - 10 2 /. 0 3. 20 . . .

    , 4.10.

    4.10 - 4.41 4.11 - 4.41

    126

  • .

    1 File - New - Model . . Sine Wave Sources, Saturation - Discontinuities, Integrator - Continuous, Scope. Display ( ) Workspace ( Matlab) - Sinks.

    2 : - Scope (. ); - Sine Wave: Amplitude - 10, Frequency - 2; - Saturation: Upper limit - 3, Lower limit - 0; - To Workspace: Variable name - integral (

    . Matlab). Save format - Array ( Matlab ).

    3 , 4.10. .

    4 . Simulation Configuration Parameters. Simulation Time Start time 0, Stop time - 20.

    5 (Simulation - Start). Display .

    6 Scope, . (. 4.40), , Scope , 4.11.

    7 Word. .

    8 Matlab. , integral. , . . - .

    4.42 - , . 15 3, - 10 2. , 5. 20 .

    , 4.12.

    127

  • 4.12 - 4.42

    . 1 File - New - Model .

    . Random Number Constant Sources, Add. Abs ( ) Divide - Math Operations, Integrator - Continuous, Scope Display - Sinks, Mux ( Scope) - Signal Routing.

    - Mux () , , Scope, , .

    2 Add () , ( ) . Add . List of Signs ( Main) +- ( "" ""); , . .

    3 : - Random Number: Mean - . Variance -

    : - Constant: Constant value - 5. 4 , 4.12.

    . . , Scope, . 4.13. Word.

    4.43 - , (24 ) (100 ), .

    4.14.

    128

  • 4.13 - 4.42

    4.14 - 4.43

    1 File - New - Model . 2 .

    SimPowerSystems. Electrical Sources DC Voltage Source ( ), Elements - Parallel RLC Branch ( , ), Measurements - Current Measurement ( ).

    - - , Format - Flip Block Format - Rotate Block.

    3 (Simulink). Sinks Display.

    4 DC Voltage Source. Amplitude 24 ( ). .

    5 (.. ). Parallel RLC Branch : Resistance - 100, Inductance - Inf (), Capacitance - 0.

    6 , 4.14. . . Display . , .

    4.44 - 4.15. .

    129

  • 4.15 - 4.44

    4.45 - , (220 , 50 ), (100 ), (5 ) (10 ), . .

    - AC Voltage Source, - Series RLC Branch SimPowerSystems.

    4.46 - :

    " = + 2 - ' ,

    - . () 0 5.

    , 4.16.

    4.16 - 4.46

    .

    1 File - New - Model . . Clock ( ) Sources, Fcn ( ) - User-Defined Functions, Add () Gain (

    130

  • ) - Math Operations. , , .

    - Gain, 4.16, Format - Flip Block.

    2 Fcn , . . Expression, Fcn . Expression : u*exp(u). .

    3 Add , , . Add

    + 2 - '. Fcn

    List of signs : ++- (.. "", "" ""). . 4 Gain Gain 2. ,

    2. 5 , 4.16.

    (. 4.40). . 6 ,

    . Simulation Configuration Parameters. Simulation Time Start time 0, Stop time - 5.

    7 . Scope , 4.17.

    4.17 - 4.32

    4.47 - :

    " + 0,5 + 3 = 10sin ,

    - . () 0 30.

    - sin Sine Wave ( Sources).

    131

  • 5

    MATHEMATICA

    5.1 Mathematica

    Mathema-tica, , 4 Matlab. - , . , .

    : 5x3+3x

    2-7+15=0.

    Mathematica :

    Solve[5^3 + 3 ^2 - 7 + 15==0, ]

    :

    , , - .

    . :

    Solve[5^3 + 3 ^2 - 7 + 15==0, x]//N

    :

    {{x -> -2.02401} , {x -> 0.712004 - 0.987551 i},

    ( -> 0 .712004 + 0.987551 i}}

    SoIve[a ^3 + b ^2 + + d==0, ]

    :

    132

  • .. .

    5.2 Mathematica. Mathematica

    , Mathematica.

    Mathematica 5.1. , Mathematica :

    - ; - (Notepad) -

    . 5.1 ;

    - (Palettes) - . 5.1 (Startup Palette), .

    133

  • 5.1 - Mathematica

    () , In[1], In[2] .. : Out[1], Out[2] .. , , .

    Mathematica Shift - Enter.

    , . , :

    5*8

    ( 40) , - . (*) , 5*8 5 8 ( ).

    :

    =5*8

    . ,

    . , :

    =5*8;

    134

  • , . , , :

    (8-3)/(15-4)

    : 5/11. :

    (8-3)/(15-4)//N

    0.4555.

    x=2P i

    : 2, .. .

    x=2Pi//N

    6.28319. , Mathematica

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

    - , . (, 3.2, 3.0, 3.), , - . , //N.

    5.1 - . 1 10 . :

    2*Pi*10, Shift-Enter ( Pi ). : 20.

    2 , : 2*Pi*10//N.

    Mathematica: - Mathematica .

    Mathematica (, Sin), (, Pi, ) (, Infinity - ) .

    , , Sin[x].

    Mathematica , , Mathematica -

    135

  • , . :

    5.2 - ( Shift-Enter).

    1 52+7-25=0. :

    Solve[5*x^2+7*x-25==0, ]

    .

    - , , .. ( ) . (, ) =. lr[].

    2 52+7-25=0 .

    :

    = 5*^2+7*-25==0

    , 5*^2+7*-25==0 ( , - ).

    3 :

    Solve[u, ]

    , , .

    Mathematica . %, - % % ..

    5.3 - ( Shift-Enter):

    =50*2 Sqrt[%] % % + 1

    Sqrt[%] 10, %%+1 - 101.

    , Mathematica, : >> "_".

    5.4 - .

    1 f x2sin : f=x^2*Sin[x].

    , .. - .

    - , 5.2, , f x^2*Sin[x], - .

    136

  • 2 f, , 0 10 0,1. : Table[f,{x,0,10,0.1}]//N. . //N , ( ) .

    - Mathematica . , Table 5.6.

    3 . : bl[f,{,0,10,0.1}]//N>>"_". , rezlab1.txt, c:\_Users\Ivanov, :

    Table[f,{x,0,10,0.1}]//N>>"c:\\_Users\\Ivanov\\rezlab1.txt"

    4 Mathematica, , .

    - bl[f,{,0,10,0.1}]//N>>"_" 3 : %"_". , - .

    5.3 .

    (.. ) File - Save. .nb. , . , , ( File - Open) Kernel - Evaluation - Evaluate Cells. , Kernel - Evaluation - Evaluate Notebook.

    5.5 - .

    1 , 5.1 - 5.4, File - Save. Mathematica.

    2 Mathematica. File - Open. 3 ( )

    f Shift-Enter. , f. , f ( f=x^2*Sin[x]).

    4 f=x^2*Sin[x]. ( ) . Kernel - Evaluation - Evaluate Cells.

    137

    file://c:/_Users/Ivanov

  • 5 f. , x^2*Sin[x]. , f .

    6 Mathematica Word. Mathematica, . Word.

    5.4

    , Mathematica, .

    5.6 - , c sin =2.

    1 , f f=x^2*Sin[x]. 2 :

    f/.x->2

    =2 x^2*Sin[x], ( 4 Sin[2]). , f : , a f - x^2*Sin[x].

    3 :

    y=f/.x->2

    - , 2, . f .

    , .

    5.7 - 52+7-25=0 z+1.

    1 :

    = 5*^2+7*-25==0

    2 :

    u=u/.x->z+1

    : -25+7(l+z)+5(l+z)2==0.

    (=) , . u/.x->z+l, , .

    3 :

    u=Simplify[u]

    : z (17+5 z)==13.

    138

  • 5.5

    . File - Palettes.

    5.8 - Mathematica.

    1 , , File - Palettes - Basic Input.

    2 3 (..

    ). 4 .

    () .

    :

    ( - 2, Sin) *.

    5 Shift-Enter. 6 , Mathematica.

    :

    Integrate[2 Sin[x]/Exp[x],x]

    () , .

    , , , .

    5.9 - :

    : , Mathematica.

    , ( ), , Mathematica.

    139

  • 5.6

    5.6.1 .

    Mathematica . - .

    , ={5, 3.5, 7, 8, 4} - . , .

    Mathematica , - . ,

    Mathematica : b={{5,2,7}, {4,6,2}, {1,9,4}, {3,7,2}}. b - , .

    . , , - .

    , , Mathematica b, . [[2]], 3.5. b[[2]], {4,6,2}, .. b. b[[3,2]], 9.

    , Mathematica .

    5.10 - 1 10 0.1, t

    2+sin t t 1 10 0,1.

    1 :

    x=Range[l,10,0.1];

    , 91 .

    2 :

    y=Table[t^2+Sin[t],{t,l,10,0.1}]//N;

    -, , : y=x^2+Sin[x]//N.

    . , ={5,{2,7,5}} - , - 5, - {2,7,5}.

    140

  • 5.6.2 ,

    , (, ..) .

    5.11 - , .

    1 , :

    2 elem , : elem=a[[l,3]].

    3 : [[2]]. 4 a: Transpose[a][[2]]. Trans

    pose [] - . 5 (5,7,5) :

    a=Insert[a,{5,7,5},2]. 6 (1,1,1,1) .

    : - : a=Transpose[a]; - (1,1,1,1),

    : a=Insert[a,{l,l,l,l},{{2},{3}}]. {{2},{3}} - , . 2 3 ( 2 4), ;

    - : a=Transpose[a]. 7 : MatrixForm[a]. 8 : TableForm[a].

    5.6.3

    Matlab : . .

    5.12 - . 1 , :

    2 b : b=b+l.

    141

  • 3 b, u: u=+b. 4 b ,

    v: v=a*b ( v=a b). 5 b: Sqrt[b]. 6 a c : z=a.c. 7 b, .. :

    b=Transpose[b]. 8 : d=Det[x]. 9 , : xobr=Inverse[x]. 10 , ,

    xobr , . , .. , , - .

    11 : Eigenvalues(x). 12 : Eigenvectors(x).

    5.13 - : 61 + 142 + 73 = 120 1 +52 + 93 = 175 81 +32 + 53 = 100.

    : x=a

    -1b, - (a

    -1 -

    ), b - . ; .

    Mathematica LinearSolve[a,b].

    5.7

    (Add-on) Mathematica, ( Mathematica), . , (, , ..) (, ). . Mathematica. :

    _'_'

    , , , "~" ( "").

    142

  • 5.14 - .

    , (, , ..). :

    Miscellaneous'PhysicalConstants'

    PhysicalConstants Miscellaneous. , :

    SpeedOfLight

    : 2 9 9 7 9 2 4 5 9 M e t e r

    Second

    (, ) .

    5.8

    Mathematica . Mathematica , - .

    Mathematica - Plot[, {, , }, ]. -, (, Sin[x]). - , . - , . ( , ..). Plot .

    Mathematica.

    5.15 - y=0,25x+sin -1 0 10.

    :

    Plot[0.25 x+Sin[x]-l,{x,0,10}]

    5.16 - y=0,25x+sin x - 1 y=0,25x+cos - 1 0 10.

    :

    Plot[{0.25 + Sin[x] - 1,0.25x + Cos[x] -1 } , {, 0,10}, AxesLabel ->{"X", "Y"},

    PlotStyle -> {Dashing[{}], Dashing[{0.05,0.025}]}]

    143

  • - , , .

    AxesLabel . PlotStyle Dashing : , - ( 0,05 - , 0,025 - ). Plot Mathematica.

    5.17 - y=0,25x+sin - 1 y=0,25x+cos - 1 0 10 .

    1 Legend Graphics:

    {Dashing[{0.15, 0.025}],

    Dashing[{0.05, 0.025}]},

    PlotLegend -> {"0.25 x+Sin[x]-1", "0.25 x+Cos[x] -1"} ,

    LegendPosition -> {-1, -1 .2 } , IegendSize -> {2, 0.5}]

    - LegendPosition . , - . , , -1 1. (LegendSize).

    5.18 - , :

    x=6cos3t

    y=6sin3t

    t 0 2. :

    ParametricPlot[{6*Cos[t]^3,6*Sin[t]^3},{t,0,2*Pi}]

    5.19 - , : r=6 cos 3t, f 0 2.

    1 Graphics Graphics:

  • Plot3D[x^2+2y^2,{x,-5,5},{y,-5,5},PlotRange->{0,40}]

    :

    Plot3D[x^2+2y^2,{x,-5,5},{y,-5,5},PlotRange->{0,40},Mesh->False]

    :

    ContourPlot[x^2+2y^2,{x,-5,5},{y,-5,5},Axes->True,AxesLabel->{"X","Y"}]

    5.21 - , :

    x=(cos t)(+cos u) y=(sin t)(3+cos u) z=sin 2u

    t 0 1,75, 0 2. : ParametricPlot3D[{Cos[t] (3+Cos[u]), S i n ( t ] ( 3 + Cos[u]),

    Sin[2u]} , {t, 0, 1.75Pi}, {u, 0, 2P i } , Axes -> True, AxesLabel -> {"X", "Y", "Z"}]

    5.22 - :

    X 1,2 3,1 6,7 7,8 9,8 12,5 14,3 Y 15,7 12,2 10,4 6,2 6,1 5,9 5,8

    . , X Y.

    1 , , :

    1.2 15.7 3.1 12.2 6.7 10.4 7.8 6.2 9.8 6.1 12.5 5.9 14.3 5.8

    2 . 3 Mathematica. -

    ( - dan). :

    d an=ReadL i s t [ " _ " , Number, RecordLists->True]

    , 5.4. Number , ; Number, , , . RecordLists->True , ( , ). dan .

    4 , : ListPlot[dan].

    145

  • 5 (, ), :

    ListPlot[dan, PlotRange->{-l,15}, PlotStyle->PointSize[0.02]]

    5.23 - , : (x

    2+y

    2)2-x

    2+y

    2=0, -2 2.

    , , Mathematica.

    - " " - implicit function.

    5.24 - 5.22. (. 5.6), : X Y.

    5.9

    Mathematica :

    Solve[ypa, ]

    NSolve[ypa, ]

    - ; - , .

    Solve , NSolve - ( ).

    - , , . 5.1 5.2.

    , Solve NSolve . (, - , ), .

    , Solve NSolve . . :

    FindRoot[ypa, {, _}]

    - ; - , ; _ - ,

    .

    146

  • , FindRoot ( ). , .

    .

    5.25 - sin + cos = 0.

    1 :

    Solve[Sin[x]+Cos[x]==0,x]

    :

    , .

    , . 2 :

    Sin[x]+Cos[x]==0/.%

    : {true,true}. , .

    - (/.) (%). . 5.2 5.4.

    3 , 1 2, : (. 5.2). ( Shift-Enter):

    ur=Sin[x]+Cos[x]==0 Solve[ur,x] ur/.%

    (Sin[x]+Cos[x]==0) ur, . , 1 2.

    4 sin + cos = 0 . :

    NSolve[ur,x]

    :

    {{ -> - 0 . 7 8 5 3 9 8 } , { -> 2 . 3 5 6 1 9 } }

    5 . :

    Sin[x]+Cos[x]/.%

    : {1.1102210-16

    , 1.1102210

    -16}, .. ().

    147

  • - ur/.% ( , ) : {false, false}, . , , - .

    6 sin + cos = 0 ( , ). :

    rez=x/.NSoIve[ur,x]

    , NSolve (.. , 4), , rez. rez {-0.785398,

    1 x/.NSolve[ur,x], NSolve

    , - .

    2 rez=x/.NSolve[ur,x] ( - ), , , (. 3).

    7 (.. ) :

    Sin[x]+Cos[x]/.x->rez

    , .

    5.26 - 0,25 + sin - 1 = 0 0 10.

    1 Solve. :

    Solve[-1+0.25 x+Sin[x]==0,x]

    , . .

    2 , , y=0,25x+sin - 1 0 10, Plot. , 5.2.

    2.35619}.

    S.2 - =0,25 + sin -1

    148

  • 3 FindRoot (. ). , , :

    FindRoot[0.25*x+Sin[x]-l=0,{x,0}]

    , =0. : {->0.890487}.

    4 :

    0.25*x+Sin[x]-l/.%

    , 0,890487. .

    5 ( ). :

    xl=x/.FindRoot[0.25*x+Sin[x]-l==0,{x,0}]

    ( 0,890487) , x1.

    6 :

    0.25*x+Sin[x]-l/.x->xl

    . 7

    2 3.

    8 . : x={xl,x2,x3}.

    5.10

    Solve NSolve, - FindRoot. , , . . FindRoot :

    FindRoot[{ypa}, {,x0},{,0},...]

    - , ; , ,... - , ; x0, 0,... - .

    5.27 - :

    x12 - x1x2 =-X1

    x22 - x1x2 =

    -X2.

  • 1 xl, 2, , , . , xl :

    xl=.

    Clear[x1]

    2 , :

    FindRoot[{xl^2-x1 x2=Exp[-xl] , 2^2+1 x2==Exp[-x2]},{xl,0},{x2,0}]

    xl 2 .

    :

    {x1->0.906592, 2->0.461078}.

    3 . , , :

    {1^2-1 x2-Exp[-xl], 2^2+1 2-[-2]}/.%

    ( ), .

    4 : ( , 2). :

    x={xl,x2}/.FindRoot[{x1^2-xl x2=Exp[-xl], 2^2+1 2==[-2]}, {xl,0},{x2,0}]

    , FindRoot (xl->0.906592, 2->0.461078), xl 2. ( ) .

    5.11

    y=f(x) :

    FindMiniinum[, {, _}]

    - fix), ; - ; _ - ,

    .

    FindMaximum, , FindMinimum.

    , FindMinimum FindMaximum . , .

    15

  • 5.28 - =0.25 x+sin - 1 [0; 10].

    , (. 5.2).

    1 ( , =5), :

    FindMinimum[0.25*x+Sin[x]-l,{x,5}]

    : {-0.853319,{->4.45971}}. ( -0.853319) - ; ( ->4.45971) - .

    2 ( ), , . ( Shift-Enter ):

    rez=% y=rez[[l]] x=x/.rez[[2]]

    (.. , 1) rez. , rez {-0.853319,{->4.45971}}. () . (), .

    3 (. 5.2), FindMaximum.

    5.12

    FindMinimum :

    FindMinimum[, {,x0},{,0},...]

    - , ;

    , ,... - ; x0, y0,... - .

    FindMaximum, , FindMinimum.

    5.29 - :f(x1, 2) = (x1-5)

    2(2-2)

    2- (15)(2-2).

    1 :

    FindMinimum[(xl-5)^2*(x2-2)^2-(xl-5)*(x2-2),{xl,0},{x2,0}]

    151

  • :

    {-0.25, {1 -> 1.09656, 2-> 1.87191}}.

    ( -0.25) - ; - ( ).

    2 , . xl 2 :

    rez=% (x1-5)^2*(x2-2)^2-(x1-5)*(x2-2)/.rez[[2]]

    (.. , 1) rez. , rez {-0.25,{1->1.09656, 2->1.87191}}. rez[[2]], .. xl 2, . 0,25.

    3 (f, xl 2), , 1 FindRoot. ( Shift-Enter ):

    f=rez[[1]] x1=x1/.rez[[2]] x2=x2/.rez[[2]]

    f=rez[[1]] f rez. - ( ). x1 2, .

    5.30 - = 5 - 2/ - 2 + 10 sin

    5 - 2/ - 2 + 10 sin = 0 -10 10.

    5.13

    (. 3.5) , , Mathematica :

    ximize[ , {}, {}]

    , , Minimize, , Maximize.

    , Minimize Maximize NMinimize NMaximize.

    152

  • 5.31 - : E=3x1 + 52 + 2x3 > max 8x1 + 7x2 + 53 = 2500

    xi>=0, i=1,...,3.

    :

    Maximze[3x1 + 5x2 + 2x3,

    {81 + 72 + 5x3 = 2500, x1 >= 0, 2 >= 0, 3 >= 0},

    {xl, 2, }] :

    , - , .

    , :

    Maximize[3xl+ 5x2 + 23,

    {8x1+ 7x2 + 5x3 = 0, 2 >= 0, 3 >=0},

    {xl, 2, 3}]//N

    :

    {430.278, {x1->22.265, 2->69.3373, 3->8.39749}}

    - , NMaximize Maximize.

    5.32 - 5.31 : 1, 2, 3 .

    :

    153

  • Maximize [3 x1+ 5 x2 + 2 x3,

    {8x1+ 1x2 + 5x3 = 2500, x1 >= 0, x2 >= 0,

    x3 >= 0, xl Integers, x2 Integers, x3 Integers},

    {xl, x2, x3}] // N

    , , , , (Integers). . :

    {430., {1->20.,2->70,,3->10.}} Minimize Maximize ( NMinimize NMaximize)

    , .. , 5.11 5.12. Mathematica.

    5.33 - : = 100x1+300x2 -> max 20x1 + 52 = 50 31 + 22 = 10 1 = 22

    12 + 23 = 100

    22 +3

    2 = 1000

    i>=0, i=l,...,3.

    154

  • 5.14

    Mathematica :

    DSo l v e [ ypa , y [x ] , ]

    - ; [ ] - ,

    ; - .

    DSolve : D S o l v e [ { y p a } , { y 1 [ x ] , y 2 [ ] , . . . , y n [ ] } , ] .

    5.35 - : "- = x, -

    .

    :

    DSolve[y"[] - [] == [], [], ]

    ( " [ ] ) ( ).

    :

    [1], [2] - .

    5.36 - :

    y1=2+0,12

    y2 = -y1

    - .

    :

    DSolve[{y1'[x] == 2[] + 0.1*^2, 2' [] == -y1[x]},

    {y1[],y2[]},]

    :

    {{y1[] -> C[1] s[1 . ] + [2] Sin[l. x] + 0 .1 Sin[1. x]

    ( - 1 . ( - 2 . + 1. 2) s[1 . ] + 2. x Sin[1. ] ) + 0.1

    Cos[1 . x] (2 . x C o s [ 1 . x] + 1. ( - 2 . + 1 . x2) S i n [ l . x]),

    y 2 [ x ] -> [2] s[1 . x] - C[1] Sin[1. x] + 0.1 Cos[1 . X]

    ( - 1 . ( - 2 . + 1. x2) Cos [ l . x] + 2. x S i n [ l . x]) - 0 . 1 S in[

    1. x] (2 . x s[1 . x] + 1. ( - 2 . + 1 . 2) Sin[1, x])}}

    155

  • 1() 2() , Simplify[], - , . :

    Simplify[%]

    :

    {{y1[] ->

    0 . 2 s[1. X]2 + Sin[1. ] ([2] + 0 .2 S i n [ l . ] ) +

    Cos[ l . ] ([1] + (0. + 0. 2) Sin[1. ]) ,

    2 [ ] -> ( 0 . 2 - 0 .1 2) s[1 . X]

    2 +

    s [ 1 . ] ([2] + 0. S i n [ l . ]) +

    S i n [ l . x l ( -1 . [1] + ( 0 . 2 - 0 . 1 2) S i n [ 1 . x ] ) } }

    Mathematica :

    NDSo l v e [ { y p a , _}, {1, 2,..., n}, {, min, xmax}],

    - ( ); _ - ,

    , , ;

    1, 2,..., n - , . ( ), ;

    - ;

    Xmim Xmax - .

    5.37 - 5.35 : (0)=5, '(0)=12. () 0 10.

    1 . :

    NDSolve[{y"[x]-y[x]==x*Exp[x], [0]=5, '[0]==12}, , {,0,10}]

    :

    {{y-> lnterpolatingFunction[{{0., 10.}}, ]})

    , () 0 10. ( 0 10) (). .

    2 ():

    Plot[Evaluate[y[x]/.%],{x,0,10},AxesLabel->{"x","y"}]

    () 5.3.

    156

  • Evaluate () , , .. NDSolve. Plot ( 0 10) , Evaluate, .. ().

    - Evaluate[y[x]/.%] , []/.%. , , Evaluate. , Plot : Plot[y[x]/.%,{x,0,10}, AxesLabel->{"x","y"}]. []/.% (, ). Evaluate .

    5.38 - :

    1 =2+0,12

    - , : 1(0)=0, 2(0)=1. 1() 2() 0 20.

    1 Legend, Graphics (. 5.7, 5.8). :

    Graphics'Legend'

    Legend , : 1() 2(), .

    2 . :

    rez = NDSoIve[{yl'[x]==y2[x]+0.1*x^2, 2'[]== -yl[x], 1[0]==0, 2[0]==1}, {1,2},{,0,20}]

    1() 2() 0 20. :

    {{y1->InterpolatingFunction[{{0., 20.}}, ],

    y2->InterpolatingFunction[{{0., 20.}}, ]}}

    , .. 1() 2(),

    rez.

    3 :

    Plot[Evaluate[{y1[], 2[])/ . r e z ] , {x, 0, 20}, PlotStyle -> {Dashing[{}], Dashing [{0.05, 0 .02}]} , PlotLegend-> {"yl", "y2" }, LegendPosition-> {1 , 0}, AxesLabel->{"X", "Y"}]

    157

  • 5.4.

    4 y1(x) 2() . , y1() :

    Plot[Evaluate[1[]/.rez], {, 0, 20},

    AxesLabel -> {"X", "Y"}]

    2().

    - - . %, %% ..

    5.3 - 5.37 5.4 - 5.38

    , , (.. ), , , .

    5.39 - y1(x), 5.38, .

    1 1() =10:

    yl[10]/.rez

    2 y1(x) 0 10 0,1. . :

    - 0 10 0,1:

    x=Range[0,10,0.1];

    ( , );

    - y1(x) :

    1[]/.rz>>"_"

    158

  • 5.40 - :

    '' + 0,5 + y3 = 10sin ,

    - , (0)=0, '(0)=1. () 0 10. () =8.

    5.41 - :

    y1'= y2

    2 '=-y1 +1000(1-y12)2

    y1, 2 - . y1(0)=2, y2(0)=0. y1(x) 2() 0 3000.

    159

  • 6

    ++

    6.1 -

    : -> -> -> -> .

    - , . .

    - - , , . :

    - - - ;

    - , ( ) ( ) . - - .

    - () - , , , . : 1) , ; 2) - ; 3) . - .

    :

    - ; - ; - -.

    , .. , . (). , 60, , ..

    . , , ,

    160

  • . . () , . . ++ , . ++ .

    - : , ; , () .

    -

    .