All Off: For For End End
All Off: For For End End
clear
clear all
hold off
clf
% Parameters
density = 0.098; % lbf/in^3
length = 85*12; % in
w_load = 585000; % lbf
yield_strength = 2.5*10^4; %lbf/in^2
shear_strength = 1.9*10^4; % lbf/in^2
E_youngs = 10^7; % lbf/in^2
% Objective Function:
% Assum t and b in order to create plot with two variables.
% Vary t and b to optimize solution further.
t = 1.4; % in
b = 7; % in
d = 0:1:250; % in, based on data from "Mechanics of Materials" Ferdinand
h = 0:1:250; % in, based on data from "Mechanics of Materials" Ferdinand
[x1,x2] = meshgrid(d,h);
f = b*x1 - b*x2 +t*x2;
% Contour map for h vs d
figure(1)
hold on
contour(x1,x2,f,60)
% Condition for which beam is an I-beam
plot(d,h,'c--','LineWidth',3) % Plot condition d-h > 0
for i = 1:numel(d)
for j = 1:numel(h)
w_beam(i,j) = w_load + (b*d(i)-b*h(j)+t*h(j))*length*density;
end
end