In: Computer Science
d. Utilize the codes you developed so far to calculate the position of the maximum beam deflections a function of the beam length (L). Vary L between 100 cm to 1000 cm. Plot the final results, e. Label the axes and comment on the result. Attach your code. f. Based on your result, do you think it is possible that the position of maximum beam deflection is located right at the middle of the beam? Explain your thinking!
`Hey,
Note: Brother if you have any queries related the answer please do comment. I would be very happy to resolve all your queries.
clc
clear all
close all
format long
R=[];
L=100:1:1000;
for ii=1:length(L)
l=L(ii);
E = 55000;
I = 30000;
W = 2.2;
% find df/dx
f=@(x) (W*(-5*x^4 + 2* l^2 *3*x^2 - l^4))/(120*E*I*l);
e=0.1e-2;
a=0;
b=l-1;
iter = 0;
if f(a)*f(b)>=0
disp('No Root')
else
prev = (a+b)/2;
p=a;
while (abs(p-prev)/abs(p)>e)
prev=p;
iter =iter+ 1;
p = (a+b)/2;
if f(p) == 0
p
q=1
break;
end
if f(a)*f(p)<0
b = p;
else
a = p;
end
if(iter==100)
disp('the required accuracy is not reached in 50
iterations');
end
end
end
R(ii)=p;
end
plot(L,R);
xlabel('Length');
ylabel('The position of maximum deflection');
Kindly revert for any queries
Thanks.