Merge pull request #99 from fangliu-tju/main

update center_of_mass.qmd
This commit is contained in:
john verzani 2023-05-25 12:57:40 -04:00 committed by GitHub
commit 9dc64d23d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -182,7 +182,7 @@ For the triangular shape, we have by the fact that $f(x) = 1 - \lvert x \rvert$
##### Example
What about the center of mass of the triangle formed by the line $x=-1$, the $x$ axis and $(1-x)/2$? This too is defined between $a=-1$ and $b=-1$, but the center of mass will be negative, as a graph shows more mass to the left of $0$ than the right:
What about the center of mass of the triangle formed by the line $x=-1$, the $x$ axis and $(1-x)/2$? This too is defined between $a=-1$ and $b=1$, but the center of mass will be negative, as a graph shows more mass to the left of $0$ than the right:
```{julia}
@ -331,7 +331,7 @@ We can talk about the center of mass in the $y$ direction too. The approximating
For example, consider, again, the triangle bounded by the line $x=-1$, the $x$ axis, and the line $y=(1-x)/2$. In terms of describing this in $y$, the function $f(y)=2 -2y$ gives the total length of the horizontal slice (which comes from solving $y=(x-1)/2$for $x$, the general method to find an inverse function, and subtracting $-1$) and the interval is $y=0$ to $y=1$. Thus our center of mass in the $y$ direction will be
For example, consider, again, the triangle bounded by the line $x=-1$, the $x$ axis, and the line $y=(1-x)/2$. In terms of describing this in $y$, the function $f(y)=2 -2y$ gives the total length of the horizontal slice (which comes from solving $y=(1-x)/2$for $x$, the general method to find an inverse function, and subtracting $-1$) and the interval is $y=0$ to $y=1$. Thus our center of mass in the $y$ direction will be
$$
@ -397,10 +397,10 @@ However, the value for cm$_y$ will - like the last problem - be around $1/3$. Th
$$
\text{cm}_y = \frac{\int_{0}^1 y 2 \sqrt{1 - y^2}dy}{\int_{0}^1 2\sqrt{1-y^2}} =
\frac{-(1-x^2)^{3/2}/3\big|_0^1}{\pi/2} = \frac{1}{3}.
\frac{-2(1-y^2)^{3/2}/3\big|_0^1}{\pi/2} = \frac{4}{3\pi}.
$$
In fact it is exactly $1/3$. The top calculation is done by $u$-substitution, the bottom by using the area formula for a half circle, $\pi r^2/2$.
The top calculation is done by $u$-substitution, the bottom by using the area formula for a half circle, $\pi r^2/2$.
##### Example
@ -538,7 +538,7 @@ $$
(Where $\text{sech}$ is the hyperbolic secant, implemented in `julia` through `sech`.)
For $m=2$ and $s=4$ compute the mean, or center of mass, of this density.
For $\mu=2$ and $s=4$ compute the mean, or center of mass, of this density.
```{julia}