• Assignment #5:
    Problem 1: Exact value for I2: I2 = 6.68768552562197447 (obtained by I2 = double(int('x^(-1/2)*exp(x)','x',0,2)) using symbolic toolbox)
    For loglog plot: Store values of N in vector Nv, store values of error in vector errv and use loglog(Nv,errv) . Note that a behavior err = C Na gives a straight line in the loglog plot.
  • Assignment #4:
    Example for plotting zero contours of two functions: For x1 in [-8,8], x2 in [-10,10] plot points where sin(x1-x2)+x1^3/20 = 0 with solid blue curves, plot points where cos(x1+x2)-x2^2/20 = 0 with dashed red curves:
    [X1,X2] = meshgrid(-8:.2:8,-10:.2:10);
    contour(X1,X2, sin(X1-X2) + X1.^3./20 ,[0 0],'b-');  hold on
    contour(X1,X2, cos(X1+X2) - X2.^2./20 ,[0 0],'r--'); hold off

    Note that you MUST use .* ./ .^ instead of * / ^ for element-wise arithmetic operations with the arrays X1 and X2.

  • Assignment #3:

    Problem 1:
    1(b): You can get equidistant nodes using x=linspace(-pi,pi,10) .
    For 1(c): Use 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:

    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.)

  • Exam 1 will be on Tuesday, March 7.
    Bring a calculator.
  • Assignment 1:
    If you have questions about the grading: First look at the solution. You can contact the grader Gunay Dogan at gunay@math .
  • If you are not familiar with Matlab: