Install Python
To install Python using the Microsoft Store
Step-1 Go to your Start menu, type "Microsoft Store".
Step-2 Once the store is open, select Search from the upper-right menu and enter "Python".
Step-3 Once Python has downloaded and installation process, open Windows PowerShell using the Start menu (lower left Windows icon).
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
# Read the csv file
data_5 = pd.read_csv('Stress_strain_20205.csv')
data_10 = pd.read_csv('Stress_strain_202010.csv')
data_20 = pd.read_csv('Stress_strain_202020.csv')
data_40 = pd.read_csv('Stress_Strain_404020.csv')
# X is the Strain and Y is the Stress Values
strain_5 = data_5.iloc[:, 0].values
stress_5 = data_5.iloc[:, 1].values
strain_10 = data_10.iloc[:, 0].values
stress_10 = data_10.iloc[:, 1].values
strain_20 = data_20.iloc[:, 0].values
stress_20 = data_20.iloc[:, 1].values
strain_40 = data_40.iloc[:, 0].values
stress_40 = data_40.iloc[:, 1].values
# Plot Stress-Strain Curve
plt.plot(strain_5, stress_5, color='red', label="Stress-Strain -[20 20 5]")
plt.plot(strain_10,stress_10,color = 'blue', label = 'Stress-Strain - [20 20 10]')
plt.plot(strain_20, stress_20, color='darkolivegreen', label="Stress-Strain-[20 20 20]")
plt.plot(strain_40, stress_40, color='mediumvioletred', label="Stress-Strain-[40 40 20]")
plt.title("Stress-Strain Curve")
plt.xlabel("Strain")
plt.ylabel("Stress(GPa)")
# # # Find the maximum stress value (Yield Strength)
# yield_strength = max(stress_5)
# yield_index = np.argmax(stress_5) # Find the index of the maximum stress value
# yield_strain = strain_5[yield_index] # Find corresponding strain for the max stress
# yield_strength_10 = max(stress_10)
# yield_index_10= np.argmax(stress_10) # Find the index of the maximum stress value
# yield_strain_10 = strain_10[yield_index_10] # Find corresponding strain for the max stress
# print(f"Yield Strength of [20 20 5]: {yield_strength} GPa at strain: {yield_strain}")
# print(f"Yield Strength of [20 20 10]: {yield_strength_10} GPa at strain: {yield_strain_10}")
# # Plot the Yield Strength point
# plt.scatter(yield_strain, yield_strength, color='red', zorder=5, label=f"Yield Strength = {yield_strength:.2f} GPa")
# Show the legend
plt.legend()
# Display the plot
plt.show()