siconos.kernel.NonSmoothLaw (Python class)

class siconos.kernel.NonSmoothLaw(*args)[source]

Bases: object

Non Smooth Laws (NSL) Base Class.

This class is the base class for all nonsmooth laws in Siconos. A nonsmooth law characterize the (nonsmooth) relationship between 2 variables, usually designated by \(y\) and \(\lambda\). \(y\) is most of time seen as the “input” from DynamicalSystems and is given by a Relation linked to this nonsmoothlaw. \(\lambda\) is then the “output” and through the same Relation is fed back to one or more DynamicalSystem.

classical examples of nonsmooth law include:

  • RelayNSL: \(-y \in \mathcal{N}_{[-1,1]}(\lambda)\quad \Longleftrightarrow\quad -\lambda \in \mbox{sgn} (y)\)
  • NormalConeNSL: given a polytope $K$, \(-\lambda \in \partial \sigma_{-K}(y)\quad\Longleftrightarrow\quad y\in\mathcal{N}_{-K}(-\lambda)\)
  • ComplementarityConditionNSL: \(0\leq y \perp \lambda \geq 0\)
  • NewtonImpactNSL and NewtonImpactFrictionNSL for impact, without or with friction
  • MultipleImpactNSL for a multiple impact law
  • MixedComplementarityConditionNSL

The computation of both \(y\) and \(\lambda\) is carried on by a solver in Numerics through a OneStepNSProblem object.

Generated class (swig), based on C++ header Program listing for file kernel/src/modelingTools/NonSmoothLaw.hpp.


NonSmoothLaw(int size)

basic constructor

Parameters:size – the nonsmooth law size
display() → void[source]

display() =0 -> None

display the data of the NonSmoothLaw on the standard output

isVerified() → bool[source]

check if the NS law is verified

Returns:a boolean value which determines if the NS Law is verified
size() → int[source]

to get the size

Returns:the size of the NS law