SMART BED AND CONTACT IMPACT OF FLEXIBLE BODIES USING ENERGY COMPENSATION METHOD