floripy.rbd package#

Submodules#

floripy.rbd.bodymodels module#

Class implementing a body.

class floripy.rbd.bodymodels.BodyBase(bid)[source]#

Bases: object

Attributes:
bid

Methods

update_acceleration(a)

Update velocity and angular acceleration

update_bid(bid)

Update the body id.

update_position(com, shifter)

Update com and shifter.

update_velocity(v)

Update velocity and angular velocity

get_acceleration

get_angular_acceleration

get_angular_velocity

get_com

get_linear_acceleration

get_linear_velocity

get_shifter

get_velocity

update_com

update_shifter

update_bid(bid)[source]#

Update the body id.

update_position(com, shifter)[source]#

Update com and shifter.

update_velocity(v)[source]#

Update velocity and angular velocity

update_acceleration(a)[source]#

Update velocity and angular acceleration

update_com(com)[source]#
update_shifter(shifter)[source]#
get_com()[source]#
get_shifter()[source]#
get_velocity()[source]#
get_angular_velocity()[source]#
get_linear_velocity()[source]#
get_acceleration()[source]#
get_angular_acceleration()[source]#
get_linear_acceleration()[source]#
property bid#
class floripy.rbd.bodymodels.BodyZero(bid=None)[source]#

Bases: BodyBase

Attributes:
bid

Methods

update_acceleration(a)

Update velocity and angular acceleration

update_bid(bid)

Update the body id.

update_position(com, shifter)

Update com and shifter.

update_velocity(v)

Update velocity and angular velocity

get_acceleration

get_angular_acceleration

get_angular_velocity

get_com

get_linear_acceleration

get_linear_velocity

get_shifter

get_velocity

update_com

update_shifter

update_position(com, shifter)[source]#

Update com and shifter.

property bid#
get_acceleration()#
get_angular_acceleration()#
get_angular_velocity()#
get_com()#
get_linear_acceleration()#
get_linear_velocity()#
get_shifter()#
get_velocity()#
update_acceleration(a)#

Update velocity and angular acceleration

update_bid(bid)#

Update the body id.

update_com(com)#
update_shifter(shifter)#
update_velocity(v)#

Update velocity and angular velocity

class floripy.rbd.bodymodels.Sphere(bid, radius=None)[source]#

Bases: BodyBase

Attributes:
bid

Methods

update_acceleration(a)

Update velocity and angular acceleration

update_bid(bid)

Update the body id.

update_position(com, shifter)

Update com and shifter.

update_velocity(v)

Update velocity and angular velocity

get_acceleration

get_angular_acceleration

get_angular_velocity

get_com

get_linear_acceleration

get_linear_velocity

get_radius

get_shifter

get_velocity

update_com

update_shifter

get_radius()[source]#
property bid#
get_acceleration()#
get_angular_acceleration()#
get_angular_velocity()#
get_com()#
get_linear_acceleration()#
get_linear_velocity()#
get_shifter()#
get_velocity()#
update_acceleration(a)#

Update velocity and angular acceleration

update_bid(bid)#

Update the body id.

update_com(com)#
update_position(com, shifter)#

Update com and shifter.

update_shifter(shifter)#
update_velocity(v)#

Update velocity and angular velocity

class floripy.rbd.bodymodels.Prolate(bid, a=None, c=None)[source]#

Bases: BodyBase

Attributes:
bid

Methods

update_acceleration(a)

Update velocity and angular acceleration

update_bid(bid)

Update the body id.

update_position(com, shifter)

Update com and shifter.

update_velocity(v)

Update velocity and angular velocity

get_acceleration

get_angular_acceleration

get_angular_velocity

get_com

get_director

get_linear_acceleration

get_linear_velocity

get_prolate_a

get_prolate_c

get_shifter

get_velocity

update_com

update_shifter

get_prolate_a()[source]#
get_prolate_c()[source]#
get_director()[source]#
property bid#
get_acceleration()#
get_angular_acceleration()#
get_angular_velocity()#
get_com()#
get_linear_acceleration()#
get_linear_velocity()#
get_shifter()#
get_velocity()#
update_acceleration(a)#

Update velocity and angular acceleration

update_bid(bid)#

Update the body id.

update_com(com)#
update_position(com, shifter)#

Update com and shifter.

