Analysis of the magnetohydrodynamic flow in a porous medium