Centroid calculation using integrals

In summary, the author is given a function and is supposed to find the centroid of the function. However, the author has problems understanding the function and is not sure how to calculate the area under the curve.
  • #1
arhzz
260
52
Homework Statement
Find xs and ys
Relevant Equations
Integration
Hello!

Im given this function ## f:[-\pi/2,1] -> [0,1]## with f(x) = 1-x for x (0,1] and f(x) = cos(x) for x ##[-\pi/2,0] ##

And im susposed to find the centroid of this function so xs and ys.

For that I am given these 2 equations ( I found them in the notes)

## x_s =\frac{1}{A} \int_{a}^{b} f(x) x dx ## and ##y_s =\frac{1}{A} \int_{a}^{b} \frac{f(x)}{2}*f(x) dx##

Now to calculate A I found this formula ## A = \int_{a}^{b} f(x) dx ##

Okay so now looking at my problem specificly I have 2 diffrent values for the function depending on where it is. So I calculated A1 and A2; one for 1-x with the integral bounderies going from 0 to 1 and A2 for cos(x) with integral bounderies being -pi/2 and 1

I get ## A_1= \frac{1}{2} ## and ##A_2 = 1 ## Think that should be correct. Now since I have 2 A's (A should be the surface) I went ahead and caluclated using the formulas I posted above xs1 and xs2. For xs1 I used A1 and the same integral bounderies (0 to 1); for xs2 I used A2 and -pi/2 to 1

I get ##xs_1 = \frac{1}{3} ## and ##xs_2 = 1 - \frac{\pi}{2} ## Okay now to get a final xs I tried adding xs1 and xs2 together

After doing that i get this ##x_s =\frac{8-3\pi}{6} ## for xs. The solution says it should be ##xs = \frac{7-3\pi}{9} ##

I have rechecked all of my integrals and they should be correct,so im making a mistake somewhere else.I am not to sure what to do when I have 2 xs's, can i just add them together or not? Am i choosing the integral bounderies correctly or not?

Thanks in advance.
 
Last edited:
Physics news on Phys.org
  • #2
arhzz said:
Im given this function ## f:[-\pi/2,1] -> [0,1]## with f(x) = 1-x for x (0,1] and f(x) = cos(x) for x ##[-\pi/2,1] ##
For the above function, I think that for the 2nd part of your function the definition should be ##f(x) = \cos(x)## for ##x \in [\frac{-\pi}2, 0]##.

I'll take a look at the rest of your work and reply on it later.
 
  • #3
arhzz said:
Okay so now looking at my problem specificly I have 2 diffrent values for the function depending on where it is. So I calculated A1 and A2; one for 1-x with the integral bounderies going from 0 to 1 and A2 for cos(x) with integral bounderies being -pi/2 and 1
This is the source of your problems. If I am correct in what I wrote in the previous post, the interval for the f(x) = cos(x) part should be ##[-\pi/2, 0]##, not ##[\pi/2, 1]##. With the intervals you wrote, you'll get two different function values on the interval [0, 1], so you'll get the wrong values for the area beneath the cos(x) part as well as the moment about the y-axis, which you're calling xs.
arhzz said:
I get ## A_1= \frac{1}{2} ## and ##A_2 = 1 ## Think that should be correct.
I get the same values for the two areas. Was this your integral for ##A_2##: ##\int_{-\pi/2}^0~\cos(x)dx##? If so, you are using the correct interval; namely ##[-\pi/2, 0]##.

You don't show the work you did for what you're calling xs (the moment about the y-axis). If you use the wrong interval for this integral, you'll get a wrong value.

Also for what you're calling ys, the moment about the x-axis, you'll need to use ##\cos^{-1}(x)## in the integrand, with the limits of integration being 0 and 1.
 
  • #4
Mark44 said:
This is the source of your problems. If I am correct in what I wrote in the previous post, the interval for the f(x) = cos(x) part should be ##[-\pi/2, 0]##, not ##[\pi/2, 1]##. With the intervals you wrote, you'll get two different function values on the interval [0, 1], so you'll get the wrong values for the area beneath the cos(x) part as well as the moment about the y-axis, which you're calling xs.

I get the same values for the two areas. Was this your integral for ##A_2##: ##\int_{-\pi/2}^0~\cos(x)dx##? If so, you are using the correct interval; namely ##[-\pi/2, 0]##.

You don't show the work you did for what you're calling xs (the moment about the y-axis). If you use the wrong interval for this integral, you'll get a wrong value.

Also for what you're calling ys, the moment about the x-axis, you'll need to use ##\cos^{-1}(x)## in the integrand, with the limits of integration being 0 and 1.
Oh I just checked I made a mistake in the original post. The interval you posted is correct and that is the one I used; A2 you just typed in. I will edit my post.

Although I typed it in the forum wrong I calculated with the right intervals; hence you get the same area under the curve. The rest what I did is I just pluged in the formula. I can post it in detail if it will help.
 
  • #5
arhzz said:
The rest what I did is I just pluged in the formula. I can post it in detail if it will help.
Yes, please post your integrals for xs and ys. If you click on the integral I wrote you can see the Tex that I wrote for it.
 
  • #6
Okay here we go

$$ x_s1 = \frac{1}{A1} \int_{0}^{1} xf(x)dx $$ With plug in values $$ x_s1 = \frac{1}{1/2} \int_{0}^{1} (1-x) * x dx $$

