We present a simple model for the response of a dissipationless spherical system to an instantaneous mass change at its center, describing the formation of flat cores in dark matter haloes and ultra-diffuse galaxies (UDGs) from feedback-driven outflow episodes in a specific mass range. This model generalizes an earlier simplified analysis of an isolated shell into a system with continuous density, velocity and potential profiles. The response is divided into an instantaneous change of potential at constant velocities due to a given mass loss or gain, followed by energy-conserving relaxation to a new Jeans equilibrium. The halo profile is modeled by a two-parameter function with a variable inner slope and an analytic potential profile , which enables to determine the associated kinetic energy at equilibrium. The model is tested against NIHAO cosmological zoom-in simulations, where it successfully predicts the evolution of the inner dark-matter profile between successive snapshots in about 75% of the cases, failing mainly in merger situations. This model provides a simple understanding of the formation of dark-matter halo cores and UDGs by supernova-driven outflows, and a useful analytic tool for studying such processes.