fit_extrapolate_solve: introduce generic versions of these utility functions to handle arbitrary numbers of knowns and unknowns and a more unified output