Optimal control of gradient flows via the Weighted Energy-Dissipation method | Synapse