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

1 1 .

2
2 2 4
2.1. 4
2.2. 5
2.3. 7

2.4. 9
( )
2.4.1. 9
( -)
1 13
3 3 14
3.1. , 14

3.1.1. 14
3.1.2. 16
3.2.
3.3. -
3.4. 20
3.4.1. 20
3.4.2. 21

3.4.3.
2
4 4
4.1.
4.2.
4.3.
4.4.
4.5.
5 5
6 6

1. .


.
, ,
,
. ,
.

: , ,
.. ,
.
,
. ,

() .
, .
.
. ,
, 825 ..
, , ,
.
,
().
S,
L ( ).
:
.
XVI
. ,
.: 8 ,
.

=(8-)(2-8) 0<x<8. ,
, , -,
, (0,8)
.
.,
.,.
,
.
XVII .

.
,
. ,
( )
.,
(1788 .),
(1797 .).
, ,
.
, .,

.
40-
, , .
30- ,
, ,
, .

.,
.
(1939 .).

,
, ,
.
50-70- -,

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

: , , , .

, ,
.

,
.

:
1) ;
2) ;
3) ;
4) ;
5) ;
6) .

.
,
,
, ,
.
, ,
, ,
.

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

.

.

: 1)4 2) 3)
.
, ,
. ,
, .
,

(
, ..).
, .

, ,
, .
(, ..)
.

.
,
, , ,
, ).



.
( )
( ),
.

2.

2.1.

f(x) x0,
, , x-x0< , f(x)f(xo),
.. x0, , x
f(x)f(xo). x*,
f(x)f(x*).

.1

12
10
8
6
4 xm
2
0
-2 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
x0
-4
x*

x* x0
, .
, x* x0 ,
, .. :
f(x)=0
xm,
. ,
,
.
, , x* x0 f(x)
.
. ,
, f(x)
, , f(x0)>0, f(x*)>0,
f(xm)<0. , ,
.
, f(x)
x0 x*, xm., ,
:
f(x0+h)=f(x0)+hf(x0)+h2/2f(x0)+
, f(x0+h)-f(x0) 0
h < , f(x0) =0.
h2>0, f(x0)>0, 0 .
, xm .
1.
f(x)=x3-2x2+x+1
f(x)=3x2-4x+1=0
3x2-3x-x+1=0
3x(x-1)-(x-1)=0
(x-1)(3x-1)=0
x=1/3 x=1
f(x)=6x-4
f(1/3)=-2<0, .. x=1/3 -
f(1)= 2>0, .. x=1 -

2.2.

n
f(x1,x2,,xn)=f(x).
n- x1,x2,,xn
- x.
, .. f/x1, f/x2,,
f/xn, f(x) g(x) .
() f(x) G(x)
n*n Gij=2f/xixj
f(x) x0,
x0, , x
f(x)f(xo). x*,
f(x)f(x*).

.
xo

f(x0)=0,

..

f(x0)/x1 =0
f(x0)/x2,=0

f(x0)/xn,=0


x0 f(x0)=0, G(x0) .

x0 f(x0)=0, G(x0) ..

2.

f(x)=f(x1,x2,x3)=x12+x22+x32-4x1-8x2-12x3+100

.
, :

2x1-4
f(x0)= 2x2-8 =0
2x3-12

, x1=2, x2=4, x3=6.

2 0 0
G(x0)= 0 2 0
0 0 2

,
2.
, (2;4;6) f(x) .

2.3.


z=f(x,y)min
x,y ,
g(x,y)=0


L(x,y,)=f(x,y)+ g(x,y),

.

:

L(x,,y,)/x =f(x,,y)/x+ g(x,,y)/x=0


L(x,,y,)/y =f(x,,y)/y+ g(x,,y)/y=0 (3)
L(x,,y,)/ =g(x,,y)/=0

,
- .
. f(x,y)=x2+y2 min x+y=4.


L(x,y,)= x2+y2+ (x+y-4).


:
L(x,,y,)/x =2x - =0
L(x,,y,)/y =2,y - =0
L(x,,y,)/ =x+y-4=0

x=2, y=2, =4.


f(2,2)=8.

(3)
m n .

z=f(x)=f(x1,x2,x3,,xn)
g1(x)=0
g2(x)=0
..
gm(x)=0

f(x+h)- f(x)0
h,
gi(x+h)= gi(x)=0 i=1,2,,m
h=(h1,h2,h3,,hn)
n
(f(x)/xj) hj=0
j=1

