Mlife error during compilation

Hi everyone,

I’m working on the 5 MW basic model due to an University project. I encounter some errors during Mlife execution and I’m not sure what is going on and why it’s failing.

Here is the error code:

Index exceeds the number of array elements (1).

Error in read_value (line 67)
varargout{1}{i} = cell2mat( temp(i) );

Error in read_settings (line 802)
temp = read_value( ParamFile{1}{PLine+iFile}, ‘string’ , 2, ‘’, ‘’, fidEcho );

Error in mlife (line 246)
[ Statistics, FileInfo, Fatigue ] = read_settings( settingsFile, dataDirectory );

Attached you will find my Mlife file if it helps.

Thank you very much in advance
Martintxo

PS: Seems like there is an error attaching files, here is the transcripted code:

----- MLife version 1.0 Input File -------------------------------------------
MLife_template Test#09
----- Job Options ------------------------------------------------------------
true EchoInp Echo input to .echo as this file is being read.
true StrNames Use channel names following a “$” instead of numbers when specifying channels in this input file.
false OutData Output modified data array after scaling and calculated channels. (currently unavailable)
“%6.2e” RealFmt Format for outputting floating-point values.
“Mlife_template_copia_raiz_pala_torre” RootName Root name for aggregate output files.
----- Input-Data Layout ------------------------------------------------------
5 TitleLine The row with the file title on it (zero if no title is available).
0 NamesLine The row with the channel names on it (zero if no names are available or are specified below).
0 UnitsLine The row with the channel units on it (zero if no units are available or are specified below).
9 FirstDataLine The first row of data.
38 NumChans The number of channels in each input file.
ChanTitle ChanUnits Scale Offset PSFtype NumCols rows of data follow. Title and units strings must be 10 characters or less.
“Time” “(s)” 1 0 0
“Wind1VelX” “(m/s)” 1 0 0
“Wind1VelY” “(m/s)” 1 0 0
“Wind1VelZ” “(m/s)” 1 0 0
“RotSpeed” “(rpm)” 1 0 0
“GenSpeed” “(rpm)” 1 0 0
“Azimuth” “(deg)” 1 0 0
“BldPitch1” “(deg)” 1 0 0
“ldPitch2” “(deg)” 1 0 0
“BldPitch3” “(deg)” 1 0 0
“OoPDefl1” “(m)” 1 0 0
“IPDefl1” “(m)” 1 0 0
“TwstDefl1” “(deg)” 1 0 0
“RootFxb1” “(kN)” 1 0 0
“RootFyb1” “(kN)” 1 0 0
“RootFzb1” “(kN)” 1 0 0
“RootMxb1” “(kN-m)” 1 0 0
“RootMyb1” “(kN-m)” 1 0 0
“RootMzb1” “(kN-m)” 1 0 0
“YawBrFxp” “(kN)” 1 0 0
“YawBrFyp” “(kN)” 1 0 0
“YawBrFzp” “(kN)” 1 0 0
“YawBrMxp” “(kN-m)” 1 0 0
“YawBrMyp” “(kN-m)” 1 0 0
“YawBrMzp” “(kN-m)” 1 0 0
“TwrBsFxt” “(kN)” 1 0 0
“TwrBsFyt” “(kN)” 1 0 0
“TwrBsFzt” “(kN)” 1 0 0
“TwrBsMxt” “(kN-m)” 1 0 0
“TwrBsMyt” “(kN-m)” 1 0 0
“TwrBsMzt” “(kN-m)” 1 0 0
“LSShftFxa” “(kN)” 1 0 0
“LSShftFya” “(kN)” 1 0 0
“LSShftFza” “(kN)” 1 0 0
“RotTorq” “(kN-m)” 1 0 0
“RotPwr” “(kN)” 1 0 0
“GenPwr” “(kW)” 1 0 0
“GenTq” “(kN-m)” 1 0 0
----- Calculated Channels ----------------------------------------------------
0 NumCChan The number calculated channels to generate.
1234567890 Seed The integer seed for the random number generator (-2,147,483,648 to 2,147,483,647)
Col_Title Units Equation Put each field in quotes. Titles and units are limited to 10 characters. NumCChan rows of data follow.
----- Load Roses -------------------------------------------------------------
0 NumRoses The number of load roses to generate.
Rose Name Units Channel1 Channel2 nSectors
----- Time and Wind Speed ----------------------------------------------------
1 TimeChan The channel containing time.
2 WSChan The primary wind-speed channel (used for mean wind speed and turbulence intensity, 0 for none)
----- Statistics and Extreme Events ------------------------------------------
true DoStats Generate statistics of all the channels.
false WrStatsTxt Write the stats to a text file?
true WrStatsXLS Write the stats to an Excel file?
0 NumSFChans Number of channels that will have summary statistics generated for them.
SFChans List of channels that will have summary statistics generated for them. Must number NumSFChans.
----- Distributions -----------------------------------------------------------
false UserDistrib User defined distribution? true = load user-specified distribution, false = only use Weibull wind distribution
2 WeibullShape Weibull shape factor. If WeibullShape=2, enter the mean wind speed for WeibullScale.
8.5 WeibullScale Weibull scale factor. If WeibullShape<>2. Otherwise, enter the mean wind speed.
3 WSin Cut-in wind speed for the turbine.
25 WSout Cut-out wind speed for the turbine.
30 WSmax Maximum wind speed value for the wind-speed bins.
2 WSMaxBinSize Maximum width of a wind-speed bin.
0 nDistribVars Number of independent variables in the user-specified distribution, ignored if UserDistrib = false
“” DistribName Filename of the user-supplied distribution table, ignored if UserDistrib = false
----- Fatigue ----------------------------------------------------------------
12 nFatigueChannels The number of fatigue channels. Next six lines ignored if zero.
0.01 FiltRatio The fraction of the maximum range of each channel used as a cutoff range for the racetrack filter. Use zero for no filter.
630720000 DesignLife Number of seconds in the design lifetime (20 years = 630720000 seconds).
1 Availability Fraction of the design life the turbine is operating when winds are between Vin and Vout
false BinCycles Bin the rainflow cycles?
0.5 UCMult Multiplier for binning unclosed cycles. (0 discards, 1 counts as a full cycle)
true DoShortTerm Compute simple (unweighted) damage-equivalent loads and damage rates.
true DoLife Do lifetime-related calculations?
true DoAggregate Compute a DELs and a damage result based on an aggregate of all the input files (does not use the wind spped distribution)
false WrShortTermTxt Write short-term results to plain-text files?
true WrShortTermXLS Write short-term resultsto an Excel workbook?
false WrLifeTxt Write lifetime results to plain-text files?
true WrLifeXLS Write lifetime results to an Excel workbook?
0.0158 EquivalentFrequency The frequency of the damage equivalent load (Hz)
true DEL_AsRange true = report DELs as a range value, false = report as a one-sided amplitude
3 DEL_Type 1 = fixed mean, 2 = zero mean, 3 = both
2 GoodmanFlag 0 = no Goodman correction, 1 = use Goodman correction, 2 = compute results with and without Goodman correction
Channel# NSlopes SNslopeLst BinFlag BinWidth/Number TypeLMF LUlt BinWidth not used when BinCycles is false. nFatigueChannels rows of data follow. LUlt >> LMF
$RootFxb1$ 1 10 BN 200 WM 699
$RootFyb1$ 1 10 BN 200 WM 367
$RootFzb1$ 1 10 BN 200 WM 1155
$RootMxb1$ 1 10 BN 200 WM 8642
$RootMyb1$ 1 10 BN 200 WM 19349
$RootMzb1$ 1 10 BN 200 WM 752
$TwrBsFxt$ 2 4 7 BN 200 WM 2687
$TwrBsFyt$ 2 4 7 BN 200 WM 380
$TwrBsFzt$ 2 4 7 BN 200 WM 7781
$TwrBsMxt$ 2 4 7 BN 200 WM 31951
$TwrBsMyt$ 2 4 7 BN 200 WM 2
$TwrBsMzt$ 2 4 7 BN 200 WM 11569
2 NumDELGroups
Name NChannels ChannelList
“Blade loads” 6 1 2 3 4 5 6
“Tower loads” 6 7 8 9 10 11 12
----- Input Files ------------------------------------------------------------
2 FileFormat Format of input files. 1 = FAST ascii, 2 = FAST binary
72 1.1 1.3 1.5 1.7 (Weibull-Weighted Normal Operation: NumNormFiles, PSF1, PSF2, PSF3, PSF4)
“1dlc12a.outb”
“1dlc12b.outb”
“1dlc12c.outb”
“1dlc12d.outb”
“1dlc12e.outb”
“1dlc12f.outb”
“1dlc12g.outb”
“1dlc12h.outb”
“1dlc12i.outb”
“1dlc12j.outb”
“1dlc12k.outb”
“1dlc12l.outb”
“2dlc12a.outb”
“2dlc12b.outb”
“2dlc12c.outb”
“2dlc12d.outb”
“2dlc12e.outb”
“2dlc12f.outb”
“2dlc12g.outb”
“2dlc12h.outb”
“2dlc12i.outb”
“2dlc12j.outb”
“2dlc12k.outb”
“2dlc12l.outb”
“3dlc12a.outb”
“3dlc12b.outb”
“3dlc12c.outb”
“3dlc12d.outb”
“3dlc12e.outb”
“3dlc12f.outb”
“3dlc12g.outb”
“3dlc12h.outb”
“3dlc12i.outb”
“3dlc12j.outb”
“3dlc12k.outb”
“3dlc12l.outb”
“4dlc12a.outb”
“4dlc12b.outb”
“4dlc12c.outb”
“4dlc12d.outb”
“4dlc12e.outb”
“4dlc12f.outb”
“4dlc12g.outb”
“4dlc12h.outb”
“4dlc12i.outb”
“4dlc12j.outb”
“4dlc12k.outb”
“4dlc12l.outb”
“5dlc12a.outb”
“5dlc12b.outb”
“5dlc12c.outb”
“5dlc12d.outb”
“5dlc12e.outb”
“5dlc12f.outb”
“5dlc12g.outb”
“5dlc12h.outb”
“5dlc12i.outb”
“5dlc12j.outb”
“5dlc12k.outb”
“5dlc12l.outb”
“6dlc12a.outb”
“6dlc12b.outb”
“6dlc12c.outb”
“6dlc12d.outb”
“6dlc12e.outb”
“6dlc12f.outb”
“6dlc12g.outb”
“6dlc12h.outb”
“6dlc12i.outb”
“6dlc12j.outb”
“6dlc12k.outb”
“6dlc12l.outb”
3 1.1 1.3 1.5 1.7 (Weibull-Weighted Idling: NumIdleFiles, PSF1, PSF2, PSF3, PSF4)
“dlc41a.outb”
“dlc41b.outb”
“dlc41c.outb”
12 1.2 1.3 1.4 1.6 (Discrete Events: NumDiscFiles, PSF1, PSF2, PSF3, PSF4)9 NumFiles The number of input files to read.
“1dlc61_2ms.outb”
“1dlc61_27ms.outb”
“2dlc61_2ms.outb”
“2dlc61_27ms.outb”
“3dlc61_2ms.outb”
“3dlc61_27ms.outb”
“4dlc61_2ms.outb”
“4dlc61_27ms.outb”
“5dlc61_2ms.outb”
“5dlc61_27ms.outb”
“6dlc61_2ms.outb”
“6dlc61_27ms.outb”
==EOF== DO NOT REMOVE OR CHANGE. MUST COME JUST AFTER LAST LINE OF VALID INPUT.

