Multistage optimization of a petroleum production system with material balance model