03.03.2014 Views

Numerical Methods Course Notes Version 0.1 (UCSD Math 174, Fall ...

Numerical Methods Course Notes Version 0.1 (UCSD Math 174, Fall ...

Numerical Methods Course Notes Version 0.1 (UCSD Math 174, Fall ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

4.3. SECANT METHOD 59<br />

(b) f(x) = x 2 − (2 + ɛ)x + 1 + ɛ, for ɛ small.<br />

(c) f(x) = x 7 − 7x 6 + 21x 5 − 35x 4 + 35x 3 − 21x 2 + 7x − 1.<br />

(d) f(x) = (x − 1) 7 .<br />

(4.13) Implement the secant method Your m-file should have header line like:<br />

function x = run_secant(f, x0, x1, N, tol)<br />

where f is the name of the function. Run your code to find zeroes of the following functions:<br />

(a) f(x) = tan x − x.<br />

(b) f(x) = x 2 + 1. (Note: This function has no zeroes.)<br />

(c) f(x) = 2 + sin x. (Note: This function also has no zeroes.)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!