Virtual Mechanical Systems: An Energy-Based Approach