Coding the objects for the center of gravity?

조회 수: 3 (최근 30일)
Tae Yeong Kim
Tae Yeong Kim 2013년 5월 14일
I am planning to code two boxes, one top of another, so that I can simulate the motions as the top box moves.
However, I have no idea how to incorporate the center of gravity, when I am trying to use first moment of mass through Matlab.
Does anyone know how this would be possible through addition of codes or change? thank you

답변 (2개)

Image Analyst
Image Analyst 2013년 5월 14일
Isn't the center of gravity just the average of the x edges and y edges? Yes, it is. So then you just have to draw and move the boxes, which you can do in the overlay if you use rectangle(), or plot(), or even line(). I'm sure you know how to move the x1, x2, y1, and y2 coordinates, so just increment them (however you do that, e.g. via the user interacting with a GUI), erase the old boxes, and draw the new boxes.
  댓글 수: 3
Image Analyst
Image Analyst 2013년 5월 14일
I can't do your project for you. For one, I don't know the math that your professor went over to describe any possible deformations of the boxes when hit by arbitrary forces at arbitrary angles and arbitrary locations on the perimeter. I don't know all of that - I hope you understand. I suggest you ask your professor to review the equations with you again.
Tae Yeong Kim
Tae Yeong Kim 2013년 5월 14일
yes, thank you for your kind help

댓글을 달려면 로그인하십시오.


Yao Li
Yao Li 2013년 5월 14일
I think SimMechanics is the best choice for you to perform the dynamic anlysis. Also, if you have installed ADAMS or some other softwares (such as Maplesim, Dymola, etc.) which can provide dynamic anlysis, I think it takes only minutes to get what you want.
  댓글 수: 2
Tae Yeong Kim
Tae Yeong Kim 2013년 5월 14일
The only program that I have is Matlab, and I guess I can't move on to another program. Thanks for the suggestion
Yao Li
Yao Li 2013년 5월 14일
Then, do you have SimMechanics toolbox in Simulink?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 General Applications에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by