bitsim
Model, simulate, estimate and control robots in C++
Loading...
Searching...
No Matches
bitsim::systems::DoublePendulumSystem Class Reference

A double pendulum in Chrono: two uniform rods, the upper one hanging from a pivot at the origin and the lower one from the end of the upper one, swinging in the x-z plane under gravity, -z. More...

#include <double_pendulum_system.h>

Public Member Functions

 DoublePendulumSystem (const DoublePendulumProperties &props={}, real_t theta1=0.0, real_t theta2=0.0)
void step (real_t dt)
 Advance the simulation by dt [s].
std::array< real_t, 2 > angles () const
std::array< real_t, 2 > angular_velocities () const
real_t energy () const
real_t time () const
const DoublePendulumProperties & properties () const noexcept
chrono::ChSystemNSC & system () noexcept
 The Chrono system, to draw it.

Detailed Description

A double pendulum in Chrono: two uniform rods, the upper one hanging from a pivot at the origin and the lower one from the end of the upper one, swinging in the x-z plane under gravity, -z.

The angles are those of the links from the downward vertical, positive towards +x: \(\theta = 0\) hangs straight down. There is no friction in the joints.

Constructor & Destructor Documentation

◆ DoublePendulumSystem()

bitsim::systems::DoublePendulumSystem::DoublePendulumSystem ( const DoublePendulumProperties & props = {},
real_t theta1 = 0.0,
real_t theta2 = 0.0 )
explicit
Parameters
propsThe links
theta1The angle of the upper link to start from [rad]
theta2The angle of the lower link to start from [rad]

Member Function Documentation

◆ angles()

std::array< real_t, 2 > bitsim::systems::DoublePendulumSystem::angles ( ) const
Returns
The angles of the two links from the downward vertical [rad]

◆ angular_velocities()

std::array< real_t, 2 > bitsim::systems::DoublePendulumSystem::angular_velocities ( ) const
Returns
The rates of change of the angles [rad/s]

◆ energy()

real_t bitsim::systems::DoublePendulumSystem::energy ( ) const
Returns
The kinetic plus the potential energy, with the pivot at zero height [J]

◆ properties()

const DoublePendulumProperties & bitsim::systems::DoublePendulumSystem::properties ( ) const
inlinenoexcept

◆ step()

void bitsim::systems::DoublePendulumSystem::step ( real_t dt)

Advance the simulation by dt [s].

◆ system()

chrono::ChSystemNSC & bitsim::systems::DoublePendulumSystem::system ( )
inlinenoexcept

The Chrono system, to draw it.

◆ time()

real_t bitsim::systems::DoublePendulumSystem::time ( ) const
inline

The documentation for this class was generated from the following files: