Stress and deflection Equation Not Working Out

조회 수: 2 (최근 30일)
Daniel Millard
Daniel Millard 2021년 11월 2일
댓글: Jon 2021년 11월 2일
I hvae to write a code to calculate stress and deflection along the beam at intervals of 10cm, i hvae tried the equation multiple ways and its not working could someone please show me where i'm going wrong.
Values-
E is the modulus of elasticity and I is the moment of inertia.
Assume that the cantilever beam is 2 metres long with a 2,000N load located 1 metre from the end.
The beam has:
Section modulus (Z) of 1.5x105mm3 Moment of inertia (I) of 44.6 x l06 mm4 and Modulus of elasticity (E) of 2 x l05 N/mm2 .
E = 2*10^5;
P = 2000;
I = 44.6*10^6;
l = 2;
a = (0:0.1:l);
b = (l-a);
for n = 1:length(a)
s(1:4,n) =(P*a(n)*b(n).*c)./(I*l);
end
%plot(a,s)
for x = 1:length(a)/2
for d = 1:4
d = ((P.*b(x).*x)./(6*l*E*I)).*(l.^2-x.^2-b(x).^2);
end
end
for x = length(a)-1
for d2 = 1:4
for mi = I(1:4)
d2 = -(((P*b)./(6*l*E*mi)).*((l./b).*(x-a).^3)+(l^2-b.^2).*(x-x^3));
end
figure
plot(d2)
end
end

답변 (1개)

Jon
Jon 2021년 11월 2일
You may have other issues, but to start with you have to assign the value of the variable c before you use it at line 8
  댓글 수: 3
Jon
Jon 2021년 11월 2일
However you want to find a value for c, you need to assign it before you can use it on the right hand side of an expression.
So you need to have a line such as:
c = 2
before you get to
s(1:4,n) =(P*a(n)*b(n).*c)./(I*l);
Jon
Jon 2021년 11월 2일
Also, your line of code
for mi = I(1:4)
does not make sense, as you only have assigned one value to I (I = 44.6*10^6;). So it doesn't make sense to loop through 4 values of I when there is only one value for it

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Stress and Strain에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by