Computer Science Projects

 

 

Your task is to write three programs which perform linear algebra computations.  At each due date, your team will turn in to us

a sheet of paper, typed, with either

a)      the path to the source and executable code

b)      or a diskette with the source and executable code on it, which runs under Windows

We will then grade your work according to the criteria

 

a)      does it run ? We will then run it with test data

b)      are the answers correct?

c)      is the source code readable and well documented? well organized?

d)      is the software user friendly?

 

It is suggested you test your software yourself by checking your answers with Maple.

 

Program #1. Gauss Jordan Software – due Friday, Nov 8

§       write an interactive program using C++ or Java which

allows the user to enter their system of equations

implements the Gauss-Jordan algoritm

displays the solution

§       it should work for all 3 types of solutions

§       it should work correctly for random problems entered by us

§       the source code should be with it, readable and well documented

Program #2. Matrix Algebra Software  due Tuesday, Nov 19

                       

                                    Input: either one or two matrices of any size (within reason; 10x10 is reasonable).

                                                they should see what they inputted and make changes if they made a mistake.

 

                                                additional information needed to determine which matrix operations they wish

 

                                    Computations:

                                                product of two matrices

                                                a power of a square matrix

                                                a power times another matrix

                                                the inverse of a square matrix  (much code from Project 1 should be recyclable here)

 

                                    Output:   computations as they are done.  If matrix is singular, tell the user.

 

                                    This should all be with float data type – not just integer/textbook problems

 

 

Program #3.  Dominant Eigenvalue Estimation 

 

                             Input:  a square matrix (A)

                                                  a column vector x  (same size as A)

                                                  an integer k 

 

                             Computations:

                                        Compute the vector Akx

                                                  Compute the vector Ak+1x

                                                  You now have two vectors of the same size. Entry by entry

                                                  compute the ratio of the latter ( Ak+1x)  to the former (Akx)

 

                             Output:

                                         The ratios  (3 decimal places should be fine), in order

 

Comments:  from a programming point of view, this is an exercise in stealing code from your second project! You did most of this.

 

Testing it:   pick a matrix of your choice , 3x3 or so, with all positive entries.  Use Maple and find out what the eigenvalues are and make note of the largest one (it should be positive).  Also note the eigenvector  for it.

 

Now input it into your software. Take x to have entries of all 1’s.  Try a power like 8 or 10 for k.

 

The ratios you output should be approximately all the same if k is large enough. The ratio should also be familiar!

 

Why this all happens will be explained in class….

 

So…this should not be a long assignment, but it is a valuable numerical example of programming.

 

Due date: Monday, Dec 9.