# Details on MP Systems

In a wide sense substances are different kinds of matter. At each step the substance quantities vary by means of some *reactions*, or more generally *transformations* (a transformation can correspond
to a long and complex chain of many reactions). Moreover, some substance quantities can be introduced from outside and/or can be expelled outside. For internal reactions, which do not introduce or expel matter, the matter they consume is equal to the matter they produce (*conservation principle*).

At any step, the fluxes of matter (consumed/produced) by all the rules produce the change of the state. The matter of a substance which a rule moves, at any step, is an integer multiple (positive if produced and negative if consumed) of some quantities, called moles, specific of each substance (*molarity principle*).

Fluxes depend on the state of the system. If we are able to determine the amount of reactants that each reaction takes in that step, according to the stoichiometry of the reactions, which we assume to know, we can perfectly establish the amount of substances consumed and produced between two steps, therefore whole the dynamics
can be discovered. The MP systems Log-gain theory provides a method to deduce the reaction fluxes of an MP system by means of suitable algebraic manipulations of state time series.

The change of each substance, at any step is the sum of contributes of all the rules which consume or produce that substance (*additivity principle*). This framework results to be general enough to cover a great variety of dynamical systems, going from chemical or biochemical
systems, to cellular dynamics, signaling systems seen as protein activations networks, but also population dynamics, and even economical systems seen as goods transformation systems.

A few significant processes already modeled by MP systems may be found at MP models section: they include the Belousov-Zhabotinsky reaction (in the Brusselator formulation), the Lotka-Volterra dynamics, the
circadian rhythms and the mitotic cycles in early amphibian embryos, and NPQ (Non-photochemical Quenching). In all these cases some quantities (of different types) change according to rules consuming/producing and inserting/expelling. The interesting fact about these phenomena is their common discrete mathematical
representation: multisets of objects and rewriting rules over them.

MP systems are essentially multiset grammars where rules are regulated by functions. This means that, if the state of a system is the multiset of objects inside it, for each reaction, a state dependent function provides the value of the *reaction unit* which has to be moved by the reaction in that state. For example, if a unit *u* is
assigned to a reaction *aab -> c* in a given state, then *2u* objects of type *a* and *u* objects of type *b* are consumed and *u* objects of type *c* are produced by the reaction in the passage to the next state.

In other words, an MP system can be identified with a *multiset grammar regulated by maps*. For this reason, we adopt two different ways for representing MP systems: MP graphs (where we can distinguish a reaction level from a regulation level), and set of rewriting rules,
where each rule is equipped with an (algebraic) formula expressing the regulation map of the rule. Regulation function, also called *flux maps*, are usually polynomials with variables denoting the quantities
of different types of objects, expressed with respect to some conventional population unit, called *conventional mole*.

The principles of functioning of MP systems are related to some generalization of chemical laws of Avogadro (*molarity principle*: any reaction involves integer multiples of the same molar amount of any kind of its reactants or products), Dalton (*additivity principle*: substance variations are the sums of substance variations due to all reactions), and Lavoisier (*conservation principle*: in any reaction the mass consumed equates the mass produced) which is generalized by the mass conservativeness.
A formal definition of MP systems and more technical details on the whole theory may be found at the __Publication__ section.