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 MATLAB release compatible with WEC-Sim. Any release newer than R2015b should be compatible with WEC-Sim. We recommend running WEC-Sim in MATLAB 2016b or newer.

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: (R2017b)
MATLAB                                                Version 9.3         (R2017b)
Simulink                                              Version 9.0         (R2017b)
Simscape                                              Version 4.3         (R2017b)
Simscape Multibody                                    Version 5.1         (R2017b)


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 $SOURCE/wecSimStartup.m file ($SOURCE 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>;

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