Mathematica Asked by user77740 on July 8, 2021
Using Mathematica, find the center of mass of a 2D square not centered at the origin.
center: (x0, y0)
area1 = 4*Integrate[1, {x, x0, a/2}, {y, y0, b/2 }]
cm = mass/area1
RegionCentroid[Rectangle[{x0 - a/2, y0 - a/2}, {x0 + a/2, y0 + a/2}]]
Answered by cvgmt on July 8, 2021
The center of mass is the mass weighted mean of the position vector. Call the mass density: rho, then we have:
totmass= Integrate[rho , {x, x0 - a/2, x0 + a/2}, {y, y0 - b/2, y0 + b/2}];
cof= Integrate[rho {x,y}, {x, x0 - a/2, x0 + a/2}, {y, y0 - b/2, y0 + b/2}] /totmass //Simplify
(*{x0,y0}*)
Answered by Daniel Huber on July 8, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP