ROSENBRH Translation Listing


      PROBLEM ROSENBRH(10000,1000) ! Solver Hera
      !-------------------------------------------------------------|
      ! Unconstrained Optimizer test problem - Rosenbrock function  |
      ! A contour graph is generated to compare the search patterns |
      ! of different solvers graphically.                           |
      !-------------------------------------------------------------|
      ! Hera: Newton Eigenvector Direction Selection Method         |
      !-------------------------------------------------------------|
        @ROSENG
        X=-1.2 : Y=1     ! Traditional starting point
        FIND X,Y; IN ROSEM(X,Y,R); BY HERA(SET); TO MINIMIZE R
        @SHOW('ROSEB','Hera Rosenbrock Optimization')
      END

      CONTROLLER SET(HERA)
        CONVERGE=2
        DETAIL=1    ! Detailed report for every iteration
        DETOUT=0    ! Detailed report to DETAIL stream
        SUMOUT=1    ! Summary report to SUMMARY stream
      END

      MODEL ROSEM(X,Y,R)
        !-----------------------------------------------------------|
        ! Formula defining the objective function surface           |
        !-----------------------------------------------------------|
        R=100*(Y-X**2)**2+(1-X)**2
        @CURVE('ROSEB','SR',X,Y)
      END

      PROCEDURE ROSENG  ! Contour graph generator
      !-------------------------------------------------------------|
      !          Procedure to setup graphics output                 |
      !-------------------------------------------------------------|   
        DIMENSION CONS(8),LABL(8),LTYP(8),KLR(8)
        DATA X1,X2,Y1,Y2/-2.5,2.5,-1.5,3.5/
        DATA XA,XB,YA,YB/-1.5,1.5,-0.5,1.5/
        DATA CONS/0,.5,1,2,4,10,16,18/
        DATA LABL/0,1,0,1,0,1,0,1/
        DATA LTYP/0,2,0,2,0,2,0,2/
        DATA KLR /3,3,3,3,3,3,3,3/
        EXTERNAL ROSY
        N=101
        XO=XA
        YO=YA
        @GRAFIL('ROSEB','SUM','IMAGE',0,0)
        @FONT('ROSEB','COMPLEX','STANDARD',0,1) ! Default charsize & color 
        @XYPLOT('ROSEB','RECT',X1,X2,X1,.5,Y1,Y2,Y1,.5,1.0,0,0,0,0)
        @MESH('ROSEB','CS',XA,XB,YA,YB,N,N,ROSY)
        @HEAD('ROSEB','ROSENBROCK FUNCTION',50,40,10)
        @HEAD('ROSEB','SOLVER HERA',50,100,10)
        @CONTOUR('ROSEB','CS',CONS,LABL,KLR,LTYP,8)
        @SETUP('ROSEB','SR',0,2,-5,1)
      END

      FUNCTION ROSY(X,Y)  ! Contour graph function
        ROSY=100.*(Y-X**2)**2+(1-X)**2
      END