Unexpected result from ArcLengthDetermining which rule NIntegrate selects automaticallyFinding minimum fly-by...

Is camera lens focus an exact point or a range?

By means of an example, show that P(A) + P(B) = 1 does not mean that B is the complement of A.

How can Trident be so inexpensive? Will it orbit Triton or just do a (slow) flyby?

Melting point of aspirin, contradicting sources

Has Darkwing Duck ever met Scrooge McDuck?

Pre-mixing cryogenic fuels and using only one fuel tank

Is it improper etiquette to ask your opponent what his/her rating is before the game?

Schmidt decomposition - example

why `nmap 192.168.1.97` returns less services than `nmap 127.0.0.1`?

What major Native American tribes were around Santa Fe during the late 1850s?

Will the technology I first learn determine the direction of my future career?

Have I saved too much for retirement so far?

Is there an efficient solution to the travelling salesman problem with binary edge weights?

Perfect Cadence in minor key

Folder comparison

What linear sensor for a keyboard?

Why do we read the Megillah by night and by day?

Varistor? Purpose and principle

Open a doc from terminal, but not by its name

Extending the spectral theorem for bounded self adjoint operators to bounded normal operators

Global amount of publications over time

Why does the Sun have different day lengths, but not the gas giants?

Drawing ramified coverings with tikz

Flux received by a negative charge



Unexpected result from ArcLength


Determining which rule NIntegrate selects automaticallyFinding minimum fly-by radius between Mars and spacecraft from interpolating functionCoarse-graining in numerical integrationsNIntegrate fails to converge around a value out of integration rangeA 1D numerical integral Mathematica cannot compute, from physicsDifferential Equation with Numerically Integrated Boundary ConditionsDifferents results of the intersection area between two regions when using the function “Area” and the function “NIntegrate”Issue with boundary Integration of FEM numerical solution (interpolation function)How to get the most accurate volume of a special solid?Numerical solution of 3 dim integral with singularity













7












$begingroup$


I want to determine the arc lenght of a parametric curve $C: {x(t),y(t) } = { cos(t)^p , sin(t)^p }$ with $p$ between $0$ and $1$, and $t$ between $0$ and $pi/2$.



I set up the following function of $p$:



L[p_] :=  ArcLength[{Cos[t]^p, Sin[t]^p}, {t, 0, Pi/2}, 
Method -> {"NIntegrate", MaxRecursion -> 20}]


For $p=1$ we have a quarter of a circle of radius 1 and we know the arc length is equal to $pi/2$. The above function gives the correct result: 1.5708.



For $p$ close to zero, the curve approaches a square, and we know the result should be very close to $2$. However, the function doesn't even come close to it. Evaluating L[1/100] results in 1.30603. Not close to 2 (it's not even bigger than Pi/2).



Plotting, results in the following:



Plot[L[p], {p, 0, 1}]



enter image description here



Any ideas? I'm running 11.0.0.0










share|improve this question











$endgroup$








  • 1




    $begingroup$
    I get a warning from NIntegrate ("Numerical integration converging too slowly; suspect one of the following: singularity...") when trying to evaluate L for small p.
    $endgroup$
    – MarcoB
    Mar 15 at 20:53












  • $begingroup$
    @MarcoB I don't get any warnings when evaluating L[1/100]
    $endgroup$
    – Ivan
    Mar 15 at 20:57
















7












$begingroup$


I want to determine the arc lenght of a parametric curve $C: {x(t),y(t) } = { cos(t)^p , sin(t)^p }$ with $p$ between $0$ and $1$, and $t$ between $0$ and $pi/2$.



I set up the following function of $p$:



L[p_] :=  ArcLength[{Cos[t]^p, Sin[t]^p}, {t, 0, Pi/2}, 
Method -> {"NIntegrate", MaxRecursion -> 20}]


For $p=1$ we have a quarter of a circle of radius 1 and we know the arc length is equal to $pi/2$. The above function gives the correct result: 1.5708.



For $p$ close to zero, the curve approaches a square, and we know the result should be very close to $2$. However, the function doesn't even come close to it. Evaluating L[1/100] results in 1.30603. Not close to 2 (it's not even bigger than Pi/2).



Plotting, results in the following:



Plot[L[p], {p, 0, 1}]



enter image description here



Any ideas? I'm running 11.0.0.0










share|improve this question











$endgroup$








  • 1




    $begingroup$
    I get a warning from NIntegrate ("Numerical integration converging too slowly; suspect one of the following: singularity...") when trying to evaluate L for small p.
    $endgroup$
    – MarcoB
    Mar 15 at 20:53












  • $begingroup$
    @MarcoB I don't get any warnings when evaluating L[1/100]
    $endgroup$
    – Ivan
    Mar 15 at 20:57














7












7








7





$begingroup$


I want to determine the arc lenght of a parametric curve $C: {x(t),y(t) } = { cos(t)^p , sin(t)^p }$ with $p$ between $0$ and $1$, and $t$ between $0$ and $pi/2$.



I set up the following function of $p$:



L[p_] :=  ArcLength[{Cos[t]^p, Sin[t]^p}, {t, 0, Pi/2}, 
Method -> {"NIntegrate", MaxRecursion -> 20}]


For $p=1$ we have a quarter of a circle of radius 1 and we know the arc length is equal to $pi/2$. The above function gives the correct result: 1.5708.