Dear Martintxo,

I would guess there is problem with the format of your input file, but it is not obvious to me what that is after my quick review. It appears that you are generating an echo file. Can you review the *.echo file and compare it with your input file to see if everything is being read in properly or if there is a formatting issue (e.g., a missing or extra line)?

Best regards,

Dear Jason,

Thanks for your reply. I see no differences between the .echo file and the .mlif. I have no clue about where is the error, apparently input is OK.

Just in case the .outb files didn’t have 38 channels, I have retried the analysis with few wind files which I am 100% sure they have the same channels as specified in the .mlife file, and still not working. Nevertheless by doing that the error message is in computing fatigue.

Dear Martintxo,

The first error you were reporting was associated with reading in the MLife input file. So, if you are getting in error about the fatigue calculation, presumably you have solved the first error (at least with fewer *.outb files). Are there specific *.outb files that result in the first error?

What new error regarding fatigue calculation are you getting?

Best regards,

Dear Jason, dear Martintxo,

I have also received an error message while running Matlab with the MLife codes which might fit to the topic discussed here before. This is the error Matlab displayed:

Index exceeds the number of array elements (256).

Error in compute_windspeed_bins (line 56)
Fatigue.TimePP(WSbin) = Fatigue.TimePP(WSbin) +
Fatigue.ElapTime(iFile);

