  In this paper we introduce a procedure for identifying optimal methods in
parametric families of numerical schemes for initial value problems in partial
differential equations. The procedure maximizes accuracy by adaptively
computing optimal parameters that minimize a defect-based estimate of the local
error at each time-step. Viable refinements are proposed to reduce the
computational overheads involved in the solution of the optimization problem,
and to maintain conservation properties of the original methods. We apply the
new strategy to recently introduced families of conservative schemes for the
Korteweg-de Vries equation and for a nonlinear heat equation. Numerical tests
demonstrate the improved efficiency of the new technique in comparison with
existing methods.
