Intuition contradicting answer for calculating pressure I have a cylindrical container say of some base area $A$. The atmospheric pressure is $P_0$. The cylinder is moved at an acceleration $a$ horizontally right. I need to find which base would have to face more internal pressure. The cylinder is filled with some ideal gas.
My intuition, even though I doubt it, says that in the frame of the cylinder the fictitious forces act towards left, so it should be the left face.
But on some calculations using the laws of motion, I get equations as
$$(P_0-P_1)A=ma$$
$$(P_2-P_0)A=ma$$
($m$ is the mass of each base of cylinder) On solving I have
$$P_1=P_0-{ma\over A},P_2=P_0+{ma\over A}$$
which means the right face faces more internal pressure.
What is going wrong? P.S. just give me a hint.

 A: Firstly, as Peter mentioned, your equations implicitly assume that the fluid inside is causing the acceleration. Otherwise you need to specify that the system is being pulled. I'll deal with both situations here.

If the water causes the acceleration
Unfortunately, we can't directly deal with the individual cylinder caps because the cylinder tube exerts a force on them. Whenever you have a body, if you want to consider a part of it as a system you need to consider internal forces as well.
So, first lets just look at the cylinder (without the fluid). The $p_0A$ cancels out, and what is left is $p_2A-p_1A$ to the right. So $ma=A(p_2-p_1)$.
From this we can easily tell that $p_2>p_1$ as acceleration is towards the right.
In retrospect, this is obvious, as the fluid is making the cylinder accelerate to the right -- it needs to exert more pressure on the right wall outwards for this effect to take place.
Now, to calculate force on a single cap, we have $(p_2-p_0)A-T_1=m_{cap}a$. Here, $T_1$ is the internal stress between the right cap and the tube. We can write a similar expression for the left cap with a different stress, and write a third expression for the tube itself ($T_1-T_2=m_{tube}a$). Plugging in the values, you will be able to solve for $T_1$ and $T_2$.
If the cylinder is being pulled
In such a case, you will be pulling it with a force $F=(m_{cyl}+m_{fluid})a$ (as this is the only unbalanced horizontal force on the object.
In such a case, there still will be a pressure gradient in the fluid. Easiest way to see this is by considering forces on the shell: There is a balanced $p_0A$ on both sides, there's an $F=m_{cyl}a$ pulling it to the right, and a $(p_2-p_1)A$ to the right from the water pressure. We need $m_{cyl}a+(p_2-p_1)A=m_{shell}a$, and we get $(p_2-p_1)A<0$, so the left side exerts more pressure on the cylinder.
Where does this pressure gradient come from? The acceleration. It's the same thing that creates a gradient in water in the presence of gravity. If you move to the accelerating frame, the pseudo force is just like a gravitational force acting to the left, and it creates the required gradient (force/pressure are frame-invariant, so a gradient in the accelerated frame persists in the static frame).
A: See the cylinder as a whole object . The second law of motion gives that the  cylinder does not accelerate untill it have a net external force.
So, the external pressures on both sides of the cylinder is not equal.The external agent which accelerates the cylinder applies force ($ma$) on left face towards right so that pressure on left fave exeeds by a amount  $ma/A$ by right face pressure.

Now you can find P_1 and then presuure at any distance.