Error in mlife (line 565)
Fatigue = compute_windspeed_bins(Fatigue,
windChannelMeans,FileInfo.DLCs(1).NumFiles,
FileInfo.DLCs(2).NumFiles );

Error in MLife_Runfile (line 7)
[Fatigue, Stastistics] = mlife(settingsFile, outputDirectory);

As the statistics were generated before the error, I have checked the values and they were not reasonable. Before, I used the same settings and files but didn’t inserted the input-file channels (beginning in line 16) and no error occurred and the results were reasonable.
I also followed the advice to check the echo-file but I haven’t seen any differences and using other files is not changing the occurrence of the error.

I have attached the files I used. Maybe this is helping you to solve our/my error.
Thanks a lot in advance
Sören
MLife_SLink.zip (1.9 MB)

Dear Soeren, Dear Martintxo,

I’m not sure how to help. There is no active development on MLife at NREL right now and the original developers are no longer working here. There is some active effort to develop capability similar to MCrunch, MLife, and MExtremes in Python, but this is not complete yet.

Could one or both of you spend some time debugging this to see if a bug can be found? I don’t have time to debug this myself.

Best regards,

Dear Soeren,

Thanks for your reply and for your efforts. Unfortunately still doesn’t work for me although I tried your changes.

I will continue struggling and if I get any result I will let you know.

Best regards

Hi all,

I still working with that error but no success I must admit. Nevertheless I found another error code:

[code]Error using rainflow (line 67)
Too many input arguments.

Error in compute_fatigue_per_DEL_type (line 118)
cycles = rainflow(double(peaks), abs( double(lmf)), double(Fatigue.ChanInfo(iCh).LUlt),
double(Fatigue.UCMult))';

