Processing OpenFast linearization output
Moderator: Bonnie.Jonkman

 Posts: 61
 Joined: Sat Feb 29, 2020 9:56 am
 Organization: NITcalicut
 Location: INDIA
Re: Processing OpenFast linearization output
Sir,
Thank you for spending your time on clearing my doubts. I made changes to copy of my Matlab scripts as in https://github.com/OpenFAST/matlabtoolbox/pull/12. For running Matlab scripts I followed the procedure given in MBC3.pdf. After I issued the command fx_getMATS in matlab command window the code started executing and when I typed Fast output file without .lin extention I got error then I tried executing fx_mbc3 then I got another error.
>> 5MW_Land_BD_Linear.1
5MW_Land_BD_Linear.1
↑
Error: Unexpected MATLAB expression.
>> 5MW_Land_BD_Linear.1 5MW_Land_BD_Linear.2
5MW_Land_BD_Linear.1 5MW_Land_BD_Linear.2
↑
Error: Unexpected MATLAB expression.
>> who
Your variables are:
ans
>> fx_mbc3
Running mbc3 (v2.0, 29Jan2018)
Not enough input arguments.
Error in fx_mbc3 (line 41)
[matData, FAST_linData] = fx_getMats(FileNames);
And I tried to run fx_mbc3 by replacing FileNames by ('5MW_Land_BD_Linear.1.lin','5MW_Land_BD_Linear.2.lin') in line 41 of fxmbc3 M file. Then I got this error.
Error using fx_getMats
Too many input arguments.
Error in fx_mbc3 (line 41)
[matData, FAST_linData] = fx_getMats('5MW_Land_BD_Linear.1.lin','5MW_Land_BD_Linear.2.lin');
Can I get some help.
Thank you for spending your time on clearing my doubts. I made changes to copy of my Matlab scripts as in https://github.com/OpenFAST/matlabtoolbox/pull/12. For running Matlab scripts I followed the procedure given in MBC3.pdf. After I issued the command fx_getMATS in matlab command window the code started executing and when I typed Fast output file without .lin extention I got error then I tried executing fx_mbc3 then I got another error.
>> 5MW_Land_BD_Linear.1
5MW_Land_BD_Linear.1
↑
Error: Unexpected MATLAB expression.
>> 5MW_Land_BD_Linear.1 5MW_Land_BD_Linear.2
5MW_Land_BD_Linear.1 5MW_Land_BD_Linear.2
↑
Error: Unexpected MATLAB expression.
>> who
Your variables are:
ans
>> fx_mbc3
Running mbc3 (v2.0, 29Jan2018)
Not enough input arguments.
Error in fx_mbc3 (line 41)
[matData, FAST_linData] = fx_getMats(FileNames);
And I tried to run fx_mbc3 by replacing FileNames by ('5MW_Land_BD_Linear.1.lin','5MW_Land_BD_Linear.2.lin') in line 41 of fxmbc3 M file. Then I got this error.
Error using fx_getMats
Too many input arguments.
Error in fx_mbc3 (line 41)
[matData, FAST_linData] = fx_getMats('5MW_Land_BD_Linear.1.lin','5MW_Land_BD_Linear.2.lin');
Can I get some help.

 Posts: 5082
 Joined: Thu Nov 03, 2005 4:38 pm
 Location: Boulder, CO
 Contact:
Re: Processing OpenFast linearization output
Dear Dhaneesh,
FileNames is a required argument to fx_getMats. Specify a single file in quotes, e.g., FileNames = '5MW_Land_BD_Linear.1.lin'. If you want to specify multiple files, use a cell array, e.g., FileNames = { '5MW_Land_BD_Linear.1.lin', '5MW_Land_BD_Linear.2.lin' }
Best regards,
FileNames is a required argument to fx_getMats. Specify a single file in quotes, e.g., FileNames = '5MW_Land_BD_Linear.1.lin'. If you want to specify multiple files, use a cell array, e.g., FileNames = { '5MW_Land_BD_Linear.1.lin', '5MW_Land_BD_Linear.2.lin' }
Best regards,
Jason Jonkman, Ph.D.
Senior Engineer  National Wind Technology Center (NWTC)
National Renewable Energy Laboratory (NREL)
15013 Denver West Parkway  Golden, CO 80401
+1 (303) 384 – 7026  Fax: +1 (303) 384 – 6901
nwtc.nrel.gov
Senior Engineer  National Wind Technology Center (NWTC)
National Renewable Energy Laboratory (NREL)
15013 Denver West Parkway  Golden, CO 80401
+1 (303) 384 – 7026  Fax: +1 (303) 384 – 6901
nwtc.nrel.gov

 Posts: 61
 Joined: Sat Feb 29, 2020 9:56 am
 Organization: NITcalicut
 Location: INDIA
Re: Processing OpenFast linearization output
Sir,
From beginning I was using cell array to define FileNames in fx_getMats. Eventhough I was getting the same error. I am attaching the matlab scripts fx_getMats and fx_mbc3. Can I know where I was wrong.
From beginning I was using cell array to define FileNames in fx_getMats. Eventhough I was getting the same error. I am attaching the matlab scripts fx_getMats and fx_mbc3. Can I know where I was wrong.
 Attachments

 fx_mbc3.docx
 (16.23 KiB) Downloaded 27 times

 fx_getMats.docx
 (16.19 KiB) Downloaded 32 times

 Posts: 5082
 Joined: Thu Nov 03, 2005 4:38 pm
 Location: Boulder, CO
 Contact:
Re: Processing OpenFast linearization output
Dear Dhaneesh,
I haven't looked at your MATLAB scripts, but after downloading the master branch of the MATLAB toolbox, the only thing that you should need to change is the one line in ReadFASTLinear.m that I indicated in my Apr 22. 2020 post above. I was able to run fx_mbc3.m using the OpenFAST linearization output files you attached in your Apr 22, 2020 post above with this one line change to ReadFASTLinear.m.
Best regards,
I haven't looked at your MATLAB scripts, but after downloading the master branch of the MATLAB toolbox, the only thing that you should need to change is the one line in ReadFASTLinear.m that I indicated in my Apr 22. 2020 post above. I was able to run fx_mbc3.m using the OpenFAST linearization output files you attached in your Apr 22, 2020 post above with this one line change to ReadFASTLinear.m.
Best regards,
Jason Jonkman, Ph.D.
Senior Engineer  National Wind Technology Center (NWTC)
National Renewable Energy Laboratory (NREL)
15013 Denver West Parkway  Golden, CO 80401
+1 (303) 384 – 7026  Fax: +1 (303) 384 – 6901
nwtc.nrel.gov
Senior Engineer  National Wind Technology Center (NWTC)
National Renewable Energy Laboratory (NREL)
15013 Denver West Parkway  Golden, CO 80401
+1 (303) 384 – 7026  Fax: +1 (303) 384 – 6901
nwtc.nrel.gov

 Posts: 61
 Joined: Sat Feb 29, 2020 9:56 am
 Organization: NITcalicut
 Location: INDIA
Re: Processing OpenFast linearization output
Sir,
Thank you for your quick reply and sorry to bother you this many times on same topic. Earlier I made all changes showed in pull request to my matlab scripts and tried to run mbc then I got error(Not enough input arguments) and error in line 41 of mbc. After seeing your last reply I only changed that 66 line in ReadFASTlinear.m and tried running mbc. Eventhough I was getting same error. And I haven't made any changes in matlab scripts.
Thank you.
Thank you for your quick reply and sorry to bother you this many times on same topic. Earlier I made all changes showed in pull request to my matlab scripts and tried to run mbc then I got error(Not enough input arguments) and error in line 41 of mbc. After seeing your last reply I only changed that 66 line in ReadFASTlinear.m and tried running mbc. Eventhough I was getting same error. And I haven't made any changes in matlab scripts.
Thank you.
 Attachments

 ReadFASTLinear.docx
 (12.54 KiB) Downloaded 33 times

 fx_mbc3.docx
 (16.22 KiB) Downloaded 27 times

 fx_getMats.docx
 (14.76 KiB) Downloaded 27 times

 Posts: 5082
 Joined: Thu Nov 03, 2005 4:38 pm
 Location: Boulder, CO
 Contact:
