Microgrids are, as their name implies, real-time networks operating between producers, distributors and consumers. Aim of this work is to model and simulate operation of microgrids, including micro power plants, photovoltaic panels, wind farms, diesel power and storage energy, and finally we will apply the model in real time simulation thanks to MEGASIM of the RT-LAB platform Application of this work will be in southern Algeria area, where climate is hot, sunny and arid, and daytime temperatures are very high. It means that both of wind and photovoltaic energies are widely suitable in this location. Results obtained by this tool will allow us to have a very accurate vision of Micro grid operation, in term of power flow or fault responses.