(gi(x)/xj) hj=0 i=1,2,,m


n m
(f(xy)/xj+ i(gi(xy)/xj)) hj=0
j=1 i=1
i .i ,i,, m

h1,h2,h3,,hn ,
0 .
, ,

f(x)/xj+ i(gi(x)/xj) =0 j=1,2,,m

f(x)/xj+ i(gi(x)/xj) =0 j=1,2,,n

F(x,)=f(x)+ + igi(x)

f(x)

F(x)/xj =f(x)/xj+ i(gi(x)/xj) =0 j=1,2,,n


F(x)/i =gi(x) =0 i=1,2,,m

2.4.

z=f(x1,x2,x3,,xn)
gi(x1,x2,x3,,xn)0, i=1,2,,m
xj0,j=1,2,3,..,n

2.4.1. (
)

z=x1-x2-5extr
(x1-1)x21
x1+x23,5
0x15
0x25

2.4.2. ( -)


.

()

z=f(x1,x2,x3,,xn)min
gi(x1,x2,x3,,xn)bi, i=1,2,,m
xj0,j=1,2,3,..,n

,
f(x1,x2,x3,,xn)max - f(x1,x2,x3,,xn)min,
gi(x1,x2,x3,,xn)0, i=1,2,,m - gi(x1,x2,x3,,xn)0, i=1,2,,m.
,
.


ui2 (, ui2
)
gi(x1,x2,x3,,xn)+ui2= bi, i=1,2,,m.
,
z=f(x1,x2,x3,,xn)min

gi(x1,x2,x3,,xn)+ui2- bi=0 i=1,2,,m.
,
F(x,,u)=f(x)+ + i[gi(x)+ ui2- bi]

,
, :

F(x,,u)/xj =f(x)/xj+ i(gi(x)/xj) =0 j=1,2,,n


F(x,,u)/i =gi(x) ) + ui2- bi =0 i=1,2,,m
F(x,,u)/ui =2 i ui =0 i=1,2,,m

ui/2,
i ui2 =0

i[ bi - gi(x)]=0 i=1,2,,m (*)
*

f(x*)/xj+ i(gi(x*)/xj) =0 j=1,2,,n
gi(x* ) + ui2- bi =0 i=1,2,,m
i[ bi - gi(x*)]=0 i=1,2,,m
.
, i =0 bi - gi(x*)=0. i 0, -
gi(x*)= bi
. ,
gi(x*)< bi ,
i =0. , gi(x*)< bi ,
, , ,
,
. , ,
.
,
, i 0.
,
(x*,*,u*).
z=f(*), z bi
bi , ,
z.
,
z/bi=- i*
z/bi= (f/xj) (xj)/bi),
*.
gk(x) ) + uk2= bk,

gk/bi= (gk/xj) (xj)/bi)=0,ik 1,i=k


