Skip to content

Latest commit

 

History

History
68 lines (44 loc) · 1.88 KB

configspring.rst

File metadata and controls

68 lines (44 loc) · 1.88 KB

ConfigSpring -- Linear Spring acting on a configuration variable

trep.potentials

Unlike the LinearSpring which creates a spring force between two points in 3D space, a ConfigSpring implements a spring force directly on a generalized coordinate:


Fq =  − k(q − q0)

where k is the spring stiffness and q0 is the neutral "length" of the spring.

Implemented Calculations
Calculation Implemented
V

Y

V_dq

Y

V_dqdq

Y

V_dqdqdq

Y

Examples

We can create a simple 1D harmonic oscillator using ConfigSpring on a translational configuration variable. The same oscillator could be created using a LinearSpring as well.

code_snippets/configspring-ex1.py

A ConfigSpring can be used to create a torsional spring on a rotational configuration variable. Here we create a pendulum with a length of 2 and mass of 1. Instead of gravity, the pendulum is moved by a single torsional spring.

code_snippets/configspring-ex2.py

ConfigSpring Objects

Create a new spring acting on the specified configuration variable. The configuration variable must already exist in the system.

ConfigSpring.config

The configuration variable that spring depends and acts on.

(read only)

ConfigSpring.q0

The "neutral length" of the spring. When self.config.q == q0, the force is zero.

ConfigSpring.k

The spring constant of the spring.