Professional Documents
Culture Documents
2020me10935 Lab3 MCL311
2020me10935 Lab3 MCL311
MCL311
HARSHIT KUMAR 2020ME10935
QUES.1:
clc
clear all
E=200e3;
A=100;
L=600;
ii=1:numberElements;
elementNodes(ii,1) =ii;
elementNodes(ii,2) =ii+1;
displacements= zeros(numberNodes,1);
force=zeros(numberNodes,1);
stiffness= zeros(numberNodes);
for i=1:numberElements
L(i)=nodeCoordinates(i+1) -nodeCoordinates(i);
k(i)= A*E/L(i);
end
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]);
displacement = stiffness(activeDof,activeDof)\force(activeDof);
displacements1= zeros(numberNodes,1)
displacements1(activeDof) = displacement;
F=stiffness*displacements1;
reactions= F(restrictedDof);
disp('reactions')
[restrictedDof reactions]
nodeNumber= (1:numberNodes)';
disp('displacements')
[nodeNumber nodeCoordinates' displacements1]
plot(nodeCoordinates', displacements1)
QUES.4 :
clc
clear all
E=200e3;
A=zeros(1,numberElements);
A=linspace(100,200,numberElements);
L=600;
ii=1:numberElements;
elementNodes(ii,1) =ii;
elementNodes(ii,2) =ii+1;
displacements= zeros(numberNodes,1);
force=zeros(numberNodes,1);
stiffness= zeros(numberNodes);
for i=1:numberElements
L(i)=nodeCoordinates(i+1) -nodeCoordinates(i);
k(i)= A(i)*E/L(i);
end
prompt="Enter the force node"
forceNode=input(prompt);
force(forceNode,1)=10000.0;
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]);
displacement = stiffness(activeDof,activeDof)\force(activeDof);
displacements1 = zeros(numberNodes,1)
displacements1(activeDof)= displacement;
F=stiffness*displacements1;
reactions= F(restrictedDof);
disp('reactions')
[restrictedDof reactions]
nodeNumber= (1:numberNodes)';
disp('displacements')
[nodeNumber nodeCoordinates' displacements1]
plot(nodeCoordinates', displacements1)
ANSYS QUES 4:
1. First, we run ‘’ANSYS Mechanical Enterprise’’ software in PC and then go to “Preferences’’ in the
main menu and select “Structural’’ option. ‘’Structural’’ option in the “Preferences” menu allows
the user to set various options related to the structural analysis capabilities. It can include settings
for element types, load steps, solution methods, and more.
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 Perform: Main Menu → Preprocessor → Modeling → Move/Modify → Elements → Modify
Attrib
Then select the elements while assigning them new attribute numbers.
st
First, enter New Attribute number = 1 and select 1 element.
nd
Then , enter New Attribute number = 2 and select 2 element.
th
Similarly repeating this process till selecting 5 element as each element have different
section area.
10. Then Perform: Main Menu → Preprocessor → Loads → Define Loads → Apply → Structural →
Displacement → On Nodes and select the Node 2 and restrict its all Degrees of freedom (DOF) as
it is fixed end.
11. Then Perform: Main Menu → Preprocessor → Loads → Define Loads → Apply → Structural →
Force/Moment → On Nodes and set the load value = “1e4” on Node 2 along X direction.
After the above operation, the element will look like this:
12. Then Perform: Main Menu → Solution → Current LS and it will solve the given problem.
13. Then Perform: Main Menu → General Postproc → Plot Results → Contour Plot→ Nodal Solu
Then Perform: Contour Nodal Solution Data → Nodal Solution → DOF Solution → X-component
of displacement → OK
It results to:
14. Then Perform: 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:
16. Then Perform: PlotCtrls → Redirect Plots → To JPEG File and turn “ON” force white BG and black
FG and increase “Pixel Resolution” to 1600 to save the plot of element to a JPEG File with a better
quality.
FINAL SOLUTION OF QUES 4: