Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

University of Bahrain

College of Engineering
Department of Mechanical Engineering

MENG 380 Computer Applications in Mechanical Engineering


Quiz 1
Semester II, 2020/2021
Student Name: Ameer Danial I.D.: 20163340 Sec.: 1

Q.1 The shear force, V, and bending moment, M, of the beam shown is given as follows:

a) Plot the shear force (V) and the bending moment (M) diagrams arranged vertically in one
figure for the interval 0 ≤ x ≤ 10 m.
b) Find the value of x at which the shear is zero (V = 0) and find the corresponding bending
moment (M).
The specific values of a and b are given in separate excel sheet.
Q.2 Find the centroid of the shaded area shown below. The area is bounded between x = 0
and x = 2 m. The specific value of k is given in a separate excel sheet.
Q1)

a)

function [v]=q1_(x)
a=3.35;
b=4.65;

if x>=0 && x<=a


v= 10+a-b+((a^2)/10)-2*x;
elseif a>=10 && x<= a+b
v= 10-a-b-((a^2)/10);
elseif x>=a+b && x<= 10
v=-a-b-((a^2)/10);
else
v = 0 ;
end
end

>> x=linspace(0,10);

>> n=length(x);

>> v=zeros(1,n);

>> for i=1:n

v(i)=q1_(x(i));

end

>> plot(x,v)
b)

function [m]=q1_2(x)
a=3.35;
b=4.65;

if x>=0 && x<= a


m= x*(10+a-b-((a^2)/10)-x) ;
elseif a>=10 && x<= a+b
m= x*(10+a-b-((a^2)/10))+(a^2);
elseif x>=a+b && x<= 10
m= x*(-a-b-((a^2)/10))+(a^2)+10*(a+b);
else
m = 0 ;
end

>> x=linspace(0,10);

>> n=length(x);

>> m=zeros(1,n);

>> for i=1:n

m(i)=q1_2(x(i));

end

>> plot(x,m)

>>
Q2)

a=0;
b=2;
y1=@(x) sqrt(2.*x);
y2=@(x) 0.27.*x;
A=integral(@(x)y1(x)-y2(x),a,b);
Qx=integral(@(x) x.*(y1(x)-y2(x)),a,b);
xb=Qx/A
Qy=integral(@(x)(y1(x)).^2-(y2(x).^2),a,b)/2;
yb=Qy/A

>> q1_quiz1

xb =

1.1661

yb =

0.8947

You might also like