Jump to content

How to get the max Power?


Recommended Posts

Posted
Dear Wasp Community,

is it possible to write a command in the Html script to get the maximum of the Power for each turbine in the report view.

In detail, I want to get the value in kW at which each turbine has it´s maximum in the power curve. In Wasp you will find the data set for the power by clicking on "windturbinegenerator" on the left hand side in the workspace. The Power curve is poping up and then by clicking on data.

I guess that I first need to define the data set, maybe like see below:
Set WTG = Site.AsICalculatingHierarchyMember.CalculationByIndex(1).Associates.WindTurbineGenerator.Data.Power

as well as to add a new table and to calculate the maximum.

But do you have an idea how the correct Html comand needs to look like? I pretty much tested every combination and it wasn´t working out. I will appreciate it.

Cheers,

Windmueller
Posted
Hi "windmueller",

You can just make a loop to find the maximum value, then report that.
As you write above, you can see the power variable, and loop through its members/components (as seen in other bits of the script for e.g. other variables).
So I don't think that you would need to worry about HTML per se, as you can set the max value to an arbitrary variable via if statement and a loop (over speed bins).

Hope this helps,
--Mark
Posted
Hi "windmueller"

I think you might be asking not for the HTML command, but the correct syntax in your script code to find the power on a power curve.

If so, then you're almost right in your guess. It's a bit more long-winded, though.

Site.AsICalculatingHierarchyMember.CalculationByType(5)

.... because number 5 is for ProductionRose. Then...

.Associates.WindTurbineGenerator.SelectedPerformanceTable

...then...

.PointWithHighestPower.Power

... which returns a float. A long chain of properties, but I hope it gets you what you need.
Posted
Hi Duncan,
thank you for the answer.
You`re write. I´m searching for the correct synthax in the script code. I tried your way also with a couple of variations but there always was poping up the following error message:

"Script control reported the error:
Typenkonflikt: 'Builder.InsertClosedTableDataElement'

The last execution line attempt was for an unknown line number.
Script: 'Wind farm report (HTML)', version: 11.01.0001"

This is the synthax where I would like to add the max of the power (Nennleistung):

Builder.StartParagraphElement
Builder.StartTableElement "Border=1 CellSpacing=0 CellPadding =2 Width=100%"
Builder.StartTableRowElement
Builder.InsertClosedTableDataHeaderRowElement "Site"
Builder.InsertClosedTableDataHeaderRowElement "Rechtswert [m]"
Builder.InsertClosedTableDataHeaderRowElement "Hochwert [m]"
Builder.InsertClosedTableDataHeaderRowElement "Turbine"
Builder.InsertClosedTableDataHeaderRowElement "Elevation [m] a.s.l."
Builder.InsertClosedTableDataHeaderRowElement "Height [m] a.g.l."
Builder.InsertClosedTableDataHeaderRowElement "Net AEP [" & DataFormatting.GetAepUnits(MaxPower) & "]"
Builder.InsertClosedTableDataHeaderRowElement "Parkertrag [%]"
Builder.InsertClosedTableDataHeaderRowElement "Nennleistung max"
Builder.EndTableRowElement
Set AllSites = WindFarm.AllContributingSites
Set Site = ReportingAssistant.TypeCaster.CastMemberToTurbineSite(AllSites.FirstMember)
Do While Not Site Is Nothing
DirtyCannotCalc = False
DirtyCanCalc = False
OKCannotCalc = False
OKCanCalc = False
With Site.AsICalculatingHierarchyMember.CalculationByType(ectProductionRose)
If .Status = 1 Then
DirtyCannotCalc = True
ElseIf .Status = 3 Then
DirtyCanCalc = True
ElseIf .Status = 2 Then
OKCannotCalc = True
ElseIf .Status = 4 Then
OKCanCalc = True
End If
End With

Builder.StartTableRowElement
Builder.InsertClosedTableDataElement Site.Description
Builder.InsertClosedTableDataElement (Site.AsIRveaSite.LocationX)
Builder.InsertClosedTableDataElement (Site.AsIWaspSite.Location.Y)
If OKCanCalc Then
Builder.InsertClosedTableDataElement Site.AsICalculatingHierarchyMember.CalculationByType (ectProductionRose).Associates.WindTurbineGenerator.Description
Builder.InsertClosedTableDataElement Site.AsIWaspSite.Elevation
Builder.InsertClosedTableDataElement Site.HubHeightAgl
Builder.InsertClosedTableDataElement DataFormatting.FormatAep(Site.ProductionRose.SumOfSectorsAnnualNetProduction, False, MaxPower)
WakeAbs = Site.ProductionRose.SumOfSectorsAnnualGrossProduction - Site.ProductionRose.SumOfSectorsAnnualNetProduction
WakePerc = WakeAbs / Site.ProductionRose.SumOfSectorsAnnualGrossProduction
Builder.InsertClosedTableDataElement DataFormatting.FormatWakeLossProportion((1)-WakePerc)
Builder.InsertClosedTableDataElement

When I add your syntax code it wouldn`t work out.

Site.AsICalculatingHierarchyMember.CalculationByType(5)
Associates.WindTurbineGenerator.SelectedPerformanceTable
PointWithHighestPower.Power

Do you have an idea?
Posted
For me, it worked fine when I did this:


MaxPower = Site.AsICalculatingHierarchyMember.CalculationByType(5).Associates.WindTurbineGenerator.SelectedPerformanceTable.PointWithHighestPower.Power


MsgBox(MaxPower)
  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...