%Mason Averill %ME-480 Fall 2020, 11/20 %FEM Method Solution %Input Parameters l=1; %length of the beam in meters t=0.05; %width of the beam in meters e=200*10^9; %Young's Modulus of the steel utilized in Pa density=7900; %density of the steel utilized in kg/m^3 gravity=9.81; %acceleration due to gravity p=5000; %Point load applied at end of beam in N number_of_elements_max=100; %specify number of elements to consider number_of_elements=1; FEM_end_deflection_store=zeros(1,number_of_elements_max); FEM_end_slope_store=zeros(1,number_of_elements_max); percent_error_deflection_store=zeros(1,number_of_elements_max); while(number_of_elements<=number_of_elements_max) %Discretize x delta_x=l/number_of_elements; x=0:delta_x:l; %Optimum h(x) determined by optimizer: 0.063427138414689221796410276261629*x1 + 199/10000 %Now find h(x) from the wall towards the end of the beam h_x=-0.063427138414689221796410276261629*x+199/10000+0.063427138414689221796410276261629; %First lets find the area at each node [rows,columns]=size(h_x); A_x=zeros(rows,columns-1); %this will hold the area for each element A_i=0; A_j=0; i=1; while(i