Getting Started

This section provides instructions on how to download and install the WEC-Sim code.

MATLAB Toolbox Requirements

WEC-Sim is developed in MATLAB/Simulink, and requires the toolboxes listed below. WEC-Sim’s Simulink Library was saved in Matlab version R2015b, thus it is the oldest WEC-Sim compatible release. Any release newer than R2015b should also be compatible with WEC-Sim.

Required Toolbox Oldest Compatible Version
MATLAB Version 8.6 (R2015b)
Simulink Version 8.6 (R2015b)
Simscape Version 3.14 (R2015b)
Simscape Multibody Version 4.7 (R2015b)

Ensure that the correct version of MATLAB and the required toolboxes are installed by typing ver in the MATLAB Command Window:

>> ver
--------------------------------------------------------------------------------------
MATLAB Version: 9.2.0.556344 (R2017a)
--------------------------------------------------------------------------------------
MATLAB                                                Version 9.2         (R2017a)
Simulink                                              Version 8.9         (R2017a)
Simscape                                              Version 4.2         (R2017a)
Simscape Multibody                                    Version 5.0         (R2017a)

Note

Simscape Multibody was called SimMechanics prior to R2016a

Download WEC-Sim

There are three ways of obtaining the WEC-Sim code which is distributed through the WEC-Sim GitHub repository:

Install WEC-Sim

Once you have downloaded the WEC-Sim source code, take the following steps to install the WEC-Sim code:

Step 1. Add WEC-Sim Source Code to MATLAB Path

Open the $wecSim/wecSimStartup.m file ($wecSim refers to WEC-Sim source code directory).

% Set the wecSimPath variable to the location of the WEC-Sim source directory
% Copy the code in this file and place it in your'startup.m' file

wecSimPath = <wecSim>;
addpath(genpath(wecSimPath));

Copy the code in the wecSimStartup.m shown above and paste it into the startup.m file located in the MATLAB Startup Folder. Set the wecSimPath variable to the $wecSim folder and open the startup.m file by typing open startup.m into the MATLAB Command Window:

>> open startup.m

Verify the path was set up correctly by checking that the WEC-Sim source directory ($wecSim) is listed in the MATLAB. This is done by typing path into the MATLAB Command Window:

>> path