0% found this document useful (0 votes)
3 views

python plots

Lkjb

Uploaded by

Puspita Das
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

python plots

Lkjb

Uploaded by

Puspita Das
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

In [22]: import matplotlib.

pyplot as plt
import numpy as np

# Define the function to determine brake application based on revolution tim


def apply_brakes(revolution_time):
return "." if revolution_time < 1.35 else "No Brakes"

# Generate some sample data for velocity


velocity = np.linspace(0, 10, 100)
revolution_time = 1.5 * np.exp(-0.1 * velocity) # Assuming some relationshi

# Determine brake application based on revolution time


brake_decision = [apply_brakes(rt) for rt in revolution_time]

# Plot the graph


plt.figure(figsize=(10, 6))
plt.plot(velocity, revolution_time, label='Revolution Time')
for i in range(len(brake_decision)):
if brake_decision[i] == "Apply Brakes":
plt.scatter(velocity[i], revolution_time[i], color='red', label='App
plt.axhline(y=1.35, color='r', linestyle='--', label='Brake Decision Boundar
plt.xlabel('Velocity')
plt.ylabel('Revolution Time')
plt.title('Brake Application Decision based on Revolution Time vs Velocity')
plt.legend()
plt.grid(True)
plt.show()

In [ ]:

You might also like