An MHD simulation of the interaction of the solar wind with the outflowing plasma from a comet