com
Module¶
- cartesian(arrays, out=None)¶
Generate a cartesian product of input arrays.
- Parameters:
- arrayslist of array-like
1-D arrays to form the cartesian product of.
- outndarray
Array to place the cartesian product in.
- Returns:
- outndarray
2-D array of shape (M, len(arrays)) containing cartesian products formed of input arrays.
Examples
>>> cartesian(([1, 2, 3], [4, 5], [6, 7])) array([[1, 4, 6], [1, 4, 7], [1, 5, 6], [1, 5, 7], [2, 4, 6], [2, 4, 7], [2, 5, 6], [2, 5, 7], [3, 4, 6], [3, 4, 7], [3, 5, 6], [3, 5, 7]])
- center_of_mass(slopes, intercepts)¶
Returns the center of mass relative to the slopes and intercepts coordinate system.
- Parameters:
- slopesndarray, shape(n,)
The slope of every line used to calculate the center of mass.
- interceptsndarray, shape(n,)
The intercept of every line used to calculate the center of mass.
- Returns:
- xfloat
The abscissa of the center of mass.
- yfloat
The ordinate of the center of mass.
- com_line(alpha, a, par, part, l1, l2)¶
Returns the slope and intercept for the line that passes through the part’s center of mass with reference to the benchmark bicycle coordinate system.
- Parameters:
- alphafloat
The angle the head tube makes with the horizontal. When looking at the bicycle from the right side this is the angle between a vector point out upwards along the steer axis and the earth horizontal with the positve direction pointing from the left to the right. If the bike is in its normal configuration this would be 90 degrees plus the steer axis tilt (lambda).
- afloat
The distance from the pendulum axis to a reference point on the part, typically the wheel centers. This is positive if the point falls to the left of the axis and negative otherwise.
- pardictionary
Benchmark parameters. Must include lam, rR, rF, w
- partstring
The subscript denoting which part this refers to.
- l1, l2floats
The location of the handlebar reference point relative to the front wheel center when the fork is split. This is measured perpendicular to and along the steer axis, respectively.
- Returns:
- mfloat
The slope of the line in the benchmark coordinate system.
- bfloat
The z intercept in the benchmark coordinate system.
- part_com_lines(mp, par, forkIsSplit)¶
Returns the slopes and intercepts for all of the center of mass lines for each part.
- Parameters:
- mpdictionary
Dictionary with the measured parameters.
- Returns:
- slopesdictionary
Contains a list of slopes for each part.
- interceptsdictionary
Contains a list of intercepts for each part.
- The slopes and intercepts lists are in order with respect to each other and
- the keyword is either ‘B’, ‘H’, ‘G’ or ‘S’ for Frame, Handlebar/Fork,
- Handlerbar, and Fork respectively.
- total_com(coordinates, masses)¶
Returns the center of mass of a group of objects if the indivdual centers of mass and mass is provided.
- coordinatesarray_like, shape(3,n)
The rows are the x, y and z coordinates, respectively and the columns are for each object.
- massesarray_like, shape(3,)
An array of the masses of multiple objects, the order should correspond to the columns of coordinates.
- Returns:
- mTfloat
Total mass of the objects.
- cTndarray, shape(3,)
The x, y, and z coordinates of the total center of mass.