Excel VBA version of PGSL Version 4.

Copyright (C) Benny Raphael  

PGSL is a global optimisation algorithm developed by Dr. Benny Raphael
Consult the following paper if you are interested.
B. Raphael and I.F.C. Smith, A direct stochastic algorithm for global search, J of Applied Mathematics and Computation, Vol 146, No 2-3, 2003, pp 729-758
Note that there are several modifications to the original algorithm in this version.
Consult the following website for latest developments in PGSL
http://www.geocities.com/bennyraphael/PGSL/index.html
Do not remove this README.txt file if you wish to distribute any applications
developed using PGSL.

-------------------------------------------------------------

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or  any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

-------------------------------------------------------------

How to solve your optimisation problem

1.  Copy PGSL.xls to another file, say, myproblem.xls
2.  Make sure you have Macros in excel.  This is done by
clicking on Tools/Macro/Security and setting Security Level to Medium
3.  Open myproblem.xls.  Enable Macros if the security dialog shows up
4.  In the first column of the sheet Optimisation, under the title "Variables",
	list all your variables without leaving any blank cell
	Enter the text End in the cell immediately after the last variable.
    In the second and third columns of the corresponding rows specify the
	minimum and maximum bounds of each variable
    In the fourth column specify the precision of each variable.  
	Do not set a higher precision than the accuracy you desire.  It might take too long to converge
    In the fifth column (E) you can put some test values for each variable.
    When optimisation runs, PGSL puts values generated for each variable in this column.
    
5.  In the cell to the right side of the cell containing the text "Cost", insert
	the excel formula for computing the objective function.  The formula should be defined
	in terms of values of variables in Column E where PGSL puts values generated for each variable.
	Test the formula by trying out different values of variables in Column E (under the title Optimum)
6.  In Column B next to the cell containing the text Threshold, specify the threshold of the objective function
	If you have no idea about the lower bound of the objective function, specify an impossible low value
7.  In Column B next to the cell containing the text "NumEvaluations", specify the maximum number 
	of evaluations of the objective function.  This value will determine how long the optimiser should
	run.  Note that you will need many evaluations for objective functions involving many variables.
	For example, Griewank's function in 10 variables might require more than 50,000 evaluations.
8. Click on the button "Start optimisation".  When the program terminates you will have the best values
	of variables in Column E.  

If you wish to write your objective function in VB instead of using Excel formula,
Select Tools/Macro/Visual Basic Editor from Excel menu.  Double click on Module1 in the VBA editor.
Search for this line
Function costFunction(x1() As Double)
This function can be modified to implement your objective function.  The argument to the
function, x1, contains the values of variables that are generated by PGSL.  The function
should return the evaluation of the point x1.




