Somehow the correction I made on Nov 2 to the sample output for the computation or \(\sqrt{2}\) got undone. This has been fixed.
Thanks to Pawel and Eric.
bounce.m
corrected; online handout updated (page 21).Jean and Chan have brought to my attention a serious bug in
my original implementation of bounce.m
.
This also has necessitated a change to the handout that, sadly, amounts to a clarification of November 9th's clarification (page 21).
Click HERE to see the corrected source code: search for the comment that begins with ZZZ.
As explained in the code comments, the assignment of the
variable dlim
, which defines the width of the border around
the unit square for plotting purposes, was previously made
inside the graphics section, which means that if plotting is
disabled (i.e. plotenable
is 0) then it doesn't
get assigned. However,
it needs to be assigned ALWAYS, even if plotting
is disabled, since I have asked you to use it in your determination
of when the simulation should end.
Action you need to take
This varies depending on whether you have or have not started working on the problem.
If you have started
If you have already copied bounce.m
to mbounce.m
and begun
work on mbounce.m
then simply move the assignment statement
dlim = 0.15;
out of the for
loop: in my amended version I have put it immediately
after the statement:
fwidth = 5;
So once your code reads ...
fwidth = 5;
dlim = 0.15;
... you're good to go.
If you have not started
If you have not yet copied bounce.m
then you need to take
NO ACTION, apart from following the updated instructions, which
involve a clarfication of November 9th's clarifaction (sorry!), but
please do get working on the problem!
Thanks to Jean and Chan.
Action you need to take
Read the clarification on page 21 and be sure that your implementation conforms to what is described there. There is no change to the original specification, but there has been some confusion on this point; hence the addendum.
Action you need to take
Use the corrected bounds in your code (the same bounds used in
bounce.m
)
Description
The bounds for the plotting domain were incorrectly specified. They should be
\[
-0.15 \le x \le 1.15 \quad\quad\quad -0.15 \le y \le 1.15
\]
Thanks to ??? (send me your name and I'll post it here for posterity!)
Action you need to take
Use the corrected upper bound
Description
The 2-item list following the text
"Then create a script file tf2.m
that"
incorrectly stated the range of \(x\) that is to be used for plotting and for identifying roots: it now correctly reads
\[ 0.1 \le x \le 18.0 \]
Previously the upper bound was given as 1.8.
Thanks to Connor B.
Action you need to take: None, other than to note the change.
Description
I cut-and-paste the wrong output for the invocation of newtonfda
that computes \(+\sqrt{2}\), so it was a duplicate of that for the
\(-\sqrt{2}\) calculation. The displayed output is now correct.
Action you need to take: None
There was some text missing in the first paragraph of section 3.2.1, and the problem has been rectified.
newtonfda
header (page 15)Action you need to take
Use the amended header in your implementation of
newtonfda
Description
I've changed the specification of the header for newtonfda
to
function x = newtonfda(f, x0, h, epsilon, nmax)
It was previously
function [x] = newtonfda(f, x0, h, epsilon, nmax)
Since there is only one output argument, x
, which is to be a vector,
the [ ]
around x
are redundant: i.e. the definitions are equivalent,
so I'm opting for the syntactically-simpler one.
Action you need to take
Use the corrected header in your implementation of
zebra
Description
The function header is
function z = zebra(n)
not
z = zebra(n)
as in the original.
Thanks to Kevin K.
Action you need to take
Read or reread item 10 of the updated instructions carefully, paying heed to the Warning!! section.
Action you need to take: None
Equation (1) had a typo: there was a subscript \(k\) on \(y^{\rm in}\) which has been corrected to \(i\)
Thanks to Amanda.