Dynamic optimization of metabolic networks coupled with gene expression