1. (13 points) Let f be smooth function. Using the Taylor exansions of f(z), f(Ith). F(I-
2h) f(x-h). and f(x-2h), develop fourth order central difference approximation to
f"(x) the form
taof; Faifj+1 O(h¹),
where the as are coefficients to be determined and as usual we assume uniformly spaced
grid and we let fits f(xj bh).
Report each as as rational multiple of an integer power of h.
2. (17 points) Consider the following scenario. Let To x, denote chosen points
given interval. We are given both the function values f(z;) and the first derivative values
for i=0, 1....n. We would like to find polynomial P of degree at most 2n
which interpolates both the the function and its first derivative. That is. we would like
to find such that
P(x)) f(x)), and P(x) j'(x;).
where Ln,i denotes the ith degree Lagrange basis polynomial
Show that the polynomial
satisfies deg(P) S 2n and the conditions listed in by first showing that
Hi(xi) 8,11 and H}(xi) 0.
and then deriving similar relations for H;. (Note that diy denotes the Kronecker delta
You may find its definition here.)
3. (15 points) Many of the quadrature rules we have studied take function values from a
uniformly spaced grid. It turns out, however, that such choice of points is far from
Define new quadrature by
Show that, with only two function evaluations the quadrature given in (2) can integrate
polynomials of degree at most exactly
Hint: Consider first applying the change of variables x 6-41 bto to transform I to an
integral over symmetric interval. Further, recall that the definite integral is linear and
that every polynomial of degree at most 3 is a linear combination of terms of the form
x1. for i=0,1,2.3.
(15 points) Use the Newton-Raphson method to solve the following system of nonlinear
Set tol = ..e-6 and max.iter 100. Use I(()) [1,1,1]T as starting point and note
that your algorithm should converge to solution
5. (20 points) Consider the function F(I. y) = 2.²² 2x 4u² 6u 2.ry +7. Show that
the Newton-Raphson method for optimization converges in this case in single step,
regardless of the starting point z(())
Do this by finding the minimum of / analytically (as critical point of the function).
computing the Hessian and gradient by hand and carrying out the necessary calculations
Then verify your computations by using an implementation of the optimization method
in Matlab, using tol 1.e-6.
6. (20 points) Consider the following boundary value problem
Using N 41 node points,
(a) Derive the tri- -diagogal system to solve the ODE using central difference for both
1st- and 2nd-derivatives. Identify elements of vectors a. b.c and f
(b) and plot your numerical solution against analytical solutions. You can obtain the
analytical solution from Wolfram/ Alpha, and evaluate the arbitrary constants.
7. (15 points) Bonus PDE question (up to 15% of total points of problems through 6)
The steady state temperature distribution T(I y) in a rectangular copper plate, 0 :52
subject to the following boundary conditions:
The upper and lower boundaries (y =0 and y = 1) are perfectly insulated i.e., the
normal derivative of 7 zero at these boundaries.
The left side (x =0) is kept at 0°, and the right side at f(y) =g.
You need to write program to evaluate T(r.y) numerically.
(a) Discretize the Laplace equation using second-order finite difference approxirnation
of the second derivatives. At the upper and lower boundaries (y =0 and
also use second-order finite difference for the Neumann boundary conditions. Show
equation for The for interior points, and similar equations for Neumann boundary
Then write program to compute the solution using the SOR method with & =
1.25 and = 1.75. You should use M = N = 11 points in the z- and y-directions
(including boundary points). respectively (note: the grid spacing is not the same in
x and directions).
The program should iterate following the specifications below:
Start with initial temperature distribution T.i for all and 7, except for the
boundary elements corresponding to T
Iterations should stop when the solution reaches steady-state the residues
between iterations are
Record the total number of iterations required. Monitor your solution at the center
of the plate, T at (x.y) (1,0.5), at each iteration : and compare with the exact
Plot the relative error c(k) as the iteration progresses (similar to Fig. 8.7)
The exact solution at (1,0.5) is T(1,0.5) =0.25.
These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction
of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice.
Unethical use is strictly forbidden.