update_shifter(shifter)#
update_velocity(v)#

Update velocity and angular velocity

class floripy.rbd.bodymodels.Oblate(bid, a=None, c=None)[source]#

Bases: BodyBase

Attributes:
bid

Methods

update_acceleration(a)

Update velocity and angular acceleration

update_bid(bid)

Update the body id.

update_position(com, shifter)

Update com and shifter.

update_velocity(v)

Update velocity and angular velocity

get_acceleration

get_angular_acceleration

get_angular_velocity

get_com

get_director

get_linear_acceleration

get_linear_velocity

get_oblate_a

get_oblate_c

get_shifter

get_velocity

update_com

update_shifter

get_oblate_a()[source]#
get_oblate_c()[source]#
get_director()[source]#
property bid#
get_acceleration()#
get_angular_acceleration()#
get_angular_velocity()#
get_com()#
get_linear_acceleration()#
get_linear_velocity()#
get_shifter()#
get_velocity()#
update_acceleration(a)#

Update velocity and angular acceleration

update_bid(bid)#

Update the body id.

update_com(com)#
update_position(com, shifter)#

Update com and shifter.

update_shifter(shifter)#
update_velocity(v)#

Update velocity and angular velocity

class floripy.rbd.bodymodels.Parallelogram(bid, vertices=None)[source]#

Bases: BodyBase

Attributes:
bid
num_vertices

Methods

update_acceleration(a)

Update velocity and angular acceleration

update_bid(bid)

Update the body id.

update_position(com, shifter)

Update com and shifter.

update_velocity(v)

Update velocity and angular velocity

get_acceleration

get_angular_acceleration

get_angular_velocity

get_com

get_ellipsoid_a

get_ellipsoid_b

get_ellipsoid_c

get_ellipsoid_shifter

get_linear_acceleration

get_linear_velocity

get_shifter

get_velocity

update_com

update_shifter

get_ellipsoid_a()[source]#
get_ellipsoid_b()[source]#
get_ellipsoid_c()[source]#
get_ellipsoid_shifter()[source]#
property num_vertices#
property bid#
get_acceleration()#
get_angular_acceleration()#
get_angular_velocity()#
get_com()#
get_linear_acceleration()#
get_linear_velocity()#
get_shifter()#
get_velocity()#
update_acceleration(a)#

Update velocity and angular acceleration

update_bid(bid)#

Update the body id.

update_com(com)#
update_position(com, shifter)#

Update com and shifter.

update_shifter(shifter)#
update_velocity(v)#

Update velocity and angular velocity

floripy.rbd.bodymodels.create(bid, body_type, **kwargs)[source]#

floripy.rbd.jointmodels module#

Classes for various joint models. Ref. Roy Featherstone, Rigid Body Dynamics, Table 4.1, p.79

class floripy.rbd.jointmodels.JointBase(category, pf, sf, xi, r, zeta, prox_shifter, dist_shifter, mss, css, num_gencoord, num_genspeed)[source]#

Bases: object

Attributes:
connects
num_constraints
num_gencoord
num_genspeed
predecessor
successor

Methods

get_css()

Returns the joint constraint subspace.

get_jpvm()

Returns the joint partial velocity matrix.

get_mss()

Returns the joint motion subspace.

get_shifter66()

Return the 6x6 transform in world.

get_gencoord

get_gencoord_dot

abstractmethod get_gencoord_dot(u)[source]#
get_gencoord()[source]#
get_jpvm()[source]#

Returns the joint partial velocity matrix.

get_mss()[source]#

Returns the joint motion subspace.

get_css()[source]#

Returns the joint constraint subspace.

get_shifter66()[source]#

Return the 6x6 transform in world.

property num_genspeed#
property num_gencoord#
property num_constraints#
property predecessor#
property successor#
property connects#
class floripy.rbd.jointmodels.Revolute(**kwargs)[source]#

Bases: JointBase

Attributes:
connects
num_constraints
num_gencoord
num_genspeed
predecessor
successor

Methods

get_css()

Returns the joint constraint subspace.

get_jpvm()

Returns the joint partial velocity matrix.

get_mss()

Returns the joint motion subspace.

get_shifter66()

Return the 6x6 transform in world.

get_constraint_mat

