1#ifndef BITSIM_SYSTEMS_DOUBLE_PENDULUM_SYSTEM_H
2#define BITSIM_SYSTEMS_DOUBLE_PENDULUM_SYSTEM_H
4#include "bitsim/bitsim_config.h"
10#include <chrono/physics/ChBody.h>
11#include <chrono/physics/ChSystemNSC.h>
61 std::array<real_t, 2>
angles()
const;
79 chrono::ChSystemNSC &
system() noexcept {
return system_; }
83 chrono::ChSystemNSC system_;
84 std::shared_ptr<chrono::ChBody> link1_;
85 std::shared_ptr<chrono::ChBody> link2_;
The basic types of bitsim. Code outside this file names Eigen's matrix and vector types only through ...
void step(real_t dt)
Advance the simulation by dt [s].
Definition double_pendulum_system.cpp:87
real_t time() const
Definition double_pendulum_system.h:73
const DoublePendulumProperties & properties() const noexcept
Definition double_pendulum_system.h:74
DoublePendulumSystem(const DoublePendulumProperties &props={}, real_t theta1=0.0, real_t theta2=0.0)
Definition double_pendulum_system.cpp:56
chrono::ChSystemNSC & system() noexcept
The Chrono system, to draw it.
Definition double_pendulum_system.h:79
std::array< real_t, 2 > angles() const
Definition double_pendulum_system.cpp:96
std::array< real_t, 2 > angular_velocities() const
Definition double_pendulum_system.cpp:101
real_t energy() const
Definition double_pendulum_system.cpp:107
Definition double_pendulum_system.cpp:18
Definition dc_motor_backend_base.h:9
double real_t
real_t
Definition bitsim_types.h:20
The two links of a double pendulum, each a uniform rod.
Definition double_pendulum_system.h:25
real_t width
the width of the links, as they are drawn [m]
Definition double_pendulum_system.h:30
real_t l2
the length of the lower link [m]
Definition double_pendulum_system.h:27
real_t m2
the mass of the lower link [kg]
Definition double_pendulum_system.h:29
real_t m1
the mass of the upper link [kg]
Definition double_pendulum_system.h:28
real_t l1
the length of the upper link [m]
Definition double_pendulum_system.h:26