You have unsaved changes
Python
import matplotlib.pyplot as plt

# Constants
base_spd = 102
spd_buffs = 0.96  # 96%

# Function to calculate Aglaea_spd
def calculate_aglaea_spd(sunday_max_spd):
    return (10000 / (100 - (10000 / sunday_max_spd))) - (base_spd * spd_buffs) + 0.1

# Function to calculate minimum_speed
def calculate_minimum_speed(sunday_spd):
    return sunday_spd - (base_spd * 0.06)

# Range of Sunday_spd values
sunday_spd_values = range(160, 166)

# Lists to store results
aglaea_spd_values = []
condition_satisfied = []
minimum_speed_values = []

# Calculate values for each Sunday_spd
for sunday_spd in sunday_spd_values:
    aglaea_spd = calculate_aglaea_spd(sunday_spd)
    aglaea_spd_values.append(aglaea_spd)
    
    # Check if the condition is satisfied
    condition = sunday_spd < aglaea_spd + (base_spd * 0.06)
    condition_satisfied.append(condition)
    
    # Calculate minimum_speed
    minimum_speed = calculate_minimum_speed(sunday_spd)
    minimum_speed_values.append(minimum_speed)

# Plotting the results
plt.figure(figsize=(10, 6))

# Plot Aglaea_spd
plt.plot(sunday_spd_values, aglaea_spd_values, label='Aglaea_spd', marker='o')

# Plot minimum_speed
plt.plot(sunday_spd_values, minimum_speed_values, label='Minimum Speed', marker='x')

# Highlight where the condition is satisfied
for i, condition in enumerate(condition_satisfied):
    if condition:
        plt.scatter(sunday_spd_values[i], aglaea_spd_values[i], color='green', zorder=5)
    else:
        plt.scatter(sunday_spd_values[i], aglaea_spd_values[i], color='red', zorder=5)

# Add labels and title
plt.xlabel('Sunday_spd')
plt.ylabel('Speed')
plt.title('Aglaea_spd and Minimum Speed vs Sunday_spd')
plt.legend()
plt.grid(True)

# Show plot
plt.show()
Matplotlib is building the font cache; this may take a moment.