MACE12201 Tools for Civil Engineers
Tools for Civil Engineers
Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
MACE12201 Tools for Civil Engineers
Matlab CW -- Basic and Programming
Q1. Use your favourite manual method to solve the simultaneous equations
+ 2 = 3 −
= −3 + +
2 − = 6
Now use Matlab to solve the equations and compare your results (5 marks).
Q2. Find out what function polyfit does. A proximity probe is a sensor which measures
the gap between its tip and a metallic surface. The sensitivity of the probe is defined as
the increase in its output voltage per unit increase in gap and is measured in volts per
mm. One such probe was calibrated by measuring the output voltage over a range of
gaps, as shown in the following table.
gap
(mm)
1.00 1.50 2.00 2.50 3.00 3.50 4.00 4.50 5.00
Voltage
(V)
1.00 2.49 3.79 5.50 6.80 8.40 9.70 11.49 14.15
Write a program to perform the following tasks:
(a) Plot a labelled graph of voltage versus gap: the points on your graph should be
indicated by a cross (‘×’) and not joined by straight line segments. (3 marks)
(b) Use function polyfit to fit a straight line through the data in (a). This straight line
should then be plotted onto the plot in (a). (4 marks)
(c) Use the listed output Voltage as an input vector, outputs further a vector of the
consecutive voltage variations.
Hint: e.g. for the input V=[1 2.49 3.79 5.50 ……], will output delV=[1.49
1.30 1.71 ……]. Recall what end does; or you could use the function length
instead (3 marks).
Q3. Use Matlab to develop a simple program analysing an isosceles triangle truss shown
below. (15 marks)
Fig Q3
T
1
l
2
h
P
3
MACE12201 Tools for Civil Engineers Jack Wu/ October 2021
2
The truss has a pin-support at joint 1 and a roller-support at joint 3. The vertex 2 of the
truss is hinged. A vertical downwards load P and a horizontal force T, as shown in Fig Q3,
are applied at the vertex.
The program should be able to accommodate all required input parameters, and output axial
forces F12, F13 and F23 in members of 12, 13 and 23, respectively, after the analyses are
carried out. Here Fij means internal axial force in member joining joints i and j, with its sign
convention: tension (+) and compression (-).
Since axial forces in the truss members can be calculated by using any standard method, you
can consult "Structures 1" lecture notes or any Structural and Stress analysis textbooks for
further details.
After being received the appropriate inputs, the Matlab program which should include the
given parameters (l, h, P and T as shown in Fig Q3) will generate a graph showing the
internal axial force F13.
• The program should have the facility to input the data interactively i.e. prompt the user to
input the member lengths of the necessary, the applied load (i.e. handle any lengths of the
truss members, any concentrated loadings at joint 2)
• The Matlab figures for the internal force F13 generated by your program should be titled
and labelled appropriately.
After finishing your programming, test it on the specific isosceles triangle truss given in
Matlab CW--Test and complete all blanks no later than the date stated.
The submission requirement for Q3 in Matlab CW – Basic and Programming includes
(1) an MS word file of your program together with the force F13 graphs it produces in the
two test loading cases with the corresponding inputs and outputs.
(2) the original program (.m file only).
* Matlab CW – Basic and Programming carries 30 marks for effort in writing the programs,
seeking the answers and producing the qualified figure when necessary. You will earn the
remaining 6 marks if you can validate the program (prove that it works correctly) by filling ALL
blanks in Matlab CW --Test correctly which is automatically assessed by Blackboard. It is your
responsibility to make sure to enter correct answers for ALL questions, otherwise you will lose
these marks in the test.
** Coursework submission should contain, as a minimum, the m-file, the figure produced (if
applicable), and any other information requested in the questions. For marking purpose, all m-
files and figures (where applicable) should also be copied and pasted (not a screenshot) into a
single word file with answers.