During polymerization in a nongrowing cell population of Ralstonia eutropha, alternating between two different carbon sources (fructose and fructose/valeric acid) could lead to the production of block copolymers consisting of blocks of homo-poly-3-hydroxybutyrate (PHB) and polyhydroxybutyrate-co-valerate (PHBV) copolymer. The problem of finding the optimal number of carbon source switches and corresponding switching times that maximize the final concentration of diblock copolymers (PHB-PHBV and PHBV-PHB) was addressed. It was mathematically formulated in the mixed-integer nonlinear programming (MINLP) framework, which allows the decomposition of the original problem into the primal and master problems. The primal problem corresponds to the original problem for a fixed number of carbon source switches, whereas the master problem consists of finding the number of carbon source switches that maximizes the optimum solutions of all possible primal problems. The global optimum was obtained for 39 carbon source switches. It corresponds to a mass fraction of 50.6% of final diblock copolymer concentration over the final total polymer concentration.