Department of Mathematics

Spring Semester, 2006

See Online Course Synopsis Handbook for information about Spring 2005 offering of this course: Mathematics 160S

Click here for our text's home page, which has links to program source code and errata.

**Homework**

- On each homework paper, please acknowledge the The Duke Community Standard.

- Except where indicated otherwise, please write your own computer code, based on a method's algorithm or on pseudocode given in the text.

Write a program that executes the following algorithms for initial value problems:

modified Euler (author's nomenclature, p. 276-277), Heun's method (author's nomenclature, p. 274), and 4th-order Runge Kutta (RK4).

Use all three of these methods to solve problems 5c and 5d from text page 264.

In addition (for 5c and 5d), by reducing the step-size h by multiplying by successive factors of 1/2 (you may wish to do this more than twice), obtain approximate values for y(b) and compute approximations to the orders of convergence, the asymptotic constants, and the true value of y(b) (note that b = 2 in 5c and b = 1 in 5d). Discuss the resulting asymptotic approximations to y(b) in the context of the true value for y(b), obtained in problems 7c and 7d (p. 264).

From the text, page 264, problems 7c and 7d, as follows:

for this problem, for the three methods above, and also for
forward Euler (as in HW8),
graph the error, y(t) - (numerical approximation), on the
intervals stipulated by the text in 5c and 5d (page 264), under
the assumption that the numerical approximations use linear
interpolation between values of w_{i}. Also,
produce graphs of error for step sizes h/2 and h/4.

Describe and discuss the differing errors for forward Euler,
modified Euler, Heun's method, and RK4, and how these errors
are related to the order of convergence.

- Homework No. 8, due Thursday, March 30.

Problems from text, pages 255-256: 3(b,d), 6, 8a, 9a.

A program that executes the forward Euler algorithm for initial value problems.

From the text, page 264, problems 5c and 5d.

In addition, by reducing the step-size h by multiplying by successive factors of 1/2, obtain approximate values for y(b) and compute approximations to the order of convergence, the asymptotic constant, and the true value of y(b) (note that b = 2 in 5c and b = 1 in 5d). Discuss the resulting asymptotic approximation to y(b) in the context of the true value for y(b), obtained in problems 7c and 7d, below.

From the text, page 264, problems 7c and 7d.

For this problem, graph the error, y(t) - (numerical approximation), under the assumption that the numerical approximation uses linear interpolation between values of w_{i}. Also, produce graphs for step sizes h/2 and h/4.

From the text, page 265, problem 15.

(Note that you can get the true solution y(t) by means of separation of variables. I think that the characterization in part b ``minimum error obtainable'' is incorrect; instead, it is a bound on the error.) I urge you to use values of h that are smaller and smaller, by multiplying by successive factors of 1/10, to see whether the predicted behavior of the error can be observed.)

- Typewritten report due Tuesday, March 28.

The report, not less than one page and double-spaced, should describe your final project plans.

- Homework No. 7, due Thursday, March 23.

Program for empirical order of convergence.

Problems from text, pages 204-205: 11 and 16.

Supplementary problem. For the integral in problem 11, page 204: approximate the integral, using 2, 4, 8, 16,... , etc., subintervals, and single precision arithmetic. Do this for both the trapezoidal rule and Simpson's rule. For each three successive evaluations, compute p, C, and I from the equations for empirical order of convergence. (Of course, do this separately for the two differing cases, i.e., the trapezoidal rule and Simpsons's rule.) Graph p, C, and I as functions of the exponent n, where 2 to the nth power is the number of subintervals of the third of the successive evaluations. Continue until the integral approximations no longer converge with the appropriate order. Show that the empirical coefficient C that we found in class is consistent with the asymptotic error estimates for the trapezoidal rule and for Simpson's rule.

- Mini-project (target due date, Tuesday March 7)

Mini-project specifications

- Homework No. 6, due Tuesday, February 28.

Programs for second-order numerical differentiation and for the trapezoidal rule and the composite trapezoidal rule.

