( )
603
-
2013
, , .
. , , , , . Compaq Visual Fortran 6.6.
, , . . . , , . , .
. , , , , . , , , . , .
, , , . , . , , , . , , .
, , . , .
|
|
. , , . , , , . , , .
. .
, , , .
, :
- , ;
- ;
- ;
- ;
- , ;
- , ( ) ;
- , .
1.
, . .
-. ,
S , f (x) [ a, b ] (. .1).
S. . , .
|
,
i - [ a, b ], h = (b a)/ n , n .
|
|
, S (. .3). I
,
(J.Gregory() 1668, Th.Simpson 1743)
, , . .4. [ a, b ] . ,
.
, . . , , [ a, b ]
.
. ( )
.
[ a, b ] f (x) :
- ;
- ;
- .
, , , , . , ( ). , ,
,
Cm , , m (m = 2 m = 4 ).
.
,
,
S (h /2) S (h) , [ a, b ], . , , , .
,
, 0.5%, , h = 0.5, .. [0, 1] 0, 0.5 1.0.
.
(h = 0.25), .. 4 ,
.
,
|
|
,
.
, , : (h = 0.125). 0.6141, 0.0046 0.75%, . , , (h = 0.0625) . 0.6152, 0.0011, 0.18%. , h = 0.0625 , 0.6152, .
, , [ a, b ]. . : [ a, b ], .
. , , . - , . IMSL [6-8], , -
Subroutine Qdags(Fun,a,b,errAbs,errRel,result,errEst).
:
Fun - -, (Real*4);
a, b - (Real*4);
errAbs - (Real*4);
errRel - (Real*4);
result - (Real*4);
errEst - (Real*4).
, . (Real*8) DQdags.
, :
-
Subroutine Priam(a,b,n,Fun,s);
- Subroutine Trap(a,b,n,Fun,s);
- Subroutine Simps(a,b,n,Fun,s).
:
a, b - (Real*4);
n - [ a, b ] (Integer*4);
Fun - -, (Real*4);
s - (Real*4).
Fun
Function Fun(x)
Fun =..........
Return
End
.
0.001.
. Trap, , c :
123456789....
Real*4 I
External F
Open(1, File='res_1.txt')
|
|
pi=3.1416
n=8
Call Trap(0.,pi/2.,n,F,I)
Write(1, 10) I,n
10 Format(' -',F10.6,' n=',I2)
Close(1)
End
! *** ***
Function F(x)
F=4*Sqrt(100*Sin(x)**2+81*Cos(x)**2)
Return
End
, . n = 8, res_1.txt,
- 59.731743 n= 8
n,, , .
2.
, . . . , . .
. , , . , f (x) . y = f (x), . , , . [ a, b ], (. 1). f (x) f (a) f (b) < 0.
. : , , , .
. , . , , f (x).