Theoretical calculation for the equations of state and phase transitions of sodium and potassium hydrides