Similarity analysis of modified shallow water equations and evolution of weak waves