Archived

This topic is now archived and is closed to further replies.

Monder

Integration Confusion

Recommended Posts

I''ve started reading the book ''Physics for Game Developers'' and in the first few pages it shows you how to calculate the centre of mass of a body. These are the equations it gives (S being the integration sign Xc = (S Xo dm) / m Yc = (S Yo dm) / m Zc = (S Zo dm) / m where (X,Y,Z)c are the coordinates of the centre of mass, (X,Y,Z)o are the coordinates to the centre of mass from each elemental mass and dm is the elemental mass. Now what I''m not getting here is what do you have to intergrate with respect to? I can''t see how you can intergrate (X, Y ,Z)o with respect to m which is what it seems to be asking you to do. I haven''t actually been taught calculus in school yet but I''ve been reading ahead in my maths book and I can differentiate simple functions (i.e. 4x^2 + 5x), itergrate simple functions and I understand how you can use intergration to represent a sumation, but I''m not quite getting how it''s being used here.

Share this post


Link to post
Share on other sites
You have to do a substitution.
In this case, dm = density * dV.
So if you are assuming constant density, Xc = (S Xo dV) / (S dV)
Then dV = dx * dy * dz, so in fact you doing a triple integral over the body.

"Math is hard" -Barbie

Share this post


Link to post
Share on other sites
in words the formula is: (distance from origin)=(the sum of all elements*distancefromorigin)/(total mass).

might help. or it might not. its not a very easy topic, certainly not in three dimensions. but this is all quite theoreticly, since IRL you actually never have continous functions which to integrate.

therefore i recommend you just do a numerical approach, ie taking the average of all masses multiplied by their position (see the similarity with the above formula?).

Share this post


Link to post
Share on other sites
What a coincidence, the professor in my Physics class was doing center of mass this week. Spooky!

Anyway, the complexity of the problem depends on a few factors. For instance, the complexity of the function defining the space perpendicular to the direction of variable of integration (i.e if integrating with respect to x, then the perpendicular y/z area, etc.). It also depends on the density function. If both are constant functions, then they cancel out and you are left with integrating first- and second-degree polynomials, which are sweet beans. If only one is constant, then that one cancels out too. At any rate, the hardest part of any of this is figuring out the perpendicular distance/area as a function of the third variable if they don''t give you nice equations to start with. Like y/z area as a function of x. It''s cases like these where I like rectangular prisms

Share this post


Link to post
Share on other sites
Well the author also gives

Xc = (E Xo m)/(E m)

Where E is that big greek E thing used for summations (can''t remeber what it''s proper name is). I''m sure you can see what the formulae for Yc and Zc are going to be.

THe author says to worry too much about the itergrals but personally I like having at least a rough understanding of all formulae presented in a book even if the author says not to worry about them.

Thanks guys.

Share this post


Link to post
Share on other sites
yeah its a sigma. it stand for summation, sort of numerical integration. no offence, but seeing the nature of your questions i indeed wouldnt bother with integration: no matter how smart you are, its not going to be a thing youll just figure out in a couple of hours. and besides, as i said, the whole integrating thing is very theoretical, since you ''never'' have a nice function describing your model, but rather an irregular mesh.
so the numerical summation on finitly small elements is the best way to go, and requires only knowledge about finding an average.

Share this post


Link to post
Share on other sites
quote:
but seeing the nature of your questions i indeed wouldnt bother with integration: no matter how smart you are, its not going to be a thing youll just figure out in a couple of hours.


Well as I''ve already said I like having a rough understanding of things and I did teach myself everything I know about intergration in just a few hours so my understanding is indeed rough

Share this post


Link to post
Share on other sites
quote:
Original post by Eelco
yeah its a sigma. it stand for summation, sort of numerical integration.

If you leave out the "sort of numerical integration," that statement would be correct.

[edited by - unferth on October 26, 2003 1:34:47 PM]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:
Original post by Eelco
yeah its a sigma. it stand for summation, sort of numerical integration. no offence, but seeing the nature of your questions i indeed wouldnt bother with integration: no matter how smart you are, its not going to be a thing youll just figure out in a couple of hours. and besides, as i said, the whole integrating thing is very theoretical, since you ''never'' have a nice function describing your model, but rather an irregular mesh.
so the numerical summation on finitly small elements is the best way to go, and requires only knowledge about finding an average.

<i>Physics for Game Developers</i> says the opposite. They say that b/c your meshes are so complex, and b/c they might be non-rigid, or b/c moments of inertia might change, it''s best to use integration of bouding shapes, which they go over. It would be a lot faster to calculate the moment of inertia of a cylinder than iterating over 100s of vertices to get something that''s most accurate, when the object isn''t real in the first place.

Share this post


Link to post
Share on other sites