DAKOTA/Matlab black box interface quick example for rosenbrock test function
Brian M. Adams
11/17/2005; updated 5/11/2009 to include Windows example

FILES: dakota_matlab_rosenbrock.in	sample DAKOTA input file
       dakota_matlab_rosenbrock.out	sample DAKOTA output

       matlab_rosen_bb_simulator.sh     analysis driver script called by DAKOTA
    OR matlab_rosen_bb_simulator.vbs

       matlab_rosen_wrapper.m           matlab wrapper called by script
       rosenbrock.m                     actual analysis driver (your program)
	  
EXECUTION:

This example presumes the Matlab executable is on the path.  If not,
you'll need to modify the matlab_rosen_bb_simulator.* to include the
explicit path to it.

To run the example (minimize rosenbrock function using CONMIN's FRCG alg.):

	dakota -i dakota_matlab_rosenbrock.in
	

Windows Example Step-by-Step:

1. Download DAKOTA binary for Cygwin.  I'd recommend the version without
graphics, unless you have a working Xserver on your machine and want
to mess with
it. (http://www.cs.sandia.gov/dakota/licensing/release/Dakota_4_2.cygwin.zip)
Please register on our download page if you haven't already.  My
example presumes you'll install DAKOTA to C:\Dakota42.

2. Unzip the attached Matlab example in a location of your choosing.
I'll assume C:\matlab_blackbox for convenience.

3. Open a Command Prompt.  Set the PATH to find DAKOTA:
	set PATH=C:\Dakota42\bin;%PATH%
  If this worked, typing 'dakota -v' should give you version information.

4. Start the Matlab automation server (you may need to make sure
Matlab is on your Windows PATH by default or add it locally in the
command window) and wait for the command window to appear (minimized):
  	matlab /automation

5. Run dakota on the sample problem:
	dakota dakota_matlab_rosenbrock.in

What's going on:
*. DAKOTA is repeatedly invoking 'cscript runmat.vbs' for function evaluations

*. This VBS script instructs Matlab to evaluate the
matlab_rosen_wrapper.m, which unpacks the DAKOTA parameters files and
invokes rosenbrock.m, which is a stand-in for your Matlab objective
function.

*. The wrapper then writes the results file for return to DAKOTA.


TO DO:

- Include constraints, gradients, Hessians (if you have analytic
derivatives, you can return them to DAKOTA, though this example
doesn't demonstrate that).
