Optimal Control Of Production For A Supply Chain System With Time-Varying Demand And Flexible Production Capacities