mm245/ma260 lab4
http://www.maths.nuigalway.ie/~gettrick/teach/mm245/labs/l4.html
-
As well as coming to the supervised lab - you are expected
to work on this lab on your own outside of lab hours (in your own time).
-
For this lab you must submit all source code (matlab/scilab/octave .m files).
The code should have comments of explanation, with at least as many
comments as code.
This should be sent in via BLACKBOARD (not directly by email).
Any questions asked should be answered by
typing into a plain text (.txt) file (or inserted at
the end of MATLAB/SCILAB/OCTAVE code after the percentage (comment) symbol)
which should also
be uploaded via blackboard.
-
This material should be uploaded
before
the deadline of 5pm
Friday November 15th, 2013. You will lose 20% for each day
(or part of day) the lab is late.
-
Plagiarism (the unattributed copying of work from other sources
(internet, fellow students,....)) will not be tolerated. Please see
http://www.nuigalway.ie/engineering/documents/plagiarism_guide_students
_v4.pdf. You risk getting zero for your lab if it is found to be
plagiarized.
-
If you are really stuck:
-
Ask in the lab
-
Post a question in the Discussion Board in BLACKBOARD
You should study (and run) the code in
trap1.m at
http://www.maths.nuigalway.ie/~gettrick/teach/mm245/labs/matlab/
which is commented to explain its operation.
For this lab,
consider the integral of x*sin(x) between the limits
of 0 and 3*PI/4 (i.e. 135 degrees).
-
Find the estimate given by using the trapezoidal rule in MATLAB with 8 (eight)
intervals. By calculating the exact integral (on a sheet of paper),
calculate (in MATLAB) the relative error. You should submit all the
MATLAB code you use to do your calculations.
-
Determine the number of iterations necessary to ensure a relative
error of less than 0.3%. You should submit all the MATLAB code you use to
do your calculations. [Hint: it is a good idea to use a WHILE loop here:
iterate the trapezoid calculations, using progressively more points
xi, until the relative error is below 0.003.]
©
NUI, Galway