You are on page 1of 6

PDVVP College of Engineering

Practical No. 3

Aim- To determine mechanical properties from stress , strain curve data .

Prerequisites- dataset, Jupyter Notebook .

Program & Outputs-


1. Packages-
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy.stats import linregress
%matplotlib inline

2. Data Loading-
%ls

1
PDVVP College of Engineering

dataset_al=pd.read_csv(r'C:\Users\My Pc\Desktop\steel1045.csv')

dataset_al.head()

dataset_steel=pd.read_csv(r'C:\Users\My Pc\Desktop\steel1045.csv')

dataset_steel.head()

d = 0.506

r = d/2

A = np.pi*r**2

stress_al = (dataset_al['FORCE']/A)*0.001

strain_al = dataset_al['CH5']*0.01

stress_steel = (dataset_steel['FORCE']/A)*0.001

strain_steel = dataset_steel['CH5']*0.01

Plot the full stress , strain curve-

fig,ax = plt.subplots()

ax.plot(strain_steel, stress_steel)

ax.set_xlabel('Strain (in/in)')
ax.set_ylabel('Stress (ksi)')

2
PDVVP College of Engineering

ax.set_title('Stress-Strain Curve of Al6061 and Steel1018 in Tension')

ax.legend(['Al6061','Steel1018'])

plt.show()

fig,ax = plt.subplots()

ax.plot(strain_al, stress_al)

ax.set_xlabel('Strain (in/in)')

ax.set_ylabel('Stress (ksi)')

ax.set_title('Stress-Strain Curve of Al6061 and Steel1018 in Tension')


ax.legend(['Al6061','Steel1018'])

plt.show()

3
PDVVP College of Engineering

ts_al = np.max(stress_al)

ts_steel = np.max(stress_steel)

print(f'The tensile strength of Al6061 is: {round(ts_al,1)} ksi')

print(f'The tensile strength of Steel1018 is: {round(ts_steel,1)} ksi')

fig,ax = plt.subplots()

ax.plot(strain_al, stress_al)

ax.plot(strain_steel, stress_steel)

ax.set_title('Inset of elastic region')

ax.set_xlabel('Strain (in/in)')
ax.set_ylabel('Stress (ksi)')

ax.legend(['Al6061','Steel1018'])

ax.set_xlim([0,0.01])

ax.set_ylim([0,70])

plt.show()

4
PDVVP College of Engineering

linear_stress_al_mask = stress_al < 35

linear_stress_al = stress_al[linear_stress_al_mask]

linear_strain_al = strain_al[linear_stress_al_mask]

linear_regression_output = linregress(linear_strain_al, linear_stress_al)


E_al = linear_regression_output[0]

print(f'The elastic modulus of Al6061 is {round(E_al,1)} ksi')

linear_stress_steel_mask = stress_steel < 55


linear_stress_steel = stress_steel[linear_stress_steel_mask]

linear_strain_steel = strain_steel[linear_stress_steel_mask]

linear_regression_output_steel = linregress(linear_strain_steel, linear_stress_steel)

E_steel = linear_regression_output_steel[0]

print(f'The elastic modulus of Steel1018 is {round(E_steel,1)} ksi')

stress_al_array = np.array(stress_al)

stress_al_last = stress_al_array[-1]

strain_al_array = np.array(strain_al)

strain_al_last = strain_al_array[-1]

EL_al = -stress_al_last/E_al + strain_al_last

print(f'The ductility of Al6061 is {round(EL_al*100,1)}%')

5
PDVVP College of Engineering

stress_steel_array = np.array(stress_steel)

stress_steel_last = stress_steel_array[-1]

strain_steel_array = np.array(strain_steel)

strain_steel_last = strain_steel_array[-1]

EL_steel = -stress_steel_last/E_steel + strain_steel_last


print(f'The ductility of Steel1018 is {round(EL_steel*100,1)}%')

You might also like