Greeting,
I am working on a problem that involves optimizing the shape of a tank so that the level drops at a constant rate.

Problem and my attempt
----------------------

Working on the problem, here is what I know. There is an axially symmetrical tank whose wall shape is given by $f(z) = R(\frac{z}{H})^n$ which is shown in the figure. The spigot of the tank has cross-sectional area, a and there is no vena contracta. What I need to do is find $n$ so I can satisfy these conditions. 

Here is what I have done so far to start on the problem. I am assuming that the area where the spigot is in the tank will not have any significant effects on the total volume of the tank if I integrate.

Doing a mass balance on the tank I get that 

1. $In-out+Generation = Accumulation$ where $Generation; In = 0$
2. $-\rho Q\_{out}=\frac{\rho dV}{dT}$ as a consequence of the mass balance. And since density is constant $-Q\_{out}=\frac{dV}{dT}$
3. To get $Q\_{out}$ use the fact that $u\_2a = Q\_{out}$
4. Using Bernoulli's Equation to get an expression for $u\_2$. Between 1 and 2 I get $\frac{u\_1^2}2+gz\_1+\frac{P\_1}{\rho}=\frac{u\_2^2}2+gz\_2+\frac{P\_2}{\rho}$
5. Using the relation that $P\_1=P\_2=P\_{atm}$ (4) can be simplified to $\frac{u\_1^2}2+gz\_1+=\frac{u\_2^2}2+gz\_2$ and saying that $u\_1 = \frac{dz}{dt}$ I now have $\frac{\frac{dz}{dt}^2}2+gz\_1+=\frac{u\_2^2}2+gz\_2$
6. Solving (5) for $u\_2$ I get that $u\_2 = \frac{dz}{dt} + \sqrt{2g(z\_1-z\_2)}$

My issue
--------

This is where I start to run into issues relating what I know. I know that $\frac{dz}{dt} = constant$ and I know that I need to solve for $n$ in the $f(z)$ function. I am guess that do solve equation (2) for the volume of the tank which is $a\_t\frac{dz}{dt}$. I assume since $\frac{dz}{dt}$ is present on both sides it will cancel out. Why does the rate of the flow even matter though? Why is it not valid just to say that the velocity of the water in the tank will be irrelevant in comparison to the velocity coming out of the spigot? Typically that is a valid assumption, or am I in correct in that? 

And one small struggle is getting the area of the tank by just knowing $f(z)$. It has been a while since I've done calculus. The first thought in my mind is a solid of revolution. I think that $f(z)$ is a function that relates z and radius so $r = f(z) = R(\frac{z}{H})^n$ and if so, would I be doing $V = \int\_a^b \pi r^2 dz$ which is $ V = \int\_a^b \pi R(\frac{z}{H})^n dz$? This integral seems very difficult to calculate though and leads me to believe that I have done something wrong. Any push in the right direction would be greatly appreciated! 

[![enter image description here](https://i.stack.imgur.com/ZcJI0.png)](https://i.stack.imgur.com/ZcJI0.png)