Math model for analysis of domain patterns stability