Problem from text, pages 176-178: 5(a,c), 7(a,c); 24 (note that the ambiguous "Example 4" refers to the material after Example 3, but preceding Example 4, and then to the material after Table 4.4, but before the little blue square).

Problems from text, pages 195 and 196: 1(a,c), 3(a,c), 15, 24.

- Homework No. 5, due Tuesday, February 21.

Programs for Newton divided difference and for cubic spline; also a program to graph a cubic spline using a set of arbitrary points. For the cubic spline, you may borrow code from a pre-existing source (but do not use an input-output black box).

Problems from text, on pages 127 and 128: 1 (use Eq. 3.10 for part a; algorithm 3.2 for part b); 8 (confirm agreement at the nodes); 19; 20.

Problems from text, pages 153-157: 3d; 7d (note that "Exercise 4" is a misprint; the problem should say "Exercise 3"); 25; 32. Graph all the splines that you obtain in these problems, on the given domain. Use enough resolution so that the graphs appear smooth (except for the exceptional points in problem 32). In problem 25, also include graphs to compare the function f to the splines.

Supplementary problem: use a spline with 11 evenly spaced nodes to approximate f(x) = 1/(1 + x*x) on the interval [-5,5]; compare your results graphically (101 points recommended) to those obtained with the interpolating polynomial that uses the same 11 nodes (you have already done the interpolating polynomial case in Homework 4, problem 25).

- Homework No. 4, due Tuesday, February 14.

Programs for interpolating polynomial (Lagrange form) and for Neville's method.

Problems from text, on pages 115-117: 1(a,b), 3(a,b), 5a, 9a, 11, 25 (you can make use of Neville's method for problem 25).

Supplementary problem 1: Graph a sampling of the interpolating polynomials, of degree up to and including 10, over the interval [-5,5], for the function f in problem 25 (you may use Neville's method; make sure to use enough evaluation points to get nearly smooth curves). In each graph, include a plot of f for comparison.

Supplementary problem 2: Using 101 evenly spaced points between 0 and 2, graph P(x), the interpolating polynomial of degree n for exp(x), where the node points are given by (i*2/n, exp(i*2/n)) for i = 0 to n, for (a) n = 1; (b) n = 3; and (c) n = 10. In each graph, include a plot of exp(x) for comparison. What is the maximum error, in each case, in terms of |exp(x) - P(x)|, when the maximum is taken over all 101 points?

- Homework No. 3, due Tuesday, February 7.

Assigned reading: Sections 2.3 and 2.4 through the top of page 79; Section 10.2.

Newton method programs; from text pages 71-73: problems 1, 3, 5(b,d), 6a, 18, 27; and on page 614: problem 7a.

- Homework No. 2, due Tuesday, January 31.

Assigned reading: Sections 2.1 and 2.2.

Program for bisection method; from text, pages 51-52: 4, 13, 14

Program for fixed-point method; from text,pages 61-62: 8, 10, 15

(Note that problem 10 contains an error: "11" should be "13.")

In problem 10 (Section 2.2), consider two possible strategies: a fixed point of (i) f(x) = 25/x^2; or of (ii) f(x) = 5/sqrt(x).

*In each case, find, if possible, an interval [a,b] containing the root such that f[a,b] is a subset of [a,b]. If not possible, prove that it isn't possible.

*In addition, in each case, find, if possible, an interval [a,b] containing the root such that |f'| < 1. If not possible, prove that it isn't possible.

*For each case, try the fixed point method and report the results.

- Homework No. 1, due Tuesday, January 24.

Assigned reading: Section 1.2.

Supplementary Problems on "Caution";

and from from text pages 26-28, problems 1(b,d,f,h), 12, 17, and 22.

Click here for Possible Projects

**Important dates**

- Final quiz: Tuesday, May 2, 7:00 PM - 10:00 PM

Return to: Layton's Home Page * Faculty List * Department of Mathematics * Duke University

Last modified: 24 March 2006