Error in compute_no_goodman_fatigue (line 25)
[aggEquivalentCycles, lifetimeEquivalentCycles, ChannelBasedResults, FileBasedResults] =
compute_fatigue_per_DEL_type( DEL_Type, DLCs, DLC_Occurrences, nFatigueChannels, nFiles,
windChannelMeans, Fatigue );

Error in compute_fatigue (line 77)
Fatigue = compute_no_goodman_fatigue(nFiles, Fatigue, FileInfo.DLCs, FileInfo.DLC_Occurrences,
windChannelMeans);

Error in mlife (line 602)
Fatigue = compute_fatigue( FileInfo, Fatigue, windChannelMeans );[/code]

First thing I thought is that it could be some differences between the input code and the .out files from wind, but all of them are exactly the same. Channels definition is also right and everything seems to match. Not sure what’s going on with that mistake…

Dear Jason,

I am attempting to run MLife but receive the following Matlab error:

Kindly see below the .mlif settings file I am using:

Thanks for your help.
Best regards,
Matthew

----- MLife version 1.0 Input File -------------------------------------------
Test#01
----- Job Options ------------------------------------------------------------
true EchoInp Echo input to .echo as this file is being read.
true StrNames Use channel names following a “$” instead of numbers when specifying channels in this input file.
false OutData Output modified data array after scaling and calculated channels. (currently unavailable)
“%6.2e” RealFmt Format for outputting floating-point values.
“MLife_FirstTest” RootName Root name for aggregate output files.
----- Input-Data Layout ------------------------------------------------------
5 TitleLine The row with the file title on it (zero if no title is available).
0 NamesLine The row with the channel names on it (zero if no names are available or are specified below).
0 UnitsLine The row with the channel units on it (zero if no units are available or are specified below).
9 FirstDataLine The first row of data.
53 NumChans The number of channels in each input file.
ChanTitle ChanUnits Scale Offset PSF_Type NumCols rows of data follow. Title and units strings must be 10 characters or less.
“Time” “(s)” 1.0 0.0 0
“Wind1VelX” “(m/s)” 1.0 0.0 0
“Azimuth” “(deg)” 1.0 0.0 0
“BldPitch1” “(deg)” 1.0 0.0 0
“GenSpeed” “(rpm)” 1.0 1.0 0
“IPDefl1” “(m)” 1.0 0.0 0
“LSSGagMya” “(kN-m)” 1.0 0.0 0
“LSSGagMza” “(kN-m)” 1.0 0.0 0
“OoPDefl1” “(m)” 1.0 0.0 0
“PtfmPitch” “(deg)” 1.0 0.0 0
“PtfmRoll” “(deg)” 1.0 0.0 0
“PtfmSurge” “(m)” 1.0 0.0 0
“PtfmSway” “(m)” 1.0 0.0 0
“RootFxc1” “(kN)” 1.0 0.0 0
“RootFyc1” “(kN)” 1.0 0.0 0
“RootFzc1” “(kN)” 1.0 0.0 0
“RootMxc1” “(kN-m)” 1.0 0.0 0
“RootMyc1” “(kN-m)” 1.0 0.0 0
“RootMzc1” “(kN-m)” 1.0 0.0 0
“RotSpeed” “(rpm)” 1.0 0.0 0
“RotTorq” “(kN-m)” 1.0 0.0 0
“Spn2MLxb1” “(kN-m)” 1.0 0.0 0
“Spn2MLyb1” “(kN-m)” 1.0 0.0 0
“TTDspTwst” “(deg)” 1.0 0.0 0
“TwHt1TPxi” “(m)” 1.0 0.0 0
“TwHt1TPyi” “(m)” 1.0 0.0 0
“TwstDefl1” “(deg)” 1.0 0.0 0
“YawBrFxp” “(kN)” 1.0 0.0 0
“YawBrFyp” “(kN)” 1.0 0.0 0
“YawBrFzp” “(kN)” 1.0 0.0 0
“YawBrMxp” “(kN-m)” 1.0 0.0 0
“YawBrMyp” “(kN-m)” 1.0 0.0 0
“YawBrMzp” “(kN-m)” 1.0 0.0 0
“RtAeroFxh” “(N)” 1.0 0.0 0
“RtAeroFyh” “(N)” 1.0 0.0 0
“RtAeroFzh” “(N)” 1.0 0.0 0
“RtAeroMxh” “(N-m)” 1.0 0.0 0
“RtAeroMyh” “(N-m)” 1.0 0.0 0
“RtAeroMzh” “(N-m)” 1.0 0.0 0
“RtVAvgxh” “(m/s)” 1.0 0.0 0
“RtAeroCp” “(-)” 1.0 0.0 0
“RtTSR” “(-)” 1.0 0.0 0
“GenPwr” “(kW)” 1.0 0.0 0
“GenTq” “(kN-m)” 1.0 0.0 0
“Wave1Elev” “(m)” 1.0 0.0 0
“M2N1MKxe” “(Nm)" 1.0 0.0 0
“M2N1MKye” "(N
m)” 1.0 0.0 0
“M1N1MKxe” “(Nm)" 1.0 0.0 0
“M1N1MKye” "(N
m)” 1.0 0.0 0
“-ReactFXss” “(N)” 1.0 0.0 0
“-ReactFYss” “(N)” 1.0 0.0 0
“-ReactFZss” “(N)” 1.0 0.0 0
“-ReactMXss” “(Nm)” 1.0 0.0 0
“-ReactMYss” “(Nm)” 1.0 0.0 0
“-ReactMZss” “(Nm)” 1.0 0.0 0
----- Calculated Channels ----------------------------------------------------
0 NumCChan The number calculated channels to generate.
1234567890 Seed The integer seed for the random number generator (-2,147,483,648 to 2,147,483,647)
Col_Title Units Equation Put each field in quotes. Titles and units are limited to 10 characters. NumCChan rows of data follow.
----- Load Roses -------------------------------------------------------------
0 NumRoses The number of load roses to generate.
Rose Name Units Channel1 Channel2 nSectors
----- Time and Wind Speed ----------------------------------------------------
$Time$ TimeChan The channel containing time.
$WindVel1X$ WSChan The primary wind-speed channel (used for mean wind speed and turbulence intensity, 0 for none)
----- Statistics and Extreme Events ------------------------------------------
false DoStats Generate statistics of all the channels.
true WrStatsTxt Write the stats to a text file?
true WrStatsXLS Write the stats to an Excel file?
6 NumSFChans Number of channels that will have summary statistics generated for them.
$-ReactFXss$ $-ReactFYss$ $-ReactFZss$ $-ReactMXss$ $-ReactMYss$ $-ReactMZss$ SFChans List of channels that will have summary statistics generated for them. Must number NumSFChans.
----- Distributions -----------------------------------------------------------
false UserDistrib User defined distribution? true = load user-specified distribution, false = only use Weibull wind distribution
2.4 WeibullShape Weibull shape factor. If WeibullShape=2, enter the mean wind speed for WeibullScale.
3 WeibullScale Weibull scale factor. If WeibullShape<>2. Otherwise, enter the mean wind speed.
3 WSin Cut-in wind speed for the turbine.
21 WSout Cut-out wind speed for the turbine.
44 WSmax Maximum wind speed value for the wind-speed bins.
1 WSMaxBinSize Maximum width of a wind-speed bin.
0 nDistribVars Number of independent variables in the user-specified distribution, ignored if UserDistrib = false
“” DistribName Filename of the user-supplied distribution table, ignored if UserDistrib = false
----- Fatigue ----------------------------------------------------------------
6 nFatigueChannels The number of fatigue channels. Next six lines ignored if zero.
0.0 FiltRatio The fraction of the maximum range of each channel used as a cutoff range for the racetrack filter. Use zero for no filter.
630720000 DesignLife Number of seconds in the design lifetime (20 years = 630720000 seconds).
1 Availability Fraction of the design life the turbine is operating when winds are between Vin and Vout
false BinCycles Bin the rainflow cycles?
0.5 UCMult Multiplier for binning unclosed cycles. (0 discards, 1 counts as a full cycle)
true DoShortTerm Compute simple (unweighted) damage-equivalent loads and damage rates.
true DoLife Do lifetime-related calculations?
true DoAggregate Compute a DELs and a damage result based on an aggregate of all the input files (does not use the wind spped distribution)
true WrShortTermTxt Write short-term results to plain-text files?
true WrShortTermXLS Write short-term resultsto an Excel workbook?
true WrLifeTxt Write lifetime results to plain-text files?
false WrLifeXLS Write lifetime results to an Excel workbook?
1 EquivalentFrequency The frequency of the damage equivalent load (Hz)
false DEL_AsRange true = report DELs as a range value, false = report as a one-sided amplitude
2 DEL_Type 1 = fixed mean, 2 = zero mean, 3 = both
1 GoodmanFlag 0 = no Goodman correction, 1 = use Goodman correction, 2 = compute results with and without Goodman correction
Channel# NSlopes SNslopeLst BinFlag BinWidth/Number TypeLMF LUlt BinWidth not used when BinCycles is false. nFatigueChannels rows of data follow. LUlt >> LMF
$-ReactFXss$ 1 10 BW 20 161 31875
$-ReactFYss$ 1 10 BW 20 161 31875
$-ReactFZss$ 1 10 BW 20 161 31875
$-ReactMXss$ 1 10 BW 20 161 31875
$-ReactMYss$ 1 10 BW 20 161 31875
$-ReactMZss$ 1 10 BW 20 161 31875
0 NumDELGroups
Name NChannels ChannelList
----- Input Files ------------------------------------------------------------
1 FileFormat Format of input files. 1 = FAST ascii, 2 = FAST binary
24 1.1 1.3 1.1 1.3
“HydroDyn_out_whs_2.6_wtp_6_wdir_45_wndspd_3.out”
1 1.1 1.3 1.5 1.7 (Weibull-Weighted Idling: NumIdleFiles, PSF1, PSF2, PSF3, PSF4)
“HydroDyn_out_whs_2.6_wtp_6_wdir_45_wndspd_3.out”
0 1.2 1.3 1.4 1.6 (Discrete Events: NumDiscFiles, PSF1, PSF2, PSF3, PSF4)24 NumFiles The number of input files to read.
==EOF== DO NOT REMOVE OR CHANGE. MUST COME JUST AFTER LAST LINE OF VALID INPUT.

