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).
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 aij = (-2 i)j and bij = 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.
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 Awhere 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 cm2. 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.