*Only do this assignment if you are not doing a project.*

Please turn in this assignment by emailing them to me .
Please use the subject of "Physics 222 HW6" for this assignment
(if you use the link above, the subject will be added automatically).
Please *attach * the source code to any programs that
you write for this assignment. If you write more than one program,
attach *each separately*. When answering the questions themselves
feel free to answer directly in the body of your message (or attach your
answers).

#### Matrices and vectors

In this program you will get some practice using some of Fortran's arrays features.

Your program should declare two allocatable, 2D, real arrays

**A**and**B**. The arrays will be square arrays of equal sizes. Your program should prompt for the sizes of the arrays and then initialize them so that the value of a_{ij}= (-2 i)^{j}and b_{ij}= 4*i * j, where i is the row number and j is the column number.Your program will then do several calculations with these arrays and print the results of each to the screen.

- For each array it will take the square root of the sum of each array element multiplied by itself.
- It will calculate the matrix multiplication
**C**=**A B**of the two arrays. - It will find the dot product of a given column vector of
**A**with a given row vector of**B**. Your program should prompt for which row and column to use. - Finally, your program will find a array
**D**. Where a_{ij}< b_{ij}, d_{ij}= π a_{ij}^{2}, otherwise d_{ij}= a_{ij}* b_{ij}.

- 2 x 2 arrays, dotting and crossing the column 1 and row 2, respectively.
- 3 x 3 arrays, dotting and crossing the column 2 and row 2, respectively.
- 5 x 5 arrays, dotting and crossing the column 5 and row 1, respectively.
- 8 x 8 arrays, dotting and crossing the column 4 and row 2, respectively.

#### Leaky Water Tower

Consider the case of a cylindrical water tower with a leak on its side near the bottom of the water tank. If we know the area of the hole, then the change in volume is:

dV/dt = - v A

where the velocity that the water leaves the hole can be determined from fluid mechanics. Convert this problem to a difference equation and solve it numerically for the height of the water as a function of time. Your program should read the numerical parameters from a file. The input file will contain (in order) the size time step to use in seconds, the initial height of the water in meters, the radius of the water tower in meters, and the area of the hole in cm^{2}. Also assume that the tank is open on the top. Find the total time it takes water to drain from the hole, and plot the height of the water as a function of time for your results. Run your program for the files water_tower1.dat and water_tower2.dat.