<p>In this paper, we proposed a dynamic optimization problem involving a two-stage fractional system subjected to both a terminal state inequality constraint and continuous state inequality constraints in a microbial batch process. The objective function was the productivity of 1,3-propanediol at the terminal time, while the decision variables were the initial concentrations of biomass and glycerol, and the terminal time of the batch process. We first equivalently transformed the problem with free terminal time into one with fixed terminal time in a new time horizon by applying a proposed time-scaling transformation. We then converted the equivalent problem into an optimization problem with only box constraints by using an exact penalty function method. A novel third-order numerical scheme was presented for solving the two-stage fractional system. On this basis, we developed an improved particle swarm optimization algorithm to solve the resulting optimization problem. Finally, numerical results showed that a significant increase in the productivity of 1,3-propanediol at the terminal time was obtained compared with the previously reported results.</p>