Problem set 3 Due: Tuesday October 13, 1998

Curve-fitting and Interpolation

1. (a) Take x i = 1,2,3, ... 10 , generate 10 corresponding random y i 's using Matlab's randn function. Fit both a straight line and a parabola to your data. Plot the results.

(b) Fit the polynomial of highest order possible to your data. Plot the polynomial on a finer grid (i.e. more x 's between 1 and 10), highlighting the data points. Compare that high order polynomial to the spline interpolant which you can obtain using matlab's spline function.
(c) repeat (b) for 15 x's from 1 to 15 and 15 corresponding y's.
(d) what do you conclude from your experiments in (b) and (c) (plus whatever other experiment you feel like doing)? Keep it brief but meaningful.


2. Explain how you can use Matlab's polyfit to fit data to an exponential decay law (such as radioactive decay data) y = A e - B t . What are the best A and B for this data?



Fabian Waleffe
1998-10-04