Assignment

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

GENG2140 Assignment 1

Due Date: 29 August 5pm



Submission procedure: Please submit:
1. A soft copy (without hand drawings) of all your Matlab files to CSSE via
https://secure.csse.uwa.edu.au/run/cssubmit. Your submission should include the following
Matlab files:
- moment_of_inertia.m
- moment_of_inertia_test.m
- moment_of_inertia_test2.m
- fault.m
- stress.m
2. A hard copy report of the assignment to the assignment boxes provided by your school.
3. The hard copy must include everything you have done in your assignment, including the
results of your program runs and comments on the results obtained.
4. Please keep a copy for ourselves.
Note: You do not need to submit the hard copy of your Matlab code with your report.

In the following data A1 means the last 3 digits of your 8 digit student number divided by 1000. For
instance, for the student number 12345222, A1=222/1000=0.222.

For plotting graphs in EXCEL use INSERT, CHART, SCATTER.

1. Let a measurement of vibration described by
( ) 20 0 1 cos
2
s s = t t A u
be conducted with a random (non-systematic) error of amplitude Au=0.1. That is, -0.1 Au 0.1.

(a) Using EXCEL and the random function RAND() plot the exact and measured values on the
interval [0, 10].
(b) Find the exact velocity
dt
du
v =
Plot the exact velocities together with the measured velocities. The measured velocities are to be
determined from the data with the random errors using finite difference with the steps
At=0.1; 0.2; 0.4; 0.8; 2.4
(c) Discuss what time step would be the best for this problem.
(d) Repeat the previous steps for the error amplitude Au=0.3. Discuss what the effect of increasing
amplitude is.
(25%)

2. Write a Matlab function, moment_of_inertia, to compute
}

=
1
0
1
dx e x E
x n
n
,
for arbitrary n using the recurrent formula from the lecture notes. Your function should have the
following heading: function En = moment_of_inertia(n), where En is the return value of
the function. You should put your function in the file moment_of_inertia.m.
Write another Matlab function
function [n, En] = moment_of_inertia_test
that returns
- the value of n at which the result E
n
becomes negative the first time, and
- the value E
n
itself.
You may use a for loop or while loop to compute these values. Ensure that your function will not
go into an infinite loop. The function should be saved to a file named
moment_of_inertia_test.m.
Your function should also output a meaningful message onto the screen showing the values of n and
E
n
found by the function. You can use the fprintf, disp, or display function for the printing.
(Hint: To find out more information about the fprintf function, type doc fprintf in the
Matlab command window (similarly for the disp and display functions).)

Include the output produced by your moment_of_inertia_test function in your report.

In your report, comment on whether E
n
can be negative. Explain the result. Write another Matlab
function to produce a plot of n versus E
n
up to the value of n when E
n
becomes negative. Your
Matlab function should have the following heading:
function moment_of_inertia_test2
Save this new Matlab function to moment_of_inertia_test2.m. Include the plot in your
report.
(25%)


3. A fault dips 35 in the dip direction o=(1+A1)10 North-East. The stress state in the Earth crust
around the fault is characterised by a vertical stress of magnitude 20 MPa and horizontal stresses of
the magnitudes 12 MPa in the North-South direction and 5 MPa in the East-West direction. All
stresses are compressive. Write a short Matlab function which finds the stresses acting on the fault
plane and determine whether the fault will be in a stable condition if it resists sliding by friction
with zero cohesion and the friction angle = 25. Your Matlab function should have the following
heading:
function [stability_flag, tau] = fault()
where the first output parameter stability_flag should have the value 1 if the fault is stable, 0
otherwise; the second output parameter tau should contain the tau value computed (see lecture
note). Ensure that your function assigns appropriate values to these two parameters. You should
include appropriate fprintf (or disp or display) statement(s) in your function so that it prints
out the results in a meaningful way (for inclusion in your hardcopy report).
Your Matlab function should be saved to a file named fault.m.
You should use the supplied fault_test.m script file to test your fault function.
(25%)


4. For the stress matrix

MPa
A
|
|
|
.
|

\
|



=
1 3 0
3 2 1
0 1 1
o

determine, using Matlab, the principal stresses and principal directions. Your Matlab function
should be saved to a file named stress.m. and it should have the following heading:
function [stresses,dir1,dir2,dir3] = stress()
where the first output parameter, stresses, should be an array of 3 elements containing the three
principal stress values in decreasing order (i.e. stresses(1) > stresses(2) > stresses(3));
the last three output parameters, dir1, dir2, and dir3, should all be arrays of 3 elements
corresponding to the principal directions for stresses(1), stresses(2), and stresses(3)
respectively.
You should use the supplied stress_test.m script file to test your stress function.

Sketch (using pen and paper) the orientation of the principal axes and include it in your report.
(Hint: study the entries of the principal vectors and draw them approximately with respect to the
original coordinate set; these will give you the principal directions. You can attach a pencil drawing
or use any suitable drawing package. You can also call the Matlab function plot, line, or
quiver3 in your stress.m to plot these vectors for your report. Other useful Matlab functions
include eig, diag, and sort.) Explain the meaning of principal stresses and principal directions
in your report.
(25%)

You might also like