Solar-wind disturbances and the solar wind-magnetosphere energy coupling function