Re: area under a parametric curve

• To: mathgroup at smc.vnet.net
• Subject: [mg75023] Re: [mg74983] area under a parametric curve
• From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
• Date: Sat, 14 Apr 2007 01:12:12 -0400 (EDT)
• References: <200704130608.CAA00311@smc.vnet.net>

```On 13 Apr 2007, at 15:08, Roger Bagula wrote:

> In working with unit square "curves"
> I came up with the idea of using a Lemnicape  ( quarter of a curve):
>
>   x = Sqrt[Abs[Cos[t]]]*Sin[t]
>   y = Sqrt[Abs[Cos[t]]]*Cos[t]
>   x1 = x*Sin[ArcCos[-1/2^((2/3))]] + 1/2
>   y1 = y + 1/2
>   Solve[1/2 + Sqrt[Abs[Cos[t]]Cos[t] == 0, t]
>   ParametricPlot[{x1, 2*y1}, {t, 0, 2*Pi}, PlotRange -> {{0, 1},
> {0, 1}}]

It is impossible to tell what you want since you do not explain the
terms you use and post code that is syntacticcally wrong and des not
work even if it it corrected. As an exampel fo the former: in what
sense is this a "unit square curve"? As an example of the latter,
consider what you wrote:

Solve[1/2 + Sqrt[Abs[Cos[t]]Cos[t] == 0, t]

Have you tried to evaluate it? Not only does it haver a syntax error
but even if corrected will not return to you a very "informative"
output.

Are you doing something with the loop:

ParametricPlot[{Sqrt[-Cos[t]] Sin[t] + 1/2,
2 Sqrt[1 - 1/(2 Power[2, (3)^-1])] Sqrt[-Cos[t]] Cos[t] + 1}, {t,
Pi/2,
3 Pi/2}, PlotRange -> All,AspectRatio->Automatic]

Note that I removed the absolute value since in this range of the
values of t Cos[t] is always negative. This is actually a crucial
step in dealing with this kind of problem.

If this is indeed what you mean (I am not at all sure) you should use

{ToRules[Reduce[1/2 + Sqrt[-Cos[t]]*Cos[t] == 0 && Pi/2 < t < (3*Pi)/
2, t]]}

{{t -> 2*Pi - ArcCos[-(1/2^(2/3))]}, {t -> ArcCos[-(1/2^(2/3))]}}

Only the second solution gives a positive value for y (for Pi/2<t<3Pi/
2).

One can compute the area of the whole loop by first using
GroebnerBasis to obtain a cartesion equation of the loop and then
using NIntegrate and Boole.  The cartesian equation of the curve
comes out quite complicated degree 6 polynomial in two variables:

f[X_, Y_] = (1/(-4 + 2^(2/3))^3)*4*
(192*(-5 - 2*2^(1/3) + 4*2^(2/3))*X^6 -
576*(-5 - 2*2^(1/3) + 4*2^(2/3))*X^5 +
48*(2*(-8 - 2^(1/3) + 4*2^(2/3))*(Y - 2)*Y +
68*2^(2/3) - 32*2^(1/3) - 91)*X^4 -
96*(2*(-8 - 2^(1/3) + 4*2^(2/3))*(Y - 2)*Y +
28*2^(2/3) - 12*2^(1/3) - 41)*X^3 +
12*(4*(Y - 2)*Y*((-4 + 2^(2/3))*(Y - 2)*Y +
14*2^(2/3) - 3*2^(1/3) - 32) +
112*2^(2/3) - 42*2^(1/3) - 187)*X^2 -
12*(4*(Y - 2)*Y*((-4 + 2^(2/3))*(Y - 2)*Y +
6*2^(2/3) - 2^(1/3) - 16) + 32*2^(2/3) -
10*2^(1/3) - 63)*X - 2*(Y - 2)*Y*
(2*(Y - 2)*Y*(4*(Y - 2)*Y -
3*(-8 + 2^(2/3))) + 40*2^(2/3) -
13*2^(1/3) - 32) - 80*2^(2/3) + 20*2^(1/3) +
129)

To convince yoruself that this is the same loop you can plot on the
same graph:

g1== ParametricPlot[{Sqrt[-cos(t)] sin(
t) + 1/2, 2 Sqrt[1 - 1/(2 Power[2, (3)^-1])] Sqrt[-cos(t)]
cos(t) + 1}, {t, Pi/2, 3 Pi/2}, PlotRange -> All, PlotStyle ->
Red]

and

g2=ContourPlot[f[x, y], {x, -2, 2}, {y, -1, 1}, Contours -> {0}]

Show[g2, g1]

The function f is negative inside the loop so to find the enitre area
enclosed inside the loop you can use (for example):

NIntegrate[Boole[f[X,Y]<0],{X,-1,1.5},{Y,-1,1},MaxRecursion->0]

1.55325

You can also equally easily find the area "under" any part of this
curve but I will leave this to you.

Andrzej Kozlowski

>
> My question is how to get the area under such a curve?
> Since the curve is symmetrical only {x,0,1/2} is actually necessary.
>
> A second question is how to get rid of the curve "in" part
> that comes about because the Lemnicape isn't exactly symmetrical:
> what is the maximum x  to y instead of the "2" I've used in this as
> the
> scaling.
> Here a try at a better curve:
>   x = Sqrt[Abs[Cos[t]]]*Sin[t]
>   y = Sqrt[Abs[Cos[t]]]*Cos[t]
>   x1 = x*Sin[2.226604043204] + 1/2
>   y1 = y + 1/2
>   Solve[1/2 + 2.1 Sqrt[ Abs[Cos[t]] Cos[t]/2 == 0, t]
>   ParametricPlot[{x1, 2.1*y + 1}, {t, 0, 2*Pi}, PlotRange -> {{0,
> 1}, {
>   0, 1.0}}]
>

```

• Prev by Date: Re: Strange results from Mathematica
• Next by Date: Re: Memory issue in SVD
• Previous by thread: area under a parametric curve
• Next by thread: Memory issue in SVD