Using mathlab only: input required m=input(\'Enter Mass of the bean : \'); F1=in
ID: 3601718 • Letter: U
Question
Using mathlab only:
input required
m=input('Enter Mass of the bean : ');
F1=input('Enter Triangular Distributed Load : ');
F2=input('Enter Rectangular Distributed Load : ');
F3=input('Enter Point Load : ');
theta=input('Enter Angle : ');
X1=input('Enter Distance1 : ');
X2=input('Enter Distance2 : ');
X3=input('Enter Distance3 : ');
X4=input('Enter Distance4 : ');
g=9.91;
a)Convert the triangular distributed distance load (F1) into point load (P1y) and find its distance (d1) from pin A
P1y=1/2*x1*F1
d1=x1/3
b)Convert the rectangular distributed load (F2) into point load (P2y) and find its distance (d2) from pin A 2
P1y=1/2*x1*F1
d1=x1/3
c)Convert the rectangular distributed load (F2) into point load (P2y) and find its distance (d2) from pin A 2
P2y=x2*F2
d2=x1+(x2/2)
d)convert the angle from degree to radian
angle radains=(theta*3.14)/180
e)Resolve the point load (F3) into x-direction (P3x)
P3x=F3*sin theta
f)Resolve the point load (F3) into y- direction (P3y)
P3y=F3*cos theta
g)Find the distance (d3) between the point load (F3) and pin A
d3=(x1+x2+x3+x4)*sin theta
h)Find the horizontal reaction force at pin A (RAx)
RAx=P3x
i)Find the vertical reaction force at roller B (RBy)
RBy=(P3y*(x1+x2+x3+x4)+P2y*d2+P1y*d1)/(x1+x2+x3)
-
g)Find the vertical reaction force at pin A (RAy)
Ray=P1y+P2y-RBy+P3y
k)Find the resultant reaction force (RA)
RA=square root RAx square+RAy square
l)Write an output function to display the horizontal reaction force at pin A (RAx)
m)Write an output function to display the vertical reaction force at pin A (RAy)
n)Write an output function to display the resultant reaction force at pin A( RA)
o)Write an output function to display the vertical reaction force at roller B (RBy
the input is ready, convert the equations from (a) to(k)to math lab code and(i)to (o) output
****************************************************************************************
I have posted the question 3 times and i got this code and not working
m=input('Enter Mass of the bean : ');
F1=input('Enter Triangular Distributed Load : ');
F2=input('Enter Rectangular Distributed Load : ');
F3=input('Enter Point Load : ');
theta=input('Enter Angle : ');
X1=input('Enter Distance1 : ');
X2=input('Enter Distance2 : ');
X3=input('Enter Distance3 : ');
X4=input('Enter Distance4 : ');
g=9.91;
function d1 = triangulartopoint(X1,F1)
P1y=1/2*X1*F1;
d1=X1/3;
end
function d2 = rectangulartopoint(X1,X2,F2)
P2y=X2*F2;
d2=X1+(X2/2);
end
function radian = degreetoradian(theta)
radian=(theta*3.14)/180;
end
function P3x = loadx(F3,theta)
P3x=F3*sin(theta);
end
function P3y = loady(F3,theta)
P3y=F3*cos(theta);
end
function d3 = distance(X1,X2,X3,X4,theta)
d3=(X1+X2+X3+X4)*sin(theta);
end
function RAx = horizontalreaction(P3x)
RAx=P3x;
end
function RBy = verticalreactionB(X1,X2,X3,X4,d1,d2,P1y,P2y,P3y)
RBy=(P3y*(X1+X2+X3+X4)+P2y*d2+P1y*d1)/(X1+X2+X3);
end
function RAy = verticalreactionA(P1y,P2y,P3y,RBy)
RAy=P1y+P2y-RBy+P3y;
end
function RA = resultant(RAx,RAy)
RA=sqrt((RAx*RAx)+(RAy*RAy));
end
P1y=1/2*X1*F1;
P2y=X2*F2;
d1 = triangulartopoint(X1,F1);
d2 = rectangulartopoint(X1,X2,F1);
radian = degreetoradian(theta);
P3x = loadx(F3,radian);
P3y = loady(F3,radian);
d3 = distance(X1,X2,X3,X4,radian);
RAx = horizontalreaction(P3x);
RBy = verticalreactionB(X1,X2,X3,X4,d1,d2,P1y,P2y,P3y);
RAy = verticalreactionA(P1y,P2y,P3y,RBy);
RA = resultant(RAx,RAy);
printf(" The horizontal reaction force at pin A (RAx) = %f",RAx);
printf(" The vertical reaction force at pin A (RAy) = %f",RAy);
printf(" The resultant reaction force at pin A (RA) = %f",RA);
printf(" The vertical reaction force at roller B (RBy) = %f",RBy);
Explanation / Answer
m=input('Enter Mass of the bean : ');
F1=input('Enter Triangular Distributed Load : ');
F2=input('Enter Rectangular Distributed Load : ');
F3=input('Enter Point Load : ');
theta=input('Enter Angle : ');
X1=input('Enter Distance1 : ');
X2=input('Enter Distance2 : ');
X3=input('Enter Distance3 : ');
X4=input('Enter Distance4 : ');
g=9.91;
function d1 = triangulartopoint(X1,F1)
P1y=1/2*X1*F1;
d1=X1/3;
end
function d2 = rectangulartopoint(X1,X2,F2)
P2y=X2*F2;
d2=X1+(X2/2);
end
function radian = degreetoradian(theta)
radian=(theta*3.14)/180;
end
function P3x = loadx(F3,theta)
P3x=F3*sin(theta);
end
function P3y = loady(F3,theta)
P3y=F3*cos(theta);
end
function d3 = distance(X1,X2,X3,X4,theta)
d3=(X1+X2+X3+X4)*sin(theta);
end
function RAx = horizontalreaction(P3x)
RAx=P3x;
end
function RBy = verticalreactionB(X1,X2,X3,X4,d1,d2,P1y,P2y,P3y)
RBy=(P3y*(X1+X2+X3+X4)+P2y*d2+P1y*d1)/(X1+X2+X3);
end
function RAy = verticalreactionA(P1y,P2y,P3y,RBy)
RAy=P1y+P2y-RBy+P3y;
end
function RA = resultant(RAx,RAy)
RA=sqrt((RAx*RAx)+(RAy*RAy));
end
P1y=1/2*X1*F1;
P2y=X2*F2;
d1 = triangulartopoint(X1,F1);
d2 = rectangulartopoint(X1,X2,F1);
radian = degreetoradian(theta);
P3x = loadx(F3,radian);
P3y = loady(F3,radian);
d3 = distance(X1,X2,X3,X4,radian);
RAx = horizontalreaction(P3x);
RBy = verticalreactionB(X1,X2,X3,X4,d1,d2,P1y,P2y,P3y);
RAy = verticalreactionA(P1y,P2y,P3y,RBy);
RA = resultant(RAx,RAy);
printf(" The horizontal reaction force at pin A (RAx) = %f",RAx);
printf(" The vertical reaction force at pin A (RAy) = %f",RAy);
printf(" The resultant reaction force at pin A (RA) = %f",RA);
printf(" The vertical reaction force at roller B (RBy) = %f",RBy);
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.