4#include <cyqlone/example-problems/export.h>
29 std::vector<real_t>
masses{1, 1, 1, 1, 1, 1};
58 .masses = std::vector<real_t>(n_masses, 1),
59 .n_actuators = (n_masses + 1) / 2,
67 double steady_state_spring_length = 0.1) {
69 params.width = steady_state_spring_length *
static_cast<real_t
>(n_masses + 1);
74 const real_t Ts = 0.5;
83 .T_horiz = Ts *
static_cast<real_t
>(
N_horiz),
89 .
masses = std::vector<real_t>(n_masses, 1),
90 .n_actuators = n_masses - 1,
98 std::vector<real_t>
masses(n_masses, 1.0);
101 masses[n_masses / 2 - 1] = 0.2;
102 masses[n_masses / 2 + 0] = 0.5;
103 masses[n_masses / 2 + 1] = 0.2;
115 .width = real_t(0.1) *
static_cast<real_t
>(n_masses + 1),
124 .n_actuators = n_masses / 2,
140SpringMassProblem CYQLONE_EXAMPLE_PROBLEMS_EXPORT spring_mass(
SpringMassParams p);
std::vector< real_t > ref
Data structure for optimal control problems.
Storage for a linear-quadratic OCP of the form.
std::vector< real_t > masses
real_t r_act
scaling factor for cost terms for the actuators
real_t friction
friction coefficient
real_t T_horiz
time horizon
real_t p_max_f
maximum displacement of each mass for the final stage
static SpringMassParams wang_boyd_2008_width(index_t n_masses, index_t N_horiz=30, uint64_t seed=0, double steady_state_spring_length=0.1)
real_t F_max
maximum actuator force
real_t q_vel_f
scaling factor for terminal cost term for the velocity
real_t p_min
minimum displacement of each mass
real_t v_max
maximum velocity of each mass (zero = no limit)
real_t v_max_f
maximum velocity of each mass for the final stage
uint64_t seed
random seed for actuator placement
real_t p_min_f
minimum displacement of each mass for the final stage
real_t width
width of the setup (distance between the walls)
real_t q_vel
scaling factor for cost terms for the velocity
real_t k_spring
spring constant between masses
static SpringMassParams active_state_constr(index_t n_masses=18, index_t N_horiz=256, uint64_t seed=0)
enum cyqlone::qpalm::problems::SpringMassParams::ActuatorPlacement actuator_placement
real_t q_pos_f
scaling factor for terminal cost term for the position
static SpringMassParams domahidi_2012(index_t n_masses, index_t N_horiz, uint64_t seed=0)
static SpringMassParams wang_boyd_2008(index_t n_masses, index_t N_horiz=30, uint64_t seed=0)
index_t n_actuators
number of actuators
real_t p_max
maximum displacement of each mass
index_t N_horiz
number of discretization steps
real_t q_pos
scaling factor for cost terms for the position