## Harp_opt help

Discuss tidal-current device design and modeling

Moderator: Bonnie.Jonkman

Ruben.Gutierrez
Posts: 2
Joined: Wed Jul 20, 2016 2:12 pm
Organization: University of the Basque Country (UPV/EHU)
Location: Spain-Vitoria/Gasteiz
Contact:

### Re: Harp_opt help

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.

Danny.Sale
Posts: 40
Joined: Tue Jul 13, 2010 4:55 pm

### Re: Harp_opt help

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

Danny.Sale
Posts: 40
Joined: Tue Jul 13, 2010 4:55 pm

### Re: Harp_opt help

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

Ha.Tran wrote: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)

(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.

I do not know how to fix this error.

I will be very grateful for this help.

Thank you so much!

Ruben.Gutierrez
Posts: 2
Joined: Wed Jul 20, 2016 2:12 pm
Organization: University of the Basque Country (UPV/EHU)
Location: Spain-Vitoria/Gasteiz
Contact:

### Re: Harp_opt help

Danny.Sale wrote: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

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)

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?

Rubén

Danny.Sale
Posts: 40
Joined: Tue Jul 13, 2010 4:55 pm

### Re: Harp_opt help

hi Rubén,

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

Code: Select all

Error using .*
Matrix dimensions must agree.

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

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: https://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!

### Who is online

Users browsing this forum: No registered users and 1 guest