User:Yongtao-Li/HW3.4

=Problem 3.4 "Area of Bifolium"=

Given
The classic curve bifolium is shown as following


 * egm6341.s11.team2.hw3.4.1.png

The exact area of this leaf which can be calculated using WolframAlpha is π/16.

Find
1) Do literature search to find history and applications (if any) of this classic curve. First described by Johannes Kepler in 1609, a bifolium is a curve that has the respective Cartesian and polor form,
 * {| style="width:100%" border="0"

$$ \displaystyle (x^2+y^2)(y^2+x(x+b))=4axy^2 $$    (4.0a) and
 * style="width:98%" |
 * style="width:98%" |
 * 
 * }
 * {| style="width:100%" border="0"

$$ \displaystyle r=-bcos(\theta)+4acos(\theta)sin^2(\theta) $$    (4.0b) The etymology of bifolium stems from the Latin prefix [bi-] meaning "two" and the Latin root word [folium] meaning "leaved", hence the meaning "two-leaved". The of Descartes] was first discovered by Rene Descartes in 1638 and is represented by the equation,
 * style="width:98%" |
 * style="width:98%" |
 * 
 * }
 * {| style="width:100%" border="0"

$$ \displaystyle (x^3+y^3)=3axy $$    (4.0c) Unique to the folium of Descartes is the asymptote located at
 * style="width:98%" |
 * style="width:98%" |
 * 
 * }
 * {| style="width:100%" border="0"

$$ \displaystyle x+y+a=0 $$    (4.0d)
 * style="width:98%" |
 * style="width:98%" |
 * 
 * }

2) Find area in one leaf to $$ {10^{ - 6}} $$ accuracy using following methods.

2.1) Complex Trapezoidal Rule.

2.2) Complex Simpson's Rule.

2.3) Sum the area of triangles which composite the leaf. If we know two edges a and b and the angle t between them, the area of one triangle is

Formulation
2.1) and 2.2)

First we have to divide the curve into two parts like the red and green curves shown in Figure 4.1. Since we can not explicit show the function relationship in terms x, we can write the function relation in terms of y as following:

Because equation (4.4) and (4.5) are describe the green and red curve separately, we can use equation (4.1) and (4.2) to integrate the area between these two curve and y axis and the area difference is just the area of this leaf.

2.3)

When using summation of triangles that constitute the leaf, we can divide [0,π/2] into several equal angles and the parametric equations are needed to calculate the edge length of each triangles:

Fortran Code for these three methods
In order to simplify the procedure and make it clear, Fortran codes which are written to calculate the leaf area using the above formulation are as following:

Result
Using the above codes, we can have the following output on the screen:

From the above result, the integrated results are calculated exactly. Since we use $$ {10^{ - 6}} $$ accuracy compared to the given exact solution, we also generate the error convergence as figure 4.2 and figure 4.3.


 * egm6341.s11.team2.hw3.4.2.png


 * egm6341.s11.team2.hw3.4.3.png

From figure 4.2 we can find both Complex Trapezoidal and Simpson's method can convergent at the same time, but Complex Trapezoidal integration gives less error for equal block number.

From figure 4.3 we notice that using summation of triangles is very easy to find convergence when just cut a leaf in to more than 1000 triangles which are very easy to calculate its area.