Apply contact forces between a pair of connected bodies

**Library:**Simscape / Multibody / Forces and Torques

The Spatial Contact Force block models the contact between a pair of bodies using the penalty method. This method allows the bodies to penetrate a small amount to compute the contact forces. The block applies normal and frictional contact forces between the connected base and follower bodies.

The normal contact force is computed using the force equation of the classical
spring-damper system. During contact, the normal contact force is proportional to its
corresponding penetration depth and velocity. The **Transition Region
Width** specifies the transitional region to the force equations. While the
penetration depth moves through the transition region, the block smoothly ramps up the force.
At the end of the transition region, the full stiffness and damping are applied. On the
rebound, both stiffness and damping forces are smoothly decreased back to zero. This smooth
transition eliminates discontinuities from the force equations and eliminates zero-crossing
events. The larger the **Transition Region Width**, the smoother the
transition trend of the contact force. In contrast, as the **Transition Region
Width** is reduced toward zero, the contact force tends to have a sharper
transition that behaves like a discontinuous problem.

To better detect contacts when the value of **Transition Region Width**
is small, the Spatial Contact Force block supports optional
zero-crossing detection. The zero-crossing events only occur when the separation distance
changes from positive or zero to negative and vice versa.

**Note**

The zero-crossing detection of the Spatial Contact Force
block is different with the original zero-crossing detection of Simulink^{®} blocks, such as From File and Integrator, because the force equation of the Spatial Contact
Force is continuous. For more information of the zero-crossing detection
of Simulink blocks, see Zero-Crossing Detection.

Each body has a contact frame with its origin located at the contact point and its
*z*-axis aligned with the contact normal direction. When the surface is
smooth near the contact point, the contact normal is the outward surface normal at the contact
point. When the surface is not smooth, the contact normal is computed using other means, but
it always points outward from the body near the contact point. During continuous contact, the
contact frame moves around the body as the contact point moves.

The diagram shows the contact frame for the base body. Contact forces are applied to the two solid bodies at the origin of the contact frame in conformance with Newton's Third Law:

The normal force,

`f`

, which is aligned with the_{n}*z*-axis of the contact frame. This force pushes the solid bodies apart in order to reduce penetration.The frictional force,

`f`

, which lies in the contact plane. This force opposes the relative tangential velocities between the two bodies near the area of penetration._{f}

The Spatial Contact Force block supports a variety of geometries and bodies. For example, it supports all the solid blocks in the Body Elements library and the Infinite Plane and Point blocks in the Curves and Surfaces library.

**Note**

For File Solid and Revolved Solid blocks, their physical properties, such as mass and inertia, are based on the true geometry, but contact modeling is based on the convex hull geometry. For an example, see the following figure.

**Contacts Between Solids**

Convex hulls are commonly used to represent the geometric boundary when the true geometry
presents algorithmic complexity. A convex hull is the smallest convex polyhedron that contains
all the vertexes of a true geometry. For a convex hull, the exterior angle
(**α**) between a pair of adjacent faces must be greater than or
equal to 180 degrees.

**Convex Hull**

Brick Solid | Cylindrical Solid | Extruded Solid | File Solid | Spherical Solid