We determine the photospheric boundary conditions which maximize the m
agnetic energy released by a loss of ideal-MHD equilibrium in two-dime
nsional flux-rope models. In these models a loss of equilibrium causes
a transition of the flux rope to a lower magnetic energy state at a h
igher altitude. During the transition a vertical current sheet forms b
elow the flux rope, and reconnection in this current sheet releases ad
ditional energy. Here we compute how much energy is released by the lo
ss of equilibrium relative to the total energy release. When the flux-
rope radius is small compared to its height, it is possible to obtain
general solutions of the Grad-Shafranov equation for a wide range of b
oundary conditions. Variational principles can then be used to find th
e particular boundary condition which maximizes the magnetic energy re
leased for a given class of conditions. We apply this procedure to a c
lass of models known as cusp-type catastrophes, and we find that the m
aximum energy released by the loss of equilibrium is 20.8% of the tota
l energy release for any model in this class. If the additional restri
ction is imposed that the photospheric magnetic field forms a simple a
rcade in the absence of coronal currents, then the maximum energy rele
ase reduces to 8.6%.