For $p$ close to zero, the curve approaches a square, and we know the result should be very close to $2$. However, the function doesn't even come close to it. Evaluating L[1/100] results in 1.30603. Not close to 2 (it's not even bigger than Pi/2).



Plotting, results in the following:



Plot[L[p], {p, 0, 1}]



enter image description here



Any ideas? I'm running 11.0.0.0










share|improve this question











$endgroup$




I want to determine the arc lenght of a parametric curve $C: {x(t),y(t) } = { cos(t)^p , sin(t)^p }$ with $p$ between $0$ and $1$, and $t$ between $0$ and $pi/2$.



I set up the following function of $p$:



L[p_] :=  ArcLength[{Cos[t]^p, Sin[t]^p}, {t, 0, Pi/2}, 
Method -> {"NIntegrate", MaxRecursion -> 20}]


For $p=1$ we have a quarter of a circle of radius 1 and we know the arc length is equal to $pi/2$. The above function gives the correct result: 1.5708.



For $p$ close to zero, the curve approaches a square, and we know the result should be very close to $2$. However, the function doesn't even come close to it. Evaluating L[1/100] results in 1.30603. Not close to 2 (it's not even bigger than Pi/2).



Plotting, results in the following:



Plot[L[p], {p, 0, 1}]



enter image description here



Any ideas? I'm running 11.0.0.0







numerical-integration






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 15 at 21:28









Henrik Schumacher

57.6k578158




57.6k578158










asked Mar 15 at 20:37









IvanIvan

1,639821




1,639821








  • 1




    $begingroup$
    I get a warning from NIntegrate ("Numerical integration converging too slowly; suspect one of the following: singularity...") when trying to evaluate L for small p.
    $endgroup$
    – MarcoB
    Mar 15 at 20:53












  • $begingroup$
    @MarcoB I don't get any warnings when evaluating L[1/100]
    $endgroup$
    – Ivan
    Mar 15 at 20:57














  • 1




    $begingroup$
    I get a warning from NIntegrate ("Numerical integration converging too slowly; suspect one of the following: singularity...") when trying to evaluate L for small p.
    $endgroup$
    – MarcoB
    Mar 15 at 20:53












  • $begingroup$
    @MarcoB I don't get any warnings when evaluating L[1/100]
    $endgroup$
    – Ivan
    Mar 15 at 20:57








1




1




$begingroup$
I get a warning from NIntegrate ("Numerical integration converging too slowly; suspect one of the following: singularity...") when trying to evaluate L for small p.
$endgroup$
– MarcoB
Mar 15 at 20:53






$begingroup$
I get a warning from NIntegrate ("Numerical integration converging too slowly; suspect one of the following: singularity...") when trying to evaluate L for small p.
$endgroup$
– MarcoB
Mar 15 at 20:53














$begingroup$
@MarcoB I don't get any warnings when evaluating L[1/100]
$endgroup$
– Ivan
Mar 15 at 20:57




$begingroup$
@MarcoB I don't get any warnings when evaluating L[1/100]
$endgroup$
– Ivan
Mar 15 at 20:57










3 Answers
3






active

oldest

votes


















10












$begingroup$

Seems to be a precision thing.



L[p_] = {Cos[t]^p, Sin[t]^p}

ArcLength[L[1/100], {t, 0, π/2}, WorkingPrecision -> 1000]

1.99447959240474567...





share|improve this answer









