Numerical Linear Algebra, Math 4267, Homework # 5 Due March 29, 1999

Part # 1

In order to describe the contour of an airplane, we seek a function

However we can't proceed as in homework # 4 to find ck since we have no function to integrate. However we can sample the contour and use a summation rather than an integral. PC-Matlab has a built in function called fft that will find the ck if we are given sampled data points on the contour. Such sampled data points are at ftp://www.etsu.edu/kerleyl/nla in file air.dat. Our objective is to plot SN different values of N. As expected, the bigger N the better the approximation, thus the better the plot. To achieve this, do the following.

The following PC-Matlab code is helpful.


strg='Input number N for plotting SN where N < 256';

N = input(strg);

N2= round(N/2);

load air.dat;

% Let j = complex number (0,1)

j = sqrt(-1);

f = air(:,1) + j*air(:,2);

plot(f);

% f represents the original airplane

% Find the Fourier coefficients

c=fft(f);

L=length(c);

A = zeros(L,1);

% To evaluate SN, we want to make all of the entries of the vector c zero except the first N/2 entries and the last N/2 entries. Call such a resulting vector cmod. Apply the inverse Fourier transform which is the Matlab function ifft to cmod to obtain a vector say fnew.

Produce 8 plots as follows:

(1) f

(2) c (Hint: Use plot(c,'g.'); The graph will have dots with no connecting lines.

(3) cmod (Hint: Use plot(cmod,'g.'); The graph will have dots with no connecting lines.

(4) fnew for N = 16 and N = 64

Remark: f c via fft

and c f via ifft.


Part # 2

Work p 606, 8

See files orbit.m, orbitj.m, Newt.m, and Newtrun.m at ftp://www.etsu.edu/kerleyl/nla . These 4 files illustrate algorithm 10.1 on p 601 applied to solving the following non-linear system of equations

3x2 + 4y2 - 3 = 0 and x2 + y2 - sqrt(3)/2 = 0. One problem arises in starting with a good initial guess. Suggestions about this will be made in class.

To work 8b, type in help fzero. For example, to solve x^2 = 2, one would

save a file say xsq.m where code is as follows

function y = xsq(x)

y = x*x -2;

Then use

root1=fzero('xsq',2) to find one root and

root2=fzero('xsq',-2) to find the other root.