Re: Processing OpenFast linearization output
Dear Dhaneesh,
How are you calling fx_mb3.m? I would expect it to look something like:
Best regards,
How are you calling fx_mb3.m? I would expect it to look something like:
Code: Select all
>> [MBC] = fx_mbc3( '5MW_Land_BD_Linear.1.lin' )
Running mbc3 (v2.0, 29Jan2018)
Rotating channel "ED BldPitch1, (deg)" does not form a unique blade triplet. Blade(s) not found: 2 3
MultiBlade Coordinate transformation completed
MBC =
struct with fields:
DescStates: {194×1 cell}
ndof2: 97
ndof1: 0
RotSpeed_rpm: 12.0991
performedTransformation: 1
A: [194×194 double]
B: [194×6 double]
C: [60×194 double]
D: [60×6 double]
AvgA: [194×194 double]
eigSol: [1×1 struct]
AvgB: [194×6 double]
AvgC: [60×194 double]
AvgD: [60×6 double]
Best regards,
Jason Jonkman, Ph.D.
Senior Engineer  National Wind Technology Center (NWTC)
National Renewable Energy Laboratory (NREL)
15013 Denver West Parkway  Golden, CO 80401
+1 (303) 384 – 7026  Fax: +1 (303) 384 – 6901
nwtc.nrel.gov
Senior Engineer  National Wind Technology Center (NWTC)
National Renewable Energy Laboratory (NREL)
15013 Denver West Parkway  Golden, CO 80401
+1 (303) 384 – 7026  Fax: +1 (303) 384 – 6901
nwtc.nrel.gov

 Posts: 61
 Joined: Sat Feb 29, 2020 9:56 am
 Organization: NITcalicut
 Location: INDIA
