The structure of aperiodic crystals which includes incommensurate, quasi- and composite crystals is usually described in spaces of higher dimension, the so called superspace. The main advantage of the superspace formalism is that an aperiodic structure in three dimensions recovers its full periodicity in higher dimensions. The symmetry properties of aperiodic crystals are obviously more convenient to describe in superspace too. The origin of the incommensurate nature of structures can often be found in competing interatomic interactions. From molecular dynamics simulation of a simple three dimensional model with close-packed layers and a single degree of freedom for each particle, it is possible to find the existence conditions of commensurate and incommensurate phases. Incommensurate phases can already be predicted on the basis of nearest and next nearest neighbour particle interactions only. We illustrate this principle of interactions with two examples of structures, Na2CO3 and K3In(PO4)(2). These examples shows clearly the importance of non-oxygen interactions i.e. next nearest interactions for the formation of incommensurate structures.