This work studies the balancing control problem for flexible inverted-pendulum systems and investigates the relationship between system parameters and robustness to disturbances. To this end, a new energy-shaping controller with adaptive disturbance-compensation for a class of underactuated mechanical systems is presented. Additionally, a method for the identification of key system parameters that affect the robustness of the closed-loop system is outlined. The proposed approach is applied to the flexible pendulum-on-cart system and a simulation study is conducted to demonstrate its effectiveness. Finally, the control problem for a classical pendulum-on-cart system with elastic joint is discussed to highlight the similarities with its flexi...