%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), in inches
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), in inches
a = 6.69;  %Distance between the support and the load (i.e between the two holes), in inches 
b = 0.375; %The crank thickness in, inches
h = 0.612; %This is a rough estimate of the total height from the dimensions given for the crank. We can get the actual height at the middle cross-section from ANSYS later on. Unit is in inches.
p = 100; %Load, in lbs.

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