Dear Matthew,

I see that you are generating an echo file. What are the contents of this file; which line of your input file is this error triggered?

Best regards,

Dear Jason,

Thank you for your reply.

The following is the echo file produced:

Echoing contents of “BaseSettingsFile_3.mlif”.
Test#01
----- Job Options ------------------------------------------------------------
true EchoInp Echo input to .echo as this file is being read.
true

It appears MLife is breaking in the ‘Job Options’ part, specifically the following line 2:

true StrNames Use channel names following a “$” instead of numbers when specifying channels in this input file.

Please let me know if you know any reasoning behind this. Thanks.

Best regards,
Matthew

Dear Matthew,

I’m surprised that MLife is complaining about the StrNames line. I copied/pasted the contents of your input file and ran MLife myself and your input file is read in properly. I’m not sure how to help. I would suggest stepping through the solution with the MATLAB debugger.

Best regards,

Dear Jason,

The error came from the NumChans not matching the number of channels in the .out file.

I have since corrected this, and now am receiving the following error. I understand you were saying to step through the Matlab errors but I am a bit lost and I am wondering if you have dealt with this type of error before:

Thanks again for your time and help.

Best regards,

Dear Matthew,

Again, this sounds like a problem with the formatting of your MLife input file. I can’t really help without being able to reproduce the problem myself. You can use the Echo option to locate the line in the file that has the formatting problem and/or use the MATLAB debugger to step through and identify the problem.

