Optimizing selectivity and activity in heterogeneous and homogeneous catalysis for chemical production