HARP_Opt DOS messages

Hi,
I have been using HARP_Opt to design 3 bladed rotors using my own generated NACA44xx CL/CD files from book curves and profile files from the respective 4 digit NACA formulas. Haven’t build any yet. Lately I have been trying to optimize further with structural optimization (multi objective) to have an idea of how thick a carbon fiber layup had to be (8m rotor). Before, the required iterations/generations for a solution were under 150 and now I have set the limit to 350 (no other change to convergence values) without reaching a solution. My laptop is not that powerfull an the last time it took 1 and 1/2 days to reach the 350 generations without a convergence solution. The resulting EXCEL file was empty and the DOS screen had the following error messages.


                       Average            Average

Generation f-count Pareto distance Pareto spread
331 66400 0.000895492 0.324895

…snip snip snip snip snip snip snip snip snip snip snip snip snip snip snip snip snip snip snip snip snip

350 70200 0.000573077 0.217427
Optimization terminated: maximum number of generations exceeded.
Generating output files (please wait)…
??? Invoke Error, Dispatch Exception:
Source: Microsoft Excel
Description: Error en el método Copy de la clase Worksheet.
Help File: C:\Archivos de programa\Microsoft Office\Office10\3082\xlmain10.chm
Help Context ID: 0
Error in ==> HARP_Opt>Optimize_Callback at 802
Error in ==> gui_mainfcn at 96
Error in ==> HARP_Opt at 47
Error in ==>
@(hObject,eventdata)HARP_Opt(‘Optimize_Callback’,hObject,eventdata,guidata(hObje
ct))
??? Error while evaluating uicontrol Callback


Obviously the next time I will set the limit to a very big number (2000?) and use the console to eventually stop, but would like to know if this messages are known to “generation limit reached” or if I might have a compatibility problem with EXCEL. When no structural optimization is used, the EXCEL file is generated with no problem.
I do not want to find out that, lets say 600 generations are required with 4 days running and that I keep having the same problem even without the limit reach.

Thanks for any guidance and or help

Thomas Magdahl

Hi Thomas,

Your error message indicates an error with copying a worksheet in Excel. I think this error was caused when HARP_Opt created an Excel file with more worksheets than your computer could support. I did a quick internet search and found that the maximum number of Excel worksheets is limited by available memory, and this limit may have been exceeded on your computer.

Can you tell me:
What settings did you use for PopSize and ParetoFrc?
In your Excel output file, are there several empty worksheets, if so, how many?

Each worksheet in the Excel output file corresponds to a Pareto optimal solution on the Pareto frontier, and the number of Pareto optimal solutions (and resulting number of Excel worksheets) is approximately PopSize*ParetoFrc. I would suggest lowering the values for PopSize and/or ParetoFrc so that you get a smaller number of worksheets in Excel. For example, try PopSize = 50 and ParetoFrc = 0.2, which should result in around 10 worksheets in Excel. If this works you can try larger values to possibly improve the optimization. Let me know if this works for you.

Also, I would suggest using a smaller number for NumGen, the maximum number of generations for the genetic algorithm. A very large number for NumGen is not neccessary. I would suggest using the default value for NumGen, or smaller.

HARP_Opt has two convergence criteria: either a tolrance is met or a maximum number of iterations is met. When not performing a structural optimization (single-objective), I usually see HARP_Opt converge by meeting the default specified tolerance within ~50 generations, but when structural optimization is enabled (multi-objective) I have never witnessed the code converge by meeting the tolerance criteria, I’m not sure how long that would take. But I beleive that it is sufficient, and more practical, to just stop the code after a sufficient number of generations.

The largest improvements will occur in the earliest iterations (generations) of the optimization, as the iterations increase the resulting improvements usually become smaller and smaller. We can get “close enough” to the global optima with a “sufficient” number of iterations, after this point any further iterations may only yield insignificant improvements. There are uncertanties in our inputs (such as aerodynamic coefficients) and uncertainties in our predictions from blade element momentum theory. The extra effort required to see a 1% improvement in the optimization may not be worthwhile when we consider that the uncertainties in our performance predictions are much larger. Therefore, a larger number of optimization iterations is unncessary, and the default values for NumGen, or smaller, should (hopefully!) get us close enough.

Also, the speed of the code is most sensitive to the value of PopSize, so if it is running too slow for you try decreasing this value.

Hope this helps!

Cheers,
Danny Sale
University of Washington
Mechanical Engineering
phone: (865) 719-0557

Please be aware that the theory used in WT_Perf is not super accurate and the airfoil data you use is probably worse, so running a large number of generations is a waste of time.

Ideally, you should use HARP_Opt with WT_Perf to come up with a few candidate designs and then use a more-sophisticated wake model to choose the best of those. We don’t currently offer a better wake model or have any near-term plans for one, but I put it on my wish list for Santa anyway…

Hi Danny,

