Scalar-field cosmological and collapse models with general self-interaction potentials