File kernel/src/modelingTools/RelayNSL.hpp#

Go to the source code of this file

formalization of the Relay nonsmooth law

class RelayNSL : public NonSmoothLaw
#include <RelayNSL.hpp>

Relay NonSmoothLaw.

This class formalizes the Relay nonsmooth law i.e.

\[ -y \in \mathcal{N}_{[lb,ub]}(\lambda), \]

where \( lb \) is the lower bound and \( ub \) is the upper bound of the Relay law.

In this default case, the lower bound is set to \( lb=-1 \) and the upper bound ub is set to \( ub=1 \). We get the well-known form of the RelayNSL as the multivalued sign function, i.e.

\[ y \in -\mathcal{N}_{[-1,1]}(\lambda) \Longleftrightarrow \lambda \in -\mbox{sgn} (y) \]

where the multi-valued sign function is defined as

\[\begin{split} \mbox{sgn} (y) = \left\{ \begin{array}{lcl} 1 && y >0 \\ [-1,1] && y =0 \\ -1 && y <0 \end{array}\right. \end{split}\]

Todo:

Build the Sgn NonSmoothLaw as the default instance of Relay

Public Functions

RelayNSL(unsigned int size, double lb = -1.0, double ub = 1.0)

constructor with the value of the RelayNSL attributes

Parameters:
  • size – size of the NonSmoothLaw

  • lb – lower endpoint of the interval, default value is -1.0

  • ub – upper endpoint of the interval, default value is 1.0

~RelayNSL()#
virtual bool isVerified() const override

check the ns law to see if it is verified

Returns:

true if the NS Law is verified, false otherwise

inline double lb() const

to get lb

Returns:

the value of lb

inline void setLb(double lb)

to set the lower bound

Parameters:

lb – the new lower bound

inline double ub() const

to get ub

Returns:

the value of ub

inline void setUb(double ub)

to set ub

Parameters:

ub – the new upper bound

virtual void display() const override

print the data to the screen

ACCEPT_STD_VISITORS()#

Private Functions

ACCEPT_SERIALIZATION(RelayNSL)#
RelayNSL()#

default constructor

Private Members

double _lb#

represent the lower bound of the Relay

double _ub#

represent the upper bound of the Relay