Bernoulli's equation :
Do you mean : P+\tfrac{1}{2}\rho v^2+\rho g h=constant

[quote]
question 1: can this be simulated with an ideal gas between the pistons?
[/quote]
Could you describe your model in more detail? I can not catch your ideas.

[quote]
question 2: is Bernoulli's equation  true for an ideal gas?
[/quote]

The Bernoulli's principle is valid for incompressible flows (e.g. most liquid flows) and also for compressible flows (e.g. gases) moving at low Mach numbers