Unexpected result from ArcLengthDetermining 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

Official degrees of earth’s rotation per day

Declaring defaulted assignment operator as constexpr: which compiler is right?

Gravity magic - How does it work?

Are there other languages, besides English, where the indefinite (or definite) article varies based on sound?

Are all passive ability checks floors for active ability checks?

How to use deus ex machina safely?

What exactly is this small puffer fish doing and how did it manage to accomplish such a feat?

Use void Apex method in Lightning Web Component

Logical notation

Welcoming 2019 Pi day: How to draw the letter π?

Life insurance that covers only simultaneous/dual deaths

Site Collection Administrator has left the building

Is it true that good novels will automatically sell themselves on Amazon (and so on) and there is no need for one to waste time promoting?

Opacity of an object in 2.8

Can I use USB data pins as power source

Why is the BSI not using powers of two?

how to write formula in word in latex

Why do Australian milk farmers need to protest supermarkets' milk price?

What should tie a collection of short-stories together?

How to create the Curved texte?

How can I track script which gives me "command not found" right after the login?

Hacking a Safe Lock after 3 tries

The difference between「N分で」and「後N分で」

Look at your watch and tell me what time is it. vs Look at your watch and tell me what time it is



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













2












$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
    1 hour ago











  • $begingroup$
    @MarcoB I don't get any warnings when evaluating L[1/100]
    $endgroup$
    – Ivan
    1 hour ago















2












$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
    1 hour ago











  • $begingroup$
    @MarcoB I don't get any warnings when evaluating L[1/100]
    $endgroup$
    – Ivan
    1 hour ago













2












2








2





$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 1 hour ago









Henrik Schumacher

56.6k577156




56.6k577156










asked 1 hour ago









IvanIvan

1,612821




1,612821







  • 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
    1 hour ago











  • $begingroup$
    @MarcoB I don't get any warnings when evaluating L[1/100]
    $endgroup$
    – Ivan
    1 hour ago












  • 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
    1 hour ago











  • $begingroup$
    @MarcoB I don't get any warnings when evaluating L[1/100]
    $endgroup$
    – Ivan
    1 hour ago







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
1 hour ago





$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
1 hour ago













$begingroup$
@MarcoB I don't get any warnings when evaluating L[1/100]
$endgroup$
– Ivan
1 hour ago




$begingroup$
@MarcoB I don't get any warnings when evaluating L[1/100]
$endgroup$
– Ivan
1 hour ago










3 Answers
3






active

oldest

votes


















2












$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.)



Yes, looks to be approaching two sides of a square, but the sides are shrinking!



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 ...






share|improve this answer











$endgroup$












  • $begingroup$
    >but the sides are shrinking. Not really. Check your plotrange
    $endgroup$
    – Ivan
    1 hour ago











  • $begingroup$
    Yes, but this does not seem to answer the OP's question. Try including smaller values of $p$.
    $endgroup$
    – MarcoB
    1 hour ago






  • 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
    1 hour ago







  • 1




    $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
    1 hour ago






  • 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
    1 hour ago



















2












$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$. Since the maximal curvature in of 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






share|improve this answer











