MCL 311 Lab 4 PDF
MCL 311 Lab 4 PDF
MCL 311 Lab 4 PDF
2020ME10902
MCL-311 (LAB – 04)
Matlab code for Ques-1:
clc
clear all
ii = 1:numberElements;
elementNodes(ii,1) = ii;
elementNodes(ii,2) = ii + 1;
for e = 1:numberElements
elementDof = elementNodes(e,:);
stiffness(elementDof, elementDof) = stiffness(elementDof, elementDof) +
k(e).*[1 -1;-1 1];
end
restrictedDof = [1];
activeDof = setdiff([1:numberNodes]',[restrictedDof]);
displacements1 = zeros(numberNodes,1);
displacements1(activeDof) = displacements;
F = stiffness*displacements1;
reactions = F(restrictedDof);
disp('reactions')
[restrictedDof reactions]
nodenumber = (1:numberNodes)';
disp('displacements')
[nodenumber nodeCoordinates' displacements1]
plot(nodeCoordinates' ,displacements1)
E = 200e3;
A1 = 200; A2=100
Ltotal = 600;
nodeCoordinates = zeros(1,numberElements+1);
nodeCoordinates = linspace(0,Ltotal,numberElements+1);
i1 = 1:numberElements
elementNodes(i1,1)=i1;
elementNodes(i1,2)=i1+1;
for e=1:numberElements
elementDof=elementNodes(e,:);
stiffness(elementDof,elementDof) = stiffness(elementDof,elementDof)+ K (e).*[1 -1;-1 1];
end
restrictedDof = [1];
activeDof=setdiff([1:numberNodes]',[restrictedDof]);
dsplacements1 = zeros(numberNodes,1);
displacements1(activeDof)=displacements;
F=stiffness.*displacements1;
reaction=F(restrictedDof);
disp('reactions')
[restrictedDof reaction]
nodenumber = (1:numberNodes);
disp('displacements')
[nodenumber nodeCoordinates displacements1]
Then add link with section ID = 4 defining the section name = s4 and section area
=130 mm^2 and applying the changes.
Then add link with section ID = 5 defining the section name = s5 and section area
=110 mm^2 and applying the changes.
After applying this operation, the node numbers will look start to appear on the line.
9. Then Doing this command
Main Menu → Preprocessor → Modeling → Move/Modify → Elements → Modify
Attrib
Then select the elements while assigning them new attribute numbers.
First, enter New Attribute number = 1 and select 1 st element.
It results to:
14. Then Doing this command PlotCtrls → Style → Size and Shape and turn “Display
of Element” option “ON”. This process lets us change the size and shape of
graphics window elements. When "Display of Element" is "ON," the plot shows
the model's element distribution and mesh quality.
Resulting this solution:
15. Then doing a right click and selecting the Oblique View to getter a better view of
the element.
Oblique View: