1. Setup

1.1. Dependencies

The following table displays the required and optional dependencies for WecOptTool.

Dependency Website Required?*
MATLAB https://www.mathworks.com/products/matlab.html yes [1]
MATLAB Optimization Toolbox https://www.mathworks.com/products/optimization.html yes
NEMOH https://github.com/LHEEA/Nemoh yes
WAFO https://github.com/wafo-project/wafo optional
MATLAB Parallel Computing Toolbox https://www.mathworks.com/products/parallel-computing.html optional
MATLAB Global Optimization Toolbox https://www.mathworks.com/products/global-optimization.html optional
* The values in the Required column have the following meanings:
  • yes indicates dependencies that must be installed to use the WecOptTool toolbox
  • optional indicates dependencies that are used on a case by case basis, in the examples

1.2. Download

Get the stable version

The latest stable version of WecOptTool can be downloaded by clicking HERE.

Details of this and previous stable releases can be found in the Releases section of the GitHub repository.


Get the development version

To get the latest development version of WecOptTool, clone or download the WecOptTool GitHub repository using the ‘Clone or download’ button.

Note that, although the developers endeavor to ensure that the development version is not broken, bugs or unexpected behavior may occur, so please beware.

Please see the “Contributing” section of the source code’s README.md file for details on how to contribute to the code development.


1.3. Install

Note

Unexpected behavior may occur if multiple versions of the toolbox are installed. Please following the Uninstall instructions to uninstall any previous versions of WecOptTool first.

  1. Download the WecOptTool software: See the Download section. If required, unzip the archive to a path of your choosing (i.e. /path/to/WecOptTool).

  2. Add WecOptTool to your MATLAB path: Add the WecOptTool toolbox to your MATLAB path using the MATLAB command prompt:

    >> addpath(genpath('/path/to/WecOptTool/toolbox'));
    >> savepath;
    

    Alternatively the “Set Path” graphical tool can be used to add the toolbox.

  3. Prepare Nemoh: Follow the OS dependent instructions for setting up NEMOH:

    Windows

    Executables are provided in the ‘Release’ directory of the NEMOH source code. These are installed into WecOptTool using the installNemoh.m MATLAB script, run from the WecOptTool root directory, using the MATLAB command prompt as follows:

    >> cd /path/to/WecOptTool
    >> installNemoh('/path/to/NEMOH/Release');
    

    Linux

    To set up NEMOH for Linux, first, use a command window to compile the executables (you will need gfortran or the Intel FORTRAN compiler):

    $ cd /path/to/NEMOH
    $ make
    

    Executables will be created a new directory called ‘bin’, which must then be installed into WecOptTool using the installNemoh.m MATLAB script, run from the WecOptTool root directory using the MATLAB command prompt:

    >> cd /path/to/WecOptTool
    >> installNemoh('/path/to/NEMOH/bin');
    

  4. Verify dependencies installation: You can verify that the dependencies have been installed correctly by running the dependencyCheck.m script provided in the root directory of the WecOptTool source code. The script is called as follows using the MATLAB command prompt:

    >> cd /path/to/WecOptTool
    >> dependencyCheck
    

    and successful output may look like this:

    WecOptTool Dependency Checker
    -------------------------------
    
    Required
    --------
    Optimization Toolbox:                   Found
    NEMOH:                                  Found
    
    Optional
    --------
    Parallel Toolbox:                       Found
    Global Optimization Toolbox:    Not Installed
    WAFO:                                   Found
    
  5. (optional) Run functionality tests: A test suite is available to verify that the code is operational.

    A script is provided in the root directory of the WecOptTool source code and is run from the MATLAB command window, as follows:

    >> cd /path/to/WecOptTool
    >> runTests;
    

    There should be no Failed or Incomplete tests at the end of the run. For example:

    Totals:
       91 Passed, 0 Failed, 0 Incomplete.
       195.0643 seconds testing time.
    

1.4. Uninstall

Uninstall a previous version of WecOptTool using the MATLAB command prompt:

>> rmpath(genpath('/path/to/WecOptTool/toolbox'));

Alternatively the “Set Path” graphical tool can be used to remove the toolbox.

Footnotes

[1]The WecOptTool developers are endeavoring to ensure that this software is compatible with the latest version of MATLAB (and the toolbox dependencies). Unfortunately, this may mean that backwards compatibility with older versions of MATLAB is not possible. See the MATLAB Version Support Policy page for further details.