$endgroup$




















    2












    $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$












      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









      2












      $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.)



      Yes, looks to be approaching two sides of a square, but the sides are shrinking!



      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 ...






      share|improve this answer











      $endgroup$












      • $begingroup$
        >but the sides are shrinking. Not really. Check your plotrange
        $endgroup$
        – Ivan
        1 hour ago











      • $begingroup$
        Yes, but this does not seem to answer the OP's question. Try including smaller values of $p$.
        $endgroup$
        – MarcoB
        1 hour ago






      • 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
        1 hour ago







      • 1




        $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
        1 hour ago






      • 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
        1 hour ago
















      2












      $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.)



      Yes, looks to be approaching two sides of a square, but the sides are shrinking!



      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 ...






      share|improve this answer











      $endgroup$












      • $begingroup$
        >but the sides are shrinking. Not really. Check your plotrange
        $endgroup$
        – Ivan
        1 hour ago











      • $begingroup$
        Yes, but this does not seem to answer the OP's question. Try including smaller values of $p$.
        $endgroup$
        – MarcoB
        1 hour ago






      • 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
        1 hour ago







      • 1




        $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
        1 hour ago






      • 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
        1 hour ago














      2












      2








      2





      $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.)



      Yes, looks to be approaching two sides of a square, but the sides are shrinking!



      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 ...






      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.)



      Yes, looks to be approaching two sides of a square, but the sides are shrinking!



      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 ...







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited 1 hour ago

























      answered 1 hour ago









      mjwmjw

      5779




      5779











      • $begingroup$
        >but the sides are shrinking. Not really. Check your plotrange
        $endgroup$
        – Ivan
        1 hour ago











      • $begingroup$
        Yes, but this does not seem to answer the OP's question. Try including smaller values of $p$.
        $endgroup$
        – MarcoB
        1 hour ago






      • 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
        1 hour ago







      • 1




        $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
        1 hour ago






      • 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
        1 hour ago

















      • $begingroup$
        >but the sides are shrinking. Not really. Check your plotrange
        $endgroup$
        – Ivan
        1 hour ago











      • $begingroup$
        Yes, but this does not seem to answer the OP's question. Try including smaller values of $p$.
        $endgroup$
        – MarcoB
        1 hour ago






      • 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
        1 hour ago







      • 1




        $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
        1 hour ago






      • 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
        1 hour ago
















      $begingroup$
      >but the sides are shrinking. Not really. Check your plotrange
      $endgroup$
      – Ivan
      1 hour ago





      $begingroup$
      >but the sides are shrinking. Not really. Check your plotrange
      $endgroup$
      – Ivan
      1 hour ago













      $begingroup$
      Yes, but this does not seem to answer the OP's question. Try including smaller values of $p$.
      $endgroup$
      – MarcoB
      1 hour ago




      $begingroup$
      Yes, but this does not seem to answer the OP's question. Try including smaller values of $p$.
      $endgroup$
      – MarcoB
      1 hour ago




      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
      1 hour ago





      $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
      1 hour ago





      1




      1




      $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
      1 hour ago




      $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
      1 hour ago




      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
      1 hour ago





      $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
      1 hour ago












      2












      $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$. Since the maximal curvature in of 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






      share|improve this answer











      $endgroup$

















        2












        $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$. Since the maximal curvature in of 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






        share|improve this answer











        $endgroup$















          2












          2








          2





          $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$. Since the maximal curvature in of 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






          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$. Since the maximal curvature in of 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







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 1 hour ago

























          answered 1 hour ago









          Henrik SchumacherHenrik Schumacher

          56.6k577156




          56.6k577156





















              2












              $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$

















                2












                $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$















                  2












                  2








                  2





                  $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 39 mins ago









                  Bill WattsBill Watts

                  3,4811620




                  3,4811620



























                      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

                      Magento 2 duplicate PHPSESSID cookie when using session_start() in custom php scriptMagento 2: User cant logged in into to account page, no error showing!Magento duplicate on subdomainGrabbing storeview from cookie (after using language selector)How do I run php custom script on magento2Magento 2: Include PHP script in headerSession lock after using Cm_RedisSessionscript php to update stockMagento set cookie popupMagento 2 session id cookie - where to find it?How to import Configurable product from csv with custom attributes using php scriptMagento 2 run custom PHP script

                      Can not update quote_id field of “quote_item” table magento 2Magento 2.1 - We can't remove the item. (Shopping Cart doesnt allow us to remove items before becomes empty)Add value for custom quote item attribute using REST apiREST API endpoint v1/carts/cartId/items always returns error messageCorrect way to save entries to databaseHow to remove all associated quote objects of a customer completelyMagento 2 - Save value from custom input field to quote_itemGet quote_item data using quote id and product id filter in Magento 2How to set additional data to quote_item table from controller in Magento 2?What is the purpose of additional_data column in quote_item table in magento2Set Custom Price to Quote item magento2 from controller

                      How to solve knockout JS error in Magento 2 Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?(Magento2) knockout.js:3012 Uncaught ReferenceError: Unable to process bindingUnable to process binding Knockout.js magento 2Cannot read property `scopeLabel` of undefined on Product Detail PageCan't get Customer Data on frontend in Magento 2Magento2 Order Summary - unable to process bindingKO templates are not loading in Magento 2.1 applicationgetting knockout js error magento 2Product grid not load -— Unable to process binding Knockout.js magento 2Product form not loaded in magento2Uncaught ReferenceError: Unable to process binding “if: function()return (isShowLegend()) ” magento 2