- 3.0.2 models module.
InvertedPendulumActDynLinearizedForward.h
Go to the documentation of this file.
1 /**********************************************************************************************************************
2 This file is part of the Control Toolbox (https://github.com/ethz-adrl/control-toolbox), copyright by ETH Zurich.
3 Licensed under the BSD-2 license (see LICENSE file in main directory)
4 **********************************************************************************************************************/
5 
6 #pragma once
7 
8 #include <ct/core/core.h>
9 
10 namespace ct {
11 namespace models {
12 namespace InvertedPendulum {
13 
15 {
16 public:
18 
23 
24  InvertedPendulumActDynLinearizedForward(const ct::core::SYSTEM_TYPE& type = ct::core::SYSTEM_TYPE::GENERAL)
25  : ct::core::LinearSystem<3, 1>(type)
26  {
27  initialize();
28  }
29 
32 
34  virtual const state_matrix_t& getDerivativeState(const state_vector_t& x,
35  const control_vector_t& u,
36  const double t = double(0.0)) override;
37 
38  virtual const state_control_matrix_t& getDerivativeControl(const state_vector_t& x,
39  const control_vector_t& u,
40  const double t = double(0.0)) override;
41 
42 private:
43  void initialize()
44  {
45  dFdx_.setZero();
46  dFdu_.setZero();
47  vX_.fill(0.0);
48  vU_.fill(0.0);
49  }
50 
51  state_matrix_t dFdx_;
52  state_control_matrix_t dFdu_;
53  std::array<double, 0> vX_;
54  std::array<double, 0> vU_;
55 };
56 }
57 }
58 }
ct::core::LinearSystem< 3, 1, double > Base
Definition: InvertedPendulumActDynLinearizedForward.h:17
ct::core::ControlVector< control_dim > u
virtual const state_matrix_t & getDerivativeState(const state_vector_t &x, const control_vector_t &u, const double t=double(0.0)) override
Definition: InvertedPendulumActDynLinearizedForward.cpp:13
Base::state_vector_t state_vector_t
Definition: InvertedPendulumActDynLinearizedForward.h:19
InvertedPendulumActDynLinearizedForward(const ct::core::SYSTEM_TYPE &type=ct::core::SYSTEM_TYPE::GENERAL)
Definition: InvertedPendulumActDynLinearizedForward.h:24
clear all close all load ct GNMSLog0 mat reformat t
Definition: InvertedPendulumActDynLinearizedForward.h:14
Base::state_matrix_t state_matrix_t
Definition: InvertedPendulumActDynLinearizedForward.h:21
Base::state_control_matrix_t state_control_matrix_t
Definition: InvertedPendulumActDynLinearizedForward.h:22
virtual const state_control_matrix_t & getDerivativeControl(const state_vector_t &x, const control_vector_t &u, const double t=double(0.0)) override
Definition: InvertedPendulumActDynLinearizedForward.cpp:31
InvertedPendulumActDynLinearizedForward(const InvertedPendulumActDynLinearizedForward &other)
Definition: InvertedPendulumActDynLinearizedForward.h:30
StateVector< 3, double > state_vector_t
ct::core::StateVector< state_dim > x
Base::control_vector_t control_vector_t
Definition: InvertedPendulumActDynLinearizedForward.h:20
StateMatrix< 3, double > state_matrix_t
StateControlMatrix< 3, 1, double > state_control_matrix_t
ControlVector< 1, double > control_vector_t
virtual ~InvertedPendulumActDynLinearizedForward()
Definition: InvertedPendulumActDynLinearizedForward.h:31
virtual InvertedPendulumActDynLinearizedForward * clone() const override
Definition: InvertedPendulumActDynLinearizedForward.h:33