MATLAB求解阴影面积

MATLAB求解阴影面积_第1张图片
Figure 1

Matlab solution:

STEP 1. Find the possible intersection points on two circles.

![][01]
[01]: http://latex.codecogs.com/svg.latex?\left{\begin{array}{ll}x2+(y-a)2&=a2\(x-\frac{a}{2})2+(y-\frac{a}{2})2&=(\frac{a}{2})2\end{array}\right.

code:

>> syms x x0 y0 a positive;
>> [x0, y0]=solve('x^2+(y-a)^2=a^2', '(x-a/2)^2+(y-a/2)^2=(a/2)^2');

output:
![][02]
[02]: http://latex.codecogs.com/svg.latex?\left{\begin{array}{ll}x_0&=\frac{5\pm\sqrt{7}}{8}a\y_0&=\frac{3\pm\sqrt{7}}{8}a\end{array}\right.

and the smaller one of x0 is the first cross point.

STEP 2. find the area s0 by integrating function f on (0, x0), where f is the part using the analytical function of the inscribed circle with radius a/2 minus the second circle with radius a.

![][03]
[03]: http://latex.codecogs.com/svg.latex?f=\sqrt{a2-x2}-\sqrt{ax-x^2}-\frac{a}{2}

then, integrate f on (0, x0):
![][04]
[04]: http://latex.codecogs.com/svg.latex?s_0=\int_{0}{x_0}fdx=\int_{0}{\frac{5-\sqrt{7}}{8}a}(\sqrt{a2-x2}-\sqrt{ax-x^2}-\frac{a}{2})dx

code:

>> f=a/2-(a*x-x^2)^(1/2)-(a-(a^2-x^2)^(1/2));
>> s0=simplify(int(f, x, 0, x0(1,1)));

output:

![][05]
[05]: http://latex.codecogs.com/svg.latex?s_0=\frac{\sqrt{7}+2-\pi+2arcsin(\frac{\sqrt{7}-1}{4})-8arcsin(\frac{\sqrt{7}-5}{8})}{16}a^2

STEP 3. find the area s

>> c= (a^2-pi*a^2/4)/4;
>> s=simplify(c+2*s0);

![][06]
[06]: http://latex.codecogs.com/svg.latex?s=c+2s_0=\frac{2\sqrt{7}-3\pi+4arcsin(\frac{\sqrt{7}-1}{4})-16arcsin(\frac{\sqrt{7}-5}{8})}{16}a2\approx0.1464a2

(done!)

你可能感兴趣的:(MATLAB求解阴影面积)