# Interactions between dynamical systems¶

An Interaction is an “object” that defines the way some Dynamical Systems are linked, how they behave together. For example if you consider a set of rigid bodies, Interactions will define what will happen when contact between bodies occurs.

First of all, we introduce the set of all possible interactions, indeed all interactions declared by user,

NSDS is the non-smooth dynamical system and \(I_{\alpha}\) a single interaction.

An Interaction is applied to a set of Dynamical Systems, then the set \(\mathcal{DS}^{\alpha}=\{ d \ / \ ds_{d} \in I_{\alpha} \}\) is the set of all dynamical systems involved in \(I_{\alpha}\). Finally, we denote \(\mathcal{DS}_{\alpha,\beta}\) the set of dynamical systems that are involved in interactions \(\alpha\) and \(\beta\);

Considering an interaction \(I_{\alpha}\), upper case letters will be used to represent the concatenation of variables from the dynamical systems of \(\mathcal{DS}^{\alpha}\). Note that Index \(\alpha\) for variables or operators specific to \(I_{\alpha}\), will be omitted as soon as possible to lighten notations.

Then one get the following vectors of global coordinates, say X (or Q in the Lagrangian case):

\(x_i \ (or \ q_i)\) being the vectors of global coordinates of the Dynamical Systems involved in the Interaction.

Remember also that each DynamicalSystem as a variable called \(r\) (or \(p\) in the Lagrangian case), an input vector related to the non-smooth behavior or law, with:

Thus we define \(R\) for the Interaction as:

*Warning: it is forbidden to mix first and second order Dynamical Systems in a single Interaction.*

An Interaction is characterized by some “local” variables, \(y\) (also called output, \(R\) being the input) and \(\lambda\). Both of them are “vector of vectors”:

\(y[i]\) is a vector that represents the derivative number \(i\) of variable \(y\) according to time. Each \(y[i]\) or \(\lambda[i]\) is a vector of size *interactionSize*.

Not that the number of saved derivatives depends on the problem type.

Then an Interaction proposes: * a “Non Smooth Law” that links y and \(\lambda\) * a “Relation” between the local variables \((y,\lambda)\) and the global ones (those of the Dynamical Systems), \((X,R)\) (the constraints).

As an example consider again the case of a ball bouncing on the ground: * the Interaction will include the two dynamical systems (ball and ground) * the relation will consist in defining y as the distance between the ground and the ball and \(\lambda\) as something like the reaction of the ground at contact (Lagrangian multipliers indeed). * the Non-Smooth law will “say”: if there is contact, then the reaction is positive (y=0 then \(\lambda>0\)) and if not, no reaction occurs(if \(\lambda=0, y>0\)); and also that the velocity after contact is equal to the opposite of the one before contact multiplied by some “damping” coefficient (this corresponds to a Newton Impact Law, see below).

Definition and description of the different types of relations and non-smooth laws are presented in the sections below.