- Details
- Parent Category: Engineering Assignments' Solutions
We Helped With This Mechanical Engineering Homework: Have A Similar One?

Category | Engineering |
---|---|
Subject | Mechanical Engineering |
Difficulty | Undergraduate |
Status | Solved |
More Info | Mechanical Engineering Assignment Help |
Short Assignment Requirements
Assignment Description
DEN331/DENM331 – Coursework on Solids
Ettore Barbieri
OBJECTIVE
• You need to write a Finite Element Code for 2D truss structures using 1D Two-Noded Bar Elements.
• Your submission will have a Main.m file and 5 other .m files, each one containing a function. Put the files in the same folder and compress the whole folder. Submit a .zip file.
• The structure of these 6 files is given to you: you need to write the content of each file.
• You are given some verification examples. You need to write the input to your code and test it.
RULES
• It’s a group project
– Same groups as the Fluids Coursework.
– Choose a spokesperson, who will submit on behalf of the group.
– All members must contribute (see FAQ).
• Electronic submission
– You need to submit your Matlab files (.m) compressed in a .zip file.
• Contributions:
– Your Matlab files will need to contain a “Contributions” section (as a comment): your grade will depend on your contribution.
This is what you need to produce
1 of 6 – Main.m
% Call to function to import nodes, elements, Young’s moduli and cross section areas
[Nodes,Elements, E, A] = ReadFiles(‘elements.txt’,’nodes.txt’,’youngs.txt’,’areas.txt’);
% Plot undeformed configuration PlotMesh(Nodes,Elements);
% Define here the boundary conditions
% Your code here: arrays F, Ux, Uy must contain your BCs in this way:
% F = [NodeID Fx Fy]
% Ux = [NodeID value: 0 if fixed, any number otherwise] & Uy = [NodeID value] see Verification Example 1.
% Call to StiffnessMatrix function
K = StiffnessMatrix(Nodes,Elements,E,A);
% Call to Solve function
[d,R] = Solve(K,F,Ux,Uy);
% Post-processing – Plot Deformed configuration and compute stresses in each bar Stress = PlotDeformed(Nodes,Elements,E,A,d);
% Contributions
%
%
% STUDENT ID NAME SURNAME CONTRIBUTION
2 of 6 – PlotMesh.m
function PlotMesh(Nodes,Elements)
% Your code here
end
% Contributions
%
%
% STUDENT ID NAME SURNAME CONTRIBUTION
3 of 6 – ReadFiles.m
function [Nodes,Elements, E, A] = ReadFiles(el_name,nodes_name,youngs_name,areas_name)
% Your code here
end
% Contributions
%
%
% STUDENT ID NAME SURNAME CONTRIBUTION
4 of 6 – StiffnessMatrix.m
function K = StiffnessMatrix(X,el,E,A)
% Your code here
end
% Contributions
%
%
% STUDENT ID NAME SURNAME CONTRIBUTION
5 of 6 – Solve.m
function [d,R] = Solve(K,F,Ux,Uy)
% Your code here
end
% Contributions
%
%
% STUDENT ID NAME SURNAME CONTRIBUTION
6 of 6 – PlotDeformed.m
function Stress = PlotDeformed(Nodes,Elements,E,A,d)
% Your code here
end
% Contributions
%
%
% STUDENT ID NAME SURNAME CONTRIBUTION
THE COMPETITION
• Your functions need to be written in a general manner, and need to work for an arbitrary number of elements and nodes and for general boundary conditions.
• Your code will be tested against a structure with a large number of elements (around 10,000).
• CODE VERIFICATION: you are given 3 examples with solutions to test the correctness of your code, but the competition will be on a different structure and boundary conditions, unknown to you at the moment.
• The code that produces the exact results in the least time will win!
• All the qualified submissions will be ranked, and marks assigned according to a statistical distribution centred on the median. The fastest code will receive 80/100.
THE COMPETITION
BONUS TASKS
• There are some bonus tasks that are not strictly necessary to pass the coursework, but if your group writes the fastest code and accomplishes all of them, you will receive 100/100.
• You will get extra marks if:
– Your code produces graphs that are aesthetically pleasant.
– Your code is well commented and easy to read and follow to someone external to your group.
– PlotDeformed.m also colors the bars according to the value of stress.
– In addition to the Bar element, your code also uses Beam elements, even in 2D.
– Your code also works in 3D, at least for the Bar elements.
Example 1
|
Example 2
Displacements reactions stresses
ans = ans = ans =
1.0000 0 1.0e+05 * -210.9015
2.0000 0 122.4318
3.0000 7.1429 0.0000 0.0000 62.5575
4.0000 -9.0386 0.0000 1.0000 -44.2349
5.0000 5.2471 0.0001 1.0000 -173.1447
6.0000 -16.2965 -88.4697
7.0000 5.2471 62.5575
8.0000 -20.0881 -173.1447 9.0000 10.4942 -44.2349
10.0000 0 122.4318
11.0000 3.3513 -210.9015
12.0000 -9.0386
10
x
0 1000 2000 3000 4000 5000 6000
Example 3
• Check that in the previous examples:
• det𝐊 = 0
• 𝐊; = 𝐊
• More verification examples are in the textbook.
• “The deformed configuration seems to be the same as the undeformed configuration…”
– RE: It could be that displacements are really small, hence the deformed configuration is barely visible. Try adding a scaling factor (10, 100, 1000 or more) to your displacements.
• Matlab says “Undefined function or variable ...”
– RE: All the files need to be in the same working folder.
• “Does each file need to contain a “Contributions” section?”
– RE: Yes. Main.m must contain all the group members with their contribution. Each function also needs to have the same section, but not necessarily contain all the group members, hence I expect that you divide the work equally.
• “I did all the work and some of my group mates did not do anything.
Do we get the same grade?”
– RE: No. Let me know promptly of group members who sat back and did nothing, and I will not award them the same mark. If they did absolutely nothing, they will get zero marks.
• “I found this book/code on the internet. Can I use it?”
– RE: No. Plagiarism applies to software as well. We have our ways to find out if you take your code is not genuine.
• “Nobody in my group is good at programming.”
– RE: Everything you need to know will explained to you in the IT Classes, so do attend.
• “How will you time the codes?”
– RE: Using the commands “tic” and “toc” and “timeit”. The measure will be based on the execution of the file “Main.m”.
• “What happens if we cannot replicate the verification examples? Will we fail the coursework?”
– RE: No. You will not qualify for the competition, hence will not achieve higher marks. It is unlikely that you will fail the coursework, but it is still possible. I will check the submission and see what went wrong. Sometimes, even simple distraction mistakes will stop your code to run properly. You will also receive a feedback on the errors in your code.
• “Will the marks be based only on the speed of the code?”
– RE: Not entirely. I will check the actual code and see what went wrong. Each group will receive a feedback on what could have been done to speed up their code.
• “In Example 1, you gave us the Boundary Conditions, but you didn’t specify them for Example 2”. – RE: You need to write the Boundary Conditions for example 2.
• ”How can I improve the performances of my code?”
– RE:
https://uk.mathworks.com/help/matlab/matlab_prog/techniquesfor-improving-performance.html