import math
from math import ceil as mC
from math import floor as mF
from math import log as LN
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from scipy.integrate import quad
import seaborn as sns
#Colors.
C = ['#440154FF', '#3B528BFF', '#21908DFF', '#5EC962FF', '#FDE725FF']
def negativeSplit() :
"""
Return the negative split pace data.
Parameters:
None.
Returns:
Set of 5001 values.
"""
n = [i for i in range(0, 5001)]
exp = 0
nsP = []
while len(n) >= 1 :
half = mF(len(n)/2)
nsP += [24/5 * (10/11) ** exp] * half
if len(n) == 1 :
nsP += [24/5 * (10/11) ** (exp+1)] * 1
break
else :
n = n[half:]
exp += 1
return(nsP)
def functionEC(x) :
return(24/5 * (11/10)**(LN(1-x/5)/LN(2)))
def continuous(D) :
"""
Return the continuous pace data.
Parameters:
None.
Returns:
Set of 5001 values.
"""
cP = []
for d in D[:-1] :
cP.append(functionEC(d))
return(cP+[0])
#Variables. Time = Pace * Distance (min = min/km * km)
D = [d/1000 for d in range(0, 5001)]
#Steady Pace.
steady_pace_P = [23/5]*5001
steady_pace_T = 23
#Negative Split.
negative_split_P = negativeSplit()
negative_split_T = 22
#Continuous.
continuous_P = continuous(D)
#Integral.
continuous_T = quad(functionEC, 0, 5)
sns.set()
#Plot.
fig = plt.figure(figsize = (12, 7))
ax = fig.add_subplot(xlim = (0, 5), ylim = (0, 5))
#Title.
ax.set_title("Pace", fontsize = 24)
#x-axis.
ax.set_xlabel("Distance Ran(km)", fontsize = 18)
#y-axis.
ax.set_ylabel("Pace (min/km)", fontsize = 18)
plt.yticks(ticks = [0, 1.2, 2.4, 3.6, 4.8], labels = [0, 1.2, 2.4, 3.6, 4.8])
ax.tick_params(axis = 'both', labelsize = 16)
ax.plot(D, steady_pace_P, lw = 5, c = C[0], label = "Steady Pace")
ax.plot(D, negative_split_P, lw = 5, c = C[1], label = "Zeno's Discrete Pace")
ax.plot(D, continuous_P, lw = 5, c = C[3], label = "Zeno's Continuous Pace")
ax.legend(fontsize = '18', loc = 'lower left')
fig.savefig('2025.06.13.png', bbox_inches = "tight");