Skip to content

Commit

Permalink
Delete unnecessary files and remove graph generation code
Browse files Browse the repository at this point in the history
  • Loading branch information
Ze7111 committed Feb 19, 2024
1 parent 25ed2ec commit 58319a3
Show file tree
Hide file tree
Showing 14 changed files with 0 additions and 63 deletions.
Binary file removed acceleration_vs_inverse_mass.png
Binary file not shown.
Binary file removed acceleration_vs_mass.png
Binary file not shown.
Binary file removed build/helix-0.0.1-alpha.l.zip
Binary file not shown.
Binary file removed build/helix-0.0.1-alpha.m.zip
Binary file not shown.
Binary file removed build/helix-0.0.1-alpha.n.zip
Binary file not shown.
Binary file removed build/helix-0.0.1-alpha.o.zip
Binary file not shown.
Binary file removed build/helix-0.0.1-alpha.p.zip
Binary file not shown.
Binary file removed build/helix-0.0.1-alpha.q.zip
Binary file not shown.
Binary file removed build/helix-0.0.1-alpha.r.zip
Binary file not shown.
Binary file removed build/helix-0.0.1-alpha.s.zip
Binary file not shown.
Binary file removed build/helix-0.0.2-alpha.j.zip
Binary file not shown.
Binary file removed build/helix-0.0.2-alpha.o.zip
Binary file not shown.
Binary file removed inverse_acceleration_vs_mass.png
Binary file not shown.
63 changes: 0 additions & 63 deletions tests/test2.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,67 +35,4 @@ def iterwe():
[something(code) for code in reversed_codes]

return chr(int(val))
import numpy as np
import matplotlib.pyplot as plt

# Given data from the chart
times = np.array([1.46, 1.50, 1.64, 1.70, 1.87, 2.04, 2.17, 2.42]) # times in seconds
masses = np.array([900, 1000, 1100, 1250, 1500, 1750, 2000, 2500]) # masses in grams

# Converting masses to kilograms
masses_kg = masses / 1000

# Distance covered is 1.00 meters for all trials
distance = 1.00 # in meters

# Using kinematic equation: distance = (initial_velocity * time) + (0.5 * acceleration * time^2)
# Here, initial_velocity = 0 (starting from rest), so we can solve for acceleration as:
# distance = (0.5 * acceleration * time^2) => acceleration = 2 * distance / time^2

# Calculate accelerations for each mass
accelerations = 2 * distance / times**2

# Graph 1: Acceleration vs. Total Mass
plt.figure(figsize=(10, 6))
plt.plot(masses_kg, accelerations, 'o-', label='Acceleration vs. Mass')
plt.title('Acceleration vs. Total Mass')
plt.xlabel('Total Mass (kg)')
plt.ylabel('Acceleration (m/s^2)')
plt.grid(True)
plt.legend()
plt.savefig('acceleration_vs_mass.png')
plt.close()

# Graph 2: Acceleration vs. 1/Total Mass
inverse_masses = 1 / masses_kg
plt.figure(figsize=(10, 6))
plt.plot(inverse_masses, accelerations, 'o-', label='Acceleration vs. 1/Mass')
plt.title('Acceleration vs. 1/Total Mass')
plt.xlabel('1/Total Mass (1/kg)')
plt.ylabel('Acceleration (m/s^2)')
plt.grid(True)
plt.legend()
plt.savefig('acceleration_vs_inverse_mass.png')
plt.close()

# Graph 3: 1/Acceleration vs. Total Mass
inverse_accelerations = 1 / accelerations
plt.figure(figsize=(10, 6))
plt.plot(masses_kg, inverse_accelerations, 'o-', label='1/Acceleration vs. Mass')
plt.title('1/Acceleration vs. Total Mass')
plt.xlabel('Total Mass (kg)')
plt.ylabel('1/Acceleration (s^2/m)')
plt.grid(True)
plt.legend()
plt.savefig('inverse_acceleration_vs_mass.png')
plt.close()

# Return the paths to the saved graphs
graph_paths = {
"acceleration_vs_mass": "acceleration_vs_mass.png",
"acceleration_vs_inverse_mass": "acceleration_vs_inverse_mass.png",
"inverse_acceleration_vs_mass": "inverse_acceleration_vs_mass.png"
}

graph_paths, accelerations

0 comments on commit 58319a3

Please sign in to comment.