get_gencoord

get_gencoord_dot

renormalize

selfupdate

update

update(q)[source]#
selfupdate()[source]#
renormalize()[source]#
get_gencoord_dot(u)[source]#
get_constraint_mat()[source]#
property connects#
get_css()#

Returns the joint constraint subspace.

get_gencoord()#
get_jpvm()#

Returns the joint partial velocity matrix.

get_mss()#

Returns the joint motion subspace.

get_shifter66()#

Return the 6x6 transform in world.

property num_constraints#
property num_gencoord#
property num_genspeed#
property predecessor#
property successor#
class floripy.rbd.jointmodels.Free(**kwargs)[source]#

Bases: JointBase

Attributes:
connects
num_constraints
num_gencoord
num_genspeed
predecessor
successor

Methods

get_css()

Returns the joint constraint subspace.

get_jpvm()

Returns the joint partial velocity matrix.

get_mss()

Returns the joint motion subspace.

get_shifter66()

Return the 6x6 transform in world.

get_constraint_mat

get_gencoord

get_gencoord_dot

renormalize

selfupdate

update

update(q)[source]#
selfupdate()[source]#
get_gencoord_dot(u)[source]#
renormalize()[source]#
get_constraint_mat()[source]#
property connects#
get_css()#

Returns the joint constraint subspace.

get_gencoord()#
get_jpvm()#

Returns the joint partial velocity matrix.

get_mss()#

Returns the joint motion subspace.

get_shifter66()#

Return the 6x6 transform in world.

property num_constraints#
property num_gencoord#
property num_genspeed#
property predecessor#
property successor#
class floripy.rbd.jointmodels.Spherical(**kwargs)[source]#

Bases: JointBase

Attributes:
connects
num_constraints
num_gencoord
num_genspeed
predecessor
successor

Methods

get_css()

Returns the joint constraint subspace.

get_jpvm()

Returns the joint partial velocity matrix.

get_mss()

Returns the joint motion subspace.

get_shifter66()

Return the 6x6 transform in world.

get_constraint_mat

get_gencoord

get_gencoord_dot

selfupdate

update

update(q)[source]#
selfupdate()[source]#
get_gencoord_dot(u)[source]#
get_constraint_mat()[source]#
property connects#
get_css()#

Returns the joint constraint subspace.

get_gencoord()#
get_jpvm()#

Returns the joint partial velocity matrix.

get_mss()#

Returns the joint motion subspace.

get_shifter66()#

Return the 6x6 transform in world.

property num_constraints#
property num_gencoord#
property num_genspeed#
property predecessor#
property successor#
class floripy.rbd.jointmodels.Root(**kwargs)[source]#

Bases: Free

Attributes:
connects
num_constraints
num_gencoord
num_genspeed
predecessor
successor

Methods

get_css()

Returns the joint constraint subspace.

get_jpvm()

Returns the joint partial velocity matrix.

get_mss()

Returns the joint motion subspace.

get_shifter66()

Return the 6x6 transform in world.

get_constraint_mat

get_gencoord

get_gencoord_dot

is_rooted

renormalize

reroot

selfupdate

update

uproot

update(q)[source]#
selfupdate()[source]#
uproot()[source]#
reroot(root_sphere_radius=0.0, loc=[0.0, 0.0, 0.0])[source]#
is_rooted()[source]#
property connects#
get_constraint_mat()#
get_css()#

Returns the joint constraint subspace.

get_gencoord()#
get_gencoord_dot(u)#
get_jpvm()#

Returns the joint partial velocity matrix.

get_mss()#

Returns the joint motion subspace.

get_shifter66()#

Return the 6x6 transform in world.

property num_constraints#
property num_gencoord#
property num_genspeed#
property predecessor#
renormalize()#
property successor#
class floripy.rbd.jointmodels.Fixed(**kwargs)[source]#

Bases: JointBase

Attributes:
connects
num_constraints
num_gencoord
num_genspeed
predecessor
successor

Methods

get_css()

Returns the joint constraint subspace.

get_jpvm()

Returns the joint partial velocity matrix.

get_mss()

Returns the joint motion subspace.

get_shifter66()

Return the 6x6 transform in world.

get_constraint_mat

get_gencoord

get_gencoord_dot

selfupdate

