PHYCS 3730/6720 Lab Exercise

Reading and references: Here we learn about doubly subscripted arrays and construct them in two ways. Also we practice solving eigenvalue problems using Maple. The answer file is lab14.

Exercise 1. Simple C++ and C

Write a simple C++ program that declares a doubly subscripted array of a[10][5] and assign values a[i][j] = 100*i + j. Print out selected values to verify that you are getting the result you expected. Does the value a[i] have any meaning with this method?

Copy your code and results to the answer file.


Exercise 2.

Use Maple to find the eigenvalues and eigenvectors of the matrix
   9   3   3
   3   2   4
   3   4   2
Remember to use with(linalg). The functions eigenvals and eigenvectors are what you are looking for. Be sure you understand the output from the eigenvectors function. To check your understanding, verify that the eigenvector for the eigenvalue 12 satifies the eigenvalue equation: matrix times eigenvector equals eigenvalue times eigenvector. To multiply a matrix a times a vector v use
   evalm(a &* v);
The &* operator is Maple for multiplying as matrices as opposed to multiplying as numbers.

Copy your Maple session to the answer file.