We analyze numerically a model of eruption of a thin flux rope with the endpoints frozen in the photosphere. The flux rope is assumed to maintain a shape of partial current-carrying torus staying initially in equilibrium in the external dipolar magnetic field. There is an unstable equilibrium point, which can be reached by slow evolution of the system, and then a catastrophic loss of equilibrium and flux-rope eruption follow. Parameters of eruption, such as acceleration, velocity, electric field generated at the null point, depend in particular on the initial length of the flux rope or in other words on the endpoints separation. Analysis of the sample of 30 eruptive events observed on the Sun in the period from 2012 to 2016 showed that the eruptions of shorter filaments are more often associated with flaring phenomena and not followed by coronal mass ejections (CMEs). Eruptions of most lengthy filaments are followed as a rule by CMEs but are much rarely associated with flares.