#1 2016-09-02 15:35:27

windmueller
Member
Registered: 2009-12-14
Posts: 15

How to get the max Power?

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

Offline

#2 2016-09-02 17:32:34

Mark Kelly
WAsP team
From: Risø
Registered: 2010-07-13
Posts: 42

Re: How to get the max Power?

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


Dr. Mark Kelly
WAsP Team,  Risø DTU

Offline

#3 2016-09-09 21:51:28

Duncan
WAsP team
From: Europe
Registered: 2009-05-14
Posts: 286

Re: How to get the max Power?

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.

Offline

#4 2016-09-14 11:19:00

windmueller
Member
Registered: 2009-12-14
Posts: 15

Re: How to get the max Power?

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?

Offline

#5 2016-09-19 16:44:02

Duncan
WAsP team
From: Europe
Registered: 2009-05-14
Posts: 286

Re: How to get the max Power?

For me, it worked fine when I did this:


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


MsgBox(MaxPower)

Offline

#6 2016-10-21 13:40:39

windmueller
Member
Registered: 2009-12-14
Posts: 15

Re: How to get the max Power?

Hi Duncan,

i was trying it on another pc and it was working well.
Thank you very much ;)

Cheers,

Pit

Offline

Board footer

Powered by FluxBB

[ Generated in 0.012 seconds, 10 queries executed - Memory usage: 557.87 KiB (Peak: 577.19 KiB) ]