Our research activity in computer simulations of the solar wind interaction with the magnetosphere is reviewed. First, results of global MHD simulation of the earth's magnetosphere are shown. They provided us a new insight into the field-aligned current system, the structure of the magnetospheric convention, and the substorm mechanism. Then, we applied the simulation code to real-time operation. The real-time simulation helps us to improve the simulation model by comparing the accumulating simulation data with observations. Finally, global hybrid code simulation of solar wind interaction with an unmagnetized planet was carried out to extend the global model to the ion cyclotron radius scale, and the results are shown.