PROGRAM FINDROT C======================================================================= C FIND ROOT OF THE FOLLOWING FUNCTIONS C COSH(LAMBDA)*COS(LAMBDA)+1=0 FOR CANTILEVER C COSH(LAMBDA)*COS(LAMBDA)-1=0 FOR FREE-FREE BEAM C======================================================================= IMPLICIT REAL*8 ( A-H , O-Z ) PARAMETER ( MXN=1200, DX=0.001D0, DXNEWTON=DX/10.D0 ) DIMENSION ROOT(MXN) C---------- DX = INCREMENTAL VALUE C======================================================================= EPS = 1.D-14 C======================================================================= C------ INITIALIZATION X = DX NROOT = 0 F0 = FX (X) C DO WHILE ( X .LT. 200.D0 ) X = X + DX F1 = FX (X) IF ( F0*F1 .LT. 0.D0 ) THEN CALL NEWTON ( X-DX, DXNEWTON, FLAMBDA, EPS ) NROOT = NROOT + 1 ROOT(NROOT) = FLAMBDA END IF F0 = F1 END DO C OPEN ( 1, FILE='ROOT.DAT', STATUS='UNKNOWN' ) DO I = 1 , NROOT WRITE (1,*) ROOT (I) WRITE (*,*) ROOT (I) END DO CLOSE (1) C======================================================================= STOP 'NORMAL TERMINATION' END C C SUBROUTINE NEWTON (X0, DX, X, EPS ) IMPLICIT REAL*8 ( A-H , O-Z ) X = X0 DELTAX = X DO WHILE ( DABS(DELTAX/X) .GT. EPS ) DFDX = (FX(X+DX)-FX(X-DX))/(2.D0*DX) DELTAX = - FX(X)/DFDX X = X + DELTAX END DO RETURN END C C FUNCTION FX(FLAMBDA) IMPLICIT REAL*8 ( A-H , O-Z ) FX = COSH(FLAMBDA)*COS(FLAMBDA)+1.D0 RETURN END