Post by iconPost by zezo | 2017-10-13 | 20:04:57

Reposting this in separate thread on behalf of belharra

I don't have the time to maintain xls files myself, but can provide some information to someone who does, if needed.

commenticon 13 Comments
Post by iconPost by marcusbelgicus | 2017-10-13 | 20:08:27
Excellent source of information. I assume this is not including any hypotetical increase in speed coming from 'virtual' foils?
Post by iconPost by zezo | 2017-10-13 | 20:15:54
I guess not, but we can add second formula-based sheet if need be.
Post by iconPost by karriv | 2017-10-15 | 19:29:57
Great, thanks belharra and Cvetan!
Post by iconPost by toxcct | 2017-10-16 | 16:05:04
How were you (or belharra) able to build the performance sheets for each sails ?
Post by iconPost by zezo | 2017-10-16 | 16:49:19
It was not me, bit in the end you have 7 js arrays for the different sails and have to do linear interpolation between the data points.

In my code I do intermediate interpolation to 1 km/h / 1 degree resolution to simplify/speed up the run-time math a bit.

The general get_speed(twa,tws) function has to do two (binary) searches every time to get the interpolation data points.
Post by iconPost by toxcct | 2017-10-17 | 00:49:45
Sorry, I'm a bit confused... which 'get_speed()' function are you talking about ?

I guess you're talking about your polars compiler code that is not public, right ?
(because I can't see any such function named after get_speed() in your polars.js)
Post by iconPost by zezo | 2017-10-17 | 08:10:43
I don't have the exact code for the general case.

But the idea is following

Given tws, twa, arrays with twa and tws indexes and 2d polar array:

the indexes look like

"tws": [0, 2, 4, 5, 8, 10, 12, 14, 16, 18, 20, 22, 24,
"twa": [0, 20, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75,

You have to find the 4 bounding points that form square in the plane where the tws and twa are in the square

1) Find the tws index where the i-th speed is below the twa and i+1 is above
2) Same fort the twa
3) Do linear interpolation in one direction and then the other

Example: given TWA 43 and TWS 3

tws index is 1, twa index is 4 we have to interpolate between
polars[4][1], polars[4][2]
polars[5][1], polars[5][2]

The linear interpolation itself is like (for two data points, ws1 at tws[1] and ws2 at tws[2])

bs = bs1 + (bs2-bs1) * (tws - tws1)/*(tws2-tws1)

You calculate that two times for the two TWA cases and apply the same logic for the angle.

If in the example above numbers are
5 6
6 7

we get bs = 5.5 for twa 40 and 6.5 for twa 45 and then bs is 5.5 + 3/5

You can also solve the three interpolations analytically and get a single formula for the bi-linear interpolation. It looks like this

#define bilinear(x,y,A) ((A[1]+A[2]-A[0]-A[3])*x*y + (A[3]-A[2])*x + (A[0]-A[2]) * y + A[2])

where A holds the four corners and x and y are the fractional positions within the square, i.e. (tws - tws1)/*(tws2-tws1), (twa - twa1)/*(twa2-twa1)

There is additional twist above the maximum tws. Not sure if you get the last point or keep the slope defined by the last two points.
Post by iconPost by karriv | 2017-10-17 | 14:14:51
There's a handy add-on available for excel for interpolation:
Post by iconPost by Thistle1678 | 2017-10-19 | 21:50:58
If anyone is feeling motivated I'd like to see this in a single performance polar (always using the correct sail) I may chip away at it as I go...
Post by iconPost by karriv | 2017-10-25 | 11:14:09
I compiled one single polar for the Pro-sails.

If you find inconsistencies in the polar, let me know.
Post by iconPost by Alexandria | 2017-10-25 | 12:45:46
Thanks, karriv!
Post by iconPost by Saileellely | 2017-10-25 | 11:53:48
And I have one for all sails except code 0. I used conditional formatting to indicate with colours for different sails. I also generated difference in case you do have code 0: max 3% and it is only effective between 80deg and 110deg.

I don't have google drive though for sharing.
Post by iconPost by Thistle1678 | 2017-10-25 | 18:21:48
Thanks Karriv, I updated my polars from last year, but haven't tested them yet... I'll give yours a try!
Topics list
Copyright 2009 by ZEZO.ORG. All Rights Reserved.