Sorry for the late reply but I thought I would get an email notification on reply, but just discovered I had to enable it in my profile.
Thanks for your input and I am sorry I didn’t searched myself for excel errors first!
Answering your questions:
PopSize=200
ParetoFrc=0.5
I have only changed NumGen in my runs assuming the preset values where not arbitrary chosen!
Maybe engineering deformation too, of changing as few parameters at a time :slight_smile:
The excel sheet in size and visual appearance is very similar to Output_Template.xls,
it has only one WorkSheet (Named “1”).
Using the DOS/FC command in binary mode yields only 6 different bytes (maybe file creation time or the like).
I just started to run the code using
PopSize=100
ParetoFrc=0.3
I hope memory keeps up!
I will keep you informed on the results!

Thanks

Thomas Magdahl

Hi Marshall,

Thanks for the input!
I was very reluctant to use NumGen as the ending criteria.
Not having the wake model you mention, and only concentrating
on the rotor, is there anything else that can be done to validate it?

I can imagine that if you do not change anything on the HARP interface
and run it again, the results might be slightly different due to a different
initial population. Could this be used to generate a group from where
to select the best one using some additional validation?

Thanks

Thomas Magdahl

Hi Danny,

Something new happend!
I searched google for the message and it is Matlab related, so
being a Matlab lego made it not very usefull.

It stopped at generation 143 (maximum was set to a higher value)
The DOS console was cleared from the initial and iteration updates
and only the following lines were available (the DOS console has a 10x bigger buffer):

??? The following error occurred converting from cell to double:
Error using ==> double
Conversion to double from cell is not possible.
Error in ==> gadsplot>updatelist at 197
Error in ==> gadsplot at 75
Error in ==> gamultiobjsolve at 54
Error in ==> gamultiobj at 240
Error in ==> HARP_Opt>Optimize_Callback at 774
Error in ==> gui_mainfcn at 96
Error in ==> HARP_Opt at 47
Error in ==>
@(hObject,eventdata)HARP_Opt(‘Optimize_Callback’,hObject,eventdata,guidata(hObje
ct))
??? Error while evaluating uicontrol Callback

Sorry for the “bad news” and I fear they are related to my particular configuration.
At the start of HARP there was a message warning related to locale configuration
inconsistency ( Spanish(Mexican) v/s Spanish(Chile)). Could this be the source of
the problem?

Regards

Thomas Magdahl

Hi Danny,

Please discard my previous post. It was originated on the “locale configuration” mismatch.
With respect to my original report,
PopSize=100
ParetoFrc=0.3
failed due to memory limitation as you mentioned, because
PopSize=50
ParetoFrc=0.2
produced an EXCEL file as you described.

Thanks for the help and guidance.

Thomas Magdahl

p.s. I left the PC running during the hollidays and it reached 1200 generations without stopping, and only when
I stoped it manully I got the memory error, which confirms that the way to go is set the limit yourself
knowing that generations beyond 150 o 200 do not improve the simulation much compared to other uncertainties.

Hi Thomas,

Sorry for the delay in getting back to you, I’ve been traveling over the holidays.

I’m glad the code completed successfully once you used smaller values for PopSize and ParetoFrc. This suggests that your original HARP_Opt error was due to reaching the maximum number of sheets in Excel, which is limited by your memory. If you wish to increase PopSize and ParetoFrc to achieve better results from the optimization, you might be able to determine the maximum number of sheets that Excel can support on your computer by opening the Excel output file and copying the sheet until Excel crashes. Taking note of the number of sheets that Excel can handle on your computer, you could increase PopSize and ParetoFrc such that this number is not exceeded. In the next release of HARP_Opt, I will try to add an automated check to determine if the Excel memory limitation will be exceeded before the code begins running.

That’s correct, if you run HARP_Opt multiple times with the same inputs it’s possible that you may achieve slightly different results due to the random process of the genetic algorithm, but the differences between these solutions should hopefully be insignificant. However, the state of the random number generator in MATLAB is reset each time MATLAB is restarted. So this means that if you run HARP_Opt, close the program, and then restart HARP_Opt the random number generator should be reset and you should achieve the exact same results if using the same set of inputs.

Danny Sale
University of Washington
Mechanical Engineering
phone: (865) 719-0557

Hi Danny,

It was good I was able to confirm and make tests before I made you loose time
on almost unrelated issues to the Wind Turbine topic.
I will read the HARP manual again and take a look at the files to be sure
I understand everything, but I suspect I will need to make some additional questions.
Should I start a new topic for that if I can not find an answer in the forum posts?

Thanks for your time!

Thomas Magdahl

Hi Thomas,

Please feel free to start new topics on HARP_Opt, chances are that other people may have similar questions or problems. We sincerely appreciate you testing out the code and bringing these issues to our attention so we can further improve the code. Thank you!

Danny Sale
University of Washington
Mechanical Engineering
phone: (865) 719-0557