Laboratory generation of solitary waves: An inversion technique to improve available methods