A method of constructing a database-free optimal dynamical system and a global optimal dynamical system