%Bike Crank Tutorial - Pre-Analysis
%Sigma_x along height of cross-section

x = 3.345; %Distance of the cross-section from the left hole (i.e middle of the crank)
y = [-0.3 -0.2 -0.1 0 0.1 0.2 0.3]; %Input vector of all heights we wish to find stress (0 is at the middle of the crank so the normal stress from bending will be 0 there.)
a = 6.69;  %Distance between the support and the load (i.e between the two holes). 
b = 0.375; %The crank thickness
h = 0.612; %This is a rough estimate coming from the dimensions given for the crank. We can get the actual height at the middle cross-section from ANSYS later on. 
p = 100; %Load

M=-p*(a-x); %Moment
I=(1/12)*b*h^3; %Moment of inertia
sigma_x=(M.*y/I) %normal stress in the x-direction