Skip to contents

Particle() and RigidBody() create the bodies of SymPy's sympy.physics.mechanics. A particle has a mass and a point; a rigid body adds a reference frame and an inertia. Attributes and methods (mass, masscenter, frame, inertia, central_inertia, potential_energy, linear_momentum(), angular_momentum(), kinetic_energy() and parallel_axis()) are reached with $.

Usage

Particle(name, point = NULL, mass = NULL)

RigidBody(name, masscenter = NULL, frame = NULL, mass = NULL, inertia = NULL)

Arguments

name

Body name.

point, masscenter

The mass center, a PhysPoint(); created when NULL.

mass

The mass; a symbol <name>_mass when NULL.

frame

The body frame; a new ReferenceFrame() when NULL.

inertia

An Inertia() tuple or a list of a dyadic and a point; built from symbolic moments of inertia when NULL.

Value

A Particle or RigidBody.

Examples

N <- ReferenceFrame("N")
P <- PhysPoint("P")
P$set_vel(N, 3 * N$x)
p <- Particle("p", P, 2)
p$linear_momentum(N)
#> 6*N.x
p$kinetic_energy(N)
#> 9
B <- RigidBody("B")
B$central_inertia
#> B_ixx*(B_frame.x|B_frame.x) + B_ixy*(B_frame.x|B_frame.y) + B_izx*(B_frame.x|B_frame.z) + B_ixy*(B_frame.y|B_frame.x) + B_iyy*(B_frame.y|B_frame.y) + B_iyz*(B_frame.y|B_frame.z) + B_izx*(B_frame.z|B_frame.x) + B_iyz*(B_frame.z|B_frame.y) + B_izz*(B_frame.z|B_frame.z)