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
-
inline CommonSMC(unsigned int type, SP::ControlSensor sensor)¶
General constructor.
- Parameters
type – the type of the SMC Actuator
sensor – the ControlSensor feeding the Actuator
-
inline CommonSMC(unsigned int type, SP::ControlSensor sensor, SP::SimpleMatrix B, SP::SimpleMatrix D = std::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 void initialize(const NonSmoothDynamicalSystem &nsds, const Simulation &s)¶
Initialization.
- Parameters
nsds – current nonsmooth dynamical system
s – current simulation setup
-
void setCsurface(SP::SimpleMatrix Csurface)¶
Set Csurface.
- Parameters
Csurface – a SP::SimpleMatrix containing the new value for _Csurface
-
void setSaturationMatrix(SP::SimpleMatrix newSat)¶
Set _D to pointer newPtr.
- Parameters
newSat – a SP::SimpleMatrix containing the new value for _D
-
inline void setAlpha(double alpha)¶
Set _alpha.
- Parameters
alpha – the new value for _alpha
-
inline void setSolver(const int numericsSolverId)¶
Set the solver.
- Parameters
numericsSolverId – the solver for the relay
-
inline void setPrecision(double newPrecision)¶
Set the precision.
- Parameters
newPrecision – a double
-
inline 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
- Returns
a reference to the LinearOSNS problem
-
inline SiconosVector &ueq()¶
get \( u^{eq} \)
- Returns
a reference to _ueq
-
inline SiconosVector &us()¶
get \( u^{s} \)
- Returns
a reference to _us
-
inline void setTheta(double newTheta)¶
Set _theta, used in some discretization method for \( u^{eq} \).
- Parameters
newTheta – the new value for _thetaSMC
-
inline 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
-
inline 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
-
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
-
inline 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
-
inline virtual SP::NonSmoothDynamicalSystem getInternalNSDS() const¶
get the NSDS used in the SMC
- Returns
the NSDS used in the SMC
-
inline OneStepIntegrator &getInternalOSI() const¶
get the Integrator used in the SMC
- Returns
the Integrator used in the SMC
-
inline CommonSMC(unsigned int type, SP::ControlSensor sensor)¶