# MLife Calculation

**URL:** <https://forums.nlr.gov/t/mlife-calculation/1313>\
**Category:** Computer-Aided Engineering Software Tools\
**Created:** [April 5, 2016, 8:35pm UTC](https://forums.nlr.gov/t/mlife-calculation/1313 "2016-04-05T20:35:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Junyi.Wu](https://avatars.discourse-cdn.com/v4/letter/j/8797f3/32.png) [@Junyi.Wu](https://forums.nlr.gov/u/Junyi.Wu)\
**Post date:** [April 5, 2016, 8:35pm UTC](https://forums.nlr.gov/t/mlife-calculation/1313/1 "2016-04-05T20:35:14Z")

</div>

Hello everyone,

I am now trying to use MLife to calculate fatigue life of some wind turbines. However, I met some problems and Matlab complained like that:

> [@](#):
>
> Attempted to access Fatigue.TimePP(398); index out of bounds because numel(Fatigue.TimePP)=225.
> 
> 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 er3 (line 1)  
> mlife(‘Test For TLP.mlif’, '.\Data', '.\Results\Testtlp');

Could some one can tell me what’s wrong with my MLife file? Thanks a lot.

Kind Regards  
Junyi  
[MLife.txt](https://forums.nlr.gov/uploads/short-url/nWDZtRETVOYekGAtXJekm71YcZ9.txt) (8.23 KB)

---

<div class="post-metadata">

**Author:** ![Kan.Zheng](https://dub1.discourse-cdn.com/nrel/user_avatar/forums.nlr.gov/kan.zheng/32/7275_2.png) [@Kan.Zheng](https://forums.nlr.gov/u/Kan.Zheng)\
**Post date:** [March 20, 2019, 12:41am UTC](https://forums.nlr.gov/t/mlife-calculation/1313/2 "2019-03-20T00:41:02Z")

</div>

> [@Junyi.Wu](#):
>
> Hello everyone,
> 
> I am now trying to use MLife to calculate fatigue life of some wind turbines. However, I met some problems and Matlab complained like that:
> 
> > [@](#):
> >
> > Attempted to access Fatigue.TimePP(398); index out of bounds because numel(Fatigue.TimePP)=225.
> > 
> > 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 er3 (line 1)  
> > mlife(‘Test For TLP.mlif’, '.\Data', '.\Results\Testtlp');
> 
> Could some one can tell me what’s wrong with my MLife file? Thanks a lot.
> 
> Kind Regards  
> Junyi

Dear Jonkman,  
I have come with the same problem with Junyi.Wu as above.This error caused by the wind speed, maybe the wind speed you set is over 90 degrees. The code recongnize it’s a negative value and things go wrong.

However, in reality condition as DNVGL-ST-0437 mentioned, these work conditions should be considered(inflow direction over 90 degree) . If we define ''Time and Wind Speed ‘’ as the picture shows above, it will cause error because the value of ‘‘Wind1VelX’’ is negative. Is there any method to solve this problem? Should I modified the source code of Mlife? Can you give me some advice?

 ![1553042089(1).png](https://europe1.discourse-cdn.com/nrel/original/2X/b/b1aef2c4806ed5e355e1bd8e548c3b3b0a8923aa.png)
