A new approach to find optimal settings of model parameters as well as optimal models of dynamical systems is presented. The Adaptive Cross Validation (ACV) method is based on a number of well known ideas which are combined to a general optimization tool. It could be used for both design (off-line) and control (on-line) of widespread applications, which can be both continuous and discrete. The method is specially suited for modular optimization problems. A new mathematical model formalism for describing systems is also introduced. A controlled system application, a circuit-switched network, is used as an example to clarify the method.