Class CommonSMC

Defined in Program listing for file control/src/Controller/CommonSMC.hpp

class CommonSMC : public Actuator

Subclassed by ExplicitLinearSMC, ExplicitTwisting, LinearSMC, LinearSMCOT2, Twisting

Public Functions

CommonSMC(unsigned int type, SP::ControlSensor sensor)

General constructor.

Parameters

CommonSMC(unsigned int type, SP::ControlSensor sensor, SP::SimpleMatrix B, SP::SimpleMatrix D = std11::shared_ptr<SimpleMatrix>())

Constructor for dynamics affine in control.

Parameters
  • type: the type of the SMC Actuator
  • sensor: the ControlSensor feeding the Actuator
  • B: the matrix multiplying the control input
  • D: the saturation matrix (optional)

virtual void actuate() = 0

Compute the new control law at each event.

virtual SP::NonSmoothDynamicalSystem getInternalNSDS() const

get the NSDS used in the SMC

Return
the NSDS used in the SMC

OneStepIntegrator &getInternalOSI() const

get the Integrator used in the SMC

Return
the Integrator used in the SMC

virtual void initialize(const NonSmoothDynamicalSystem &nsds, const Simulation &s)

Initialization.

Parameters
  • nsds: current nonsmooth dynamical system
  • s: current simulation setup

SP::SiconosVector lambda() const

get _lambda

Return
a pointer to _lambda

void noUeq(bool b)

Disable (or enable) the use of the state-continuous control \(u^{eq}\).

Parameters
  • b: disable the use of Ueq if true

const LinearOSNS &relay()

Get the OneStepNSProblem problem associated with the controller.

This is useful to gain access to the data given to the solver in Numerics

Return
a reference to the LinearOSNS problem

void setAlpha(double alpha)

Set _alpha.

Parameters
  • alpha: the new value for _alpha

void setComputeResidus(bool b)

Disable (or enable) the computation of the residus on the Newton loop.

This has an incidence only if the Relation is nonlinear

Parameters
  • b: disable the computation of the residus

void setCsurface(SP::SimpleMatrix Csurface)

Set Csurface.

Parameters
  • Csurface: a SP::SimpleMatrix containing the new value for _Csurface

void setDS(SP::FirstOrderNonLinearDS ds)

Set the DynamicalSystem used to compute the control law.

This is useful when we have a Nonlinear problem and we need to compute the control law with an approximate model, or when the dynamics are quite different.

Parameters
  • ds: the DynamicalSystem to be used in the Controller

void setPrecision(double newPrecision)

Set the precision.

Parameters
  • newPrecision: a double

void setSaturationMatrix(SP::SimpleMatrix newSat)

Set _D to pointer newPtr.

Parameters
  • newSat: a SP::SimpleMatrix containing the new value for _D

void setSolver(const int numericsSolverId)

Set the solver.

Parameters
  • numericsSolverId: the solver for the relay

void setTheta(double newTheta)

Set _theta, used in some discretization method for \(u^{eq}\).

Parameters
  • newTheta: the new value for _thetaSMC

virtual void setTimeDiscretisation(const TimeDiscretisation &td)

This is derived in child classes if they need to copy the TimeDiscretisation associated with this Sensor.

Parameters
  • td: the TimeDiscretisation for this Sensor

SiconosVector &ueq()

get \(u^{eq}\)

Return
a reference to _ueq

SiconosVector &us()

get \(u^{s}\)

Return
a reference to _us