Documentation ¶
Overview ¶
Package gorow package to simulate the physics rowing (sport)
Index ¶
- Constants
- Variables
- func AddBearing(strokes []StrokeRecord)
- func AddStream(strokes []StrokeRecord, vstream float64, unit string)
- func AddWind(strokes []StrokeRecord, vwind float64, winddirection float64, unit string)
- func AverageHR(strokes []StrokeRecord) float64
- func AveragePower(strokes []StrokeRecord) float64
- func AverageSPM(strokes []StrokeRecord) float64
- func BladeForce(oarangle float64, rigging *Rig, vb, fblade float64) ([]float64, error)
- func ConstSpace(value float64, N int) []float64
- func ConstantVeloFast(velo float64, crew *Crew, rigging *Rig, timestep float64, aantal int, ...) ([]float64, error)
- func ConstantWattFast(watt float64, crew *Crew, rigging *Rig, timestep float64, aantal int, ...) ([]float64, error)
- func DragEq(displacement float64, velo float64, alfaref float64, doprint int, ...) float64
- func EnergyBalance(F float64, crew *Crew, rigging *Rig, v0 float64, dt float64, ...) ([]float64, error)
- func LinSpace(start float64, stop float64, N int) ([]float64, error)
- func OTWSetPower(strokes []StrokeRecord, c *Crew, rg *Rig, secret string, progressurl string, ...) error
- func PhysGetPower(velo float64, rower *Crew, rigging *Rig, bearing float64, vwind float64, ...) ([]float64, error)
- func Stroke(F float64, crew *Crew, rigging *Rig, v0 float64, dt float64, aantal int, ...) ([]float64, error)
- func StrokeFieldMapping(field string) (string, error)
- func WorkoutMetrics(filename string, ftp float64, sex string, hrftp, hrmax, hrmin float64) (tss, normp, trimp, hrtss, normv, normw float64, err error)
- func WriteCSV(strokes []StrokeRecord, f string, overwrite bool, gz bool) (ok bool, err error)
- func WriteParquet(strokes []StrokeRecord, f string, overwrite bool, gz bool) (ok bool, err error)
- type CosinusRecovery
- type Crew
- type Flat
- type FlatRecovery
- type ForceProfile
- type RecoveryProfile
- type Rig
- type SinusRecovery
- type SinusRecovery2
- type StrokeRecord
- type StrongBegin
- type StrongEnd
- type StrongMiddle
- type StrongMiddle2
- type Trapezium
- type Trapezium2
- type TriangleRecovery
Constants ¶
const CLmax = 1.0
CLmax maximum lift coefficient for blade
const Cdw = 1.1 // for all boats, big approximation
Cdw drag constant
const LbstoN = 4.44822
LbstoN convert lbs of force to Newton
const N = 50
N Number for bladeforce
const RhoAir = 1.226 // kg.m3
RhoAir air density
const Scull = "scull"
Scull string
Variables ¶
var RigCoastalLiteboat = NewRig(0.9, 35, 2.655, 1.6, 0.88, "scull", -0.93, 0.0822, 0.46, 1, 1.121)
RigCoastalLiteboat coastal1x
var RigCoastalMaas = NewRig(0.9, 18, 2.655, 1.6, 0.88, "scull", -0.93, 0.0822, 0.46, 1, 1.121)
RigCoastalMaas coastal1x
var RigDouble = NewRig(0.9, 27, 2.655, 1.6, 0.88, "scull", -0.93, 0.0822, 0.46, 2, 1.05)
RigDouble 2x
var RigEight = NewRig(1.14, 151, 3.205, 1.6, 0.88, "row", -0.93, 0.1174, 0.545, 8, 1)
RigEight 8+
var RigFour = NewRig(1.14, 50, 3.205, 1.6, 0.88, "row", -0.93, 0.1174, 0.545, 4, 1)
RigFour 4-
var RigPair = NewRig(1.14, 27, 3.205, 1.6, 0.88, "row", -0.93, 0.1174, 0.46, 2, 1.05)
RigPair 2-
var RigQuad = NewRig(0.9, 52, 2.655, 1.6, 0.88, "scull", -0.93, 0.0822, 0.46, 4, 1.11)
RigQuad 4x
var RigSingle = NewRig(0.9, 14, 2.655, 1.6, 0.88, "scull", -0.93, 0.0822, 0.46, 1, 0.98)
RigSingle 1x
Functions ¶
func AddBearing ¶
func AddBearing(strokes []StrokeRecord)
AddBearing returns a stroke set with bearing
func AddStream ¶
func AddStream(strokes []StrokeRecord, vstream float64, unit string)
AddStream adds river stream
func AddWind ¶
func AddWind(strokes []StrokeRecord, vwind float64, winddirection float64, unit string)
AddWind adds wind speed and direction
func AverageHR ¶
func AverageHR(strokes []StrokeRecord) float64
AverageHR calculates average heart rate
func AveragePower ¶
func AveragePower(strokes []StrokeRecord) float64
AveragePower calculates average power
func BladeForce ¶
BladeForce calculates the blade slip given a handle force
func ConstSpace ¶
ConstSpace to create a array of value
func ConstantVeloFast ¶
func ConstantVeloFast( velo float64, crew *Crew, rigging *Rig, timestep float64, aantal int, aantal2 int, Fmin float64, Fmax float64, catchacceler float64, windv float64, dowind bool, ) ([]float64, error)
ConstantVeloFast calculates force and power to achieve certain boat speed
func ConstantWattFast ¶
func ConstantWattFast( watt float64, crew *Crew, rigging *Rig, timestep float64, aantal int, aantal2 int, Fmin float64, Fmax float64, catchacceler float64, windv float64, dowind bool, maxIterationsAllowed int, ) ([]float64, error)
ConstantWattFast returns force, average speed given input power in Watt
func DragEq ¶
func DragEq(displacement float64, velo float64, alfaref float64, doprint int, constantdrag int) float64
DragEq calculates drag
func EnergyBalance ¶
func EnergyBalance( F float64, crew *Crew, rigging *Rig, v0 float64, dt float64, catchacceler float64, windv float64, dowind bool, ) ([]float64, error)
EnergyBalance calculates one stroke with average handle force as input
func OTWSetPower ¶
func OTWSetPower( strokes []StrokeRecord, c *Crew, rg *Rig, secret string, progressurl string, powermeasured bool, verbose bool) error
OTWSetPower adds power for OTW rows
func PhysGetPower ¶
func PhysGetPower( velo float64, rower *Crew, rigging *Rig, bearing float64, vwind float64, winddirection float64, vstream float64, ) ([]float64, error)
PhysGetPower Gets power and no wind pace
func Stroke ¶
func Stroke( F float64, crew *Crew, rigging *Rig, v0 float64, dt float64, aantal int, catchacceler float64, dowind bool, windv float64, ) ([]float64, error)
Stroke calculates a few (aantal) strokes and returns parameters averaged over those strokes
func StrokeFieldMapping ¶
StrokeFieldMapping maps StrokeRecord field names to CSV header names
func WorkoutMetrics ¶
func WorkoutMetrics( filename string, ftp float64, sex string, hrftp, hrmax, hrmin float64, ) (tss, normp, trimp, hrtss, normv, normw float64, err error)
WorkoutMetrics calculates workout level metrics (TSS, TRIMP and more)
func WriteParquet ¶
WriteParquet writes data to Parquet
Types ¶
type CosinusRecovery ¶
CosinusRecovery recovery profile
type Crew ¶
type Crew struct { Mc float64 Strokelength float64 Tempo float64 Frac float64 // recprofile = sinusrecovery() Recoveryprofile RecoveryProfile // Strokeprofile = trapezium(X1=0.15,X2=0.5,H2=0.9) Strokeprofile ForceProfile // technique = technique_meas() Maxpower float64 Maxforce float64 }
Crew class with rower quantities
type ForceProfile ¶
type ForceProfile interface {
// contains filtered or unexported methods
}
ForceProfile interface forceprofile
type RecoveryProfile ¶
type RecoveryProfile interface {
// contains filtered or unexported methods
}
RecoveryProfile interface
type Rig ¶
type Rig struct { Lin float64 Mb float64 BladeLength float64 Lscull float64 Nrowers int32 RowOrScull string Span float64 CatchAngle float64 DragForm float64 // contains filtered or unexported fields }
Rig holds boat rigging parameters and has methods to manipulate them
type SinusRecovery2 ¶
SinusRecovery2 recovery profile
type StrokeRecord ¶
type StrokeRecord struct { Timestamp float64 `rowingdata:"TimeStamp (sec)" parquet:"name=time, type=DOUBLE, encoding=PLAIN_DICTIONARY"` Distance float64 `rowingdata:" Horizontal (meters)" parquet:"name=distance, type=DOUBLE"` Spm float64 `rowingdata:" Cadence (stokes/min)" parquet:"name=spm, type=DOUBLE"` Hr float64 `rowingdata:" HRCur (bpm)" parquet:"name=hr, type=DOUBLE"` Pace float64 `rowingdata:" Stroke500mPace (sec/500m)" parquet:"name=pace, type=DOUBLE"` Power float64 `rowingdata:" Power (watts)" parquet:"name=power, type=DOUBLE"` Drivelength float64 `rowingdata:" DriveLength (meters)" parquet:"name=drivelength, type=DOUBLE"` Strokedistance float64 `rowingdata:" StrokeDistance (meters)" parquet:"name=distanceperstroke, type=DOUBLE"` Drivetime float64 `rowingdata:" drivetime"` Dragfactor int64 `rowingdata:" DragFactor"` Strokerecoverytime float64 `rowingdata:" StrokeRecoveryTime (ms)"` Workperstroke float64 `rowingdata:" WorkPerStroke (joules)" parquet:"name=driveenergy, type=DOUBLE"` Averageforce float64 `rowingdata:" AverageDriveForce (lbs)" parquet:"name=averageforce, type=DOUBLE"` Peakforce float64 `rowingdata:" PeakDriveForce (lbs)" parquet:"name=peakforce, type=DOUBLE"` Velo float64 `rowingdata:" Speed (m/sec)" parquet:"name=velo, type=DOUBLE"` Lapnr int64 `rowingdata:" lapIdx"` Intervaltime float64 `rowingdata:" ElapsedTime (sec)"` Calories float64 `rowingdata:" Calories (kCal)"` Workoutstate float64 `rowingdata:" WorkoutState" parquet:"name=workoutstate, type=DOUBLE"` Latitude float64 `rowingdata:" latitude"` Longitude float64 `rowingdata:" longitude"` Bearing float64 `rowingdata:" bearing"` Nowindpace float64 `rowingdata:"nowindpace" parquet:"name=nowindpace, type=DOUBLE"` Equivergpower float64 `rowingdata:"Equiv erg Power" parquet:"name=equivergpower, type=DOUBLE"` Modelpower float64 `rowingdata:"power (model)"` Modelfavg float64 `rowingdata:"averageforce (model)"` Modeldrivelength float64 `rowingdata:"drivelength (model)"` Vwind float64 `rowingdata:"vwind"` Winddirection float64 `rowingdata:"winddirection"` Vstream float64 `rowingdata:"vstream"` }
StrokeRecord sort of dataframe
func ReadCSV ¶
func ReadCSV(f string) ([]StrokeRecord, error)
ReadCSV reads rowing data into data frame from CSV file or gzipped CSV file with extension .csv.gz
func ReadParquet ¶
func ReadParquet(f string) ([]StrokeRecord, error)
ReadParquet reads rowing data into data frame from Parquet file
type StrongMiddle ¶
type StrongMiddle struct {
Frac float64
}
StrongMiddle stroke profile with strong middle
type StrongMiddle2 ¶
type StrongMiddle2 struct {
Frac float64
}
StrongMiddle2 stroke profile, alternative with strong middle
type TriangleRecovery ¶
type TriangleRecovery struct {
X1 float64
}
TriangleRecovery recovery profile