# interface

Specify physical connections between components of `mechss` model

## Syntax

``sysCon = interface(sys,c1,nodes1,c2,nodes2)``
``sysCon = interface(sys,c,nodes)``
``sysCon = interface(___,KI,CI)``

## Description

example

````sysCon = interface(sys,c1,nodes1,c2,nodes2)` specifies physical couplings between components `c1` and `c2` in the second-order sparse model `sys`. `nodes1` and `nodes2` contain the indices of shared nodes relative to the nodes of `c1` and `c2`. The physical interface is assumed rigid and satisfies the standard consistency and equilibrium conditions. `sysCon` is the resultant model with the specified physical connections. Use `showStateInfo` to get the list of all available components of `sys`.```

example

````sysCon = interface(sys,c,nodes)` specifies that component `c` interfaces with the ground. Connecting the node specified in `c` to the ground amounts to the zero displacement constraint (`q = 0`).```
````sysCon = interface(___,KI,CI)` further specifies the stiffness `KI` and damping `CI` for nonrigid interfaces.```

## Examples

collapse all

For this example, consider a structural model that consists of two square plates connected with pillars at each vertex as depicted in the figure below. The lower plate is attached rigidly to the ground while the pillars are attached rigidly to each vertex of the square plate.

Load the finite element model matrices contained in `platePillarModel.mat` and create the sparse second-order model representing the above system.

```load('platePillarModel.mat') sys = ... mechss(M1,[],K1,B1,F1,'Name','Plate1') + ... mechss(M2,[],K2,B2,F2,'Name','Plate2') + ... mechss(Mp,[],Kp,Bp,Fp,'Name','Pillar3') + ... mechss(Mp,[],Kp,Bp,Fp,'Name','Pillar4') + ... mechss(Mp,[],Kp,Bp,Fp,'Name','Pillar5') + ... mechss(Mp,[],Kp,Bp,Fp,'Name','Pillar6');```

Use `showStateInfo` to examine the components of the `mechss` model object.

`showStateInfo(sys)`
```The state groups are: Type Name Size ---------------------------- Component Plate1 2646 Component Plate2 2646 Component Pillar3 132 Component Pillar4 132 Component Pillar5 132 Component Pillar6 132 ```

Now, load the interfaced node index data from `nodeData.mat` and use `interface` to create the physical connections between the two plates and the four pillars. `nodes` is a `6x7` cell array where the first two rows contain node index data for the first and second plates while the remaining four rows contain index data for the four pillars.

```load('nodeData.mat','nodes') for i=3:6 sys = interface(sys,"Plate1",nodes{1,i},"Pillar"+i,nodes{i,1}); sys = interface(sys,"Plate2",nodes{2,i},"Pillar"+i,nodes{i,2}); end```

Specify connection between the bottom plate and the ground.

`sysCon = interface(sys,"Plate2",nodes{2,7});`

Use `showStateInfo` to confirm the physical interfaces.

`showStateInfo(sysCon)`
```The state groups are: Type Name Size ----------------------------------- Component Plate1 2646 Component Plate2 2646 Component Pillar3 132 Component Pillar4 132 Component Pillar5 132 Component Pillar6 132 Interface Plate1-Pillar3 12 Interface Plate2-Pillar3 12 Interface Plate1-Pillar4 12 Interface Plate2-Pillar4 12 Interface Plate1-Pillar5 12 Interface Plate2-Pillar5 12 Interface Plate1-Pillar6 12 Interface Plate2-Pillar6 12 Interface Plate2-Ground 6 ```

You can use `spy` to visualize the sparse matrices in the final model.

`spy(sysCon)`

The data set for this example was provided by Victor Dolk from ASML.

## Input Arguments

collapse all

Sparse second-order model, specified as a `mechss` model object. For more information, see `mechss`.

Components of `sys` to connect, specified as a string or an array of character vectors. Use `showStateInfo` to get the list of all available components of `sys`.

Index information of components to connect, specified as an `Nc`-by-`Ni` cell array, where `Nc` is the number of components and `Ni` is the number of physical interfaces.

Stiffness matrix, specified as an `Nq`-by-`Nq` sparse matrix, where `Nq` is the number of nodes in `sys`.

Damping matrix, specified as an `Nq`-by-`Nq` sparse matrix, where `Nq` is the number of nodes in `sys`.

## Output Arguments

collapse all

Output system with physical interfaces, returned as a `mechss` model object. Use `showStateInfo` to examine the list of physical interfaces in the system.

## Algorithms

Dual Assembly

`interface` uses the concept of dual assembly to physically connect the nodes of the model components. For `n` substructures in the physical domain, the sparse matrices in block diagonal form are:

where, f is the force vector dependent on time and g is the vector of internal forces at the interface.

In the concept of dual assembly, the global set of degrees of freedom (DoFs) q is retained and the physical coupling is expressed as consistency and equilibrium constraints at the interface. For rigid connections, these constraints are of the form:

where `g` is the vector of internal forces at the interface, and the matrix `B` is permutable to [I -I]. For a pair of matching nodes with indices i1,i2 where i1 selects a node in the first component while i2 selects the matching node in the second component, $Bq=0$ enforces consistency of displacements

while $g=-{B}^{T}\lambda$ enforces equilibrium of the internal forces g at the interface:

Combining these constrains with the uncoupled equations leads to the following dual assembly model for the coupled system:

`$\left[\begin{array}{cc}M& 0\\ 0& 0\end{array}\right]\left[\begin{array}{c}\stackrel{¨}{q}\\ \lambda \end{array}\right]+\left[\begin{array}{cc}C& 0\\ 0& 0\end{array}\right]\left[\begin{array}{c}\stackrel{˙}{q}\\ \lambda \end{array}\right]+\left[\begin{array}{cc}K& {B}^{T}\\ B& 0\end{array}\right]\left[\begin{array}{c}q\\ \lambda \end{array}\right]=\left[\begin{array}{c}f\\ 0\end{array}\right]$`

Nonrigid interface

Non-rigid interfaces are expressed in the following form:

This models a spring-damper connection between two matching nodes at the interface and corresponds to the internal force . In DAE form, it can be rewritten as:

Note that eliminating $\delta ,\stackrel{˙}{\delta }$ amounts to replacing the aggregate C,K matrices by $C+{B}^{T}{C}_{c}B,K+{B}^{T}{K}_{c}B$ using

which shows how non-rigid connections modify the overall damping and stiffness.