implementation
//PROGRAM D12R1
//Driver for routine RK4
uses
unit2;
{$R *.DFM}
procedure DERIVS(X:real; Y:array of real;var DYDX:array of real);
begin
DYDX[1]:= -Y[2];
DYDX[2]:= Y
Procedure ZBRAC(var X1, X2:real; SUCCES:boolean);
var
NTRY,J:integer; FACTOR,F1,F2:real;
begin
FACTOR:=1.6;
NTRY:=50;
If X1 = X2 Then ShowMessage('you have to guess an initial r
Function RTSEC(X1, X2, XACC:real):real;
Label 99;
var
MAXIT,J:integer; FL,F,SWAP,XL,DX,RTS:real;
begin
MAXIT:=30;
FL:=FUN(X1);
F:=FUN(X2);
If Abs(FL) < Abs(F) Then
be
Function RTNEWT(X1, X2, XACC:real):real;
Label 99;
var
J,JMAX:integer; DX,RTN,F,DF:real;
begin
JMAX:=20;
RTN:=0.5 * (X1 + X2);
For J:=1 To JMAX do
begin
FUND(RTN,