Learn R Programming

AvInertia (version 0.0.2)

massprop_bones: Bone mass properties

Description

Calculate the moment of inertia of a bone modeled as a hollow cylinder with two solid end caps

Usage

massprop_bones(m, l, r_out, r_in, rho, start, end)

Arguments

m

Mass of bone (kg)

l

Length of bone (kg)

r_out

Outer radius of bone (m)

r_in

Inner radius of bone (m)

rho

Density of the bone (kg/m^3)

start

a 1x3 vector (x,y,z) representing the 3D point where bone starts. Points from the VRP to the bone start. Frame of reference: VRP | Origin: VRP

end

a 1x3 vector (x,y,z) representing the 3D point where bone ends. Points from the VRP to the bone start. Frame of reference: VRP | Origin: VRP

Value

This function returns a list that includes:

  • Ia 3x3 matrix representing the moment of inertia tensor of a bone modeled as a hollow cylinder with two solid end caps

  • CGa 1x3 vector representing the center of gravity position of a bone modeled as a hollow cylinder with two solid end caps

  • ma double that returns the input bone mass

Warning

Parallel axis theorem does not apply between two arbitrary points. One point must be the object's center of gravity.

Examples

Run this code
# NOT RUN {
# refer to the vignette
library(AvInertia)

# load data
data(dat_id_curr, package = "AvInertia")
data(dat_bird_curr, package = "AvInertia")
data(dat_feat_curr, package = "AvInertia")
data(dat_bone_curr, package = "AvInertia")
data(dat_mat, package = "AvInertia")
data(clean_pts, package = "AvInertia")

# 1. Determine the center of gravity of the bird's torso (including the legs)
dat_torsotail_out = massprop_restbody(dat_id_curr, dat_bird_curr)
# 2. Calculate the inertia of the flight feathers about the tip of the calamus
feather_inertia <- compute_feat_inertia(dat_mat, dat_feat_curr, dat_bird_curr)
# 3. Determine the center of gravity of one of the bird's wings
dat_wing_out      = massprop_birdwing(dat_id_curr, dat_bird_curr,
dat_bone_curr, dat_feat_curr, dat_mat, clean_pts,
feather_inertia, plot_var = 0)
# Visualize the center of gravity of each wing component in the x and y axis
dat_wing_out      = massprop_birdwing(dat_id_curr, dat_bird_curr,
dat_bone_curr, dat_feat_curr, dat_mat, clean_pts,
feather_inertia, plot_var = "yx")
# or the y and z axis
dat_wing_out      = massprop_birdwing(dat_id_curr, dat_bird_curr,
dat_bone_curr, dat_feat_curr, dat_mat, clean_pts,
feather_inertia, plot_var = "yz")
# 4. Combine all data and obtain the center of gravity, moment of inertia
# and principal axes of the bird
curr_full_bird      = combine_inertialprop(dat_torsotail_out,dat_wing_out,
dat_wing_out, dat_id_curr, dat_bird_curr, symmetric=TRUE)

# }

Run the code above in your browser using DataLab