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

LAB 3

MCL311
HARSHIT KUMAR 2020ME10935

QUES.1:

clc
clear all

%Define number of nodes and number of elements

prompt="Enter the number of elements"


numberElements= input(prompt);
numberNodes= numberElements +1;

E=200e3;
A=100;
L=600;

nodeCoordinates=zeros(1, numberElements +1);


nodeCoordinates= linspace(0,L,numberElements+1);

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

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)

QUES.4 :

clc
clear all

%Define number of nodes and number of elements

prompt="Enter the number of elements"


numberElements= input(prompt);
numberNodes= numberElements +1;

E=200e3;
A=zeros(1,numberElements);
A=linspace(100,200,numberElements);
L=600;

nodeCoordinates=zeros(1, numberElements +1);


nodeCoordinates= linspace(0,L,numberElements+1);

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.

2. Then perform: Main Menu → Preprocessor → Add/ Edit/ Delete


Then, add a new element defining the structural mass of element and of “3D finit stn 180”
analysis type. The 3D Finite Element (FE) Structural 180 analysis type simulates 3-dimensional
structures under various loading conditions. The finite element method discretizes the structure
into many small elements and solves for the unknown displacement, velocity, and acceleration
fields within those elements.

After adding element, the elements are shown as follows:


3. Then perform: Main Menu → Preprocessor → Material Properties → Material Models
and define Material Model Number 1 and select Linear Isotopic Elastic Structural Model and
enter EX (Young’s Modulus) = 200 e3 and PRXY (Poisson’s Ratio) = 0.3

4. Then perform: Main Menu → Preprocessor → Section → Link → Add


Then add link with section ID = 1 defining the section name = s1 and section area =190 mm^2
and applying the changes.
Then add link with section ID = 2 defining the section name = s2 and section area =170 mm^2
and applying the changes.
Then add link with section ID = 3 defining the section name = s3 and section area =150 mm^2
and applying the changes.

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.

5. Then perform: Main Menu → Preprocessor → Modeling → Create → Keypoints → In Active CS


Add a keypoint with Keypoint Number 1 as origin and Keypoint Number 2 with X location = 600 as
the length of bar is 600mm. Thus, defining the two ends of the bar.
The above operation results to this:
6. Then Go to List → Properties → Section Properties to check the executed operations i.e. the
section numbers and the respective section areas.
7. Then perform: Main Menu → Preprocessor → Meshing → Mesh Tool and set the element
attribute “Global” and setting global size controls with Element Edge Length =0 and No. of
element divisions =5.
Now this operation will lead to selecting Mesh Line and then we select the mesh line shown in
green colour below to divide this line.

After selecting line, it will look like this:


8. Then going to “Plot” menu and in the Numbering Controls turn on the “Node Numbers”.

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:

You might also like