``Computer Literacy'' Assignment 7 This assignment is to use PV-Wave and Maple on a few simple tasks. Part I. Use PV-Wave For this first part, you will need the following files: Ab.dat y.dat These are the same files used for ``Computer Literacy'' Assignment 5 (October 5) You can get them from the Web page, or directly from my public ftp directory on science, /usr/pub/jgentle/csi801. (Or anonymous ftp, then cd jgentle/csi801) **** for now, skip the PV-Wave part of the assignment if you have any difficulties with it. I.1. The data in the file Ab.dat represent an overdetermined system of linear equations. The first three columns are the coefficient matrix A and the last column is the right-hand side b. Read this matrix into PV-Wave. Use wc -l to determine how many rows there are in Ab.dat, then use openr, unit, 'Ab.dat', /Get_Lun RMF, unit, ab, rows, 4 Extract the coefficient matrix and the right-hand side into appropriate matrices, and then solve the system A*x = b in the least squares sense. (If you do not know the expression for the LS solution, use elementary calculus to determine a minimum of (b-A*x)'*(b-A*x).) Print the solution, x. I.2. Write an .pro file for a procedure to do a bubble sort. The procedure should be called bubble (the file is bubble.pro). The procedure should be invoked by bubble, x, y So the first line of your bubble.pro file is pro bubble, x, y Print your .pro file. I.3. Retrieve the signal stored in y.dat. This is a single channel noisy signal that was sampled at 1000Hz. It consists of two apparent sinusoids. Plot the signal (Just use plot, y.) Now let's use a tenth-order lowpass Butterworth filter with a cutoff frequency of 80 Hz to look at the signal further. Do this by filter = 1/(1+(y/80)^20) z = FFT(FFT(y,-1)*filter, 1) Now plot z. To see it better, now plot only the first 100 elements of z. Print the number of peaks you see in the first 100 elements of z. Part II. Use Maple on the NeXT. II.1 Solve the second-order ODE y'' + 2y' + y = exp(-x) (y'' and y' indicate derivatives wrt x) Now solve the same ODE with the initial conditions y(0) = 1 and y'(0) = 0 Plot the solution to the IVP over the range (0,8) II.2 Consider the 3 by 3 Toeplitz matrix with elements a, b, and c. (That is the matrix that looks like this: a b c b a b c b a) Invert this matrix. Using Maple's solve() on certain expressions in the symbolic solution you obtained, determine conditions for which the matrix would be singular. (Hint to reduce your typing: you can use such things as %1 or %2 to represent certain things.) II.3 According to Maxwell-Boltzman theory, the probability density of the velocity of a gas molecule is proportional to (m/(k*T))**(3/2) * exp(-(m*v**2)/(2*k*T)) * v**2, where v is the velocity, T is the absolute temperature, m is the molecular mass, and k is Boltzman's constant. Determine the mode of this distribution (the point where it achieves its maximum value -- the "most likely" velocity) by determining the critical points (points where the first derivative is 0) and finding one of those whose second derivative is ...(positive or negative?). Your solution is called the rms velocity. II.4 Produce a 3-d display of the "Sidney Opera House"; that is, plot the function \[ \sqrt{\Gamma(0.01+ |x|) * J_0(y) * J_1(y) }, \] over the ranges x:(-6,6) and y:(-3,3), where $\Gamma$ is the gamma function and $J_i$ is the Bessel function of the first kind, of order $i$. (Use ?Bessel and/or ?inifcns to get more info about these functions in Maple. Use ?plot3d also.) Link this image into your Web page for this class.