

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Due Date: See web page
[i] Save all the files in the directory pre-09-03-matrixmult in a directory of the same name in your nyx-login home directory. YOU HAVE TO make a single change to the file pbs.sh before you do anything. Run the following commands to begin with:
module load pgi module load acml
Compile the timing code for matrix-matrix multiplication using the command
make -f makefile.nyx.mak Time
To run the compiled code, submit the job using
qsub pbs.sh
To check the status of your job, use
qstat -u yourname
Look at the output in /home/yourname/out.txt. What do you learn from the output? Run the program with different inputs by modifying pbs.sh. By different inputs I refer to different dimensions for the matrices. Time the matrix-matrix multiplys for matrices of dimension 3, 4, and 5. To do that you have to change all the 1000s in TimeMatrixMult.cpp to 10000000. Why is the BLAS matrix-matrix multiply so much faster for 200 × 200 matrices, but slower for much smaller matrices?
[ii]As explained in class, the Lorentz transformation
x′^ =
x − ut (1 − u^2 /c^2 )^1 /^2
t′^ =
t − ux/c^2 (1 − u^2 /c^2 )^1 /^2
where c is the velocity of light, is a matrix transformation. Here (x′, t′) give the velocity in frame of reference that is moving with speed u with respect to the (x, t) frame of reference. Find the eigenvalues and eigenvectors of the matrix. One of the eigenvalues is √ 1 − u/c 1 + u/c
What is the physical interpretation of the eigenvectors? Suppose the (x′′, t′′) frame is moving with a speed u′^ with respect to the (x′, t′) frame. What are the eigenvalues and eigenvectors of the transformation from (x, t) to (x′′, t′′)? Write down the answer without doing calculations.
Express one of the eigenvalues in the form √ 1 − U/c 1 + U/c
for a suitable U , and thus derive the relativistic law for addition of speeds.
[iii] Suppose the orientation of a moving rigid body about its center of mass is given by Q(t), where Q(t) is a function of time t that is a 3 × 3 orthogonal matrix with determinant
[iv] Write a matlab function
[dd0, dd1] = qrtridiag(d0, d1, shift) %% d0 = row vector of length m %% d1 = row vector of length m- %% dd0 = row vector of length m %% dd1 = row vector of length m-
that works as follows. For a tridiagonal matrix A, d0 gives the main diagonal of a real symmetric matrix and dd0 gives the subdiagonal. For instance, for
d0 = [1, 1 , 1 , 1 , 1] and d1 = [1, 2 , 3 , 4]. Your matlab function must do a qr factorization of A and then return rq, with a shift. More specifically, if
QR = A − shif t ∗ eye(m) B = RQ + shif t ∗ eye(m),
dd0 and dd1 must correspond to the tridiagonal matrix B. You can implement this step using Matlab’s qr, although you are welcome to do a more efficient implementation using Given’s rotations. Do two implementations of the QR algorithm, the first with no shifts and the second using the last entry of d0 as the shift at each iteration. The second implementation must