21 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR =
double>
25 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
27 typedef typename std::shared_ptr<LinearSystem<STATE_DIM, CONTROL_DIM, SCALAR>>
LinearSystemPtr;
47 switchedLinearSystems_(switchedLinearSystems),
48 continuousModeSequence_(continuousModeSequence)
54 :
LinearSystem<STATE_DIM, CONTROL_DIM,
SCALAR>(arg), continuousModeSequence_(arg.continuousModeSequence_)
56 switchedLinearSystems_.clear();
57 for (
auto& subSystem : arg.switchedLinearSystems_)
59 switchedLinearSystems_.emplace_back(subSystem->clone());
75 const control_vector_t& u,
76 const time_t t =
time_t(0.0))
override 79 return switchedLinearSystems_[mode]->getDerivativeState(x, u,
t);
83 const control_vector_t& u,
84 const time_t t =
time_t(0.0))
override 87 return switchedLinearSystems_[mode]->getDerivativeControl(x, u,
t);
91 SwitchedLinearSystems switchedLinearSystems_;
interface class for a general linear system or linearized system
Definition: LinearSystem.h:23
std::vector< T, Alloc > Switched
Declaring Switched alias such that we can write Switched<System>
Definition: Switching.h:12
Base::time_t time_t
Definition: ControlledSystem.h:53
virtual ~SwitchedLinearSystem()
destructor
Definition: SwitchedLinearSystem.h:64
SwitchedLinearSystem(const SwitchedLinearSystems &switchedLinearSystems, const ContinuousModeSequence &continuousModeSequence, const ct::core::SYSTEM_TYPE &type=ct::core::SYSTEM_TYPE::GENERAL)
default constructor
Definition: SwitchedLinearSystem.h:43
interface class for a general switched linear system or linearized system
Definition: SwitchedLinearSystem.h:22
ControlledSystem< STATE_DIM, CONTROL_DIM, SCALAR > Base
Definition: SwitchedLinearSystem.h:30
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef std::shared_ptr< LinearSystem< STATE_DIM, CONTROL_DIM, SCALAR > > LinearSystemPtr
Definition: SwitchedLinearSystem.h:27
Definition: StateMatrix.h:12
clear all close all load ct GNMSLog0 mat reformat t
virtual const state_control_matrix_t & getDerivativeControl(const state_vector_t &x, const control_vector_t &u, const time_t t=time_t(0.0)) override
get the B matrix of a linear system
Definition: SwitchedLinearSystem.h:82
Definition: ControlVector.h:12
CppAD::AD< CppAD::cg::CG< double > > SCALAR
ControlVector< CONTROL_DIM, SCALAR > control_vector_t
input vector type
Definition: SwitchedLinearSystem.h:34
Definition: StateVector.h:12
StateMatrix< STATE_DIM, SCALAR > state_matrix_t
state Jacobian type
Definition: SwitchedLinearSystem.h:36
virtual const state_matrix_t & getDerivativeState(const state_vector_t &x, const control_vector_t &u, const time_t t=time_t(0.0)) override
get the A matrix of a linear system
Definition: SwitchedLinearSystem.h:74
StateControlMatrix< STATE_DIM, CONTROL_DIM, SCALAR > state_control_matrix_t
input Jacobian type
Definition: SwitchedLinearSystem.h:37
SYSTEM_TYPE
type of system
Definition: System.h:15
Base::time_t time_t
Definition: SwitchedLinearSystem.h:31
Phase getPhaseFromTime(Time time) const
get phase pointer from time
Definition: Switching.h:68
any non-specific system
Definition: System.h:17
SwitchedLinearSystem(const SwitchedLinearSystem &arg)
copy constructor
Definition: SwitchedLinearSystem.h:53
Switched< LinearSystemPtr > SwitchedLinearSystems
Definition: SwitchedLinearSystem.h:28
StateVector< STATE_DIM, SCALAR > state_vector_t
state vector type
Definition: SwitchedLinearSystem.h:33
Definition: StateControlMatrix.h:12
A general, non-linear dynamic system with a control input.
Definition: ControlledSystem.h:46
virtual SwitchedLinearSystem< STATE_DIM, CONTROL_DIM, SCALAR > * clone() const override
deep cloning
Definition: SwitchedLinearSystem.h:67