Multiply the brackets out and get rid of the double fraction $$ 2 * \int_{0}^{1} x^2 - x dx $$ Now solve the Integral, it should be only the power rule so we get $$ 2 * ( \frac{x^2}{2} - \frac{x^3}{3}) $$ And I dont know how to do it in LaTeX but evalute the brackets at 1 and 0. Now I put the bracket term on a common denominator and get this $$ 2*(\frac{3x^2-2x^3}{6}) $$ So now we have to plug in 1 into x and subtract that from plugging 0 into x. If we plug 1 into this we get 1/6, if we plug 0 we get 0 hence we are left with. $$ 2 * \frac{1}{6} $$ and that is 1/3.

Okay for xs2 =$$ 1 * \int_{-pi/2}^{0} xcos(x) dx $$ Use partiall integration to solve the integral; I get $$ 1* (xsin(x)+cos(x))$$ and evaluate at -pi/2 and 0. Plug in first 0 than -pi/2 and subract them from each other.We should get $$ 1*(1-\frac{pi}{2} )$$.

This is how I did it
 
  • #7
That doesn't look right to me.

The moment about the y-axis, which you have separated into s1 and s2 has to be done as a single quantity. You can't do them separately.

This is what you need. $$\overline x = \frac{M_{y, 1} + M_{y, 2}}{A_1 + A_2} = \frac{\int_{-\pi/2}^0~x\cos(x)dx + \int_0^1 ~x(1 - x)dx}{A_1 + A_2}$$

Your values for the two integrals look ok to me, but you can't calculate the two parts of this moment separately.

The value I get for ##\overline x = \frac{M_y}{A_1}##, the x-coordinate of the centroid, is ##1 - \frac \pi 3##. I don't guarantee that I haven't made any mistakes.

Calculating ##M_x## will be a bit harder, but you need it to get the other coordinate of the centroid, ##\overline y##.
 
  • Like
Likes arhzz
  • #8
Mark44 said:
That doesn't look right to me.

The moment about the y-axis, which you have separated into s1 and s2 has to be done as a single quantity. You can't do them separately.

This is what you need. $$\overline x = \frac{M_{y, 1} + M_{y, 2}}{A_1 + A_2} = \frac{\int_{-\pi/2}^0~x\cos(x)dx + \int_0^1 ~x(1 - x)dx}{A_1 + A_2}$$

Your values for the two integrals look ok to me, but you can't calculate the two parts of this moment separately.

The value I get for ##\overline x = \frac{M_y}{A_1}##, the x-coordinate of the centroid, is ##1 - \frac \pi 3##. I don't guarantee that I haven't made any mistakes.

Calculating ##M_x## will be a bit harder, but you need it to get the other coordinate of the centroid, ##\overline y##.
Ahh okay that makes sence.See I did not know this formula existed, and I knew I was calculating the integrals right. So if I understood you correctly this will give me the value of my xs? So for ys I need to the same but solve a trickier integral?
 
  • #9
arhzz said:
Ahh okay that makes sence.See I did not know this formula existed, and I knew I was calculating the integrals right. So if I understood you correctly this will give me the value of my xs? So for ys I need to the same but solve a trickier integral?
Yes.
 
  • Like
Likes arhzz
  • #10
Okay I finally got around to revisiting this.And you are right,the formula was wrong. Using the formula you gave me the right result (the result I was not been able to find in post #1). Thank you for your great help as always!
 

1. What is a centroid?

A centroid is the geometric center of a shape or object. It is the point where all the mass of the object is evenly distributed, and it is often referred to as the "center of gravity" or "center of mass".

2. How is the centroid of a shape calculated?

The centroid of a shape can be calculated using integrals. This involves dividing the shape into infinitesimally small elements and finding the average value of their coordinates. The coordinates of the centroid can then be determined by integrating the coordinates of each element with respect to its area or volume.

3. What is the significance of calculating the centroid of a shape?

The centroid is an important property of a shape as it helps determine its stability, balance, and moments of inertia. It also plays a crucial role in engineering, architecture, and physics, as it allows for the precise calculation of forces and moments acting on the object.

4. Can the centroid of a shape be outside of the shape?

Yes, the centroid of a shape can be outside of the shape. This can happen when the shape is irregular or has holes, causing the mass to be distributed unevenly. In such cases, the centroid may lie outside the shape or even in empty space.

5. Are there any limitations to using integrals for centroid calculation?

While integrals are a powerful tool for calculating centroids, they do have limitations. They may not be suitable for complex or irregularly shaped objects, and the calculations can become quite complicated. In such cases, other methods, such as the geometric method or the parallel axis theorem, may be used to determine the centroid.

Similar threads

  • Calculus and Beyond Homework Help
Replies
3
Views
343
  • Calculus and Beyond Homework Help
Replies
3
Views
266
  • Calculus and Beyond Homework Help
Replies
2
Views
540
  • Calculus and Beyond Homework Help
Replies
9
Views
543
  • Calculus and Beyond Homework Help
Replies
5
Views
1K
  • Calculus and Beyond Homework Help
Replies
9
Views
162
  • Calculus and Beyond Homework Help
Replies
3
Views
557
  • Calculus and Beyond Homework Help
Replies
2
Views
420
  • Calculus and Beyond Homework Help
Replies
23
Views
947
  • Calculus and Beyond Homework Help
Replies
8
Views
660
Back
Top