Best regards,

1 Like

Dear Soeren

I have also received this error yesterday, I debug the Matlab script, and find the reason is in my . milfe file.

If we want mlife to read .out file, we have to change the ChanTitle and ChanUnite under block ‘Input-Data Layout’ in .mlif file, and the number of the ChanTitle must be same with the channel of the .out file. The reason of my error is I missing a channel in ChanTitle, which results in Mlife incorrectly read the data of .out file. The actual number of lines Mlife read is different from the number of lines entered in NumChans, which results in the Index exceeds the number of array elements(256).

Best regards,

2 Likes

Hello Everyone!
I want to calculate the fatigue load of four channels, and I computed the extreme maximum load using Mextrem that worked for the same results. However, in the Mlife I am getting errors that I attached below.
What could be the problem causing this error?
Best regards,

Echoing contents of "Test02.mlif".
Test #02 Testing %12.4e formatting, NamesLIne=0, NumChans>0, WrDELsXLS=true
-----  Job Options  ------------------------------------------------------------
true              EchoInp           Echo input to <rootname>.echo as this file is being read.
true                                   
false                 OutData          Output modified data array after scaling and calculated channels?
"%12.3e"              RealFmt          Format for outputting floating-point values.
"Test02"              AggRoot          Root name for aggregate output files.
-----  Input-Data Layout  ------------------------------------------------------
6                     TitleLine        The row with the file title on it.
7                     NamesLine        The row with the channel names on it.
8                     UnitsLine        The row with the channel units on it.
9                     FirstDataLine    The first row of data.
74                    NumChans         The number of channels in each input file.
ChanTitle    ChanUnits    Scale  Offset   PSF_Type  NumCols rows of data follow.  Title and units strings must be 10 characters or less.
"Time"                  "(s)"         1.0   0.0   0
"Wind1VelX"             "(m/s)"       1.0   0.0   0
"Wind1VelY"             "(m/s)"       1.0   0.0   0
"Wind1VelZ"             "(m/s)"       1.0   0.0   0
"Azimuth"             "(deg)"         1.0   0.0   0
"NacYaw"             "(deg)"          1.0   0.0   0
"LSSGagMxa"             "(kN-m)"      1.0   0.0   0
"LSSGagMya"             "(kN-m)"      1.0   0.0   0
"TwrBsMxt"             "(kN-m)"       1.0   0.0   0
"TwrBsMyt"             "(kN-m)"       1.0   0.0   0
"BldPitch1"             "(deg)"       1.0   0.0   0
"GenSpeed"             "(rpm)"        1.0   0.0   0
"IPDefl1"             "INVALID"       1.0   0.0   0
"OoPDefl1"             "INVALID"      1.0   0.0   0
"RootFxb1"             "INVALID"      1.0   0.0   0
"RootFxc1"             "INVALID"      1.0   0.0   0
"RootFyb1"             "INVALID"      1.0   0.0   0
"RootFyc1"             "INVALID"      1.0   0.0   0
"RootFzc1"             "INVALID"      1.0   0.0   0
"RootMxb1"             "INVALID"      1.0   0.0   0
"RootMxc1"             "INVALID"      1.0   0.0   0
"RootMyb1"             "INVALID"      1.0   0.0   0
"RootMyc1"             "INVALID"      1.0   0.0   0
"RootMzc1"             "INVALID"      1.0   0.0   0
"RotSpeed"             "(rpm)"        1.0   0.0   0
"TipClrnc1"             "INVALID"     1.0   0.0   0
"TipDxb1"             "INVALID"       1.0   0.0   0
"TipDyb1"             "INVALID"       1.0   0.0   0
"TipDzb1"             "INVALID"       1.0   0.0   0
"TwstDefl1"             "INVALID"     1.0   0.0   0
"B1RootFxr"             "(N)"         1.0   0.0   0
"B1RootFyr"             "(N)"         1.0   0.0   0
"B1RootFzr"             "(N)"         1.0   0.0   0
"B1RootMxr"             "(N-m)"       1.0   0.0   0
"B1RootMyr"             "(N-m)"       1.0   0.0   0
"B1RootMzr"             "(N-m)"       1.0   0.0   0
"B1TipTDxr"             "(m)"         1.0   0.0   0
"B1TipTDyr"             "(m)"         1.0   0.0   0
"B1TipTDzr"             "(m)"         1.0   0.0   0
"B1TipRDxr"             "(-)"         1.0   0.0   0
"B1TipRDyr"             "(-)"         1.0   0.0   0
"B1TipRDzr"             "(-)"         1.0   0.0   0
"B2RootFxr"             "(N)"         1.0   0.0   0
"B2RootFyr"             "(N)"         1.0   0.0   0
"B2RootFzr"             "(N)"         1.0   0.0   0
"B2RootMxr"             "(N-m)"       1.0   0.0   0
"B2RootMyr"             "(N-m)"       1.0   0.0   0
"B2RootMzr"             "(N-m)"       1.0   0.0   0
"B2TipTDxr"             "(m)"         1.0   0.0   0
"B2TipTDyr"             "(m)"         1.0   0.0   0
"B2TipTDzr"             "(m)"         1.0   0.0   0
"B2TipRDxr"             "(-)"         1.0   0.0   0
"B2TipRDyr"             "(-)"         1.0   0.0   0
"B2TipRDzr"             "(-)"         1.0   0.0   0
"B3RootFxr"             "(N)"         1.0   0.0   0
"B3RootFyr"             "(N)"         1.0   0.0   0
"B3RootFzr"             "(N)"         1.0   0.0   0
"B3RootMxr"             "(N-m)"       1.0   0.0   0
"B3RootMyr"             "(N-m)"       1.0   0.0   0
"B3RootMzr"             "(N-m)"       1.0   0.0   0
"B3TipTDxr"             "(m)"         1.0   0.0   0
"B3TipTDyr"             "(m)"         1.0   0.0   0
"B3TipTDzr"             "(m)"         1.0   0.0   0
"B3TipRDxr"             "(-)"         1.0   0.0   0
"B3TipRDyr"             "(-)"         1.0   0.0   0
"B3TipRDzr"             "(-)"         1.0   0.0   0
"RtFldCp"             "(-)"           1.0   0.0   0
"RtFldCq"             "(-)"           1.0   0.0   0
"RtFldCt"             "(-)"           1.0   0.0   0
"RtFldPwr"             "(W)"          1.0   0.0   0
"RtSpeed"             "(rpm)"         1.0   0.0   0
"RtTSR"             "(-)"             1.0   0.0   0
"GenPwr"             "(kW)"           1.0   0.0   0
"GenTq"             "(kN-m)"          1.0   0.0   0
-----  Calculated Channels  ----------------------------------------------------
2                     NumCChan         The number calculated channels to generate.
1234067890            Seed             The integer seed for the random number generator.
Col_Title   Units    Equation       Put each field in quotes.  Titles and units are limited to 10 characters.  NumCChan rows of data follow.
"TBBM" "(kN-m)" "sqrt( timeSeriesData(:,9).^2 + timeSeriesData(:,10).^2 )" 
"TTBM" "(kN-m)" "sqrt( timeSeriesData(:,$YawBrMxp$).^2 + timeSeriesData(:,$YawBrMyp$).^2 )" 
-----  Load Roses  -------------------------------------------------------------
0                     nLoadRoses       The number of load roses to generate.
Rose Name11    Units    Channel1       Channel2     nSectors
-----  Time and Wind Speed  ----------------------------------------------------
1                     TimeChan         The channel containing time.
2                     WSChan           The primary wind-speed channel.
-----  Statistics and Extreme Events  ------------------------------------------
false                 DoStats          Generate statistics of all the channels.
false                 WrStatsTxt       Write a text file of statistics for each input file and the aggregate of all of them.
false                 WrStatsXLS       Write an Excel file of statistics for each input file and the aggregate of all of them.
3                     NumSFChans       Number of channels that will have summary statistics generated for them.
7 8 75     SFChans          List of channels that will have summary statistics generated for them.  Must number NumSFChans.
-----  Distributions -----------------------------------------------------------
false                 UserDistrib      User defined distribution?
2                     weibullShapeFactor  Weibull shape factor. If WeibullShape=2, enter the mean wind speed for WeibullScale.
10                    weibullScaleFactor  Weibull scale factor. If WeibullShape<>2.  Otherwise, enter the mean wind speed.
5                     WSin             Cut-in wind speed for the turbine.
15                    WSout            Cut-out wind speed for the turbine.
30                    WSmax            Maximum  value for the wind-speed bins.
2                     WSMaxBinSize     The max width of a wind-speed bin.
0                     nDistribVars     The number of independent variables in the user-specified distribution.
""                    DistribFile      Filename of the user-supplied distribution table.
-----  Fatigue  ----------------------------------------------------------------
4                     nFatigueChannels  The number of rainflow channels.
0                     FiltRatio        The fraction of the maximum range of each channel used as a cutoff range for the racetrack filter.
6.3072e+08            DesignLife       Number of seconds in the rainflow counting period.
1                     Availability     Fraction of the design life the turbine is operating when winds are between Vin and Vout
true                  BinCycles        Bin the rainflow cycles?
0                     UCMult           Multiplier for binning unclosed cycles.
true                  DoShortTerm      Compute simple (unweighted) damage-equivalent loads and damage rates.
true                  DoLife           Do lifetime-related calculations?
true                  DoAggregate      Compute a DELs and a damage result based on an aggregate of all the input files
true                  WrShortTermTxt   Write DELs to plain-text files?
false                 WrShortTermXLS   Write DELs to an Excel workbook?
true                  WrLifeTXT        Write lifetime results to plain-text files?
false                 WrLifeXLS        Write lifetime results to an Excel workbook?
1                     EquivalentFrequency  The frequency of the damage equivalent load (Hz).
true                  DEL_AsRange      true = report DELs as a range value,  false = report as a one-sided amplitude
1                     DEL_Type         1 = fixed mean, 2 = zero mean, 3 = compute both
1                     GoodmanFlag      0 = no Goodman, 1 = use Goodman, 2 = compute with and without
Channel#  NSlopes  SNslopeLst      BinFlag  BinWidth/Number  TypeLMF     LUlt    BinWidth not used when BinCycles is false. nFatigueChannels rows of data follow.  LUlt >> LMF
35              1       10         BN 	  	100       WM    651800
7              1       3          BN 	  	100       WM    249600
8              1       3          BN 	  	100       WM    194000
75                   1       3          BN 	  	100       WM    2298000
4                     nGroups           
NChannels      Channel     List
"B1RootMyr"               1            1 
"LSSGagMxa"               1            2
"LSSGagMya"               1            3
"TBBM"                    1            4
-----  Input Files  ------------------------------------------------------------
1                     FileFormat       Flag determining input file format.  1 = ascii, 2 = binary
6  1.0   1.0   1.0   1.0    (Weibull-Weighted Normal Operation: NumNormFiles, PSF1, PSF2, PSF3, PSF4)
"WT10_BD8YN40S1.txt"                   
"WT10_BD8YN40S2.txt"                   
"WT10_BD8YN40S3.txt"                   
"WT10_BD8YN40S4.txt"                   
"WT10_BD8YN40S5.txt"                   
"WT10_BD8YN40S6.txt"                   
0  1.0   1.0   1.0   1.0    (Weibull-Weighted Idling: NumIdleFiles, PSF1, PSF2, PSF3, PSF4)
0  1.0   1.0   1.0   1.0    (Discrete Events: NumDiscFiles, PSF1, PSF2, PSF3, PSF4)2  1.1   1.3   1.0   1.7    (Weibull-Weighted Normal Operation: NumNormFiles, PSF1, PSF2, PSF3, PSF4)
==EOF==                             DO NOT REMOVE OR CHANGE.  MUST COME JUST AFTER LAST LINE OF VALID INPUT.

Dear @Dereje.Haile,

I’m not an expert on the MLife source code, and the MLife developers no longer work at NREL, so, it is difficult to offer support on the source code. I would suggest debugging further, e.g. isolate what line in read_one_file.m is triggering the error.

Best regards,

1 Like

Could you share one/all of the input files “WT_BD8…txt” which contains all the columns? I want to give debugging this a try but I want to get the full picture.

Regards,

Dear @Muthu.Kumar,

Thank you for your help! I added the directory path in the mlife_certification_tests() code, but the error has changed, as shown below. I have uploaded the output file to Google Drive. OutPutFile - Google Drive
Best regards,

Although true --- StrNames was used, changing TimeChan$Time$ to 1 solved the problem. Thank you.