• Assignment #3: due date extended to Wednesday, Nov. 3

    Problem 1:
    1(a):
    Solve a linear system to find the coefficient vector of the polynomial. Then evaluate the polynomial using nested multiplication. Do not use the Matlab functions polyfit or polyval .
    1(b): You can get equidistant nodes using x=linspace(-pi,pi,10) . For (C) use equidistant nodes. For (i) (B) give a theoretical error bound using the bound for the Chebyshev polynomial below.

    Problem 2: Use [x,y] = pickpoints(9) to enter the points. Download pickpoints.m
    For (a) do the following:

    • t=1:9; te=1:.05:9;
    • For the data given by vectors t, x use spline to evaluate the interpolating function at points te, yielding vector xe
    • For the data given by vectors t, y use spline to evaluate the interpolating function at points te, yielding vector ye
    • plot(x,y,'o',xe,ye); axis equal

    For (b) use polint instead of spline.

    Problem 3: Remember to take the logarithms (log in Matlab) of the population values before doing the least squares fit: p=[75.995,...,249633]; q=log(p) .
    Print out the vector c which you get for (i),(ii),(iii) and check that they are the same (up to roundoff errors). Then use one of those c vectors for the plot and for the predicted population.

    Problem 4: Download co2.dat , then use in Matlab load co2.dat (not load co2 as stated in the problem).
    IMPORTANT: Use x = 1:length(co2) since x is the time in months (the seasonal variations in (ii) have a period of 12 months.)