Archivo

Archivo para Martes, 12 de julio de 2011

¿Corriendo muy rápido al principio de una carrera? No necesariamente

Martes, 12 de julio de 2011

Franela Vino Tinto 2011 - Edición Copa America
En plena Copa America, y yo ahora corriendo luciendo los colores de la Vino Tinto.

En preparación para mi carrera en el Yankee Stadium, me conseguí un excelente articulo en el sitio web de RunnersWorld, el cual explica que tan rápido hay que ir en la primera milla para tener una ventaja más que decente, sin quemarse después en el resto de la carrera. Esto se aplica para carreras de 5 kilómetros, el código es muy fácil de seguir:

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
#!/usr/bin/env python
# author: josevnz@kodegeek.com
# http://kodegeek.com/blog
import re
import sys
 
'''
Formula taken from:
http://www.runnersworld.com/article/0,7120,s6-238-244--11404-2-1-2,00.html"To
figure your 6 percent faster first mile: First convert your best 5-K
time to all seconds by multiplying the minutes by 60 and adding the
seconds. Say, you've run 24:19. That would be 24 x 60, + 19 = 1459.
Now divide this total by 3.1 (miles in 5-K) to get your average mile
time in seconds (1459/3.1 = 470.6, or about 7:51 pace). Next multiply
this figure by .94 to get a figure that's 6 percent faster (470.6 x
.94 = 4
42.36). Now divide by 60 to return the figure to minutes:seconds
(442.36/60 = 7:22). So you should aim to run your first mile in 7:22.
Good l
uck!"
'''
def calc_time(time):
       if len(time) == 0:
           return None
       if len(time[0]) > 0:
               m = re.search('(\d+):(\d+)', time[0])
               min = m.group(1)
               sec = m.group(2)
               if len(min) > 0 and len(sec) > 0:
                       secs = (int(min) * 60.0) + int(sec)
                       secs /= 3.1
                       secs *= 0.94
                       mins = secs / 60.0
                       n = re.search('(\d+)\.(\d+)', str(mins))
                       realsecs = "0." + n.group(2)
                       realsecs = round(float(realsecs) * 60)
                       return str(int(mins)) + ":" + str(int(realsecs))
       return None
 
 
if __name__ == "__main__":
       secs = calc_time(sys.argv[1:])
       print "Pace for first mile in 5K: %s" % secs

Por ejemplo, si usted hizo 22:30 en su última carrera (Bueno, eso lo hice yo :-) ):

Macintosh:python josevnz$ ./fastmile5k.py 22:30
Pace for first mile in 5K: 6:49
Macintosh:python josevnz$

¿Qué piensa usted, correr rápido al principio o ir lento y explotar gradualmente?

programación, python, vida sana