This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: AMSC/CMSC 460 H. M. Glaz
FINAL EXAM
Friday, December 17, 2004 1:30 — 3:30 PM Instructions: YOU MUST start each problem on a new page. Make sure that you Show your work,
including intermediate results. ‘Matlab code’ means something fairly close to working code in the easier situations7 but syntax rules, etc.
are not important. Concentrate on making it clear that you know how to implement the algorithm in code7
given enough time. If need be7 use some pseudocode mixed in to make your point. Important: It is not likely that anyone will do all the problems. There are (25 + 20 + 40 + 50 + 75 + 75
+75) 360 possible points, plus two (2) Extra Credit parts. You should assume that I will set a maximum (i.e.7
perfect) score of 250 points, but that the grading will be fairly rigorous (I am keeping open the possibility
of moving this +/v 25 points). You may try all problems if you wish, but I advise otherwise. _
(new) Honor Pledge: I pledge on my honor that I have not given or received any unauthorized assistance
on this examination. You MUST write this out in full and sign it on the lipage. (1) (25 pts) Suppose that (i) you sample a function y(t) at distinct times resulting in the data (tk, yk) , k =
1, . . . ,8 ; (ii) that you are told to model the function y(t) by a cubic polynomial derived from a least
squares fit to the data; and (iii) the coefﬁcients a of the polynomial are to be calculated via the
Matlab expression 1 = A\b . a. (23 pts) Write down the matrix A and the vector b that make this work.
(b) (2 pts) How does Matlab obtain the answer? (2) (20 pts) Let
4
I:/0 6$p(17)d$. Obtain approximate solutions for the value of I by using the compound trapezoid rule with (a) (10 pts) 2 panels (equally spaced) ,
(b) (10 pts) 4 panels (equally spaced) . Note: it is not necessary to evaluate exponentials or actually perform the summa—
tions. Put away your calculators for this problem. (3) (40 pts) Let a1(;r~4)2+a2(x~3)3+a3(9c—2)4, x33
8(33): b1(ac—4)2+bg(a:—4)3——b3(:r—4)4, 33x35
01(xﬂ4)2+02(a:~r)3 “03(mw5)4, 5§x (a) (20 pts) Determine what constraints air, bi, chi : 1,2,37 must satisfy for 3(215) to be a cubic
spline. Your answer should consist of equations which deﬁne or relate these 9 parameters.
(b) (20 pts) Determine the values of the parameters so that the cubic spline interpolates the points (90,11) 2 (37 5) , (0, ~1) , (6.21) . FINAL 12/17/2004 DRAFT 1 Typeset by AMS—TEK (Hint: If you know what ‘cubic’ means, then the determination of a3, ()3, C3 should take just
seconds — nothing fancy here.) (4) (50 (+EC) pts) Consider the problem of ﬁnding an m E R such that
cos($) 2 ex — 1 . (a) (50 pts) Write a Matlab program which would ﬁnd an approximate solution using Newton’s
method. Using an error tolerance, try to insure that the error in the computed solution is no
greater than 10‘4. (b) (Extra Credit) Write a new Matlab program which is ‘highly likely’ to ﬁnd several zeros (moderate
EC). If you can write your code to get ‘all possible (double precision) solutions’ — more EC. You
must explain your work. (5) (75 pts) Consider using Newton’s method to ﬁnd a root of the equation g(y) = 0 . Deﬁne the function
f 2 limnmooyn where y0,y1 ,. . . are the Newton iterates for the initial guess yo 2 cc. (a) (42 pts) Write a Matlab m—ﬁle which computes an approximation to I: /01f(x)da: with an error no greater than 10”3 . (For full credit, the name of the function — or function handle
— should be an input argument, along with the tolerance(s).) Here, you will need an mﬁle to
compute g(y) for general inputs y, but the body will be empty for part You may use, e.g.,
the compound trapezoid rule for the quadrature (simplest). (b) (15 pts) Now, deﬁne 1
9(y)=(y—§)2~1
Fill in the mﬁle for g(y) and verify that your code will do what is required. (c) (18 pts) What is the exact value ofl for the special case deﬁned in part (b)? Explain (brieﬂy)
your reasoning. Note: ‘Brieﬂy’ does not mean zero or nothing; one or two sentences is enough. Hint: Part (a) focuses on algorithm / program logic; the rest requires speciﬁc analysis of the special
case. However, it’s likely that part (a) will be easier if you work some on (b) e (0) ﬁrst. (6) (75 pts) The linear system Ax :2 b is to be solved — U v
He 0) where U E 72me is assumed to be nonsingular and upper—triangular, and u,v E Rm are column
vectors. (a) (2 pts) If A E RNXN , what is N in terms of m.
(b) (23 pts) Specify the triangular factorization of A, that is ﬁnd w, 2 such that #th We? :> (c) (20 pts) Show that A is nonsingular if and only if uTU’lv 7E 0.
(d) (30 pts) Formulate an eﬁﬁcient algorithm to solve AX : b. Speciﬁcally, your algorithm should
require an operation count of only order n2 . Demonstrate this. FINAL 12/17/2004 DRAFT 2 (7) FINAL Hint: Sketch the matrix A — focusing on where the (large number of) zeroes are — and think
carefully about how Gaussian elimination ~ without pivoting (don’t even consider pivoting, or any
roundoff issues) proceeds. Notes: No Matlab code ~ just a sequence of steps to be performed; also, indicate how explicit
matrix inversions will be avoided. Make sure that you state where the problem hypotheses are used
* the n2 count depends directly on the fact that U is triangular. (75 pts) Let f(:r,y) = 1:2 + y2 — 21,, f (x, y) ~ (a) (25 pts) Let Q = [—1,1) x [4,1]. Write a Matlab code which does the following: (1) given an
integer N > 0, a set of N angles 6 = 0,27r/N,2 >t< (27r/N), . .. is formed and (2) the following
approach is implemented with the objective of obtaining N points on C : using the angles above,
consider the corresponding collection of rays from the origin to the boundary of 9. Along each
ray, use the bisection method to ﬁnd a point on C . Finally, (3) plot the points. (b) (15 pts) Demonstrate that the algorithm works (the main point is that each use of the bisection
method leads to a useful result, if you set it up properly). and deﬁne C = f_1(0); that is, the curve C is the zero set of Note: Of course, the exact solution for C is trivial to obtain. You are not to use the detailed
solution — instead, show that the boundary of Q is entirely outside C (and the origin is inside C)
and try to write your algorithm/demonstration for more general f (3:, y) . (c) (10 pts) What restrictions need to be placed on f (36,31) to guarantee that an approximation to
C is obtained? (See part (01) below; if you work part (d), then (c) — (d) scoring is combined.) (01) (25 pts; EC possible) Here, you are to consider the practicality of generalizing the algorithm to
more complicated functions f(9c, . A few examples are attached (although polar notaion is used
in the titles, it is straightforward to convert the equations to rectangular coordinates A and each
curve is the zero set for some f(:c, y) Redeﬁne the square 9 so that it contains the curve C in
each case (equivalently, the curves can all be scaled to ﬁt in the given 9 and retain exactly the
same properties as in the ﬁgures). Identify as many implementation issues as possible, and sketch possible generalized code. Be
sure to think about what to do if bisection fails — don’t let the program crash or just stop; more
difﬁcult — how do you know when a ray has multiple intersections and what to do about it. What
about cusp points? You can also construct examples which illustrate new problems. 12/17/2004 DRAFT 3 y—axis y—axis 0.5 ——1 —0.5 O 0.5 The plot of r = sin(29) _s x—axis The plot of r= a*exp(9 cot b) ; 3 =1 ,b = 1.3 x—axis y—axis The plot of r: 1 + cos(theta)
1.5 0.5 —1.5 y—axis —O.5 0 0.5 1 1.5 2
x—axis Nephroid —— www—groups.dcs.st—and.ac.uk/...
4 , ...
View
Full Document
 Spring '08
 staff
 Algebra, matlab, Numerical Analysis, pts, compound trapezoid rule

Click to edit the document details