The purpose of this study is to develop a motion generation technique based on a double inverted pendulum model (DIPM) that learns and reproduces humanoid robot (or virtual human) motions while keeping its balance in a pattern similar to a human. DIPM consists of a cart and two inverted pendulums, connected in a serial. Although the structure resembles human upper- and lower-body, the balancing motion in DIPM is different from the motion that human does. To do this, we use the motion capture data to obtain the reference motion to keep the balance in the existence of external force. By an optimization technique minimizing the difference between the motion of DIPM and the reference motion, control parameters of the proposed method were learned in advance. The learned control parameters are re-used for the control signal of DIPM as input of linear quadratic regulator that generates a similar motion pattern as the reference. In order to verify this, we use virtual human experiments were conducted to generate the motion that naturally balanced.