home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C!T ROM 2
/
ctrom_ii_b.zip
/
ctrom_ii_b
/
PROGRAM
/
PASCAL
/
NRPAS13
/
RTSEC.DEM
< prev
next >
Wrap
Text File
|
1991-04-29
|
707b
|
39 lines
PROGRAM d9r6(input,output);
(* driver for routine RTSEC *)
CONST
n=100;
nbmax=20;
x1=1.0;
x2=50.0;
TYPE
glnbmax = ARRAY [1..nbmax] OF real;
VAR
i,nb : integer;
root,xacc : real;
xb1,xb2 : glnbmax;
(*$I MODFILE.PAS *)
(*$I BESSJ0.PAS *)
FUNCTION fx(x: real): real;
BEGIN
fx := bessj0(x)
END;
(*$I ZBRAK.PAS *)
(*$I RTSEC.PAS *)
BEGIN
nb := nbmax;
zbrak(x1,x2,n,xb1,xb2,nb);
writeln;
writeln('roots of bessj0:');
writeln('x':20,'f(x)':15);
FOR i := 1 to nb DO BEGIN
xacc := (1.0e-6)*(xb1[i]+xb2[i])/2.0;
root := rtsec(xb1[i],xb2[i],xacc);
writeln(' root ',i:2,' ',root:12:6,fx(root):14:6)
END
END.