z/bi+k* (gk/bi)= z/bi+ i*== (fk/xj + k* (gk/xj) (xj/bj)


.
,
z/bi=- i*
bi ,
z f(x),
, .
z/bi0, ..

i*0
f(x),
gi(x1,x2,x3,,xn)bi, i=1,2,,m ,
x* *,
f(x*)/xj+ i(gi(x*)/xj) =0 j=1,2,,n
gi(x* ) bi =0 i=1,2,,m
i[ bi - gi(x*)]=0
i*0 i=1,2,,m
-.

1.
-
F(x)=3x12+4x1x2+5x22min
x10,
x20
x1+x24
:
F(x)=3x12+4x1x2+5x22min

-x10,
-x20
-x1-x2-4


F(x.u,)= 3x12+4x1x2+5x22+ 1(u12-x1)+ 2(u22-x2)+ 3(u32-x1-x2+4)

6x1+4x2- 1- 2=0
4x1+10x2- 2- 3=0
-x10,
-x20
-x1-x2-4
1x2=0
2x2=0
3(4-x1-x2)=0
1,2,,30

x1=3,x2=1, 1=0, 2=0, 3*=22


, 44 (3;1).
, -

1( +) 25 40

5=2+3 8=5+3
:
-
-
-

f(x)=x3-2x2+x+1
f(x)=x(x-1)2
f(x)=x/(x2+1)
f(x)=|x|
5=2+3 8=5+3
:
-
-
-

f(x)=2x13-2 x1x2+x22
f(x)= x12-4 x1-6x2-x22
f(x)= x1 - x1x2+x22 +9x1-6x2+20
2

f(x)= x13+x23 -6x1x2+1


f(x)= 2x1x2-4x1-2x2
f(x)=- x1 - x1x2-x22 +3x1+6x2+20
2

5=2+3 8=5+3


f(x,y)=x2+y2 min
x+y=4.
f(x,y)=2x+4y extr
x2+4y2=8.
f(x,y)=1/x+1/y extr
x+y=2.
f(x,y)= x+y extr
1/x2+1/y2 =1/2.
f(x,y)= x-y+4 extr
4x-y2 =0
f(x,y)=x2+y2 min
x+y-1=0.
f(x,y)= xy extr
x2+y2 =2.
- 5=2+3 8=5+3
-
-
F(x)=3x12+4x1x2+5x22min
x10, x20,x1+x24

3
3.1.
3.2.
3.3. -
3.4.

3.

3.1. ,

3.1.1.

:
.
: , 1
:
1 ,


0,8 0,5 400
0,4 0,8 365

,
, 100 .
, , 350
. 1 16 ,
14 .
,
,
.
.
: 1- ,
2- .

L(x)=16x1+14x2max
0,8x1+0,5x2400
0,4x1+0,8x2365
x1x2+100
x2350
x10, x20
,
, . ,

.

.
,
.

. ,
.
:
bi ,i=1,,m-
aij,,i=1,m,j=1,,n- i j

cj - j .


1 2 j n
1 a11 a12 a1j a1n b1
2 a21 a22 a2j a2n b2
.. .
i ai1 ai2 aij ain bi

m am1 am2 amj amn bm
c1 c2 cj cn

xj j ,
x=(x1,x2,,xn) .

L(x)=c1 1 +c2 2 + +cj j + cn n

.
:
a11 1 + a12 2 + + a1j j + + a1n n
b1 , ..

a11 1 + a12 2 + + a1j j + + a1n nb1



.
, j 0, j =1, ,n,
.
,
:

L(x)= cj j max

aij j bi, i=1,,m
j 0, j =1, ,n

3.1.2. ( )


33 , 23
12 .
3 .
:

1 4 3 1 20
2 3 2 1 20
3 2 1 2 10

,
,
.
1,2,3 1,2 3 ,
(, j 0, j =1,2 ,3).
:

41+32,+2333
31+22,+323
1+2,+2312

L(x)=20 1 +20 2 +10 3min

.

bi ,i=1,,m , n .
,i j , j
.


1 2 j n
1 a11 a12 a1j a1n b1
2 a21 a22 a2j a2n b2
.. .
i ai1 ai2 aij ain bi

m am1 am2 amj amn bm
c1 c2 cj cn

:
bi ,i=1,,m- i .
aij,,i=1,m,j=1,,n- i j
,
cj j .

xj j ,
x=(x1,x2,,xn) .

L(x)=c1 1 +c2 2 + +cj j + cn n

:
a11 1 + a12 2 + + a1j j + + a1n n
b1
, ..
a11 1 + a12 2 + + a1j j + + a1n nb1

.
, j 0, j =1, ,n,
.
,
:

L(x)= cj j min

aij j bi, i=1,,m
j 0, j =1, ,n

3.3.-


(, )
.

1 ( ).
3 .,
4 ..

1.

1- 2-
1 2 4
1 1 3
2 1 8
3 4

,
?
.
:
x1-
x2-
:

L(x)= 3x1+4x2max

x1+2x24
x1+x23
2x1+x28

x10, x20

,
x30, x40, x50
:
L(x)= 3x1+4x2max

x1+2x2+x3 =4
x1+x2 +x4=3
2x1+x2 +x5=8

x10, x20, x30, x40, x50

1- :

3 4 0 0 0
x1 x2 x3 x4 x5 bi
x3 1 2 1 0 0 4
x4 1 1 0 1 0 3
x5 2 1 0 0 1 8
-3 -4 0 0 0 0

L(x1*) =0, x1*=(0,0,4,3,8) aij*min(4/2, 3/1, 8/2)

, ,
.
x2,
x3, min(4/2, 3/1, 8/2)= min(2,3,8)=2.
2. (
) x2, x3.
2- :

3 4 0 0 0
x1 x2 x3 x4 x5 bi
x2 1/2 1 1/2 0 0 2
x4 1/2 0 -1/2 1 0 1
x5 3/2 0 -1/2 0 1 6
-1 0 2 0 0 8

L(x2*) =8, x2*=(0,2,0,1,6) aij*min(4, 2, 4)

.
. 1/2.
3- :
3 4 0 0 0
x1 x2 x3 x4 x5 bi
x2 0 1 1 -1 0 1
x1 1 0 -1 2 0 2
x5 0 0 1 -3 0 3
0 0 1 2 0 10

L(x3*) =0, x3*=(2,1,0,0,3)

. ,

= (2,1) Lmax=10

: ,
, 10
..
3.4.


,
, .
, , ,
, ,
, ..

3.4.1.


: m A1,A2,,Am
, , a1,a2,,am. n
B1,B2,,Bn , , b1,b2,,bn.
1 Ai Bj cij.
, ,

.

,
.
, ..
ai= bj
,
.

xij , Ai Bj.

L(X)= cij xijmin

:
xij=ai
xij=bj
ai= bj
xij0, i=1,2,,m, j=1,2,,n

Xopt=( xij) , i=1,2,,m, j=1,2,,n,

.
,
:


.

3.4.2.


.
A1,A2,3 90, 400
110 . 1,2,3
140, 300 160 .
,
.
(..)

2 5 2
4 1 5
3 6 8
.

., :

ai=90+400+110=600
i=140+300+160=600 .

, .

.
:
1 2 3
140 300 160
a1 90 2 5 2
90
2 400 4 1 5
300 100
3 110 3 6 8
50 60

5=3+3-1, ..
.
,
:
90 0 0
Xopt1= 0 300 100
50 0 60

L(Xopt)=902+3001+1005+503+608=1610 ..


:
,
m+n ui vj, ui + vj=cij
ui +vj-cij0 .
ui vj .
vj ui. ui vj
ui + vj=cij , .
, , u1=0.
. , ui, vj=cij- ui,
vj , ui =cij- vj.
ij =ui + vj-cij,
. ij0,
. ij0,
,
.
,
ui vj.
:
1 2 3 ui
140 300 160
a1 90 2 5 2
90 0
2 400 4 1 5
300 100 -2
3 110 3 6 8
50 60 1
vj 2 3 7

u1=0.
. ,
(1,1), u1 +
v1=2. , v1=2.
. ,
.
(3,1): u3 + v1=2. v1=2=> u3 =1
(3,3): u3 + v3=2. u3 =1=> v3=7
(2,3): u2 + v3=2. v3=7=> u2 =-2
(2,2): u2 + v3=2. u2 =-2=> v2=3
.


12 =u1 + v2-c12=0+3-5=-2<0
13 =u1 + v3-c13=0+7-2=5>0
21 =u2 + v1-c21=-2+2-4=-4<0
32 =u3 + v2-c32=-1+3-6=-2<0

13>0
,

.
, .
, .
ij0 (, ),
, , : ,
. (+),
(-) (+). (-)
, ,
(+), (-).
.
, .. ,
.

.
(1,3), .
(+) (-) .
(1,1) 90 - + (1,3)

(3,1) 50 + - 60 (3,3)

(-) , 60.
, ,
, .
:
(1,1) 30 + - 60 (1,3)

(3,1) 110 - + (3,3)

30 0 60
Xopt2= 0 300 100
110 0 0

L(Xopt)=302+602+3001+1005+3110=60+120+300+500+330=1310
..

.

.

1 2 3 ui
140 300 160
a1 90 2 5 2
30 60 0
2 400 4 1 5
300 100 3
3 110 3 6 8
110 1
vj 2 -2 2

u1+v1=2 u1=0 v1=2


u3+v1=3 u3=3-v1=3-2=1
u2+v2=1 v2=1-u2=1-3=-2
u2+v3=5 u2=5-v3=5-2=3
u1+v3=2 v3=2-u1=2-0=2


12 =u1 + v2-c12=0+2-5=-3<0
21 =u2 + v1-c21=3+2-4=1>0
32 =u3 + v2-c32=-1-2-6=-7<0
33 =u3 + v3-c33=-1+2-6=-3<0
21 =1>0:

(1,1) 30 - + 60 (1,3)

(2,1) + - 100 (2,3)

(1,1) + - 90 (1,3)

(2,1) 30 - + 70 (2,3)

0 0 90
Xopt2= 30 300 70
110 0 0

L(Xopt)=304+902+3001+705+3110=120+180+300+350+330=1280
..

1 2 3 ui
140 300 160
a1 90 2 5 2
30 90 0
2 400 4 1 5
30 300 70 3
3 110 3 6 8
110 2
vj 1 -2 2

.

.

u1+v3=2 u1=0 v3=2


u2+v1=4 v 1=4- u2=4-3=1
u2+v2=1 v2=1-u2=1-3=-2
u2+v3=5 u2=5-v3=5-2=3
u3+v1=3 u3=3- v1=3-1=2


11 =u1 + v1-c11=0+1-2=-1<0
12 =u1 + v2-c12=0-2-5=-7<0
32 =u3 + v2-c32=-2-2-6=-6<0
33 =u3 + v3-c33=-3+2-8=--3<0

, ,
.

3.4.3.

) ai >bj, .. ,
..
.
,
ai -bj.

