Numerical Simulations and Diagnostics in Astrophysics: A few Magnetohydrodynamics Examples