Vibrating water container problem I am struggling with this seemingly difficult question:

"A water-filled container is sitting still on a platform as shown.
Suddenly, the platform starts shaking vertically due to the action of a nearby machine.
An accelerometer placed on the contained wall measures the vertical acceleration ($m/s/s$) as:
$$a=488*cos(348t)$$
What is the smallest h (the distance from water surface to the top of the container wall) when the water will spill over the edge? Ignore the friction between water and the container walls. Give your answer in millimeters."


The question seems to be phrased in a misleading way?
As I understand it, the water will spill over the edge during the brief cyclical instant when the downward acceleration of the container is greater than the downward acceleration of gravity acting on the water itself.
When:
$$9.81=488*cos(348t)$$
Given the question's phrasing, it seems that the answer is $h=0$ i.e. when the difference in height between the top of the container walls and the water surface is zero, then the water will obviously spill, but this is not the right answer.
EDIT: In response to DJohnM. Is this what you mean?

So, to my understanding, the question can then be rephrased as such:
When the water is spilling over the edge (as the water has been forced up partially or entirely above the container walls and is in freefall), what is the maximum height difference attainable between the top of the container and the top surface of the water?
 A: I believe the premise of your solution is incorrect.
The tank is following simple harmonic motion, and its acceleration, velocity and position as a function of time can calculated.
The water is not similarly driven.  As long as the tank is accelerating upward, the water follows the tank.  As long as the tank is accelerating downward at less than $g$, the water follows the tank, But, when the tank is accelerating downward at more than $g$, the water gets left behind as it is only in free fall. The tank lacks a lid!
The question is: how far behind does the water get?  When it falls behind the top edge of the tank, it slops over sideways... 
A: Acceleration $a = A\cos{\omega}{t}$ which gives us
velocity $v$ = $\frac{A}{\omega}\sin{\omega}{t}$ and
position $x$ = $\frac{A}{\omega^2}(1-\cos{\omega}{t})$
where $x$ is position above an initial position of $0$ as a function of $t$.
The water is pushed up as long the the acceleration is positive which is between ${\omega}{t} = 0$ and ${\omega}{t} = \frac{\pi}{2}$.
At that point the water becomes a free falling body with an initial velocity equal to $v_0 = \frac{A}{\omega}$ and initial position $y_0 = \frac{A}{\omega^2}$.
Therefore, the position $y$ of the water is given by
$y=-\frac{1}{2}gt^2 + \frac{A}{\omega}t + \frac{A}{\omega^2}$ for $t \ge \frac{\pi}{2\omega}$
The water reaches a maximum height when its velocity is $0$ or when
$-gt + \frac{A}{\omega} = 0 \rightarrow t = \frac{A}{g\omega}$
For the numbers in this problem that is about $0.14$ seconds or about $8$ periods of the movement of the container. Plugging this value of $t$ into $y$
above gives a maximum height of about $104$ millimeters.
The period of the container is $\frac{2\pi}{\omega} \approx 0.018$ seconds. This means that the container is vibrating up and down while the water is still rising. The height of the container varies between $0$ and $\frac{2A}{\omega^2}$ or about $8$ millimeters. Therefore, when the water reaches a maximum height the distance between the top of the container and the top of the water will be between $96$ and $104$ millimeters. If I plug the time $t = \frac{A}{g\omega}$ into the expressions for position and velocity of the container, I get that the container is at about $4$ millimeters and its velocity is positive. Therefore, the distance is about $100$ millimeters and closing when the water reaches its maximum height.
