  We report, in detail, an optimization approach for fitting a
three-dimensional (3D) magnetic cloud (MC) model to {\em in situ} spacecraft
measurements. The model, dubbed the Freidberg solution, encompasses 3D spatial
variations in a generally cylindrical geometry, as derived from a linear
force-free formulation. The approach involves a least-squares minimization
implementation with uncertainty estimates from magnetic field measurements. We
present one case study of the MC event on 22 May 2007 to illustrate the method
and demonstrate the satisfying result of the minimum reduced $\chi^2\lesssim
1$, obtained from the STEREO B (STB) spacecraft measurements. In addition,
since the ACE spacecraft at Earth crossed the STB solution domain with an
appropriate separation distance, the result from the optimally fitted Freidberg
solution along the ACE spacecraft path is compared with the actual measurements
of magnetic field components. A correlation coefficient of 0.89 is obtained
between the two sets of data.
