-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathppi.txt
120 lines (98 loc) · 3.74 KB
/
ppi.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
"Auto-Select stage weighting factor"
"If the stage is not a prologue, for various reasons."
@climb:=max(elevation)-min(elevation),
@coe:=if(@climb>200 or duration>3600,4.7,2.7),
"Time evaluate in seconds",
@tim:=duration"s",
"MMP Range Today - days to calc MMP",
"We have chosen 44 days, but it can be changed to 90 days."
@desde:=date-44,
@hasta:=date,
"Weight in Kg",
@peso:=metric(weight),
"MAX POWER 1sec",
@init:=max(athleterange(@desde,@hasta,meanmax(power,1)))/@peso,
"If the rider has no longer durations, take the next previous one.",
@mmp5:=max(athleterange(@desde,@hasta,meanmax(power,5)))/@peso,
@mmp30:=max(athleterange(@desde,@hasta,meanmax(power,30)))/@peso,
@mmp60:=max(athleterange(@desde,@hasta,meanmax(power,60)))/@peso,
@mmp2m:=max(athleterange(@desde,@hasta,meanmax(power,120)))/@peso,
@mmp5m:=max(athleterange(@desde,@hasta,meanmax(power,300)))/@peso,
@mmp10m:=max(athleterange(@desde,@hasta,meanmax(power,600)))/@peso,
@mmp20m:=max(athleterange(@desde,@hasta,meanmax(power,1200)))/@peso,
@mmp30m:=max(athleterange(@desde,@hasta,meanmax(power,1800)))/@peso,
@mmp60m:=max(athleterange(@desde,@hasta,meanmax(power,3600)))/@peso,
@hay:=isValid(athleterange(@desde,@hasta,max(meanmax(power,7200)))),
@mmp120m:=if(@hay,MAX(athleterange(@desde,@hasta,max(meanmax(power,7200)))),@mmp60m)/@peso,
@hay:=isValid(athleterange(@desde,@hasta,max(meanmax(power,10800)))),
@mmp180m:=if(@hay,MAX(athleterange(@desde,@hasta,max(meanmax(power,10800)))),@mmp120m)/@peso,
@hay:=isValid(athleterange(@desde,@hasta,max(meanmax(power,14400)))),
@mmp240m:=if(@hay,MAX(athleterange(@desde,@hasta,max(meanmax(power,14400)))),@mmp180m)/@peso,
@calc5 :=@mmp5*100/@init,
@calc30 :=@mmp30*@calc5/@mmp5,
@calc60 :=@mmp60*@calc30/@mmp30,
@calc2m :=@mmp2m*@calc60/@mmp60,
@calc5m :=@mmp5m*@calc2m/@mmp2m,
@calc10m :=@mmp10m*@calc5m/@mmp5m,
@calc20m :=@mmp20m*@calc10m/@mmp10m,
@calc30m :=@mmp30m*@calc20m/@mmp20m,
@calc60m :=@mmp60m*@calc30m/@mmp30m,
@calc120m:=@mmp120m*@calc60m/@mmp60m,
@calc180m:=@mmp180m*@calc120m/@mmp120m,
@calc240m:=@mmp240m*@calc180m/@mmp180m,
"rango de indice, uso el modulo por las dudas",
@z11:=abs(@calc60m-@calc120m),
@z12:=abs(@calc120m-@calc180m),
@z13:=abs(@calc180m-@calc240m),
@z21:=abs(@calc20m-@calc30m),
@z22:=abs(@calc30m-@calc60m),
@z31:=abs(@calc5m-@calc10m),
@z32:=abs(@calc10m-@calc20m),
@z41:=abs(@calc60-@calc2m),
@Z42:=abs(@calc2m-@calc5m),
@z51:=abs(@calc5-@calc30),
@z52:=abs(@calc30-@calc60),
@z61:=abs(100-@calc5),
@z62:=abs(@calc5-@calc30),
@z6cf:=(@z61+@z62)/2,
@z5cf:=(@z51+@z52)/2,
@z4cf:=(@z41+@z42)/2,
@z3cf:=(@z31+@z32)/2,
@z2cf:=(@z21+@z22)/2,
@z1cf:=(@z11+@z12+@z13)/3,
@levels:=(
(
{@Z1VT1,@Z2MLSS,@Z3VT2,@Z4MAP,@Z5ANEXT,@Z6ANINT,@IGNORE},
bin(power,li(athleterange(@desde,@hasta,@mmp:=meanmax(power),{@mmp,((,xx(@mmp)[-1])+1,1),((,xx(@mmp)[-1])+14400,0)}),
{14400,7200,1800,600,120,10}))
) )/sum(duration"bike"),
"termino de calcular el ppi",
@pz1:=@levels[0],
@pz2:=@levels[1],
@pz3:=@levels[2],
@pz4:=@levels[3],
@pz5:=@levels[4],
@pz6:=@levels[5],
@ign:=@levels[6],
"zonas via MMP",
@levels:=(
(
{@Z1VT1,@Z2MLSS,@Z3VT2,@Z4MAP,@Z5ANEXT,@Z6ANINT,@IGNORE},
bin(power,li(athleterange(@desde,@hasta,@mmp:=meanmax(power),{@mmp,((,xx(@mmp)[-1])+1,1),((,xx(@mmp)[-1])+14400,0)}),
{14400,7200,1800,600,120,10}))
) )/sum(duration"bike"),
"termino de calcular el ppi",
@pz1:=@levels[0]*100,
@pz2:=@levels[1]*100,
@pz3:=@levels[2]*100,
@pz4:=@levels[3]*100,
@pz5:=@levels[4]*100,
@pz6:=@levels[5]*100,
@ign:=@levels[6]*100,
@ppi:=(((@coe*@z1cf)*@pz1)+@tim+
((@coe*@z2cf)*@pz2)+@tim+
((@coe*@z3cf)*@pz3)+@tim+
((@coe*@z4cf)*@pz4)+@tim+
((@coe*@z5cf)*@pz5)+@tim+
((@coe*@z6cf)*@pz6)+@tim+
(@ign*@ign)+@tim)/100"ppi"