Problems plotting FAST results with PlotCertTestResults.m

Hi everyone,

I’m quite new using FAST, Aerodyn and it’s preprocessors and I’m not very used to these kind of softwares, for that reason I find this forum amazing and would like to thank you everyone who is behind it. Now let’s see if you could help me.

I’m working with the 5MW turbine, which I downloaded from the JJonkman’s public folder and I’m trying to simulate the wind turbine without using the Matlab control feature since my objective is to compare FAST simulations with another software simulations and see how well the other software works and which improvements can be done. For that reason the first step I’ve done is to create a Wind field that is steady with the main working speed of the 5MW turbine, and then trying to simulate with FAST and without any of the control possibilities. Here my configuration:

0 YCMode
9999.9 TYCOn
0 PCMode
0.0 TPCOn
0 VSContrl

1 GenModel
1 HSSBrMode
All DOFs are enabled except: Noise and Teeter

I also enabled more BldGagNd because I wanted to see the loads in different parts of the wings:
6 NBlGages
1,2,3,9,14,17 BldGagNd

The simulation run well and I become a result (which I don’t why has 0kW power output)

Trying to represent it in Matlab with the PlotCertTestResults.m I become this error:

I know that this function is made to compare two files but I guess that comparing two times the same I will obtain the plots of my simulation.

Thanks in advance

Dear Oriol,

Are you using FAST binary or formatted output? The error seems to indicate that it’s not finding binary data when it expects it.

I think it is possible to use the same file twice. Bonnie wrote the script–maybe she has additional advice.

Marshall

Hi, Oriol.

The fatal error you are getting looks like it’s caused because MATLAB can’t find the ReadFASTBinary.m file (that file should be in the FAST archive). The non-fatal errors appear because you don’t have files named Test01.out, Test01.azi, Test02.out, Test03.out, Test03.azi, etc in the directories you specified.

The PlotCertTestResults function is really intended to plot the results from the entire certification test. It looks for FAST output files named Test*.out, Test*.outb, and Crunch output files Test*.azi, Test*.pmf, etc. for Tests 01-17. If you are going to plot the results from just one case with PlotCertTestResults.m, you will have to edit the script to do what you want.

I have been working with another script that will plot the output from a single (or many) FAST output files; a nicer version of this script will be distributed with FAST v8 in the near future, but you may try this version now. There is some documentation at the top of the file (or type “help PlotFASToutput” in MATLAB) If you’re plotting just one file, you can call it this way: PlotFASToutput({fileNameStr}) To use the script, you will need the functions to read FAST binary (.outb) and read FAST text (.out) files if you don’t already have them. Put them in your MATLAB search path.

Dear Marshall and Bonnie,

Thank you for your reply and amazing help, this function have helped me a lot to work faster and better, I think it’s worth to share it with all the FAST community users even it’s not on an official release status yet.

Kind Regards

Dear Bonnie,

Thanks for your nicely written matlab script PlotFASToutput. Probably because I’m new to it, it’s not easy for me to get it work for drawing one channel of two files in a single plot. Could you show me an example or syntax of calling the subroutine PlotFASToutput? Just an simple case is enough.

Kind regards,
Yingyi
Kyushu University

Dear All,

I use the most recent version of PlotFASToutput.m in the latest released FAST_v8.16.00a-bjj. The interface is like this:
[outData]=PlotFASToutput(FilePath,FilesDesc,ReferenceFile,Channels,ShowLegend,CustomHdr,PlotPSDs,OnePlot)
Could anyone help me correctly call this function by showing a very simple example? I appreciate your help!

Kind regards,
Yingyi Liu

As shown above, the easiest syntax is if you are plotting one file:

PlotFASToutput({'fileName'}) where fileName is the name of the FAST output file you want to plot (either .out or .outb)

If you want to plot multiple files, you can use this syntax:

PlotFASToutput({'fileName1','fileName2'},{'Text describing fileName1','Text describing fileName2'}) The second cell array gives the text displayed in the legend.

Any of the inputs can be omitted using an empty array: [], so if you want to plot just a few channels, you can call it this way:

PlotFASToutput({'fileName1','fileName2'},{'Text describing fileName1','Text describing fileName2'},[],{'GenTq','BldPitch1'}) Channels input can be either a cell array of names (corresponding to the reference file, which I omitted here but you can specify) or as column numbers in an array.

If you type help PlotFASToutput it will display what the rest of the options are.

Dear Bonnie,

I appreciate your prompt help. Now I’m able to draw a PSD graph for several channels of multiple files in one single plot. For convenience of subsequent researchers who may have same question like me, I poster here the command I used following Bonnie’s help:

PlotFASToutput({‘fileName1’,‘fileName2’},{‘Text describing fileName1’,‘Text describing fileName2’},[],{‘RtSpeed’,‘RtAeroCp’,‘RtAeroCq’},[1],{[],8,7,8},[1],[0])

