When modeling complex systems, we usually encounter the following difficulties: partiality, large amounts of data and uncertainty of conclusions. The most common approach used for modeling is the physical approach, sometimes reinforced by statistical procedures. If we assume emergences in the complex system, a physical approach is not appropriate at all. Instead, we build here the approach of structural invariants. In this paper, we show that another plane can be built above the plane of physical description, which is responsible for violation of structural invariants. Main attention is concentrated (in this article) on the invariant matroid and bases of matroid (M, BM) in combination with Ramsey graph theory. In addition, the article introduces a calculus that describes the emergent phenomena using two quantities - the power of the emergent phenomenon and the complexity of the structure of the considered complex system. We show the application of the method for modeling phase transition in chemistry.