Digital model of a Distribution Management System for the optimal operation of active distribution systems