We introduce a variational algorithm, which solves the classical inverse
Sturm-Liouville problem when two spectra are given. In contrast to other
approaches, it recovers the potential as well as the boundary conditions
without a priori knowledge of the mean of the potential. Numerical examples
show that the algorithm works quite reliable, even in the presence of noise. A
proof of the absence of strict local minimizers of the functional supports the
observation, that a good initial guess is not essential.Comment: 9 pages, 7 figure