L(X)= cij xijmin


xij=ai i=1,2,,m+1
xij=bj
xij0, i=1,2,,m+1, j=1,2,,n
) ai <bj, .. , ..
.

, ,
: bj -ai.

L(X)= cij xijmin


xij=ai i=1,2,,m
xij=bj, j=1,2,,n+1
xij0, i=1,2,,m


,
,

, 0.

.
.

240, 40, 110 90.190,40 130
.

7 13 9 8
14 8 7 10
3 15 20 6

.
ai=240+40+110=390 .
bj =90+190+40+130=450 .
ai <bj, ,
=450-390=60 .
20 ..

1 2 3 4 ui
90 190 40 130
a1 240 7 13 9 8 0
130 110
2 40 14 8 7 10 -5
0 40
3 110 3 15 20 6 -2
90 20
60 20 20 20 20 7
60
vj 5 13 12 8

m+ n-1=7, 6,
(2,2) .
:
11 = -2<0 13= 14
21 = = -7<0 24= -4<0
32 = -10<0
1 =-8<0 3 =-1<0 4=-5<0
(1,3) .

13 =14>0:

(1,2) 130 - + (1,3)

(2,2) 0 + - 40 (2,3)

(1,2) 90 + - 40 (1,3)

(2,2) 40 - + (2,3)