Kind regards
Yingyi Liu

Dear Bonnie,

I followed the above method to do an analysis for the rotor-aerodynamic-power(RtAeroPwr) time series of AWT-27CR2 turbine in the Test03 example in FAST_v8.15.00a-bjj released version. My intention was to see the influence of tower shadow on turbine power and loading. Therefore I ran the FAST program twice, and obtained the time series data as attached.

I draw the PSD plot for the two time series data using your matlab code PlotFASToutput. At the meanwhile, I also used a Matlab code named dat2spec.m in WAFO open-source toolbox, which is often used for power spectrum plot in metocean field. The figure is attached here:

Note that, in order to see the nP effects, I normalised the frequency axis by the frequency of the mean rotor rotation speed fRotor=54.34/60.

As we can expect, for the two-bladed turbine, the presence of tower shadow will induce the nP (n is 2,4,6,8…) effect. However, I can see the two plots are not consistent, the peak frequencies in the first plot do not exactly coincide with the nP frequencies. I’m not sure what the possible reason is. Do you have any comment or guidance on fixing this problem? Thanks a lot.

Kind regards
Yingyi Liu
RotAeroPwrTimeSeries.csv (109 KB)

Hi, Yingyi Liu.

I plotted the CertTest 03 results using the PlotFASToutput() function, using the normalization you specified. My results match up with the nP frequencies, as you’d expect. So, I’m not sure what you are plotting. I did verify that you have the same time series (at least for the first 20 seconds that I ran it)

Hi, Bonnie,

Your answer reminds me of the influence of computation time on the spectral analysis. Finally I find that a parameter called “TStart” in the Test03.fst matters a lot, which specifies the “Time to begin tabular output”. Another parameter called “TMax” in the same file also matters, but not as significantly as “TStart”. To show you the reason, I plot the following figures.

At first step, I calculated for the default set values TStart= 10s and TMax= 20s, the PSD plot looks like this:


The Figure (a) is exactly the same as you ploted, the peak frequencies occurs at 1P, 2P, 3P, 4P,…,etc. (odd and even).

If I set the values to be TStart= 0s and TMax= 20s, the PSD plot is:


Note that in Figure (b), the peak frequencies occurs at 2P, 4P, 6P, 8P…,etc. (even mode only). This result matches up with our usual knowledge of nP frequencies for two-bladed wind turbines.

(As maximum 3 attachments are allowed in one post, I will continue in the next post below.)

Hi, Bonnie,

(This post is to continue the previous post.)

If I calculated for a sufficient long time for Tmax, e.g., TStart= 10s and TMax= 500s, the PSD plot looks like this:


And if I set the beginning time for tabular output from the very beginning, as TStart= 0s and TMax= 500s, the PSD plot is:


As you can see, the Figure (c) does not match up with the nP frequencies (there are gradually increasing shifts between its peak frequencies and the nP frequencies) while the Figure (d) matches up with them. Another point worth to note is the difference between the two plots in the low-frequency region (difference below frequency at 2).

The above analysis seems to reveal the big influence of the “TStart” parameter when using the PlotFASToutput() function. But I’m curious about the default setting of “TStart= 10s”, is it a really neccessary substitution for “TStart= 0s” for obtaning the steady time series output? (Probably this question shall come to Dr.Jason)

Thank you so much in advance for clearing up my confusions. ^^

Kind Regards,
Yingyi Liu

Your comment about TStart indicated a problem in PlotFASToutput’s call to the function that calculates the PSD. I was not computing the delta frequency with TStart, so we ended up with some strange results when TStart isn’t 0.

I have fixed the code in the MATLAB_Toolbox git repo, here: github.com/NWTC/MATLAB_Toolbox/ … SToutput.m

Dear Bonnie,

I notice that you have changed the code of PlotFASToutput.m in Line 339 from:
[ f1, Sf1 ] = getPSD( outData{iFile,2}(1:n,i), 1/outData{iFile,1}(n) )
to
[ f1, Sf1 ] = getPSD( outData{iFile,2}(1:n,i), 1/(outData{iFile,1}(n) - outData{iFile,1}(1)) )
Now the problem has been fixed.

The Figure (a) now looks like:


and the Figure(c) now becomes:


In addition, it seems that my previous understanding about the TStart is incorrect. The default setting of TStart= 10s seems to be neccessary since otherwise the PSDPlot will be inaccurate if the time series data of 0~10s are included for the PSD analysis.

Indeed, though I noticed that it might be sensible to change 1/TMax with 1/(TMax-TStart) as well, I was not capable of modifying the code in the script, which made me worried. Therefore I turned to you, and your answer now helps me understand in more depth about the code you written. Thank you so much for your prompt answer for this issue, and we appreciate very much for the additional effort you have made in your spare time after daily works.

Best Regards,
Yingyi Liu