$endgroup$





















    6












    $begingroup$

    I can only provide an alternative to bypass ArcLength.



    The points pts of a quarter circle are scaled such that they lie on the desired curve; afterwards the length of the polygonal line is computed.



    You will still get problems for values of p very close to 0, but at least you may obtain a qualitatively correct plot (so I hope).



    Certainly this method won't provide you with the best possible accuracy. The relative error between the arclength $ell$ of an arc and the length $s$ of a secant is roughly $|ell/s - 1| leq ell^2 , max(|kappa|)$ in the limit of $ell to 0$. Here $kappa$ denotes the curvature of the curve. Since the maximal curvature of the curve goes to $infty$ for $p to infty$, the quality of this approximation will reduce significantly for $p to 0$.



    n = 10000;
    pts = Transpose[{Cos[Subdivide[0., Pi/2, n]], Sin[Subdivide[0., Pi/2, n]]}];
    L[p_] := With[{x = pts/Power[Dot[(Abs[pts]^(1/p)), {1., 1.}], p]},
    Total[Sqrt[Dot[Differences[x]^2, {1., 1.}]]]
    ]
    Plot[L[p], {p, 0.001, 1}]


    enter image description here



    Edit



    The ratio behind this is that in contrast to the parameterization



    γ[t_, p_] = {Cos[t]^p, Sin[t]^p};


    the parameterization



    η[t_, p_] = {Cos[t], Sin[t]}/ Power[Cos[t]^(1/p) + Sin[t]^(1/p), p];


    has finite speed which is always helpful for determining the arclength by integration:



    assume = {p > 0, 0 < t < Pi/2};
    speedγ[t_, p_] = Simplify[Sqrt[D[γ[t, p], t].D[γ[t, p], t]], assume];
    speedη[t_, p_] = Simplify[Sqrt[D[η[t, p], t].D[η[t, p], t]], assume];
    Quiet@GraphicsRow[{
    Plot[Evaluate[Table[speedγ[t, 2^-k], {k, 0, 10}]], {t, 0, Pi/2},
    PlotLabel -> "Speed of γ",
    PlotRange -> {0, 10}
    ],
    Plot[Evaluate[Table[speedη[t, 2^-k], {k, 0, 10}]], {t, 0, Pi/2},
    PlotLabel -> "Speed of η",
    PlotRange -> {0, 10}
    ]
    },
    ImageSize -> Large
    ]


    enter image description here



    Whit this parameterization, one can also employ NIntegrate to compute the arclength, at least for not too small p.



    NIntegrate[speedη[t, 1/1000], {t, 0, Pi/2}]



    2.







    share|improve this answer











    $endgroup$





















      3












      $begingroup$

      Manipulate[ParametricPlot[{Cos[t]^p, Sin[t]^p}, {t, 0, Pi/2}], {p, 0.01, 1}]


      gives this plot at $p=0.01$:



      (An unpreprocessing plot was here.)



      UPDATE:



      p = 0.01; ParametricPlot[{Cos[t]^p, Sin[t]^p}, {t, 0, Pi/2}, Axes -> False, Frame -> True, PlotRange -> {{0, 1.1}, {0, 1.1}}]


      enter image description here



      So yes, the sides are not shrinking, but Mathematica seems to be missing some of the curve ...



      ADDITIONAL UPDATE:



      f[t_][p_] := {Cos[t]^p, Sin[t]^p};
      p = 0.01;
      k = 10^6;
      Show[
      ListLinePlot[Transpose@f[[Pi]/(2 k) Range[0, k]][p], PlotStyle -> Red],
      ListPlot[Transpose@f[[Pi]/(2 k) Range[0, k]][p], PlotStyle -> PointSize[Large]],
      AspectRatio -> 1, Frame -> True, Axes -> False
      ]


      If we sample $t$ with one million equally spaced points, there are big jumps to the first and the last point!



      enter image description here



      Plot[f[10^-q][.01][[2]], {q, 0, 100}, Frame -> True, Axes -> False, FrameLabel -> {"-Log10[t]", "f[[2]]"}]


      This plot shows that we need $t le 10^{-100}$ for the $y$-value of the curve to be less than $approx 0.1$ when $p=.01$.



      enter image description here






      share|improve this answer











      $endgroup$













      • $begingroup$
        >but the sides are shrinking. Not really. Check your plotrange
        $endgroup$
        – Ivan
        Mar 15 at 20:54








      • 2




        $begingroup$
        No, not that desperate ... By the way, you guys are tough! Imagine a classroom where a student gives an answer/suggestion that is not correct. Or a collaboration with somebody making a mistake. Seems that "Mathematica Stack Exchange" culture does not like people taking risks. May hurt creativity ... But we will have strictly precise, quality answers!!
        $endgroup$
        – mjw
        Mar 15 at 21:12








      • 2




        $begingroup$
        @mjw "Seems that "Mathematica Stack Exchange" culture does not like people taking risks." To the contrary. I was really surprise that posts in this threads were downvoted so quickly. Downvotes on answers are actually very uncommon on this site.
        $endgroup$
        – Henrik Schumacher
        Mar 15 at 21:16






      • 1




        $begingroup$
        @Ivan, yes, point well taken! Could be an artifact. But why is the ArcLength[] returning wrong results? Seems that in both cases Mathematica is undersampling ...
        $endgroup$
        – mjw
        Mar 15 at 21:29








      • 4




        $begingroup$
        A downvote doesn't mean that you're a bad person, it means that someone somewhere didn't find your answer useful. It's an unremarkable, ordinary thing that can be allowed to pass without comment.
        $endgroup$
        – hobbs
        Mar 16 at 4:02











      Your Answer





      StackExchange.ifUsing("editor", function () {
      return StackExchange.using("mathjaxEditing", function () {
      StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
      StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
      });
      });
      }, "mathjax-editing");

      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "387"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f193346%2funexpected-result-from-arclength%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      10












      $begingroup$

      Seems to be a precision thing.



      L[p_] = {Cos[t]^p, Sin[t]^p}

      ArcLength[L[1/100], {t, 0, π/2}, WorkingPrecision -> 1000]

      1.99447959240474567...





      share|improve this answer









      $endgroup$


















        10












        $begingroup$

        Seems to be a precision thing.



        L[p_] = {Cos[t]^p, Sin[t]^p}

        ArcLength[L[1/100], {t, 0, π/2}, WorkingPrecision -> 1000]

        1.99447959240474567...





        share|improve this answer









        $endgroup$
















          10












          10








          10





          $begingroup$

          Seems to be a precision thing.



          L[p_] = {Cos[t]^p, Sin[t]^p}

          ArcLength[L[1/100], {t, 0, π/2}, WorkingPrecision -> 1000]

          1.99447959240474567...





          share|improve this answer









          $endgroup$



          Seems to be a precision thing.



          L[p_] = {Cos[t]^p, Sin[t]^p}

          ArcLength[L[1/100], {t, 0, π/2}, WorkingPrecision -> 1000]

          1.99447959240474567...






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 15 at 21:49









          Bill WattsBill Watts

          3,6111621




          3,6111621























              6












              $begingroup$

              I can only provide an alternative to bypass ArcLength.



              The points pts of a quarter circle are scaled such that they lie on the desired curve; afterwards the length of the polygonal line is computed.



              You will still get problems for values of p very close to 0, but at least you may obtain a qualitatively correct plot (so I hope).



              Certainly this method won't provide you with the best possible accuracy. The relative error between the arclength $ell$ of an arc and the length $s$ of a secant is roughly $|ell/s - 1| leq ell^2 , max(|kappa|)$ in the limit of $ell to 0$. Here $kappa$ denotes the curvature of the curve. Since the maximal curvature of the curve goes to $infty$ for $p to infty$, the quality of this approximation will reduce significantly for $p to 0$.



              n = 10000;
              pts = Transpose[{Cos[Subdivide[0., Pi/2, n]], Sin[Subdivide[0., Pi/2, n]]}];
              L[p_] := With[{x = pts/Power[Dot[(Abs[pts]^(1/p)), {1., 1.}], p]},
              Total[Sqrt[Dot[Differences[x]^2, {1., 1.}]]]
              ]
              Plot[L[p], {p, 0.001, 1}]


              enter image description here



              Edit



              The ratio behind this is that in contrast to the parameterization



              γ[t_, p_] = {Cos[t]^p, Sin[t]^p};


              the parameterization



              η[t_, p_] = {Cos[t], Sin[t]}/ Power[Cos[t]^(1/p) + Sin[t]^(1/p), p];


              has finite speed which is always helpful for determining the arclength by integration:



              assume = {p > 0, 0 < t < Pi/2};
              speedγ[t_, p_] = Simplify[Sqrt[D[γ[t, p], t].D[γ[t, p], t]], assume];
              speedη[t_, p_] = Simplify[Sqrt[D[η[t, p], t].D[η[t, p], t]], assume];
              Quiet@GraphicsRow[{
              Plot[Evaluate[Table[speedγ[t, 2^-k], {k, 0, 10}]], {t, 0, Pi/2},
              PlotLabel -> "Speed of γ",
              PlotRange -> {0, 10}
              ],
              Plot[Evaluate[Table[speedη[t, 2^-k], {k, 0, 10}]], {t, 0, Pi/2},
              PlotLabel -> "Speed of η",
              PlotRange -> {0, 10}
              ]
              },
              ImageSize -> Large
              ]


              enter image description here



              Whit this parameterization, one can also employ NIntegrate to compute the arclength, at least for not too small p.



              NIntegrate[speedη[t, 1/1000], {t, 0, Pi/2}]



              2.







              share|improve this answer











              $endgroup$


















                6












                $begingroup$

                I can only provide an alternative to bypass ArcLength.



                The points pts of a quarter circle are scaled such that they lie on the desired curve; afterwards the length of the polygonal line is computed.



                You will still get problems for values of p very close to 0, but at least you may obtain a qualitatively correct plot (so I hope).



                Certainly this method won't provide you with the best possible accuracy. The relative error between the arclength $ell$ of an arc and the length $s$ of a secant is roughly $|ell/s - 1| leq ell^2 , max(|kappa|)$ in the limit of $ell to 0$. Here $kappa$ denotes the curvature of the curve. Since the maximal curvature of the curve goes to $infty$ for $p to infty$, the quality of this approximation will reduce significantly for $p to 0$.



                n = 10000;
                pts = Transpose[{Cos[Subdivide[0., Pi/2, n]], Sin[Subdivide[0., Pi/2, n]]}];
                L[p_] := With[{x = pts/Power[Dot[(Abs[pts]^(1/p)), {1., 1.}], p]},
                Total[Sqrt[Dot[Differences[x]^2, {1., 1.}]]]
                ]
                Plot[L[p], {p, 0.001, 1}]


                enter image description here



                Edit



                The ratio behind this is that in contrast to the parameterization



                γ[t_, p_] = {Cos[t]^p, Sin[t]^p};


                the parameterization



                η[t_, p_] = {Cos[t], Sin[t]}/ Power[Cos[t]^(1/p) + Sin[t]^(1/p), p];


                has finite speed which is always helpful for determining the arclength by integration:



                assume = {p > 0, 0 < t < Pi/2};
                speedγ[t_, p_] = Simplify[Sqrt[D[γ[t, p], t].D[γ[t, p], t]], assume];
                speedη[t_, p_] = Simplify[Sqrt[D[η[t, p], t].D[η[t, p], t]], assume];
                Quiet@GraphicsRow[{
                Plot[Evaluate[Table[speedγ[t, 2^-k], {k, 0, 10}]], {t, 0, Pi/2},
                PlotLabel -> "Speed of γ",
                PlotRange -> {0, 10}
                ],
                Plot[Evaluate[Table[speedη[t, 2^-k], {k, 0, 10}]], {t, 0, Pi/2},
                PlotLabel -> "Speed of η",
                PlotRange -> {0, 10}
                ]
                },
                ImageSize -> Large
                ]


                enter image description here



                Whit this parameterization, one can also employ NIntegrate to compute the arclength, at least for not too small p.



                NIntegrate[speedη[t, 1/1000], {t, 0, Pi/2}]



                2.







                share|improve this answer











                $endgroup$
















                  6












                  6








                  6





                  $begingroup$

                  I can only provide an alternative to bypass ArcLength.



                  The points pts of a quarter circle are scaled such that they lie on the desired curve; afterwards the length of the polygonal line is computed.



                  You will still get problems for values of p very close to 0, but at least you may obtain a qualitatively correct plot (so I hope).



                  Certainly this method won't provide you with the best possible accuracy. The relative error between the arclength $ell$ of an arc and the length $s$ of a secant is roughly $|ell/s - 1| leq ell^2 , max(|kappa|)$ in the limit of $ell to 0$. Here $kappa$ denotes the curvature of the curve. Since the maximal curvature of the curve goes to $infty$ for $p to infty$, the quality of this approximation will reduce significantly for $p to 0$.



                  n = 10000;
                  pts = Transpose[{Cos[Subdivide[0., Pi/2, n]], Sin[Subdivide[0., Pi/2, n]]}];
                  L[p_] := With[{x = pts/Power[Dot[(Abs[pts]^(1/p)), {1., 1.}], p]},
                  Total[Sqrt[Dot[Differences[x]^2, {1., 1.}]]]
                  ]
                  Plot[L[p], {p, 0.001, 1}]


                  enter image description here



                  Edit



                  The ratio behind this is that in contrast to the parameterization



                  γ[t_, p_] = {Cos[t]^p, Sin[t]^p};


                  the parameterization



                  η[t_, p_] = {Cos[t], Sin[t]}/ Power[Cos[t]^(1/p) + Sin[t]^(1/p), p];


                  has finite speed which is always helpful for determining the arclength by integration:



                  assume = {p > 0, 0 < t < Pi/2};
                  speedγ[t_, p_] = Simplify[Sqrt[D[γ[t, p], t].D[γ[t, p], t]], assume];
                  speedη[t_, p_] = Simplify[Sqrt[D[η[t, p], t].D[η[t, p], t]], assume];
                  Quiet@GraphicsRow[{
                  Plot[Evaluate[Table[speedγ[t, 2^-k], {k, 0, 10}]], {t, 0, Pi/2},
                  PlotLabel -> "Speed of γ",
                  PlotRange -> {0, 10}
                  ],
                  Plot[Evaluate[Table[speedη[t, 2^-k], {k, 0, 10}]], {t, 0, Pi/2},
                  PlotLabel -> "Speed of η",
                  PlotRange -> {0, 10}
                  ]
                  },
                  ImageSize -> Large
                  ]


                  enter image description here



                  Whit this parameterization, one can also employ NIntegrate to compute the arclength, at least for not too small p.



                  NIntegrate[speedη[t, 1/1000], {t, 0, Pi/2}]



                  2.







                  share|improve this answer











                  $endgroup$



                  I can only provide an alternative to bypass ArcLength.



                  The points pts of a quarter circle are scaled such that they lie on the desired curve; afterwards the length of the polygonal line is computed.



                  You will still get problems for values of p very close to 0, but at least you may obtain a qualitatively correct plot (so I hope).



                  Certainly this method won't provide you with the best possible accuracy. The relative error between the arclength $ell$ of an arc and the length $s$ of a secant is roughly $|ell/s - 1| leq ell^2 , max(|kappa|)$ in the limit of $ell to 0$. Here $kappa$ denotes the curvature of the curve. Since the maximal curvature of the curve goes to $infty$ for $p to infty$, the quality of this approximation will reduce significantly for $p to 0$.



                  n = 10000;
                  pts = Transpose[{Cos[Subdivide[0., Pi/2, n]], Sin[Subdivide[0., Pi/2, n]]}];
                  L[p_] := With[{x = pts/Power[Dot[(Abs[pts]^(1/p)), {1., 1.}], p]},
                  Total[Sqrt[Dot[Differences[x]^2, {1., 1.}]]]
                  ]
                  Plot[L[p], {p, 0.001, 1}]


                  enter image description here



                  Edit



                  The ratio behind this is that in contrast to the parameterization



                  γ[t_, p_] = {Cos[t]^p, Sin[t]^p};


                  the parameterization



                  η[t_, p_] = {Cos[t], Sin[t]}/ Power[Cos[t]^(1/p) + Sin[t]^(1/p), p];


                  has finite speed which is always helpful for determining the arclength by integration:



                  assume = {p > 0, 0 < t < Pi/2};
                  speedγ[t_, p_] = Simplify[Sqrt[D[γ[t, p], t].D[γ[t, p], t]], assume];
                  speedη[t_, p_] = Simplify[Sqrt[D[η[t, p], t].D[η[t, p], t]], assume];
                  Quiet@GraphicsRow[{
                  Plot[Evaluate[Table[speedγ[t, 2^-k], {k, 0, 10}]], {t, 0, Pi/2},
                  PlotLabel -> "Speed of γ",
                  PlotRange -> {0, 10}
                  ],
                  Plot[Evaluate[Table[speedη[t, 2^-k], {k, 0, 10}]], {t, 0, Pi/2},
                  PlotLabel -> "Speed of η",
                  PlotRange -> {0, 10}
                  ]
                  },
                  ImageSize -> Large
                  ]


                  enter image description here



                  Whit this parameterization, one can also employ NIntegrate to compute the arclength, at least for not too small p.



                  NIntegrate[speedη[t, 1/1000], {t, 0, Pi/2}]



                  2.








                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Mar 16 at 17:14

























                  answered Mar 15 at 21:08









                  Henrik SchumacherHenrik Schumacher

                  57.6k578158




                  57.6k578158























                      3












                      $begingroup$

                      Manipulate[ParametricPlot[{Cos[t]^p, Sin[t]^p}, {t, 0, Pi/2}], {p, 0.01, 1}]


                      gives this plot at $p=0.01$:



                      (An unpreprocessing plot was here.)



                      UPDATE:



                      p = 0.01; ParametricPlot[{Cos[t]^p, Sin[t]^p}, {t, 0, Pi/2}, Axes -> False, Frame -> True, PlotRange -> {{0, 1.1}, {0, 1.1}}]


                      enter image description here



                      So yes, the sides are not shrinking, but Mathematica seems to be missing some of the curve ...



                      ADDITIONAL UPDATE:



                      f[t_][p_] := {Cos[t]^p, Sin[t]^p};
                      p = 0.01;
                      k = 10^6;
                      Show[
                      ListLinePlot[Transpose@f[[Pi]/(2 k) Range[0, k]][p], PlotStyle -> Red],
                      ListPlot[Transpose@f[[Pi]/(2 k) Range[0, k]][p], PlotStyle -> PointSize[Large]],
                      AspectRatio -> 1, Frame -> True, Axes -> False
                      ]


                      If we sample $t$ with one million equally spaced points, there are big jumps to the first and the last point!



                      enter image description here



                      Plot[f[10^-q][.01][[2]], {q, 0, 100}, Frame -> True, Axes -> False, FrameLabel -> {"-Log10[t]", "f[[2]]"}]


                      This plot shows that we need $t le 10^{-100}$ for the $y$-value of the curve to be less than $approx 0.1$ when $p=.01$.



                      enter image description here






                      share|improve this answer











                      $endgroup$













                      • $begingroup$
                        >but the sides are shrinking. Not really. Check your plotrange
                        $endgroup$
                        – Ivan
                        Mar 15 at 20:54








                      • 2




                        $begingroup$
                        No, not that desperate ... By the way, you guys are tough! Imagine a classroom where a student gives an answer/suggestion that is not correct. Or a collaboration with somebody making a mistake. Seems that "Mathematica Stack Exchange" culture does not like people taking risks. May hurt creativity ... But we will have strictly precise, quality answers!!
                        $endgroup$
                        – mjw
                        Mar 15 at 21:12








                      • 2




                        $begingroup$
                        @mjw "Seems that "Mathematica Stack Exchange" culture does not like people taking risks." To the contrary. I was really surprise that posts in this threads were downvoted so quickly. Downvotes on answers are actually very uncommon on this site.
                        $endgroup$
                        – Henrik Schumacher
                        Mar 15 at 21:16






                      • 1




                        $begingroup$
                        @Ivan, yes, point well taken! Could be an artifact. But why is the ArcLength[] returning wrong results? Seems that in both cases Mathematica is undersampling ...
                        $endgroup$
                        – mjw
                        Mar 15 at 21:29








                      • 4




                        $begingroup$
                        A downvote doesn't mean that you're a bad person, it means that someone somewhere didn't find your answer useful. It's an unremarkable, ordinary thing that can be allowed to pass without comment.
                        $endgroup$
                        – hobbs
                        Mar 16 at 4:02
















                      3












                      $begingroup$

                      Manipulate[ParametricPlot[{Cos[t]^p, Sin[t]^p}, {t, 0, Pi/2}], {p, 0.01, 1}]


                      gives this plot at $p=0.01$:



                      (An unpreprocessing plot was here.)



                      UPDATE:



                      p = 0.01; ParametricPlot[{Cos[t]^p, Sin[t]^p}, {t, 0, Pi/2}, Axes -> False, Frame -> True, PlotRange -> {{0, 1.1}, {0, 1.1}}]


                      enter image description here



                      So yes, the sides are not shrinking, but Mathematica seems to be missing some of the curve ...



                      ADDITIONAL UPDATE:



                      f[t_][p_] := {Cos[t]^p, Sin[t]^p};
                      p = 0.01;
                      k = 10^6;
                      Show[
                      ListLinePlot[Transpose@f[[Pi]/(2 k) Range[0, k]][p], PlotStyle -> Red],
                      ListPlot[Transpose@f[[Pi]/(2 k) Range[0, k]][p], PlotStyle -> PointSize[Large]],
                      AspectRatio -> 1, Frame -> True, Axes -> False
                      ]


                      If we sample $t$ with one million equally spaced points, there are big jumps to the first and the last point!



                      enter image description here



                      Plot[f[10^-q][.01][[2]], {q, 0, 100}, Frame -> True, Axes -> False, FrameLabel -> {"-Log10[t]", "f[[2]]"}]


                      This plot shows that we need $t le 10^{-100}$ for the $y$-value of the curve to be less than $approx 0.1$ when $p=.01$.



                      enter image description here






                      share|improve this answer











                      $endgroup$













                      • $begingroup$
                        >but the sides are shrinking. Not really. Check your plotrange
                        $endgroup$
                        – Ivan
                        Mar 15 at 20:54








                      • 2




                        $begingroup$
                        No, not that desperate ... By the way, you guys are tough! Imagine a classroom where a student gives an answer/suggestion that is not correct. Or a collaboration with somebody making a mistake. Seems that "Mathematica Stack Exchange" culture does not like people taking risks. May hurt creativity ... But we will have strictly precise, quality answers!!
                        $endgroup$
                        – mjw
                        Mar 15 at 21:12








                      • 2




                        $begingroup$
                        @mjw "Seems that "Mathematica Stack Exchange" culture does not like people taking risks." To the contrary. I was really surprise that posts in this threads were downvoted so quickly. Downvotes on answers are actually very uncommon on this site.
                        $endgroup$
                        – Henrik Schumacher
                        Mar 15 at 21:16






                      • 1




                        $begingroup$
                        @Ivan, yes, point well taken! Could be an artifact. But why is the ArcLength[] returning wrong results? Seems that in both cases Mathematica is undersampling ...
                        $endgroup$
                        – mjw
                        Mar 15 at 21:29








                      • 4




                        $begingroup$
                        A downvote doesn't mean that you're a bad person, it means that someone somewhere didn't find your answer useful. It's an unremarkable, ordinary thing that can be allowed to pass without comment.
                        $endgroup$
                        – hobbs
                        Mar 16 at 4:02














                      3












                      3








                      3





                      $begingroup$

                      Manipulate[ParametricPlot[{Cos[t]^p, Sin[t]^p}, {t, 0, Pi/2}], {p, 0.01, 1}]


                      gives this plot at $p=0.01$:



                      (An unpreprocessing plot was here.)



                      UPDATE:



                      p = 0.01; ParametricPlot[{Cos[t]^p, Sin[t]^p}, {t, 0, Pi/2}, Axes -> False, Frame -> True, PlotRange -> {{0, 1.1}, {0, 1.1}}]


                      enter image description here



                      So yes, the sides are not shrinking, but Mathematica seems to be missing some of the curve ...



                      ADDITIONAL UPDATE:



                      f[t_][p_] := {Cos[t]^p, Sin[t]^p};
                      p = 0.01;
                      k = 10^6;
                      Show[
                      ListLinePlot[Transpose@f[[Pi]/(2 k) Range[0, k]][p], PlotStyle -> Red],
                      ListPlot[Transpose@f[[Pi]/(2 k) Range[0, k]][p], PlotStyle -> PointSize[Large]],
                      AspectRatio -> 1, Frame -> True, Axes -> False
                      ]


                      If we sample $t$ with one million equally spaced points, there are big jumps to the first and the last point!



                      enter image description here



                      Plot[f[10^-q][.01][[2]], {q, 0, 100}, Frame -> True, Axes -> False, FrameLabel -> {"-Log10[t]", "f[[2]]"}]


                      This plot shows that we need $t le 10^{-100}$ for the $y$-value of the curve to be less than $approx 0.1$ when $p=.01$.



                      enter image description here






                      share|improve this answer











                      $endgroup$



                      Manipulate[ParametricPlot[{Cos[t]^p, Sin[t]^p}, {t, 0, Pi/2}], {p, 0.01, 1}]


                      gives this plot at $p=0.01$:



                      (An unpreprocessing plot was here.)



                      UPDATE:



                      p = 0.01; ParametricPlot[{Cos[t]^p, Sin[t]^p}, {t, 0, Pi/2}, Axes -> False, Frame -> True, PlotRange -> {{0, 1.1}, {0, 1.1}}]


                      enter image description here



                      So yes, the sides are not shrinking, but Mathematica seems to be missing some of the curve ...



                      ADDITIONAL UPDATE:



                      f[t_][p_] := {Cos[t]^p, Sin[t]^p};
                      p = 0.01;
                      k = 10^6;
                      Show[
                      ListLinePlot[Transpose@f[[Pi]/(2 k) Range[0, k]][p], PlotStyle -> Red],
                      ListPlot[Transpose@f[[Pi]/(2 k) Range[0, k]][p], PlotStyle -> PointSize[Large]],
                      AspectRatio -> 1, Frame -> True, Axes -> False
                      ]


                      If we sample $t$ with one million equally spaced points, there are big jumps to the first and the last point!



                      enter image description here



                      Plot[f[10^-q][.01][[2]], {q, 0, 100}, Frame -> True, Axes -> False, FrameLabel -> {"-Log10[t]", "f[[2]]"}]


                      This plot shows that we need $t le 10^{-100}$ for the $y$-value of the curve to be less than $approx 0.1$ when $p=.01$.



                      enter image description here







                      share|improve this answer














                      share|improve this answer



                      share|improve this answer








                      edited Mar 17 at 5:47

























                      answered Mar 15 at 20:53









                      mjwmjw

                      9479




                      9479












                      • $begingroup$
                        >but the sides are shrinking. Not really. Check your plotrange
                        $endgroup$
                        – Ivan
                        Mar 15 at 20:54








                      • 2




                        $begingroup$
                        No, not that desperate ... By the way, you guys are tough! Imagine a classroom where a student gives an answer/suggestion that is not correct. Or a collaboration with somebody making a mistake. Seems that "Mathematica Stack Exchange" culture does not like people taking risks. May hurt creativity ... But we will have strictly precise, quality answers!!
                        $endgroup$
                        – mjw
                        Mar 15 at 21:12








                      • 2




                        $begingroup$
                        @mjw "Seems that "Mathematica Stack Exchange" culture does not like people taking risks." To the contrary. I was really surprise that posts in this threads were downvoted so quickly. Downvotes on answers are actually very uncommon on this site.
                        $endgroup$
                        – Henrik Schumacher
                        Mar 15 at 21:16






                      • 1




                        $begingroup$
                        @Ivan, yes, point well taken! Could be an artifact. But why is the ArcLength[] returning wrong results? Seems that in both cases Mathematica is undersampling ...
                        $endgroup$
                        – mjw
                        Mar 15 at 21:29








                      • 4




                        $begingroup$
                        A downvote doesn't mean that you're a bad person, it means that someone somewhere didn't find your answer useful. It's an unremarkable, ordinary thing that can be allowed to pass without comment.
                        $endgroup$
                        – hobbs
                        Mar 16 at 4:02


















                      • $begingroup$
                        >but the sides are shrinking. Not really. Check your plotrange
                        $endgroup$
                        – Ivan
                        Mar 15 at 20:54








                      • 2




                        $begingroup$
                        No, not that desperate ... By the way, you guys are tough! Imagine a classroom where a student gives an answer/suggestion that is not correct. Or a collaboration with somebody making a mistake. Seems that "Mathematica Stack Exchange" culture does not like people taking risks. May hurt creativity ... But we will have strictly precise, quality answers!!
                        $endgroup$
                        – mjw
                        Mar 15 at 21:12








                      • 2




                        $begingroup$
                        @mjw "Seems that "Mathematica Stack Exchange" culture does not like people taking risks." To the contrary. I was really surprise that posts in this threads were downvoted so quickly. Downvotes on answers are actually very uncommon on this site.
                        $endgroup$
                        – Henrik Schumacher
                        Mar 15 at 21:16






                      • 1




                        $begingroup$
                        @Ivan, yes, point well taken! Could be an artifact. But why is the ArcLength[] returning wrong results? Seems that in both cases Mathematica is undersampling ...
                        $endgroup$
                        – mjw
                        Mar 15 at 21:29








                      • 4




                        $begingroup$
                        A downvote doesn't mean that you're a bad person, it means that someone somewhere didn't find your answer useful. It's an unremarkable, ordinary thing that can be allowed to pass without comment.
                        $endgroup$
                        – hobbs
                        Mar 16 at 4:02
















                      $begingroup$
                      >but the sides are shrinking. Not really. Check your plotrange
                      $endgroup$
                      – Ivan
                      Mar 15 at 20:54






                      $begingroup$
                      >but the sides are shrinking. Not really. Check your plotrange
                      $endgroup$
                      – Ivan
                      Mar 15 at 20:54






                      2




                      2




                      $begingroup$
                      No, not that desperate ... By the way, you guys are tough! Imagine a classroom where a student gives an answer/suggestion that is not correct. Or a collaboration with somebody making a mistake. Seems that "Mathematica Stack Exchange" culture does not like people taking risks. May hurt creativity ... But we will have strictly precise, quality answers!!
                      $endgroup$
                      – mjw
                      Mar 15 at 21:12






                      $begingroup$
                      No, not that desperate ... By the way, you guys are tough! Imagine a classroom where a student gives an answer/suggestion that is not correct. Or a collaboration with somebody making a mistake. Seems that "Mathematica Stack Exchange" culture does not like people taking risks. May hurt creativity ... But we will have strictly precise, quality answers!!
                      $endgroup$
                      – mjw
                      Mar 15 at 21:12






                      2




                      2




                      $begingroup$
                      @mjw "Seems that "Mathematica Stack Exchange" culture does not like people taking risks." To the contrary. I was really surprise that posts in this threads were downvoted so quickly. Downvotes on answers are actually very uncommon on this site.
                      $endgroup$
                      – Henrik Schumacher
                      Mar 15 at 21:16




                      $begingroup$
                      @mjw "Seems that "Mathematica Stack Exchange" culture does not like people taking risks." To the contrary. I was really surprise that posts in this threads were downvoted so quickly. Downvotes on answers are actually very uncommon on this site.
                      $endgroup$
                      – Henrik Schumacher
                      Mar 15 at 21:16




                      1




                      1




                      $begingroup$
                      @Ivan, yes, point well taken! Could be an artifact. But why is the ArcLength[] returning wrong results? Seems that in both cases Mathematica is undersampling ...
                      $endgroup$
                      – mjw
                      Mar 15 at 21:29






                      $begingroup$
                      @Ivan, yes, point well taken! Could be an artifact. But why is the ArcLength[] returning wrong results? Seems that in both cases Mathematica is undersampling ...
                      $endgroup$
                      – mjw
                      Mar 15 at 21:29






                      4




                      4




                      $begingroup$
                      A downvote doesn't mean that you're a bad person, it means that someone somewhere didn't find your answer useful. It's an unremarkable, ordinary thing that can be allowed to pass without comment.
                      $endgroup$
                      – hobbs
                      Mar 16 at 4:02




                      $begingroup$
                      A downvote doesn't mean that you're a bad person, it means that someone somewhere didn't find your answer useful. It's an unremarkable, ordinary thing that can be allowed to pass without comment.
                      $endgroup$
                      – hobbs
                      Mar 16 at 4:02


















                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Mathematica Stack Exchange!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      Use MathJax to format equations. MathJax reference.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f193346%2funexpected-result-from-arclength%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      is 'sed' thread safeWhat should someone know about using Python scripts in the shell?Nexenta bash script uses...

                      How do i solve the “ No module named 'mlxtend' ” issue on Jupyter?

                      Pilgersdorf Inhaltsverzeichnis Geografie | Geschichte | Bevölkerungsentwicklung | Politik | Kultur...