Center of Mass - Matrix Representation +- HP Forums (http://www.hpmuseum.org/forum) +-- Forum: HP Software Libraries (/forum-10.html) +--- Forum: HP Prime Software Library (/forum-15.html) +--- Thread: Center of Mass - Matrix Representation (/thread-3553.html) |
Center of Mass - Matrix Representation - Eddie W. Shore - 04-04-2015 11:05 PM The HP Prime program CENTERMTX calculates the center of mass of the matrix M, where M represents the body. The entries of M represents an array of molecules, each with assigned weights. It is possible that the center of mass is located outside of the body. Note: If gravity affects the particles equally, then the center of mass & center of gravity are identical. Formulas: Xc = ∑(x * m)/∑m Yc = ∑(y * m)/∑m HP Prime: CENTERMTX Code: EXPORT CENTERMTX(m) Example: Locate the center of mass of the following body. M = [[1 , 2, 1], [1, 1, 2],[1, 2, 1]] The center of mass: [[ 2.08333333333, 2 ]] http://edspi31415.blogspot.com/2015/04/hp-prime-center-of-mass-matrix.html RE: Center of Mass - Matrix Representation - Thomas Ritschel - 04-08-2015 02:35 PM The following program computes the center of mass for arbitrary arrangements of mass points in 3D cartesian space. For a system consisting of n particles the input is a n-by-4 matrix, e.g. the x, y, z coordinates in the the first three columns and the masses in the forth column. Code: EXPORT CG(xyzm) Using akmon's example: Code: CG([[0 0 0 1][5 0 0 1][5 5 0 1]]) = [3.333333333 1.666666667 0] = [10/3 5/3 0] |