1 2 3 4 ui
90 190 40 130
a1 240 7 13 9 8 0
90 40 110
2 40 14 8 7 10 -5
40
3 110 3 15 20 6 -2
90 20
60 20 20 20 20 7
60
vj 5 13 9 8

11 = -2<0
21 = = -14<0 23= -3<0 24= -7<0
32 = -4<0 32 = -4<0 33 = -13<0
1 =-7<0 3 =-4<0 4=-5<0

,
0 90 40 110
0 40 0 0
90 90 0 20


L(Xopt)=3120 ..

, -

1( +) 25 40

5=2+3 8=5+3
5=2+3 8=5+3
5=2+3 8=5+3
- 5=2+3 8=5+3
5 5
2( +) 25 40
( )
() 5=2+3 8=5+3
) 5=2+3 8=5+3
- 5=2+3 8=5+3
5=2+3 8=5+3
5 5
() ( ) 10 20
5 10
5 10



60-72%
73-86%
87-100%
2.5. .
{ }
program minel;
const
GRANICA=10;
var
a:array[1..GRANICA] of integer;{ }
min:integer; { }
i:integer; { , }

begin

{ }

min:=1;{ }
for i:=2 to GRANICA do
if a[i]<a[min] then min:=i;
writeln( :',a[min]);
writeln( :',min);
end.

2.3. ()

program first;
label l,l1;
var
eps,x,d,z,ff,fff:real;
function f(x:real):real;
begin
f:=x*x/2-sin(x);
end;
function df(x:real):real;
begin
df:=x-cos(x);
end;
function ddf(x:real):real;
begin
ddf:=1+sin(x);
end;
begin
writeln('input eps'); readln(eps);
writeln('input initial point'); readln(z);
l:x:=z;
z:=x-df(x)/ddf(x);
writeln(x,' ',z);
if abs(z-x)>eps then goto l;
x:=z; ff:=df(x);d:=ddf(x);fff:=xf(x);
if d>0 then begin writeln('min',ff,'in',x); goto
l1; end;
if d<0 then begin writeln('max',ff,'in',x); goto
l1; end;
l1: writeln('end of program'); readln;
end.