437/537 Homework #3

due at the beginning of class, Thursday, Sep 27, 2006

Problems are from Sauer's book unless problem number starts with "X".

1.4

X1. [4 points] We saw in class Sep 18 that newton's method fails to converge to the root (0) of f(x) = tanh(x) when the initial guess x0=1.09. Try the routine fzero from Octave-Forge, and see if it converges given an initial bracket of (-1.00,1.09). Include hard copy of code and output.
Here's an example of a driver for fzero:
function test_fzero()
   format long
   approx = [-1,1.09]
   options.abstol = 1.0e-6
   fzero(@myfunc,approx,options)
end
You need to write your own "myfunc". The general syntax for a function of a single variable with a single return argument is
function out = foo( in )
   out = in*whatever + blah;
end
(b) [1 point] If fzero does converge, how many function evaluations does fzero use in order to get an absolute error of less than 10-15.
(c) [1 point] How does this compare with the cost of Newton starting from 1.08?

2.1

X2.(Cost of GE & BS). Here's the CPU specs of the computer "orange" in my office that served you this file
$ cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 15
model           : 4
model name      : Intel(R) Pentium(R) 4 CPU 2.93GHz
stepping        : 1
cpu MHz         : 2934.721
cache size      : 1024 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 5
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc pni monitor ds_cpl tm2 cid xtprbogomips        : 5871.31
(a) [2 points] On this machine, about how big of a matrix could you do Gaussian Elimination on in 1 minute?
(b) [1 point] In 1 hour?
(c) [2 points] How long would a back-solve take on the same machine for each of these two matrices?
(d) [2 points] Would these matrices fit in memory (see below)? Explain.
$ cat /proc/meminfo
MemTotal:      2571260 kB
MemFree:       1653428 kB
Buffers:         45808 kB
Cached:         485340 kB
This problem moved to HW 4.
2.1 CP 1 [correct GE and BS code: 6pts, correct usage and answer 2pts] (Do only the Ex 2c problem) with coefficient of z in eqn 2 changed to 0.97.

2.2

2.2 Ex 2a [4pts] (matrix factorization by hand)