Harp_opt help

I have designed a research hydro kinetic turbine for my PhD research work and want to optimize plus validate it through harp_opt. I have checked the harp code with the provided case of 1MW wind turbine case and it worked well. But for the provided case of 200kw hydro kinetic case, with VSVP, it give error. whereas for FSFP option selected, it goes into a never ending cycle of creating generations and finds non as feasible. I have also tried it with the approximate setting for the NREL 550 KW turbine but it creates only one generation with VSVP selected and then gives some errors. the first error as (Error in ==> Main at 127 OmgCC = TSR_Opt.*V.*30/(pi.*RotorRad);). Please some body help me with the issue and provide me some GUI setting for any hydro kinetic turbine or through any mean possible.

hello Mujahid,

Regarding the repeated cycles of infeasible solutions, I think this is because the constraints could be set too tightly. Try changing the upper/lower limits on your design variables to increase the range, and hopefully the code should find more feasible solutions. I think the problem you are facing has been discussed in this thread: http://forums.nrel.gov/t/harp-opt-cavitation-constraint/730/5 My guess is that cavitation constraint is giving you problem, and best way to remedy is to limit the maximum rotor speed. Hope that helps, otherwise you could try describing your input values and error messages in more detail.

~Danny

Thanks a lot. I will soon shear my experience.
Best Regards

Hi ,
I have tried different combinations of settings but still the problem of “not finding the feasible solution and continuous generation creation”, exists. I have also tried it with the cavitation check disabled and using different bounds as you directed. Regarding the applied GUI setting, i have used the settings for 200 KW Hydro kinetic turbine provided in the Harp downloaded package. I am trying to attach the GUI settings but its not getting attached with this post. I will send you the setting through email.

Best Regards

hi Mujahid,

I thought of another cause. Often the code will crash because something crashed the WT_Perf code … the WT_Perf code is not always robust and HARP_Opt was supposed to detect if WT_Perf crashed while reading the output files of WT_Perf. After you get this error message, can you check if the WT_Perf output files (*.oup and *.bed) have empty or nonsensical values? Sometimes tweaking some of the WT_Perf solver parameters can help fix this.

thanks,
Danny

Hi Dany,
Thanks for your continued support. Output file *.oup is empty as you predicted and *.bed is not available in the output file folder. Plz guide me how to rectify the problem.
Thanking in anticipation.
Best Regards

Hi Mujahid,

maybe first try decreasing tolerance and increasing maximum iterations (and next maybe change TI_SINGULARITY or other parameters) within the section labeled “BEMT Options” … and if that cannot help then HARP_Opt v2 does not recognize the WT_Perf error. And then I suggest trying v3 (github.com/andrewning/HARP_Opt).

hope that helps,
~Danny

Hi Danny,
Thanks for your continued support. Wt_Perf runs out side the Harp_opt on my computer. I have checked it with various input files and settings and it worked well.
But when i run Harp_opt V3, it gives the following errors.

Warning: Out of range or non-integer values truncated during conversion to character.

In parseOptimizationOptions at 40
In HARP_Opt at 66
Error using readOutFileWTPerf (line 22)
ERROR: Could not locate and open file C:\Users\Acer
pc\Documents\MATLAB\HARP_Opt-master\Output\test_FSFP\test_FSFP.oup

Error in wtperf_CC (line 37)
WTPoup = readOutFileWTPerf(SIM,WTP,‘cc’);

Error in optAero (line 32)
WTPoup = wtperf_CC(state,WTP,SIM,TURB,CAV,ENV,BLADE);

Error in optFitness (line 30)
[f(1), BLADE, WTP, WTPoup] = optAero(x_aero, SIM,OPT,TURB,BLADE,ENV,WTP,CAV,state);

Error in HARP_Opt_Init>@(x0)optFitness(x0,SIM,OPT,TURB,BLADE,ENV,WTP,CAV,state) (line
246)
OPT.objective = @(x0) optFitness(x0,SIM,OPT,TURB,BLADE,ENV,WTP,CAV,state);

Error in funevaluate (line 41)
f = feval(FUN,reshapeinput(Xin,X),varargin{:});

Error in poptimfcnchk (line 20)
[y,count] = funevaluate(FUN,Xin,X,‘init’,[],[],objFcnArg{:});