Re: Processing OpenFast linearization output
Sir,
It worked. I think the problem was in issuing the command in Matlab window. Because I was following an outdated procedure for executing MBC3 mentioned in (https://github.com/OpenFAST/matlabtool ... s/MBC3.pdf).
1. In MBC generated output the MBC transformed mass and stiffness matrices are not generated. Can I Know how to get them in MBC output ?
2. I am interested in cce generated eigenresults. So when I tried to run eiganalysis script I got the error
>> [MBC] = eiganalysis('5MW_Land_DLL_WTurb.1.lin','5MW_Land_DLL_WTurb.2.lin')
Error using eiganalysis (line 26)
**ERROR: the statespace matrix is not a square matrix.
But the statespace matrix I got in output file was a square matrix.
I think I was issuing the command in wrong way. Can I know the correct procedure ?
Thank you.
It worked. I think the problem was in issuing the command in Matlab window. Because I was following an outdated procedure for executing MBC3 mentioned in (https://github.com/OpenFAST/matlabtool ... s/MBC3.pdf).
1. In MBC generated output the MBC transformed mass and stiffness matrices are not generated. Can I Know how to get them in MBC output ?
2. I am interested in cce generated eigenresults. So when I tried to run eiganalysis script I got the error
>> [MBC] = eiganalysis('5MW_Land_DLL_WTurb.1.lin','5MW_Land_DLL_WTurb.2.lin')
Error using eiganalysis (line 26)
**ERROR: the statespace matrix is not a square matrix.
But the statespace matrix I got in output file was a square matrix.
I think I was issuing the command in wrong way. Can I know the correct procedure ?
Thank you.

 Posts: 5082
 Joined: Thu Nov 03, 2005 4:38 pm
 Location: Boulder, CO
 Contact:
Re: Processing OpenFast linearization output
Dear Dhaneesh,
The linearization functionality of OpenFAST does not export the mass and stiffness matrices directly. The presence of mass and stiffness matrices would require that all states be second order, but the OpenFAST linearization functionality supports states in both first and second order. So instead of mass and stiffness, the OpenFAST linearization generates the firstorder state matrix, A. If all states were second order, the state matrix would likely look something like the following, and so, contain the same information:
A = [ [ 0, I ]; [ M^1*K, M^1*C ] ]
where:
0 = Zero matrix
I = Identity matrix
M = Mass matrix
K = Stiffness matrix
C = Damping matrix
M^1 = The inverse of the mass matrix
If you look at the Eigenalysis.m script, you'll see that it expects the first argument to be the state matrix, A, not a filename.
The CCE script is no longer supported. I would not recommend that you use it anyway, because performing an eigenanalysis on state matrices that are averaged without first applying the MBC transform, will not result in a meaningful eigensolution.
Best regards,
The linearization functionality of OpenFAST does not export the mass and stiffness matrices directly. The presence of mass and stiffness matrices would require that all states be second order, but the OpenFAST linearization functionality supports states in both first and second order. So instead of mass and stiffness, the OpenFAST linearization generates the firstorder state matrix, A. If all states were second order, the state matrix would likely look something like the following, and so, contain the same information:
A = [ [ 0, I ]; [ M^1*K, M^1*C ] ]
where:
0 = Zero matrix
I = Identity matrix
M = Mass matrix
K = Stiffness matrix
C = Damping matrix
M^1 = The inverse of the mass matrix
If you look at the Eigenalysis.m script, you'll see that it expects the first argument to be the state matrix, A, not a filename.
The CCE script is no longer supported. I would not recommend that you use it anyway, because performing an eigenanalysis on state matrices that are averaged without first applying the MBC transform, will not result in a meaningful eigensolution.
Best regards,
Jason Jonkman, Ph.D.
Senior Engineer  National Wind Technology Center (NWTC)
National Renewable Energy Laboratory (NREL)
15013 Denver West Parkway  Golden, CO 80401
+1 (303) 384 – 7026  Fax: +1 (303) 384 – 6901
nwtc.nrel.gov
Senior Engineer  National Wind Technology Center (NWTC)
National Renewable Energy Laboratory (NREL)
15013 Denver West Parkway  Golden, CO 80401
+1 (303) 384 – 7026  Fax: +1 (303) 384 – 6901
nwtc.nrel.gov

 Posts: 61
 Joined: Sat Feb 29, 2020 9:56 am
 Organization: NITcalicut
 Location: INDIA
Re: Processing OpenFast linearization output
Sir,
Whether the natural frequencies obtained in eigsol of MBC output are the complete frequencies obtained in eigenanalysis of wind turbine ? or are there any AvgNaturalFrequencies like cce generated eigvalues as old version. Because when I tried with syntax command [mbc] = eiganalysis(A, ndof2, ndof1) It was showing an error printing ( undefined function or variable A ). If MBC output frequencies are not the complete natural frequencies then how can I get complete system frequencies.
Thank you.
Whether the natural frequencies obtained in eigsol of MBC output are the complete frequencies obtained in eigenanalysis of wind turbine ? or are there any AvgNaturalFrequencies like cce generated eigvalues as old version. Because when I tried with syntax command [mbc] = eiganalysis(A, ndof2, ndof1) It was showing an error printing ( undefined function or variable A ). If MBC output frequencies are not the complete natural frequencies then how can I get complete system frequencies.
Thank you.

 Posts: 5082
 Joined: Thu Nov 03, 2005 4:38 pm
 Location: Boulder, CO
 Contact:
Re: Processing OpenFast linearization output
Dear Dhaneesh,
fx_mbc3.m already calls eigenanalysis.m; there is no need to call eigenanalysis.m separately. All you need to do is run fx_mbc3.m.
Assuming you've called fx_mbc3.m as follows:
the eigensolution is stored in the MATLAB structure, MBC.eigSol, e.g., the fullsystem natural frequencies in Hz are contained in MBC.eigSol.NaturalFreqs_Hz.
Best regards,
fx_mbc3.m already calls eigenanalysis.m; there is no need to call eigenanalysis.m separately. All you need to do is run fx_mbc3.m.
Assuming you've called fx_mbc3.m as follows:
Code: Select all
[MBC] = fx_mbc3( '5MW_Land_BD_Linear.1.lin' )
the eigensolution is stored in the MATLAB structure, MBC.eigSol, e.g., the fullsystem natural frequencies in Hz are contained in MBC.eigSol.NaturalFreqs_Hz.
Best regards,
Jason Jonkman, Ph.D.
Senior Engineer  National Wind Technology Center (NWTC)
National Renewable Energy Laboratory (NREL)
15013 Denver West Parkway  Golden, CO 80401
+1 (303) 384 – 7026  Fax: +1 (303) 384 – 6901
nwtc.nrel.gov
Senior Engineer  National Wind Technology Center (NWTC)
National Renewable Energy Laboratory (NREL)
15013 Denver West Parkway  Golden, CO 80401
+1 (303) 384 – 7026  Fax: +1 (303) 384 – 6901
nwtc.nrel.gov

 Posts: 74
 Joined: Mon Jan 09, 2017 1:00 am
 Organization: TÜV NORD
 Location: Germany
Re: Processing OpenFast linearization output
Hi Jason,
the fix solved my problem. Thank you.
Best regards,
Simon
the fix solved my problem. Thank you.
Best regards,
Simon

 Posts: 61
 Joined: Sat Feb 29, 2020 9:56 am
 Organization: NITcalicut
 Location: INDIA
Re: Processing OpenFast linearization output
Sir,
Was the pull request 350 (for linearization of offshore wind turbine ) included in dev branch of openfast? If it is included where I can download regtest and openfast binaries for modified source code.
Thank you.
Was the pull request 350 (for linearization of offshore wind turbine ) included in dev branch of openfast? If it is included where I can download regtest and openfast binaries for modified source code.
Thank you.

 Posts: 5082
 Joined: Thu Nov 03, 2005 4:38 pm
 Location: Boulder, CO
 Contact:
Re: Processing OpenFast linearization output
Dear Dhaneesh,
Not yet, and I'm not sure why it is taking so long (likely key staff are just busy). Regardless, you can access the branch of OpenFAST that includes the new offshore linearization capability through the links found here: https://github.com/OpenFAST/openfast/pull/350.
Best regards,
Not yet, and I'm not sure why it is taking so long (likely key staff are just busy). Regardless, you can access the branch of OpenFAST that includes the new offshore linearization capability through the links found here: https://github.com/OpenFAST/openfast/pull/350.
Best regards,
Jason Jonkman, Ph.D.
Senior Engineer  National Wind Technology Center (NWTC)
National Renewable Energy Laboratory (NREL)
15013 Denver West Parkway  Golden, CO 80401
+1 (303) 384 – 7026  Fax: +1 (303) 384 – 6901
nwtc.nrel.gov
Senior Engineer  National Wind Technology Center (NWTC)
National Renewable Energy Laboratory (NREL)
15013 Denver West Parkway  Golden, CO 80401
+1 (303) 384 – 7026  Fax: +1 (303) 384 – 6901
nwtc.nrel.gov

 Posts: 17
 Joined: Fri May 08, 2020 2:12 am
 Organization: CSIRSERC
 Location: India
Re: Processing OpenFast linearization output
Dear Jason,
I am interested in using the runCampbell matlab script you mentioned on this forum to run OpenFAST with linearization. I pulled the source code for the matlabtoolbox from github. I found that the runCampbell script requires InflowWind.dat, ServoDyn.dat, and ElastoDyn.dat files template files but they are missing on the github. I have reported this on the github but there is still no reply. I would like to know if I can generate those template files using one of the examples available in the rtests. Can you please let me know how to generate these template files?
Thank you,
Srinivasa
I am interested in using the runCampbell matlab script you mentioned on this forum to run OpenFAST with linearization. I pulled the source code for the matlabtoolbox from github. I found that the runCampbell script requires InflowWind.dat, ServoDyn.dat, and ElastoDyn.dat files template files but they are missing on the github. I have reported this on the github but there is still no reply. I would like to know if I can generate those template files using one of the examples available in the rtests. Can you please let me know how to generate these template files?
Thank you,
Srinivasa

 Posts: 5082
 Joined: Thu Nov 03, 2005 4:38 pm
 Location: Boulder, CO
 Contact:
Re: Processing OpenFast linearization output
Dear Srinivasa,
Yes, the runCampbell.m script runs OpenFAST multiple times, and so, it expects standard InflowWind, ServoDyn, ElastoDyn, etc. input files to exist. Templates for these files can be obtained from the OpenFAST regression tests (rtest) suite: https://github.com/OpenFAST/rtest. The InflowWind file is assumed to use WindType = 1 and the ServoDyn file is assumed to use PCMode = 0, VSContrl = 1, HSSBrMode = 0, and YCMode = 0.
Best regards,
Yes, the runCampbell.m script runs OpenFAST multiple times, and so, it expects standard InflowWind, ServoDyn, ElastoDyn, etc. input files to exist. Templates for these files can be obtained from the OpenFAST regression tests (rtest) suite: https://github.com/OpenFAST/rtest. The InflowWind file is assumed to use WindType = 1 and the ServoDyn file is assumed to use PCMode = 0, VSContrl = 1, HSSBrMode = 0, and YCMode = 0.
Best regards,
Jason Jonkman, Ph.D.
Senior Engineer  National Wind Technology Center (NWTC)
National Renewable Energy Laboratory (NREL)
15013 Denver West Parkway  Golden, CO 80401
+1 (303) 384 – 7026  Fax: +1 (303) 384 – 6901
nwtc.nrel.gov
Senior Engineer  National Wind Technology Center (NWTC)
National Renewable Energy Laboratory (NREL)
15013 Denver West Parkway  Golden, CO 80401
+1 (303) 384 – 7026  Fax: +1 (303) 384 – 6901
nwtc.nrel.gov
Return to “Structural Analysis”
Who is online
Users browsing this forum: No registered users and 1 guest