Page 1 of 1

MATLAB2HD script

Posted: Thu Aug 08, 2019 8:42 am
by Charlie.Sheng
Dear all,

I am using the MATLAB script to generate the new HydroDyn input files with the modified certain parameters. but I got problem, and here to seek for help, my code is as followings:

% HydroDyn input file
Hrefer='C:\Users\Desktop\FAST_MATLAB\OC4TC\5MW_Baseline\NRELOffshrBsline5MW_OC4DeepCwindSemi_HydroDyn.dat';
HydroS = HD2Matlab(Hrefer,2); % this contains 2 header lines
% Wave seed
WaS=randi([-2147483648,2147483647],1);
HydroS = SetFASTPar(HydroS,'WaveSeed(1)',WaS);
%Hs
Hs=12;
HydroS = SetFASTPar(HydroS,'WaveHs',Hs);

Hrefer1='C:\Users\Desktop\FAST_MATLAB\OC4TC\5MW_Baseline\NRELOffshrBsline5MW_OC4DeepCwindSemi_HydroDynCS.dat';
Matlab2HD(HydroS,Hrefer,Hrefer1,2); % there are 2 header lines

while I got the error from the MATLAB as follows:

WARNING: ! not found in the HD data structure. Default value listed below (from template file, C:\Users\Desktop\FAST_MATLAB\OC4TC\5MW_Baseline\NRELOffshrBsline5MW_OC4DeepCwindSemi_HydroDyn.dat) will be used instead:
Columns 1 through 13

20.0000 0.6300 0.6300 0 0 0 0 0 0 0 0 0 0

Columns 14 through 21

0 0 0 0 0 0 0 0

WARNING: ! not found in the HD data structure. Default value listed below (from template file, C:\Users\Desktop\FAST_MATLAB\OC4TC\5MW_Baseline\NRELOffshrBsline5MW_OC4DeepCwindSemi_HydroDyn.dat) will be used instead:
Columns 1 through 13

21.0000 0.6300 0.6300 0 0 0 0 0 0 0 0 0 0

Columns 14 through 21

0 0 0 0 0 0 0 0
......

I try to recheck the code many times, while still cannot figure out what is the problem. Any help would be appreciated!

Best regards,
Charlie

Re: MATLAB2HD script

Posted: Wed Oct 16, 2019 4:44 pm
by Bonnie.Jonkman
Hi, Charlie.

I am not exactly sure what the problem is, but the warning message indicates that it thinks there is a variable called "!" in the template that has a value of "20.0000 0.6300 0.6300 0 0 0 0 0 0 0 0 0 0". Perhaps it's not reading a table correctly?

Do you get this problem if you use this template: https://github.com/OpenFAST/matlab-tool ... droDyn.dat

Re: MATLAB2HD script

Posted: Fri Oct 18, 2019 3:03 pm
by Charlie.Sheng
Hi Bonnie,

I figure out the problem. Yes, you are right, when using MATLAB2HD script to modify the parameters in template HydroDyn input files, the '!' cannot be read by the script. With all '!' being deleted, the matlab script will work successfully.

Thanks,
Charlie