%% Simulation Data
simu = simulationClass();               %Create the Simulation Variable
simu.simMechanicsFile = 'wec2.slx';    %Location of Simulink Model File
% simu.mcrCaseFile='batch.mat';
simu.mode = 'normal';                   %Specify Simulation Mode ('normal','accelerator','rapid-accelerator')
simu.explorer='on';                     %Turn SimMechanics Explorer (on/off)
simu.solver = 'ode4';                   %simu.solver = 'ode4' for fixed step & simu.solver = 'ode45' for variable step 
simu.dt = 0.005; 						%Simulation time-step [s]
simu.rampTime = 100;                       %Wave Ramp Time Length [s]
simu.startTime = 0;                     %Simulation Start Time [s]
simu.endTime = 1000;                    %Simulation End bdcloseTime [s]
simu.b2b  = 0;                          %Body-to-body interactions
simu.rho = 1025;                        %Water density - default = 1000 ! 
simu.nlHydro = 0;                       %Non-linear FK force
simu.ssCalc = 0;						%Control option to use state space model 
simu.CITime=100;
% simu.dtFeNonlin=1*simu.dt;            %Non-linear FK force time-step
simu.paraview=0;                        %Output files for visualisation in Paraview (0-No ; 1-Yes)
simu.domainSize=25;                     %Side-length of the square domain for viewing
simu.dtOut = 0.05;

if simu.paraview == 1
    waves.viz.numPointsX = 50;
    waves.viz.numPointsY = 5;
end
%% Wave Information 
%% noWaveCIC, no waves with radiation CIC  
% waves = waveClass('noWaveCIC');       %Create the Wave Variable and Specify Type      

%% Regular Waves  
% waves = waveClass('regularCIC');        %Create the Wave Variable and Specify Type                               
% waves.H = 3;                          %Wave Height [m]
% waves.T = 16;                            %Wave Period [s]

%% Irregular Waves using PM Spectrum with Convolution Integral Calculation
waves = waveClass('irregular');       %Create the Wave Variable and Specify Type
waves.H = 1.75;                       %Significant Wave Height [m]
waves.T = 5;                         %Peak Period [s]
waves.waveDir = 0;
waves.spectrumType = 'BS';
waves.phaseSeed = 5;%randi(99,1);

%% Irregular Waves using User-Defined Spectrum
% waves = waveClass('irregularImport');  %Create the Wave Variable and Specify Type
% waves.spectrumDataFile = 'ndbcBuoyData.txt';  %Name of User-Defined Spectrum File [2,:] = [omega, Sf]

%% User-Defined Time-Series
% waves = waveClass('userDefined');     %Create the Wave Variable and Specify Type
% waves.etaDataFile = 'umpqua46229_6_2008.mat'; % Name of User-Defined Time-Series File [:,2] = [time, wave_elev]

%% Body Data
%% Float
body(1) = bodyClass('.\hydro\wec2.h5');      
body(1).mass = 730e3;                   
body(1).momOfInertia = [6.4e6 6.4e6 1.0e7];          %Moment of Inertia [kg*m^2]     
body(1).geometryFile = '.\geometry\wec2.stl';    %Location of Geomtry File

%% PTO and Constraint Parameters
% %% Rigid Connection
% constraint(1) = constraintClass('Constraint1'); %Create Constraint Variable and Set Constraint Name
% constraint(1).loc = [0 0 -70];                  %Constraint Location [m]

% Translational PTO
pto(1) = ptoClass('PTO1');                      %Create PTO Variable and Set PTO Name
pto(1).k=0;                                     %PTO Stiffness [N/m]
pto(1).c=0;                                     %PTO Daming [N/(m/s)]
pto(1).loc = [0 0 -70];                         %PTO Location [m]
pto_pretens=-(8.4924e+05)*9.81;                 %PTO pre-tension [N]