Error in patternsearch (line 342)
[Iterate,OUTPUT.funccount] = poptimfcnchk(FUN,nonlcon,initialX,Iterate, …

Error in HARP_Opt (line 180)
case ‘PatternSearch’; [OPT.xBest, OPT.fval, OPT.exitflag, OPT.output]
= patternsearch(OPT.objective, OPT.x0, OPT.Aineq, OPT.bineq, [], [], OPT.lb,
OPT.ub,
Caused by:
Failure in initial user-supplied objective function evaluation. PATTERNSEARCH cannot
continue.

Please help me debug these errors

Best Regards

Hi Danny,
I am back to work after a long week end. The entire out put directory is attached by the name mujahid_FSFP. The input file used is the same as test_FSFP. I have just changed the name of the input file. Hope you will find an answer.
one more thing, does these errors have some thing to do with the location of the other files that Harp uses on my computer.

Best Regards
mujahid_FSFP.zip (362 KB)

Hi Mujahid,

it appears you are using directory names containing “spaces”, Matlab has some trouble with this sometimes. Try renaming “Acer pc” to something like “Acer_pc”, this is what the Matlab error is indicating.

~Danny

Hi Danny,
Thanks for your continued support. Harp code has started working. I have used it for several cases. I still have some problem with understanding some of the parameters like the hub dia and circular root. I am working on it and will share my thoughts if unable to understand.

Thanks a lot once again.

Best Regards

Hi,
All the new user of the HARP_Opt follow the procedure below:(Note: the procedure is only valid for users who have already Matlab installed on their systems)

  1. Go to the link github.com/NREL/HARP_Opt? and download the archive Harp_opt-master.
  2. Save the archive to a location of your choice. Ensure that none of the folder name on the path to the code contain space.
  3. On the Matlab command prompt make the folder containing the Harp_Opt-master as your current folder.
    4.On the command window enter HARP_Opt test_FSFP.inp and press enter. The test_FSFP is one of the input file provided in the input folder of the down loaded archive.
  4. Make a copy of one of the input files and make necessary changes according to your own requirement.
  5. Repeat the procedure as in 4 for your created input file.
  6. The out put files for your designed turbine are stored in the output folder by the name as of your input file.
  7. Enjoy this excellent code and keeping sharing your problems and experiences on this forum.

Best Regards

Hi Danny and Mujahid Badshah,

I design a horizontal axis tidal turbine using BEM theory. Now, I try to use Harp_opt v3 for the purpose of optimizing. However, as I run VSFP case, I encounter the following error:

Attempted to access WTPoup.rpm(2); index out of bounds because
numel(WTPoup.rpm)=0.

Error in optAero (line 121)

Error in optFitness (line 14)

Error in HARP_Opt_Init>@(x0)optFitness(x0,SIM,OPT,TURB,BLADE,ENV,WTP,CAV,state)
(line 230)

Error in funevaluate (line 41)

Error in poptimfcnchk (line 20)

Error in patternsearch (line 354)

Error in HARP_Opt (line 165)

Caused by:
Failure in initial user-supplied objective function evaluation.
PATTERNSEARCH cannot continue.

MATLAB[i]:badsubscript

I do not know how to fix this error.

Please help me to solve this problem.

I will be very grateful for this help.

Thank you so much!

Hi,
At the moment I am unable to give you a specific reply. But I will suggest you to try using other optimization algorithms available in the code like genetic algorithm etc.,.
I also think that, your BEM design can also cause this problem. So, as a second step try using more flexible constraints instead of using very strict constraints that you already have from your BEM design. As a third step, I will suggest that you should start from the design cases provided in the code. Then make step wise changes and obtain solution after each change, to shape the parameters to closely match your design.

Best Regards

Hi Mujahid Badshah,

Due to your suggestion, I can run Harp_opt v3 successfully.

I am really happy for this.

Thank you very much.

Best regards,
Ngoc Ha Tran.

Hi guys!
My name is Ruben and I am studying for a mechanical engineering degree. My final project is based on a stall regulated rotor design. The HAWT,which is used in my project, is composed of three blades with a rated power of 100KW. The aim is to delete the pitch mechanism in order to use a variable speed control system with a fixed pitch, so a stall-regulated wind turbine is required.

In order to make it possible, I am using HARP_Opt v3 with Matlab since I don’t know how to install the fourth version with Python.

I was interested in watching the slope in the power graph for a wind velocity of 15 m/s, and I have obtained a quite visual result for a FSFP configuration. Then I have simulated the distribution of HARP_Opt with the same characteristics in WT_Perf:


So here it’s the first question: Why the graphs are different? The solution with WT_Perf seems to be the best one for a stall-regulated because the slope is smaller.

Then, I tried to simulate the rotor with a VSFP configuration and a range of rotational speed of 16-50 rpms (the real case). But when the iterations finish I get this loop in Matlab without a final result:

Why does it happen?

Sorry for the large paragraphs. I am very grateful to your work with HARP_Opt, it’s a good resource to make a research about this subject.

Thanks in advance, Regards!

hi Ruben,

Which optimization method did you use, and are you running the multiple objective mode (which adds the structural objective)? And are you saying that the data in the *.xls spreadsheet is different than the data in the corresponding WT_Perf input file?

thanks,
Danny

hello, did you manage to resolve this problem related to the errors in optAero.m and optFitness.m? I checked it today and uploaded a quick bugfix to GitHub, maybe this resolves the error you received. It sounds like you ran the ‘test_VSFP.inp’ example … it worked for me now without error, let me know your experience.

Also, to address some other questions in this thread, check to see that you can actually run WT_Perf on your systems, there is one thing to tweak in the HARP_Opt input file depending if you are Windows, Max, or *nix. Some of the errors you all mention indicate that WT_Perf did not actually run, you may need to recompile it on your specific system. That’s my best idea at the moment ;)

cheers,
Danny

Hi Danny!
I meant that the HARP_Opt’s results are different in a high wind velocity from ones obtained with WT_Perf. I think that you are right about the OPT.STRUCT configuration, it may be my mistake. But I can’t fix it:
These are the optimization settings which have been previously chosen in Harp Opt :

I didn’t use a multiple objective method because if I did it with a configuration of WT_Perf in OPT.STRUCT, I will obtain the following error:

Error using .*
Matrix dimensions must agree.

Error in calcAEP (line 29)
avgPwr = trapzf(VEL, pwr.*VEL_DIST);

Error in optAero (line 130)
aep = calcAEP(ENV.VEL, WTPoup.power, ENV.FLOW_DIST, ENV.VEL_DIST);

Error in optFitness (line 30)
[f(1), BLADE, WTP, WTPoup] = optAero(x_aero, SIM,OPT,TURB,BLADE,ENV,WTP,CAV,state);

Error in HARP_Opt_Init>@(x0)optFitness(x0,SIM,OPT,TURB,BLADE,ENV,WTP,CAV,state) (line 246)
OPT.objective = @(x0) optFitness(x0,SIM,OPT,TURB,BLADE,ENV,WTP,CAV,state);

Error in funevaluate (line 40)
f = feval(FUN,reshapeinput(Xin,X),varargin{:});

Error in poptimfcnchk (line 19)
[y,count] = funevaluate(FUN,Xin,X,‘init’,[],[],objFcnArg{:});

Error in patternsearch (line 343)
[Iterate,OUTPUT.funccount] = poptimfcnchk(FUN,nonlcon,initialX,Iterate, …

Error in HARP_Opt (line 180)
case ‘PatternSearch’; [OPT.xBest, OPT.fval, OPT.exitflag, OPT.output] =
patternsearch(OPT.objective, OPT.x0, OPT.Aineq, OPT.bineq, [], [], OPT.lb, OPT.ub, [], OPT.options);

Caused by:
Failure in initial user-supplied objective function evaluation. PATTERNSEARCH cannot continue.

What I have to do to fix it?
What do you think about my second question in the previous post about the matlab loop with VSFP?

Thanks in advance,
Rubén

hi Rubén,

The part of the error message that I suspect is important is:

[code]Error using .*
Matrix dimensions must agree.

Error in calcAEP (line 29)
avgPwr = trapzf(VEL, pwr.*VEL_DIST);[/code]

and I wonder if pwr and VEL_DIST are the same size. VEL_DIST is the velocity probability distribution, and is defined within the Inputs/Inflow_Data folder. Can you check if this file maybe has some mistake in it? The file should look similar to: github.com/NREL/HARP_Opt/blob/m … _20mHH.dat

Also, check your value of ENV.FLOW_DIST, maybe you can try the ‘Rayleigh’ or ‘Weibull’ options. And then the ‘Hist’ if you create a similar inflow data file.

Hope that helps!