  We address the problem of constructing accurate mathematical models of the
dynamics of molecular systems projected on a collective variable. To this aim
we introduce an algorithm optimizing the parameters of a standard or
generalized Langevin equation until the latter reproduces in a faithful way a
set of molecular dynamics trajectories. In particular, using solvated proline
dipeptide as a test case, we report evidence that ~100 short trajectories
initiated at the top of a high barrier encode all the information needed to
reconstruct free energy, friction, and mass profiles, including non-Markovian
effects. The approach allows accessing the thermodynamics and kinetics of
activated processes in a conceptually direct way, it employs only standard
unbiased molecular dynamics trajectories, and is competitive in computational
cost with respect to existing enhanced sampling methods. Furthermore, the
systematic construction of Langevin models for different choices of collective
variables starting from the same initial data could help in reaction coordinate
optimization.