update

update(q)[source]#
selfupdate()[source]#
get_gencoord_dot(u)[source]#
get_constraint_mat()[source]#
property connects#
get_css()#

Returns the joint constraint subspace.

get_gencoord()#
get_jpvm()#

Returns the joint partial velocity matrix.

get_mss()#

Returns the joint motion subspace.

get_shifter66()#

Return the 6x6 transform in world.

property num_constraints#
property num_gencoord#
property num_genspeed#
property predecessor#
property successor#
floripy.rbd.jointmodels.create(joint_type, **kwargs)[source]#

floripy.rbd.mbs module#

class floripy.rbd.mbs.Mbs(**kwargs)[source]#

Bases: object

Attributes:
num_bodies
num_constraints
num_gencoord
num_genspeed
num_joints

Methods

bid_iter()

Returns a range over the body ids.

export_digraph(G, fn)

Draws a digraph to a file.

get_all_director()

Return director vector for all bodies.

get_all_ellipsoid_shifters()

Return the ellipsoid shifters for all bodies.

get_coms()

Return com for all bodies.

get_gencoord()

Called by timestepper to set initial condition.

get_shifters()

Return shifters for all bodies.

jid_iter()

Returns a range over the joint ids for looping sequentially.

loop_jid_iter()

Returns a range over the loop joint ids for looping sequentially.

renormalize()

Renormalizes unit quaternions in the joints.

tofile(time)

Write to output file.

tree_jid_iter()

Returns a range over the tree joint ids for looping sequentially.

close_files

constraints_violated

create_mbs

eval_position_constraints

eval_velocity_constraints

gencoord_correction

get_all_ellipsoid_a

get_all_ellipsoid_b

get_all_ellipsoid_c

get_all_oblate_a

get_all_oblate_c

get_all_prolate_a

get_all_prolate_c

get_all_radius

get_constraint_mat

get_gencoord_dot

get_partial_mat

get_torque_force

partition_gencoord

pullback

update

create_mbs(body_dict=None, joint_dict=None)[source]#
export_digraph(G, fn)[source]#

Draws a digraph to a file.

get_torque_force()[source]#
update(q, time)[source]#
eval_position_constraints()[source]#
eval_velocity_constraints()[source]#
constraints_violated(kind, tol)[source]#
gencoord_correction()[source]#
partition_gencoord()[source]#
pullback()[source]#
renormalize()[source]#

Renormalizes unit quaternions in the joints.

get_gencoord()[source]#

Called by timestepper to set initial condition.

get_gencoord_dot(u)[source]#
get_partial_mat()[source]#
get_constraint_mat()[source]#
get_coms()[source]#

Return com for all bodies.

get_shifters()[source]#

Return shifters for all bodies.

get_all_radius()[source]#
get_all_prolate_a()[source]#
get_all_prolate_c()[source]#
get_all_oblate_a()[source]#
get_all_oblate_c()[source]#
get_all_ellipsoid_a()[source]#
get_all_ellipsoid_b()[source]#
get_all_ellipsoid_c()[source]#
get_all_director()[source]#

Return director vector for all bodies.

get_all_ellipsoid_shifters()[source]#

Return the ellipsoid shifters for all bodies.

jid_iter()[source]#

Returns a range over the joint ids for looping sequentially.

tree_jid_iter()[source]#

Returns a range over the tree joint ids for looping sequentially.

loop_jid_iter()[source]#

Returns a range over the loop joint ids for looping sequentially.

bid_iter()[source]#

Returns a range over the body ids. The zero body is not included.

tofile(time)[source]#

Write to output file.

close_files()[source]#
property num_bodies#
property num_joints#
property num_gencoord#
property num_genspeed#
property num_constraints#

floripy.rbd.timestepper module#

Class implementing Kane’s method.

class floripy.rbd.timestepper.Timestepper(model, hydrodynamics, flowfield, **kwargs)[source]#

Bases: object

Interface to ODE integrator.

Methods

decomp_LTL(A[, overwrite, zero_upper, out])

Compute the LTL decomposition of a positive definite matrix.

run

static decomp_LTL(A, overwrite=False, zero_upper=True, out=None)[source]#

Compute the LTL decomposition of a positive definite matrix.

run()[source]#

Module contents#