This assignment will help you to start using the UNIX operating system, edit files, write FORTRAN code and use the FORTRAN compiler. You have to modify the code I wrote for solving a set of second order equations, to solve a set of systems of linear equations.
In a first step you have to copy the files eq2.f and eq2.inp from the /home/tomanek/PHY480/HW1 directory on gauss.
Next you will compile the eq2.f file using the g77 compiler, e.g.
g77 eq2.f -o eq2
This program solves a set of 2nd order algebraic equations of the form
a x2+ b x + c = 0
File eq2.inp contains a set of coefficients a, b, c written in three columns for each equation. You could change these values using the vi editor. To run the executable use
eq2
and enter the name of the input file (eq2.inp) when asked.
Finally, you have to modify the FORTRAN program to solve a set of systems of linear equations of the form
a11x + a12y = b1
a21x + a22y = b2
Please make sure that you have covered all possible scenarios. Test your program with an input file containing a set of coefficients a11, a12, a21, a22, b1, b2 on each line.
I will test your program with my input file. Grades will be based on the results.