A generalized inverse is presented for the Korteweg-de Vries (KdV) equation, an initial condition and data from synthetic but realistic solitary internal waves. The synthetic data are statistically consistent with hypothesized levels of error in the KdV equation, initial condition and observing system. The observing system consists of point-wise measurements of the pycnocline displacement, either at fixed locations or from a ship drifting in the soliton current. These synthetic inversions are designed using the environmental conditions and disturbances observed by Pinkel [J. Phys. Oceanogr. 30 (2000) 2906]. The inverse solution is found by minimizing a quadratic cost functional, which yields a weighted least-squares best-fit to the KdV equation, the initial condition and the data. The weight for each squared residual is derived from its hypothesized covariance. The minimal value of the least-squares estimator (or cost function) is the test statistic for the error hypotheses and is shown here to be a reliable indicator of grossly incorrect hypotheses. In particular, it will be shown that even with just a single ship survey, the method does lead to decisive tests of hypotheses concerning the level of error in the model. Also, neglect of ship drift is found to be less deleterious to the inversion than is neglect of error in the KdV dynamics. The inverse is calculated by the iterated, direct representer algorithm [Ocean Model. 3 (2001) 137], which is readily extended to include parameter estimation. Significant skill is found for estimating the linear phase speed.