Short of cut and try cut and try, lather rinse repeat, It looks like there is a way to clock the launch inside the barrel and find the location where it peaks.
I'm not sure how long it will be up, but some engineers worked out a solution that can use a laptop, wire, a magnet and some free software. The method and results are here;
http://inteltrailblazerschallenge.wikispaces.com/Barrel+length+trim+method
They found the best length for a 60 PSI launcher with a 2 inch valve, 700 cubic inch surge tank, and 4 inch barrel for launching 4 inch foam balls. They got over 450 FPS with a foam ball.